././@PaxHeader0000000000000000000000000000003400000000000011452 xustar000000000000000028 mtime=1696604227.0194156 pycares-4.4.0/0000755000175100001770000000000000000000000013773 5ustar00runnerdocker00000000000000././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604221.0 pycares-4.4.0/ChangeLog0000644000175100001770000001645600000000000015561 0ustar00runnerdocker00000000000000No longer updated. Please check the commits. Version 4.0.0 ============= - doc: uppdate README - core: add support for CAA queries - core: add support for getaddrinfo() - doc: update README - core: add ability to use the system installed c-ares - misc: set version to 4.0.0 - test: remove TTL tests - core: update c-ares and use a submodule - core: drop bundled c-ares version - misc: drop tasks.py Version 3.2.0 ============= - misc: add Python 3.9 classifier - core: drop py3.5 from CI and documentation - ci: run tests in Python 3.9 - ci: fix SDK path in appveyor - ci: fix VS linker in appveyor - ci: update python installer script in appveyor - misc: add compiled windows dll to gitignore - test: skip SOA non-ascii test due to changes in remote host - test: fix broken chunked TXT test due to changes in remote host - test: skip ANY test due to problems with mac - ci: add action to release wheels to PyPi - ci: drop AppVeyor - ci: don't fail fast - ci: stop testing on Travis - test: add generic way to check for a CI - test: relax check - test: try to avoid spurious CI failures - ci: test all platforms on GH actions - ci: build wheels on GH Actions - build: fix build error on macOS - ci: explicitly set Python versions to build wheels for - ci: update cibuildwheel - ci: re-add IDNA test Version 3.1.1 ============= - ffi: new style callbacks Version 3.1.0 ============= - misc: add Python 3.8 classifier - (origin/master, origin/HEAD) build: use Travis to build Python Wheels - ci: use GH Actions to test on macOS - ci: run tests in Python 3.8 too - test: remove no longer valid test - test: remove empty test - errno: return str from errno.strerror - core: fix crash when processing .onion queries - test: fix test_query_txt_multiple_chunked - doc: fix path of _version.py file - core: fix support for ARES_OPT_LOOKUPS option - build: add cygwin support - core: fix struct in6_addr alignment - misc: simplify non-ascii txt test example - core: fix long TXT record with non-ascii bytes - build: remove extra add_include_dir line on linux - build: fix testing manylinux wheels Version 3.0.0 ============= (changes since version 2.x) - core: drop C backend in favor of CFFI - core: drop Python < 3.5 support - core: use None instead of -1 for default values - core: add support for ANY queries - core: automagically encode query names with IDNA - core: add support for ares_search Version 3.0.0b5 =============== - core: add support for ares_search Version 3.0.0b4 =============== - core: give better errors descriptions for AresError - test: add IDNA test using the query() API - cffi: simplify destroying ares channel Version 3.0.0b3 =============== - core: reorganize package - core: automagically encode query names with IDNA Version 3.0.0b2 =============== - errno: fix errorcode dictionary Version 3.0.0b1 =============== - core: add support for ANY queries - cffi: fix memory leak Version 3.0.0b0 =============== - core: drop C backend - core: drop Python < 3.5 support - core: use None instead of -1 for default values - core: set TTL to -1 when we cannot parse it Version 2.4.0 ============= - misc: fix building wheels for unavailable Python versions - test: skip getaddrinfo6 test on Travis - doc: add FreeBSD building instructions - build: fix MinGW build - ci, misc: add support for CPython 3.7 - ci: run on latest PyPy versions on TravisCI - examples: extra examples - ci: fix AppVeyor build - test: fix TXT test - core: fix repr for PTR results Version 2.3.0 ============= - core: fix CPython implementation TTL parsing issue - core: add ability to make queries using the command line - core: fix parsing TXT records with invalid UTF-8 chars - deps: removed unneeded c-ares files - core: update bundled c-ares to 1.13.0 - ci: fix PyPy in Travis Version 2.2.0 ============= - test: fix CNAME test - core: parse TTL in PTR replies - core: parse PTR aliases - doc: fix installation instructions in README - doc: fix Channel.set_local_ip documentation - core: accept local_ip and local_dev as kwargs - ci, misc: add support for CPython 3.6 - ci: only run CI on master - ci: disable some Travis notifications - build: add scripts to build manylinux wheels Version 2.1.1 ============= - cffi: fix setting nameserver in Channel.__init__ - doc: update Sphinx configuration so the docs can be built - core: backport fix for CVE-2016-5180 - cffi: fix structure definition - ci: use PyPy 5.4.1 when testing on Travis Version 2.1.0 ============= - core: fix parsing chunked TXT records Version 2.0.1 ============= - core: fix importing from errno submodule Version 2.0.0 ============= - doc: fix rst syntax in README - sample: fix correctly setting events mask - setup.py: mark as executable and add shebang - tests.py: assertions moved out of cb so C code cannot discard - tests.py: test reverse_address on IPv6 also - tests.py: ensure all query results have proper and bound type - pycares.c: register result struct-sequences in pycares namespace - ci: run tests with PyPy as well - ci: run tests on CPython 3.5 on Travis - test: moved test file to tests/tests.py - test: add Python 3.5 to tox.ini - ci: use PyPy 5 in Travis CI - build: refactor building bundled c-ares - ci: add Python 3.5 to AppVeyor - core: reorganize package - core: add CFFI core implementation - cffi: fix OSX support - cffi: fixup FreeBSD support - doc: MinGW support got axed - doc: update supported Python versions - core: update bundled c-ares to 9642b57 Version 1.0.0 ============= - build: fix build on Windows with Python - channel: return TTL information - channel:don't unnecessarily create a list for CNAME results - core: use inet_pton instead of inet_addr - channel: simplify PTR response handling - channel: make al queries return namedtuple-like objects - build: use setuptools - ci: add appveyor integration - build: enable verbose output when building c-ares - build: fix 64-bit build on Windows - build: drop support for older Python versions - doc: update documentation Version 0.7.0 ============= - setup: Fix decoding in non-UTF-8 environments - build: updated Travis build process - Add rotate option - Update documentation Version 0.6.3 ============= - Fix crash if ares_timeout returns NULL - Fix initializing channel with float timeouts < 1 Version 0.6.2 ============= - Fix crash due to a refcount bug Version 0.6.1 ============= - Raise ValueError if query type is not valid - Re-enabled CNAME test - Fixed importing from errno submodule in Python 3 Version 0.6.0 ============= - Added asyncio integration example - Added event loop integration documantation - Mention Python 3.4 support - Fixed setup_cares.py to properly work with Python 3 - Fix build on BSD systems Version 0.5.0 ============= - Updated to c-ares 1.10.0 Version 0.4.0 ============= - Added support for compiling with Microsoft Visual Studio - Added socket_send_buffer_size, socket_receive_buffer_size, lookups and domains init options - Unified set_local_ip* functions Version 0.3.0 ============= - Simplified gethostbyaddr interface - Added reverse_address method - Added PTR query support - Fixed pyuv resolver example Version 0.2.0 ============= - Fixed checking port number boundaries - Refactored unicode support - Encode given hostnames with idna encoding for gethostbyname and query Version 0.1.0 ============= - Initial release ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604221.0 pycares-4.4.0/LICENSE0000644000175100001770000000205600000000000015003 0ustar00runnerdocker00000000000000Copyright (C) 2012 by Saúl Ibarra Corretgé Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 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. ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604221.0 pycares-4.4.0/MANIFEST.in0000644000175100001770000000043200000000000015530 0ustar00runnerdocker00000000000000include README.rst PYPIREADME.rst LICENSE ChangeLog include setup.py setup_cares.py tox.ini graft docs graft examples graft tests graft deps graft src recursive-exclude * __pycache__ recursive-exclude * *.py[co] recursive-exclude * *.[ao] recursive-exclude * *.so prune docs/_build ././@PaxHeader0000000000000000000000000000003400000000000011452 xustar000000000000000028 mtime=1696604227.0194156 pycares-4.4.0/PKG-INFO0000644000175100001770000001151500000000000015073 0ustar00runnerdocker00000000000000Metadata-Version: 2.1 Name: pycares Version: 4.4.0 Summary: Python interface for c-ares Home-page: http://github.com/saghul/pycares Author: Saúl Ibarra Corretgé Author-email: s@saghul.net License: MIT Description: Looking for new maintainers =========================== https://github.com/saghul/pycares/issues/139 pycares: Python interface for c-ares ==================================== pycares is a Python module which provides an interface to c-ares. `c-ares `_ is a C library that performs DNS requests and name resolutions asynchronously. Documentation ------------- http://readthedocs.org/docs/pycares/ Bundled c-ares -------------- pycares currently bundles c-ares as a submodule for ease of building. Using the system provided c-ares is possible if the ``PYCARES_USE_SYSTEM_LIB`` environment variable is set to ``1`` when building. NOTE: Versions prior to 4.0.0 used to embed a modified c-ares with extended TTL support. That is no longer the case and as a result only A and AAAA records will have TTL information. Follow this PR in uppstream c-ares, looks like TTLs will be added: https://github.com/c-ares/c-ares/pull/393 Installation ------------ GNU/Linux, macOS, Windows, others: :: pip install pycares FreeBSD: :: cd /usr/ports/dns/py-pycares && make install IDNA 2008 support ^^^^^^^^^^^^^^^^^ If the ``idna`` package is installed, pycares will support IDNA 2008 encoding otherwise the builtin idna codec will be used, which provides IDNA 2003 support. You can force this at installation time as follows: :: pip install pycares[idna] Running the test suite ---------------------- From the top level directory, run: ``python -m unittest -v`` NOTE: Running the tests requires internet access and are somewhat environment sensitive because real DNS quesries are made, there is no mocking. If you observe a failure that the CI cannot reproduce, please try to setup an environment as close as the current CI. Using it from the cli, a la dig ------------------------------- This module can be used directly from the command line in a similar fashion to dig (limited, of course): :: $ python -m pycares google.com ;; QUESTION SECTION: ;google.com IN A ;; ANSWER SECTION: google.com 300 IN A 172.217.17.142 $ python -m pycares mx google.com ;; QUESTION SECTION: ;google.com IN MX ;; ANSWER SECTION: google.com 600 IN MX 50 alt4.aspmx.l.google.com google.com 600 IN MX 10 aspmx.l.google.com google.com 600 IN MX 40 alt3.aspmx.l.google.com google.com 600 IN MX 20 alt1.aspmx.l.google.com google.com 600 IN MX 30 alt2.aspmx.l.google.com Author ------ Saúl Ibarra Corretgé License ------- Unless stated otherwise on-file pycares uses the MIT license, check LICENSE file. Supported Python versions ------------------------- Python >= 3.8 are supported. Both CPython and PyPy are supported. Contributing ------------ If you'd like to contribute, fork the project, make a patch and send a pull request. Have a look at the surrounding code and please, make yours look alike :-) Platform: POSIX Platform: Microsoft Windows Classifier: Development Status :: 5 - Production/Stable Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: MIT License Classifier: Operating System :: POSIX Classifier: Operating System :: Microsoft :: Windows Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: 3.9 Classifier: Programming Language :: Python :: 3.10 Classifier: Programming Language :: Python :: 3.11 Classifier: Programming Language :: Python :: 3.12 Classifier: Programming Language :: Python :: Implementation :: CPython Classifier: Programming Language :: Python :: Implementation :: PyPy Requires-Python: >=3.8 Description-Content-Type: text/x-rst Provides-Extra: idna ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604221.0 pycares-4.4.0/PYPIREADME.rst0000644000175100001770000000554000000000000016170 0ustar00runnerdocker00000000000000Looking for new maintainers =========================== https://github.com/saghul/pycares/issues/139 pycares: Python interface for c-ares ==================================== pycares is a Python module which provides an interface to c-ares. `c-ares `_ is a C library that performs DNS requests and name resolutions asynchronously. Documentation ------------- http://readthedocs.org/docs/pycares/ Bundled c-ares -------------- pycares currently bundles c-ares as a submodule for ease of building. Using the system provided c-ares is possible if the ``PYCARES_USE_SYSTEM_LIB`` environment variable is set to ``1`` when building. NOTE: Versions prior to 4.0.0 used to embed a modified c-ares with extended TTL support. That is no longer the case and as a result only A and AAAA records will have TTL information. Follow this PR in uppstream c-ares, looks like TTLs will be added: https://github.com/c-ares/c-ares/pull/393 Installation ------------ GNU/Linux, macOS, Windows, others: :: pip install pycares FreeBSD: :: cd /usr/ports/dns/py-pycares && make install IDNA 2008 support ^^^^^^^^^^^^^^^^^ If the ``idna`` package is installed, pycares will support IDNA 2008 encoding otherwise the builtin idna codec will be used, which provides IDNA 2003 support. You can force this at installation time as follows: :: pip install pycares[idna] Running the test suite ---------------------- From the top level directory, run: ``python -m unittest -v`` NOTE: Running the tests requires internet access and are somewhat environment sensitive because real DNS quesries are made, there is no mocking. If you observe a failure that the CI cannot reproduce, please try to setup an environment as close as the current CI. Using it from the cli, a la dig ------------------------------- This module can be used directly from the command line in a similar fashion to dig (limited, of course): :: $ python -m pycares google.com ;; QUESTION SECTION: ;google.com IN A ;; ANSWER SECTION: google.com 300 IN A 172.217.17.142 $ python -m pycares mx google.com ;; QUESTION SECTION: ;google.com IN MX ;; ANSWER SECTION: google.com 600 IN MX 50 alt4.aspmx.l.google.com google.com 600 IN MX 10 aspmx.l.google.com google.com 600 IN MX 40 alt3.aspmx.l.google.com google.com 600 IN MX 20 alt1.aspmx.l.google.com google.com 600 IN MX 30 alt2.aspmx.l.google.com Author ------ Saúl Ibarra Corretgé License ------- Unless stated otherwise on-file pycares uses the MIT license, check LICENSE file. Supported Python versions ------------------------- Python >= 3.8 are supported. Both CPython and PyPy are supported. Contributing ------------ If you'd like to contribute, fork the project, make a patch and send a pull request. Have a look at the surrounding code and please, make yours look alike :-) ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604221.0 pycares-4.4.0/README.rst0000644000175100001770000000607600000000000015473 0ustar00runnerdocker00000000000000Looking for new maintainers =========================== https://github.com/saghul/pycares/issues/139 pycares: Python interface for c-ares ==================================== .. image:: https://badge.fury.io/py/pycares.png :target: https://pypi.org/project/pycares/ .. image:: https://github.com/saghul/pycares/workflows/Test/badge.svg :target: https://github.com/saghul/pycares/actions pycares is a Python module which provides an interface to c-ares. `c-ares `_ is a C library that performs DNS requests and name resolutions asynchronously. Documentation ------------- http://readthedocs.org/docs/pycares/ Bundled c-ares -------------- pycares currently bundles c-ares as a submodule for ease of building. Using the system provided c-ares is possible if the ``PYCARES_USE_SYSTEM_LIB`` environment variable is set to ``1`` when building. NOTE: Versions prior to 4.0.0 used to embed a modified c-ares with extended TTL support. That is no longer the case and as a result only A and AAAA records will have TTL information. Follow this PR in uppstream c-ares, looks like TTLs will be added: https://github.com/c-ares/c-ares/pull/393 Installation ------------ GNU/Linux, macOS, Windows, others: :: pip install pycares FreeBSD: :: cd /usr/ports/dns/py-pycares && make install IDNA 2008 support ^^^^^^^^^^^^^^^^^ If the ``idna`` package is installed, pycares will support IDNA 2008 encoding otherwise the builtin idna codec will be used, which provides IDNA 2003 support. You can force this at installation time as follows: :: pip install pycares[idna] Running the test suite ---------------------- From the top level directory, run: ``python -m unittest -v`` NOTE: Running the tests requires internet access and are somewhat environment sensitive because real DNS quesries are made, there is no mocking. If you observe a failure that the CI cannot reproduce, please try to setup an environment as close as the current CI. Using it from the cli, a la dig ------------------------------- This module can be used directly from the command line in a similar fashion to dig (limited, of course): :: $ python -m pycares google.com ;; QUESTION SECTION: ;google.com IN A ;; ANSWER SECTION: google.com 300 IN A 172.217.17.142 $ python -m pycares mx google.com ;; QUESTION SECTION: ;google.com IN MX ;; ANSWER SECTION: google.com 600 IN MX 50 alt4.aspmx.l.google.com google.com 600 IN MX 10 aspmx.l.google.com google.com 600 IN MX 40 alt3.aspmx.l.google.com google.com 600 IN MX 20 alt1.aspmx.l.google.com google.com 600 IN MX 30 alt2.aspmx.l.google.com Author ------ Saúl Ibarra Corretgé License ------- Unless stated otherwise on-file pycares uses the MIT license, check LICENSE file. Supported Python versions ------------------------- Python >= 3.8 are supported. Both CPython and PyPy are supported. Contributing ------------ If you'd like to contribute, fork the project, make a patch and send a pull request. Have a look at the surrounding code and please, make yours look alike :-) ././@PaxHeader0000000000000000000000000000003400000000000011452 xustar000000000000000028 mtime=1696604226.9634144 pycares-4.4.0/deps/0000755000175100001770000000000000000000000014726 5ustar00runnerdocker00000000000000././@PaxHeader0000000000000000000000000000003400000000000011452 xustar000000000000000028 mtime=1696604226.9634144 pycares-4.4.0/deps/build-config/0000755000175100001770000000000000000000000017270 5ustar00runnerdocker00000000000000././@PaxHeader0000000000000000000000000000003400000000000011452 xustar000000000000000028 mtime=1696604226.9674146 pycares-4.4.0/deps/build-config/config_android/0000755000175100001770000000000000000000000022235 5ustar00runnerdocker00000000000000././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604221.0 pycares-4.4.0/deps/build-config/config_android/ares_config.h0000644000175100001770000003453300000000000024675 0ustar00runnerdocker00000000000000/* ares_config.h. Generated from ares_config.h.in by configure. */ /* ares_config.h.in. Generated from configure.ac by autoheader. */ /* Define if building universal (internal helper macro) */ /* #undef AC_APPLE_UNIVERSAL_BUILD */ /* define this if ares is built for a big endian system */ /* #undef ARES_BIG_ENDIAN */ /* when building as static part of libcurl */ /* #undef BUILDING_LIBCURL */ /* Defined for build that exposes internal static functions for testing. */ /* #undef CARES_EXPOSE_STATICS */ /* Defined for build with symbol hiding. */ #define CARES_SYMBOL_HIDING 1 /* Definition to make a library symbol externally visible. */ #define CARES_SYMBOL_SCOPE_EXTERN __attribute__ ((__visibility__ ("default"))) /* the signed version of size_t */ #define CARES_TYPEOF_ARES_SSIZE_T ssize_t /* Use resolver library to configure cares */ /* #undef CARES_USE_LIBRESOLV */ /* if a /etc/inet dir is being used */ /* #undef ETC_INET */ /* Define to the type of arg 2 for gethostname. */ #define GETHOSTNAME_TYPE_ARG2 size_t /* Define to the type qualifier of arg 1 for getnameinfo. */ #define GETNAMEINFO_QUAL_ARG1 const /* Define to the type of arg 1 for getnameinfo. */ #define GETNAMEINFO_TYPE_ARG1 struct sockaddr * /* Define to the type of arg 2 for getnameinfo. */ #define GETNAMEINFO_TYPE_ARG2 socklen_t /* Define to the type of args 4 and 6 for getnameinfo. */ #define GETNAMEINFO_TYPE_ARG46 socklen_t /* Define to the type of arg 7 for getnameinfo. */ #define GETNAMEINFO_TYPE_ARG7 int /* Specifies the number of arguments to getservbyport_r */ #define GETSERVBYPORT_R_ARGS 6 /* Specifies the size of the buffer to pass to getservbyport_r */ #define GETSERVBYPORT_R_BUFSIZE 4096 /* Define to 1 if you have AF_INET6. */ #define HAVE_AF_INET6 1 /* Define to 1 if you have the header file. */ #define HAVE_ARPA_INET_H 1 /* Define to 1 if you have the header file. */ //#define HAVE_ARPA_NAMESER_COMPAT_H 1 /* Define to 1 if you have the header file. */ //#define HAVE_ARPA_NAMESER_H 1 /* Define to 1 if you have the header file. */ #define HAVE_ASSERT_H 1 /* Define to 1 if you have the `bitncmp' function. */ /* #undef HAVE_BITNCMP */ /* Define to 1 if bool is an available type. */ #define HAVE_BOOL_T 1 /* Define to 1 if you have the clock_gettime function and monotonic timer. */ #define HAVE_CLOCK_GETTIME_MONOTONIC 1 /* Define to 1 if you have the closesocket function. */ /* #undef HAVE_CLOSESOCKET */ /* Define to 1 if you have the CloseSocket camel case function. */ /* #undef HAVE_CLOSESOCKET_CAMEL */ /* Define to 1 if you have the connect function. */ #define HAVE_CONNECT 1 /* define if the compiler supports basic C++11 syntax */ #define HAVE_CXX11 1 /* Define to 1 if you have the header file. */ #define HAVE_DLFCN_H 1 /* Define to 1 if you have the header file. */ #define HAVE_ERRNO_H 1 /* Define to 1 if you have the fcntl function. */ #define HAVE_FCNTL 1 /* Define to 1 if you have the header file. */ #define HAVE_FCNTL_H 1 /* Define to 1 if you have a working fcntl O_NONBLOCK function. */ #define HAVE_FCNTL_O_NONBLOCK 1 /* Define to 1 if you have the freeaddrinfo function. */ #define HAVE_FREEADDRINFO 1 /* Define to 1 if you have a working getaddrinfo function. */ #define HAVE_GETADDRINFO 1 /* Define to 1 if the getaddrinfo function is threadsafe. */ #define HAVE_GETADDRINFO_THREADSAFE 1 /* Define to 1 if you have the getenv function. */ #define HAVE_GETENV 1 /* Define to 1 if you have the gethostbyaddr function. */ #define HAVE_GETHOSTBYADDR 1 /* Define to 1 if you have the gethostbyname function. */ #define HAVE_GETHOSTBYNAME 1 /* Define to 1 if you have the gethostname function. */ #define HAVE_GETHOSTNAME 1 /* Define to 1 if you have the getnameinfo function. */ #define HAVE_GETNAMEINFO 1 /* Define to 1 if you have the getservbyport_r function. */ #define HAVE_GETSERVBYPORT_R 1 /* Define to 1 if you have the `gettimeofday' function. */ #define HAVE_GETTIMEOFDAY 1 /* Define to 1 if you have the `if_indextoname' function. */ #define HAVE_IF_INDEXTONAME 1 /* Define to 1 if you have a IPv6 capable working inet_net_pton function. */ /* #undef HAVE_INET_NET_PTON */ /* Define to 1 if you have a IPv6 capable working inet_ntop function. */ #define HAVE_INET_NTOP 1 /* Define to 1 if you have a IPv6 capable working inet_pton function. */ #define HAVE_INET_PTON 1 /* Define to 1 if you have the header file. */ #define HAVE_INTTYPES_H 1 /* Define to 1 if you have the ioctl function. */ #define HAVE_IOCTL 1 /* Define to 1 if you have the ioctlsocket function. */ /* #undef HAVE_IOCTLSOCKET */ /* Define to 1 if you have the IoctlSocket camel case function. */ /* #undef HAVE_IOCTLSOCKET_CAMEL */ /* Define to 1 if you have a working IoctlSocket camel case FIONBIO function. */ /* #undef HAVE_IOCTLSOCKET_CAMEL_FIONBIO */ /* Define to 1 if you have a working ioctlsocket FIONBIO function. */ /* #undef HAVE_IOCTLSOCKET_FIONBIO */ /* Define to 1 if you have a working ioctl FIONBIO function. */ #define HAVE_IOCTL_FIONBIO 1 /* Define to 1 if you have a working ioctl SIOCGIFADDR function. */ #define HAVE_IOCTL_SIOCGIFADDR 1 /* Define to 1 if you have the `resolve' library (-lresolve). */ /* #undef HAVE_LIBRESOLVE */ /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 /* if your compiler supports LL */ #define HAVE_LL 1 /* Define to 1 if the compiler supports the 'long long' data type. */ #define HAVE_LONGLONG 1 /* Define to 1 if you have the malloc.h header file. */ #define HAVE_MALLOC_H 1 /* Define to 1 if you have the memory.h header file. */ #define HAVE_MEMORY_H 1 /* Define to 1 if you have the MSG_NOSIGNAL flag. */ #define HAVE_MSG_NOSIGNAL 1 /* Define to 1 if you have the header file. */ #define HAVE_NETDB_H 1 /* Define to 1 if you have the header file. */ #define HAVE_NETINET_IN_H 1 /* Define to 1 if you have the header file. */ #define HAVE_NETINET_TCP_H 1 /* Define to 1 if you have the header file. */ #define HAVE_NET_IF_H 1 /* Define to 1 if you have PF_INET6. */ #define HAVE_PF_INET6 1 /* Define to 1 if you have the recv function. */ #define HAVE_RECV 1 /* Define to 1 if you have the recvfrom function. */ #define HAVE_RECVFROM 1 /* Define to 1 if you have the send function. */ #define HAVE_SEND 1 /* Define to 1 if you have the setsockopt function. */ #define HAVE_SETSOCKOPT 1 /* Define to 1 if you have a working setsockopt SO_NONBLOCK function. */ /* #undef HAVE_SETSOCKOPT_SO_NONBLOCK */ /* Define to 1 if you have the header file. */ #define HAVE_SIGNAL_H 1 /* Define to 1 if sig_atomic_t is an available typedef. */ #define HAVE_SIG_ATOMIC_T 1 /* Define to 1 if sig_atomic_t is already defined as volatile. */ /* #undef HAVE_SIG_ATOMIC_T_VOLATILE */ /* Define to 1 if your struct sockaddr_in6 has sin6_scope_id. */ #define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1 /* Define to 1 if you have the socket function. */ #define HAVE_SOCKET 1 /* Define to 1 if you have the header file. */ /* #undef HAVE_SOCKET_H */ /* Define to 1 if you have the header file. */ #define HAVE_STDBOOL_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STDINT_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STDLIB_H 1 /* Define to 1 if you have the strcasecmp function. */ #define HAVE_STRCASECMP 1 /* Define to 1 if you have the strcmpi function. */ /* #undef HAVE_STRCMPI */ /* Define to 1 if you have the strdup function. */ #define HAVE_STRDUP 1 /* Define to 1 if you have the stricmp function. */ /* #undef HAVE_STRICMP */ /* Define to 1 if you have the header file. */ #define HAVE_STRINGS_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STRING_H 1 /* Define to 1 if you have the strncasecmp function. */ #define HAVE_STRNCASECMP 1 /* Define to 1 if you have the strncmpi function. */ /* #undef HAVE_STRNCMPI */ /* Define to 1 if you have the strnicmp function. */ /* #undef HAVE_STRNICMP */ /* Define to 1 if you have the header file. */ #define HAVE_STROPTS_H 1 /* Define to 1 if you have struct addrinfo. */ #define HAVE_STRUCT_ADDRINFO 1 /* Define to 1 if you have struct in6_addr. */ #define HAVE_STRUCT_IN6_ADDR 1 /* Define to 1 if you have struct sockaddr_in6. */ #define HAVE_STRUCT_SOCKADDR_IN6 1 /* if struct sockaddr_storage is defined */ #define HAVE_STRUCT_SOCKADDR_STORAGE 1 /* Define to 1 if you have the timeval struct. */ #define HAVE_STRUCT_TIMEVAL 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_IOCTL_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_PARAM_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_SELECT_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_SOCKET_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_STAT_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_TIME_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_TYPES_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_UIO_H 1 /* Define to 1 if you have the header file. */ #define HAVE_TIME_H 1 /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 /* Define to 1 if you have the windows.h header file. */ /* #undef HAVE_WINDOWS_H */ /* Define to 1 if you have the winsock2.h header file. */ /* #undef HAVE_WINSOCK2_H */ /* Define to 1 if you have the winsock.h header file. */ /* #undef HAVE_WINSOCK_H */ /* Define to 1 if you have the writev function. */ #define HAVE_WRITEV 1 /* Define to 1 if you have the ws2tcpip.h header file. */ /* #undef HAVE_WS2TCPIP_H */ /* Define to the sub-directory where libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" /* Define to 1 if you need the malloc.h header file even with stdlib.h */ /* #undef NEED_MALLOC_H */ /* Define to 1 if you need the memory.h header file even with stdlib.h */ /* #undef NEED_MEMORY_H */ /* Define to 1 if _REENTRANT preprocessor symbol must be defined. */ /* #undef NEED_REENTRANT */ /* Define to 1 if _THREAD_SAFE preprocessor symbol must be defined. */ /* #undef NEED_THREAD_SAFE */ /* cpu-machine-OS */ #define OS "i686-pc-linux-gnu" /* Name of package */ #define PACKAGE "c-ares" /* Define to the address where bug reports for this package should be sent. */ #define PACKAGE_BUGREPORT "c-ares mailing list: http://cool.haxx.se/mailman/listinfo/c-ares" /* Define to the full name of this package. */ #define PACKAGE_NAME "c-ares" /* Define to the full name and version of this package. */ #define PACKAGE_STRING "c-ares 1.13.0" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "c-ares" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ #define PACKAGE_VERSION "1.13.0" /* a suitable file/device to read random data from */ #define CARES_RANDOM_FILE "/dev/urandom" /* Define to the type qualifier pointed by arg 5 for recvfrom. */ #define RECVFROM_QUAL_ARG5 /* Define to the type of arg 1 for recvfrom. */ #define RECVFROM_TYPE_ARG1 int /* Define to the type pointed by arg 2 for recvfrom. */ #define RECVFROM_TYPE_ARG2 void /* Define to 1 if the type pointed by arg 2 for recvfrom is void. */ #define RECVFROM_TYPE_ARG2_IS_VOID 1 /* Define to the type of arg 3 for recvfrom. */ #define RECVFROM_TYPE_ARG3 size_t /* Define to the type of arg 4 for recvfrom. */ #define RECVFROM_TYPE_ARG4 int /* Define to the type pointed by arg 5 for recvfrom. */ #define RECVFROM_TYPE_ARG5 struct sockaddr /* Define to 1 if the type pointed by arg 5 for recvfrom is void. */ /* #undef RECVFROM_TYPE_ARG5_IS_VOID */ /* Define to the type pointed by arg 6 for recvfrom. */ #define RECVFROM_TYPE_ARG6 socklen_t /* Define to 1 if the type pointed by arg 6 for recvfrom is void. */ /* #undef RECVFROM_TYPE_ARG6_IS_VOID */ /* Define to the function return type for recvfrom. */ #define RECVFROM_TYPE_RETV ssize_t /* Define to the type of arg 1 for recv. */ #define RECV_TYPE_ARG1 int /* Define to the type of arg 2 for recv. */ #define RECV_TYPE_ARG2 void * /* Define to the type of arg 3 for recv. */ #define RECV_TYPE_ARG3 size_t /* Define to the type of arg 4 for recv. */ #define RECV_TYPE_ARG4 int /* Define to the function return type for recv. */ #define RECV_TYPE_RETV ssize_t /* Define as the return type of signal handlers (`int' or `void'). */ #define RETSIGTYPE void /* Define to the type qualifier of arg 2 for send. */ #define SEND_QUAL_ARG2 const /* Define to the type of arg 1 for send. */ #define SEND_TYPE_ARG1 int /* Define to the type of arg 2 for send. */ #define SEND_TYPE_ARG2 void * /* Define to the type of arg 3 for send. */ #define SEND_TYPE_ARG3 size_t /* Define to the type of arg 4 for send. */ #define SEND_TYPE_ARG4 int /* Define to the function return type for send. */ #define SEND_TYPE_RETV ssize_t /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* Define to 1 if you can safely include both and . */ #define TIME_WITH_SYS_TIME 1 /* Define to disable non-blocking sockets. */ /* #undef USE_BLOCKING_SOCKETS */ /* Version number of package */ #define VERSION "1.13.0" /* Define to avoid automatic inclusion of winsock.h */ /* #undef WIN32_LEAN_AND_MEAN */ /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD # if defined __BIG_ENDIAN__ # define WORDS_BIGENDIAN 1 # endif #else # ifndef WORDS_BIGENDIAN /* # undef WORDS_BIGENDIAN */ # endif #endif /* Define to 1 if OS is AIX. */ #ifndef _ALL_SOURCE /* # undef _ALL_SOURCE */ #endif /* Enable large inode numbers on Mac OS X 10.5. */ #ifndef _DARWIN_USE_64_BIT_INODE # define _DARWIN_USE_64_BIT_INODE 1 #endif /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ /* Define for large files, on AIX-style hosts. */ /* #undef _LARGE_FILES */ /* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ /* Type to use in place of in_addr_t when system does not provide it. */ /* #undef in_addr_t */ /* Define to `unsigned int' if does not define. */ /* #undef size_t */ /* the signed version of size_t */ /* #undef ssize_t */ ././@PaxHeader0000000000000000000000000000003400000000000011452 xustar000000000000000028 mtime=1696604226.9674146 pycares-4.4.0/deps/build-config/config_cygwin/0000755000175100001770000000000000000000000022115 5ustar00runnerdocker00000000000000././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604221.0 pycares-4.4.0/deps/build-config/config_cygwin/ares_config.h0000644000175100001770000003502200000000000024547 0ustar00runnerdocker00000000000000/* ares_config.h. Generated from ares_config.h.in by configure. */ /* ares_config.h.in. Generated from configure.ac by autoheader. */ /* Define if building universal (internal helper macro) */ /* #undef AC_APPLE_UNIVERSAL_BUILD */ /* define this if ares is built for a big endian system */ /* #undef ARES_BIG_ENDIAN */ /* when building as static part of libcurl */ /* #undef BUILDING_LIBCURL */ /* when building c-ares library */ /* #undef CARES_BUILDING_LIBRARY */ /* when not building a shared library */ /* #undef CARES_STATICLIB */ /* Define to 1 to enable hiding of library internal symbols. */ #define CARES_SYMBOL_HIDING 1 /* Definition to make a library symbol externally visible. */ #define CARES_SYMBOL_SCOPE_EXTERN __attribute__ ((visibility ("default"))) /* the signed version of size_t */ #define CARES_TYPEOF_ARES_SSIZE_T ssize_t /* if a /etc/inet dir is being used */ /* #undef ETC_INET */ /* Define to the type qualifier of arg 1 for getnameinfo. */ #define GETNAMEINFO_QUAL_ARG1 const /* Define to the type of arg 1 for getnameinfo. */ #define GETNAMEINFO_TYPE_ARG1 struct sockaddr * /* Define to the type of arg 2 for getnameinfo. */ #define GETNAMEINFO_TYPE_ARG2 socklen_t /* Define to the type of args 4 and 6 for getnameinfo. */ #define GETNAMEINFO_TYPE_ARG46 int /* Define to the type of arg 7 for getnameinfo. */ #define GETNAMEINFO_TYPE_ARG7 int /* Specifies the number of arguments to getservbyport_r */ /* #undef GETSERVBYPORT_R_ARGS */ /* Specifies the size of the buffer to pass to getservbyport_r */ /* #undef GETSERVBYPORT_R_BUFSIZE */ /* Define to 1 if you have AF_INET6. */ #define HAVE_AF_INET6 1 /* Define to 1 if you have the header file. */ #define HAVE_ARPA_INET_H 1 /* Define to 1 if you have the header file. */ #define HAVE_ARPA_NAMESER_COMPAT_H 1 /* Define to 1 if you have the header file. */ #define HAVE_ARPA_NAMESER_H 1 /* Define to 1 if you have the header file. */ #define HAVE_ASSERT_H 1 /* Define to 1 if you have the `bitncmp' function. */ /* #undef HAVE_BITNCMP */ /* Define to 1 if bool is an available type. */ #define HAVE_BOOL_T 1 /* Define to 1 if you have the clock_gettime function and monotonic timer. */ /* #undef HAVE_CLOCK_GETTIME_MONOTONIC */ /* Define to 1 if you have the closesocket function. */ /* #undef HAVE_CLOSESOCKET */ /* Define to 1 if you have the CloseSocket camel case function. */ /* #undef HAVE_CLOSESOCKET_CAMEL */ /* Define to 1 if you have the connect function. */ #define HAVE_CONNECT 1 /* Define to 1 if you have the header file. */ #define HAVE_DLFCN_H 1 /* Define to 1 if you have the header file. */ #define HAVE_ERRNO_H 1 /* Define to 1 if you have the fcntl function. */ #define HAVE_FCNTL 1 /* Define to 1 if you have the header file. */ #define HAVE_FCNTL_H 1 /* Define to 1 if you have a working fcntl O_NONBLOCK function. */ #define HAVE_FCNTL_O_NONBLOCK 1 /* Define to 1 if you have the freeaddrinfo function. */ #define HAVE_FREEADDRINFO 1 /* Define to 1 if you have a working getaddrinfo function. */ #define HAVE_GETADDRINFO 1 /* Define to 1 if the getaddrinfo function is threadsafe. */ /* #undef HAVE_GETADDRINFO_THREADSAFE */ /* Define to 1 if you have the gethostbyaddr function. */ #define HAVE_GETHOSTBYADDR 1 /* Define to 1 if you have the gethostbyname function. */ #define HAVE_GETHOSTBYNAME 1 /* Define to 1 if you have the gethostname function. */ #define HAVE_GETHOSTNAME 1 /* Define to 1 if you have the getnameinfo function. */ #define HAVE_GETNAMEINFO 1 /* Define to 1 if you have the getservbyport_r function. */ /* #undef HAVE_GETSERVBYPORT_R */ /* Define to 1 if you have the `gettimeofday' function. */ #define HAVE_GETTIMEOFDAY 1 /* Define to 1 if you have the `if_indextoname' function. */ #define HAVE_IF_INDEXTONAME 1 /* Define to 1 if you have the `inet_net_pton' function. */ /* #undef HAVE_INET_NET_PTON */ /* Define to 1 if inet_net_pton supports IPv6. */ /* #undef HAVE_INET_NET_PTON_IPV6 */ /* Define to 1 if you have a IPv6 capable working inet_ntop function. */ #define HAVE_INET_NTOP 1 /* Define to 1 if you have a IPv6 capable working inet_pton function. */ #define HAVE_INET_PTON 1 /* Define to 1 if you have the header file. */ #define HAVE_INTTYPES_H 1 /* Define to 1 if you have the ioctl function. */ #define HAVE_IOCTL 1 /* Define to 1 if you have the ioctlsocket function. */ /* #undef HAVE_IOCTLSOCKET */ /* Define to 1 if you have the IoctlSocket camel case function. */ /* #undef HAVE_IOCTLSOCKET_CAMEL */ /* Define to 1 if you have a working IoctlSocket camel case FIONBIO function. */ /* #undef HAVE_IOCTLSOCKET_CAMEL_FIONBIO */ /* Define to 1 if you have a working ioctlsocket FIONBIO function. */ /* #undef HAVE_IOCTLSOCKET_FIONBIO */ /* Define to 1 if you have a working ioctl FIONBIO function. */ #define HAVE_IOCTL_FIONBIO 1 /* Define to 1 if you have a working ioctl SIOCGIFADDR function. */ #define HAVE_IOCTL_SIOCGIFADDR 1 /* Define to 1 if you have the `resolve' library (-lresolve). */ /* #undef HAVE_LIBRESOLVE */ /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 /* if your compiler supports LL */ #define HAVE_LL 1 /* Define to 1 if the compiler supports the 'long long' data type. */ #define HAVE_LONGLONG 1 /* Define to 1 if you have the malloc.h header file. */ #define HAVE_MALLOC_H 1 /* Define to 1 if you have the memory.h header file. */ #define HAVE_MEMORY_H 1 /* Define to 1 if you have the MSG_NOSIGNAL flag. */ #define HAVE_MSG_NOSIGNAL 1 /* Define to 1 if you have the header file. */ #define HAVE_NETDB_H 1 /* Define to 1 if you have the header file. */ #define HAVE_NETINET_IN_H 1 /* Define to 1 if you have the header file. */ #define HAVE_NETINET_TCP_H 1 /* Define to 1 if you have the header file. */ #define HAVE_NET_IF_H 1 /* Define to 1 if you have PF_INET6. */ #define HAVE_PF_INET6 1 /* Define to 1 if you have the recv function. */ #define HAVE_RECV 1 /* Define to 1 if you have the recvfrom function. */ #define HAVE_RECVFROM 1 /* Define to 1 if you have the send function. */ #define HAVE_SEND 1 /* Define to 1 if you have the setsockopt function. */ #define HAVE_SETSOCKOPT 1 /* Define to 1 if you have a working setsockopt SO_NONBLOCK function. */ /* #undef HAVE_SETSOCKOPT_SO_NONBLOCK */ /* Define to 1 if you have the header file. */ #define HAVE_SIGNAL_H 1 /* Define to 1 if sig_atomic_t is an available typedef. */ #define HAVE_SIG_ATOMIC_T 1 /* Define to 1 if sig_atomic_t is already defined as volatile. */ /* #undef HAVE_SIG_ATOMIC_T_VOLATILE */ /* Define to 1 if your struct sockaddr_in6 has sin6_scope_id. */ #define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1 /* Define to 1 if you have the socket function. */ #define HAVE_SOCKET 1 /* Define to 1 if you have the header file. */ /* #undef HAVE_SOCKET_H */ /* Define to 1 if you have the header file. */ #define HAVE_STDBOOL_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STDINT_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STDLIB_H 1 /* Define to 1 if you have the strcasecmp function. */ #define HAVE_STRCASECMP 1 /* Define to 1 if you have the strcmpi function. */ /* #undef HAVE_STRCMPI */ /* Define to 1 if you have the strdup function. */ #define HAVE_STRDUP 1 /* Define to 1 if you have the stricmp function. */ /* #undef HAVE_STRICMP */ /* Define to 1 if you have the header file. */ #define HAVE_STRINGS_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STRING_H 1 /* Define to 1 if you have the strncasecmp function. */ #define HAVE_STRNCASECMP 1 /* Define to 1 if you have the strncmpi function. */ /* #undef HAVE_STRNCMPI */ /* Define to 1 if you have the strnicmp function. */ /* #undef HAVE_STRNICMP */ /* Define to 1 if you have the header file. */ /* #undef HAVE_STROPTS_H */ /* Define to 1 if you have struct addrinfo. */ #define HAVE_STRUCT_ADDRINFO 1 /* Define to 1 if you have struct in6_addr. */ #define HAVE_STRUCT_IN6_ADDR 1 /* Define to 1 if you have struct sockaddr_in6. */ #define HAVE_STRUCT_SOCKADDR_IN6 1 /* if struct sockaddr_storage is defined */ #define HAVE_STRUCT_SOCKADDR_STORAGE 1 /* Define to 1 if you have the timeval struct. */ #define HAVE_STRUCT_TIMEVAL 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_IOCTL_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_PARAM_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_SELECT_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_SOCKET_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_STAT_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_TIME_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_TYPES_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_UIO_H 1 /* Define to 1 if you have the header file. */ #define HAVE_TIME_H 1 /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 /* Define to 1 if you have the windows.h header file. */ /* #undef HAVE_WINDOWS_H */ /* Define to 1 if you have the winsock2.h header file. */ /* #undef HAVE_WINSOCK2_H */ /* Define to 1 if you have the winsock.h header file. */ /* #undef HAVE_WINSOCK_H */ /* Define to 1 if you have the writev function. */ #define HAVE_WRITEV 1 /* Define to 1 if you have the ws2tcpip.h header file. */ /* #undef HAVE_WS2TCPIP_H */ /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" /* Define to 1 if you are building a native Windows target. */ /* #undef NATIVE_WINDOWS */ /* Define to 1 if you need the malloc.h header file even with stdlib.h */ /* #undef NEED_MALLOC_H */ /* Define to 1 if you need the memory.h header file even with stdlib.h */ /* #undef NEED_MEMORY_H */ /* Define to 1 if _REENTRANT preprocessor symbol must be defined. */ /* #undef NEED_REENTRANT */ /* Define to 1 if _THREAD_SAFE preprocessor symbol must be defined. */ /* #undef NEED_THREAD_SAFE */ /* Define to 1 if your C compiler doesn't accept -c and -o together. */ /* #undef NO_MINUS_C_MINUS_O */ /* cpu-machine-OS */ #define OS "i686-pc-cygwin" /* Name of package */ #define PACKAGE "c-ares" /* Define to the address where bug reports for this package should be sent. */ #define PACKAGE_BUGREPORT "c-ares mailing list => http://cool.haxx.se/mailman/listinfo/c-ares" /* Define to the full name of this package. */ #define PACKAGE_NAME "c-ares" /* Define to the full name and version of this package. */ #define PACKAGE_STRING "c-ares 1.13.0" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "c-ares" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ #define PACKAGE_VERSION "1.13.0" /* a suitable file/device to read random data from */ #define CARES_RANDOM_FILE "/dev/urandom" /* Define to the type of arg 1 for recvfrom. */ #define RECVFROM_TYPE_ARG1 int /* Define to the type pointed by arg 2 for recvfrom. */ #define RECVFROM_TYPE_ARG2 void /* Define to 1 if the type pointed by arg 2 for recvfrom is void. */ #define RECVFROM_TYPE_ARG2_IS_VOID 1 /* Define to the type of arg 3 for recvfrom. */ #define RECVFROM_TYPE_ARG3 size_t /* Define to the type of arg 4 for recvfrom. */ #define RECVFROM_TYPE_ARG4 int /* Define to the type pointed by arg 5 for recvfrom. */ #define RECVFROM_TYPE_ARG5 struct sockaddr /* Define to 1 if the type pointed by arg 5 for recvfrom is void. */ /* #undef RECVFROM_TYPE_ARG5_IS_VOID */ /* Define to the type pointed by arg 6 for recvfrom. */ #define RECVFROM_TYPE_ARG6 socklen_t /* Define to 1 if the type pointed by arg 6 for recvfrom is void. */ /* #undef RECVFROM_TYPE_ARG6_IS_VOID */ /* Define to the function return type for recvfrom. */ #define RECVFROM_TYPE_RETV int /* Define to the type of arg 1 for recv. */ #define RECV_TYPE_ARG1 int /* Define to the type of arg 2 for recv. */ #define RECV_TYPE_ARG2 void * /* Define to the type of arg 3 for recv. */ #define RECV_TYPE_ARG3 size_t /* Define to the type of arg 4 for recv. */ #define RECV_TYPE_ARG4 int /* Define to the function return type for recv. */ #define RECV_TYPE_RETV int /* Define as the return type of signal handlers (`int' or `void'). */ #define RETSIGTYPE void /* Define to the type qualifier of arg 2 for send. */ #define SEND_QUAL_ARG2 const /* Define to the type of arg 1 for send. */ #define SEND_TYPE_ARG1 int /* Define to the type of arg 2 for send. */ #define SEND_TYPE_ARG2 void * /* Define to the type of arg 3 for send. */ #define SEND_TYPE_ARG3 size_t /* Define to the type of arg 4 for send. */ #define SEND_TYPE_ARG4 int /* Define to the function return type for send. */ #define SEND_TYPE_RETV int /* The size of `int', as computed by sizeof. */ #define SIZEOF_INT 4 /* The size of `long', as computed by sizeof. */ #define SIZEOF_LONG 4 /* The size of `size_t', as computed by sizeof. */ #define SIZEOF_SIZE_T 4 /* The size of `struct in6_addr', as computed by sizeof. */ #define SIZEOF_STRUCT_IN6_ADDR 16 /* The size of `struct in_addr', as computed by sizeof. */ #define SIZEOF_STRUCT_IN_ADDR 4 /* The size of `time_t', as computed by sizeof. */ #define SIZEOF_TIME_T 4 /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* Define to 1 if you can safely include both and . */ #define TIME_WITH_SYS_TIME 1 /* Define to disable non-blocking sockets. */ /* #undef USE_BLOCKING_SOCKETS */ /* Version number of package */ #define VERSION "1.7.1" /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD # if defined __BIG_ENDIAN__ # define WORDS_BIGENDIAN 1 # endif #else # ifndef WORDS_BIGENDIAN /* # undef WORDS_BIGENDIAN */ # endif #endif /* Define to 1 if OS is AIX. */ #ifndef _ALL_SOURCE /* # undef _ALL_SOURCE */ #endif /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ /* Define for large files, on AIX-style hosts. */ /* #undef _LARGE_FILES */ /* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ /* Type to use in place of in_addr_t when system does not provide it. */ /* #undef in_addr_t */ /* Define to `unsigned int' if does not define. */ /* #undef size_t */ /* the signed version of size_t */ /* #undef ssize_t */ #define HAVE_GETENV 1 ././@PaxHeader0000000000000000000000000000003400000000000011452 xustar000000000000000028 mtime=1696604226.9674146 pycares-4.4.0/deps/build-config/config_darwin/0000755000175100001770000000000000000000000022101 5ustar00runnerdocker00000000000000././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604221.0 pycares-4.4.0/deps/build-config/config_darwin/ares_config.h0000644000175100001770000003446500000000000024545 0ustar00runnerdocker00000000000000/* ares_config.h. Generated from ares_config.h.in by configure. */ /* ares_config.h.in. Generated from configure.ac by autoheader. */ /* Define if building universal (internal helper macro) */ /* #undef AC_APPLE_UNIVERSAL_BUILD */ /* define this if ares is built for a big endian system */ /* #undef ARES_BIG_ENDIAN */ /* when building as static part of libcurl */ /* #undef BUILDING_LIBCURL */ /* Defined for build that exposes internal static functions for testing. */ /* #undef CARES_EXPOSE_STATICS */ /* Defined for build with symbol hiding. */ #define CARES_SYMBOL_HIDING 1 /* Definition to make a library symbol externally visible. */ #define CARES_SYMBOL_SCOPE_EXTERN __attribute__ ((__visibility__ ("default"))) /* the signed version of size_t */ #define CARES_TYPEOF_ARES_SSIZE_T ssize_t /* Use resolver library to configure cares */ /* #undef CARES_USE_LIBRESOLV */ /* if a /etc/inet dir is being used */ /* #undef ETC_INET */ /* Define to the type of arg 2 for gethostname. */ #define GETHOSTNAME_TYPE_ARG2 size_t /* Define to the type qualifier of arg 1 for getnameinfo. */ #define GETNAMEINFO_QUAL_ARG1 const /* Define to the type of arg 1 for getnameinfo. */ #define GETNAMEINFO_TYPE_ARG1 struct sockaddr * /* Define to the type of arg 2 for getnameinfo. */ #define GETNAMEINFO_TYPE_ARG2 socklen_t /* Define to the type of args 4 and 6 for getnameinfo. */ #define GETNAMEINFO_TYPE_ARG46 socklen_t /* Define to the type of arg 7 for getnameinfo. */ #define GETNAMEINFO_TYPE_ARG7 int /* Specifies the number of arguments to getservbyport_r */ /* #undef GETSERVBYPORT_R_ARGS */ /* Specifies the size of the buffer to pass to getservbyport_r */ /* #undef GETSERVBYPORT_R_BUFSIZE */ /* Define to 1 if you have AF_INET6. */ #define HAVE_AF_INET6 1 /* Define to 1 if you have the header file. */ #define HAVE_ARPA_INET_H 1 /* Define to 1 if you have the header file. */ #define HAVE_ARPA_NAMESER_COMPAT_H 1 /* Define to 1 if you have the header file. */ #define HAVE_ARPA_NAMESER_H 1 /* Define to 1 if you have the header file. */ #define HAVE_ASSERT_H 1 /* Define to 1 if you have the `bitncmp' function. */ /* #undef HAVE_BITNCMP */ /* Define to 1 if bool is an available type. */ #define HAVE_BOOL_T 1 /* Define to 1 if you have the clock_gettime function and monotonic timer. */ /* #undef HAVE_CLOCK_GETTIME_MONOTONIC */ /* Define to 1 if you have the closesocket function. */ /* #undef HAVE_CLOSESOCKET */ /* Define to 1 if you have the CloseSocket camel case function. */ /* #undef HAVE_CLOSESOCKET_CAMEL */ /* Define to 1 if you have the connect function. */ #define HAVE_CONNECT 1 /* define if the compiler supports basic C++11 syntax */ #define HAVE_CXX11 1 /* Define to 1 if you have the header file. */ #define HAVE_DLFCN_H 1 /* Define to 1 if you have the header file. */ #define HAVE_ERRNO_H 1 /* Define to 1 if you have the fcntl function. */ #define HAVE_FCNTL 1 /* Define to 1 if you have the header file. */ #define HAVE_FCNTL_H 1 /* Define to 1 if you have a working fcntl O_NONBLOCK function. */ #define HAVE_FCNTL_O_NONBLOCK 1 /* Define to 1 if you have the freeaddrinfo function. */ #define HAVE_FREEADDRINFO 1 /* Define to 1 if you have a working getaddrinfo function. */ #define HAVE_GETADDRINFO 1 /* Define to 1 if the getaddrinfo function is threadsafe. */ #define HAVE_GETADDRINFO_THREADSAFE 1 /* Define to 1 if you have the getenv function. */ #define HAVE_GETENV 1 /* Define to 1 if you have the gethostbyaddr function. */ #define HAVE_GETHOSTBYADDR 1 /* Define to 1 if you have the gethostbyname function. */ #define HAVE_GETHOSTBYNAME 1 /* Define to 1 if you have the gethostname function. */ #define HAVE_GETHOSTNAME 1 /* Define to 1 if you have the getnameinfo function. */ #define HAVE_GETNAMEINFO 1 /* Define to 1 if you have the getservbyport_r function. */ /* #undef HAVE_GETSERVBYPORT_R */ /* Define to 1 if you have the `gettimeofday' function. */ #define HAVE_GETTIMEOFDAY 1 /* Define to 1 if you have the `if_indextoname' function. */ #define HAVE_IF_INDEXTONAME 1 /* Define to 1 if you have a IPv6 capable working inet_net_pton function. */ #define HAVE_INET_NET_PTON 1 /* Define to 1 if you have a IPv6 capable working inet_ntop function. */ #define HAVE_INET_NTOP 1 /* Define to 1 if you have a IPv6 capable working inet_pton function. */ #define HAVE_INET_PTON 1 /* Define to 1 if you have the header file. */ #define HAVE_INTTYPES_H 1 /* Define to 1 if you have the ioctl function. */ #define HAVE_IOCTL 1 /* Define to 1 if you have the ioctlsocket function. */ /* #undef HAVE_IOCTLSOCKET */ /* Define to 1 if you have the IoctlSocket camel case function. */ /* #undef HAVE_IOCTLSOCKET_CAMEL */ /* Define to 1 if you have a working IoctlSocket camel case FIONBIO function. */ /* #undef HAVE_IOCTLSOCKET_CAMEL_FIONBIO */ /* Define to 1 if you have a working ioctlsocket FIONBIO function. */ /* #undef HAVE_IOCTLSOCKET_FIONBIO */ /* Define to 1 if you have a working ioctl FIONBIO function. */ #define HAVE_IOCTL_FIONBIO 1 /* Define to 1 if you have a working ioctl SIOCGIFADDR function. */ #define HAVE_IOCTL_SIOCGIFADDR 1 /* Define to 1 if you have the `resolve' library (-lresolve). */ /* #undef HAVE_LIBRESOLVE */ /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 /* if your compiler supports LL */ #define HAVE_LL 1 /* Define to 1 if the compiler supports the 'long long' data type. */ #define HAVE_LONGLONG 1 /* Define to 1 if you have the malloc.h header file. */ /* #undef HAVE_MALLOC_H */ /* Define to 1 if you have the memory.h header file. */ #define HAVE_MEMORY_H 1 /* Define to 1 if you have the MSG_NOSIGNAL flag. */ /* #undef HAVE_MSG_NOSIGNAL */ /* Define to 1 if you have the header file. */ #define HAVE_NETDB_H 1 /* Define to 1 if you have the header file. */ #define HAVE_NETINET_IN_H 1 /* Define to 1 if you have the header file. */ #define HAVE_NETINET_TCP_H 1 /* Define to 1 if you have the header file. */ #define HAVE_NET_IF_H 1 /* Define to 1 if you have PF_INET6. */ #define HAVE_PF_INET6 1 /* Define to 1 if you have the recv function. */ #define HAVE_RECV 1 /* Define to 1 if you have the recvfrom function. */ #define HAVE_RECVFROM 1 /* Define to 1 if you have the send function. */ #define HAVE_SEND 1 /* Define to 1 if you have the setsockopt function. */ #define HAVE_SETSOCKOPT 1 /* Define to 1 if you have a working setsockopt SO_NONBLOCK function. */ /* #undef HAVE_SETSOCKOPT_SO_NONBLOCK */ /* Define to 1 if you have the header file. */ #define HAVE_SIGNAL_H 1 /* Define to 1 if sig_atomic_t is an available typedef. */ #define HAVE_SIG_ATOMIC_T 1 /* Define to 1 if sig_atomic_t is already defined as volatile. */ /* #undef HAVE_SIG_ATOMIC_T_VOLATILE */ /* Define to 1 if your struct sockaddr_in6 has sin6_scope_id. */ #define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1 /* Define to 1 if you have the socket function. */ #define HAVE_SOCKET 1 /* Define to 1 if you have the header file. */ /* #undef HAVE_SOCKET_H */ /* Define to 1 if you have the header file. */ #define HAVE_STDBOOL_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STDINT_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STDLIB_H 1 /* Define to 1 if you have the strcasecmp function. */ #define HAVE_STRCASECMP 1 /* Define to 1 if you have the strcmpi function. */ /* #undef HAVE_STRCMPI */ /* Define to 1 if you have the strdup function. */ #define HAVE_STRDUP 1 /* Define to 1 if you have the stricmp function. */ /* #undef HAVE_STRICMP */ /* Define to 1 if you have the header file. */ #define HAVE_STRINGS_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STRING_H 1 /* Define to 1 if you have the strncasecmp function. */ #define HAVE_STRNCASECMP 1 /* Define to 1 if you have the strncmpi function. */ /* #undef HAVE_STRNCMPI */ /* Define to 1 if you have the strnicmp function. */ /* #undef HAVE_STRNICMP */ /* Define to 1 if you have the header file. */ /* #undef HAVE_STROPTS_H */ /* Define to 1 if you have struct addrinfo. */ #define HAVE_STRUCT_ADDRINFO 1 /* Define to 1 if you have struct in6_addr. */ #define HAVE_STRUCT_IN6_ADDR 1 /* Define to 1 if you have struct sockaddr_in6. */ #define HAVE_STRUCT_SOCKADDR_IN6 1 /* if struct sockaddr_storage is defined */ #define HAVE_STRUCT_SOCKADDR_STORAGE 1 /* Define to 1 if you have the timeval struct. */ #define HAVE_STRUCT_TIMEVAL 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_IOCTL_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_PARAM_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_SELECT_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_SOCKET_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_STAT_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_TIME_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_TYPES_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_UIO_H 1 /* Define to 1 if you have the header file. */ #define HAVE_TIME_H 1 /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 /* Define to 1 if you have the windows.h header file. */ /* #undef HAVE_WINDOWS_H */ /* Define to 1 if you have the winsock2.h header file. */ /* #undef HAVE_WINSOCK2_H */ /* Define to 1 if you have the winsock.h header file. */ /* #undef HAVE_WINSOCK_H */ /* Define to 1 if you have the writev function. */ #define HAVE_WRITEV 1 /* Define to 1 if you have the ws2tcpip.h header file. */ /* #undef HAVE_WS2TCPIP_H */ /* Define to the sub-directory where libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" /* Define to 1 if you need the malloc.h header file even with stdlib.h */ /* #undef NEED_MALLOC_H */ /* Define to 1 if you need the memory.h header file even with stdlib.h */ /* #undef NEED_MEMORY_H */ /* Define to 1 if _REENTRANT preprocessor symbol must be defined. */ /* #undef NEED_REENTRANT */ /* Define to 1 if _THREAD_SAFE preprocessor symbol must be defined. */ /* #undef NEED_THREAD_SAFE */ /* cpu-machine-OS */ #define OS "x86_64-apple-darwin16.7.0" /* Name of package */ #define PACKAGE "c-ares" /* Define to the address where bug reports for this package should be sent. */ #define PACKAGE_BUGREPORT "c-ares mailing list: http://cool.haxx.se/mailman/listinfo/c-ares" /* Define to the full name of this package. */ #define PACKAGE_NAME "c-ares" /* Define to the full name and version of this package. */ #define PACKAGE_STRING "c-ares 1.13.0" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "c-ares" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ #define PACKAGE_VERSION "1.13.0" /* a suitable file/device to read random data from */ #define CARES_RANDOM_FILE "/dev/urandom" /* Define to the type qualifier pointed by arg 5 for recvfrom. */ #define RECVFROM_QUAL_ARG5 /* Define to the type of arg 1 for recvfrom. */ #define RECVFROM_TYPE_ARG1 int /* Define to the type pointed by arg 2 for recvfrom. */ #define RECVFROM_TYPE_ARG2 void /* Define to 1 if the type pointed by arg 2 for recvfrom is void. */ #define RECVFROM_TYPE_ARG2_IS_VOID 1 /* Define to the type of arg 3 for recvfrom. */ #define RECVFROM_TYPE_ARG3 size_t /* Define to the type of arg 4 for recvfrom. */ #define RECVFROM_TYPE_ARG4 int /* Define to the type pointed by arg 5 for recvfrom. */ #define RECVFROM_TYPE_ARG5 struct sockaddr /* Define to 1 if the type pointed by arg 5 for recvfrom is void. */ /* #undef RECVFROM_TYPE_ARG5_IS_VOID */ /* Define to the type pointed by arg 6 for recvfrom. */ #define RECVFROM_TYPE_ARG6 socklen_t /* Define to 1 if the type pointed by arg 6 for recvfrom is void. */ /* #undef RECVFROM_TYPE_ARG6_IS_VOID */ /* Define to the function return type for recvfrom. */ #define RECVFROM_TYPE_RETV ssize_t /* Define to the type of arg 1 for recv. */ #define RECV_TYPE_ARG1 int /* Define to the type of arg 2 for recv. */ #define RECV_TYPE_ARG2 void * /* Define to the type of arg 3 for recv. */ #define RECV_TYPE_ARG3 size_t /* Define to the type of arg 4 for recv. */ #define RECV_TYPE_ARG4 int /* Define to the function return type for recv. */ #define RECV_TYPE_RETV ssize_t /* Define as the return type of signal handlers (`int' or `void'). */ #define RETSIGTYPE void /* Define to the type qualifier of arg 2 for send. */ #define SEND_QUAL_ARG2 const /* Define to the type of arg 1 for send. */ #define SEND_TYPE_ARG1 int /* Define to the type of arg 2 for send. */ #define SEND_TYPE_ARG2 void * /* Define to the type of arg 3 for send. */ #define SEND_TYPE_ARG3 size_t /* Define to the type of arg 4 for send. */ #define SEND_TYPE_ARG4 int /* Define to the function return type for send. */ #define SEND_TYPE_RETV ssize_t /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* Define to 1 if you can safely include both and . */ #define TIME_WITH_SYS_TIME 1 /* Define to disable non-blocking sockets. */ /* #undef USE_BLOCKING_SOCKETS */ /* Version number of package */ #define VERSION "1.13.0" /* Define to avoid automatic inclusion of winsock.h */ /* #undef WIN32_LEAN_AND_MEAN */ /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD # if defined __BIG_ENDIAN__ # define WORDS_BIGENDIAN 1 # endif #else # ifndef WORDS_BIGENDIAN /* # undef WORDS_BIGENDIAN */ # endif #endif /* Define to 1 if OS is AIX. */ #ifndef _ALL_SOURCE /* # undef _ALL_SOURCE */ #endif /* Enable large inode numbers on Mac OS X 10.5. */ #ifndef _DARWIN_USE_64_BIT_INODE # define _DARWIN_USE_64_BIT_INODE 1 #endif /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ /* Define for large files, on AIX-style hosts. */ /* #undef _LARGE_FILES */ /* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ /* Type to use in place of in_addr_t when system does not provide it. */ /* #undef in_addr_t */ /* Define to `unsigned int' if does not define. */ /* #undef size_t */ ././@PaxHeader0000000000000000000000000000003400000000000011452 xustar000000000000000028 mtime=1696604226.9674146 pycares-4.4.0/deps/build-config/config_freebsd/0000755000175100001770000000000000000000000022227 5ustar00runnerdocker00000000000000././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604221.0 pycares-4.4.0/deps/build-config/config_freebsd/ares_config.h0000644000175100001770000003454000000000000024665 0ustar00runnerdocker00000000000000/* ares_config.h. Generated from ares_config.h.in by configure. */ /* ares_config.h.in. Generated from configure.ac by autoheader. */ /* Define if building universal (internal helper macro) */ /* #undef AC_APPLE_UNIVERSAL_BUILD */ /* define this if ares is built for a big endian system */ /* #undef ARES_BIG_ENDIAN */ /* when building as static part of libcurl */ /* #undef BUILDING_LIBCURL */ /* Defined for build that exposes internal static functions for testing. */ /* #undef CARES_EXPOSE_STATICS */ /* Defined for build with symbol hiding. */ #define CARES_SYMBOL_HIDING 1 /* Definition to make a library symbol externally visible. */ #define CARES_SYMBOL_SCOPE_EXTERN __attribute__ ((__visibility__ ("default"))) /* the signed version of size_t */ #define CARES_TYPEOF_ARES_SSIZE_T ssize_t /* Use resolver library to configure cares */ /* #undef CARES_USE_LIBRESOLV */ /* if a /etc/inet dir is being used */ /* #undef ETC_INET */ /* Define to the type of arg 2 for gethostname. */ #define GETHOSTNAME_TYPE_ARG2 size_t /* Define to the type qualifier of arg 1 for getnameinfo. */ #define GETNAMEINFO_QUAL_ARG1 const /* Define to the type of arg 1 for getnameinfo. */ #define GETNAMEINFO_TYPE_ARG1 struct sockaddr * /* Define to the type of arg 2 for getnameinfo. */ #define GETNAMEINFO_TYPE_ARG2 socklen_t /* Define to the type of args 4 and 6 for getnameinfo. */ #define GETNAMEINFO_TYPE_ARG46 size_t /* Define to the type of arg 7 for getnameinfo. */ #define GETNAMEINFO_TYPE_ARG7 int /* Specifies the number of arguments to getservbyport_r */ #define GETSERVBYPORT_R_ARGS 6 /* Specifies the size of the buffer to pass to getservbyport_r */ #define GETSERVBYPORT_R_BUFSIZE 4096 /* Define to 1 if you have AF_INET6. */ #define HAVE_AF_INET6 1 /* Define to 1 if you have the header file. */ #define HAVE_ARPA_INET_H 1 /* Define to 1 if you have the header file. */ #define HAVE_ARPA_NAMESER_COMPAT_H 1 /* Define to 1 if you have the header file. */ #define HAVE_ARPA_NAMESER_H 1 /* Define to 1 if you have the header file. */ #define HAVE_ASSERT_H 1 /* Define to 1 if you have the `bitncmp' function. */ /* #undef HAVE_BITNCMP */ /* Define to 1 if bool is an available type. */ #define HAVE_BOOL_T 1 /* Define to 1 if you have the clock_gettime function and monotonic timer. */ #define HAVE_CLOCK_GETTIME_MONOTONIC 1 /* Define to 1 if you have the closesocket function. */ /* #undef HAVE_CLOSESOCKET */ /* Define to 1 if you have the CloseSocket camel case function. */ /* #undef HAVE_CLOSESOCKET_CAMEL */ /* Define to 1 if you have the connect function. */ #define HAVE_CONNECT 1 /* define if the compiler supports basic C++11 syntax */ #define HAVE_CXX11 1 /* Define to 1 if you have the header file. */ #define HAVE_DLFCN_H 1 /* Define to 1 if you have the header file. */ #define HAVE_ERRNO_H 1 /* Define to 1 if you have the fcntl function. */ #define HAVE_FCNTL 1 /* Define to 1 if you have the header file. */ #define HAVE_FCNTL_H 1 /* Define to 1 if you have a working fcntl O_NONBLOCK function. */ #define HAVE_FCNTL_O_NONBLOCK 1 /* Define to 1 if you have the freeaddrinfo function. */ #define HAVE_FREEADDRINFO 1 /* Define to 1 if you have a working getaddrinfo function. */ #define HAVE_GETADDRINFO 1 /* Define to 1 if the getaddrinfo function is threadsafe. */ #define HAVE_GETADDRINFO_THREADSAFE 1 /* Define to 1 if you have the getenv function. */ #define HAVE_GETENV 1 /* Define to 1 if you have the gethostbyaddr function. */ #define HAVE_GETHOSTBYADDR 1 /* Define to 1 if you have the gethostbyname function. */ #define HAVE_GETHOSTBYNAME 1 /* Define to 1 if you have the gethostname function. */ #define HAVE_GETHOSTNAME 1 /* Define to 1 if you have the getnameinfo function. */ #define HAVE_GETNAMEINFO 1 /* Define to 1 if you have the getservbyport_r function. */ #define HAVE_GETSERVBYPORT_R 1 /* Define to 1 if you have the `gettimeofday' function. */ #define HAVE_GETTIMEOFDAY 1 /* Define to 1 if you have the `if_indextoname' function. */ #define HAVE_IF_INDEXTONAME 1 /* Define to 1 if you have a IPv6 capable working inet_net_pton function. */ #define HAVE_INET_NET_PTON 1 /* Define to 1 if you have a IPv6 capable working inet_ntop function. */ #define HAVE_INET_NTOP 1 /* Define to 1 if you have a IPv6 capable working inet_pton function. */ #define HAVE_INET_PTON 1 /* Define to 1 if you have the header file. */ #define HAVE_INTTYPES_H 1 /* Define to 1 if you have the ioctl function. */ #define HAVE_IOCTL 1 /* Define to 1 if you have the ioctlsocket function. */ /* #undef HAVE_IOCTLSOCKET */ /* Define to 1 if you have the IoctlSocket camel case function. */ /* #undef HAVE_IOCTLSOCKET_CAMEL */ /* Define to 1 if you have a working IoctlSocket camel case FIONBIO function. */ /* #undef HAVE_IOCTLSOCKET_CAMEL_FIONBIO */ /* Define to 1 if you have a working ioctlsocket FIONBIO function. */ /* #undef HAVE_IOCTLSOCKET_FIONBIO */ /* Define to 1 if you have a working ioctl FIONBIO function. */ #define HAVE_IOCTL_FIONBIO 1 /* Define to 1 if you have a working ioctl SIOCGIFADDR function. */ #define HAVE_IOCTL_SIOCGIFADDR 1 /* Define to 1 if you have the `resolve' library (-lresolve). */ /* #undef HAVE_LIBRESOLVE */ /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 /* if your compiler supports LL */ #define HAVE_LL 1 /* Define to 1 if the compiler supports the 'long long' data type. */ #define HAVE_LONGLONG 1 /* Define to 1 if you have the malloc.h header file. */ /* #undef HAVE_MALLOC_H */ /* Define to 1 if you have the memory.h header file. */ #define HAVE_MEMORY_H 1 /* Define to 1 if you have the MSG_NOSIGNAL flag. */ #define HAVE_MSG_NOSIGNAL 1 /* Define to 1 if you have the header file. */ #define HAVE_NETDB_H 1 /* Define to 1 if you have the header file. */ #define HAVE_NETINET_IN_H 1 /* Define to 1 if you have the header file. */ #define HAVE_NETINET_TCP_H 1 /* Define to 1 if you have the header file. */ #define HAVE_NET_IF_H 1 /* Define to 1 if you have PF_INET6. */ #define HAVE_PF_INET6 1 /* Define to 1 if you have the recv function. */ #define HAVE_RECV 1 /* Define to 1 if you have the recvfrom function. */ #define HAVE_RECVFROM 1 /* Define to 1 if you have the send function. */ #define HAVE_SEND 1 /* Define to 1 if you have the setsockopt function. */ #define HAVE_SETSOCKOPT 1 /* Define to 1 if you have a working setsockopt SO_NONBLOCK function. */ /* #undef HAVE_SETSOCKOPT_SO_NONBLOCK */ /* Define to 1 if you have the header file. */ #define HAVE_SIGNAL_H 1 /* Define to 1 if sig_atomic_t is an available typedef. */ #define HAVE_SIG_ATOMIC_T 1 /* Define to 1 if sig_atomic_t is already defined as volatile. */ /* #undef HAVE_SIG_ATOMIC_T_VOLATILE */ /* Define to 1 if your struct sockaddr_in6 has sin6_scope_id. */ #define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1 /* Define to 1 if you have the socket function. */ #define HAVE_SOCKET 1 /* Define to 1 if you have the header file. */ /* #undef HAVE_SOCKET_H */ /* Define to 1 if you have the header file. */ #define HAVE_STDBOOL_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STDINT_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STDLIB_H 1 /* Define to 1 if you have the strcasecmp function. */ #define HAVE_STRCASECMP 1 /* Define to 1 if you have the strcmpi function. */ /* #undef HAVE_STRCMPI */ /* Define to 1 if you have the strdup function. */ #define HAVE_STRDUP 1 /* Define to 1 if you have the stricmp function. */ /* #undef HAVE_STRICMP */ /* Define to 1 if you have the header file. */ #define HAVE_STRINGS_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STRING_H 1 /* Define to 1 if you have the strncasecmp function. */ #define HAVE_STRNCASECMP 1 /* Define to 1 if you have the strncmpi function. */ /* #undef HAVE_STRNCMPI */ /* Define to 1 if you have the strnicmp function. */ /* #undef HAVE_STRNICMP */ /* Define to 1 if you have the header file. */ /* #undef HAVE_STROPTS_H */ /* Define to 1 if you have struct addrinfo. */ #define HAVE_STRUCT_ADDRINFO 1 /* Define to 1 if you have struct in6_addr. */ #define HAVE_STRUCT_IN6_ADDR 1 /* Define to 1 if you have struct sockaddr_in6. */ #define HAVE_STRUCT_SOCKADDR_IN6 1 /* if struct sockaddr_storage is defined */ #define HAVE_STRUCT_SOCKADDR_STORAGE 1 /* Define to 1 if you have the timeval struct. */ #define HAVE_STRUCT_TIMEVAL 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_IOCTL_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_PARAM_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_SELECT_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_SOCKET_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_STAT_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_TIME_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_TYPES_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_UIO_H 1 /* Define to 1 if you have the header file. */ #define HAVE_TIME_H 1 /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 /* Define to 1 if you have the windows.h header file. */ /* #undef HAVE_WINDOWS_H */ /* Define to 1 if you have the winsock2.h header file. */ /* #undef HAVE_WINSOCK2_H */ /* Define to 1 if you have the winsock.h header file. */ /* #undef HAVE_WINSOCK_H */ /* Define to 1 if you have the writev function. */ #define HAVE_WRITEV 1 /* Define to 1 if you have the ws2tcpip.h header file. */ /* #undef HAVE_WS2TCPIP_H */ /* Define to the sub-directory where libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" /* Define to 1 if you need the malloc.h header file even with stdlib.h */ /* #undef NEED_MALLOC_H */ /* Define to 1 if you need the memory.h header file even with stdlib.h */ /* #undef NEED_MEMORY_H */ /* Define to 1 if _REENTRANT preprocessor symbol must be defined. */ /* #undef NEED_REENTRANT */ /* Define to 1 if _THREAD_SAFE preprocessor symbol must be defined. */ /* #undef NEED_THREAD_SAFE */ /* cpu-machine-OS */ #define OS "x86_64-unknown-freebsd10.3" /* Name of package */ #define PACKAGE "c-ares" /* Define to the address where bug reports for this package should be sent. */ #define PACKAGE_BUGREPORT "c-ares mailing list: http://cool.haxx.se/mailman/listinfo/c-ares" /* Define to the full name of this package. */ #define PACKAGE_NAME "c-ares" /* Define to the full name and version of this package. */ #define PACKAGE_STRING "c-ares 1.13.0" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "c-ares" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ #define PACKAGE_VERSION "1.13.0" /* a suitable file/device to read random data from */ #define CARES_RANDOM_FILE "/dev/urandom" /* Define to the type qualifier pointed by arg 5 for recvfrom. */ #define RECVFROM_QUAL_ARG5 /* Define to the type of arg 1 for recvfrom. */ #define RECVFROM_TYPE_ARG1 int /* Define to the type pointed by arg 2 for recvfrom. */ #define RECVFROM_TYPE_ARG2 void /* Define to 1 if the type pointed by arg 2 for recvfrom is void. */ #define RECVFROM_TYPE_ARG2_IS_VOID 1 /* Define to the type of arg 3 for recvfrom. */ #define RECVFROM_TYPE_ARG3 size_t /* Define to the type of arg 4 for recvfrom. */ #define RECVFROM_TYPE_ARG4 int /* Define to the type pointed by arg 5 for recvfrom. */ #define RECVFROM_TYPE_ARG5 struct sockaddr /* Define to 1 if the type pointed by arg 5 for recvfrom is void. */ /* #undef RECVFROM_TYPE_ARG5_IS_VOID */ /* Define to the type pointed by arg 6 for recvfrom. */ #define RECVFROM_TYPE_ARG6 socklen_t /* Define to 1 if the type pointed by arg 6 for recvfrom is void. */ /* #undef RECVFROM_TYPE_ARG6_IS_VOID */ /* Define to the function return type for recvfrom. */ #define RECVFROM_TYPE_RETV ssize_t /* Define to the type of arg 1 for recv. */ #define RECV_TYPE_ARG1 int /* Define to the type of arg 2 for recv. */ #define RECV_TYPE_ARG2 void * /* Define to the type of arg 3 for recv. */ #define RECV_TYPE_ARG3 size_t /* Define to the type of arg 4 for recv. */ #define RECV_TYPE_ARG4 int /* Define to the function return type for recv. */ #define RECV_TYPE_RETV ssize_t /* Define as the return type of signal handlers (`int' or `void'). */ #define RETSIGTYPE void /* Define to the type qualifier of arg 2 for send. */ #define SEND_QUAL_ARG2 const /* Define to the type of arg 1 for send. */ #define SEND_TYPE_ARG1 int /* Define to the type of arg 2 for send. */ #define SEND_TYPE_ARG2 void * /* Define to the type of arg 3 for send. */ #define SEND_TYPE_ARG3 size_t /* Define to the type of arg 4 for send. */ #define SEND_TYPE_ARG4 int /* Define to the function return type for send. */ #define SEND_TYPE_RETV ssize_t /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* Define to 1 if you can safely include both and . */ #define TIME_WITH_SYS_TIME 1 /* Define to disable non-blocking sockets. */ /* #undef USE_BLOCKING_SOCKETS */ /* Version number of package */ #define VERSION "1.13.0" /* Define to avoid automatic inclusion of winsock.h */ /* #undef WIN32_LEAN_AND_MEAN */ /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD # if defined __BIG_ENDIAN__ # define WORDS_BIGENDIAN 1 # endif #else # ifndef WORDS_BIGENDIAN /* # undef WORDS_BIGENDIAN */ # endif #endif /* Define to 1 if OS is AIX. */ #ifndef _ALL_SOURCE /* # undef _ALL_SOURCE */ #endif /* Enable large inode numbers on Mac OS X 10.5. */ #ifndef _DARWIN_USE_64_BIT_INODE # define _DARWIN_USE_64_BIT_INODE 1 #endif /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ /* Define for large files, on AIX-style hosts. */ /* #undef _LARGE_FILES */ /* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ /* Type to use in place of in_addr_t when system does not provide it. */ /* #undef in_addr_t */ /* Define to `unsigned int' if does not define. */ /* #undef size_t */ /* the signed version of size_t */ /* #undef ssize_t */ ././@PaxHeader0000000000000000000000000000003400000000000011452 xustar000000000000000028 mtime=1696604226.9674146 pycares-4.4.0/deps/build-config/config_linux/0000755000175100001770000000000000000000000021754 5ustar00runnerdocker00000000000000././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604221.0 pycares-4.4.0/deps/build-config/config_linux/ares_config.h0000644000175100001770000003444000000000000024411 0ustar00runnerdocker00000000000000/* ares_config.h. Generated from ares_config.h.in by configure. */ /* ares_config.h.in. Generated from configure.ac by autoheader. */ /* Define if building universal (internal helper macro) */ /* #undef AC_APPLE_UNIVERSAL_BUILD */ /* define this if ares is built for a big endian system */ /* #undef ARES_BIG_ENDIAN */ /* when building as static part of libcurl */ /* #undef BUILDING_LIBCURL */ /* Defined for build that exposes internal static functions for testing. */ /* #undef CARES_EXPOSE_STATICS */ /* Defined for build with symbol hiding. */ #define CARES_SYMBOL_HIDING 1 /* Definition to make a library symbol externally visible. */ #define CARES_SYMBOL_SCOPE_EXTERN __attribute__ ((__visibility__ ("default"))) /* the signed version of size_t */ #define CARES_TYPEOF_ARES_SSIZE_T ssize_t /* Use resolver library to configure cares */ /* #undef CARES_USE_LIBRESOLV */ /* if a /etc/inet dir is being used */ /* #undef ETC_INET */ /* Define to the type of arg 2 for gethostname. */ #define GETHOSTNAME_TYPE_ARG2 size_t /* Define to the type qualifier of arg 1 for getnameinfo. */ #define GETNAMEINFO_QUAL_ARG1 const /* Define to the type of arg 1 for getnameinfo. */ #define GETNAMEINFO_TYPE_ARG1 struct sockaddr * /* Define to the type of arg 2 for getnameinfo. */ #define GETNAMEINFO_TYPE_ARG2 socklen_t /* Define to the type of args 4 and 6 for getnameinfo. */ #define GETNAMEINFO_TYPE_ARG46 socklen_t /* Define to the type of arg 7 for getnameinfo. */ #define GETNAMEINFO_TYPE_ARG7 int /* Specifies the number of arguments to getservbyport_r */ #define GETSERVBYPORT_R_ARGS 6 /* Specifies the size of the buffer to pass to getservbyport_r */ #define GETSERVBYPORT_R_BUFSIZE 4096 /* Define to 1 if you have AF_INET6. */ #define HAVE_AF_INET6 1 /* Define to 1 if you have the header file. */ #define HAVE_ARPA_INET_H 1 /* Define to 1 if you have the header file. */ #define HAVE_ARPA_NAMESER_COMPAT_H 1 /* Define to 1 if you have the header file. */ #define HAVE_ARPA_NAMESER_H 1 /* Define to 1 if you have the header file. */ #define HAVE_ASSERT_H 1 /* Define to 1 if you have the `bitncmp' function. */ /* #undef HAVE_BITNCMP */ /* Define to 1 if bool is an available type. */ #define HAVE_BOOL_T 1 /* Define to 1 if you have the clock_gettime function and monotonic timer. */ #define HAVE_CLOCK_GETTIME_MONOTONIC 1 /* Define to 1 if you have the closesocket function. */ /* #undef HAVE_CLOSESOCKET */ /* Define to 1 if you have the CloseSocket camel case function. */ /* #undef HAVE_CLOSESOCKET_CAMEL */ /* Define to 1 if you have the connect function. */ #define HAVE_CONNECT 1 /* define if the compiler supports basic C++11 syntax */ #define HAVE_CXX11 1 /* Define to 1 if you have the header file. */ #define HAVE_DLFCN_H 1 /* Define to 1 if you have the header file. */ #define HAVE_ERRNO_H 1 /* Define to 1 if you have the fcntl function. */ #define HAVE_FCNTL 1 /* Define to 1 if you have the header file. */ #define HAVE_FCNTL_H 1 /* Define to 1 if you have a working fcntl O_NONBLOCK function. */ #define HAVE_FCNTL_O_NONBLOCK 1 /* Define to 1 if you have the freeaddrinfo function. */ #define HAVE_FREEADDRINFO 1 /* Define to 1 if you have a working getaddrinfo function. */ #define HAVE_GETADDRINFO 1 /* Define to 1 if the getaddrinfo function is threadsafe. */ #define HAVE_GETADDRINFO_THREADSAFE 1 /* Define to 1 if you have the getenv function. */ #define HAVE_GETENV 1 /* Define to 1 if you have the gethostbyaddr function. */ #define HAVE_GETHOSTBYADDR 1 /* Define to 1 if you have the gethostbyname function. */ #define HAVE_GETHOSTBYNAME 1 /* Define to 1 if you have the gethostname function. */ #define HAVE_GETHOSTNAME 1 /* Define to 1 if you have the getnameinfo function. */ #define HAVE_GETNAMEINFO 1 /* Define to 1 if you have the getservbyport_r function. */ #define HAVE_GETSERVBYPORT_R 1 /* Define to 1 if you have the `gettimeofday' function. */ #define HAVE_GETTIMEOFDAY 1 /* Define to 1 if you have the `if_indextoname' function. */ #define HAVE_IF_INDEXTONAME 1 /* Define to 1 if you have a IPv6 capable working inet_net_pton function. */ /* #undef HAVE_INET_NET_PTON */ /* Define to 1 if you have a IPv6 capable working inet_ntop function. */ #define HAVE_INET_NTOP 1 /* Define to 1 if you have a IPv6 capable working inet_pton function. */ #define HAVE_INET_PTON 1 /* Define to 1 if you have the header file. */ #define HAVE_INTTYPES_H 1 /* Define to 1 if you have the ioctl function. */ #define HAVE_IOCTL 1 /* Define to 1 if you have the ioctlsocket function. */ /* #undef HAVE_IOCTLSOCKET */ /* Define to 1 if you have the IoctlSocket camel case function. */ /* #undef HAVE_IOCTLSOCKET_CAMEL */ /* Define to 1 if you have a working IoctlSocket camel case FIONBIO function. */ /* #undef HAVE_IOCTLSOCKET_CAMEL_FIONBIO */ /* Define to 1 if you have a working ioctlsocket FIONBIO function. */ /* #undef HAVE_IOCTLSOCKET_FIONBIO */ /* Define to 1 if you have a working ioctl FIONBIO function. */ #define HAVE_IOCTL_FIONBIO 1 /* Define to 1 if you have a working ioctl SIOCGIFADDR function. */ #define HAVE_IOCTL_SIOCGIFADDR 1 /* Define to 1 if you have the `resolve' library (-lresolve). */ /* #undef HAVE_LIBRESOLVE */ /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 /* if your compiler supports LL */ #define HAVE_LL 1 /* Define to 1 if the compiler supports the 'long long' data type. */ #define HAVE_LONGLONG 1 /* Define to 1 if you have the malloc.h header file. */ #define HAVE_MALLOC_H 1 /* Define to 1 if you have the memory.h header file. */ #define HAVE_MEMORY_H 1 /* Define to 1 if you have the MSG_NOSIGNAL flag. */ #define HAVE_MSG_NOSIGNAL 1 /* Define to 1 if you have the header file. */ #define HAVE_NETDB_H 1 /* Define to 1 if you have the header file. */ #define HAVE_NETINET_IN_H 1 /* Define to 1 if you have the header file. */ #define HAVE_NETINET_TCP_H 1 /* Define to 1 if you have the header file. */ #define HAVE_NET_IF_H 1 /* Define to 1 if you have PF_INET6. */ #define HAVE_PF_INET6 1 /* Define to 1 if you have the recv function. */ #define HAVE_RECV 1 /* Define to 1 if you have the recvfrom function. */ #define HAVE_RECVFROM 1 /* Define to 1 if you have the send function. */ #define HAVE_SEND 1 /* Define to 1 if you have the setsockopt function. */ #define HAVE_SETSOCKOPT 1 /* Define to 1 if you have a working setsockopt SO_NONBLOCK function. */ /* #undef HAVE_SETSOCKOPT_SO_NONBLOCK */ /* Define to 1 if you have the header file. */ #define HAVE_SIGNAL_H 1 /* Define to 1 if sig_atomic_t is an available typedef. */ #define HAVE_SIG_ATOMIC_T 1 /* Define to 1 if sig_atomic_t is already defined as volatile. */ /* #undef HAVE_SIG_ATOMIC_T_VOLATILE */ /* Define to 1 if your struct sockaddr_in6 has sin6_scope_id. */ #define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1 /* Define to 1 if you have the socket function. */ #define HAVE_SOCKET 1 /* Define to 1 if you have the header file. */ /* #undef HAVE_SOCKET_H */ /* Define to 1 if you have the header file. */ #define HAVE_STDBOOL_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STDINT_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STDLIB_H 1 /* Define to 1 if you have the strcasecmp function. */ #define HAVE_STRCASECMP 1 /* Define to 1 if you have the strcmpi function. */ /* #undef HAVE_STRCMPI */ /* Define to 1 if you have the strdup function. */ #define HAVE_STRDUP 1 /* Define to 1 if you have the stricmp function. */ /* #undef HAVE_STRICMP */ /* Define to 1 if you have the header file. */ #define HAVE_STRINGS_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STRING_H 1 /* Define to 1 if you have the strncasecmp function. */ #define HAVE_STRNCASECMP 1 /* Define to 1 if you have the strncmpi function. */ /* #undef HAVE_STRNCMPI */ /* Define to 1 if you have the strnicmp function. */ /* #undef HAVE_STRNICMP */ /* Define to 1 if you have the header file. */ #define HAVE_STROPTS_H 1 /* Define to 1 if you have struct addrinfo. */ #define HAVE_STRUCT_ADDRINFO 1 /* Define to 1 if you have struct in6_addr. */ #define HAVE_STRUCT_IN6_ADDR 1 /* Define to 1 if you have struct sockaddr_in6. */ #define HAVE_STRUCT_SOCKADDR_IN6 1 /* if struct sockaddr_storage is defined */ #define HAVE_STRUCT_SOCKADDR_STORAGE 1 /* Define to 1 if you have the timeval struct. */ #define HAVE_STRUCT_TIMEVAL 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_IOCTL_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_PARAM_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_SELECT_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_SOCKET_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_STAT_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_TIME_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_TYPES_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_UIO_H 1 /* Define to 1 if you have the header file. */ #define HAVE_TIME_H 1 /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 /* Define to 1 if you have the windows.h header file. */ /* #undef HAVE_WINDOWS_H */ /* Define to 1 if you have the winsock2.h header file. */ /* #undef HAVE_WINSOCK2_H */ /* Define to 1 if you have the winsock.h header file. */ /* #undef HAVE_WINSOCK_H */ /* Define to 1 if you have the writev function. */ #define HAVE_WRITEV 1 /* Define to 1 if you have the ws2tcpip.h header file. */ /* #undef HAVE_WS2TCPIP_H */ /* Define to the sub-directory where libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" /* Define to 1 if you need the malloc.h header file even with stdlib.h */ /* #undef NEED_MALLOC_H */ /* Define to 1 if you need the memory.h header file even with stdlib.h */ /* #undef NEED_MEMORY_H */ /* Define to 1 if _REENTRANT preprocessor symbol must be defined. */ /* #undef NEED_REENTRANT */ /* Define to 1 if _THREAD_SAFE preprocessor symbol must be defined. */ /* #undef NEED_THREAD_SAFE */ /* cpu-machine-OS */ #define OS "x86_64-pc-linux-gnu" /* Name of package */ #define PACKAGE "c-ares" /* Define to the address where bug reports for this package should be sent. */ #define PACKAGE_BUGREPORT "c-ares mailing list: http://cool.haxx.se/mailman/listinfo/c-ares" /* Define to the full name of this package. */ #define PACKAGE_NAME "c-ares" /* Define to the full name and version of this package. */ #define PACKAGE_STRING "c-ares 1.13.0" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "c-ares" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ #define PACKAGE_VERSION "1.13.0" /* a suitable file/device to read random data from */ #define CARES_RANDOM_FILE "/dev/urandom" /* Define to the type qualifier pointed by arg 5 for recvfrom. */ #define RECVFROM_QUAL_ARG5 /* Define to the type of arg 1 for recvfrom. */ #define RECVFROM_TYPE_ARG1 int /* Define to the type pointed by arg 2 for recvfrom. */ #define RECVFROM_TYPE_ARG2 void /* Define to 1 if the type pointed by arg 2 for recvfrom is void. */ #define RECVFROM_TYPE_ARG2_IS_VOID 1 /* Define to the type of arg 3 for recvfrom. */ #define RECVFROM_TYPE_ARG3 size_t /* Define to the type of arg 4 for recvfrom. */ #define RECVFROM_TYPE_ARG4 int /* Define to the type pointed by arg 5 for recvfrom. */ #define RECVFROM_TYPE_ARG5 struct sockaddr /* Define to 1 if the type pointed by arg 5 for recvfrom is void. */ /* #undef RECVFROM_TYPE_ARG5_IS_VOID */ /* Define to the type pointed by arg 6 for recvfrom. */ #define RECVFROM_TYPE_ARG6 socklen_t /* Define to 1 if the type pointed by arg 6 for recvfrom is void. */ /* #undef RECVFROM_TYPE_ARG6_IS_VOID */ /* Define to the function return type for recvfrom. */ #define RECVFROM_TYPE_RETV ssize_t /* Define to the type of arg 1 for recv. */ #define RECV_TYPE_ARG1 int /* Define to the type of arg 2 for recv. */ #define RECV_TYPE_ARG2 void * /* Define to the type of arg 3 for recv. */ #define RECV_TYPE_ARG3 size_t /* Define to the type of arg 4 for recv. */ #define RECV_TYPE_ARG4 int /* Define to the function return type for recv. */ #define RECV_TYPE_RETV ssize_t /* Define as the return type of signal handlers (`int' or `void'). */ #define RETSIGTYPE void /* Define to the type qualifier of arg 2 for send. */ #define SEND_QUAL_ARG2 const /* Define to the type of arg 1 for send. */ #define SEND_TYPE_ARG1 int /* Define to the type of arg 2 for send. */ #define SEND_TYPE_ARG2 void * /* Define to the type of arg 3 for send. */ #define SEND_TYPE_ARG3 size_t /* Define to the type of arg 4 for send. */ #define SEND_TYPE_ARG4 int /* Define to the function return type for send. */ #define SEND_TYPE_RETV ssize_t /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* Define to 1 if you can safely include both and . */ #define TIME_WITH_SYS_TIME 1 /* Define to disable non-blocking sockets. */ /* #undef USE_BLOCKING_SOCKETS */ /* Version number of package */ #define VERSION "1.13.0" /* Define to avoid automatic inclusion of winsock.h */ /* #undef WIN32_LEAN_AND_MEAN */ /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD # if defined __BIG_ENDIAN__ # define WORDS_BIGENDIAN 1 # endif #else # ifndef WORDS_BIGENDIAN /* # undef WORDS_BIGENDIAN */ # endif #endif /* Define to 1 if OS is AIX. */ #ifndef _ALL_SOURCE /* # undef _ALL_SOURCE */ #endif /* Enable large inode numbers on Mac OS X 10.5. */ #ifndef _DARWIN_USE_64_BIT_INODE # define _DARWIN_USE_64_BIT_INODE 1 #endif /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ /* Define for large files, on AIX-style hosts. */ /* #undef _LARGE_FILES */ /* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ /* Type to use in place of in_addr_t when system does not provide it. */ /* #undef in_addr_t */ /* Define to `unsigned int' if does not define. */ /* #undef size_t */ ././@PaxHeader0000000000000000000000000000003400000000000011452 xustar000000000000000028 mtime=1696604226.9674146 pycares-4.4.0/deps/build-config/config_netbsd/0000755000175100001770000000000000000000000022074 5ustar00runnerdocker00000000000000././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604221.0 pycares-4.4.0/deps/build-config/config_netbsd/ares_config.h0000644000175100001770000003453000000000000024531 0ustar00runnerdocker00000000000000/* ares_config.h. Generated from ares_config.h.in by configure. */ /* ares_config.h.in. Generated from configure.ac by autoheader. */ /* Define if building universal (internal helper macro) */ /* #undef AC_APPLE_UNIVERSAL_BUILD */ /* define this if ares is built for a big endian system */ /* #undef ARES_BIG_ENDIAN */ /* when building as static part of libcurl */ /* #undef BUILDING_LIBCURL */ /* Defined for build that exposes internal static functions for testing. */ /* #undef CARES_EXPOSE_STATICS */ /* Defined for build with symbol hiding. */ /* #undef CARES_SYMBOL_HIDING */ /* the signed version of size_t */ #define CARES_TYPEOF_ARES_SSIZE_T ssize_t /* Definition to make a library symbol externally visible. */ /* #undef CARES_SYMBOL_SCOPE_EXTERN */ /* Use resolver library to configure cares */ /* #undef CARES_USE_LIBRESOLV */ /* if a /etc/inet dir is being used */ /* #undef ETC_INET */ /* Define to the type of arg 2 for gethostname. */ #define GETHOSTNAME_TYPE_ARG2 size_t /* Define to the type qualifier of arg 1 for getnameinfo. */ #define GETNAMEINFO_QUAL_ARG1 const /* Define to the type of arg 1 for getnameinfo. */ #define GETNAMEINFO_TYPE_ARG1 struct sockaddr * /* Define to the type of arg 2 for getnameinfo. */ #define GETNAMEINFO_TYPE_ARG2 socklen_t /* Define to the type of args 4 and 6 for getnameinfo. */ #define GETNAMEINFO_TYPE_ARG46 size_t /* Define to the type of arg 7 for getnameinfo. */ #define GETNAMEINFO_TYPE_ARG7 int /* Specifies the number of arguments to getservbyport_r */ #define GETSERVBYPORT_R_ARGS 4 /* Specifies the size of the buffer to pass to getservbyport_r */ #define GETSERVBYPORT_R_BUFSIZE sizeof(struct servent_data) /* Define to 1 if you have AF_INET6. */ #define HAVE_AF_INET6 1 /* Define to 1 if you have the header file. */ #define HAVE_ARPA_INET_H 1 /* Define to 1 if you have the header file. */ /* #undef HAVE_ARPA_NAMESER_COMPAT_H */ /* Define to 1 if you have the header file. */ #define HAVE_ARPA_NAMESER_H 1 /* Define to 1 if you have the header file. */ #define HAVE_ASSERT_H 1 /* Define to 1 if you have the `bitncmp' function. */ /* #undef HAVE_BITNCMP */ /* Define to 1 if bool is an available type. */ #define HAVE_BOOL_T 1 /* Define to 1 if you have the clock_gettime function and monotonic timer. */ #define HAVE_CLOCK_GETTIME_MONOTONIC 1 /* Define to 1 if you have the closesocket function. */ /* #undef HAVE_CLOSESOCKET */ /* Define to 1 if you have the CloseSocket camel case function. */ /* #undef HAVE_CLOSESOCKET_CAMEL */ /* Define to 1 if you have the connect function. */ #define HAVE_CONNECT 1 /* define if the compiler supports basic C++11 syntax */ #define HAVE_CXX11 1 /* Define to 1 if you have the header file. */ #define HAVE_DLFCN_H 1 /* Define to 1 if you have the header file. */ #define HAVE_ERRNO_H 1 /* Define to 1 if you have the fcntl function. */ #define HAVE_FCNTL 1 /* Define to 1 if you have the header file. */ #define HAVE_FCNTL_H 1 /* Define to 1 if you have a working fcntl O_NONBLOCK function. */ #define HAVE_FCNTL_O_NONBLOCK 1 /* Define to 1 if you have the freeaddrinfo function. */ #define HAVE_FREEADDRINFO 1 /* Define to 1 if you have a working getaddrinfo function. */ #define HAVE_GETADDRINFO 1 /* Define to 1 if the getaddrinfo function is threadsafe. */ /* #undef HAVE_GETADDRINFO_THREADSAFE */ /* Define to 1 if you have the getenv function. */ #define HAVE_GETENV 1 /* Define to 1 if you have the gethostbyaddr function. */ #define HAVE_GETHOSTBYADDR 1 /* Define to 1 if you have the gethostbyname function. */ #define HAVE_GETHOSTBYNAME 1 /* Define to 1 if you have the gethostname function. */ #define HAVE_GETHOSTNAME 1 /* Define to 1 if you have the getnameinfo function. */ #define HAVE_GETNAMEINFO 1 /* Define to 1 if you have the getservbyport_r function. */ #define HAVE_GETSERVBYPORT_R 1 /* Define to 1 if you have the `gettimeofday' function. */ #define HAVE_GETTIMEOFDAY 1 /* Define to 1 if you have the `if_indextoname' function. */ #define HAVE_IF_INDEXTONAME 1 /* Define to 1 if you have a IPv6 capable working inet_net_pton function. */ #define HAVE_INET_NET_PTON 1 /* Define to 1 if you have a IPv6 capable working inet_ntop function. */ #define HAVE_INET_NTOP 1 /* Define to 1 if you have a IPv6 capable working inet_pton function. */ #define HAVE_INET_PTON 1 /* Define to 1 if you have the header file. */ #define HAVE_INTTYPES_H 1 /* Define to 1 if you have the ioctl function. */ #define HAVE_IOCTL 1 /* Define to 1 if you have the ioctlsocket function. */ /* #undef HAVE_IOCTLSOCKET */ /* Define to 1 if you have the IoctlSocket camel case function. */ /* #undef HAVE_IOCTLSOCKET_CAMEL */ /* Define to 1 if you have a working IoctlSocket camel case FIONBIO function. */ /* #undef HAVE_IOCTLSOCKET_CAMEL_FIONBIO */ /* Define to 1 if you have a working ioctlsocket FIONBIO function. */ /* #undef HAVE_IOCTLSOCKET_FIONBIO */ /* Define to 1 if you have a working ioctl FIONBIO function. */ #define HAVE_IOCTL_FIONBIO 1 /* Define to 1 if you have a working ioctl SIOCGIFADDR function. */ #define HAVE_IOCTL_SIOCGIFADDR 1 /* Define to 1 if you have the `resolve' library (-lresolve). */ /* #undef HAVE_LIBRESOLVE */ /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 /* if your compiler supports LL */ #define HAVE_LL 1 /* Define to 1 if the compiler supports the 'long long' data type. */ #define HAVE_LONGLONG 1 /* Define to 1 if you have the malloc.h header file. */ #define HAVE_MALLOC_H 1 /* Define to 1 if you have the memory.h header file. */ #define HAVE_MEMORY_H 1 /* Define to 1 if you have the MSG_NOSIGNAL flag. */ /* #undef HAVE_MSG_NOSIGNAL */ /* Define to 1 if you have the header file. */ #define HAVE_NETDB_H 1 /* Define to 1 if you have the header file. */ #define HAVE_NETINET_IN_H 1 /* Define to 1 if you have the header file. */ #define HAVE_NETINET_TCP_H 1 /* Define to 1 if you have the header file. */ #define HAVE_NET_IF_H 1 /* Define to 1 if you have PF_INET6. */ #define HAVE_PF_INET6 1 /* Define to 1 if you have the recv function. */ #define HAVE_RECV 1 /* Define to 1 if you have the recvfrom function. */ #define HAVE_RECVFROM 1 /* Define to 1 if you have the send function. */ #define HAVE_SEND 1 /* Define to 1 if you have the setsockopt function. */ #define HAVE_SETSOCKOPT 1 /* Define to 1 if you have a working setsockopt SO_NONBLOCK function. */ /* #undef HAVE_SETSOCKOPT_SO_NONBLOCK */ /* Define to 1 if you have the header file. */ #define HAVE_SIGNAL_H 1 /* Define to 1 if sig_atomic_t is an available typedef. */ #define HAVE_SIG_ATOMIC_T 1 /* Define to 1 if sig_atomic_t is already defined as volatile. */ /* #undef HAVE_SIG_ATOMIC_T_VOLATILE */ /* Define to 1 if your struct sockaddr_in6 has sin6_scope_id. */ #define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1 /* Define to 1 if you have the socket function. */ #define HAVE_SOCKET 1 /* Define to 1 if you have the header file. */ /* #undef HAVE_SOCKET_H */ /* Define to 1 if you have the header file. */ #define HAVE_STDBOOL_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STDINT_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STDLIB_H 1 /* Define to 1 if you have the strcasecmp function. */ #define HAVE_STRCASECMP 1 /* Define to 1 if you have the strcmpi function. */ /* #undef HAVE_STRCMPI */ /* Define to 1 if you have the strdup function. */ #define HAVE_STRDUP 1 /* Define to 1 if you have the stricmp function. */ /* #undef HAVE_STRICMP */ /* Define to 1 if you have the header file. */ #define HAVE_STRINGS_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STRING_H 1 /* Define to 1 if you have the strncasecmp function. */ #define HAVE_STRNCASECMP 1 /* Define to 1 if you have the strncmpi function. */ /* #undef HAVE_STRNCMPI */ /* Define to 1 if you have the strnicmp function. */ /* #undef HAVE_STRNICMP */ /* Define to 1 if you have the header file. */ /* #undef HAVE_STROPTS_H */ /* Define to 1 if you have struct addrinfo. */ #define HAVE_STRUCT_ADDRINFO 1 /* Define to 1 if you have struct in6_addr. */ #define HAVE_STRUCT_IN6_ADDR 1 /* Define to 1 if you have struct sockaddr_in6. */ #define HAVE_STRUCT_SOCKADDR_IN6 1 /* if struct sockaddr_storage is defined */ #define HAVE_STRUCT_SOCKADDR_STORAGE 1 /* Define to 1 if you have the timeval struct. */ #define HAVE_STRUCT_TIMEVAL 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_IOCTL_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_PARAM_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_SELECT_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_SOCKET_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_STAT_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_TIME_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_TYPES_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_UIO_H 1 /* Define to 1 if you have the header file. */ #define HAVE_TIME_H 1 /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 /* Define to 1 if you have the windows.h header file. */ /* #undef HAVE_WINDOWS_H */ /* Define to 1 if you have the winsock2.h header file. */ /* #undef HAVE_WINSOCK2_H */ /* Define to 1 if you have the winsock.h header file. */ /* #undef HAVE_WINSOCK_H */ /* Define to 1 if you have the writev function. */ #define HAVE_WRITEV 1 /* Define to 1 if you have the ws2tcpip.h header file. */ /* #undef HAVE_WS2TCPIP_H */ /* Define to the sub-directory where libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" /* Define to 1 if you need the malloc.h header file even with stdlib.h */ /* #undef NEED_MALLOC_H */ /* Define to 1 if you need the memory.h header file even with stdlib.h */ /* #undef NEED_MEMORY_H */ /* Define to 1 if _REENTRANT preprocessor symbol must be defined. */ /* #undef NEED_REENTRANT */ /* Define to 1 if _THREAD_SAFE preprocessor symbol must be defined. */ /* #undef NEED_THREAD_SAFE */ /* cpu-machine-OS */ #define OS "x86_64-unknown-freebsd10.3" /* Name of package */ #define PACKAGE "c-ares" /* Define to the address where bug reports for this package should be sent. */ #define PACKAGE_BUGREPORT "c-ares mailing list: http://cool.haxx.se/mailman/listinfo/c-ares" /* Define to the full name of this package. */ #define PACKAGE_NAME "c-ares" /* Define to the full name and version of this package. */ #define PACKAGE_STRING "c-ares 1.13.0" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "c-ares" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ #define PACKAGE_VERSION "1.13.0" /* a suitable file/device to read random data from */ #define CARES_RANDOM_FILE "/dev/urandom" /* Define to the type qualifier pointed by arg 5 for recvfrom. */ #define RECVFROM_QUAL_ARG5 /* Define to the type of arg 1 for recvfrom. */ #define RECVFROM_TYPE_ARG1 int /* Define to the type pointed by arg 2 for recvfrom. */ #define RECVFROM_TYPE_ARG2 void /* Define to 1 if the type pointed by arg 2 for recvfrom is void. */ #define RECVFROM_TYPE_ARG2_IS_VOID 1 /* Define to the type of arg 3 for recvfrom. */ #define RECVFROM_TYPE_ARG3 size_t /* Define to the type of arg 4 for recvfrom. */ #define RECVFROM_TYPE_ARG4 int /* Define to the type pointed by arg 5 for recvfrom. */ #define RECVFROM_TYPE_ARG5 struct sockaddr /* Define to 1 if the type pointed by arg 5 for recvfrom is void. */ /* #undef RECVFROM_TYPE_ARG5_IS_VOID */ /* Define to the type pointed by arg 6 for recvfrom. */ #define RECVFROM_TYPE_ARG6 socklen_t /* Define to 1 if the type pointed by arg 6 for recvfrom is void. */ /* #undef RECVFROM_TYPE_ARG6_IS_VOID */ /* Define to the function return type for recvfrom. */ #define RECVFROM_TYPE_RETV ssize_t /* Define to the type of arg 1 for recv. */ #define RECV_TYPE_ARG1 int /* Define to the type of arg 2 for recv. */ #define RECV_TYPE_ARG2 void * /* Define to the type of arg 3 for recv. */ #define RECV_TYPE_ARG3 size_t /* Define to the type of arg 4 for recv. */ #define RECV_TYPE_ARG4 int /* Define to the function return type for recv. */ #define RECV_TYPE_RETV ssize_t /* Define as the return type of signal handlers (`int' or `void'). */ #define RETSIGTYPE void /* Define to the type qualifier of arg 2 for send. */ #define SEND_QUAL_ARG2 const /* Define to the type of arg 1 for send. */ #define SEND_TYPE_ARG1 int /* Define to the type of arg 2 for send. */ #define SEND_TYPE_ARG2 void * /* Define to the type of arg 3 for send. */ #define SEND_TYPE_ARG3 size_t /* Define to the type of arg 4 for send. */ #define SEND_TYPE_ARG4 int /* Define to the function return type for send. */ #define SEND_TYPE_RETV ssize_t /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* Define to 1 if you can safely include both and . */ #define TIME_WITH_SYS_TIME 1 /* Define to disable non-blocking sockets. */ /* #undef USE_BLOCKING_SOCKETS */ /* Version number of package */ #define VERSION "1.13.0" /* Define to avoid automatic inclusion of winsock.h */ /* #undef WIN32_LEAN_AND_MEAN */ /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD # if defined __BIG_ENDIAN__ # define WORDS_BIGENDIAN 1 # endif #else # ifndef WORDS_BIGENDIAN /* # undef WORDS_BIGENDIAN */ # endif #endif /* Define to 1 if OS is AIX. */ #ifndef _ALL_SOURCE /* # undef _ALL_SOURCE */ #endif /* Enable large inode numbers on Mac OS X 10.5. */ #ifndef _DARWIN_USE_64_BIT_INODE # define _DARWIN_USE_64_BIT_INODE 1 #endif /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ /* Define for large files, on AIX-style hosts. */ /* #undef _LARGE_FILES */ /* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ /* Type to use in place of in_addr_t when system does not provide it. */ /* #undef in_addr_t */ /* Define to `unsigned int' if does not define. */ /* #undef size_t */ /* the signed version of size_t */ /* #undef ssize_t */ ././@PaxHeader0000000000000000000000000000003400000000000011452 xustar000000000000000028 mtime=1696604226.9674146 pycares-4.4.0/deps/build-config/config_openbsd/0000755000175100001770000000000000000000000022247 5ustar00runnerdocker00000000000000././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604221.0 pycares-4.4.0/deps/build-config/config_openbsd/ares_config.h0000644000175100001770000003453000000000000024704 0ustar00runnerdocker00000000000000/* ares_config.h. Generated from ares_config.h.in by configure. */ /* ares_config.h.in. Generated from configure.ac by autoheader. */ /* Define if building universal (internal helper macro) */ /* #undef AC_APPLE_UNIVERSAL_BUILD */ /* define this if ares is built for a big endian system */ /* #undef ARES_BIG_ENDIAN */ /* when building as static part of libcurl */ /* #undef BUILDING_LIBCURL */ /* Defined for build that exposes internal static functions for testing. */ /* #undef CARES_EXPOSE_STATICS */ /* Defined for build with symbol hiding. */ /* #undef CARES_SYMBOL_HIDING */ /* the signed version of size_t */ #define CARES_TYPEOF_ARES_SSIZE_T ssize_t /* Definition to make a library symbol externally visible. */ /* #undef CARES_SYMBOL_SCOPE_EXTERN */ /* Use resolver library to configure cares */ /* #undef CARES_USE_LIBRESOLV */ /* if a /etc/inet dir is being used */ /* #undef ETC_INET */ /* Define to the type of arg 2 for gethostname. */ #define GETHOSTNAME_TYPE_ARG2 size_t /* Define to the type qualifier of arg 1 for getnameinfo. */ #define GETNAMEINFO_QUAL_ARG1 const /* Define to the type of arg 1 for getnameinfo. */ #define GETNAMEINFO_TYPE_ARG1 struct sockaddr * /* Define to the type of arg 2 for getnameinfo. */ #define GETNAMEINFO_TYPE_ARG2 socklen_t /* Define to the type of args 4 and 6 for getnameinfo. */ #define GETNAMEINFO_TYPE_ARG46 size_t /* Define to the type of arg 7 for getnameinfo. */ #define GETNAMEINFO_TYPE_ARG7 int /* Specifies the number of arguments to getservbyport_r */ #define GETSERVBYPORT_R_ARGS 4 /* Specifies the size of the buffer to pass to getservbyport_r */ #define GETSERVBYPORT_R_BUFSIZE sizeof(struct servent_data) /* Define to 1 if you have AF_INET6. */ #define HAVE_AF_INET6 1 /* Define to 1 if you have the header file. */ #define HAVE_ARPA_INET_H 1 /* Define to 1 if you have the header file. */ /* #undef HAVE_ARPA_NAMESER_COMPAT_H */ /* Define to 1 if you have the header file. */ #define HAVE_ARPA_NAMESER_H 1 /* Define to 1 if you have the header file. */ #define HAVE_ASSERT_H 1 /* Define to 1 if you have the `bitncmp' function. */ /* #undef HAVE_BITNCMP */ /* Define to 1 if bool is an available type. */ #define HAVE_BOOL_T 1 /* Define to 1 if you have the clock_gettime function and monotonic timer. */ #define HAVE_CLOCK_GETTIME_MONOTONIC 1 /* Define to 1 if you have the closesocket function. */ /* #undef HAVE_CLOSESOCKET */ /* Define to 1 if you have the CloseSocket camel case function. */ /* #undef HAVE_CLOSESOCKET_CAMEL */ /* Define to 1 if you have the connect function. */ #define HAVE_CONNECT 1 /* define if the compiler supports basic C++11 syntax */ #define HAVE_CXX11 1 /* Define to 1 if you have the header file. */ #define HAVE_DLFCN_H 1 /* Define to 1 if you have the header file. */ #define HAVE_ERRNO_H 1 /* Define to 1 if you have the fcntl function. */ #define HAVE_FCNTL 1 /* Define to 1 if you have the header file. */ #define HAVE_FCNTL_H 1 /* Define to 1 if you have a working fcntl O_NONBLOCK function. */ #define HAVE_FCNTL_O_NONBLOCK 1 /* Define to 1 if you have the freeaddrinfo function. */ #define HAVE_FREEADDRINFO 1 /* Define to 1 if you have a working getaddrinfo function. */ #define HAVE_GETADDRINFO 1 /* Define to 1 if the getaddrinfo function is threadsafe. */ /* #undef HAVE_GETADDRINFO_THREADSAFE */ /* Define to 1 if you have the getenv function. */ #define HAVE_GETENV 1 /* Define to 1 if you have the gethostbyaddr function. */ #define HAVE_GETHOSTBYADDR 1 /* Define to 1 if you have the gethostbyname function. */ #define HAVE_GETHOSTBYNAME 1 /* Define to 1 if you have the gethostname function. */ #define HAVE_GETHOSTNAME 1 /* Define to 1 if you have the getnameinfo function. */ #define HAVE_GETNAMEINFO 1 /* Define to 1 if you have the getservbyport_r function. */ #define HAVE_GETSERVBYPORT_R 1 /* Define to 1 if you have the `gettimeofday' function. */ #define HAVE_GETTIMEOFDAY 1 /* Define to 1 if you have the `if_indextoname' function. */ #define HAVE_IF_INDEXTONAME 1 /* Define to 1 if you have a IPv6 capable working inet_net_pton function. */ #define HAVE_INET_NET_PTON 1 /* Define to 1 if you have a IPv6 capable working inet_ntop function. */ #define HAVE_INET_NTOP 1 /* Define to 1 if you have a IPv6 capable working inet_pton function. */ #define HAVE_INET_PTON 1 /* Define to 1 if you have the header file. */ #define HAVE_INTTYPES_H 1 /* Define to 1 if you have the ioctl function. */ #define HAVE_IOCTL 1 /* Define to 1 if you have the ioctlsocket function. */ /* #undef HAVE_IOCTLSOCKET */ /* Define to 1 if you have the IoctlSocket camel case function. */ /* #undef HAVE_IOCTLSOCKET_CAMEL */ /* Define to 1 if you have a working IoctlSocket camel case FIONBIO function. */ /* #undef HAVE_IOCTLSOCKET_CAMEL_FIONBIO */ /* Define to 1 if you have a working ioctlsocket FIONBIO function. */ /* #undef HAVE_IOCTLSOCKET_FIONBIO */ /* Define to 1 if you have a working ioctl FIONBIO function. */ #define HAVE_IOCTL_FIONBIO 1 /* Define to 1 if you have a working ioctl SIOCGIFADDR function. */ #define HAVE_IOCTL_SIOCGIFADDR 1 /* Define to 1 if you have the `resolve' library (-lresolve). */ /* #undef HAVE_LIBRESOLVE */ /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 /* if your compiler supports LL */ #define HAVE_LL 1 /* Define to 1 if the compiler supports the 'long long' data type. */ #define HAVE_LONGLONG 1 /* Define to 1 if you have the malloc.h header file. */ #define HAVE_MALLOC_H 1 /* Define to 1 if you have the memory.h header file. */ #define HAVE_MEMORY_H 1 /* Define to 1 if you have the MSG_NOSIGNAL flag. */ /* #undef HAVE_MSG_NOSIGNAL */ /* Define to 1 if you have the header file. */ #define HAVE_NETDB_H 1 /* Define to 1 if you have the header file. */ #define HAVE_NETINET_IN_H 1 /* Define to 1 if you have the header file. */ #define HAVE_NETINET_TCP_H 1 /* Define to 1 if you have the header file. */ #define HAVE_NET_IF_H 1 /* Define to 1 if you have PF_INET6. */ #define HAVE_PF_INET6 1 /* Define to 1 if you have the recv function. */ #define HAVE_RECV 1 /* Define to 1 if you have the recvfrom function. */ #define HAVE_RECVFROM 1 /* Define to 1 if you have the send function. */ #define HAVE_SEND 1 /* Define to 1 if you have the setsockopt function. */ #define HAVE_SETSOCKOPT 1 /* Define to 1 if you have a working setsockopt SO_NONBLOCK function. */ /* #undef HAVE_SETSOCKOPT_SO_NONBLOCK */ /* Define to 1 if you have the header file. */ #define HAVE_SIGNAL_H 1 /* Define to 1 if sig_atomic_t is an available typedef. */ #define HAVE_SIG_ATOMIC_T 1 /* Define to 1 if sig_atomic_t is already defined as volatile. */ /* #undef HAVE_SIG_ATOMIC_T_VOLATILE */ /* Define to 1 if your struct sockaddr_in6 has sin6_scope_id. */ #define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1 /* Define to 1 if you have the socket function. */ #define HAVE_SOCKET 1 /* Define to 1 if you have the header file. */ /* #undef HAVE_SOCKET_H */ /* Define to 1 if you have the header file. */ #define HAVE_STDBOOL_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STDINT_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STDLIB_H 1 /* Define to 1 if you have the strcasecmp function. */ #define HAVE_STRCASECMP 1 /* Define to 1 if you have the strcmpi function. */ /* #undef HAVE_STRCMPI */ /* Define to 1 if you have the strdup function. */ #define HAVE_STRDUP 1 /* Define to 1 if you have the stricmp function. */ /* #undef HAVE_STRICMP */ /* Define to 1 if you have the header file. */ #define HAVE_STRINGS_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STRING_H 1 /* Define to 1 if you have the strncasecmp function. */ #define HAVE_STRNCASECMP 1 /* Define to 1 if you have the strncmpi function. */ /* #undef HAVE_STRNCMPI */ /* Define to 1 if you have the strnicmp function. */ /* #undef HAVE_STRNICMP */ /* Define to 1 if you have the header file. */ /* #undef HAVE_STROPTS_H */ /* Define to 1 if you have struct addrinfo. */ #define HAVE_STRUCT_ADDRINFO 1 /* Define to 1 if you have struct in6_addr. */ #define HAVE_STRUCT_IN6_ADDR 1 /* Define to 1 if you have struct sockaddr_in6. */ #define HAVE_STRUCT_SOCKADDR_IN6 1 /* if struct sockaddr_storage is defined */ #define HAVE_STRUCT_SOCKADDR_STORAGE 1 /* Define to 1 if you have the timeval struct. */ #define HAVE_STRUCT_TIMEVAL 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_IOCTL_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_PARAM_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_SELECT_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_SOCKET_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_STAT_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_TIME_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_TYPES_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_UIO_H 1 /* Define to 1 if you have the header file. */ #define HAVE_TIME_H 1 /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 /* Define to 1 if you have the windows.h header file. */ /* #undef HAVE_WINDOWS_H */ /* Define to 1 if you have the winsock2.h header file. */ /* #undef HAVE_WINSOCK2_H */ /* Define to 1 if you have the winsock.h header file. */ /* #undef HAVE_WINSOCK_H */ /* Define to 1 if you have the writev function. */ #define HAVE_WRITEV 1 /* Define to 1 if you have the ws2tcpip.h header file. */ /* #undef HAVE_WS2TCPIP_H */ /* Define to the sub-directory where libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" /* Define to 1 if you need the malloc.h header file even with stdlib.h */ /* #undef NEED_MALLOC_H */ /* Define to 1 if you need the memory.h header file even with stdlib.h */ /* #undef NEED_MEMORY_H */ /* Define to 1 if _REENTRANT preprocessor symbol must be defined. */ /* #undef NEED_REENTRANT */ /* Define to 1 if _THREAD_SAFE preprocessor symbol must be defined. */ /* #undef NEED_THREAD_SAFE */ /* cpu-machine-OS */ #define OS "x86_64-unknown-freebsd10.3" /* Name of package */ #define PACKAGE "c-ares" /* Define to the address where bug reports for this package should be sent. */ #define PACKAGE_BUGREPORT "c-ares mailing list: http://cool.haxx.se/mailman/listinfo/c-ares" /* Define to the full name of this package. */ #define PACKAGE_NAME "c-ares" /* Define to the full name and version of this package. */ #define PACKAGE_STRING "c-ares 1.13.0" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "c-ares" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ #define PACKAGE_VERSION "1.13.0" /* a suitable file/device to read random data from */ #define CARES_RANDOM_FILE "/dev/urandom" /* Define to the type qualifier pointed by arg 5 for recvfrom. */ #define RECVFROM_QUAL_ARG5 /* Define to the type of arg 1 for recvfrom. */ #define RECVFROM_TYPE_ARG1 int /* Define to the type pointed by arg 2 for recvfrom. */ #define RECVFROM_TYPE_ARG2 void /* Define to 1 if the type pointed by arg 2 for recvfrom is void. */ #define RECVFROM_TYPE_ARG2_IS_VOID 1 /* Define to the type of arg 3 for recvfrom. */ #define RECVFROM_TYPE_ARG3 size_t /* Define to the type of arg 4 for recvfrom. */ #define RECVFROM_TYPE_ARG4 int /* Define to the type pointed by arg 5 for recvfrom. */ #define RECVFROM_TYPE_ARG5 struct sockaddr /* Define to 1 if the type pointed by arg 5 for recvfrom is void. */ /* #undef RECVFROM_TYPE_ARG5_IS_VOID */ /* Define to the type pointed by arg 6 for recvfrom. */ #define RECVFROM_TYPE_ARG6 socklen_t /* Define to 1 if the type pointed by arg 6 for recvfrom is void. */ /* #undef RECVFROM_TYPE_ARG6_IS_VOID */ /* Define to the function return type for recvfrom. */ #define RECVFROM_TYPE_RETV ssize_t /* Define to the type of arg 1 for recv. */ #define RECV_TYPE_ARG1 int /* Define to the type of arg 2 for recv. */ #define RECV_TYPE_ARG2 void * /* Define to the type of arg 3 for recv. */ #define RECV_TYPE_ARG3 size_t /* Define to the type of arg 4 for recv. */ #define RECV_TYPE_ARG4 int /* Define to the function return type for recv. */ #define RECV_TYPE_RETV ssize_t /* Define as the return type of signal handlers (`int' or `void'). */ #define RETSIGTYPE void /* Define to the type qualifier of arg 2 for send. */ #define SEND_QUAL_ARG2 const /* Define to the type of arg 1 for send. */ #define SEND_TYPE_ARG1 int /* Define to the type of arg 2 for send. */ #define SEND_TYPE_ARG2 void * /* Define to the type of arg 3 for send. */ #define SEND_TYPE_ARG3 size_t /* Define to the type of arg 4 for send. */ #define SEND_TYPE_ARG4 int /* Define to the function return type for send. */ #define SEND_TYPE_RETV ssize_t /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* Define to 1 if you can safely include both and . */ #define TIME_WITH_SYS_TIME 1 /* Define to disable non-blocking sockets. */ /* #undef USE_BLOCKING_SOCKETS */ /* Version number of package */ #define VERSION "1.13.0" /* Define to avoid automatic inclusion of winsock.h */ /* #undef WIN32_LEAN_AND_MEAN */ /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD # if defined __BIG_ENDIAN__ # define WORDS_BIGENDIAN 1 # endif #else # ifndef WORDS_BIGENDIAN /* # undef WORDS_BIGENDIAN */ # endif #endif /* Define to 1 if OS is AIX. */ #ifndef _ALL_SOURCE /* # undef _ALL_SOURCE */ #endif /* Enable large inode numbers on Mac OS X 10.5. */ #ifndef _DARWIN_USE_64_BIT_INODE # define _DARWIN_USE_64_BIT_INODE 1 #endif /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ /* Define for large files, on AIX-style hosts. */ /* #undef _LARGE_FILES */ /* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ /* Type to use in place of in_addr_t when system does not provide it. */ /* #undef in_addr_t */ /* Define to `unsigned int' if does not define. */ /* #undef size_t */ /* the signed version of size_t */ /* #undef ssize_t */ ././@PaxHeader0000000000000000000000000000003400000000000011452 xustar000000000000000028 mtime=1696604226.9674146 pycares-4.4.0/deps/build-config/config_sunos/0000755000175100001770000000000000000000000021764 5ustar00runnerdocker00000000000000././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604221.0 pycares-4.4.0/deps/build-config/config_sunos/ares_config.h0000644000175100001770000003450000000000000024416 0ustar00runnerdocker00000000000000/* ares_config.h. Generated from ares_config.h.in by configure. */ /* ares_config.h.in. Generated from configure.ac by autoheader. */ /* Define if building universal (internal helper macro) */ /* #undef AC_APPLE_UNIVERSAL_BUILD */ /* define this if ares is built for a big endian system */ /* #undef ARES_BIG_ENDIAN */ /* when building as static part of libcurl */ /* #undef BUILDING_LIBCURL */ /* Defined for build that exposes internal static functions for testing. */ /* #undef CARES_EXPOSE_STATICS */ /* Defined for build with symbol hiding. */ #define CARES_SYMBOL_HIDING 1 /* Definition to make a library symbol externally visible. */ #define CARES_SYMBOL_SCOPE_EXTERN __attribute__ ((__visibility__ ("default"))) /* the signed version of size_t */ #define CARES_TYPEOF_ARES_SSIZE_T ssize_t /* Use resolver library to configure cares */ /* #undef CARES_USE_LIBRESOLV */ /* if a /etc/inet dir is being used */ #define ETC_INET 1 /* Define to the type of arg 2 for gethostname. */ #define GETHOSTNAME_TYPE_ARG2 int /* Define to the type qualifier of arg 1 for getnameinfo. */ #define GETNAMEINFO_QUAL_ARG1 const /* Define to the type of arg 1 for getnameinfo. */ #define GETNAMEINFO_TYPE_ARG1 struct sockaddr * /* Define to the type of arg 2 for getnameinfo. */ #define GETNAMEINFO_TYPE_ARG2 socklen_t /* Define to the type of args 4 and 6 for getnameinfo. */ #define GETNAMEINFO_TYPE_ARG46 size_t /* Define to the type of arg 7 for getnameinfo. */ #define GETNAMEINFO_TYPE_ARG7 int /* Specifies the number of arguments to getservbyport_r */ #define GETSERVBYPORT_R_ARGS 5 /* Specifies the size of the buffer to pass to getservbyport_r */ #define GETSERVBYPORT_R_BUFSIZE 4096 /* Define to 1 if you have AF_INET6. */ #define HAVE_AF_INET6 1 /* Define to 1 if you have the header file. */ #define HAVE_ARPA_INET_H 1 /* Define to 1 if you have the header file. */ #define HAVE_ARPA_NAMESER_COMPAT_H 1 /* Define to 1 if you have the header file. */ #define HAVE_ARPA_NAMESER_H 1 /* Define to 1 if you have the header file. */ #define HAVE_ASSERT_H 1 /* Define to 1 if you have the `bitncmp' function. */ /* #undef HAVE_BITNCMP */ /* Define to 1 if bool is an available type. */ #define HAVE_BOOL_T 1 /* Define to 1 if you have the clock_gettime function and monotonic timer. */ #define HAVE_CLOCK_GETTIME_MONOTONIC 1 /* Define to 1 if you have the closesocket function. */ /* #undef HAVE_CLOSESOCKET */ /* Define to 1 if you have the CloseSocket camel case function. */ /* #undef HAVE_CLOSESOCKET_CAMEL */ /* Define to 1 if you have the connect function. */ #define HAVE_CONNECT 1 /* define if the compiler supports basic C++11 syntax */ #define HAVE_CXX11 1 /* Define to 1 if you have the header file. */ #define HAVE_DLFCN_H 1 /* Define to 1 if you have the header file. */ #define HAVE_ERRNO_H 1 /* Define to 1 if you have the fcntl function. */ #define HAVE_FCNTL 1 /* Define to 1 if you have the header file. */ #define HAVE_FCNTL_H 1 /* Define to 1 if you have a working fcntl O_NONBLOCK function. */ #define HAVE_FCNTL_O_NONBLOCK 1 /* Define to 1 if you have the freeaddrinfo function. */ #define HAVE_FREEADDRINFO 1 /* Define to 1 if you have a working getaddrinfo function. */ #define HAVE_GETADDRINFO 1 /* Define to 1 if the getaddrinfo function is threadsafe. */ #define HAVE_GETADDRINFO_THREADSAFE 1 /* Define to 1 if you have the getenv function. */ #define HAVE_GETENV 1 /* Define to 1 if you have the gethostbyaddr function. */ #define HAVE_GETHOSTBYADDR 1 /* Define to 1 if you have the gethostbyname function. */ #define HAVE_GETHOSTBYNAME 1 /* Define to 1 if you have the gethostname function. */ #define HAVE_GETHOSTNAME 1 /* Define to 1 if you have the getnameinfo function. */ #define HAVE_GETNAMEINFO 1 /* Define to 1 if you have the getservbyport_r function. */ #define HAVE_GETSERVBYPORT_R 1 /* Define to 1 if you have the `gettimeofday' function. */ #define HAVE_GETTIMEOFDAY 1 /* Define to 1 if you have the `if_indextoname' function. */ #define HAVE_IF_INDEXTONAME 1 /* Define to 1 if you have a IPv6 capable working inet_net_pton function. */ /* #undef HAVE_INET_NET_PTON */ /* Define to 1 if you have a IPv6 capable working inet_ntop function. */ #define HAVE_INET_NTOP 1 /* Define to 1 if you have a IPv6 capable working inet_pton function. */ #define HAVE_INET_PTON 1 /* Define to 1 if you have the header file. */ #define HAVE_INTTYPES_H 1 /* Define to 1 if you have the ioctl function. */ #define HAVE_IOCTL 1 /* Define to 1 if you have the ioctlsocket function. */ /* #undef HAVE_IOCTLSOCKET */ /* Define to 1 if you have the IoctlSocket camel case function. */ /* #undef HAVE_IOCTLSOCKET_CAMEL */ /* Define to 1 if you have a working IoctlSocket camel case FIONBIO function. */ /* #undef HAVE_IOCTLSOCKET_CAMEL_FIONBIO */ /* Define to 1 if you have a working ioctlsocket FIONBIO function. */ /* #undef HAVE_IOCTLSOCKET_FIONBIO */ /* Define to 1 if you have a working ioctl FIONBIO function. */ /* #undef HAVE_IOCTL_FIONBIO */ /* Define to 1 if you have a working ioctl SIOCGIFADDR function. */ /* #undef HAVE_IOCTL_SIOCGIFADDR */ /* Define to 1 if you have the `resolve' library (-lresolve). */ /* #undef HAVE_LIBRESOLVE */ /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 /* if your compiler supports LL */ #define HAVE_LL 1 /* Define to 1 if the compiler supports the 'long long' data type. */ #define HAVE_LONGLONG 1 /* Define to 1 if you have the malloc.h header file. */ #define HAVE_MALLOC_H 1 /* Define to 1 if you have the memory.h header file. */ #define HAVE_MEMORY_H 1 /* Define to 1 if you have the MSG_NOSIGNAL flag. */ /* #undef HAVE_MSG_NOSIGNAL */ /* Define to 1 if you have the header file. */ #define HAVE_NETDB_H 1 /* Define to 1 if you have the header file. */ #define HAVE_NETINET_IN_H 1 /* Define to 1 if you have the header file. */ #define HAVE_NETINET_TCP_H 1 /* Define to 1 if you have the header file. */ #define HAVE_NET_IF_H 1 /* Define to 1 if you have PF_INET6. */ #define HAVE_PF_INET6 1 /* Define to 1 if you have the recv function. */ #define HAVE_RECV 1 /* Define to 1 if you have the recvfrom function. */ #define HAVE_RECVFROM 1 /* Define to 1 if you have the send function. */ #define HAVE_SEND 1 /* Define to 1 if you have the setsockopt function. */ #define HAVE_SETSOCKOPT 1 /* Define to 1 if you have a working setsockopt SO_NONBLOCK function. */ /* #undef HAVE_SETSOCKOPT_SO_NONBLOCK */ /* Define to 1 if you have the header file. */ #define HAVE_SIGNAL_H 1 /* Define to 1 if sig_atomic_t is an available typedef. */ #define HAVE_SIG_ATOMIC_T 1 /* Define to 1 if sig_atomic_t is already defined as volatile. */ /* #undef HAVE_SIG_ATOMIC_T_VOLATILE */ /* Define to 1 if your struct sockaddr_in6 has sin6_scope_id. */ #define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1 /* Define to 1 if you have the socket function. */ #define HAVE_SOCKET 1 /* Define to 1 if you have the header file. */ /* #undef HAVE_SOCKET_H */ /* Define to 1 if you have the header file. */ #define HAVE_STDBOOL_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STDINT_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STDLIB_H 1 /* Define to 1 if you have the strcasecmp function. */ #define HAVE_STRCASECMP 1 /* Define to 1 if you have the strcmpi function. */ /* #undef HAVE_STRCMPI */ /* Define to 1 if you have the strdup function. */ #define HAVE_STRDUP 1 /* Define to 1 if you have the stricmp function. */ /* #undef HAVE_STRICMP */ /* Define to 1 if you have the header file. */ #define HAVE_STRINGS_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STRING_H 1 /* Define to 1 if you have the strncasecmp function. */ #define HAVE_STRNCASECMP 1 /* Define to 1 if you have the strncmpi function. */ /* #undef HAVE_STRNCMPI */ /* Define to 1 if you have the strnicmp function. */ /* #undef HAVE_STRNICMP */ /* Define to 1 if you have the header file. */ #define HAVE_STROPTS_H 1 /* Define to 1 if you have struct addrinfo. */ #define HAVE_STRUCT_ADDRINFO 1 /* Define to 1 if you have struct in6_addr. */ #define HAVE_STRUCT_IN6_ADDR 1 /* Define to 1 if you have struct sockaddr_in6. */ #define HAVE_STRUCT_SOCKADDR_IN6 1 /* if struct sockaddr_storage is defined */ #define HAVE_STRUCT_SOCKADDR_STORAGE 1 /* Define to 1 if you have the timeval struct. */ #define HAVE_STRUCT_TIMEVAL 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_IOCTL_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_PARAM_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_SELECT_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_SOCKET_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_STAT_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_TIME_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_TYPES_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_UIO_H 1 /* Define to 1 if you have the header file. */ #define HAVE_TIME_H 1 /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 /* Define to 1 if you have the windows.h header file. */ /* #undef HAVE_WINDOWS_H */ /* Define to 1 if you have the winsock2.h header file. */ /* #undef HAVE_WINSOCK2_H */ /* Define to 1 if you have the winsock.h header file. */ /* #undef HAVE_WINSOCK_H */ /* Define to 1 if you have the writev function. */ #define HAVE_WRITEV 1 /* Define to 1 if you have the ws2tcpip.h header file. */ /* #undef HAVE_WS2TCPIP_H */ /* Define to the sub-directory where libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" /* Define to 1 if you need the malloc.h header file even with stdlib.h */ /* #undef NEED_MALLOC_H */ /* Define to 1 if you need the memory.h header file even with stdlib.h */ /* #undef NEED_MEMORY_H */ /* Define to 1 if _REENTRANT preprocessor symbol must be defined. */ #define NEED_REENTRANT 1 /* Define to 1 if _THREAD_SAFE preprocessor symbol must be defined. */ /* #undef NEED_THREAD_SAFE */ /* cpu-machine-OS */ #define OS "i386-pc-solaris2.11" /* Name of package */ #define PACKAGE "c-ares" /* Define to the address where bug reports for this package should be sent. */ #define PACKAGE_BUGREPORT "c-ares mailing list: http://cool.haxx.se/mailman/listinfo/c-ares" /* Define to the full name of this package. */ #define PACKAGE_NAME "c-ares" /* Define to the full name and version of this package. */ #define PACKAGE_STRING "c-ares 1.13.0" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "c-ares" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ #define PACKAGE_VERSION "1.13.0" /* a suitable file/device to read random data from */ #define CARES_RANDOM_FILE "/dev/urandom" /* Define to the type qualifier pointed by arg 5 for recvfrom. */ #define RECVFROM_QUAL_ARG5 /* Define to the type of arg 1 for recvfrom. */ #define RECVFROM_TYPE_ARG1 int /* Define to the type pointed by arg 2 for recvfrom. */ #define RECVFROM_TYPE_ARG2 void /* Define to 1 if the type pointed by arg 2 for recvfrom is void. */ #define RECVFROM_TYPE_ARG2_IS_VOID 1 /* Define to the type of arg 3 for recvfrom. */ #define RECVFROM_TYPE_ARG3 size_t /* Define to the type of arg 4 for recvfrom. */ #define RECVFROM_TYPE_ARG4 int /* Define to the type pointed by arg 5 for recvfrom. */ #define RECVFROM_TYPE_ARG5 struct sockaddr /* Define to 1 if the type pointed by arg 5 for recvfrom is void. */ /* #undef RECVFROM_TYPE_ARG5_IS_VOID */ /* Define to the type pointed by arg 6 for recvfrom. */ #define RECVFROM_TYPE_ARG6 void /* Define to 1 if the type pointed by arg 6 for recvfrom is void. */ #define RECVFROM_TYPE_ARG6_IS_VOID 1 /* Define to the function return type for recvfrom. */ #define RECVFROM_TYPE_RETV int /* Define to the type of arg 1 for recv. */ #define RECV_TYPE_ARG1 int /* Define to the type of arg 2 for recv. */ #define RECV_TYPE_ARG2 void * /* Define to the type of arg 3 for recv. */ #define RECV_TYPE_ARG3 size_t /* Define to the type of arg 4 for recv. */ #define RECV_TYPE_ARG4 int /* Define to the function return type for recv. */ #define RECV_TYPE_RETV int /* Define as the return type of signal handlers (`int' or `void'). */ #define RETSIGTYPE void /* Define to the type qualifier of arg 2 for send. */ #define SEND_QUAL_ARG2 const /* Define to the type of arg 1 for send. */ #define SEND_TYPE_ARG1 int /* Define to the type of arg 2 for send. */ #define SEND_TYPE_ARG2 void * /* Define to the type of arg 3 for send. */ #define SEND_TYPE_ARG3 size_t /* Define to the type of arg 4 for send. */ #define SEND_TYPE_ARG4 int /* Define to the function return type for send. */ #define SEND_TYPE_RETV int /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* Define to 1 if you can safely include both and . */ #define TIME_WITH_SYS_TIME 1 /* Define to disable non-blocking sockets. */ /* #undef USE_BLOCKING_SOCKETS */ /* Version number of package */ #define VERSION "1.13.0" /* Define to avoid automatic inclusion of winsock.h */ /* #undef WIN32_LEAN_AND_MEAN */ /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD # if defined __BIG_ENDIAN__ # define WORDS_BIGENDIAN 1 # endif #else # ifndef WORDS_BIGENDIAN /* # undef WORDS_BIGENDIAN */ # endif #endif /* Define to 1 if OS is AIX. */ #ifndef _ALL_SOURCE /* # undef _ALL_SOURCE */ #endif /* Enable large inode numbers on Mac OS X 10.5. */ #ifndef _DARWIN_USE_64_BIT_INODE # define _DARWIN_USE_64_BIT_INODE 1 #endif /* Number of bits in a file offset, on hosts where this is settable. */ #define _FILE_OFFSET_BITS 64 /* Define for large files, on AIX-style hosts. */ /* #undef _LARGE_FILES */ /* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ /* Type to use in place of in_addr_t when system does not provide it. */ /* #undef in_addr_t */ /* Define to `unsigned int' if does not define. */ /* #undef size_t */ /* the signed version of size_t */ /* #undef ssize_t */ ././@PaxHeader0000000000000000000000000000003400000000000011452 xustar000000000000000028 mtime=1696604226.9674146 pycares-4.4.0/deps/build-config/include/0000755000175100001770000000000000000000000020713 5ustar00runnerdocker00000000000000././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604221.0 pycares-4.4.0/deps/build-config/include/ares_build.h0000644000175100001770000001537200000000000023205 0ustar00runnerdocker00000000000000#ifndef __CARES_BUILD_H #define __CARES_BUILD_H /* Copyright (C) 2009 - 2013 by Daniel Stenberg et al * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose and without fee is hereby granted, provided * that the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. M.I.T. makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. */ /* ================================================================ */ /* NOTES FOR CONFIGURE CAPABLE SYSTEMS */ /* ================================================================ */ /* * NOTE 1: * ------- * * See file ares_build.h.in, run configure, and forget that this file * exists it is only used for non-configure systems. * But you can keep reading if you want ;-) * */ /* ================================================================ */ /* NOTES FOR NON-CONFIGURE SYSTEMS */ /* ================================================================ */ /* * NOTE 1: * ------- * * Nothing in this file is intended to be modified or adjusted by the * c-ares library user nor by the c-ares library builder. * * If you think that something actually needs to be changed, adjusted * or fixed in this file, then, report it on the c-ares development * mailing list: http://cool.haxx.se/mailman/listinfo/c-ares/ * * Try to keep one section per platform, compiler and architecture, * otherwise, if an existing section is reused for a different one and * later on the original is adjusted, probably the piggybacking one can * be adversely changed. * * In order to differentiate between platforms/compilers/architectures * use only compiler built in predefined preprocessor symbols. * * This header file shall only export symbols which are 'cares' or 'CARES' * prefixed, otherwise public name space would be polluted. * * NOTE 2: * ------- * * Right now you might be staring at file ares_build.h.dist or ares_build.h, * this is due to the following reason: file ares_build.h.dist is renamed * to ares_build.h when the c-ares source code distribution archive file is * created. * * File ares_build.h.dist is not included in the distribution archive. * File ares_build.h is not present in the git tree. * * The distributed ares_build.h file is only intended to be used on systems * which can not run the also distributed configure script. * * On systems capable of running the configure script, the configure process * will overwrite the distributed ares_build.h file with one that is suitable * and specific to the library being configured and built, which is generated * from the ares_build.h.in template file. * * If you check out from git on a non-configure platform, you must run the * appropriate buildconf* script to set up ares_build.h and other local files. * */ /* ================================================================ */ /* DEFINITION OF THESE SYMBOLS SHALL NOT TAKE PLACE ANYWHERE ELSE */ /* ================================================================ */ #ifdef CARES_TYPEOF_ARES_SOCKLEN_T # error "CARES_TYPEOF_ARES_SOCKLEN_T shall not be defined except in ares_build.h" Error Compilation_aborted_CARES_TYPEOF_ARES_SOCKLEN_T_already_defined #endif /* ================================================================ */ /* EXTERNAL INTERFACE SETTINGS FOR NON-CONFIGURE SYSTEMS ONLY */ /* ================================================================ */ #if defined(__DJGPP__) || defined(__GO32__) # define CARES_TYPEOF_ARES_SOCKLEN_T int #elif defined(__SALFORDC__) # define CARES_TYPEOF_ARES_SOCKLEN_T int #elif defined(__BORLANDC__) # define CARES_TYPEOF_ARES_SOCKLEN_T int #elif defined(__TURBOC__) # define CARES_TYPEOF_ARES_SOCKLEN_T int #elif defined(__WATCOMC__) # define CARES_TYPEOF_ARES_SOCKLEN_T int #elif defined(__POCC__) # define CARES_TYPEOF_ARES_SOCKLEN_T int #elif defined(__LCC__) # define CARES_TYPEOF_ARES_SOCKLEN_T int #elif defined(__SYMBIAN32__) # define CARES_TYPEOF_ARES_SOCKLEN_T unsigned int #elif defined(__MWERKS__) # define CARES_TYPEOF_ARES_SOCKLEN_T int #elif defined(_WIN32_WCE) # define CARES_TYPEOF_ARES_SOCKLEN_T int #elif defined(__MINGW32__) # define CARES_TYPEOF_ARES_SOCKLEN_T int #elif defined(__VMS) # define CARES_TYPEOF_ARES_SOCKLEN_T unsigned int #elif defined(__OS400__) # if defined(__ILEC400__) # define CARES_TYPEOF_ARES_SOCKLEN_T socklen_t # define CARES_PULL_SYS_TYPES_H 1 # define CARES_PULL_SYS_SOCKET_H 1 # endif #elif defined(__MVS__) # if defined(__IBMC__) || defined(__IBMCPP__) # define CARES_TYPEOF_ARES_SOCKLEN_T socklen_t # define CARES_PULL_SYS_TYPES_H 1 # define CARES_PULL_SYS_SOCKET_H 1 # endif #elif defined(__370__) # if defined(__IBMC__) || defined(__IBMCPP__) # define CARES_TYPEOF_ARES_SOCKLEN_T socklen_t # define CARES_PULL_SYS_TYPES_H 1 # define CARES_PULL_SYS_SOCKET_H 1 # endif #elif defined(TPF) # define CARES_TYPEOF_ARES_SOCKLEN_T int /* ===================================== */ /* KEEP MSVC THE PENULTIMATE ENTRY */ /* ===================================== */ #elif defined(_MSC_VER) # define CARES_TYPEOF_ARES_SOCKLEN_T int /* ===================================== */ /* KEEP GENERIC GCC THE LAST ENTRY */ /* ===================================== */ #elif defined(__GNUC__) # define CARES_TYPEOF_ARES_SOCKLEN_T socklen_t # define CARES_PULL_SYS_TYPES_H 1 # define CARES_PULL_SYS_SOCKET_H 1 #else # error "Unknown non-configure build target!" Error Compilation_aborted_Unknown_non_configure_build_target #endif /* CARES_PULL_SYS_TYPES_H is defined above when inclusion of header file */ /* sys/types.h is required here to properly make type definitions below. */ #ifdef CARES_PULL_SYS_TYPES_H # include #endif /* CARES_PULL_SYS_SOCKET_H is defined above when inclusion of header file */ /* sys/socket.h is required here to properly make type definitions below. */ #ifdef CARES_PULL_SYS_SOCKET_H # include #endif /* Data type definition of ares_socklen_t. */ #ifdef CARES_TYPEOF_ARES_SOCKLEN_T typedef CARES_TYPEOF_ARES_SOCKLEN_T ares_socklen_t; #endif /* Data type definition of ares_ssize_t. */ #ifdef _WIN32 # ifdef _WIN64 # define CARES_TYPEOF_ARES_SSIZE_T __int64 # else # define CARES_TYPEOF_ARES_SSIZE_T long # endif #else # define CARES_TYPEOF_ARES_SSIZE_T ssize_t #endif typedef CARES_TYPEOF_ARES_SSIZE_T ares_ssize_t; #endif /* __CARES_BUILD_H */ ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604221.0 pycares-4.4.0/deps/build-config/include/ares_nameser.h0000644000175100001770000003211700000000000023534 0ustar00runnerdocker00000000000000 #ifndef ARES_NAMESER_H #define ARES_NAMESER_H #ifdef HAVE_ARPA_NAMESER_H # include #endif #ifdef HAVE_ARPA_NAMESER_COMPAT_H # include #endif /* ============================================================================ * arpa/nameser.h may or may not provide ALL of the below defines, so check * each one individually and set if not * ============================================================================ */ #ifndef NS_PACKETSZ # define NS_PACKETSZ 512 /* maximum packet size */ #endif #ifndef NS_MAXDNAME # define NS_MAXDNAME 256 /* maximum domain name */ #endif #ifndef NS_MAXCDNAME # define NS_MAXCDNAME 255 /* maximum compressed domain name */ #endif #ifndef NS_MAXLABEL # define NS_MAXLABEL 63 #endif #ifndef NS_HFIXEDSZ # define NS_HFIXEDSZ 12 /* #/bytes of fixed data in header */ #endif #ifndef NS_QFIXEDSZ # define NS_QFIXEDSZ 4 /* #/bytes of fixed data in query */ #endif #ifndef NS_RRFIXEDSZ # define NS_RRFIXEDSZ 10 /* #/bytes of fixed data in r record */ #endif #ifndef NS_INT16SZ # define NS_INT16SZ 2 #endif #ifndef NS_INADDRSZ # define NS_INADDRSZ 4 #endif #ifndef NS_IN6ADDRSZ # define NS_IN6ADDRSZ 16 #endif #ifndef NS_CMPRSFLGS # define NS_CMPRSFLGS 0xc0 /* Flag bits indicating name compression. */ #endif #ifndef NS_DEFAULTPORT # define NS_DEFAULTPORT 53 /* For both TCP and UDP. */ #endif /* ============================================================================ * arpa/nameser.h should provide these enumerations always, so if not found, * provide them * ============================================================================ */ #ifndef HAVE_ARPA_NAMESER_H typedef enum __ns_class { ns_c_invalid = 0, /* Cookie. */ ns_c_in = 1, /* Internet. */ ns_c_2 = 2, /* unallocated/unsupported. */ ns_c_chaos = 3, /* MIT Chaos-net. */ ns_c_hs = 4, /* MIT Hesiod. */ /* Query class values which do not appear in resource records */ ns_c_none = 254, /* for prereq. sections in update requests */ ns_c_any = 255, /* Wildcard match. */ ns_c_max = 65536 } ns_class; typedef enum __ns_type { ns_t_invalid = 0, /* Cookie. */ ns_t_a = 1, /* Host address. */ ns_t_ns = 2, /* Authoritative server. */ ns_t_md = 3, /* Mail destination. */ ns_t_mf = 4, /* Mail forwarder. */ ns_t_cname = 5, /* Canonical name. */ ns_t_soa = 6, /* Start of authority zone. */ ns_t_mb = 7, /* Mailbox domain name. */ ns_t_mg = 8, /* Mail group member. */ ns_t_mr = 9, /* Mail rename name. */ ns_t_null = 10, /* Null resource record. */ ns_t_wks = 11, /* Well known service. */ ns_t_ptr = 12, /* Domain name pointer. */ ns_t_hinfo = 13, /* Host information. */ ns_t_minfo = 14, /* Mailbox information. */ ns_t_mx = 15, /* Mail routing information. */ ns_t_txt = 16, /* Text strings. */ ns_t_rp = 17, /* Responsible person. */ ns_t_afsdb = 18, /* AFS cell database. */ ns_t_x25 = 19, /* X_25 calling address. */ ns_t_isdn = 20, /* ISDN calling address. */ ns_t_rt = 21, /* Router. */ ns_t_nsap = 22, /* NSAP address. */ ns_t_nsap_ptr = 23, /* Reverse NSAP lookup (deprecated). */ ns_t_sig = 24, /* Security signature. */ ns_t_key = 25, /* Security key. */ ns_t_px = 26, /* X.400 mail mapping. */ ns_t_gpos = 27, /* Geographical position (withdrawn). */ ns_t_aaaa = 28, /* Ip6 Address. */ ns_t_loc = 29, /* Location Information. */ ns_t_nxt = 30, /* Next domain (security). */ ns_t_eid = 31, /* Endpoint identifier. */ ns_t_nimloc = 32, /* Nimrod Locator. */ ns_t_srv = 33, /* Server Selection. */ ns_t_atma = 34, /* ATM Address */ ns_t_naptr = 35, /* Naming Authority PoinTeR */ ns_t_kx = 36, /* Key Exchange */ ns_t_cert = 37, /* Certification record */ ns_t_a6 = 38, /* IPv6 address (deprecates AAAA) */ ns_t_dname = 39, /* Non-terminal DNAME (for IPv6) */ ns_t_sink = 40, /* Kitchen sink (experimentatl) */ ns_t_opt = 41, /* EDNS0 option (meta-RR) */ ns_t_apl = 42, /* Address prefix list (RFC3123) */ ns_t_ds = 43, /* Delegation Signer (RFC4034) */ ns_t_sshfp = 44, /* SSH Key Fingerprint (RFC4255) */ ns_t_rrsig = 46, /* Resource Record Signature (RFC4034) */ ns_t_nsec = 47, /* Next Secure (RFC4034) */ ns_t_dnskey = 48, /* DNS Public Key (RFC4034) */ ns_t_tkey = 249, /* Transaction key */ ns_t_tsig = 250, /* Transaction signature. */ ns_t_ixfr = 251, /* Incremental zone transfer. */ ns_t_axfr = 252, /* Transfer zone of authority. */ ns_t_mailb = 253, /* Transfer mailbox records. */ ns_t_maila = 254, /* Transfer mail agent records. */ ns_t_any = 255, /* Wildcard match. */ ns_t_zxfr = 256, /* BIND-specific, nonstandard. */ ns_t_caa = 257, /* Certification Authority Authorization. */ ns_t_max = 65536 } ns_type; typedef enum __ns_opcode { ns_o_query = 0, /* Standard query. */ ns_o_iquery = 1, /* Inverse query (deprecated/unsupported). */ ns_o_status = 2, /* Name server status query (unsupported). */ /* Opcode 3 is undefined/reserved. */ ns_o_notify = 4, /* Zone change notification. */ ns_o_update = 5, /* Zone update message. */ ns_o_max = 6 } ns_opcode; typedef enum __ns_rcode { ns_r_noerror = 0, /* No error occurred. */ ns_r_formerr = 1, /* Format error. */ ns_r_servfail = 2, /* Server failure. */ ns_r_nxdomain = 3, /* Name error. */ ns_r_notimpl = 4, /* Unimplemented. */ ns_r_refused = 5, /* Operation refused. */ /* these are for BIND_UPDATE */ ns_r_yxdomain = 6, /* Name exists */ ns_r_yxrrset = 7, /* RRset exists */ ns_r_nxrrset = 8, /* RRset does not exist */ ns_r_notauth = 9, /* Not authoritative for zone */ ns_r_notzone = 10, /* Zone of record different from zone section */ ns_r_max = 11, /* The following are TSIG extended errors */ ns_r_badsig = 16, ns_r_badkey = 17, ns_r_badtime = 18 } ns_rcode; #endif /* HAVE_ARPA_NAMESER_H */ /* ============================================================================ * arpa/nameser_compat.h typically sets these. However on some systems * arpa/nameser.h does, but may not set all of them. Lets conditionally * define each * ============================================================================ */ #ifndef PACKETSZ # define PACKETSZ NS_PACKETSZ #endif #ifndef MAXDNAME # define MAXDNAME NS_MAXDNAME #endif #ifndef MAXCDNAME # define MAXCDNAME NS_MAXCDNAME #endif #ifndef MAXLABEL # define MAXLABEL NS_MAXLABEL #endif #ifndef HFIXEDSZ # define HFIXEDSZ NS_HFIXEDSZ #endif #ifndef QFIXEDSZ # define QFIXEDSZ NS_QFIXEDSZ #endif #ifndef RRFIXEDSZ # define RRFIXEDSZ NS_RRFIXEDSZ #endif #ifndef INDIR_MASK # define INDIR_MASK NS_CMPRSFLGS #endif #ifndef NAMESERVER_PORT # define NAMESERVER_PORT NS_DEFAULTPORT #endif /* opcodes */ #ifndef O_QUERY # define O_QUERY 0 /* ns_o_query */ #endif #ifndef O_IQUERY # define O_IQUERY 1 /* ns_o_iquery */ #endif #ifndef O_STATUS # define O_STATUS 2 /* ns_o_status */ #endif #ifndef O_NOTIFY # define O_NOTIFY 4 /* ns_o_notify */ #endif #ifndef O_UPDATE # define O_UPDATE 5 /* ns_o_update */ #endif /* response codes */ #ifndef SERVFAIL # define SERVFAIL ns_r_servfail #endif #ifndef NOTIMP # define NOTIMP ns_r_notimpl #endif #ifndef REFUSED # define REFUSED ns_r_refused #endif #if defined(_WIN32) && !defined(HAVE_ARPA_NAMESER_COMPAT_H) && defined(NOERROR) # undef NOERROR /* it seems this is already defined in winerror.h */ #endif #ifndef NOERROR # define NOERROR ns_r_noerror #endif #ifndef FORMERR # define FORMERR ns_r_formerr #endif #ifndef NXDOMAIN # define NXDOMAIN ns_r_nxdomain #endif /* Non-standard response codes, use numeric values */ #ifndef YXDOMAIN # define YXDOMAIN 6 /* ns_r_yxdomain */ #endif #ifndef YXRRSET # define YXRRSET 7 /* ns_r_yxrrset */ #endif #ifndef NXRRSET # define NXRRSET 8 /* ns_r_nxrrset */ #endif #ifndef NOTAUTH # define NOTAUTH 9 /* ns_r_notauth */ #endif #ifndef NOTZONE # define NOTZONE 10 /* ns_r_notzone */ #endif #ifndef TSIG_BADSIG # define TSIG_BADSIG 16 /* ns_r_badsig */ #endif #ifndef TSIG_BADKEY # define TSIG_BADKEY 17 /* ns_r_badkey */ #endif #ifndef TSIG_BADTIME # define TSIG_BADTIME 18 /* ns_r_badtime */ #endif /* classes */ #ifndef C_IN # define C_IN 1 /* ns_c_in */ #endif #ifndef C_CHAOS # define C_CHAOS 3 /* ns_c_chaos */ #endif #ifndef C_HS # define C_HS 4 /* ns_c_hs */ #endif #ifndef C_NONE # define C_NONE 254 /* ns_c_none */ #endif #ifndef C_ANY # define C_ANY 255 /* ns_c_any */ #endif /* types */ #ifndef T_A # define T_A 1 /* ns_t_a */ #endif #ifndef T_NS # define T_NS 2 /* ns_t_ns */ #endif #ifndef T_MD # define T_MD 3 /* ns_t_md */ #endif #ifndef T_MF # define T_MF 4 /* ns_t_mf */ #endif #ifndef T_CNAME # define T_CNAME 5 /* ns_t_cname */ #endif #ifndef T_SOA # define T_SOA 6 /* ns_t_soa */ #endif #ifndef T_MB # define T_MB 7 /* ns_t_mb */ #endif #ifndef T_MG # define T_MG 8 /* ns_t_mg */ #endif #ifndef T_MR # define T_MR 9 /* ns_t_mr */ #endif #ifndef T_NULL # define T_NULL 10 /* ns_t_null */ #endif #ifndef T_WKS # define T_WKS 11 /* ns_t_wks */ #endif #ifndef T_PTR # define T_PTR 12 /* ns_t_ptr */ #endif #ifndef T_HINFO # define T_HINFO 13 /* ns_t_hinfo */ #endif #ifndef T_MINFO # define T_MINFO 14 /* ns_t_minfo */ #endif #ifndef T_MX # define T_MX 15 /* ns_t_mx */ #endif #ifndef T_TXT # define T_TXT 16 /* ns_t_txt */ #endif #ifndef T_RP # define T_RP 17 /* ns_t_rp */ #endif #ifndef T_AFSDB # define T_AFSDB 18 /* ns_t_afsdb */ #endif #ifndef T_X25 # define T_X25 19 /* ns_t_x25 */ #endif #ifndef T_ISDN # define T_ISDN 20 /* ns_t_isdn */ #endif #ifndef T_RT # define T_RT 21 /* ns_t_rt */ #endif #ifndef T_NSAP # define T_NSAP 22 /* ns_t_nsap */ #endif #ifndef T_NSAP_PTR # define T_NSAP_PTR 23 /* ns_t_nsap_ptr */ #endif #ifndef T_SIG # define T_SIG 24 /* ns_t_sig */ #endif #ifndef T_KEY # define T_KEY 25 /* ns_t_key */ #endif #ifndef T_PX # define T_PX 26 /* ns_t_px */ #endif #ifndef T_GPOS # define T_GPOS 27 /* ns_t_gpos */ #endif #ifndef T_AAAA # define T_AAAA 28 /* ns_t_aaaa */ #endif #ifndef T_LOC # define T_LOC 29 /* ns_t_loc */ #endif #ifndef T_NXT # define T_NXT 30 /* ns_t_nxt */ #endif #ifndef T_EID # define T_EID 31 /* ns_t_eid */ #endif #ifndef T_NIMLOC # define T_NIMLOC 32 /* ns_t_nimloc */ #endif #ifndef T_SRV # define T_SRV 33 /* ns_t_srv */ #endif #ifndef T_ATMA # define T_ATMA 34 /* ns_t_atma */ #endif #ifndef T_NAPTR # define T_NAPTR 35 /* ns_t_naptr */ #endif #ifndef T_KX # define T_KX 36 /* ns_t_kx */ #endif #ifndef T_CERT # define T_CERT 37 /* ns_t_cert */ #endif #ifndef T_A6 # define T_A6 38 /* ns_t_a6 */ #endif #ifndef T_DNAME # define T_DNAME 39 /* ns_t_dname */ #endif #ifndef T_SINK # define T_SINK 40 /* ns_t_sink */ #endif #ifndef T_OPT # define T_OPT 41 /* ns_t_opt */ #endif #ifndef T_APL # define T_APL 42 /* ns_t_apl */ #endif #ifndef T_DS # define T_DS 43 /* ns_t_ds */ #endif #ifndef T_SSHFP # define T_SSHFP 44 /* ns_t_sshfp */ #endif #ifndef T_RRSIG # define T_RRSIG 46 /* ns_t_rrsig */ #endif #ifndef T_NSEC # define T_NSEC 47 /* ns_t_nsec */ #endif #ifndef T_DNSKEY # define T_DNSKEY 48 /* ns_t_dnskey */ #endif #ifndef T_TKEY # define T_TKEY 249 /* ns_t_tkey */ #endif #ifndef T_TSIG # define T_TSIG 250 /* ns_t_tsig */ #endif #ifndef T_IXFR # define T_IXFR 251 /* ns_t_ixfr */ #endif #ifndef T_AXFR # define T_AXFR 252 /* ns_t_axfr */ #endif #ifndef T_MAILB # define T_MAILB 253 /* ns_t_mailb */ #endif #ifndef T_MAILA # define T_MAILA 254 /* ns_t_maila */ #endif #ifndef T_ANY # define T_ANY 255 /* ns_t_any */ #endif #ifndef T_ZXFR # define T_ZXFR 256 /* ns_t_zxfr */ #endif #ifndef T_CAA # define T_CAA 257 /* ns_t_caa */ #endif #ifndef T_MAX # define T_MAX 65536 /* ns_t_max */ #endif #endif /* ARES_NAMESER_H */ ././@PaxHeader0000000000000000000000000000003400000000000011452 xustar000000000000000028 mtime=1696604226.9714146 pycares-4.4.0/deps/c-ares/0000755000175100001770000000000000000000000016100 5ustar00runnerdocker00000000000000././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/.cirrus.yml0000644000175100001770000000607000000000000020213 0ustar00runnerdocker00000000000000env: CIRRUS_CLONE_DEPTH: 1 task: matrix: - name: "Debian amd64" env: DIST: "DEBIAN" LC_ALL: "C" SCAN_BUILD: "scan-build" MAKE: "make" container: image: debian:latest - name: "Debian arm64" env: DIST: "DEBIAN-ARM" LC_ALL: "C" SCAN_BUILD: "scan-build" MAKE: "make" arm_container: image: debian:latest - name: "FreeBSD amd64" env: DIST: "FREEBSD" SCAN_BUILD: "scan-build" MAKE: "gmake" freebsd_instance: image_family: freebsd-13-0 - name: "MacOS" env: DIST: "MACOS" SCAN_BUILD: "/usr/local/opt/llvm/bin/scan-build" MAKE: "make" macos_instance: image: big-sur-xcode matrix: - name: "CMAKE" env: BUILD_TYPE: "cmake" - name: "AUTOTOOLS" env: BUILD_TYPE: "autotools" - name: "ASAN" # FreeBSD just hangs trying to run tests, think it may be trying to run leak sanitizer only_if: $DIST != 'FREEBSD' env: BUILD_TYPE: "asan" CONFIG_OPTS: "--enable-debug" CFLAGS: "-fsanitize=address" CXXFLAGS: "-fsanitize=address" LDFLAGS: "-fsanitize=address" - name: "ANALYZE" env: BUILD_TYPE: "analyze" SCAN_WRAP: "${SCAN_BUILD} -v --status-bugs" CONFIG_OPTS: "--enable-debug --disable-tests" - name: "VALGRIND" # FreeBSD just hangs trying to run tests, think it may be trying to run leak sanitizer only_if: $DIST == 'DEBIAN' env: BUILD_TYPE: "valgrind" TEST_WRAP: "valgrind --leak-check=full" TEST_FILTER: "--gtest_filter=-*Container*:-*LiveSearchANY*" install_script: - | case "${DIST}" in DEBIAN*) apt-get update && \ apt-get install -y cmake ninja-build autoconf automake libtool g++ case "${BUILD_TYPE}" in asan) apt-get install -y clang ;; analyze) apt-get install -y clang clang-tools ;; valgrind) apt-get install -y valgrind ;; esac ;; FREEBSD) # pkg upgrade -y && \ pkg install -y cmake ninja case "${BUILD_TYPE}" in asan|analyze) pkg install -y llvm autoconf automake libtool gmake ;; autotools) pkg install -y autoconf automake libtool gmake ;; esac ;; MACOS) brew update && \ brew install ninja cmake case "${BUILD_TYPE}" in asan|analyze) brew install llvm autoconf automake libtool make ;; autotools) brew install autoconf automake libtool make ;; esac ;; esac script: - ./ci/build.sh - ./ci/test.sh - if [ "$BUILD_TYPE" = "autotools" -a "$DIST" = "DEBIAN" ]; then ./ci/distcheck.sh ; fi - if [ "$BUILD_TYPE" = "coverage" ]; then ./ci/covupload.sh ; fi ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604222.0 pycares-4.4.0/deps/c-ares/.git0000644000175100001770000000004700000000000016665 0ustar00runnerdocker00000000000000gitdir: ../../.git/modules/deps/c-ares ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/.gitignore0000644000175100001770000000106300000000000020070 0ustar00runnerdocker00000000000000.deps .libs *.lib *.pdb *.dll *.exe *.obj .*.swp Debug Release *.exp Makefile Makefile.in aclocal.m4 autom4te.cache config.guess config.log config.status config.sub configure depcomp libtool ltmain.sh compile libcares.pc missing test-driver c-ares-*.tar.gz INSTALL install-sh *.o *.lo *.la *.gcno *.gcda *.gcov c-ares---coverage.info c-ares---coverage mkinstalldirs tags TAGS *~ aclocal.m4.bak acountry adig ahost ares_build.h ares_config.h ares_config.h.in stamp-h1 stamp-h2 ares_*pdf CHANGES.dist c-ares-*.tar.gz.asc ares_parse_mx_reply.pdf /[0-9]*.patch build ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/.travis.yml0000644000175100001770000001017300000000000020213 0ustar00runnerdocker00000000000000language: c++ dist: bionic sudo: false addons: apt: packages: - cmake - lcov - clang-tools-7 - valgrind matrix: include: - os: linux compiler: gcc env: BUILD_TYPE=normal - os: linux compiler: clang env: BUILD_TYPE=normal - os: linux compiler: gcc env: BUILD_TYPE=cmake - os: linux compiler: clang env: BUILD_TYPE=cmake - os: linux compiler: gcc env: BUILD_TYPE=coverage - os: linux compiler: clang env: BUILD_TYPE=ubsan - os: linux compiler: clang env: BUILD_TYPE=asan - os: linux compiler: clang env: BUILD_TYPE=lsan - os: linux compiler: clang env: BUILD_TYPE=analyze - os: linux compiler: gcc env: BUILD_TYPE=valgrind - os: osx osx_image: xcode11.4 compiler: gcc env: BUILD_TYPE=normal - os: osx osx_image: xcode11.4 compiler: clang env: BUILD_TYPE=normal - os: osx osx_image: xcode11.4 compiler: clang env: BUILD_TYPE=cmake - os: osx osx_image: xcode11.4 compiler: clang language: objective-c env: BUILD_TYPE=ios - os: osx osx_image: xcode11.4 compiler: clang language: objective-c env: BUILD_TYPE=ios-cmake install: - if [ "$TRAVIS_OS_NAME" != "osx" ]; then pip install --user cpp-coveralls > /dev/null; fi - if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew reinstall libtool > /dev/null; fi before_script: - | if [ "$BUILD_TYPE" = "coverage" ]; then export CONFIG_OPTS="--enable-debug --disable-shared --enable-code-coverage --enable-tests" fi - | if [ "$BUILD_TYPE" = "asan" ]; then export CONFIG_OPTS=--enable-debug export CFLAGS=-fsanitize=address export CXXFLAGS=-fsanitize=address export LDFLAGS=-fsanitize=address fi - | if [ "$BUILD_TYPE" = "lsan" ]; then export CONFIG_OPTS=--enable-debug export CFLAGS=-fsanitize=leak export CXXFLAGS=-fsanitize=leak export LDFLAGS=-fsanitize=leak fi - | if [ "$BUILD_TYPE" = "ubsan" ]; then export CFLAGS="-fsanitize=undefined -fno-sanitize-recover" export LDFLAGS="-fsanitize=undefined" fi - | if [ "$BUILD_TYPE" = "analyze" ]; then export SCAN_WRAP="scan-build-7 --status-bugs" export CONFIG_OPTS="--enable-debug --disable-tests" export CXX="clang++-7" export CC="clang-7" fi - | if [ "$BUILD_TYPE" = "valgrind" ]; then export TEST_WRAP='valgrind --leak-check=full' # Skip container tests as valgrind doesn't cope with clone() export TEST_FILTER="--gtest_filter=-*Container*:-*LiveSearchANY*" fi - | if [ "$BUILD_TYPE" = "ios" ]; then export CONFIG_OPTS="--host=arm-apple-darwin10 --disable-tests" export DEVPATH=`xcode-select -print-path`/Platforms/iPhoneOS.platform/Developer export IOSFLAGS="-isysroot $DEVPATH/SDKs/iPhoneOS.sdk -arch armv7 -miphoneos-version-min=8.0.0" export CFLAGS=$IOSFLAGS export CXXFLAGS=$IOSFLAGS export LDFLAGS=$IOSFLAGS fi - | if [ "$BUILD_TYPE" = "ios-cmake" ]; then export SYSROOT="$(xcode-select -print-path)/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/" export IOSFLAGS="-miphoneos-version-min=10.0" export ARCHITECTURES="armv7;armv7s;arm64" export CFLAGS=$IOSFLAGS export CXXFLAGS=$IOSFLAGS export LDFLAGS=$IOSFLAGS fi script: - ./ci/build.sh && ./ci/test.sh - if [ "$BUILD_TYPE" = "normal" ]; then ./ci/distcheck.sh ; fi - if [ "$BUILD_TYPE" = "coverage" ]; then ./ci/covupload.sh ; fi ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/AUTHORS0000644000175100001770000000235200000000000017152 0ustar00runnerdocker00000000000000c-ares is based on ares, and these are the people that have worked on it since the fork was made: Albert Chin Alex Loukissas Alexander Klauer Alexander Lazic Alexey Simak Andreas Rieke Andrew Andkjar Andrew Ayer Andrew C. Morrow Ashish Sharma Ben Greear Ben Noordhuis BogDan Vatra Brad House Brad Spencer Bram Matthys Chris Araman Dan Fandrich Daniel Johnson Daniel Stenberg David Drysdale David Stuart Denis Bilenko Dima Tisnek Dirk Manske Dominick Meglio Doug Goldstein Doug Kwan Duncan Wilcox Eino Tuominen Erik Kline Fedor Indutny Frederic Germain Geert Uytterhoeven George Neill Gisle Vanem Google LLC Gregor Jasny Guenter Knauf Guilherme Balena Versiani Gunter Knauf Henrik Stoerner Jakub Hrozek James Bursa Jérémy Lal John Schember Keith Shaw Lei Shi Marko Kreen Michael Wallner Mike Crowe Nick Alcock Nick Mathewson Nicolas "Pixel" Noble Ning Dong Oleg Pudeyev Patrick Valsecchi Patrik Thunstrom Paul Saab Peter Pentchev Phil Blundell Poul Thomas Lomholt Ravi Pratap Robin Cornelius Saúl Ibarra Corretgé Sebastian at basti79.de Shmulik Regev Stefan Bühler Steinar H. Gunderson Svante Karlsson Tofu Linden Tom Hughes Tor Arntsen Viktor Szakats Vlad Dinulescu William Ahern Yang Tse hpopescu at ixiacom.com liren at vivisimo.com nordsturm saghul ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/CHANGES0000644000175100001770000000037400000000000017077 0ustar00runnerdocker00000000000000This file no longer holds the changelog. Now you can generate it yourself like this: $ git log --pretty=fuller --no-color --date=short --decorate=full -1000 | ./git2changes.pl The older, manually edited, changelog is found in git named CHANGES.0 ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/CHANGES.00000644000175100001770000013413000000000000017233 0ustar00runnerdocker00000000000000 Changelog for the c-ares project Version 1.7.5 (August 16, 2011) Fixed: o detection of semicolon comments in resolv.conf o avoid using system's inet_net_pton affected by the WLB-2008080064 advisory o replacement ares_inet_net_pton affected by the WLB-2008080064 advisory o replacement ares_inet_ntop affected by potential out of bounds write o added install target to Makefile.msvc o only fall back to AF_INET searches when looking for AF_UNSPEC addresses o fixed ares_parse_*_reply memory leaks o Use correct sizeof in ares_getnameinfo() o IPv6-on-windows: find DNS servers correctly o man pages: docs for the c-ares utility programs o getservbyport replacement for Win CE o config_sortlist: (win32) missing else o advance_tcp_send_queue: avoid NULL ptr dereference o configure: fix a bashism o ares_expand_name: Fix encoded length for indirect root Version 1.7.4 (December 9, 2010) Changed: o local-bind: Support binding to local interface/IPs, see ares_set_local_ip4, ares_set_local_ip6, ares_set_local_dev Fixed: o memory leak in ares_getnameinfo o add missing break that caused get_ares_servers to fail o ares_parse_a_reply: fix CNAME response parsing o init_by_options: don't copy an empty sortlist o Replaced uint32_t with unsigned int to fix broken builds on a couple of platforms o Fix lookup with HOSTALIASES set o adig: fix NAPTR parsing o compiler warning cleanups Version 1.7.3 (June 11, 2010) Fixed: o builds on Android o now includes all files necessary to build it (1.7.2 lacked a file) Version 1.7.2 (June 10, 2010) Changed: o Added ares_parse_mx_reply() Fixed: o ares_init: Last, not first instance of domain or search should win o improve alternative definition of bool o fix VS2010 compiler warnings Version 1.7.1 (Mar 23, 2010) * May 31, 2010 (Jakub Hrozek) - Use the last instance of domain/search, not the first one * March 23, 2010 (Daniel Stenberg) - We switched from CVS to git. See http://github.com/bagder/c-ares * March 5, 2010 (Daniel Stenberg) - Daniel Johnson provided fixes for building with the clang compiler. * March 5, 2010 (Yang Tse) - Added IPv6 name servers support. Implementation has been based on code, comments and feedback provided November and December of 2008 by Daniel Stenberg, Gregor Jasny, Phil Blundell and myself, December 2009 by Cedric Bail, and February 2010 by Jakub Hrozek on the c-ares mailing list. On March I reviewed all that, selected the best of each, and adjusted or extended parts of it to make the best fit. The external and visible result of all this is that two new functions are added to the external API, ares_get_servers() and ares_set_servers(), which becomes now the preferred way of getting and setting name servers for any ares channel as these support both IPv4 and IPv6 name servers. In order to not break ABI compatibility, ares_init_options() with option mask ARES_OPT_SERVERS and ares_save_options() may still be used in code which is intended to run on IPv4-only stacks. But remember that these functions do not support IPv6 name servers. This implies that if the user is capable of defining or providing an IPv6 name server, and the app is using ares_init_options() or ares_save_options() at some point to handle the name servers, the app will likely lose IPv6 name servers. * January 28, 2010 (Daniel Stenberg) - Tommie Gannert pointed out a silly bug in ares_process_fd() since it didn't check for broken connections like ares_process() did. Based on that, I merged the two functions into a single generic one with two front-ends. * December 29, 2009 (Yang Tse) - Laszlo Tamas Szabo adjusted Makefile.msvc compiler options so that where run-time error checks enabling compiler option /GZ was used it is replaced with equivalent /RTCsu for Visual Studio 2003 and newer versions. Option /GX is replaced with equivalent /EHsc for all versions. Also fixed socket data type for internal configure_socket function. * December 21, 2009 (Yang Tse) - Ingmar Runge noticed that Windows config-win32.h configuration file did not include a definition for HAVE_CLOSESOCKET which resulted in function close() being inappropriately used to close sockets. Version 1.7.0 (Nov 30, 2009) * November 26, 2009 (Yang Tse) - Larry Lansing fixed ares_parse_srv_reply to properly parse replies which might contain non-SRV answers, skipping over potential non-SRV ones such as CNAMEs. * November 23, 2009 (Yang Tse) - Changed naming convention for c-ares libraries built with MSVC, details and build instructions provided in README.msvc file. * November 22, 2009 (Yang Tse) - Jakub Hrozek fixed more function prototypes in man pages to sync them with the ones declared in ares.h - Jakub Hrozek renamed addrttl and addr6ttl structs to ares_addrttl and ares_addr6ttl in order to prevent name space pollution, along with necessary changes to code base and man pages.This change does not break ABI, there is no need to recompile existing applications. But existing applications using these structs with the old name will need source code adjustments when recompiled using c-ares 1.7.0. * November 21, 2009 (Yang Tse) - Added manifest stuff to Makefile.msvc. * November 20, 2009 (Yang Tse) - Fixed several function prototypes in man pages that were out of sync with the ones declared in ares.h. Added ares_free_data() along with man page. Updated ares_parse_srv_reply() and ares_parse_txt_reply() with changes from Jakub Hrozek making these now return linked lists instead of arrays, and merging the ares_free_data() adjustments. * November 10, 2009 (Yang Tse) - Updated MSVC 6.0 project files to match settings from Makefile.msvc. * November 9, 2009 (Yang Tse) - Makefile.msvc is now the reference method to build c-ares and sample programs with any MSVC compiler or MS Visual Studio version. If no option or target are specified it builds dynamic and static c-ares libraries in debug and release flavours and also builds all sample programs using each of the different c-ares libraries. * November 2, 2009 (Yang Tse) - Renamed c-ares setup.h to ares_setup.h * October 31, 2009 (Yang Tse) - Symbol hiding configure options are named now --enable-symbol-hiding and --disable-symbol-hiding in an attempt to make them less ambiguous. * October 30, 2009 (Yang Tse) - Many fixes for ares_parse_txt_reply() * October 29, 2009 (Daniel Stenberg) - Jakub Hrozek added ares_parse_txt_reply() for TXT parsing * October 29, 2009 (Yang Tse) - Updated MSVC 6.0 workspace and project files that allows building dynamic and static c-ares libraries in debug and release flavours. Additionally each of the three sample programs is built against each of the four possible c-ares libraries, generating all this a total number of 12 executables and 4 libraries. * October 28, 2009 (Yang Tse) - Initial step towards the ability to reduce c-ares exported symbols when built as a shared library based on the 'visibility' attribute for GNUC and Intel compilers and based on __global for Sun compilers, taking also in account __declspec function decoration for Win32 and Symbian DLL's. * October 27, 2009 (Yang Tse) - Fixed Pelles C Win32 target compilation issues. * October 23, 2009 (Yang Tse) - John Engelhart noticed an unreleased problem relative to a duplicate ARES_ECANCELLED error code value and missing error code description. * October 7, 2009 (Yang Tse) - Overhauled ares__get_hostent() Fixing out of bounds memory overwrite triggered with malformed /etc/hosts file. Improving parsing of /etc/hosts file. Validating requested address family. Ensuring that failures always return a NULL pointer. Adjusting header inclusions. * October 6, 2009 (Yang Tse) - Fix ssize_t redefinition errors on WIN64 reported by Alexey Simak. * September 29, 2009 (Yang Tse) - Make configure script also check if _REENTRANT definition is required to make errno available as a preprocessor macro. * September 7, 2009 (Yang Tse) - Add T_SRV portability check to ares_parse_srv_reply.c * 4 Sep 2009 (Daniel Stenberg) - Jakub Hrozek added ares_parse_srv_reply() for SRV parsing * 3 Aug 2009 (Daniel Stenberg) - Joshua Kwan fixed the init routine to fill in the defaults for stuff that fails to get inited by other means. This fixes a case of when the c-ares init fails when internet access is fone. - Timo Teras changed the reason code used in the resolve callback done when ares_cancel() is used, to be ARES_ECANCELLED instead of ARES_ETIMEOUT to better allow the callback to know what's happening. * 14 Jul 2009 (Guenter Knauf) - renamed generated config.h to ares_config.h to avoid any future clashes with config.h from other projects. * June 20 2009 (Yang Tse) - Refactor how libraries are checked for connect() function in configure script and check for connect() as it is done for other functions. * June 19 2009 (Yang Tse) - Make sclose() function-like macro definition used to close a socket, now solely based on HAVE_CLOSESOCKET and HAVE_CLOSESOCKET_CAMEL config file preprocessor definitions * June 18 2009 (Yang Tse) - Add CloseSocket camel case function check for configure script. * June 17 2009 (Yang Tse) - Check for socket() and closesocket() as it is done for other functions in configure script. * June 11 2009 (Yang Tse) - Modified buildconf so that when automake runs it copies missing files instead of symlinking them. * June 8 2009 (Yang Tse) - Removed buildconf.bat from release and daily snapshot archives. This file is only for CVS tree checkout builds. * May 26 2009 (Yang Tse) - Added --enable-curldebug configure option to enable and disable building with the low-level curl debug memory tracking 'feature' to allow decoupled setting from --enable-debug, allowing again to build c-ares independently out of the CVS tree. For the c-ares library option --enable-debug enables debug build features which are _not_ related with memory tracking. For the c-ares library when --enable-debug is given it does not enable the memory tracking feature. If you wish to enable the curl debug memory tracking you must use configure option --enable-curldebug explicitily to do so. Internally, definition of preprocessor symbol DEBUGBUILD restricts code which is only compiled for debug enabled builds. And symbol CURLDEBUG is used to differentiate code which is _only_ used for memory tracking. Make ares_init(), ares_dup() and ares_init_options() fail returning ARES_ENOTINITIALIZED if library initialization has not been performed calling ares_library_init(). * May 20 2009 (Yang Tse) - Added ares_library_init() and ares_library_cleanup() man pages. * May 19 2009 (Yang Tse) - Introduced ares_library_init() and ares_library_cleanup() functions. This is an API and ABI break for Win32/64 systems. Non-Win32/64 build targets using c-ares 1.7.0 can still survive without calling these functions. Read all the details on ares_library_init(3) and ares_library_cleanup(3) man pages that are included. curl/libcurl 7.19.5 is fully compatible with c-ares 1.7.0 on all systems. In order to use c-ares 1.7.0 with curl/libcurl on Win32/64 systems it is required that curl/libcurl is 7.19.5 or newer. In other words, it is not possible on Win32/64 to use c-ares 1.7.0 with a curl/libcurl version less than 7.19.5 * May 11 2009 (Daniel Stenberg) - Gregor Jasny made c-ares link with libtool 's -export-symbols-regex option to only expose functions starting with ares_. * May 7 2009 (Yang Tse) - Fix an m4 overquoting triggering a spurious 'AS_TR_CPP' symbol definition attempt in generated config.h * May 2 2009 (Yang Tse) - Use a build-time configured ares_socklen_t data type instead of socklen_t. * April 21 2009 (Yang Tse) - Moved potential inclusion of system's malloc.h and memory.h header files to setup_once.h. Inclusion of each header file is based on the definition of NEED_MALLOC_H and NEED_MEMORY_H respectively. * March 11 2009 (Yang Tse) - Japheth Cleaver fixed acountry.c replacing u_long with unsigned long. * February 20 2009 (Yang Tse) - Do not halt compilation when using VS2008 to build a Windows 2000 target. * February 3 2009 (Phil Blundell) - If the server returns garbage or nothing at all in response to an AAAA query, go on and ask for A records anyway. * January 31 2009 (Daniel Stenberg) - ares_gethostbyname() now accepts 'AF_UNSPEC' as a family for resolving either AF_INET6 or AF_INET. It works by accepting any of the looksups in the hosts file, and it resolves the AAAA field with a fallback to A. * January 14 2009 (Daniel Stenberg) - ares.h no longer uses the HAVE_STRUCT_IN6_ADDR define check, but instead it now declares the private struct ares_in6_addr for all systems instead of relying on one possibly not present in the system. * January 13 2009 (Phil Blundell) - ares__send_query() now varies the retry timeout pseudo-randomly to avoid packet storms when several queries were started at the same time. * January 11 2009 (Daniel Stenberg) - Phil Blundell added the internal function ares__expand_name_for_response() that is now used by the ares_parse_*_reply() functions instead of the ares_expand_name() simply to easier return ARES_EBADRESP for the cases where the name expansion fails as in responses that really isn't expected. Version 1.6.0 (Dec 9, 2008) * December 9 2008 (Gisle Vanem) Fixes for Win32 targets using the Watt-32 tcp/ip stack. * Dec 4 2008 (Daniel Stenberg) Gregor Jasny provided the patch that introduces ares_set_socket_callback(), and I edited it to also get duped by ares_dup(). * Dec 3 2008 (Daniel Stenberg) API changes: I made sure the public ares_config struct looks like before and yet it supports the ROTATE option thanks to c-ares now storing the "optmask" internally. Thus we should be ABI compatible with the past release(s) now. My efforts mentioned below should not break backwards ABI compliance. Here's how I suggest we proceed with the API: ares_init() will be primary "channel creator" function. ares_init_options() will continue to work exactly like now and before. For starters, it will be the (only) way to set the existing options. ares_save_options() will continue to work like today, but will ONLY save options that you can set today (including ARES_OPT_ROTATE actually) but new options that we add may not be saved with this. Instead we introduce: ares_dup() that instead can make a new channel and clone the config used from an existing channel. It will then clone all config options, including future new things we add. ares_set_*() style functions that set (new) config options. As a start we simply add these for new functionality, but over time we can also introduce them for existing "struct ares_options" so that we can eventually deprecate the two ares_*_options() functions. ares_get_*() style functions for extracting info from a channel handle that should be used instead of ares_save_options(). * Nov 26 2008 (Yang Tse) - Brad Spencer provided changes to allow buildconf to work on OS X. - Gerald Combs fixed a bug in ares_parse_ptr_reply() which would cause a buffer to shrink instead of expand if a reply contained 8 or more records. * Nov 25 2008 (Yang Tse) - In preparation for the upcomming IPv6 nameservers patch, the internal ares_addr union is now changed into an internal struct which also holds the address family. * Nov 19 2008 (Daniel Stenberg) - Brad Spencer brought the new function ares_gethostbyname_file() which simply resolves a host name from the given file, using the regular hosts syntax. * Nov 1 2008 (Daniel Stenberg) - Carlo Contavalli added support for the glibc "rotate" option, as documented in man resolv.conf: causes round robin selection of nameservers from among those listed. This has the effect of spreading the query load among all listed servers, rather than having all clients try the first listed server first every time. You can enable it with ARES_OPT_ROTATE * Oct 21 2008 (Yang Tse) Charles Hardin added handling of EINPROGRESS for UDP connects. * Oct 18 2008 (Daniel Stenberg) Charles Hardin made adig support a regular numerical dotted IP address for the -s option as well. * Oct 7 2008 (Yang Tse) - Added --enable-optimize configure option to enable and disable compiler optimizations to allow decoupled setting from --enable-debug. * Oct 2 2008 (Yang Tse) - Added --enable-warnings configure option to enable and disable strict compiler warnings to allow decoupled setting from --enable-debug. * Sep 17 2008 (Yang Tse) - Code reorganization to allow internal/private use of "nameser.h" to any system that lacks arpa/nameser.h or arpa/nameser_compat.h header files. * Sep 16 2008 (Yang Tse) - Code reorganization to allow internal/private use of ares_writev to any system that lacks the writev function. * Sep 15 2008 (Yang Tse) - Code reorganization to allow internal/private use of ares_strcasecmp to any system that lacks the strcasecmp function. - Improve configure detection of some string functions. * Sep 11 2008 (Yang Tse) - Code reorganization to allow internal/private use of ares_strdup to any system that lacks the strdup function. Version 1.5.3 (Aug 29, 2008) * Aug 25 2008 (Yang Tse) - Improvement by Brad House: This patch addresses an issue in which a response could be sent back to the source port of a client from a different address than the request was made to. This is one form of a DNS cache poisoning attack. The patch simply uses recvfrom() rather than recv() and validates that the address returned from recvfrom() matches the address of the server we have connected to. Only necessary on UDP sockets as they are connection-less, TCP is unaffected. - Fix by George Neill: Fixed compilation of acountry sample application failure on some systems. * Aug 4 2008 (Daniel Stenberg) - Fix by Tofu Linden: The symptom: * Users (usually, but not always) on 2-Wire routers and the Comcast service and a wired connection to their router would find that the second and subsequent DNS lookups from fresh processes using c-ares to resolve the same address would cause the process to never see a reply (it keeps polling for around 1m15s before giving up). The repro: * On such a machine (and yeah, it took us a lot of QA to find the systems that reproduce such a specific problem!), do 'ahost www.secondlife.com', then do it again. The first process's lookup will work, subsequent lookups will time-out and fail. The cause: * init_id_key() was calling randomize_key() *before* it initialized key->state, meaning that the randomness generated by randomize_key() is immediately overwritten with deterministic values. (/dev/urandom was also being read incorrectly in the c-ares version we were using, but this was fixed in a later version.) * This makes the stream of generated query-IDs from any new c-ares process be an identical and predictable sequence of IDs. * This makes the 2-Wire's default built-in DNS server detect these queries as probable-duplicates and (erroneously) not respond at all. * Aug 4 2008 (Yang Tse) - Autoconf 2.62 has changed the behaviour of the AC_AIX macro which we use. Prior versions of autoconf defined _ALL_SOURCE if _AIX was defined. 2.62 version of AC_AIX defines _ALL_SOURCE and other four preprocessor symbols no matter if the system is AIX or not. To keep the traditional behaviour, and an uniform one across autoconf versions AC_AIX is replaced with our own internal macro CARES_CHECK_AIX_ALL_SOURCE. * Aug 1 2008 (Yang Tse) - Configure process now checks if the preprocessor _REENTRANT symbol is already defined. If it isn't currently defined a set of checks are performed to test if its definition is required to make visible to the compiler a set of *_r functions. Finally, if _REENTRANT is already defined or needed it takes care of making adjustments necessary to ensure that it is defined equally for the configure process tests and generated config file. * Jul 20 2008 (Yang Tse) - When recvfrom prototype uses a void pointer for arguments 2, 5 or 6 this will now cause the definition, as appropriate, of RECVFROM_TYPE_ARG2_IS_VOID, RECVFROM_TYPE_ARG5_IS_VOID or RECVFROM_TYPE_ARG6_IS_VOID. * Jul 17 2008 (Yang Tse) - RECVFROM_TYPE_ARG2, RECVFROM_TYPE_ARG5 and RECVFROM_TYPE_ARG6 are now defined to the data type pointed by its respective argument and not the pointer type. * Jul 16 2008 (Yang Tse) - Improved configure detection of number of arguments for getservbyport_r. Detection is now based on compilation checks instead of linker ones. - Configure process now checks availability of recvfrom() socket function and finds out its return type and the types of its arguments. Added definitions for non-configure systems config files, and introduced macro sreadfrom which will be used on udp sockets as a recvfrom() wrapper in the future. * Jul 15 2008 (Yang Tse) - Introduce definition of _REENTRANT symbol in setup.h to improve library usability. Previously the configure process only used the AC_SYS_LARGEFILE macro for debug builds, now it is also used for non-debug ones enabling the use of configure options --enable-largefile and --disable-largefile which might be needed for library compatibility. Remove checking the size of curl_off_t, it is no longer needed. * Jul 3 2008 (Daniel Stenberg) - Phil Blundell: If you ask ares_gethostbyname() to do an AF_INET6 lookup and the target host has only A records, it automatically falls back to an AF_INET lookup and gives you the A results. However, if the target host has a CNAME record, this behaviour is defeated since the original query does return some data even though ares_parse_aaa_reply() doesn't consider it relevant. Here's a small patch to make it behave the same with and without the CNAME. * Jul 2 2008 (Yang Tse) - Fallback to gettimeofday when monotonic clock is unavailable at run-time. * Jun 30 2008 (Daniel Stenberg) - As was pointed out to me by Andreas Schuldei, the MAXHOSTNAMELEN define is not posix or anything and thus c-ares failed to build on hurd (and possibly elsewhere). The define was also somewhat artificially used in the windows port. Now, I instead rewrote the use of gethostbyname to enlarge the host name buffer in case of need and totally avoid the use of the MAXHOSTNAMELEN define. I thus also removed the defien from the namser.h file where it was once added for the windows build. I also fixed init_by_defaults() function to not leak memory in case if error. * Jun 9 2008 (Yang Tse) - Make libcares.pc generated file for pkg-config include information relative to the libraries needed for the static linking of c-ares. * May 30 2008 (Yang Tse) - Brad House fixed a missing header file inclusion in adig sample program. Version 1.5.2 (May 29, 2008) * May 13 2008 (Daniel Stenberg) - Introducing millisecond resolution support for the timeout option. See ares_init_options()'s ARES_OPT_TIMEOUTMS. * May 9 2008 (Yang Tse) - Use monotonic time source if available, for private function ares__tvnow() * May 7 2008 (Daniel Stenberg) - Sebastian made c-ares able to return all PTR-records when doing reverse lookups. It is not common practice to have multiple PTR-Records for a single IP, but its perfectly legal and some sites have those. - Doug Goldstein provided a configure patch: updates autoconf 2.13 usage to autoconf 2.57 usage (which is the version you have specified as the minimum version). It's a minor change but it does clean up some warnings with newer autoconf (specifically 2.62). * May 5 2008 (Yang Tse) - Improved parsing of resolver configuration files. * April 4 2008 (Daniel Stenberg) - Eino Tuominen improved the code when a file is used to seed the randomizer. - Alexey Simak made adig support NAPTR records - Alexey Simak fixed the VC dsp file by adding the missing source file ares_expand_string.c * December 11 2007 (Gisle Vanem) - Added another sample application; acountry.c which converts an IPv4-address(es) and/or host-name(s) to country-name and country-code. This uses the service of the DNSBL at countries.nerd.dk. * December 3 2007 (Daniel Stenberg) - Brad Spencer fixed the configure script to assume that there's no /dev/urandom when built cross-compiled as then the script cannot check for it. - Erik Kline cleaned up ares_gethostbyaddr.c:next_lookup() somewhat Version 1.5.1 (Nov 21, 2007) * November 21 2007 (Daniel Stenberg) - Robin Cornelius pointed out that ares_llist.h was missing in the release archive for 1.5.0 Version 1.5.0 (Nov 21, 2007) * October 2 2007 (Daniel Stenberg) - ares_strerror() segfaulted if the input error number was out of the currently supported range. - Yang Tse: Avoid a segfault when generating a DNS "Transaction ID" in internal function init_id_key() under low memory conditions. * September 28 2007 (Daniel Stenberg) - Bumped version to 1.5.0 for next release and soname bumped to 2 due to ABI and API changes in the progress callback (and possibly more coming up from Steinar) * September 28 2007 (Steinar H. Gunderson) - Don't skip a server if it's the only one. (Bugfix from the Google tree.) - Made the query callbacks receive the number of timeouts that happened during the execution of a query, and updated documentation accordingly. (Patch from the Google tree.) - Support a few more socket options: ARES_OPT_SOCK_SNDBUF and ARES_OPT_SOCK_RCVBUF - Always register for TCP events even if there are no outstanding queries, as the other side could always close the connection, which is a valid event which should be responded to. * September 22 2007 (Daniel Stenberg) - Steinar H. Gunderson fixed: Correctly clear sockets from the fd_set on in several functions (write_tcp_data, read_tcp_data, read_udp_packets) so that if it fails and the socket is closed the following code doesn't try to use the file descriptor. - Steinar H. Gunderson modified c-ares to now also do to DNS retries even when TCP is used since there are several edge cases where it still makes sense. - Brad House provided a fix for ares_save_options(): Apparently I overlooked something with the ares_save_options() where it would try to do a malloc(0) when no options of that type needed to be saved. On most platforms, this was fine because malloc(0) doesn't actually return NULL, but on AIX it does, so ares_save_options would return ARES_ENOMEM. * July 14 2007 (Daniel Stenberg) - Vlad Dinulescu fixed two outstanding valgrind reports: 1. In ares_query.c , in find_query_by_id we compare q->qid (which is a short int variable) with qid, which is declared as an int variable. Moreover, DNS_HEADER_SET_QID is used to set the value of qid, but DNS_HEADER_SET_QID sets only the first two bytes of qid. I think that qid should be declared as "unsigned short" in this function. 2. The same problem occurs in ares_process.c, process_answer() . query->qid (an unsigned short integer variable) is compared with id, which is an integer variable. Moreover, id is initialized from DNS_HEADER_QID which sets only the first two bytes of id. I think that the id variable should be declared as "unsigned short" in this function. Even after declaring these variables as "unsigned short", the valgrind errors are still there. Which brings us to the third problem. 3. The third problem is that Valgrind assumes that query->qid is not initialised correctly. And it does that because query->qid is set from DNS_HEADER_QID(qbuf); Valgrind says that qbuf has unitialised bytes. And qbuf has uninitialised bytes because of channel->next_id . And next_id is set by ares_init.c:ares__generate_new_id() . I found that putting short r=0 in this function (instead of short r) makes all Valgrind warnings go away. I have studied ares__rc4() too, and this is the offending line: buffer_ptr[counter] ^= state[xorIndex]; (ares_query.c:62) This is what triggers Valgrind.. buffer_ptr is unitialised in this function, and by applying ^= on it, it remains unitialised. Version 1.4.0 (June 8, 2007) * June 4 2007 (Daniel Stenberg) - James Bursa reported a major memory problem when resolving multi-IP names and I found and fixed the problem. It was added by Ashish Sharma's patch two days ago. When I then tried to verify multiple entries in /etc/hosts after my fix, I got another segfault and decided this code was not ripe for inclusion and I reverted the patch. * June 2 2007 - Brad Spencer found and fixed three flaws in the code, found with the new gcc 4.2.0 warning: -Waddress - Brad House fixed VS2005 compiler warnings due to time_t being 64bit. He also made recent Microsoft compilers use _strdup() instead of strdup(). - Brad House's man pages for ares_save_options() and ares_destroy_options() were added. - Ashish Sharma provided a patch for supporting multiple entries in the /etc/hosts file. Patch edited for coding style and functionality by me (Daniel). * May 30 2007 - Shmulik Regev brought cryptographically secure transaction IDs: The c-ares library implementation uses a DNS "Transaction ID" field that is seeded with a pseudo random number (based on gettimeofday) which is incremented (++) between consecutive calls and is therefore rather predictable. In general, predictability of DNS Transaction ID is a well known security problem (e.g. http://bak.spc.org/dms/archive/dns_id_attack.txt) and makes a c-ares based implementation vulnerable to DNS poisoning. Credit goes to Amit Klein (Trusteer) for identifying this problem. The patch I wrote changes the implementation to use a more secure way of generating unique IDs. It starts by obtaining a key with reasonable entropy which is used with an RC4 stream to generate the cryptographically secure transaction IDs. Note that the key generation code (in ares_init:randomize_key) has two versions, the Windows specific one uses a cryptographically safe function provided (but undocumented :) by the operating system (described at http://blogs.msdn.com/michael_howard/archive/2005/01/14/353379.aspx). The default implementation is a bit naive and uses the standard 'rand' function. Surely a better way to generate random keys exists for other platforms. The patch can be tested by using the adig utility and using the '-s' option. - Brad House added ares_save_options() and ares_destroy_options() that can be used to keep options for later re-usal when ares_init_options() is used. Problem: Calling ares_init() for each lookup can be unnecessarily resource intensive. On windows, it must LoadLibrary() or search the registry on each call to ares_init(). On unix, it must read and parse multiple files to obtain the necessary configuration information. In a single-threaded environment, it would make sense to only ares_init() once, but in a heavily multi-threaded environment, it is undesirable to ares_init() and ares_destroy() for each thread created and track that. Solution: Create ares_save_options() and ares_destroy_options() functions to retrieve and free options obtained from an initialized channel. The options populated can be used to pass back into ares_init_options(), it should populate all needed fields and not retrieve any information from the system. Probably wise to destroy the cache every minute or so to prevent the data from becoming stale. - Daniel S added ares_process_fd() to allow applications to ask for processing on specific sockets and thus avoiding select() and associated functions/macros. This function will be used by upcoming libcurl releases for this very reason. It also made me export the ares_socket_t type in the public ares.h header file, since ares_process_fd() uses that type for two of the arguments. * May 25 2007 - Ravi Pratap fixed a flaw in the init_by_resolv_conf() function for windows that could cause it to return a bad return code. * April 16 2007 - Yang Tse: Provide ares_getopt() command-line parser function as a source code helper function, not belonging to the actual c-ares library. * February 19 2007 - Vlad Dinulescu added ares_parse_ns_reply(). * February 13 2007 - Yang Tse: Fix failure to get the search sequence of /etc/hosts and DNS from /etc/nsswitch.conf, /etc/host.conf or /etc/svc.conf when /etc/resolv.conf did not exist or was unable to read it. * November 22 2006 - Install ares_dns.h too - Michael Wallner fixed this problem: When I set domains in the options struct, and there are domain/search entries in /etc/resolv.conf, the domains of the options struct will be overridden. * November 6 2006 - Yang Tse removed a couple of potential zero size memory allocations. - Andreas Rieke fixed the line endings in the areslib.dsp file that I (Daniel) broke in the 1.3.2 release. We should switch to a system where that file is auto-generated. We could rip some code for that from curl... Version 1.3.2 (November 3, 2006) * October 12 2006 - Prevent ares_getsock() to overflow if more than 16 sockets are used. * September 11 2006 - Guilherme Balena Versiani: I noted a strange BUG in Win32 port (ares_init.c/get_iphlpapi_dns_info() function): when I disable the network by hand or disconnect the network cable in Windows 2000 or Windows XP, my application gets 127.0.0.1 as the only name server. The problem comes from 'GetNetworkParams' function, that returns the empty string "" as the only name server in that case. Moreover, the Windows implementation of inet_addr() returns INADDR_LOOPBACK instead of INADDR_NONE. * August 29 2006 - Brad Spencer did o made ares_version.h use extern "C" for c++ compilers o fixed compiler warnings in ares_getnameinfo.c o fixed a buffer position init for TCP reads * August 3 2006 - Ravi Pratap fixed ares_getsock() to actually return the proper bitmap and not always zero! Version 1.3.1 (June 24, 2006) * July 23, 2006 - Gisle Vanem added getopt() to the ahost program. Currently accepts only [-t {a|aaaa}] to specify address family in ares_gethostbyname(). * June 19, 2006 - (wahern) Removed "big endian" DNS section and RR data integer parser macros from ares_dns.h, which break c-ares on my Sparc64. Bit-wise operations in C operate on logical values. And in any event the octets are already in big-endian (aka network) byte order so they're being reversed (thus the source of the breakage). * June 18, 2006 - William Ahern handles EAGAIN/EWOULDBLOCK errors in most of the I/O calls from area_process.c. TODO: Handle one last EAGAIN for a UDP socket send(2) in ares__send_query(). * May 10, 2006 - Bram Matthys brought my attention to a libtool peculiarity where detecting things such as C++ compiler actually is a bad thing and since we don't need that detection I added a work-around, much inspired by a previous patch by Paolo Bonzini. This also shortens the configure script quite a lot. * May 3, 2006 - Nick Mathewson added the ARES_OPT_SOCK_STATE_CB option that when set makes c-ares call a callback on socket state changes. A better way than the ares_getsock() to get full control over the socket state. * January 9, 2006 - Alexander Lazic improved the getservbyport_r() configure check. * January 6, 2006 - Alexander Lazic pointed out that the buildconf should use the ACLOCAL_FLAGS variable for easier controlling what it does and how it runs. * January 5, 2006 - James Bursa fixed c-ares to find the hosts file on RISC OS, and made it build with newer gcc versions that no longer defines "riscos". * December 22 - Daniel Stenberg added ares_getsock() that extracts the set of sockets to wait for action on. Similar to ares_fds() but not restricted to using select() for the waiting. * November 25 - Yang Tse fixed some send() / recv() compiler warnings * September 18 - Added constants that will be used by ares_getaddrinfo - Made ares_getnameinfo use the reentrant getservbyport (getservbyport_r) if it is available to ensure it works properly in a threaded environment. * September 10 - configure fix for detecting a member in the sockaddr_in6 struct which failed on ipv6-enabled HP-UX 11.00 Version 1.3.0 (August 29, 2005) * August 21 - Alfredo Tupone provided a fix for the Windows code in get_iphlpapi_dns_info() when getting the DNS server etc. * June 19 - Added some checks for the addrinfo structure. * June 2 - William Ahern: Make UDP sockets non-blocking. I've confirmed that at least on Linux 2.4 a read event can come back from poll() on a valid SOCK_DGRAM socket but recv(2) will still block. This patch doesn't ignore EAGAIN in read_udp_packets(), though maybe it should. (This patch was edited by Daniel Stenberg and a new configure test was added (imported from curl's configure) to properly detect what non-blocking socket approach to use.) I'm not quite sure how this was happening, but I've been seeing PTR queries which seem to return empty responses. At least, they were empty when calling ares_expand_name() on the record. Here's a patch which guarantees to NUL-terminate the expanded name. The old behavior failed to NUL-terminate if len was 0, and this was causing strlen() to run past the end of the buffer after calling ares_expand_name() and getting ARES_SUCCESS as the return value. If q is not greater than *s then it's equal and *s is always allocated with at least one byte. * May 16 - Added ares_getnameinfo which mimics the getnameinfo API (another feature that could use testing). * May 14 - Added an inet_ntop function from BIND for systems that do not have it. * April 9 - Made sortlist support IPv6 (this can probably use some testing). - Made sortlist support CIDR matching for IPv4. * April 8 - Added preliminary IPv6 support to ares_gethostbyname. Currently, sortlist does not work with IPv6. Also provided an implementation of bitncmp from BIND for systems that do not supply this function. This will be used to add IPv6 support to sortlist. - Made ares_gethostbyaddr support IPv6 by specifying AF_INET6 as the family. The function can lookup IPv6 addresses both from files (/etc/hosts) and DNS lookups. * April 7 - Tupone Alfredo fixed includes of arpa/nameser_compat.h to build fine on Mac OS X. * April 5 - Dominick Meglio: Provided implementations of inet_net_pton and inet_pton from BIND for systems that do not include these functions. * March 11, 2005 - Dominick Meglio added ares_parse_aaaa_reply.c and did various adjustments. The first little steps towards IPv6 support! * November 7 - Fixed the VC project and makefile to use ares_cancel and ares_version * October 24 - The released ares_version.h from 1.2.1 says 1.2.0 due to a maketgz flaw. This is now fixed. Version 1.2.1 (October 20, 2004) * September 29 - Henrik Stoerner fix: got a report that Tru64 Unix (the unix from Digital when they made Alpha's) uses /etc/svc.conf for the purpose fixed below for other OSes. He made c-ares check for and understand it if present. - Now c-ares will use local host name lookup _before_ DNS resolving by default if nothing else is told. * September 26 - Henrik Stoerner: found out that c-ares does not look at the /etc/host.conf file to determine the sequence in which to search /etc/hosts and DNS. So on systems where this order is defined by /etc/host.conf instead of a "lookup" entry in /etc/resolv.conf, c-ares will always default to looking in DNS first, and /etc/hosts second. c-ares now looks at 1) resolv.conf (for the "lookup" line); 2) nsswitch.fon (for the "hosts:" line); 3) host.conf (for the "order" line). First match wins. - Dominick Meglio patched: C-ares on Windows assumed that the HOSTS file is located in a static location. It assumed C:\Windows\System32\Drivers\Etc. This is a poor assumption to make. In fact, the location of the HOSTS file can be changed via a registry setting. There is a key called DatabasePath which specifies the path to the HOSTS file: http://www.microsoft.com/technet/itsolutions/network/deploy/depovg/tcpip2k.mspx The patch will make c-ares correctly consult the registry for the location of this file. * August 29 - Gisle Vanem fixed the MSVC build files. * August 20 - Gisle Vanem made c-ares build and work with his Watt-32 TCP/IP stack. * August 13 - Harshal Pradhan made a minor syntax change in ares_init.c to make it build fine with MSVC 7.1 * July 24 - Made the lib get built static only if --enable-debug is used. - Gisle Vanem fixed: Basically in loops like handle_errors(), 'query->next' was assigned a local variable and then query was referenced after the memory was freed by next_server(). I've changed that so next_server() and end_query() returns the next query. So callers should use this ret-value. The next problem was that 'server->tcp_buffer_pos' had a random value at entry to 1st recv() (luckily causing Winsock to return ENOBUFS). I've also added a ares_writev() for Windows to streamline the code a bit more. * July 20 - Fixed a few variable return types for some system calls. Made configure check for ssize_t to make it possible to use that when receiving the send() error code. This is necessary to prevent compiler warnings on some systems. - Made configure create config.h, and all source files now include setup.h that might include the proper config.h (or a handicrafted alternative). - Switched to 'ares_socket_t' type for sockets in ares, since Windows don't use 'int' for that. - automake-ified and libool-ified c-ares. Now it builds libcares as a shared lib on most platforms if wanted. (This bloated the size of the release archive with another 200K!) - Makefile.am now uses Makefile.inc for the c sources, h headers and man pages, to make it easier for other makefiles to use the exact same set of files. - Adjusted 'maketgz' to use the new automake magic when building distribution archives. - Anyone desires HTML and/or PDF versions of the man pages in the release archives? * July 3 - Gnter Knauf made c-ares build and run on Novell Netware. * July 1 - Gisle Vanem provided Makefile.dj to build with djgpp, added a few more djgpp fixes and made ares not use 'errno' to provide further info on Windows. * June 30 - Gisle Vanem made it build with djgpp and run fine with the Watt-32 stack. * June 10 - Gisle Vanem's init patch for Windows: The init_by_resolv_conf() function fetches the DNS-server(s) from a series of registry branches. This can be wrong in the case where DHCP has assigned nameservers, but the user has overridden these servers with other prefered settings. Then it's wrong to use the DHCPNAMESERVER setting in registry. In the case of no global DHCP-assigned or fixed servers, but DNS server(s) per adapter, one has to query the adapter branches. But how can c-ares know which adapter is valid for use? AFAICS it can't. There could be one adapter that is down (e.g. a VPN adapter). So it's better to leave this to the IP Helper API (iphlapi) available in Win-98/2000 and later. My patch falls-back to the old way if not available. * June 8 - James Bursa fixed an init issue for RISC OS. * May 11 - Nico Stappenbelt reported that when processing domain and search lines in the resolv.conf file, the first entry encountered is processed and used as the search list. According to the manual pages for both Linux, Solaris and Tru64, the last entry of either a domain or a search field is used. This is now adjusted in the code Version 1.2.0 (April 13, 2004) * April 2, 2004 - Updated various man pages to look nicer when converted to HTML on the web site. * April 1, 2004 - Dirk Manske provided a new function that is now named ares_cancel(). It is used to cancel/cleanup a resolve/request made using ares functions on the given ares channel. It does not destroy/kill the ares channel itself. - Dominick Meglio cleaned up the formatting in several man pages. * March 30, 2004 - Dominick Meglio's new ares_expand_string. A helper function when decoding incoming DNS packages. - Daniel Stenberg modified the Makefile.in to use a for loop for the man page installation to improve overview and make it easier to add man pages. Version 1.1.0 (March 11, 2004) * March 9, 2004 - Gisle Vanem improved build on Windows. * February 25, 2004 - Dan Fandrich found a flaw in the Feb 22 fix. - Added better configure --enable-debug logic (taken from the curl configure script). Added acinclude.m4 to the tarball. * February 23, 2004 - Removed ares_free_errmem(), the function, the file and the man page. It was not used and it did nothing. - Fixed a lot of code that wasn't "64bit clean" and thus caused a lot of compiler warnings on picky compilers. * February 22, 2004 - Dominick Meglio made ares init support multiple name servers in the NameServer key on Windows. * February 16, 2004 - Modified ares_private.h to include libcurl's memory debug header if CURLDEBUG is set. This makes all the ares-functions supervised properly by the curl test suite. This also forced me to add inclusion of the ares_private.h header in a few more files that are using some kind of memory-related resources. - Made the makefile only build ahost and adig if 'make demos' is used. * February 10, 2004 - Dirk Manske made ares_version.h installed with 'make install' * February 4, 2004 - ares_free_errmem() is subject for removal, it is simply present for future purposes, and since we removed the extra parameter in strerror() it won't be used by c-ares! - configure --enable-debug now enables picky compiler options if gcc is used - fixed several compiler warnings --enable-debug showed and Joerg Mueller-Tolk reported Version 1.0.0 (February 3, 2004) * February 3, 2004 - now we produce the libcares.a library instead of the previous libares.a since we are no longer compatible * February 2, 2004 - ares_strerror() has one argument less. This is the first official modification of the existing provided ares API. * January 29, 2004 - Dirk Manske fixed how the socket is set non-blocking. * January 4, 2004 - Dominick Meglio made the private gettimeofday() become ares_gettimeofday() instead in order to not pollute the name space and risk colliding with other libraries' versions of this function. * October 24, 2003. Daniel Stenberg Added ares_version(). Version 1.0-pre1 (8 October 2003) - James Bursa made it run on RISC OS - Dominick Meglio made it run fine on NT4 - Duncan Wilcox made it work fine on Mac OS X - Daniel Stenberg adjusted the windows port - liren at vivisimo.com made the initial windows port * Imported the sources from ares 1.1.1 ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/CMakeLists.txt0000644000175100001770000007500400000000000020646 0ustar00runnerdocker00000000000000CMAKE_MINIMUM_REQUIRED (VERSION 3.1.0) INCLUDE (CheckIncludeFiles) INCLUDE (CheckTypeSize) INCLUDE (CheckFunctionExists) INCLUDE (CheckSymbolExists) INCLUDE (CheckCSourceCompiles) INCLUDE (CheckStructHasMember) INCLUDE (CheckLibraryExists) PROJECT (c-ares LANGUAGES C VERSION "1.18.0" ) # Set this version before release SET (CARES_VERSION "${PROJECT_VERSION}") INCLUDE (GNUInstallDirs) # include this *AFTER* PROJECT(), otherwise paths are wrong. # This is for libtool compatibility, and specified in a form that is easily # translatable from libtool (even if the actual form doesn't make sense). # For instance, in an autotools project, in Makefile.am there is a line that # contains something like: # -version-info 4:0:2 # This breaks down into sections of current:revision:age # This then generates a version of "(current-age).age.revision" with an # interface version of "(current-age)" # For example, a version of 4:0:2 would generate output such as: # libname.so -> libname.so.2 # libname.so.2 -> libname.so.2.2.0 SET (CARES_LIB_VERSIONINFO "7:1:5") OPTION (CARES_STATIC "Build as a static library" OFF) OPTION (CARES_SHARED "Build as a shared library" ON) OPTION (CARES_INSTALL "Create installation targets (chain builders may want to disable this)" ON) OPTION (CARES_STATIC_PIC "Build the static library as PIC (position independent)" OFF) OPTION (CARES_BUILD_TESTS "Build and run tests" OFF) OPTION (CARES_BUILD_CONTAINER_TESTS "Build and run container tests (implies CARES_BUILD_TESTS, Linux only)" OFF) OPTION (CARES_BUILD_TOOLS "Build tools" ON) # Tests require static to be enabled on Windows to be able to access otherwise hidden symbols IF (CARES_BUILD_TESTS AND (NOT CARES_STATIC) AND WIN32) SET (CARES_STATIC ON) SET (CARES_STATIC_PIC ON) MESSAGE (WARNING "Static building was requested be disabled, but reenabled to support tests") ENDIF () # allow linking against the static runtime library in msvc IF (MSVC) OPTION (CARES_MSVC_STATIC_RUNTIME "Link against the static runtime library" OFF) IF (CARES_MSVC_STATIC_RUNTIME) # CMAKE_CONFIGURATION_TYPES is empty on non-IDE generators (Ninja, NMake) # and that's why we also use CMAKE_BUILD_TYPE to cover for those generators. # For IDE generators, CMAKE_BUILD_TYPE is usually empty FOREACH (config_type ${CMAKE_CONFIGURATION_TYPES} ${CMAKE_BUILD_TYPE}) STRING (TOUPPER ${config_type} upper_config_type) SET (flag_var "CMAKE_C_FLAGS_${upper_config_type}") IF (${flag_var} MATCHES "/MD") STRING (REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}") ENDIF () ENDFOREACH () # clean up SET (upper_config_type) SET (config_type) SET (flag_var) ENDIF () ENDIF () # Keep build organized. SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}") SET (CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}") SET (CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}") SET (PACKAGE_DIRECTORY ${PROJECT_BINARY_DIR}/package) # Destinations for installing different kinds of targets (pass to install command). SET (TARGETS_INST_DEST RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) # Function in Library # CHECK_LIBRARY_EXISTS can't be used as it will return true if the function # is found in a different dependent library. MACRO (CARES_FUNCTION_IN_LIBRARY func lib var) CHECK_FUNCTION_EXISTS ("${func}" "_CARES_FUNC_IN_LIB_GLOBAL_${func}") IF ("${_CARES_FUNC_IN_LIB_GLOBAL_${func}}") SET (${var} FALSE) ELSE () CHECK_LIBRARY_EXISTS ("${lib}" "${func}" "" ${var}) ENDIF () ENDMACRO () # Look for dependent/required libraries CARES_FUNCTION_IN_LIBRARY (res_servicename resolv HAVE_RES_SERVICENAME_IN_LIBRESOLV) IF (HAVE_RES_SERVICENAME_IN_LIBRESOLV) SET (HAVE_LIBRESOLV 1) ENDIF () IF (APPLE) CHECK_C_SOURCE_COMPILES (" #include #include int main() { #if TARGET_OS_IPHONE == 0 #error Not an iPhone target #endif return 0; } " IOS) CHECK_C_SOURCE_COMPILES (" #include #include int main() { #if TARGET_OS_IPHONE == 0 || __IPHONE_OS_VERSION_MIN_REQUIRED < 100000 # error Not iOS v10 #endif return 0; } " IOS_V10) CHECK_C_SOURCE_COMPILES (" #include #include #ifndef MAC_OS_X_VERSION_10_12 # define MAC_OS_X_VERSION_10_12 101200 #endif int main() { #if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_12 # error Not MacOSX 10.12 or higher #endif return 0; } " MACOS_V1012) ENDIF () IF ((IOS OR APPLE OR ZOS) AND HAVE_LIBRESOLV) SET (CARES_USE_LIBRESOLV 1) ENDIF() CARES_FUNCTION_IN_LIBRARY (gethostbyname nsl HAVE_LIBNSL) CARES_FUNCTION_IN_LIBRARY (gethostbyname socket HAVE_GHBN_LIBSOCKET) CARES_FUNCTION_IN_LIBRARY (gethostbyname network HAVE_LIBNETWORK) CARES_FUNCTION_IN_LIBRARY (socket socket HAVE_SOCKET_LIBSOCKET) IF (HAVE_GHBN_LIBSOCKET OR HAVE_SOCKET_LIBSOCKET) SET(HAVE_LIBSOCKET TRUE) ENDIF () CARES_FUNCTION_IN_LIBRARY (socket network HAVE_LIBNETWORK) CARES_FUNCTION_IN_LIBRARY (clock_gettime rt HAVE_LIBRT) # Look for necessary includes CHECK_INCLUDE_FILES (sys/types.h HAVE_SYS_TYPES_H) CHECK_INCLUDE_FILES (sys/socket.h HAVE_SYS_SOCKET_H) CHECK_INCLUDE_FILES (sys/sockio.h HAVE_SYS_SOCKIO_H) CHECK_INCLUDE_FILES (arpa/inet.h HAVE_ARPA_INET_H) CHECK_INCLUDE_FILES (arpa/nameser_compat.h HAVE_ARPA_NAMESER_COMPAT_H) CHECK_INCLUDE_FILES (arpa/nameser.h HAVE_ARPA_NAMESER_H) CHECK_INCLUDE_FILES (assert.h HAVE_ASSERT_H) CHECK_INCLUDE_FILES (errno.h HAVE_ERRNO_H) CHECK_INCLUDE_FILES (fcntl.h HAVE_FCNTL_H) CHECK_INCLUDE_FILES (inttypes.h HAVE_INTTYPES_H) CHECK_INCLUDE_FILES (limits.h HAVE_LIMITS_H) CHECK_INCLUDE_FILES (malloc.h HAVE_MALLOC_H) CHECK_INCLUDE_FILES (memory.h HAVE_MEMORY_H) CHECK_INCLUDE_FILES (netdb.h HAVE_NETDB_H) CHECK_INCLUDE_FILES (netinet/in.h HAVE_NETINET_IN_H) CHECK_INCLUDE_FILES (net/if.h HAVE_NET_IF_H) CHECK_INCLUDE_FILES (signal.h HAVE_SIGNAL_H) CHECK_INCLUDE_FILES (socket.h HAVE_SOCKET_H) CHECK_INCLUDE_FILES (stdbool.h HAVE_STDBOOL_H) CHECK_INCLUDE_FILES (stdint.h HAVE_STDINT_H) CHECK_INCLUDE_FILES (stdlib.h HAVE_STDLIB_H) CHECK_INCLUDE_FILES (strings.h HAVE_STRINGS_H) CHECK_INCLUDE_FILES (string.h HAVE_STRING_H) CHECK_INCLUDE_FILES (stropts.h HAVE_STROPTS_H) CHECK_INCLUDE_FILES (sys/ioctl.h HAVE_SYS_IOCTL_H) CHECK_INCLUDE_FILES (sys/param.h HAVE_SYS_PARAM_H) CHECK_INCLUDE_FILES (sys/select.h HAVE_SYS_SELECT_H) CHECK_INCLUDE_FILES (sys/stat.h HAVE_SYS_STAT_H) CHECK_INCLUDE_FILES (sys/time.h HAVE_SYS_TIME_H) CHECK_INCLUDE_FILES (sys/uio.h HAVE_SYS_UIO_H) CHECK_INCLUDE_FILES (time.h HAVE_TIME_H) CHECK_INCLUDE_FILES (dlfcn.h HAVE_DLFCN_H) CHECK_INCLUDE_FILES (unistd.h HAVE_UNISTD_H) # On OpenBSD, you must include sys/types.h before netinet/tcp.h IF (HAVE_SYS_TYPES_H) CHECK_INCLUDE_FILES ("sys/types.h;netinet/tcp.h" HAVE_NETINET_TCP_H) ELSE () CHECK_INCLUDE_FILES (netinet/tcp.h HAVE_NETINET_TCP_H) ENDIF () # Include order matters for these windows files. # As cygwin environment has both socket.h and winsock2.h # headers check WIN32 not to include the later one here IF (WIN32) CHECK_INCLUDE_FILES ("winsock2.h;windows.h" HAVE_WINSOCK2_H) CHECK_INCLUDE_FILES ("winsock2.h;ws2tcpip.h;windows.h" HAVE_WS2TCPIP_H) CHECK_INCLUDE_FILES ("winsock.h;windows.h" HAVE_WINSOCK_H) CHECK_INCLUDE_FILES (windows.h HAVE_WINDOWS_H) ENDIF () # Set system-specific compiler flags IF (CMAKE_SYSTEM_NAME STREQUAL "Darwin") LIST (APPEND SYSFLAGS -D_DARWIN_C_SOURCE) ELSEIF (CMAKE_SYSTEM_NAME STREQUAL "Linux") LIST (APPEND SYSFLAGS -D_GNU_SOURCE -D_POSIX_C_SOURCE=199309L -D_XOPEN_SOURCE=600) ELSEIF (CMAKE_SYSTEM_NAME STREQUAL "SunOS") LIST (APPEND SYSFLAGS -D__EXTENSIONS__ -D_REENTRANT -D_XOPEN_SOURCE=600) ELSEIF (CMAKE_SYSTEM_NAME STREQUAL "AIX") LIST (APPEND SYSFLAGS -D_ALL_SOURCE -D_XOPEN_SOURCE=600 -D_USE_IRS) ELSEIF (CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") # Don't define _XOPEN_SOURCE on FreeBSD, it actually reduces visibility instead of increasing it ELSEIF (WIN32) LIST (APPEND SYSFLAGS -DWIN32_LEAN_AND_MEAN -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -D_WIN32_WINNT=0x0600) ENDIF () ADD_DEFINITIONS(${SYSFLAGS}) # Tell C-Ares about libraries to depend on IF (HAVE_LIBRESOLV) LIST (APPEND CARES_DEPENDENT_LIBS resolv) ENDIF () IF (HAVE_LIBNSL) LIST (APPEND CARES_DEPENDENT_LIBS nsl) ENDIF () IF (HAVE_LIBSOCKET) LIST (APPEND CARES_DEPENDENT_LIBS socket) ENDIF () IF (HAVE_LIBNETWORK) LIST (APPEND CARES_DEPENDENT_LIBS network) ENDIF () IF (HAVE_LIBRT) LIST (APPEND CARES_DEPENDENT_LIBS rt) ENDIF () IF (WIN32) LIST (APPEND CARES_DEPENDENT_LIBS ws2_32 advapi32 iphlpapi) ENDIF () # When checking for symbols, we need to make sure we set the proper # headers, libraries, and definitions for the detection to work properly # CMAKE_REQUIRED_DEFINITIONS, CMAKE_REQUIRED_LIBRARIES, and # CMAKE_EXTRA_INCLUDE_FILES. When we're done with the detection, we'll # unset them. SET (CMAKE_REQUIRED_DEFINITIONS ${SYSFLAGS}) LIST (APPEND CMAKE_REQUIRED_LIBRARIES ${CARES_DEPENDENT_LIBS}) MACRO (CARES_EXTRAINCLUDE_IFSET var include) IF (${var}) LIST (APPEND CMAKE_EXTRA_INCLUDE_FILES ${include}) ENDIF () ENDMACRO () CARES_EXTRAINCLUDE_IFSET (HAVE_STDBOOL_H stdbool.h) CARES_EXTRAINCLUDE_IFSET (HAVE_SYS_TYPES_H sys/types.h) CARES_EXTRAINCLUDE_IFSET (HAVE_ARPA_INET_H arpa/inet.h) CARES_EXTRAINCLUDE_IFSET (HAVE_ARPA_NAMESER_H arpa/nameser.h) CARES_EXTRAINCLUDE_IFSET (HAVE_NETDB_H netdb.h) CARES_EXTRAINCLUDE_IFSET (HAVE_NET_IF_H net/if.h) CARES_EXTRAINCLUDE_IFSET (HAVE_NETINET_IN_H netinet/in.h) CARES_EXTRAINCLUDE_IFSET (HAVE_NETINET_TCP_H netinet/tcp.h) CARES_EXTRAINCLUDE_IFSET (HAVE_SIGNAL_H signal.h) CARES_EXTRAINCLUDE_IFSET (HAVE_STDLIB_H stdlib.h) CARES_EXTRAINCLUDE_IFSET (HAVE_STRING_H string.h) CARES_EXTRAINCLUDE_IFSET (HAVE_STRINGS_H strings.h) CARES_EXTRAINCLUDE_IFSET (HAVE_SYS_IOCTL_H sys/ioctl.h) CARES_EXTRAINCLUDE_IFSET (HAVE_SYS_SELECT_H sys/select.h) CARES_EXTRAINCLUDE_IFSET (HAVE_SYS_SOCKET_H sys/socket.h) CARES_EXTRAINCLUDE_IFSET (HAVE_SYS_SOCKIO_H sys/sockio.h) CARES_EXTRAINCLUDE_IFSET (HAVE_SYS_TIME_H sys/time.h) CARES_EXTRAINCLUDE_IFSET (HAVE_SYS_UIO_H sys/uio.h) CARES_EXTRAINCLUDE_IFSET (HAVE_TIME_H time.h) CARES_EXTRAINCLUDE_IFSET (HAVE_FCNTL_H fcntl.h) CARES_EXTRAINCLUDE_IFSET (HAVE_UNISTD_H unistd.h) CARES_EXTRAINCLUDE_IFSET (HAVE_WINSOCK2_H winsock2.h) CARES_EXTRAINCLUDE_IFSET (HAVE_WS2TCPIP_H ws2tcpip.h) CARES_EXTRAINCLUDE_IFSET (HAVE_WINDOWS_H windows.h) # Check Types # CHECK_TYPE_SIZE can't be used to see if a type exists because on Apple when # building multi-arch, it will throw an error. So we need to wrap # CHECK_C_SOURCE_COMPILES for our tests. MACRO (CARES_TYPE_EXISTS type var) SET(_CARES_C_SOURCE " #include #include ") FOREACH(_C_HEADER ${CMAKE_EXTRA_INCLUDE_FILES}) SET(_CARES_C_SOURCE "${_CARES_C_SOURCE} #include <${_C_HEADER}>") ENDFOREACH(_C_HEADER) SET(_CARES_C_SOURCE "${_CARES_C_SOURCE} int main() { ${type} var_exists; (void)var_exists; return 0; } ") CHECK_C_SOURCE_COMPILES ("${_CARES_C_SOURCE}" ${var}) ENDMACRO () CARES_TYPE_EXISTS (socklen_t HAVE_SOCKLEN_T) CARES_TYPE_EXISTS (SOCKET HAVE_TYPE_SOCKET) CARES_TYPE_EXISTS (bool HAVE_BOOL_T) CARES_TYPE_EXISTS (ssize_t HAVE_SSIZE_T) CARES_TYPE_EXISTS ("long long" HAVE_LONGLONG) CARES_TYPE_EXISTS (sig_atomic_t HAVE_SIG_ATOMIC_T) CARES_TYPE_EXISTS ("struct addrinfo" HAVE_STRUCT_ADDRINFO) CARES_TYPE_EXISTS ("struct in6_addr" HAVE_STRUCT_IN6_ADDR) CARES_TYPE_EXISTS ("struct sockaddr_in6" HAVE_STRUCT_SOCKADDR_IN6) CARES_TYPE_EXISTS ("struct sockaddr_storage" HAVE_STRUCT_SOCKADDR_STORAGE) CARES_TYPE_EXISTS ("struct timeval" HAVE_STRUCT_TIMEVAL) # Check for preprocessor defines CHECK_SYMBOL_EXISTS (AF_INET6 "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_AF_INET6) CHECK_SYMBOL_EXISTS (O_NONBLOCK "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_O_NONBLOCK) CHECK_SYMBOL_EXISTS (FIONBIO "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_FIONBIO) CHECK_SYMBOL_EXISTS (SIOCGIFADDR "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_IOCTL_SIOCGIFADDR) CHECK_SYMBOL_EXISTS (MSG_NOSIGNAL "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_MSG_NOSIGNAL) CHECK_SYMBOL_EXISTS (PF_INET6 "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_PF_INET6) CHECK_SYMBOL_EXISTS (SO_NONBLOCK "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_SO_NONBLOCK) # XCode v8 bug: iOS when targeting less than v10, or MacOS when targeting less than v10.12 will # say clock_gettime exists, it is a weak symbol that only exists in iOS10/MacOS10.12 and will # cause a crash at runtime when running on older versions. Skip finding CLOCK_MONOTONIC on older # OS's. IF ((NOT APPLE) OR IOS_V10 OR MACOS_V1012) CHECK_SYMBOL_EXISTS (CLOCK_MONOTONIC "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_CLOCK_GETTIME_MONOTONIC) ENDIF () CHECK_STRUCT_HAS_MEMBER("struct sockaddr_in6" sin6_scope_id "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID LANGUAGE C) # Check for "LL" numeric suffix support CHECK_C_SOURCE_COMPILES ("int main() { int n=1234LL; return 0; }" HAVE_LL) CHECK_SYMBOL_EXISTS (bitncmp "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_BITNCMP) CHECK_SYMBOL_EXISTS (closesocket "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_CLOSESOCKET) CHECK_SYMBOL_EXISTS (CloseSocket "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_CLOSESOCKET_CAMEL) CHECK_SYMBOL_EXISTS (connect "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_CONNECT) CHECK_SYMBOL_EXISTS (fcntl "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_FCNTL) CHECK_SYMBOL_EXISTS (freeaddrinfo "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_FREEADDRINFO) CHECK_SYMBOL_EXISTS (getaddrinfo "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_GETADDRINFO) CHECK_SYMBOL_EXISTS (getenv "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_GETENV) CHECK_SYMBOL_EXISTS (gethostbyaddr "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_GETHOSTBYADDR) CHECK_SYMBOL_EXISTS (gethostbyname "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_GETHOSTBYNAME) CHECK_SYMBOL_EXISTS (gethostname "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_GETHOSTNAME) CHECK_SYMBOL_EXISTS (getnameinfo "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_GETNAMEINFO) CHECK_SYMBOL_EXISTS (getservbyport_r "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_GETSERVBYPORT_R) CHECK_SYMBOL_EXISTS (getservbyname_r "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_GETSERVBYNAME_R) CHECK_SYMBOL_EXISTS (gettimeofday "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_GETTIMEOFDAY) CHECK_SYMBOL_EXISTS (if_indextoname "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_IF_INDEXTONAME) CHECK_SYMBOL_EXISTS (inet_net_pton "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_INET_NET_PTON) IF (NOT WIN32) # Disabled on Windows, because these functions are only really supported on Windows # Vista or newer (_WIN32_WINNT >= 0x0600). Older versions of Windows may provide # them as experimental non-working features, so we have to disable them manually. CHECK_SYMBOL_EXISTS (inet_ntop "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_INET_NTOP) CHECK_SYMBOL_EXISTS (inet_pton "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_INET_PTON) ENDIF () CHECK_SYMBOL_EXISTS (ioctl "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_IOCTL) CHECK_SYMBOL_EXISTS (ioctlsocket "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_IOCTLSOCKET) CHECK_SYMBOL_EXISTS (IoctlSocket "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_IOCTLSOCKET_CAMEL) 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 (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) CHECK_SYMBOL_EXISTS (strcmpi "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_STRCMPI) CHECK_SYMBOL_EXISTS (strdup "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_STRDUP) CHECK_SYMBOL_EXISTS (stricmp "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_STRICMP) CHECK_SYMBOL_EXISTS (strncasecmp "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_STRNCASECMP) CHECK_SYMBOL_EXISTS (strncmpi "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_STRNCMPI) CHECK_SYMBOL_EXISTS (strnicmp "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_STRNICMP) CHECK_SYMBOL_EXISTS (writev "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_WRITEV) # On Android, the system headers may define __system_property_get(), but excluded # from libc. We need to perform a link test instead of a header/symbol test. CHECK_FUNCTION_EXISTS (__system_property_get HAVE___SYSTEM_PROPERTY_GET) # Unset temporary data SET (CMAKE_EXTRA_INCLUDE_FILES) SET (CMAKE_REQUIRED_DEFINITIONS) SET (CMAKE_REQUIRED_LIBRARIES) find_file(CARES_RANDOM_FILE urandom /dev) mark_as_advanced(CARES_RANDOM_FILE) ################################################################################ # recv, recvfrom, send, getnameinfo, gethostname # ARGUMENTS AND RETURN VALUES # # The AutoTools build tries to be really thorough here. So much so that it # takes forever. We really don't want to do that. Lets make some educated # guesses based on datatypes we have available, and for others, use some 'sane' # defaults. This should be much quicker and nearly as accurate ... and even # if not, it probably won't matter in the least. IF (HAVE_SSIZE_T AND HAVE_SOCKLEN_T) # If we have ssize_t and socklen_t, the API is usually sane and uses ssize_t and size_t for lengths SET (RECVFROM_TYPE_RETV ssize_t) SET (RECVFROM_TYPE_ARG3 size_t) ELSE () SET (RECVFROM_TYPE_RETV int) SET (RECVFROM_TYPE_ARG3 int) ENDIF () IF (HAVE_TYPE_SOCKET) # If the SOCKET type is defined, it uses socket ... should be windows only SET (RECVFROM_TYPE_ARG1 SOCKET) ELSE () SET (RECVFROM_TYPE_ARG1 int) ENDIF() IF (HAVE_SOCKLEN_T) # If we have socklen_t the APIs pretty much always actually use it SET (RECVFROM_TYPE_ARG6 "socklen_t *") SET (GETNAMEINFO_TYPE_ARG2 socklen_t) SET (GETNAMEINFO_TYPE_ARG46 socklen_t) ELSE () SET (RECVFROM_TYPE_ARG6 "int *") SET (GETNAMEINFO_TYPE_ARG2 int) SET (GETNAMEINFO_TYPE_ARG46 int) ENDIF () IF (WIN32) SET (RECV_TYPE_ARG2 "char *") ELSE () SET (RECV_TYPE_ARG2 "void *") ENDIF () # Functions are typically consistent so the equivalent fields map ... equivalently SET (RECV_TYPE_RETV ${RECVFROM_TYPE_RETV}) SET (SEND_TYPE_RETV ${RECVFROM_TYPE_RETV}) SET (RECV_TYPE_ARG1 ${RECVFROM_TYPE_ARG1}) SET (RECVFROM_TYPE_ARG2 ${RECV_TYPE_ARG2}) SET (SEND_TYPE_ARG1 ${RECVFROM_TYPE_ARG1}) SET (RECV_TYPE_ARG3 ${RECVFROM_TYPE_ARG3}) SET (SEND_TYPE_ARG3 ${RECVFROM_TYPE_ARG3}) SET (GETHOSTNAME_TYPE_ARG2 ${RECVFROM_TYPE_ARG3}) # These should always be "sane" values to use always SET (RECVFROM_QUAL_ARG5 ) SET (RECVFROM_TYPE_ARG4 int) SET (RECVFROM_TYPE_ARG5 "struct sockaddr *") SET (RECV_TYPE_ARG4 int) SET (GETNAMEINFO_TYPE_ARG1 "struct sockaddr *") SET (GETNAMEINFO_TYPE_ARG7 int) SET (SEND_TYPE_ARG2 "void *") SET (SEND_TYPE_ARG4 int) ################################################################################ # HAVE_CXX11 ?? # HAVE_SIG_ATOMIC_T_VOLATILE ?? # Set a few variables by hand that C-Ares wants, logically, based on detection # data. IF (HAVE_SOCKLEN_T) Set (CARES_TYPEOF_ARES_SOCKLEN_T "socklen_t") ELSE () Set (CARES_TYPEOF_ARES_SOCKLEN_T "int") ENDIF () IF (HAVE_SSIZE_T) Set (CARES_TYPEOF_ARES_SSIZE_T "ssize_t") ELSE () IF (WIN32) IF ("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") Set (CARES_TYPEOF_ARES_SSIZE_T "__int64") ELSE () Set (CARES_TYPEOF_ARES_SSIZE_T "int") ENDIF () ELSE () Set (CARES_TYPEOF_ARES_SSIZE_T "long") ENDIF () ENDIF () IF (HAVE_FCNTL AND HAVE_O_NONBLOCK) SET (HAVE_FCNTL_O_NONBLOCK 1) ENDIF () IF (HAVE_IOCTL AND HAVE_FIONBIO) SET (HAVE_IOCTL_FIONBIO 1) ENDIF () IF (HAVE_IOCTLSOCKET AND HAVE_FIONBIO) SET (HAVE_IOCTLSOCKET_FIONBIO 1) ENDIF () IF (HAVE_IOCTLSOCKET_CAMEL AND HAVE_FIONBIO) SET (HAVE_IOCTLSOCKET_CAMEL_FIONBIO 1) ENDIF () IF (HAVE_GETADDRINFO) IF (CMAKE_SYSTEM_NAME STREQUAL "Darwin" OR CMAKE_SYSTEM_NAME STREQUAL "HPUX" OR CMAKE_SYSTEM_NAME STREQUAL "NetBSD" OR CMAKE_SYSTEM_NAME STREQUAL "SunOS" OR CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR CMAKE_SYSTEM_NAME STREQUAL "AIX" OR WIN32) SET (HAVE_GETADDRINFO_THREADSAFE 1) ENDIF () ENDIF () IF (HAVE_TIME_H AND HAVE_SYS_TIME_H) SET (TIME_WITH_SYS_TIME 1) ENDIF () IF (HAVE_GETSERVBYPORT_R) # TODO : Should probably autodetect IF (CMAKE_SYSTEM_NAME STREQUAL "SunOS") SET (GETSERVBYPORT_R_ARGS 5) ELSEIF (CMAKE_SYSTEM_NAME STREQUAL "AIX" OR CMAKE_SYSTEM_NAME STREQUAL "OpenBSD" OR HAIKU) SET (GETSERVBYPORT_R_ARGS 4) ELSE () # Probably linux SET (GETSERVBYPORT_R_ARGS 6) ENDIF () ENDIF () IF (HAVE_GETSERVBYNAME_R) # TODO : Should probably autodetect IF (CMAKE_SYSTEM_NAME STREQUAL "SunOS") SET (GETSERVBYNAME_R_ARGS 5) ELSEIF (CMAKE_SYSTEM_NAME STREQUAL "AIX" OR CMAKE_SYSTEM_NAME STREQUAL "OpenBSD" OR HAIKU) SET (GETSERVBYNAME_R_ARGS 4) ELSE () # Probably linux SET (GETSERVBYNAME_R_ARGS 6) ENDIF () ENDIF () # Set some aliases used for ares_build.h IF (HAVE_SYS_TYPES_H) SET (CARES_HAVE_SYS_TYPES_H 1) ENDIF () IF (HAVE_SYS_SOCKET_H) SET (CARES_HAVE_SYS_SOCKET_H 1) ENDIF() IF (HAVE_WS2TCPIP_H) SET (CARES_HAVE_WS2TCPIP_H 1) ENDIF() IF (HAVE_WINSOCK2_H) SET (CARES_HAVE_WINSOCK2_H 1) ENDIF() IF (HAVE_WINDOWS_H) SET (CARES_HAVE_WINDOWS_H 1) ENDIF() IF (HAVE_ARPA_NAMESER_H) SET (CARES_HAVE_ARPA_NAMESER_H 1) ENDIF() IF (HAVE_ARPA_NAMESER_COMPAT_H) SET (CARES_HAVE_ARPA_NAMESER_COMPAT_H 1) ENDIF() # Record toplevel CMakeLists.txt path set(CARES_TOPLEVEL_DIR "${CMAKE_CURRENT_SOURCE_DIR}") # TRANSFORM_MAKEFILE_INC # # This function consumes the "Makefile.inc" autotools file, and converts it into # "Makefile.inc.cmake", a cmake include file; transforming this: # # CSOURCES = ares__close_sockets.c \ # ares__get_hostent.c \ # ares__read_line.c \ # ... # # into this: # # SET (CSOURCES # ares__close_sockets.c # ares__get_hostent.c # ares__read_line.c # ... function(TRANSFORM_MAKEFILE_INC INPUT_FILE OUTPUT_FILE) file(READ ${INPUT_FILE} MAKEFILE_INC_TEXT) string(REPLACE "$(top_srcdir)" "\${PROJECT_SOURCE_DIR}" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT}) string(REPLACE "$(top_builddir)" "\${PROJECT_BINARY_DIR}" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT}) string(REGEX REPLACE "\\\\\n" "ß!ß" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT}) string(REGEX REPLACE "([a-zA-Z_][a-zA-Z0-9_]*)[\t ]*=[\t ]*([^\n]*)" "SET(\\1 \\2)" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT}) string(REPLACE "ß!ß" "\n" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT}) string(REGEX REPLACE "\\$\\(([a-zA-Z_][a-zA-Z0-9_]*)\\)" "\${\\1}" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT}) # Replace $() with ${} string(REGEX REPLACE "@([a-zA-Z_][a-zA-Z0-9_]*)@" "\${\\1}" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT}) # Replace @@ with ${}, even if that may not be read by CMake scripts. file(WRITE ${OUTPUT_FILE} ${MAKEFILE_INC_TEXT}) endfunction() # Directory for includes ADD_SUBDIRECTORY (include) # Directory for lib and tools ADD_SUBDIRECTORY (src) # Docs ADD_SUBDIRECTORY (docs) # Tests IF (CARES_BUILD_TESTS OR CARES_BUILD_CONTAINER_TESTS) ENABLE_TESTING () ADD_SUBDIRECTORY (test) ENDIF () # Export targets IF (CARES_INSTALL) SET (CMAKECONFIG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}") INCLUDE (CMakePackageConfigHelpers) CONFIGURE_PACKAGE_CONFIG_FILE (${PROJECT_NAME}-config.cmake.in ${PROJECT_NAME}-config.cmake INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR} PATH_VARS CMAKE_INSTALL_INCLUDEDIR NO_CHECK_REQUIRED_COMPONENTS_MACRO ) WRITE_BASIC_PACKAGE_VERSION_FILE(${PROJECT_NAME}-config-version.cmake VERSION "${CARES_VERSION}" COMPATIBILITY SameMajorVersion) INSTALL (EXPORT ${PROJECT_NAME}-targets COMPONENT Devel DESTINATION ${CMAKECONFIG_INSTALL_DIR} NAMESPACE ${PROJECT_NAME}::) INSTALL (FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake" "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake" COMPONENT Devel DESTINATION ${CMAKECONFIG_INSTALL_DIR}) # pkgconfig support IF (NOT CARES_SHARED) SET (CPPFLAG_CARES_STATICLIB "-DCARES_STATICLIB") FOREACH (LIB ${CARES_DEPENDENT_LIBS}) SET (CARES_PRIVATE_LIBS "${CARES_PRIVATE_LIBS} -l${LIB}") ENDFOREACH () ENDIF () CONFIGURE_FILE("libcares.pc.cmake" "libcares.pc" @ONLY) 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") SET (CARES_LIBRARIES ${PROJECT_NAME}::cares CACHE INTERNAL "CARES LIBRARIES") IF (CARES_INSTALL) # Package creation set( CPACK_PACKAGE_NAME ${PROJECT_NAME} ) set( CPACK_PACKAGE_VENDOR "Daniel Stenberg" ) # Github project owner set( CPACK_PACKAGE_DESCRIPTION_SUMMARY "A C library for asynchronous DNS requests" ) set( CPACK_PACKAGE_HOMEPAGE_URL "https://c-ares.org/" ) set( CPACK_PACKAGE_CONTACT "https://c-ares.org/" ) set( CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR} ) set( CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR} ) set( CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH} ) set( CPACK_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH} ) set( CPACK_PACKAGE_INSTALL_DIRECTORY ${PROJECT_NAME} ) set( CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.md" ) set( CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README.md" ) set( CPACK_COMPONENT_Library_DISPLAY_NAME "c-ares Library" ) set( CPACK_COMPONENT_Library_DESCRIPTION "The c-ares binary library." ) set( CPACK_COMPONENT_Library_REQUIRED 1 ) set( CPACK_COMPONENT_Devel_DISPLAY_NAME "c-ares Development Files" ) set( CPACK_COMPONENT_Devel_DESCRIPTION "Development files for compiling against c-ares." ) set( CPACK_COMPONENT_Devel_REQUIRED 0 ) IF (CARES_BUILD_TOOLS) set( CPACK_COMPONENT_Tools_DISPLAY_NAME "c-ares Tools" ) set( CPACK_COMPONENT_Tools_DESCRIPTION "Tools for using c-ares." ) set( CPACK_COMPONENT_Tools_REQUIRED 0 ) ENDIF () if( ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" ) if ( "${CPACK_PACKAGE_ARCHITECTURE}" STREQUAL "" ) # Note: the architecture should default to the local architecture, but it # in fact comes up empty. We call `uname -m` to ask the kernel instead. EXECUTE_PROCESS( COMMAND uname -m COMMAND tr -d '\n' OUTPUT_VARIABLE CPACK_PACKAGE_ARCHITECTURE ) endif() set( CPACK_INCLUDE_TOPLEVEL_DIRECTORY 1 ) set( CPACK_PACKAGE_RELEASE 1 ) # RPM - https://cmake.org/cmake/help/latest/cpack_gen/rpm.html set( CPACK_RPM_PACKAGE_RELEASE ${CPACK_PACKAGE_RELEASE} ) set( CPACK_RPM_PACKAGE_ARCHITECTURE ${CPACK_PACKAGE_ARCHITECTURE} ) set( CPACK_RPM_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION_SUMMARY} ) set( CPACK_RPM_PACKAGE_URL ${CPACK_PACKAGE_HOMEPAGE_URL} ) set( CPACK_RPM_PACKAGE_LICENSE "MIT" ) set( CPACK_RPM_COMPONENT_INSTALL 1 ) set( CPACK_RPM_COMPRESSION_TYPE "xz" ) set( CPACK_RPM_PACKAGE_AUTOPROV 1 ) set( CPACK_RPM_Library_PACKAGE_SUMMARY ${CPACK_COMPONENT_Library_DESCRIPTION} ) set( CPACK_RPM_Library_PACKAGE_ARCHITECTURE ${CPACK_RPM_PACKAGE_ARCHITECTURE} ) set( CPACK_RPM_Library_PACKAGE_NAME "libcares${CARES_LIB_VERSION_MAJOR}" ) set( CPACK_RPM_Library_FILE_NAME "RPM-DEFAULT" ) set( CPACK_RPM_Devel_PACKAGE_REQUIRES "cmake >= ${CMAKE_MINIMUM_REQUIRED_VERSION}, ${CPACK_RPM_Library_PACKAGE_NAME} >= ${CPACK_PACKAGE_VERSION}" ) set( CPACK_RPM_Devel_PACKAGE_SUMMARY ${CPACK_COMPONENT_Devel_DESCRIPTION} ) set( CPACK_RPM_Devel_PACKAGE_ARCHITECTURE ${CPACK_RPM_PACKAGE_ARCHITECTURE} ) set( CPACK_RPM_Devel_PACKAGE_NAME "${CPACK_PACKAGE_NAME}-devel" ) set( CPACK_RPM_Devel_FILE_NAME "RPM-DEFAULT" ) IF (CARES_BUILD_TOOLS) set( CPACK_RPM_Tools_PACKAGE_REQUIRES "${CPACK_RPM_Library_PACKAGE_NAME} >= ${CPACK_PACKAGE_VERSION}" ) set( CPACK_RPM_Tools_PACKAGE_SUMMARY ${CPACK_COMPONENT_Tools_DESCRIPTION} ) set( CPACK_RPM_Tools_PACKAGE_ARCHITECTURE ${CPACK_RPM_PACKAGE_ARCHITECTURE} ) set( CPACK_RPM_Tools_PACKAGE_NAME "${CPACK_PACKAGE_NAME}-tools" ) set( CPACK_RPM_Tools_FILE_NAME "RPM-DEFAULT" ) ENDIF () # DEB - https://cmake.org/cmake/help/latest/cpack_gen/deb.html set( CPACK_DEBIAN_PACKAGE_RELEASE ${CPACK_PACKAGE_RELEASE} ) set( CPACK_DEBIAN_PACKAGE_HOMEPAGE ${CPACK_PACKAGE_HOMEPAGE_URL} ) set( CPACK_DEB_COMPONENT_INSTALL 1 ) set( CPACK_DEBIAN_COMPRESSION_TYPE "xz") set( CPACK_DEBIAN_PACKAGE_SHLIBDEPS 1 ) if ( ${CPACK_PACKAGE_ARCHITECTURE} STREQUAL "x86_64" ) set( CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64" ) # DEB doesn't always use the kernel's arch name else() set( CPACK_DEBIAN_PACKAGE_ARCHITECTURE ${CPACK_PACKAGE_ARCHITECTURE} ) endif() set( CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT" ) # Use default naming scheme set( CPACK_DEBIAN_LIBRARY_PACKAGE_NAME ${CPACK_RPM_Library_PACKAGE_NAME} ) set( CPACK_DEBIAN_DEVEL_PACKAGE_DEPENDS "cmake (>= ${CMAKE_MINIMUM_REQUIRED_VERSION}), ${CPACK_DEBIAN_LIBRARY_PACKAGE_NAME} (>= ${CPACK_PACKAGE_VERSION})" ) set( CPACK_DEBIAN_DEVEL_PACKAGE_NAME "${CPACK_PACKAGE_NAME}-dev" ) IF (CARES_BUILD_TOOLS) set( CPACK_DEBIAN_TOOLS_PACKAGE_NAME "${CPACK_PACKAGE_NAME}-tools" ) set( CPACK_DEBIAN_TOOLS_PACKAGE_SHLIBDEPS OFF ) # dpkg-shlibdeps can't find the libs we built set( CPACK_DEBIAN_TOOLS_PACKAGE_DEPENDS "${CPACK_DEBIAN_LIBRARY_PACKAGE_NAME} (>= ${CPACK_PACKAGE_VERSION})" ) ENDIF () elseif( ${CMAKE_HOST_WIN32} ) set( CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON ) set( CPACK_NSIS_DISPLAY_NAME ${PROJECT_NAME} ) set( CPACK_NSIS_PACKAGE_NAME ${PROJECT_NAME} ) set( CPACK_NSIS_URL_INFO_ABOUT ${CPACK_PACKAGE_HOMEPAGE_URL} ) endif() # This must always be last! include( CPack ) ENDIF () ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/CONTRIBUTING.md0000644000175100001770000000127500000000000020336 0ustar00runnerdocker00000000000000Contributing to c-ares ====================== To contribute patches to c-ares, please generate a GitHub pull request and follow these guidelines: - Check that the Travis builds are green for your pull request. - Please update the test suite to add a test case for any new functionality. - Build the library with `./configure --enable-debug --enable-maintainer-mode` and ensure there are no new warnings. To improve the chances of the c-ares maintainers responding to your request: - Also send an email to the mailing list at `c-ares@lists.haxx.se` describing your change. - To follow any associated discussion, please subscribe to the [mailing list](http://lists.haxx.se/listinfo/c-ares). ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/GIT-INFO0000644000175100001770000000053300000000000017200 0ustar00runnerdocker00000000000000 GIT-INFO This file is only present in git - never in release archives. It is used as a sentinel file in buildconf.bat in order to differentiate a git checkout from release and daily snapshot archives. On *nix-like systems, run the ./buildconf script first to generate a fresh configure script. This requires autotools to be installed locally. ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/INSTALL.md0000644000175100001770000002777600000000000017553 0ustar00runnerdocker00000000000000** This file is adapted from libcurl and not yet fully rewritten for c-ares! ** ``` ___ __ _ _ __ ___ ___ / __| ___ / _` | '__/ _ \/ __| | (_ |___| (_| | | | __/\__ \ \___| \__,_|_| \___||___/ How To Compile ``` Installing Binary Packages ========================== Lots of people download binary distributions of c-ares. This document does not describe how to install c-ares using such a binary package. This document describes how to compile, build and install c-ares from source code. Building from Git ================= If you get your code off a Git repository rather than an official release tarball, see the [GIT-INFO](GIT-INFO) file in the root directory for specific instructions on how to proceed. In particular, if not using CMake you will need to run `./buildconf` (Unix) or `buildconf.bat` (Windows) to generate build files, and for the former you will need a local installation of Autotools. If using CMake the steps are the same for both Git and official release tarballs. AutoTools Build =============== ### General Information, works on most Unix Platforms (Linux, FreeBSD, etc) A normal Unix installation is made in three or four steps (after you've unpacked the source archive): ./configure make make install You probably need to be root when doing the last command. If you have checked out the sources from the git repository, read the [GIT-INFO](GIT_INFO) on how to proceed. Get a full listing of all available configure options by invoking it like: ./configure --help If you want to install c-ares in a different file hierarchy than /usr/local, you need to specify that already when running configure: ./configure --prefix=/path/to/c-ares/tree If you happen to have write permission in that directory, you can do `make install` without being root. An example of this would be to make a local install in your own home directory: ./configure --prefix=$HOME make make install ### More Options To force configure to use the standard cc compiler if both cc and gcc are present, run configure like CC=cc ./configure # or env CC=cc ./configure To force a static library compile, disable the shared library creation by running configure like: ./configure --disable-shared If you're a c-ares developer and use gcc, you might want to enable more debug options with the `--enable-debug` option. ### Special Cases Some versions of uClibc require configuring with `CPPFLAGS=-D_GNU_SOURCE=1` to get correct large file support. The Open Watcom C compiler on Linux requires configuring with the variables: ./configure CC=owcc AR="$WATCOM/binl/wlib" AR_FLAGS=-q \ RANLIB=/bin/true STRIP="$WATCOM/binl/wstrip" CFLAGS=-Wextra ### CROSS COMPILE (This section was graciously brought to us by Jim Duey, with additions by Dan Fandrich) Download and unpack the c-ares package. `cd` to the new directory. (e.g. `cd c-ares-1.7.6`) Set environment variables to point to the cross-compile toolchain and call configure with any options you need. Be sure and specify the `--host` and `--build` parameters at configuration time. The following script is an example of cross-compiling for the IBM 405GP PowerPC processor using the toolchain from MonteVista for Hardhat Linux. ```sh #! /bin/sh export PATH=$PATH:/opt/hardhat/devkit/ppc/405/bin export CPPFLAGS="-I/opt/hardhat/devkit/ppc/405/target/usr/include" export AR=ppc_405-ar export AS=ppc_405-as export LD=ppc_405-ld export RANLIB=ppc_405-ranlib export CC=ppc_405-gcc export NM=ppc_405-nm ./configure --target=powerpc-hardhat-linux \ --host=powerpc-hardhat-linux \ --build=i586-pc-linux-gnu \ --prefix=/opt/hardhat/devkit/ppc/405/target/usr/local \ --exec-prefix=/usr/local ``` You may also need to provide a parameter like `--with-random=/dev/urandom` to configure as it cannot detect the presence of a random number generating device for a target system. The `--prefix` parameter specifies where c-ares will be installed. If `configure` completes successfully, do `make` and `make install` as usual. In some cases, you may be able to simplify the above commands to as little as: ./configure --host=ARCH-OS ### Cygwin (Windows) Almost identical to the unix installation. Run the configure script in the c-ares root with `sh configure`. Make sure you have the sh executable in `/bin/` or you'll see the configure fail toward the end. Run `make` ### QNX (This section was graciously brought to us by David Bentham) As QNX is targeted for resource constrained environments, the QNX headers set conservative limits. This includes the `FD_SETSIZE` macro, set by default to 32. Socket descriptors returned within the c-ares library may exceed this, resulting in memory faults/SIGSEGV crashes when passed into `select(..)` calls using `fd_set` macros. A good all-round solution to this is to override the default when building c-ares, by overriding `CFLAGS` during configure, example: # configure CFLAGS='-DFD_SETSIZE=64 -g -O2' ### RISC OS The library can be cross-compiled using gccsdk as follows: CC=riscos-gcc AR=riscos-ar RANLIB='riscos-ar -s' ./configure \ --host=arm-riscos-aof --without-random --disable-shared make where `riscos-gcc` and `riscos-ar` are links to the gccsdk tools. You can then link your program with `c-ares/lib/.libs/libcares.a`. ### Android Method using a configure cross-compile (tested with Android NDK r7b): - prepare the toolchain of the Android NDK for standalone use; this can be done by invoking the script: ./tools/make-standalone-toolchain.sh which creates a usual cross-compile toolchain. Lets assume that you put this toolchain below `/opt` then invoke configure with something like: ``` export PATH=/opt/arm-linux-androideabi-4.4.3/bin:$PATH ./configure --host=arm-linux-androideabi [more configure options] make ``` - if you want to compile directly from our GIT repo you might run into this issue with older automake stuff: ``` checking host system type... Invalid configuration `arm-linux-androideabi': system `androideabi' not recognized configure: error: /bin/sh ./config.sub arm-linux-androideabi failed ``` this issue can be fixed with using more recent versions of `config.sub` and `config.guess` which can be obtained here: http://git.savannah.gnu.org/gitweb/?p=config.git;a=tree you need to replace your system-own versions which usually can be found in your automake folder: `find /usr -name config.sub` CMake builds ============ Current releases of c-ares introduce a CMake v3+ build system that has been tested on most platforms including Windows, Linux, FreeBSD, MacOS, AIX and Solaris. In the most basic form, building with CMake might look like: ```sh cd /path/to/cmake/source mkdir build cd build cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local/cares .. make sudo make install ``` Options ------- Options to CMake are passed on the command line using "-D${OPTION}=${VALUE}". The values defined are all boolean and take values like On, Off, True, False. * CARES_STATIC - Build the static library (off by default) * CARES_SHARED - Build the shared library (on by default) * CARES_INSTALL - Hook in installation, useful to disable if chain building * CARES_STATIC_PIC - Build the static library as position-independent (off by default) Ninja ----- Ninja is the next-generation build system meant for generators like CMake that heavily parallize builds. Its use is very similar to the normal build: ```sh cd /path/to/cmake/source mkdir build cd build cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local/cares -G "Ninja" .. ninja sudo ninja install ``` Windows MSVC Command Line ------------------------- ``` cd \path\to\cmake\source mkdir build cd build cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=C:\cares -G "NMake Makefiles" .. nmake nmake install ``` Windows MinGW-w64 Command Line via MSYS --------------------------------------- ``` cd \path\to\cmake\source mkdir build cd build cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=C:\cares -G "MSYS Makefiles" .. make make install ``` Platform-specific build systems =============================== Win32 ----- ### Building Windows DLLs and C run-time (CRT) linkage issues As a general rule, building a DLL with static CRT linkage is highly discouraged, and intermixing CRTs in the same app is something to avoid at any cost. Reading and comprehension of Microsoft Knowledge Base articles KB94248 and KB140584 is a must for any Windows developer. Especially important is full understanding if you are not going to follow the advice given above. - [KB94248](http://support.microsoft.com/kb/94248/en-us) - How To Use the C Run-Time - [KB140584](http://support.microsoft.com/kb/140584/en-us) - How to link with the correct C Run-Time (CRT) library - [KB190799](http://msdn.microsoft.com/en-us/library/ms235460) - Potential Errors Passing CRT Objects Across DLL Boundaries If your app is misbehaving in some strange way, or it is suffering from memory corruption, before asking for further help, please try first to rebuild every single library your app uses as well as your app using the debug multithreaded dynamic C runtime. ### MingW32 Make sure that MinGW32's bin dir is in the search path, for example: set PATH=c:\mingw32\bin;%PATH% then run 'make -f Makefile.m32' in the root dir. ### MSVC 6 caveats If you use MSVC 6 it is required that you use the February 2003 edition PSDK: http://www.microsoft.com/msdownload/platformsdk/sdkupdate/psdk-full.htm ### MSVC from command line Run the `vcvars32.bat` file to get a proper environment. The `vcvars32.bat` file is part of the Microsoft development environment and you may find it in `C:\Program Files\Microsoft Visual Studio\vc98\bin` provided that you installed Visual C/C++ 6 in the default directory. Further details in [README.msvc](README.msvc) ### Important static c-ares usage note When building an application that uses the static c-ares library, you must add `-DCARES_STATICLIB` to your `CFLAGS`. Otherwise the linker will look for dynamic import symbols. IBM OS/2 -------- Building under OS/2 is not much different from building under unix. You need: - emx 0.9d - GNU make - GNU patch - ksh - GNU bison - GNU file utilities - GNU sed - autoconf 2.13 If during the linking you get an error about `_errno` being an undefined symbol referenced from the text segment, you need to add `-D__ST_MT_ERRNO__` in your definitions. If you're getting huge binaries, probably your makefiles have the `-g` in `CFLAGS`. NetWare ------- To compile `libcares.a` / `libcares.lib` you need: - either any gcc / nlmconv, or CodeWarrior 7 PDK 4 or later. - gnu make and awk running on the platform you compile on; native Win32 versions can be downloaded from: http://www.gknw.net/development/prgtools/ - recent Novell LibC SDK available from: http://developer.novell.com/ndk/libc.htm - or recent Novell CLib SDK available from: http://developer.novell.com/ndk/clib.htm Set a search path to your compiler, linker and tools; on Linux make sure that the var `OSTYPE` contains the string 'linux'; set the var `NDKBASE` to point to the base of your Novell NDK; and then type `make -f Makefile.netware` from the top source directory; PORTS ===== This is a probably incomplete list of known hardware and operating systems that c-ares has been compiled for. If you know a system c-ares compiles and runs on, that isn't listed, please let us know! - Alpha Tru64 v5.0 5.1 - ARM Android 1.5, 2.1, 2.3 - MIPS IRIX 6.2, 6.5 - Power AIX 3.2.5, 4.2, 4.3.1, 4.3.2, 5.1, 5.2 - i386 Linux 1.3, 2.0, 2.2, 2.3, 2.4, 2.6 - i386 Novell NetWare - i386 Windows 95, 98, ME, NT, 2000, XP, 2003 - x86_64 Linux Useful URLs =========== - c-ares: https://c-ares.org/ - MingW: http://www.mingw.org/ - MinGW-w64: http://mingw-w64.sourceforge.net/ - OpenWatcom: http://www.openwatcom.org/ ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/LICENSE.md0000644000175100001770000000137600000000000017513 0ustar00runnerdocker00000000000000# c-ares license Copyright (c) 2007 - 2018, Daniel Stenberg with many contributors, see AUTHORS file. Copyright 1998 by the Massachusetts Institute of Technology. Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of M.I.T. not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. M.I.T. makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/Makefile.Watcom0000644000175100001770000000741200000000000020775 0ustar00runnerdocker00000000000000# # Watcom / OpenWatcom / Win32 makefile for cares. # Quick hack by Guenter; comments to: /dev/nul # !ifndef %watcom !error WATCOM environment variable not set! !else SYS_INCL = -I$(%watcom)\h\nt -I$(%watcom)\h SYS_LIBS = $(%watcom)\lib386\nt;$(%watcom)\lib386 !endif !ifdef %libname LIBNAME = $(%libname) !else LIBNAME = cares !endif TARGETS = $(LIBNAME).dll $(LIBNAME)_imp.lib $(LIBNAME).lib DEMOS = adig.exe ahost.exe acountry.exe CC = wcc386 LD = wlink AR = wlib RC = wrc !ifdef __LOADDLL__ ! loaddll wcc386 wccd386 ! loaddll wpp386 wppd386 ! loaddll wlib wlibd !endif !if $(__VERSION__) < 1250 RM = del /q /f 2>NUL !else RM = rm -f !endif MD = mkdir RD = rmdir /q /s 2>NUL CP = copy CFLAGS = -3r -mf -hc -zff -zgf -zq -zm -zc -s -fr=con -w2 -fpi -oilrtfm & -wcd=201 -bt=nt -d+ -dWIN32 -dCARES_BUILDING_LIBRARY & -dNTDDI_VERSION=0x05010000 -I. $(SYS_INCL) LFLAGS = option quiet, map, caseexact, eliminate !ifdef %debug DEBUG = -dDEBUG=1 -dDEBUGBUILD CFLAGS += -d3 $(DEBUG) LFLAGS += debug all !else CFLAGS += -d0 !endif CFLAGS += -d_WIN32_WINNT=0x0600 # # Change to suite. # !ifdef %use_watt32 CFLAGS += -dWATT32 -I$(%watt_root)\inc !endif OBJ_BASE = WC_Win32.obj LINK_ARG = $(OBJ_BASE)\dyn\wlink.arg LIB_ARG = $(OBJ_BASE)\stat\wlib.arg # In order to process Makefile.inc wmake must be called with -u switch! !ifneq __MAKEOPTS__ -u !error You MUST call wmake with the -u switch! !else !include Makefile.inc !endif OBJS = $(CSOURCES:.c=.obj) OBJS = $OBJ_DIR\$(OBJS: = $OBJ_DIR\) # # Use $(OBJS) as a template to generate $(OBJS_STAT) and $(OBJS_DYN). # OBJ_DIR = $(OBJ_BASE)\stat OBJS_STAT = $+ $(OBJS) $- OBJ_DIR = $(OBJ_BASE)\dyn OBJS_DYN = $+ $(OBJS) $- ARESBUILDH = ares_build.h RESOURCE = $(OBJ_BASE)\dyn\cares.res all: $(ARESBUILDH) $(OBJ_BASE) $(TARGETS) $(DEMOS) .SYMBOLIC @echo Welcome to cares $(OBJ_BASE): -$(MD) $^@ -$(MD) $^@\stat -$(MD) $^@\dyn -$(MD) $^@\demos $(ARESBUILDH): .EXISTSONLY $(CP) $^@.dist $^@ $(LIBNAME).dll: $(OBJS_DYN) $(RESOURCE) $(LINK_ARG) $(LD) name $^@ @$]@ $(LIBNAME).lib: $(OBJS_STAT) $(LIB_ARG) $(AR) -q -b -c $^@ @$]@ adig.exe: $(OBJ_BASE)\demos\adig.obj $(OBJ_BASE)\demos\ares_getopt.obj $(LIBNAME).lib $(LD) name $^@ system nt $(LFLAGS) file { $(OBJ_BASE)\demos\ares_getopt.obj $[@ } library $]@, ws2_32.lib ahost.exe: $(OBJ_BASE)\demos\ahost.obj $(OBJ_BASE)\demos\ares_getopt.obj $(LIBNAME).lib $(LD) name $^@ system nt $(LFLAGS) file { $(OBJ_BASE)\demos\ares_getopt.obj $[@ } library $]@, ws2_32.lib acountry.exe: $(OBJ_BASE)\demos\acountry.obj $(OBJ_BASE)\demos\ares_getopt.obj $(LIBNAME).lib $(LD) name $^@ system nt $(LFLAGS) file { $(OBJ_BASE)\demos\ares_getopt.obj $[@ } library $]@, ws2_32.lib clean: .SYMBOLIC -$(RM) $(OBJS_STAT) -$(RM) $(OBJS_DYN) -$(RM) $(RESOURCE) $(LINK_ARG) $(LIB_ARG) vclean realclean: clean .SYMBOLIC -$(RM) $(TARGETS) $(LIBNAME).map -$(RM) $(DEMOS) $(DEMOS:.exe=.map) -$(RD) $(OBJ_BASE)\stat -$(RD) $(OBJ_BASE)\dyn -$(RD) $(OBJ_BASE)\demos -$(RD) $(OBJ_BASE) .ERASE $(RESOURCE): cares.rc .AUTODEPEND $(RC) $(DEBUG) -q -r -zm -I..\include $(SYS_INCL) $[@ -fo=$^@ .ERASE .c{$(OBJ_BASE)\dyn}.obj: $(CC) $(CFLAGS) -bd $[@ -fo=$^@ .ERASE .c{$(OBJ_BASE)\stat}.obj: $(CC) $(CFLAGS) -DCARES_STATICLIB $[@ -fo=$^@ .ERASE .c{$(OBJ_BASE)\demos}.obj: $(CC) $(CFLAGS) -DCARES_STATICLIB $[@ -fo=$^@ $(LINK_ARG): $(__MAKEFILES__) %create $^@ @%append $^@ system nt dll @%append $^@ file { $(OBJS_DYN) } @%append $^@ option res=$(RESOURCE), implib=$(LIBNAME)_imp.lib @%append $^@ $(LFLAGS) @%append $^@ libpath $(SYS_LIBS) # @%append $^@ library clib3r.lib !ifdef %use_watt32 @%append $^@ library $(%watt_root)\lib\wattcpw_imp.lib !else @%append $^@ library ws2_32.lib !endif $(LIB_ARG): $(__MAKEFILES__) %create $^@ @for %f in ($(OBJS_STAT)) do @%append $^@ +- %f ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/Makefile.am0000644000175100001770000000221000000000000020127 0ustar00runnerdocker00000000000000AUTOMAKE_OPTIONS = foreign nostdinc 1.9.6 ACLOCAL_AMFLAGS = -I m4 --install MSVCFILES = msvc_ver.inc buildconf.bat # adig and ahost are just sample programs and thus not mentioned with the # regular sources and headers EXTRA_DIST = AUTHORS CHANGES README.cares $(man_MANS) RELEASE-NOTES \ c-ares-config.cmake.in libcares.pc.cmake libcares.pc.in buildconf get_ver.awk \ maketgz TODO README.msvc $(MSVCFILES) INSTALL.md README.md LICENSE.md \ CMakeLists.txt Makefile.dj Makefile.m32 Makefile.netware Makefile.msvc \ Makefile.Watcom AUTHORS CONTRIBUTING.md SECURITY.md TODO CLEANFILES = $(PDFPAGES) $(HTMLPAGES) DISTCLEANFILES = include/ares_build.h DIST_SUBDIRS = include src test docs SUBDIRS = @BUILD_SUBDIRS@ pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libcares.pc # where to install the c-ares headers libcares_ladir = $(includedir) # Make files named *.dist replace the file without .dist extension dist-hook: find $(distdir) -name "*.dist" -exec rm {} \; (distit=`find $(srcdir) -name "*.dist"`; \ for file in $$distit; do \ strip=`echo $$file | sed -e s/^$(srcdir)// -e s/\.dist//`; \ cp $$file $(distdir)$$strip; \ done) ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/Makefile.dj0000644000175100001770000000432500000000000020140 0ustar00runnerdocker00000000000000# # c-ares Makefile for djgpp/gcc/Watt-32. # By Gisle Vanem 2004 - 2020. # include src/lib/Makefile.inc CSOURCES := $(addprefix src/lib/, $(CSOURCES)) CSOURCES := $(filter-out src/lib/windows_port.c, $(CSOURCES)) VPATH = src/lib src/tools # # Root directory for Waterloo tcp/ip. # WATT_ROOT should be set during Watt-32 install. # WATT32_ROOT = $(realpath $(WATT_ROOT)) WATT32_LIB = $(WATT32_ROOT)/lib/libwatt.a OBJ_DIR = djgpp CFLAGS = -g -O2 -I./include -I./src/lib \ -I$(WATT32_ROOT)/inc -Wall \ -DWATT32 -DHAVE_CONFIG_H \ -Dselect=select_s LDFLAGS = -s ifeq ($(OS),Windows_NT) # # Windows hosted djgpp cross compiler. Get it from: # https://github.com/andrewwutw/build-djgpp/releases # DJ_PREFIX ?= c:/some-path/djgpp/bin/i586-pc-msdosdjgpp- CC = $(DJ_PREFIX)gcc else # # The normal djgpp 'gcc' for MSDOS. # CC = gcc endif OBJECTS = $(addprefix $(OBJ_DIR)/, \ $(notdir $(CSOURCES:.c=.o))) GENERATED = src/lib/ares_config.h \ include/ares_build.h TARGETS = libcares.a acountry.exe adig.exe ahost.exe .SECONDARY: $(OBJ_DIR)/ares_getopt.o all: $(OBJ_DIR) $(GENERATED) $(TARGETS) @echo Welcome to c-ares. libcares.a: $(OBJECTS) ar rs $@ $(OBJECTS) src/lib/ares_config.h: src/lib/config-dos.h cp --update $< $@ include/ares_build.h: include/ares_build.h.dist cp --update $< $@ %.exe: src/tools/%.c $(OBJ_DIR)/ares_getopt.o libcares.a $(call compile_and_link, $@, $^ $(WATT32_LIB)) # Clean generated files and objects. # clean: - rm -f depend.dj $(GENERATED) $(OBJ_DIR)/*.o - rmdir $(OBJ_DIR) # Clean everything # realclean vclean: clean - rm -f $(TARGETS) $(TARGETS:.exe=.map) $(OBJ_DIR): - mkdir $@ $(OBJ_DIR)/%.o: %.c $(CC) $(CFLAGS) -o $@ -c $< @echo define compile_and_link $(CC) -o $(1) $(CFLAGS) $(LDFLAGS) -Wl,--print-map,--sort-common $(2) > $(1:.exe=.map) @echo endef DEP_REPLACE = sed -e 's@\(.*\)\.o: @\n$$(OBJ_DIR)\/\1.o: @' \ -e 's@$(WATT32_ROOT)@$$(WATT32_ROOT)@g' # # One may have to do 'make -f Makefile.dj clean' first in case # a foreign 'curl_config.h' is making trouble. # depend: $(GENERATED) Makefile.dj $(CC) -MM $(CFLAGS) $(CSOURCES) | $(DEP_REPLACE) > depend.dj -include depend.dj ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/Makefile.m320000644000175100001770000000422400000000000020142 0ustar00runnerdocker00000000000000############################################################# # ## Makefile for building libcares.a with MingW32 (GCC-3.2) ## Use: make -f Makefile.m32 [demos] ## ## Quick hack by Guenter; comments to: /dev/nul # ######################################################## ## Nothing more to do below this line! LIB = src/lib/libcares.a AR = $(CROSSPREFIX)ar CC = $(CROSSPREFIX)gcc LD = $(CROSSPREFIX)gcc RANLIB = $(CROSSPREFIX)ranlib #RM = rm -f CP = cp -afv CFLAGS = $(CARES_CFLAG_EXTRAS) -O2 -Wall -I./include -I./src/lib -D_WIN32_WINNT=0x0600 CFLAGS += -DCARES_STATICLIB LDFLAGS = $(CARES_LDFLAG_EXTRAS) -s LIBS = -lws2_32 -liphlpapi # Makefile.inc provides the CSOURCES and HHEADERS defines include src/lib/Makefile.inc OBJLIB := $(patsubst %.c,src/lib/%.o,$(strip $(CSOURCES))) $(LIB): $(OBJLIB) $(AR) cru $@ $^ $(RANLIB) $@ all: $(LIB) demos demos: src/tools/adig.exe src/tools/ahost.exe src/tools/acountry.exe tags: etags *.[ch] %.exe: %.o src/tools/ares_getopt.o $(LIB) $(LD) $(LDFLAGS) -o $@ $^ $(LIBS) $(OBJLIB): include/ares.h include/ares_dns.h include/ares_build.h .c.o: $(CC) $(CFLAGS) -o $@ -c $< include/ares_build.h: $(CP) include/ares_build.h.dist include/ares_build.h check: install: ${top_srcdir}/mkinstalldirs ${DESTDIR}${libdir} ${top_srcdir}/mkinstalldirs ${DESTDIR}${includedir} ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man3 ${INSTALL} -m 644 $(LIB) ${DESTDIR}${libdir} ${RANLIB} ${DESTDIR}${libdir}/$(LIB) chmod u-w ${DESTDIR}${libdir}/$(LIB) ${INSTALL} -m 444 ${srcdir}/include/ares.h ${DESTDIR}${includedir} ${INSTALL} -m 444 ${srcdir}/include/ares_build.h ${DESTDIR}${includedir} ${INSTALL} -m 444 ${srcdir}/include/ares_rules.h ${DESTDIR}${includedir} ${INSTALL} -m 444 ${srcdir}/include/ares_version.h ${DESTDIR}${includedir} (for man in $(MANPAGES); do \ ${INSTALL} -m 444 ${srcdir}/$${man} ${DESTDIR}${mandir}/man3; \ done) clean: $(RM) src/tools/ares_getopt.o $(OBJLIB) $(LIB) src/tools/adig.exe src/tools/ahost.exe src/tools/acountry.exe distclean: clean $(RM) config.cache config.log config.status Makefile ifeq "$(wildcard include/ares_build.h.dist)" "include/ares_build.h.dist" $(RM) include/ares_build.h endif ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/Makefile.msvc0000644000175100001770000004020600000000000020511 0ustar00runnerdocker00000000000000 # Copyright (C) 2009-2013 by Daniel Stenberg # # Permission to use, copy, modify, and distribute this # software and its documentation for any purpose and without # fee is hereby granted, provided that the above copyright # notice appear in all copies and that both that copyright # notice and this permission notice appear in supporting # documentation, and that the name of M.I.T. not be used in # advertising or publicity pertaining to distribution of the # software without specific, written prior permission. # M.I.T. makes no representations about the suitability of # this software for any purpose. It is provided "as is" # without express or implied warranty. # ------------------------------------------------------------------------------ # # Makefile for building c-ares libraries and sample programs with MSVC. # # Usage: nmake /f makefile.msvc CFG= # # must be one of: [ lib-release | lib-debug | dll-release | dll-debug } # must be one of: [ ALL | c-ares | acountry | adig | ahost | clean } # # If a other than ALL or clean is given, becomes mandatory. # # If neither nor are specified this results in # all targets being built for all c-ares library types. # # This makefile must be processed from the subdir where it is located. # # All results are generated below a subdirectory named msvcXXX. # # ------------------------------------------------------------------------------ NAME = cares # ------------------------------------------------ # c-ares static and dynamic libraries common base # file names for release and debug configurations # ------------------------------------------------ STA_LIB_REL = lib$(NAME) DYN_LIB_REL = $(NAME) STA_LIB_DBG = $(STA_LIB_REL)d DYN_LIB_DBG = $(DYN_LIB_REL)d # ------------------------------------------- # Base names for c-ares DLL import libraries # ------------------------------------------- IMP_LIB_REL = $(DYN_LIB_REL) IMP_LIB_DBG = $(DYN_LIB_DBG) # -------------------------- # Runtime library selection # -------------------------- RTLIB = /MD RTLIBD = /MDd !IF "$(RTLIBCFG)" == "static" RTLIB = /MT RTLIBD = /MTd !ENDIF # -------------------------------------------------------- # Define USE_WATT32 to 1 to use the Watt-32 tcp/ip stack, # otherwise Winsock tcp/ip stack will be used as default. # -------------------------------------------------------- USE_WATT32 = 0 # -------------------------------------------------------- # Detect compiler version. # -------------------------------------------------------- !INCLUDE .\msvc_ver.inc # ---------------------------------------------------- # Verify that current subdir is the c-ares source one # ---------------------------------------------------- !IF ! EXIST(.\src\lib\ares_init.c) ! MESSAGE Can not process Makefile.msvc from outside of c-ares source subdirectory. ! MESSAGE Change to the subdirectory where Makefile.msvc is found, and try again. ! ERROR See previous message. !ENDIF # ------------------------------------------------------------------ # Base subdir is the common root from which other subdirs will hang. # ------------------------------------------------------------------ BASE_DIR = .\msvc # ---------------------------------------- # Subdir holding sources for all projects # ---------------------------------------- SRCDIR = . # ----------------------------- # Default installation subdirs # ----------------------------- !IFNDEF INSTALL_DIR INSTALL_DIR = . !ENDIF !IFNDEF INSTALL_DIR_LIB INSTALL_DIR_LIB = $(INSTALL_DIR)\lib !ENDIF !IFNDEF INSTALL_DIR_INC INSTALL_DIR_INC = $(INSTALL_DIR)\include !ENDIF # ------------------------- # Configuration validation # ------------------------- VALID_CFGSET = FALSE !IF "$(CFG)" == "lib-release" || "$(CFG)" == "lib-debug" || \ "$(CFG)" == "dll-release" || "$(CFG)" == "dll-debug" VALID_CFGSET = TRUE !ENDIF !IF "$(VALID_CFGSET)" == "FALSE" && "$(CFG)" != "" ! MESSAGE MSVC c-ares makefile ! MESSAGE ! MESSAGE Usage: nmake /f makefile.msvc CFG= ! MESSAGE ! MESSAGE must be one of: [ lib-release | lib-debug | dll-release | dll-debug } ! MESSAGE must be one of: [ ALL | c-ares | acountry | adig | ahost | clean } ! MESSAGE ! MESSAGE If a other than ALL or clean is given, becomes mandatory. ! MESSAGE ! MESSAGE If neither nor are specified this results in ! MESSAGE all targets being built for all c-ares library types. ! MESSAGE ! ERROR Choose a valid configuration. !ENDIF # -------------------------------------------------------- # Project subdirs independent of configuration being used # -------------------------------------------------------- CARES_DIR = $(BASE_DIR)\cares PROG1_DIR = $(BASE_DIR)\acountry PROG2_DIR = $(BASE_DIR)\adig PROG3_DIR = $(BASE_DIR)\ahost # --------------------------------------------------- # Subdirs which are configuration dependent are only # defined when a valid configuration has been given. # --------------------------------------------------- !IF "$(VALID_CFGSET)" == "TRUE" CARES_OUTDIR = $(CARES_DIR)\$(CFG) PROG1_OUTDIR = $(PROG1_DIR)\$(CFG) PROG2_OUTDIR = $(PROG2_DIR)\$(CFG) PROG3_OUTDIR = $(PROG3_DIR)\$(CFG) CARES_OBJDIR = $(CARES_OUTDIR)\obj PROG1_OBJDIR = $(PROG1_OUTDIR)\obj PROG2_OBJDIR = $(PROG2_OUTDIR)\obj PROG3_OBJDIR = $(PROG3_OUTDIR)\obj !ELSE !UNDEF CARES_OUTDIR !UNDEF PROG1_OUTDIR !UNDEF PROG2_OUTDIR !UNDEF PROG3_OUTDIR !UNDEF CARES_OBJDIR !UNDEF PROG1_OBJDIR !UNDEF PROG2_OBJDIR !UNDEF PROG3_OBJDIR !ENDIF # ------------------------------------- # Settings that depend on tcp/ip stack # ------------------------------------- !IF "$(USE_WATT32)" == "1" CFLAGS = /UWIN32 /DWATT32 /I$(WATT_ROOT)\inc EX_LIBS_REL = $(WATT_ROOT)\lib\wattcpvc_imp.lib EX_LIBS_DBG = $(WATT_ROOT)\lib\wattcpvc_imp_d.lib !ELSE CFLAGS = /DWIN32 /D_WIN32_WINNT=0x0600 EX_LIBS_REL = ws2_32.lib advapi32.lib kernel32.lib iphlpapi.lib EX_LIBS_DBG = ws2_32.lib advapi32.lib kernel32.lib iphlpapi.lib !ENDIF # ------------------------------------------------- # Switches that depend on ancient compiler versions # ------------------------------------------------- !IF $(CC_VERS_NUM) == 60 PDB_NONE = /pdb:none PDBTYPE_CONSOLIDATE = /pdbtype:consolidate !ELSE !UNDEF PDB_NONE !UNDEF PDBTYPE_CONSOLIDATE !ENDIF !IF $(CC_VERS_NUM) <= 70 RT_ERROR_CHECKING = /GZ !ELSE RT_ERROR_CHECKING = /RTCsu !ENDIF # ---------------------------- # Assorted commands and flags # ---------------------------- CC_CMD_REL = cl.exe /nologo $(RTLIB) /DNDEBUG /O2 CC_CMD_DBG = cl.exe /nologo $(RTLIBD) /D_DEBUG /Od /Zi $(RT_ERROR_CHECKING) CC_CFLAGS = $(CFLAGS) /I.\src\lib /I.\include /W3 /EHsc /FD RC_CMD_REL = rc.exe /l 0x409 /d "NDEBUG" RC_CMD_DBG = rc.exe /l 0x409 /d "_DEBUG" LINK_CMD_LIB = link.exe /lib /nologo LINK_CMD_DLL = link.exe /dll /nologo /incremental:no /fixed:no LINK_CMD_EXE = link.exe /nologo /incremental:no /fixed:no /subsystem:console LINK_CMD_EXE_REL = $(LINK_CMD_EXE) /release $(PDB_NONE) LINK_CMD_EXE_DBG = $(LINK_CMD_EXE) /debug $(PDBTYPE_CONSOLIDATE) # --------------------------------- # Configuration dependent settings # --------------------------------- !IF "$(CFG)" == "lib-release" CARES_TARGET = $(STA_LIB_REL).lib CARES_CFLAGS = /DCARES_BUILDING_LIBRARY /DCARES_STATICLIB CARES_LFLAGS = SPROG_CFLAGS = /DCARES_STATICLIB SPROG_LFLAGS = /libpath:$(CARES_OUTDIR) $(EX_LIBS_REL) $(STA_LIB_REL).lib CARES_LINK = $(LINK_CMD_LIB) SPROG_LINK = $(LINK_CMD_EXE_REL) CC_CMD = $(CC_CMD_REL) !ENDIF !IF "$(CFG)" == "lib-debug" CARES_TARGET = $(STA_LIB_DBG).lib CARES_CFLAGS = /DCARES_BUILDING_LIBRARY /DCARES_STATICLIB /DDEBUGBUILD CARES_LFLAGS = SPROG_CFLAGS = /DCARES_STATICLIB SPROG_LFLAGS = /libpath:$(CARES_OUTDIR) $(EX_LIBS_DBG) $(STA_LIB_DBG).lib CARES_LINK = $(LINK_CMD_LIB) SPROG_LINK = $(LINK_CMD_EXE_DBG) CC_CMD = $(CC_CMD_DBG) !ENDIF !IF "$(CFG)" == "dll-release" CARES_TARGET = $(DYN_LIB_REL).dll CARES_CFLAGS = /DCARES_BUILDING_LIBRARY CARES_LFLAGS = /release $(EX_LIBS_REL) /implib:$(CARES_OUTDIR)\$(IMP_LIB_REL).lib $(PDB_NONE) SPROG_CFLAGS = SPROG_LFLAGS = /libpath:$(CARES_OUTDIR) $(EX_LIBS_REL) $(IMP_LIB_REL).lib CARES_LINK = $(LINK_CMD_DLL) SPROG_LINK = $(LINK_CMD_EXE_REL) CC_CMD = $(CC_CMD_REL) USE_RES_FILE = TRUE RC_CMD = $(RC_CMD_REL) !ENDIF !IF "$(CFG)" == "dll-debug" CARES_TARGET = $(DYN_LIB_DBG).dll CARES_CFLAGS = /DCARES_BUILDING_LIBRARY /DDEBUGBUILD CARES_LFLAGS = /debug $(EX_LIBS_DBG) /implib:$(CARES_OUTDIR)\$(IMP_LIB_DBG).lib /pdb:$(CARES_OUTDIR)\$(DYN_LIB_DBG).pdb $(PDBTYPE_CONSOLIDATE) SPROG_CFLAGS = SPROG_LFLAGS = /libpath:$(CARES_OUTDIR) $(EX_LIBS_DBG) $(IMP_LIB_DBG).lib CARES_LINK = $(LINK_CMD_DLL) SPROG_LINK = $(LINK_CMD_EXE_DBG) CC_CMD = $(CC_CMD_DBG) USE_RES_FILE = TRUE RC_CMD = $(RC_CMD_DBG) !ENDIF # -------------------------------------------- # Makefile.inc provides lists of source files # -------------------------------------------- !INCLUDE .\src\lib\Makefile.inc !INCLUDE .\src\tools\Makefile.inc # ---------------------------- # Build lists of object files # ---------------------------- !IF "$(VALID_CFGSET)" == "TRUE" !IF [ECHO CARES_OBJS=^$(CARES_OBJDIR)\$(CSOURCES: = $(CARES_OBJDIR^)\) > .\cares_objs.inc] == 0 !INCLUDE .\cares_objs.inc !IF [DEL .\cares_objs.inc] !ENDIF !ELSE !ERROR Problem generating CARES_OBJS list. !ENDIF CARES_OBJS = $(CARES_OBJS:.c=.obj) !IF "$(USE_RES_FILE)" == "TRUE" CARES_OBJS = $(CARES_OBJS) $(CARES_OBJDIR)\cares.res !ENDIF !IF [ECHO PROG1_OBJS=^$(PROG1_OBJDIR)\$(SAMPLESOURCES: = $(PROG1_OBJDIR^)\) > .\prog1_objs.inc] == 0 !INCLUDE .\prog1_objs.inc !IF [DEL .\prog1_objs.inc] !ENDIF !ELSE !ERROR Problem generating PROG1_OBJS list. !ENDIF PROG1_OBJS = $(PROG1_OBJS:.c=.obj) PROG1_OBJS = $(PROG1_OBJS:/=\) PROG1_OBJS = $(PROG1_OBJS) $(PROG1_OBJDIR)\acountry.obj !IF [ECHO PROG2_OBJS=^$(PROG2_OBJDIR)\$(SAMPLESOURCES: = $(PROG2_OBJDIR^)\) > .\prog2_objs.inc] == 0 !INCLUDE .\prog2_objs.inc !IF [DEL .\prog2_objs.inc] !ENDIF !ELSE !ERROR Problem generating PROG2_OBJS list. !ENDIF PROG2_OBJS = $(PROG2_OBJS:.c=.obj) PROG2_OBJS = $(PROG2_OBJS:/=\) PROG2_OBJS = $(PROG2_OBJS) $(PROG2_OBJDIR)\adig.obj !IF [ECHO PROG3_OBJS=^$(PROG3_OBJDIR)\$(SAMPLESOURCES: = $(PROG3_OBJDIR^)\) > .\prog3_objs.inc] == 0 !INCLUDE .\prog3_objs.inc !IF [DEL .\prog3_objs.inc] !ENDIF !ELSE !ERROR Problem generating PROG3_OBJS list. !ENDIF PROG3_OBJS = $(PROG3_OBJS:.c=.obj) PROG3_OBJS = $(PROG3_OBJS:/=\) PROG3_OBJS = $(PROG3_OBJS) $(PROG3_OBJDIR)\ahost.obj !ENDIF # -------------------------------- # Only our custom inference rules # -------------------------------- .SUFFIXES: .SUFFIXES: .c .rc {$(SRCDIR)\src\lib}.rc{$(CARES_OBJDIR)}.res: $(RC_CMD) /Fo $@ $< {$(SRCDIR)\src\lib}.c{$(CARES_OBJDIR)}.obj: $(CC_CMD) $(CC_CFLAGS) $(CARES_CFLAGS) /Fo$@ /Fd$(@D)\ /c $< {$(SRCDIR)\src\tools}.c{$(PROG1_OBJDIR)}.obj: $(CC_CMD) $(CC_CFLAGS) $(SPROG_CFLAGS) /Fo$@ /Fd$(@D)\ /c $< {$(SRCDIR)\src\tools}.c{$(PROG2_OBJDIR)}.obj: $(CC_CMD) $(CC_CFLAGS) $(SPROG_CFLAGS) /Fo$@ /Fd$(@D)\ /c $< {$(SRCDIR)\src\tools}.c{$(PROG3_OBJDIR)}.obj: $(CC_CMD) $(CC_CFLAGS) $(SPROG_CFLAGS) /Fo$@ /Fd$(@D)\ /c $< # Hack Alert! we reference ../lib/ 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}.c{$(PROG1_OBJDIR)\..\lib}.obj: $(CC_CMD) $(CC_CFLAGS) $(SPROG_CFLAGS) /Fo$(PROG1_OBJDIR)\$(@F) /Fd$(PROG1_OBJDIR)\ /c $< {$(SRCDIR)\src\lib}.c{$(PROG2_OBJDIR)\..\lib}.obj: $(CC_CMD) $(CC_CFLAGS) $(SPROG_CFLAGS) /Fo$(PROG2_OBJDIR)\$(@F) /Fd$(PROG2_OBJDIR)\ /c $< {$(SRCDIR)\src\lib}.c{$(PROG3_OBJDIR)\..\lib}.obj: $(CC_CMD) $(CC_CFLAGS) $(SPROG_CFLAGS) /Fo$(PROG3_OBJDIR)\$(@F) /Fd$(PROG3_OBJDIR)\ /c $< # ------------------------------------------------------------- # # ------------------------------------------------------------- # # Default target when no CFG library type has been specified, # # results in building target ALL for all c-ares library types. # # ------------------------------------------------------------- # # ------------------------------------------------------------- # !IF "$(VALID_CFGSET)" == "FALSE" ALL: $(MAKE) /NOLOGO /f .\Makefile.msvc CFG=lib-release ALL $(MAKE) /NOLOGO /f .\Makefile.msvc CFG=lib-debug ALL $(MAKE) /NOLOGO /f .\Makefile.msvc CFG=dll-release ALL $(MAKE) /NOLOGO /f .\Makefile.msvc CFG=dll-debug ALL clean: @-RMDIR /S /Q $(BASE_DIR) >NUL 2>&1 install: @$(MAKE) /nologo /f .\Makefile.msvc CFG=lib-release install @$(MAKE) /nologo /f .\Makefile.msvc CFG=lib-debug install @$(MAKE) /nologo /f .\Makefile.msvc CFG=dll-release install @$(MAKE) /nologo /f .\Makefile.msvc CFG=dll-debug install !ENDIF # --------------------------------------------------------------------- # Targets only available when a proper CFG library type has been given # --------------------------------------------------------------------- !IF "$(VALID_CFGSET)" == "TRUE" ALL: c-ares acountry adig ahost @ # $(HHEADERS) $(CSOURCES) c-ares: $(CARES_OBJDIR) $(CARES_OBJS) $(CARES_OUTDIR) $(CARES_LINK) $(CARES_LFLAGS) /out:$(CARES_OUTDIR)\$(CARES_TARGET) $(CARES_OBJS) ! IF "$(USE_RES_FILE)" == "TRUE" @if exist $(CARES_OUTDIR)\$(CARES_TARGET).manifest mt -nologo -manifest $(CARES_OUTDIR)\$(CARES_TARGET).manifest -outputresource:$(CARES_OUTDIR)\$(CARES_TARGET);2 ! ENDIF # acountry.c $(SAMPLESOURCES) $(SAMPLEHEADERS) acountry: c-ares $(PROG1_OBJDIR) $(PROG1_OBJS) $(PROG1_OUTDIR) $(SPROG_LINK) $(SPROG_LFLAGS) /out:$(PROG1_OUTDIR)\acountry.exe $(PROG1_OBJS:..\lib=) @if exist $(PROG1_OUTDIR)\acountry.exe.manifest mt -nologo -manifest $(PROG1_OUTDIR)\acountry.exe.manifest -outputresource:$(PROG1_OUTDIR)\acountry.exe;1 # adig.c $(SAMPLESOURCES) $(SAMPLEHEADERS) adig: c-ares $(PROG2_OBJDIR) $(PROG2_OBJS) $(PROG2_OUTDIR) $(SPROG_LINK) $(SPROG_LFLAGS) /out:$(PROG2_OUTDIR)\adig.exe $(PROG2_OBJS:..\lib=) @if exist $(PROG2_OUTDIR)\adig.exe.manifest mt -nologo -manifest $(PROG2_OUTDIR)\adig.exe.manifest -outputresource:$(PROG2_OUTDIR)\adig.exe;1 # ahost.c $(SAMPLESOURCES) $(SAMPLEHEADERS) ahost: c-ares $(PROG3_OBJDIR) $(PROG3_OBJS) $(PROG3_OUTDIR) $(SPROG_LINK) $(SPROG_LFLAGS) /out:$(PROG3_OUTDIR)\ahost.exe $(PROG3_OBJS:..\lib=) @if exist $(PROG3_OUTDIR)\ahost.exe.manifest mt -nologo -manifest $(PROG3_OUTDIR)\ahost.exe.manifest -outputresource:$(PROG3_OUTDIR)\ahost.exe;1 $(CARES_OUTDIR): $(CARES_DIR) @if not exist $(CARES_OUTDIR) mkdir $(CARES_OUTDIR) $(PROG1_OUTDIR): $(PROG1_DIR) @if not exist $(PROG1_OUTDIR) mkdir $(PROG1_OUTDIR) $(PROG2_OUTDIR): $(PROG2_DIR) @if not exist $(PROG2_OUTDIR) mkdir $(PROG2_OUTDIR) $(PROG3_OUTDIR): $(PROG3_DIR) @if not exist $(PROG3_OUTDIR) mkdir $(PROG3_OUTDIR) $(CARES_OBJDIR): $(CARES_OUTDIR) @if not exist $(CARES_OBJDIR) mkdir $(CARES_OBJDIR) $(PROG1_OBJDIR): $(PROG1_OUTDIR) @if not exist $(PROG1_OBJDIR) mkdir $(PROG1_OBJDIR) $(PROG2_OBJDIR): $(PROG2_OUTDIR) @if not exist $(PROG2_OBJDIR) mkdir $(PROG2_OBJDIR) $(PROG3_OBJDIR): $(PROG3_OUTDIR) @if not exist $(PROG3_OBJDIR) mkdir $(PROG3_OBJDIR) clean: @-RMDIR /S /Q $(CARES_OUTDIR) >NUL 2>&1 @-RMDIR /S /Q $(PROG1_OUTDIR) >NUL 2>&1 @-RMDIR /S /Q $(PROG2_OUTDIR) >NUL 2>&1 @-RMDIR /S /Q $(PROG3_OUTDIR) >NUL 2>&1 install: @if not exist $(CARES_OUTDIR)\$(CARES_TARGET) \ $(MAKE) /f .\Makefile.msvc CFG=$(CFG) c-ares @if not exist "$(INSTALL_DIR)" mkdir "$(INSTALL_DIR)" @if not exist "$(INSTALL_DIR_LIB)" mkdir "$(INSTALL_DIR_LIB)" @if not exist "$(INSTALL_DIR_INC)" mkdir "$(INSTALL_DIR_INC)" @copy /y $(CARES_OUTDIR)\*.* "$(INSTALL_DIR_LIB)" >NUL @copy /y $(SRCDIR)\include\ares.h "$(INSTALL_DIR_INC)" >NUL @copy /y $(SRCDIR)\include\ares_build.h "$(INSTALL_DIR_INC)" >NUL @copy /y $(SRCDIR)\include\ares_rules.h "$(INSTALL_DIR_INC)" >NUL @copy /y $(SRCDIR)\include\ares_version.h "$(INSTALL_DIR_INC)" >NUL @echo Installed c-ares $(CFG) !ENDIF $(BASE_DIR): @if not exist $(BASE_DIR) mkdir $(BASE_DIR) $(CARES_DIR): $(BASE_DIR) @if not exist $(CARES_DIR) mkdir $(CARES_DIR) $(PROG1_DIR): $(BASE_DIR) @if not exist $(PROG1_DIR) mkdir $(PROG1_DIR) $(PROG2_DIR): $(BASE_DIR) @if not exist $(PROG2_DIR) mkdir $(PROG2_DIR) $(PROG3_DIR): $(BASE_DIR) @if not exist $(PROG3_DIR) mkdir $(PROG3_DIR) # End of Makefile.msvc ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/Makefile.netware0000644000175100001770000003410500000000000021207 0ustar00runnerdocker00000000000000################################################################# # ## Makefile for building libcares (NetWare version - gnu make) ## Use: make -f Makefile.netware ## ## Comments to: Guenter Knauf http://www.gknw.de/phpbb # ################################################################# # Edit the path below to point to the base of your Novell NDK. ifndef NDKBASE NDKBASE = c:/novell endif ifndef INSTDIR INSTDIR = ../ares-$(LIBCARES_VERSION_STR)-bin-nw endif # Edit the vars below to change NLM target settings. TARGETS = adig.nlm ahost.nlm acountry.nlm LTARGET = libcares.$(LIBEXT) VERSION = $(LIBCARES_VERSION) COPYR = $(LIBCARES_COPYRIGHT_STR) DESCR = cURL $(subst .def,,$(notdir $@)) $(LIBCARES_VERSION_STR) - http://curl.haxx.se MTSAFE = YES STACK = 64000 SCREEN = none #EXPORTS = # Comment the line below if you dont want to load protected automatically. #LDRING = 3 # Edit the var below to point to your lib architecture. ifndef LIBARCH LIBARCH = LIBC endif # must be equal to NDEBUG or DEBUG ifndef DB DB = NDEBUG endif # Optimization: -O or debugging: -g ifeq ($(DB),NDEBUG) OPT = -O2 OBJDIR = release else OPT = -g OBJDIR = debug endif # Include the version info retrieved from curlver.h -include $(OBJDIR)/version.inc # The following lines defines your compiler. ifdef CWFolder METROWERKS = $(CWFolder) endif ifdef METROWERKS # MWCW_PATH = $(subst \,/,$(METROWERKS))/Novell Support MWCW_PATH = $(subst \,/,$(METROWERKS))/Novell Support/Metrowerks Support CC = mwccnlm else CC = gcc endif # a native win32 awk can be downloaded from here: # http://www.gknw.net/development/prgtools/awk-20070501.zip AWK = awk YACC = bison -y CP = cp -afv MKDIR = mkdir # RM = rm -f # if you want to mark the target as MTSAFE you will need a tool for # generating the xdc data for the linker; here's a minimal tool: # http://www.gknw.net/development/prgtools/mkxdc.zip MPKXDC = mkxdc # Global flags for all compilers CFLAGS += $(OPT) -D$(DB) -DNETWARE -DHAVE_CONFIG_H -nostdinc ifeq ($(CC),mwccnlm) LD = mwldnlm LDFLAGS = -nostdlib $(PRELUDE) $(OBJEXE) $(<:.def=.o) -o $@ -commandfile AR = mwldnlm ARFLAGS = -nostdlib -type library -o LIBEXT = lib #RANLIB = CFLAGS += -msgstyle gcc -gccinc -inline off -opt nointrinsics -proc 586 CFLAGS += -relax_pointers #CFLAGS += -w on ifeq ($(LIBARCH),LIBC) PRELUDE = $(SDK_LIBC)/imports/libcpre.o CFLAGS += -align 4 else # PRELUDE = $(SDK_CLIB)/imports/clibpre.o # to avoid the __init_* / __deinit_* whoes dont use prelude from NDK PRELUDE = "$(MWCW_PATH)/libraries/runtime/prelude.obj" # CFLAGS += -include "$(MWCW_PATH)/headers/nlm_clib_prefix.h" CFLAGS += -align 1 endif else LD = nlmconv LDFLAGS = -T AR = ar ARFLAGS = -cq LIBEXT = a RANLIB = ranlib CFLAGS += -m32 CFLAGS += -fno-builtin -fno-strict-aliasing ifeq ($(findstring gcc,$(CC)),gcc) CFLAGS += -fpcc-struct-return endif CFLAGS += -Wall # -pedantic ifeq ($(LIBARCH),LIBC) PRELUDE = $(SDK_LIBC)/imports/libcpre.gcc.o else # PRELUDE = $(SDK_CLIB)/imports/clibpre.gcc.o # to avoid the __init_* / __deinit_* whoes dont use prelude from NDK # http://www.gknw.net/development/mk_nlm/gcc_pre.zip PRELUDE = $(NDK_ROOT)/pre/prelude.o CFLAGS += -include $(NDKBASE)/nlmconv/genlm.h endif endif NDK_ROOT = $(NDKBASE)/ndk SDK_CLIB = $(NDK_ROOT)/nwsdk SDK_LIBC = $(NDK_ROOT)/libc ifeq ($(LIBARCH),LIBC) INCLUDES += -I$(SDK_LIBC)/include # INCLUDES += -I$(SDK_LIBC)/include/nks # INCLUDES += -I$(SDK_LIBC)/include/winsock CFLAGS += -D_POSIX_SOURCE else INCLUDES += -I$(SDK_CLIB)/include/nlm # INCLUDES += -I$(SDK_CLIB)/include/nlm/obsolete # INCLUDES += -I$(SDK_CLIB)/include endif CFLAGS += -I. $(INCLUDES) ifeq ($(MTSAFE),YES) XDCOPT = -n endif ifeq ($(MTSAFE),NO) XDCOPT = -u endif ifeq ($(findstring /sh,$(SHELL)),/sh) DL = ' #-include $(NDKBASE)/nlmconv/ncpfs.inc endif # Makefile.inc provides the CSOURCES and HHEADERS defines include Makefile.inc OBJLIB := $(patsubst %.c,$(OBJDIR)/%.o,$(strip $(CSOURCES))) OBJEXE = $(OBJLIB) $(OBJDIR)/ares_getopt.o .PHONY: lib nlm prebuild dist install clean lib: prebuild $(LTARGET) nlm: prebuild $(TARGETS) prebuild: $(OBJDIR) ares_build.h $(OBJDIR)/version.inc ares_config.h install: $(INSTDIR) all @$(CP) *.nlm $(INSTDIR) @$(CP) ../CHANGES $(INSTDIR) @$(CP) ../COPYING $(INSTDIR) @$(CP) ../README $(INSTDIR) @$(CP) ../RELEASE-NOTES $(INSTDIR) clean: -$(RM) $(LTARGET) $(TARGETS) ares_config.h -$(RM) -r $(OBJDIR) -$(RM) -r arpa %.$(LIBEXT): $(OBJLIB) @echo Creating $@ @-$(RM) $@ @$(AR) $(ARFLAGS) $@ $^ ifdef RANLIB @$(RANLIB) $@ endif %.nlm: $(OBJDIR)/%.def $(OBJDIR)/%.o $(OBJDIR)/%.xdc $(OBJEXE) @echo Linking $@ @-$(RM) $@ @$(LD) $(LDFLAGS) $< $(OBJDIR) $(INSTDIR): @$(MKDIR) $@ $(OBJDIR)/%.o: %.c # @echo Compiling $< $(CC) $(CFLAGS) -c $< -o $@ $(OBJDIR)/version.inc: ares_version.h $(OBJDIR) @echo Creating $@ @$(AWK) -f get_ver.awk $< > $@ $(OBJDIR)/%.xdc: Makefile.netware @echo Creating $@ @$(MPKXDC) $(XDCOPT) $@ $(OBJDIR)/%.def: Makefile.netware @echo Creating $@ @echo $(DL)# DEF file for linking with $(LD)$(DL) > $@ @echo $(DL)# Do not edit this file - it is created by make!$(DL) >> $@ @echo $(DL)# All your changes will be lost!!$(DL) >> $@ @echo $(DL)#$(DL) >> $@ @echo $(DL)copyright "$(COPYR)"$(DL) >> $@ @echo $(DL)description "$(DESCR)"$(DL) >> $@ @echo $(DL)version $(VERSION)$(DL) >> $@ ifdef NLMTYPE @echo $(DL)type $(NLMTYPE)$(DL) >> $@ endif ifdef STACK @echo $(DL)stack $(STACK)$(DL) >> $@ endif ifdef SCREEN @echo $(DL)screenname "$(SCREEN)"$(DL) >> $@ else @echo $(DL)screenname "DEFAULT"$(DL) >> $@ endif ifeq ($(DB),DEBUG) @echo $(DL)debug$(DL) >> $@ endif @echo $(DL)threadname "$^"$(DL) >> $@ ifdef XDCOPT @echo $(DL)xdcdata $(@:.def=.xdc)$(DL) >> $@ endif ifeq ($(LDRING),0) @echo $(DL)flag_on 16$(DL) >> $@ endif ifeq ($(LDRING),3) @echo $(DL)flag_on 512$(DL) >> $@ endif ifeq ($(LIBARCH),CLIB) @echo $(DL)start _Prelude$(DL) >> $@ @echo $(DL)exit _Stop$(DL) >> $@ @echo $(DL)import @$(SDK_CLIB)/imports/clib.imp$(DL) >> $@ @echo $(DL)import @$(SDK_CLIB)/imports/threads.imp$(DL) >> $@ @echo $(DL)import @$(SDK_CLIB)/imports/nlmlib.imp$(DL) >> $@ @echo $(DL)import @$(SDK_CLIB)/imports/socklib.imp$(DL) >> $@ @echo $(DL)module clib$(DL) >> $@ else @echo $(DL)flag_on 64$(DL) >> $@ @echo $(DL)pseudopreemption$(DL) >> $@ @echo $(DL)start _LibCPrelude$(DL) >> $@ @echo $(DL)exit _LibCPostlude$(DL) >> $@ @echo $(DL)check _LibCCheckUnload$(DL) >> $@ @echo $(DL)import @$(SDK_LIBC)/imports/libc.imp$(DL) >> $@ @echo $(DL)import @$(SDK_LIBC)/imports/netware.imp$(DL) >> $@ @echo $(DL)module libc$(DL) >> $@ endif ifdef MODULES @echo $(DL)module $(MODULES)$(DL) >> $@ endif ifdef EXPORTS @echo $(DL)export $(EXPORTS)$(DL) >> $@ endif ifdef IMPORTS @echo $(DL)import $(IMPORTS)$(DL) >> $@ endif ifeq ($(LD),nlmconv) @echo $(DL)input $(PRELUDE)$(DL) >> $@ @echo $(DL)input $(OBJEXE)$(DL) >> $@ @echo $(DL)input $(@:.def=.o)$(DL) >> $@ @echo $(DL)output $(notdir $(@:.def=.nlm))$(DL) >> $@ endif ares_config.h: Makefile.netware @echo Creating $@ @echo $(DL)/* $@ for NetWare target.$(DL) > $@ @echo $(DL)** Do not edit this file - it is created by make!$(DL) >> $@ @echo $(DL)** All your changes will be lost!!$(DL) >> $@ @echo $(DL)*/$(DL) >> $@ @echo $(DL)#ifndef NETWARE$(DL) >> $@ @echo $(DL)#error This $(notdir $@) is created for NetWare platform!$(DL) >> $@ @echo $(DL)#endif$(DL) >> $@ @echo $(DL)#define VERSION "$(LIBCARES_VERSION_STR)"$(DL) >> $@ @echo $(DL)#define PACKAGE_BUGREPORT "a suitable curl mailing list => http://curl.haxx.se/mail/"$(DL) >> $@ ifeq ($(LIBARCH),CLIB) @echo $(DL)#define OS "i586-pc-clib-NetWare"$(DL) >> $@ @echo $(DL)#define HAVE_STRICMP 1$(DL) >> $@ @echo $(DL)#define HAVE_STRNICMP 1$(DL) >> $@ @echo $(DL)#define NETDB_USE_INTERNET 1$(DL) >> $@ @echo $(DL)#define RECV_TYPE_ARG1 int$(DL) >> $@ @echo $(DL)#define RECV_TYPE_ARG2 char *$(DL) >> $@ @echo $(DL)#define RECV_TYPE_ARG3 int$(DL) >> $@ @echo $(DL)#define RECV_TYPE_ARG4 int$(DL) >> $@ @echo $(DL)#define RECV_TYPE_RETV int$(DL) >> $@ @echo $(DL)#define RECVFROM_TYPE_ARG1 int$(DL) >> $@ @echo $(DL)#define RECVFROM_TYPE_ARG2 char$(DL) >> $@ @echo $(DL)#define RECVFROM_TYPE_ARG3 int$(DL) >> $@ @echo $(DL)#define RECVFROM_TYPE_ARG4 int$(DL) >> $@ @echo $(DL)#define RECVFROM_TYPE_ARG5 struct sockaddr$(DL) >> $@ @echo $(DL)#define RECVFROM_TYPE_ARG6 int$(DL) >> $@ @echo $(DL)#define RECVFROM_TYPE_RETV int$(DL) >> $@ @echo $(DL)#define SEND_QUAL_ARG2$(DL) >> $@ @echo $(DL)#define SEND_TYPE_ARG1 int$(DL) >> $@ @echo $(DL)#define SEND_TYPE_ARG2 char *$(DL) >> $@ @echo $(DL)#define SEND_TYPE_ARG3 int$(DL) >> $@ @echo $(DL)#define SEND_TYPE_ARG4 int$(DL) >> $@ @echo $(DL)#define SEND_TYPE_RETV int$(DL) >> $@ else @echo $(DL)#define OS "i586-pc-libc-NetWare"$(DL) >> $@ @echo $(DL)#define HAVE_DLFCN_H 1$(DL) >> $@ @echo $(DL)#define HAVE_DLOPEN 1$(DL) >> $@ @echo $(DL)#define HAVE_FTRUNCATE 1$(DL) >> $@ @echo $(DL)#define HAVE_GETTIMEOFDAY 1$(DL) >> $@ @echo $(DL)#define HAVE_INTTYPES_H 1$(DL) >> $@ @echo $(DL)#define HAVE_LONGLONG 1$(DL) >> $@ @echo $(DL)#define HAVE_STDINT_H 1$(DL) >> $@ @echo $(DL)#define HAVE_STRCASECMP 1$(DL) >> $@ @echo $(DL)#define HAVE_STRLCAT 1$(DL) >> $@ @echo $(DL)#define HAVE_STRLCPY 1$(DL) >> $@ @echo $(DL)#define HAVE_STRTOLL 1$(DL) >> $@ @echo $(DL)#define HAVE_SYS_PARAM_H 1$(DL) >> $@ @echo $(DL)#define HAVE_SYS_SELECT_H 1$(DL) >> $@ @echo $(DL)#define HAVE_TERMIOS_H 1$(DL) >> $@ @echo $(DL)#define HAVE_AF_INET6 1$(DL) >> $@ @echo $(DL)#define HAVE_PF_INET6 1$(DL) >> $@ @echo $(DL)#define HAVE_FREEADDRINFO 1$(DL) >> $@ @echo $(DL)#define HAVE_GETADDRINFO 1$(DL) >> $@ @echo $(DL)#define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1$(DL) >> $@ @echo $(DL)#define HAVE_STRUCT_IN6_ADDR 1$(DL) >> $@ @echo $(DL)#define HAVE_STRUCT_SOCKADDR_IN6 1$(DL) >> $@ @echo $(DL)#define RECV_TYPE_ARG1 int$(DL) >> $@ @echo $(DL)#define RECV_TYPE_ARG2 void *$(DL) >> $@ @echo $(DL)#define RECV_TYPE_ARG3 size_t$(DL) >> $@ @echo $(DL)#define RECV_TYPE_ARG4 int$(DL) >> $@ @echo $(DL)#define RECV_TYPE_RETV ssize_t$(DL) >> $@ @echo $(DL)#define RECVFROM_TYPE_ARG1 int$(DL) >> $@ @echo $(DL)#define RECVFROM_TYPE_ARG2 void$(DL) >> $@ @echo $(DL)#define RECVFROM_TYPE_ARG3 size_t$(DL) >> $@ @echo $(DL)#define RECVFROM_TYPE_ARG4 int$(DL) >> $@ @echo $(DL)#define RECVFROM_TYPE_ARG5 struct sockaddr$(DL) >> $@ @echo $(DL)#define RECVFROM_TYPE_ARG6 size_t$(DL) >> $@ @echo $(DL)#define RECVFROM_TYPE_RETV ssize_t$(DL) >> $@ @echo $(DL)#define RECVFROM_TYPE_ARG2_IS_VOID 1$(DL) >> $@ @echo $(DL)#define SEND_QUAL_ARG2$(DL) >> $@ @echo $(DL)#define SEND_TYPE_ARG1 int$(DL) >> $@ @echo $(DL)#define SEND_TYPE_ARG2 void *$(DL) >> $@ @echo $(DL)#define SEND_TYPE_ARG3 size_t$(DL) >> $@ @echo $(DL)#define SEND_TYPE_ARG4 int$(DL) >> $@ @echo $(DL)#define SEND_TYPE_RETV ssize_t$(DL) >> $@ endif @echo $(DL)#define HAVE_ARPA_INET_H 1$(DL) >> $@ @echo $(DL)#define HAVE_ASSERT_H 1$(DL) >> $@ @echo $(DL)#define HAVE_ERRNO_H 1$(DL) >> $@ @echo $(DL)#define HAVE_ERR_H 1$(DL) >> $@ @echo $(DL)#define HAVE_FCNTL_H 1$(DL) >> $@ @echo $(DL)#define HAVE_GETENV 1$(DL) >> $@ @echo $(DL)#define HAVE_GETHOSTBYADDR 1$(DL) >> $@ @echo $(DL)#define HAVE_GETHOSTBYNAME 1$(DL) >> $@ @echo $(DL)#define HAVE_GETHOSTNAME 1$(DL) >> $@ @echo $(DL)#define HAVE_GETPROTOBYNAME 1$(DL) >> $@ @echo $(DL)#define HAVE_GMTIME_R 1$(DL) >> $@ @echo $(DL)#define HAVE_INET_ADDR 1$(DL) >> $@ @echo $(DL)#define HAVE_IOCTL 1$(DL) >> $@ @echo $(DL)#define HAVE_IOCTL_FIONBIO 1$(DL) >> $@ @echo $(DL)#define HAVE_LIMITS_H 1$(DL) >> $@ @echo $(DL)#define HAVE_LL 1$(DL) >> $@ @echo $(DL)#define HAVE_LOCALTIME_R 1$(DL) >> $@ @echo $(DL)#define HAVE_MALLOC_H 1$(DL) >> $@ @echo $(DL)#define HAVE_NETINET_IN_H 1$(DL) >> $@ @echo $(DL)#define HAVE_RECV 1$(DL) >> $@ @echo $(DL)#define HAVE_RECVFROM 1$(DL) >> $@ @echo $(DL)#define HAVE_SELECT 1$(DL) >> $@ @echo $(DL)#define HAVE_SEND 1$(DL) >> $@ @echo $(DL)#define HAVE_SETJMP_H 1$(DL) >> $@ @echo $(DL)#define HAVE_SIGNAL 1$(DL) >> $@ @echo $(DL)#define HAVE_SIGNAL_H 1$(DL) >> $@ @echo $(DL)#define HAVE_SIG_ATOMIC_T 1$(DL) >> $@ @echo $(DL)#define HAVE_SOCKET 1$(DL) >> $@ @echo $(DL)#define HAVE_STDLIB_H 1$(DL) >> $@ @echo $(DL)#define HAVE_STRDUP 1$(DL) >> $@ @echo $(DL)#define HAVE_STRFTIME 1$(DL) >> $@ @echo $(DL)#define HAVE_STRING_H 1$(DL) >> $@ @echo $(DL)#define HAVE_STRSTR 1$(DL) >> $@ @echo $(DL)#define HAVE_STRUCT_ADDRINFO 1$(DL) >> $@ @echo $(DL)#define HAVE_STRUCT_TIMEVAL 1$(DL) >> $@ @echo $(DL)#define HAVE_SYS_IOCTL_H 1$(DL) >> $@ @echo $(DL)#define HAVE_SYS_STAT_H 1$(DL) >> $@ @echo $(DL)#define HAVE_SYS_TIME_H 1$(DL) >> $@ @echo $(DL)#define HAVE_TIME_H 1$(DL) >> $@ @echo $(DL)#define HAVE_UNAME 1$(DL) >> $@ @echo $(DL)#define HAVE_UNISTD_H 1$(DL) >> $@ @echo $(DL)#define HAVE_UTIME 1$(DL) >> $@ @echo $(DL)#define HAVE_UTIME_H 1$(DL) >> $@ @echo $(DL)#define HAVE_WRITEV 1$(DL) >> $@ @echo $(DL)#define RETSIGTYPE void$(DL) >> $@ @echo $(DL)#define STDC_HEADERS 1$(DL) >> $@ @echo $(DL)#define TIME_WITH_SYS_TIME 1$(DL) >> $@ ifdef NW_WINSOCK @echo $(DL)#define HAVE_CLOSESOCKET 1$(DL) >> $@ else @echo $(DL)#define HAVE_SYS_TYPES_H 1$(DL) >> $@ @echo $(DL)#define HAVE_SYS_SOCKET_H 1$(DL) >> $@ @echo $(DL)#define HAVE_SYS_SOCKIO_H 1$(DL) >> $@ @echo $(DL)#define HAVE_NETDB_H 1$(DL) >> $@ endif @echo $(DL)#ifdef __GNUC__$(DL) >> $@ @echo $(DL)#define HAVE_VARIADIC_MACROS_GCC 1$(DL) >> $@ @echo $(DL)#else$(DL) >> $@ @echo $(DL)#define HAVE_VARIADIC_MACROS_C99 1$(DL) >> $@ @echo $(DL)#endif$(DL) >> $@ FORCE: ; ares_build.h: Makefile.netware FORCE @echo Creating $@ @echo $(DL)/* $@ intended for NetWare target.$(DL) > $@ @echo $(DL)** Do not edit this file - it is created by make!$(DL) >> $@ @echo $(DL)** All your changes will be lost!!$(DL) >> $@ @echo $(DL)*/$(DL) >> $@ @echo $(DL)#ifndef NETWARE$(DL) >> $@ @echo $(DL)#error This $(notdir $@) is created for NetWare platform!$(DL) >> $@ @echo $(DL)#endif$(DL) >> $@ @echo $(DL)#ifndef __CARES_BUILD_H$(DL) >> $@ @echo $(DL)#define __CARES_BUILD_H$(DL) >> $@ ifeq ($(LIBARCH),CLIB) @echo $(DL)#define CARES_TYPEOF_ARES_SOCKLEN_T int$(DL) >> $@ else @echo $(DL)#define CARES_TYPEOF_ARES_SOCKLEN_T unsigned int$(DL) >> $@ endif @echo $(DL)typedef CARES_TYPEOF_ARES_SOCKLEN_T ares_socklen_t;$(DL) >> $@ @echo $(DL)#endif /* __CARES_BUILD_H */$(DL) >> $@ ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/NEWS0000644000175100001770000000152600000000000016603 0ustar00runnerdocker00000000000000Major changes since: * see the CHANGES file Major changes in release 1.1.1: * ares should now compile as C++ code (no longer uses reserved word "class"). * Added SRV support to adig test program. * Fixed a few error handling bugs in query processing. Major changes in release 1.1.0: * Added ares_free_string() function so that memory can be freed in the same layer as it is allocated, a desirable feature in some environments. * A few of the ares_dns.h macros are fixed to use the proper bitwise operator. * Fixed a couple of fenceposts fixed in ares_expand_name()'s bounds-checking. * In process_timeouts(), extract query->next before calling next_server() and possibly freeing the query structure. * Casted arguments to ctype macros casted to unsigned char, since not all char values are valid inputs to those macros according to ANSI. ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/README.cares0000644000175100001770000000125600000000000020060 0ustar00runnerdocker00000000000000c-ares ====== This package is based on ares 1.1.1 (written by Greg Hudson). Daniel Stenberg decided to fork and release a separate project since the original ares author didn't want the improvements that were vital for our use of it. This package is dubbed 'c-ares' since Daniel wanted this for use within the curl project (hence the letter C) and it makes a nice pun. c-ares is not API compatible with ares: a new name makes that more obvious to the public. The original libares was distributed at ftp://athena-dist.mit.edu:pub/ATHENA/ares (which seems to not be alive anymore). A local copy of the original ares package is kept here: https://c-ares.org/download/ares-1.1.1.tar.gz ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/README.md0000644000175100001770000000705000000000000017361 0ustar00runnerdocker00000000000000c-ares ====== [![Build Status](https://api.cirrus-ci.com/github/c-ares/c-ares.svg)](https://cirrus-ci.com/github/c-ares/c-ares) [![Windows Build Status](https://ci.appveyor.com/api/projects/status/aevgc5914tm72pvs/branch/master?svg=true)](https://ci.appveyor.com/project/c-ares/c-ares/branch/master) [![Coverage Status](https://coveralls.io/repos/c-ares/c-ares/badge.svg?branch=master&service=github)](https://coveralls.io/github/c-ares/c-ares?branch=master) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/291/badge)](https://bestpractices.coreinfrastructure.org/projects/291) [![Fuzzing Status](https://oss-fuzz-build-logs.storage.googleapis.com/badges/c-ares.svg)](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:c-ares) [![Releases](https://coderelease.io/badge/c-ares/c-ares)](https://coderelease.io/github/repository/c-ares/c-ares) This is c-ares, an asynchronous resolver library. It is intended for applications which need to perform DNS queries without blocking, or need to perform multiple DNS queries in parallel. The primary examples of such applications are servers which communicate with multiple clients and programs with graphical user interfaces. The full source code is available in the ['c-ares' release archives](https://c-ares.org/download/), and in a git repository: https://github.com/c-ares/c-ares. See the [INSTALL.md](INSTALL.md) file for build information. If you find bugs, correct flaws, have questions or have comments in general in regard to c-ares (or by all means the original ares too), get in touch with us on the c-ares mailing list: https://lists.haxx.se/listinfo/c-ares c-ares is of course distributed under the same MIT-style license as the original ares. You'll find all c-ares details and news here: https://c-ares.org/ Notes for c-ares hackers ------------------------ * The distributed `ares_build.h` file is only intended to be used on systems which can not run the also distributed configure script. * The distributed `ares_build.h` file is generated as a copy of `ares_build.h.dist` when the c-ares source code distribution archive file is originally created. * If you check out from git on a non-configure platform, you must run the appropriate `buildconf*` script to set up `ares_build.h` and other local files before being able to compile the library. * On systems capable of running the `configure` script, the `configure` process will overwrite the distributed `ares_build.h` file with one that is suitable and specific to the library being configured and built, this new file is generated from the `ares_build.h.in` template file. * If you intend to distribute an already compiled c-ares library you **MUST** also distribute along with it the generated `ares_build.h` which has been used to compile it. Otherwise the library will be of no use for the users of the library that you have built. It is **your** responsibility to provide this file. No one at the c-ares project can know how you have built the library. * File `ares_build.h` includes platform and configuration dependent info, and must not be modified by anyone. Configure script generates it for you. * We cannot assume anything else but very basic compiler features being present. While c-ares requires an ANSI C compiler to build, some of the earlier ANSI compilers clearly can't deal with some preprocessor operators. * Newlines must remain unix-style for older compilers' sake. * Comments must be written in the old-style /* unnested C-fashion */ * Try to keep line lengths below 80 columns. ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/README.msvc0000644000175100001770000000717100000000000017735 0ustar00runnerdocker00000000000000 ___ __ _ _ __ ___ ___ / __| ___ / _` | '__/ _ \/ __| | (_ |___| (_| | | | __/\__ \ \___| \__,_|_| \___||___/ How to build c-ares using MSVC or Visual Studio ================================================= How to build using MSVC from the command line --------------------------------------------- Open a command prompt window and ensure that the environment is properly set up in order to use MSVC or Visual Studio compiler tools. Change to c-ares source folder where Makefile.msvc file is located and run: > nmake -f Makefile.msvc This will build all c-ares libraries as well as three sample programs. Once the above command has finished a new folder named MSVCXX will exist below the folder where makefile.msvc is found. The name of the folder depends on the MSVC compiler version being used to build c-ares. Below the MSVCXX folder there will exist four folders named 'cares', 'ahost', 'acountry', and 'adig'. The 'cares' folder is the one that holds the c-ares libraries you have just generated, the other three hold sample programs that use the libraries. The above command builds four versions of the c-ares library, dynamic and static versions and each one in release and debug flavours. Each of these is found in folders named dll-release, dll-debug, lib-release, and lib-debug, which hang from the 'cares' folder mentioned above. Each sample program also has folders with the same names to reflect which library version it is using. How to install using MSVC from the command line ----------------------------------------------- In order to allow easy usage of c-ares libraries it may be convenient to install c-ares libraries and header files to a common subdirectory tree. Once that c-ares libraries have been built using procedure described above, use same command prompt window to define environment variable INSTALL_DIR to designate the top subdirectory where installation of c-ares libraries and header files will be done. > set INSTALL_DIR=c:\c-ares Afterwards, run following command to actually perform the installation: > nmake -f Makefile.msvc install Installation procedure will copy c-ares libraries to subdirectory 'lib' and c-ares header files to subdirectory 'include' below the INSTALL_DIR subdir. When environment variable INSTALL_DIR is not defined, installation is done to c-ares source folder where Makefile.msvc file is located. Relationship between c-ares library file names and versions ----------------------------------------------------------- c-ares static release library version files: libcares.lib -> static release library c-ares static debug library version files: libcaresd.lib -> static debug library c-ares dynamic release library version files: cares.dll -> dynamic release library cares.lib -> import library for the dynamic release library cares.exp -> export file for the dynamic release library c-ares dynamic debug library version files: caresd.dll -> dynamic debug library caresd.lib -> import library for the dynamic debug library caresd.exp -> export file for the dynamic debug library caresd.pdb -> debug symbol file for the dynamic debug library How to use c-ares static libraries ---------------------------------- When using the c-ares static library in your program, you will have to define preprocessor symbol CARES_STATICLIB while building your program, otherwise you will get errors at linkage stage. Have Fun! ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/RELEASE-NOTES0000644000175100001770000000722600000000000020000 0ustar00runnerdocker00000000000000c-ares version 1.18.1 This is an urgent bugfix release for a regression made in 1.18.0. Bug fixes: o ares_getaddrinfo() would return ai_addrlen of 16 for ipv6 adddresses rather than the sizeof(struct sockaddr_in6) c-ares version 1.18.0 This is a feature and bugfix release. It addresses a couple of new feature requests as well as a couple of bug fixes. Changes: o Add support for URI(Uniform Resource Identifier) records via ares_parse_uri_reply() [1] o Provide ares_nameser.h as a public interface as needed by NodeJS [5] o Update URLs from c-ares.haxx.se to c-ares.org [9] o During a domain search, treat ARES_ENODATA as ARES_NXDOMAIN so that the search process will continue to the next domain in the search. [11] o Turn ares_gethostbyname() into a wrapper for ares_getaddrinfo() as they followed very similar code paths and ares_gethostbyaddr() has some more desirable features such as priority sorting and parallel queries for AF_UNSPEC. [12] o ares_getaddrinfo() now contains a name element in the address info structure as the last element. This is not an API or ABI break due to the structure always being internally allocated and it being the last element. [12] o ares_parse_a_reply() and ares_parse_aaaa_reply() were nearly identical, those now use the same helper functions for parsing rather than having their own code. [12] o RFC6761 Section 6.3 says "localhost" lookups need to be special cased to return loopback addresses, and not forward queries to recursive dns servers. On Windows this now returns all loopback addresses, on other systems it returns 127.0.0.1 or ::1 always, and will never forward a request for "localhost" to outside DNS servers. [13] o Haiki: port [14] Bug fixes: o add build to .gitignore [2] o z/OS minor update, add missing semicolon in ares_init.c [3] o Fix building when latest ax_code_coverage.m4 is imported [4] o Work around autotools 'error: too many loops' and other newer autotools import related bugs. o MinGW cross builds need advapi32 link as lower case [6] o Cygwin build fix due to containing both socket.h and winsock2.h [7] o ares_expand_name should allow underscores (_) as SRV records legitimately use them [8] o Allow '/' as a valid character for a returned name for CNAME in-addr.arpa delegation [10] o ares_getaddrinfo() was not honoring HOSTALIASES [12] o ares_getaddrinfo() had some test cases disabled due to a bug in the test framework itself which has now been resolved [12] o Due to Travis-CI becoming unfriendly to open-source, Cirrus-CI has now been brought online for automated unit testing. Thanks go to these friendly people for their efforts and contributions: Biswapriyo Nath (@Biswa96) Brad House (@bradh352) Daniel Bevenius (@danbev) Daniel Stenberg (@bagder) Dhrumil Rana (@dhrumilrana) Felix Yan (@felixonmars) Jérôme Duval (@korli) Martin Holeš (@martin-256) Sinan Kaya (9 contributors) References to bug reports and discussions on issues: [1] = https://github.com/c-ares/c-ares/pull/411 [2] = https://github.com/c-ares/c-ares/pull/410 [3] = https://github.com/c-ares/c-ares/pull/414 [4] = https://github.com/c-ares/c-ares/pull/418 [5] = https://github.com/c-ares/c-ares/pull/417 [6] = https://github.com/c-ares/c-ares/pull/420 [7] = https://github.com/c-ares/c-ares/pull/422 [8] = https://github.com/c-ares/c-ares/issues/424 [9] = https://github.com/c-ares/c-ares/issues/423 [10] = https://github.com/c-ares/c-ares/issues/427 [11] = https://github.com/c-ares/c-ares/issues/426 [12] = https://github.com/c-ares/c-ares/pull/428 [13] = https://github.com/c-ares/c-ares/pull/430 [14] = https://github.com/c-ares/c-ares/pull/431 ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/RELEASE-PROCEDURE.md0000644000175100001770000000263600000000000021037 0ustar00runnerdocker00000000000000c-ares release procedure - how to do a release ============================================== in the source code repo ----------------------- - edit `RELEASE-NOTES` to be accurate - edit `configure.ac`'s `CARES_VERSION_INFO`, and `CMakeLists.txt`'s `CARES_LIB_VERSIONINFO` set to the same value to denote the current shared object versioning. - make sure all relevant changes are committed on the master branch - tag the git repo in this style: `git tag -a cares-1_14_0` -a annotates the tag and we use underscores instead of dots in the version number. - run "./maketgz 1.14.0" to build the release tarball. It is important that you run this on a machine with the correct set of autotools etc installed as this is what then will be shipped and used by most users on *nix like systems. - push the git commits and the new tag - gpg sign the tarball - upload the resulting files to https://c-ares.org/download/ - update `ares_version.h` for the next version in the c-ares-www repo ---------------------- - edit `index.t` (version number and date), - edit `changelog.t` (add the new release in there) - commit all local changes - tag the repo with the same tag as used for the source repo - push the git commits and the new tag inform ------ - send an email to the c-ares mailing list. Insert the RELEASE-NOTES into the mail. celebrate --------- - suitable beverage intake is encouraged for the festivities ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/SECURITY.md0000644000175100001770000001057000000000000017674 0ustar00runnerdocker00000000000000c-ares security =============== This document is intended to provide guidance on how security vulnerabilities should be handled in the c-ares project. Publishing Information ---------------------- All known and public c-ares vulnerabilities will be listed on [the c-ares web site](https://c-ares.org/vulns.html). Security vulnerabilities should not be entered in the project's public bug tracker unless the necessary configuration is in place to limit access to the issue to only the reporter and the project's security team. Vulnerability Handling ---------------------- The typical process for handling a new security vulnerability is as follows. No information should be made public about a vulnerability until it is formally announced at the end of this process. That means, for example that a bug tracker entry must NOT be created to track the issue since that will make the issue public and it should not be discussed on the project's public mailing list. Also messages associated with any commits should not make any reference to the security nature of the commit if done prior to the public announcement. - The person discovering the issue, the reporter, reports the vulnerability privately to `c-ares-security@haxx.se`. That's an email alias that reaches a handful of selected and trusted people. - Messages that do not relate to the reporting or managing of an undisclosed security vulnerability in c-ares are ignored and no further action is required. - A person in the security team sends an e-mail to the original reporter to acknowledge the report. - The security team investigates the report and either rejects it or accepts it. - If the report is rejected, the team writes to the reporter to explain why. - If the report is accepted, the team writes to the reporter to let him/her know it is accepted and that they are working on a fix. - The security team discusses the problem, works out a fix, considers the impact of the problem and suggests a release schedule. This discussion should involve the reporter as much as possible. - The release of the information should be "as soon as possible" and is most often synced with an upcoming release that contains the fix. If the reporter, or anyone else, thinks the next planned release is too far away then a separate earlier release for security reasons should be considered. - Write a security advisory draft about the problem that explains what the problem is, its impact, which versions it affects, solutions or workarounds, when the release is out and make sure to credit all contributors properly. - Request a CVE number from [distros@openwall](http://oss-security.openwall.org/wiki/mailing-lists/distros) when also informing and preparing them for the upcoming public security vulnerability announcement - attach the advisory draft for information. Note that 'distros' won't accept an embargo longer than 19 days. - Update the "security advisory" with the CVE number. - The security team commits the fix in a private branch. The commit message should ideally contain the CVE number. This fix is usually also distributed to the 'distros' mailing list to allow them to use the fix prior to the public announcement. - At the day of the next release, the private branch is merged into the master branch and pushed. Once pushed, the information is accessible to the public and the actual release should follow suit immediately afterwards. - The project team creates a release that includes the fix. - The project team announces the release and the vulnerability to the world in the same manner we always announce releases. It gets sent to the c-ares mailing list and the oss-security mailing list. - The security web page on the web site should get the new vulnerability mentioned. C-ARES-SECURITY (at haxx dot se) -------------------------------- Who is on this list? There are a couple of criteria you must meet, and then we might ask you to join the list or you can ask to join it. It really isn't very formal. We basically only require that you have a long-term presence in the c-ares project and you have shown an understanding for the project and its way of working. You must've been around for a good while and you should have no plans in vanishing in the near future. We do not make the list of partipants public mostly because it tends to vary somewhat over time and a list somewhere will only risk getting outdated. ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/TODO0000644000175100001770000000132700000000000016573 0ustar00runnerdocker00000000000000TODO ==== ares_reinit() - To allow an app to force a re-read of /etc/resolv.conf etc, pretty much like the res_init() resolver function offers ares_gethostbyname - When built to support IPv6, it needs to also support PF_UNSPEC or similar, so that an application can ask for any protocol and then c-ares would return all known resolves and not just explicitly IPv4 _or_ IPv6 resolves. ares_process - Upon next ABI breakage ares_process() should be changed to return 'int' and return ARES_ENOTINITIALIZED if ares_library_init() has not been called. ares_process_fd - Upon next ABI breakage ares_process_fd() should be changed to return 'int' and return ARES_ENOTINITIALIZED if library has not been initialized. ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/acinclude.m40000644000175100001770000014643300000000000020304 0ustar00runnerdocker00000000000000 dnl CURL_CHECK_DEF (SYMBOL, [INCLUDES], [SILENT]) dnl ------------------------------------------------- dnl Use the C preprocessor to find out if the given object-style symbol dnl is defined and get its expansion. This macro will not use default dnl includes even if no INCLUDES argument is given. This macro will run dnl silently when invoked with three arguments. If the expansion would dnl result in a set of double-quoted strings the returned expansion will dnl actually be a single double-quoted string concatenating all them. AC_DEFUN([CURL_CHECK_DEF], [ AS_VAR_PUSHDEF([ac_HaveDef], [curl_cv_have_def_$1])dnl AS_VAR_PUSHDEF([ac_Def], [curl_cv_def_$1])dnl if test -z "$SED"; then AC_MSG_ERROR([SED not set. Cannot continue without SED being set.]) fi if test -z "$GREP"; then AC_MSG_ERROR([GREP not set. Cannot continue without GREP being set.]) fi ifelse($3,,[AC_MSG_CHECKING([for preprocessor definition of $1])]) tmp_exp="" AC_PREPROC_IFELSE([ AC_LANG_SOURCE( ifelse($2,,,[$2])[[ #ifdef $1 CURL_DEF_TOKEN $1 #endif ]]) ],[ tmp_exp=`eval "$ac_cpp conftest.$ac_ext" 2>/dev/null | \ "$GREP" CURL_DEF_TOKEN 2>/dev/null | \ "$SED" 's/.*CURL_DEF_TOKEN[[ ]][[ ]]*//' 2>/dev/null | \ "$SED" 's/[["]][[ ]]*[["]]//g' 2>/dev/null` if test -z "$tmp_exp" || test "$tmp_exp" = "$1"; then tmp_exp="" fi ]) if test -z "$tmp_exp"; then AS_VAR_SET(ac_HaveDef, no) ifelse($3,,[AC_MSG_RESULT([no])]) else AS_VAR_SET(ac_HaveDef, yes) AS_VAR_SET(ac_Def, $tmp_exp) ifelse($3,,[AC_MSG_RESULT([$tmp_exp])]) fi AS_VAR_POPDEF([ac_Def])dnl AS_VAR_POPDEF([ac_HaveDef])dnl ]) dnl CURL_CHECK_DEF_CC (SYMBOL, [INCLUDES], [SILENT]) dnl ------------------------------------------------- dnl Use the C compiler to find out only if the given symbol is defined dnl or not, this can not find out its expansion. This macro will not use dnl default includes even if no INCLUDES argument is given. This macro dnl will run silently when invoked with three arguments. AC_DEFUN([CURL_CHECK_DEF_CC], [ AS_VAR_PUSHDEF([ac_HaveDef], [curl_cv_have_def_$1])dnl ifelse($3,,[AC_MSG_CHECKING([for compiler definition of $1])]) AC_COMPILE_IFELSE([ AC_LANG_SOURCE( ifelse($2,,,[$2])[[ int main (void) { #ifdef $1 return 0; #else force compilation error #endif } ]]) ],[ tst_symbol_defined="yes" ],[ tst_symbol_defined="no" ]) if test "$tst_symbol_defined" = "yes"; then AS_VAR_SET(ac_HaveDef, yes) ifelse($3,,[AC_MSG_RESULT([yes])]) else AS_VAR_SET(ac_HaveDef, no) ifelse($3,,[AC_MSG_RESULT([no])]) fi AS_VAR_POPDEF([ac_HaveDef])dnl ]) dnl CARES_CHECK_LIB_XNET dnl ------------------------------------------------- dnl Verify if X/Open network library is required. AC_DEFUN([CARES_CHECK_LIB_XNET], [ AC_MSG_CHECKING([if X/Open network library is required]) tst_lib_xnet_required="no" AC_COMPILE_IFELSE([ AC_LANG_SOURCE([[ int main (void) { #if defined(__hpux) && defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 600) return 0; #elif defined(__hpux) && defined(_XOPEN_SOURCE_EXTENDED) return 0; #else force compilation error #endif } ]]) ],[ tst_lib_xnet_required="yes" LIBS="$LIBS -lxnet" ]) AC_MSG_RESULT([$tst_lib_xnet_required]) ]) dnl CARES_CHECK_AIX_ALL_SOURCE dnl ------------------------------------------------- dnl Provides a replacement of traditional AC_AIX with dnl an uniform behaviour across all autoconf versions, dnl and with our own placement rules. AC_DEFUN([CARES_CHECK_AIX_ALL_SOURCE], [ AH_VERBATIM([_ALL_SOURCE], [/* Define to 1 if OS is AIX. */ #ifndef _ALL_SOURCE # undef _ALL_SOURCE #endif]) AC_BEFORE([$0], [AC_SYS_LARGEFILE])dnl AC_BEFORE([$0], [CARES_CONFIGURE_REENTRANT])dnl AC_MSG_CHECKING([if OS is AIX (to define _ALL_SOURCE)]) AC_EGREP_CPP([yes_this_is_aix],[ #ifdef _AIX yes_this_is_aix #endif ],[ AC_MSG_RESULT([yes]) AC_DEFINE(_ALL_SOURCE) ],[ AC_MSG_RESULT([no]) ]) ]) dnl CURL_CHECK_HEADER_WINDOWS dnl ------------------------------------------------- dnl Check for compilable and valid windows.h header AC_DEFUN([CURL_CHECK_HEADER_WINDOWS], [ AC_CACHE_CHECK([for windows.h], [ac_cv_header_windows_h], [ AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #undef inline #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #include ]],[[ #if defined(__CYGWIN__) || defined(__CEGCC__) HAVE_WINDOWS_H shall not be defined. #else int dummy=2*WINVER; #endif ]]) ],[ ac_cv_header_windows_h="yes" ],[ ac_cv_header_windows_h="no" ]) ]) case "$ac_cv_header_windows_h" in yes) AC_DEFINE_UNQUOTED(HAVE_WINDOWS_H, 1, [Define to 1 if you have the windows.h header file.]) AC_DEFINE_UNQUOTED(WIN32_LEAN_AND_MEAN, 1, [Define to avoid automatic inclusion of winsock.h]) ;; esac ]) dnl CURL_CHECK_NATIVE_WINDOWS dnl ------------------------------------------------- dnl Check if building a native Windows target AC_DEFUN([CURL_CHECK_NATIVE_WINDOWS], [ AC_REQUIRE([CURL_CHECK_HEADER_WINDOWS])dnl AC_CACHE_CHECK([whether build target is a native Windows one], [ac_cv_native_windows], [ if test "$ac_cv_header_windows_h" = "no"; then ac_cv_native_windows="no" else AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ ]],[[ #if defined(__MINGW32__) || defined(__MINGW32CE__) || \ (defined(_MSC_VER) && (defined(_WIN32) || defined(_WIN64))) int dummy=1; #else Not a native Windows build target. #endif ]]) ],[ ac_cv_native_windows="yes" ],[ ac_cv_native_windows="no" ]) fi ]) AM_CONDITIONAL(DOING_NATIVE_WINDOWS, test "x$ac_cv_native_windows" = xyes) ]) dnl CURL_CHECK_HEADER_WINSOCK dnl ------------------------------------------------- dnl Check for compilable and valid winsock.h header AC_DEFUN([CURL_CHECK_HEADER_WINSOCK], [ AC_REQUIRE([CURL_CHECK_HEADER_WINDOWS])dnl AC_CACHE_CHECK([for winsock.h], [ac_cv_header_winsock_h], [ AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #undef inline #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #include #include ]],[[ #if defined(__CYGWIN__) || defined(__CEGCC__) HAVE_WINSOCK_H shall not be defined. #else int dummy=WSACleanup(); #endif ]]) ],[ ac_cv_header_winsock_h="yes" ],[ ac_cv_header_winsock_h="no" ]) ]) case "$ac_cv_header_winsock_h" in yes) AC_DEFINE_UNQUOTED(HAVE_WINSOCK_H, 1, [Define to 1 if you have the winsock.h header file.]) ;; esac ]) dnl CURL_CHECK_HEADER_WINSOCK2 dnl ------------------------------------------------- dnl Check for compilable and valid winsock2.h header AC_DEFUN([CURL_CHECK_HEADER_WINSOCK2], [ AC_REQUIRE([CURL_CHECK_HEADER_WINDOWS])dnl AC_CACHE_CHECK([for winsock2.h], [ac_cv_header_winsock2_h], [ AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #undef inline #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #include #include ]],[[ #if defined(__CYGWIN__) || defined(__CEGCC__) || defined(__MINGW32CE__) HAVE_WINSOCK2_H shall not be defined. #else int dummy=2*IPPROTO_ESP; #endif ]]) ],[ ac_cv_header_winsock2_h="yes" ],[ ac_cv_header_winsock2_h="no" ]) ]) case "$ac_cv_header_winsock2_h" in yes) AC_DEFINE_UNQUOTED(HAVE_WINSOCK2_H, 1, [Define to 1 if you have the winsock2.h header file.]) ;; esac ]) dnl CURL_CHECK_HEADER_WS2TCPIP dnl ------------------------------------------------- dnl Check for compilable and valid ws2tcpip.h header AC_DEFUN([CURL_CHECK_HEADER_WS2TCPIP], [ AC_REQUIRE([CURL_CHECK_HEADER_WINSOCK2])dnl AC_CACHE_CHECK([for ws2tcpip.h], [ac_cv_header_ws2tcpip_h], [ AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #undef inline #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #include #include #include ]],[[ #if defined(__CYGWIN__) || defined(__CEGCC__) || defined(__MINGW32CE__) HAVE_WS2TCPIP_H shall not be defined. #else int dummy=2*IP_PKTINFO; #endif ]]) ],[ ac_cv_header_ws2tcpip_h="yes" ],[ ac_cv_header_ws2tcpip_h="no" ]) ]) case "$ac_cv_header_ws2tcpip_h" in yes) AC_DEFINE_UNQUOTED(HAVE_WS2TCPIP_H, 1, [Define to 1 if you have the ws2tcpip.h header file.]) ;; esac ]) dnl CURL_CHECK_HEADER_MALLOC dnl ------------------------------------------------- dnl Check for compilable and valid malloc.h header, dnl and check if it is needed even with stdlib.h AC_DEFUN([CURL_CHECK_HEADER_MALLOC], [ AC_CACHE_CHECK([for malloc.h], [ac_cv_header_malloc_h], [ AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #include ]],[[ void *p = malloc(10); void *q = calloc(10,10); free(p); free(q); ]]) ],[ ac_cv_header_malloc_h="yes" ],[ ac_cv_header_malloc_h="no" ]) ]) if test "$ac_cv_header_malloc_h" = "yes"; then AC_DEFINE_UNQUOTED(HAVE_MALLOC_H, 1, [Define to 1 if you have the malloc.h header file.]) # AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #include ]],[[ void *p = malloc(10); void *q = calloc(10,10); free(p); free(q); ]]) ],[ curl_cv_need_header_malloc_h="no" ],[ curl_cv_need_header_malloc_h="yes" ]) # case "$curl_cv_need_header_malloc_h" in yes) AC_DEFINE_UNQUOTED(NEED_MALLOC_H, 1, [Define to 1 if you need the malloc.h header file even with stdlib.h]) ;; esac fi ]) dnl CURL_CHECK_HEADER_MEMORY dnl ------------------------------------------------- dnl Check for compilable and valid memory.h header, dnl and check if it is needed even with stdlib.h for dnl memory related functions. AC_DEFUN([CURL_CHECK_HEADER_MEMORY], [ AC_CACHE_CHECK([for memory.h], [ac_cv_header_memory_h], [ AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #include ]],[[ void *p = malloc(10); void *q = calloc(10,10); free(p); free(q); ]]) ],[ ac_cv_header_memory_h="yes" ],[ ac_cv_header_memory_h="no" ]) ]) if test "$ac_cv_header_memory_h" = "yes"; then AC_DEFINE_UNQUOTED(HAVE_MEMORY_H, 1, [Define to 1 if you have the memory.h header file.]) # AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #include ]],[[ void *p = malloc(10); void *q = calloc(10,10); free(p); free(q); ]]) ],[ curl_cv_need_header_memory_h="no" ],[ curl_cv_need_header_memory_h="yes" ]) # case "$curl_cv_need_header_memory_h" in yes) AC_DEFINE_UNQUOTED(NEED_MEMORY_H, 1, [Define to 1 if you need the memory.h header file even with stdlib.h]) ;; esac fi ]) dnl CURL_CHECK_FUNC_GETNAMEINFO dnl ------------------------------------------------- dnl Test if the getnameinfo function is available, dnl and check the types of five of its arguments. dnl If the function succeeds HAVE_GETNAMEINFO will be dnl defined, defining the types of the arguments in dnl GETNAMEINFO_TYPE_ARG1, GETNAMEINFO_TYPE_ARG2, dnl GETNAMEINFO_TYPE_ARG46 and GETNAMEINFO_TYPE_ARG7, dnl and also defining the type qualifier of first dnl argument in GETNAMEINFO_QUAL_ARG1. AC_DEFUN([CURL_CHECK_FUNC_GETNAMEINFO], [ AC_REQUIRE([CURL_CHECK_HEADER_WS2TCPIP])dnl AC_CHECK_HEADERS(sys/types.h sys/socket.h netdb.h) # AC_MSG_CHECKING([for getnameinfo]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([getnameinfo]) ],[ AC_MSG_RESULT([yes]) curl_cv_getnameinfo="yes" ],[ AC_MSG_RESULT([no]) curl_cv_getnameinfo="no" ]) # if test "$curl_cv_getnameinfo" != "yes"; then AC_MSG_CHECKING([deeper for getnameinfo]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ ]],[[ getnameinfo(); ]]) ],[ AC_MSG_RESULT([yes]) curl_cv_getnameinfo="yes" ],[ AC_MSG_RESULT([but still no]) curl_cv_getnameinfo="no" ]) fi # if test "$curl_cv_getnameinfo" != "yes"; then AC_MSG_CHECKING([deeper and deeper for getnameinfo]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ #undef inline #ifdef HAVE_WINDOWS_H #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #include #ifdef HAVE_WINSOCK2_H #include #ifdef HAVE_WS2TCPIP_H #include #endif #endif #else #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_NETDB_H #include #endif #endif ]],[[ getnameinfo(0, 0, 0, 0, 0, 0, 0); ]]) ],[ AC_MSG_RESULT([yes]) curl_cv_getnameinfo="yes" ],[ AC_MSG_RESULT([but still no]) curl_cv_getnameinfo="no" ]) fi # if test "$curl_cv_getnameinfo" = "yes"; then AC_CACHE_CHECK([types of arguments for getnameinfo], [curl_cv_func_getnameinfo_args], [ curl_cv_func_getnameinfo_args="unknown" for gni_arg1 in 'struct sockaddr *' 'const struct sockaddr *' 'void *'; do for gni_arg2 in 'socklen_t' 'size_t' 'int'; do for gni_arg46 in 'size_t' 'int' 'socklen_t' 'unsigned int' 'DWORD'; do for gni_arg7 in 'int' 'unsigned int'; do if test "$curl_cv_func_getnameinfo_args" = "unknown"; then AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #undef inline #ifdef HAVE_WINDOWS_H #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #if (!defined(_WIN32_WINNT)) || (_WIN32_WINNT < 0x0501) #undef _WIN32_WINNT #define _WIN32_WINNT 0x0501 #endif #include #ifdef HAVE_WINSOCK2_H #include #ifdef HAVE_WS2TCPIP_H #include #endif #endif #define GNICALLCONV WSAAPI #else #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_NETDB_H #include #endif #define GNICALLCONV #endif extern int GNICALLCONV getnameinfo($gni_arg1, $gni_arg2, char *, $gni_arg46, char *, $gni_arg46, $gni_arg7); ]],[[ $gni_arg2 salen=0; $gni_arg46 hostlen=0; $gni_arg46 servlen=0; $gni_arg7 flags=0; int res = getnameinfo(0, salen, 0, hostlen, 0, servlen, flags); ]]) ],[ curl_cv_func_getnameinfo_args="$gni_arg1,$gni_arg2,$gni_arg46,$gni_arg7" ]) fi done done done done ]) # AC-CACHE-CHECK if test "$curl_cv_func_getnameinfo_args" = "unknown"; then AC_MSG_WARN([Cannot find proper types to use for getnameinfo args]) AC_MSG_WARN([HAVE_GETNAMEINFO will not be defined]) else gni_prev_IFS=$IFS; IFS=',' set dummy `echo "$curl_cv_func_getnameinfo_args" | sed 's/\*/\*/g'` IFS=$gni_prev_IFS shift # gni_qual_type_arg1=$[1] # AC_DEFINE_UNQUOTED(GETNAMEINFO_TYPE_ARG2, $[2], [Define to the type of arg 2 for getnameinfo.]) AC_DEFINE_UNQUOTED(GETNAMEINFO_TYPE_ARG46, $[3], [Define to the type of args 4 and 6 for getnameinfo.]) AC_DEFINE_UNQUOTED(GETNAMEINFO_TYPE_ARG7, $[4], [Define to the type of arg 7 for getnameinfo.]) # prev_sh_opts=$- # case $prev_sh_opts in *f*) ;; *) set -f ;; esac # case "$gni_qual_type_arg1" in const*) gni_qual_arg1=const gni_type_arg1=`echo $gni_qual_type_arg1 | sed 's/^const //'` ;; *) gni_qual_arg1= gni_type_arg1=$gni_qual_type_arg1 ;; esac # AC_DEFINE_UNQUOTED(GETNAMEINFO_QUAL_ARG1, $gni_qual_arg1, [Define to the type qualifier of arg 1 for getnameinfo.]) AC_DEFINE_UNQUOTED(GETNAMEINFO_TYPE_ARG1, $gni_type_arg1, [Define to the type of arg 1 for getnameinfo.]) # case $prev_sh_opts in *f*) ;; *) set +f ;; esac # AC_DEFINE_UNQUOTED(HAVE_GETNAMEINFO, 1, [Define to 1 if you have the getnameinfo function.]) ac_cv_func_getnameinfo="yes" fi fi ]) dnl TYPE_SOCKADDR_STORAGE dnl ------------------------------------------------- dnl Check for struct sockaddr_storage. Most IPv6-enabled dnl hosts have it, but AIX 4.3 is one known exception. AC_DEFUN([TYPE_SOCKADDR_STORAGE], [ AC_CHECK_TYPE([struct sockaddr_storage], AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE, 1, [if struct sockaddr_storage is defined]), , [ #undef inline #ifdef HAVE_WINDOWS_H #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #include #ifdef HAVE_WINSOCK2_H #include #endif #else #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_NETINET_IN_H #include #endif #ifdef HAVE_ARPA_INET_H #include #endif #endif ]) ]) dnl CURL_CHECK_NI_WITHSCOPEID dnl ------------------------------------------------- dnl Check for working NI_WITHSCOPEID in getnameinfo() AC_DEFUN([CURL_CHECK_NI_WITHSCOPEID], [ AC_REQUIRE([CURL_CHECK_FUNC_GETNAMEINFO])dnl AC_REQUIRE([TYPE_SOCKADDR_STORAGE])dnl AC_CHECK_HEADERS(stdio.h sys/types.h sys/socket.h \ netdb.h netinet/in.h arpa/inet.h) # AC_CACHE_CHECK([for working NI_WITHSCOPEID], [ac_cv_working_ni_withscopeid], [ AC_RUN_IFELSE([ AC_LANG_PROGRAM([[ #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_NETDB_H #include #endif #ifdef HAVE_NETINET_IN_H #include #endif #ifdef HAVE_ARPA_INET_H #include #endif ]],[[ #if defined(NI_WITHSCOPEID) && defined(HAVE_GETNAMEINFO) #ifdef HAVE_STRUCT_SOCKADDR_STORAGE struct sockaddr_storage sa; #else unsigned char sa[256]; #endif char hostbuf[NI_MAXHOST]; int rc; GETNAMEINFO_TYPE_ARG2 salen = (GETNAMEINFO_TYPE_ARG2)sizeof(sa); GETNAMEINFO_TYPE_ARG46 hostlen = (GETNAMEINFO_TYPE_ARG46)sizeof(hostbuf); GETNAMEINFO_TYPE_ARG7 flags = NI_NUMERICHOST | NI_NUMERICSERV | NI_WITHSCOPEID; int fd = socket(AF_INET6, SOCK_STREAM, 0); if(fd < 0) { perror("socket()"); return 1; /* Error creating socket */ } rc = getsockname(fd, (GETNAMEINFO_TYPE_ARG1)&sa, &salen); if(rc) { perror("getsockname()"); return 2; /* Error retrieving socket name */ } rc = getnameinfo((GETNAMEINFO_TYPE_ARG1)&sa, salen, hostbuf, hostlen, NULL, 0, flags); if(rc) { printf("rc = %s\n", gai_strerror(rc)); return 3; /* Error translating socket address */ } return 0; /* Ok, NI_WITHSCOPEID works */ #else return 4; /* Error, NI_WITHSCOPEID not defined or no getnameinfo() */ #endif ]]) # AC-LANG-PROGRAM ],[ # Exit code == 0. Program worked. ac_cv_working_ni_withscopeid="yes" ],[ # Exit code != 0. Program failed. ac_cv_working_ni_withscopeid="no" ],[ # Program is not run when cross-compiling. So we assume # NI_WITHSCOPEID will work if we are able to compile it. AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #include #include #include ]],[[ unsigned int dummy= NI_NUMERICHOST | NI_NUMERICSERV | NI_WITHSCOPEID; ]]) ],[ ac_cv_working_ni_withscopeid="yes" ],[ ac_cv_working_ni_withscopeid="no" ]) # AC-COMPILE-IFELSE ]) # AC-RUN-IFELSE ]) # AC-CACHE-CHECK case "$ac_cv_working_ni_withscopeid" in yes) AC_DEFINE(HAVE_NI_WITHSCOPEID, 1, [Define to 1 if NI_WITHSCOPEID exists and works.]) ;; esac ]) dnl CURL_CHECK_FUNC_RECV dnl ------------------------------------------------- dnl Test if the socket recv() function is available, dnl and check its return type and the types of its dnl arguments. If the function succeeds HAVE_RECV dnl will be defined, defining the types of the arguments dnl in RECV_TYPE_ARG1, RECV_TYPE_ARG2, RECV_TYPE_ARG3 dnl and RECV_TYPE_ARG4, defining the type of the function dnl return value in RECV_TYPE_RETV. AC_DEFUN([CURL_CHECK_FUNC_RECV], [ AC_REQUIRE([CURL_CHECK_HEADER_WINSOCK])dnl AC_REQUIRE([CURL_CHECK_HEADER_WINSOCK2])dnl AC_CHECK_HEADERS(sys/types.h sys/socket.h) # AC_MSG_CHECKING([for recv]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ #undef inline #ifdef HAVE_WINDOWS_H #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #include #ifdef HAVE_WINSOCK2_H #include #else #ifdef HAVE_WINSOCK_H #include #endif #endif #else #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif #endif ]],[[ recv(0, 0, 0, 0); ]]) ],[ AC_MSG_RESULT([yes]) curl_cv_recv="yes" ],[ AC_MSG_RESULT([no]) curl_cv_recv="no" ]) # if test "$curl_cv_recv" = "yes"; then AC_CACHE_CHECK([types of args and return type for recv], [curl_cv_func_recv_args], [ curl_cv_func_recv_args="unknown" for recv_retv in 'int' 'ssize_t'; do for recv_arg1 in 'int' 'ssize_t' 'SOCKET'; do for recv_arg2 in 'char *' 'void *'; do for recv_arg3 in 'size_t' 'int' 'socklen_t' 'unsigned int'; do for recv_arg4 in 'int' 'unsigned int'; do if test "$curl_cv_func_recv_args" = "unknown"; then AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #undef inline #ifdef HAVE_WINDOWS_H #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #include #ifdef HAVE_WINSOCK2_H #include #else #ifdef HAVE_WINSOCK_H #include #endif #endif #define RECVCALLCONV PASCAL #else #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif #define RECVCALLCONV #endif extern $recv_retv RECVCALLCONV recv($recv_arg1, $recv_arg2, $recv_arg3, $recv_arg4); ]],[[ $recv_arg1 s=0; $recv_arg2 buf=0; $recv_arg3 len=0; $recv_arg4 flags=0; $recv_retv res = recv(s, buf, len, flags); ]]) ],[ curl_cv_func_recv_args="$recv_arg1,$recv_arg2,$recv_arg3,$recv_arg4,$recv_retv" ]) fi done done done done done ]) # AC-CACHE-CHECK if test "$curl_cv_func_recv_args" = "unknown"; then AC_MSG_ERROR([Cannot find proper types to use for recv args]) else recv_prev_IFS=$IFS; IFS=',' set dummy `echo "$curl_cv_func_recv_args" | sed 's/\*/\*/g'` IFS=$recv_prev_IFS shift # AC_DEFINE_UNQUOTED(RECV_TYPE_ARG1, $[1], [Define to the type of arg 1 for recv.]) AC_DEFINE_UNQUOTED(RECV_TYPE_ARG2, $[2], [Define to the type of arg 2 for recv.]) AC_DEFINE_UNQUOTED(RECV_TYPE_ARG3, $[3], [Define to the type of arg 3 for recv.]) AC_DEFINE_UNQUOTED(RECV_TYPE_ARG4, $[4], [Define to the type of arg 4 for recv.]) AC_DEFINE_UNQUOTED(RECV_TYPE_RETV, $[5], [Define to the function return type for recv.]) # AC_DEFINE_UNQUOTED(HAVE_RECV, 1, [Define to 1 if you have the recv function.]) ac_cv_func_recv="yes" fi else AC_MSG_ERROR([Unable to link function recv]) fi ]) dnl CURL_CHECK_FUNC_SEND dnl ------------------------------------------------- dnl Test if the socket send() function is available, dnl and check its return type and the types of its dnl arguments. If the function succeeds HAVE_SEND dnl will be defined, defining the types of the arguments dnl in SEND_TYPE_ARG1, SEND_TYPE_ARG2, SEND_TYPE_ARG3 dnl and SEND_TYPE_ARG4, defining the type of the function dnl return value in SEND_TYPE_RETV, and also defining the dnl type qualifier of second argument in SEND_QUAL_ARG2. AC_DEFUN([CURL_CHECK_FUNC_SEND], [ AC_REQUIRE([CURL_CHECK_HEADER_WINSOCK])dnl AC_REQUIRE([CURL_CHECK_HEADER_WINSOCK2])dnl AC_CHECK_HEADERS(sys/types.h sys/socket.h) # AC_MSG_CHECKING([for send]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ #undef inline #ifdef HAVE_WINDOWS_H #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #include #ifdef HAVE_WINSOCK2_H #include #else #ifdef HAVE_WINSOCK_H #include #endif #endif #else #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif #endif ]],[[ send(0, 0, 0, 0); ]]) ],[ AC_MSG_RESULT([yes]) curl_cv_send="yes" ],[ AC_MSG_RESULT([no]) curl_cv_send="no" ]) # if test "$curl_cv_send" = "yes"; then AC_CACHE_CHECK([types of args and return type for send], [curl_cv_func_send_args], [ curl_cv_func_send_args="unknown" for send_retv in 'int' 'ssize_t'; do for send_arg1 in 'int' 'ssize_t' 'SOCKET'; do for send_arg2 in 'char *' 'void *' 'const char *' 'const void *'; do for send_arg3 in 'size_t' 'int' 'socklen_t' 'unsigned int'; do for send_arg4 in 'int' 'unsigned int'; do if test "$curl_cv_func_send_args" = "unknown"; then AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #undef inline #ifdef HAVE_WINDOWS_H #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #include #ifdef HAVE_WINSOCK2_H #include #else #ifdef HAVE_WINSOCK_H #include #endif #endif #define SENDCALLCONV PASCAL #else #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif #define SENDCALLCONV #endif extern $send_retv SENDCALLCONV send($send_arg1, $send_arg2, $send_arg3, $send_arg4); ]],[[ $send_arg1 s=0; $send_arg3 len=0; $send_arg4 flags=0; $send_retv res = send(s, 0, len, flags); ]]) ],[ curl_cv_func_send_args="$send_arg1,$send_arg2,$send_arg3,$send_arg4,$send_retv" ]) fi done done done done done ]) # AC-CACHE-CHECK if test "$curl_cv_func_send_args" = "unknown"; then AC_MSG_ERROR([Cannot find proper types to use for send args]) else send_prev_IFS=$IFS; IFS=',' set dummy `echo "$curl_cv_func_send_args" | sed 's/\*/\*/g'` IFS=$send_prev_IFS shift # send_qual_type_arg2=$[2] # AC_DEFINE_UNQUOTED(SEND_TYPE_ARG1, $[1], [Define to the type of arg 1 for send.]) AC_DEFINE_UNQUOTED(SEND_TYPE_ARG3, $[3], [Define to the type of arg 3 for send.]) AC_DEFINE_UNQUOTED(SEND_TYPE_ARG4, $[4], [Define to the type of arg 4 for send.]) AC_DEFINE_UNQUOTED(SEND_TYPE_RETV, $[5], [Define to the function return type for send.]) # prev_sh_opts=$- # case $prev_sh_opts in *f*) ;; *) set -f ;; esac # case "$send_qual_type_arg2" in const*) send_qual_arg2=const send_type_arg2=`echo $send_qual_type_arg2 | sed 's/^const //'` ;; *) send_qual_arg2= send_type_arg2=$send_qual_type_arg2 ;; esac # AC_DEFINE_UNQUOTED(SEND_QUAL_ARG2, $send_qual_arg2, [Define to the type qualifier of arg 2 for send.]) AC_DEFINE_UNQUOTED(SEND_TYPE_ARG2, $send_type_arg2, [Define to the type of arg 2 for send.]) # case $prev_sh_opts in *f*) ;; *) set +f ;; esac # AC_DEFINE_UNQUOTED(HAVE_SEND, 1, [Define to 1 if you have the send function.]) ac_cv_func_send="yes" fi else AC_MSG_ERROR([Unable to link function send]) fi ]) dnl CURL_CHECK_FUNC_RECVFROM dnl ------------------------------------------------- dnl Test if the socket recvfrom() function is available, dnl and check its return type and the types of its dnl arguments. If the function succeeds HAVE_RECVFROM dnl will be defined, defining the types of the arguments dnl in RECVFROM_TYPE_ARG1, RECVFROM_TYPE_ARG2, and so on dnl to RECVFROM_TYPE_ARG6, defining also the type of the dnl function return value in RECVFROM_TYPE_RETV. dnl Notice that the types returned for pointer arguments dnl will actually be the type pointed by the pointer. AC_DEFUN([CURL_CHECK_FUNC_RECVFROM], [ AC_REQUIRE([CURL_CHECK_HEADER_WINSOCK])dnl AC_REQUIRE([CURL_CHECK_HEADER_WINSOCK2])dnl AC_CHECK_HEADERS(sys/types.h sys/socket.h) # AC_MSG_CHECKING([for recvfrom]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ #undef inline #ifdef HAVE_WINDOWS_H #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #include #ifdef HAVE_WINSOCK2_H #include #else #ifdef HAVE_WINSOCK_H #include #endif #endif #else #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif #endif ]],[[ recvfrom(0, 0, 0, 0, 0, 0); ]]) ],[ AC_MSG_RESULT([yes]) curl_cv_recvfrom="yes" ],[ AC_MSG_RESULT([no]) curl_cv_recvfrom="no" ]) # if test "$curl_cv_recvfrom" = "yes"; then AC_CACHE_CHECK([types of args and return type for recvfrom], [curl_cv_func_recvfrom_args], [ curl_cv_func_recvfrom_args="unknown" for recvfrom_retv in 'int' 'ssize_t'; do for recvfrom_arg1 in 'int' 'ssize_t' 'SOCKET'; do for recvfrom_arg2 in 'char *' 'void *'; do for recvfrom_arg3 in 'size_t' 'int' 'socklen_t' 'unsigned int'; do for recvfrom_arg4 in 'int' 'unsigned int'; do for recvfrom_arg5 in 'struct sockaddr *' 'void *' 'const struct sockaddr *'; do for recvfrom_arg6 in 'socklen_t *' 'int *' 'unsigned int *' 'size_t *' 'void *'; do if test "$curl_cv_func_recvfrom_args" = "unknown"; then AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #undef inline #ifdef HAVE_WINDOWS_H #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #include #ifdef HAVE_WINSOCK2_H #include #else #ifdef HAVE_WINSOCK_H #include #endif #endif #define RECVFROMCALLCONV PASCAL #else #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif #define RECVFROMCALLCONV #endif extern $recvfrom_retv RECVFROMCALLCONV recvfrom($recvfrom_arg1, $recvfrom_arg2, $recvfrom_arg3, $recvfrom_arg4, $recvfrom_arg5, $recvfrom_arg6); ]],[[ $recvfrom_arg1 s=0; $recvfrom_arg2 buf=0; $recvfrom_arg3 len=0; $recvfrom_arg4 flags=0; $recvfrom_arg5 addr=0; $recvfrom_arg6 addrlen=0; $recvfrom_retv res=0; res = recvfrom(s, buf, len, flags, addr, addrlen); ]]) ],[ curl_cv_func_recvfrom_args="$recvfrom_arg1,$recvfrom_arg2,$recvfrom_arg3,$recvfrom_arg4,$recvfrom_arg5,$recvfrom_arg6,$recvfrom_retv" ]) fi done done done done done done done ]) # AC-CACHE-CHECK # Nearly last minute change for this release starts here AC_DEFINE_UNQUOTED(HAVE_RECVFROM, 1, [Define to 1 if you have the recvfrom function.]) ac_cv_func_recvfrom="yes" # Nearly last minute change for this release ends here if test "$curl_cv_func_recvfrom_args" = "unknown"; then AC_MSG_WARN([Cannot find proper types to use for recvfrom args]) else recvfrom_prev_IFS=$IFS; IFS=',' set dummy `echo "$curl_cv_func_recvfrom_args" | sed 's/\*/\*/g'` IFS=$recvfrom_prev_IFS shift # recvfrom_ptrt_arg2=$[2] recvfrom_qual_ptrt_arg5=$[5] recvfrom_ptrt_arg6=$[6] # AC_DEFINE_UNQUOTED(RECVFROM_TYPE_ARG1, $[1], [Define to the type of arg 1 for recvfrom.]) AC_DEFINE_UNQUOTED(RECVFROM_TYPE_ARG3, $[3], [Define to the type of arg 3 for recvfrom.]) AC_DEFINE_UNQUOTED(RECVFROM_TYPE_ARG4, $[4], [Define to the type of arg 4 for recvfrom.]) AC_DEFINE_UNQUOTED(RECVFROM_TYPE_RETV, $[7], [Define to the function return type for recvfrom.]) # prev_sh_opts=$- # case $prev_sh_opts in *f*) ;; *) set -f ;; esac # case "$recvfrom_qual_ptrt_arg5" in const*) recvfrom_qual_arg5=const recvfrom_ptrt_arg5=`echo $recvfrom_qual_ptrt_arg5 | sed 's/^const //'` ;; *) recvfrom_qual_arg5= recvfrom_ptrt_arg5=$recvfrom_qual_ptrt_arg5 ;; esac # recvfrom_type_arg2=`echo $recvfrom_ptrt_arg2 | sed 's/ \*//'` recvfrom_type_arg5=`echo $recvfrom_ptrt_arg5 | sed 's/ \*//'` recvfrom_type_arg6=`echo $recvfrom_ptrt_arg6 | sed 's/ \*//'` # AC_DEFINE_UNQUOTED(RECVFROM_TYPE_ARG2, $recvfrom_type_arg2, [Define to the type pointed by arg 2 for recvfrom.]) AC_DEFINE_UNQUOTED(RECVFROM_QUAL_ARG5, $recvfrom_qual_arg5, [Define to the type qualifier pointed by arg 5 for recvfrom.]) AC_DEFINE_UNQUOTED(RECVFROM_TYPE_ARG5, $recvfrom_type_arg5, [Define to the type pointed by arg 5 for recvfrom.]) AC_DEFINE_UNQUOTED(RECVFROM_TYPE_ARG6, $recvfrom_type_arg6, [Define to the type pointed by arg 6 for recvfrom.]) # if test "$recvfrom_type_arg2" = "void"; then AC_DEFINE_UNQUOTED(RECVFROM_TYPE_ARG2_IS_VOID, 1, [Define to 1 if the type pointed by arg 2 for recvfrom is void.]) fi if test "$recvfrom_type_arg5" = "void"; then AC_DEFINE_UNQUOTED(RECVFROM_TYPE_ARG5_IS_VOID, 1, [Define to 1 if the type pointed by arg 5 for recvfrom is void.]) fi if test "$recvfrom_type_arg6" = "void"; then AC_DEFINE_UNQUOTED(RECVFROM_TYPE_ARG6_IS_VOID, 1, [Define to 1 if the type pointed by arg 6 for recvfrom is void.]) fi # case $prev_sh_opts in *f*) ;; *) set +f ;; esac # AC_DEFINE_UNQUOTED(HAVE_RECVFROM, 1, [Define to 1 if you have the recvfrom function.]) ac_cv_func_recvfrom="yes" fi else AC_MSG_WARN([Unable to link function recvfrom]) AC_MSG_WARN([Your system will be vulnerable to some forms of DNS cache poisoning]) fi ]) dnl CURL_CHECK_MSG_NOSIGNAL dnl ------------------------------------------------- dnl Check for MSG_NOSIGNAL AC_DEFUN([CURL_CHECK_MSG_NOSIGNAL], [ AC_CHECK_HEADERS(sys/types.h sys/socket.h) AC_CACHE_CHECK([for MSG_NOSIGNAL], [ac_cv_msg_nosignal], [ AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #undef inline #ifdef HAVE_WINDOWS_H #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #include #ifdef HAVE_WINSOCK2_H #include #else #ifdef HAVE_WINSOCK_H #include #endif #endif #else #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif #endif ]],[[ int flag=MSG_NOSIGNAL; ]]) ],[ ac_cv_msg_nosignal="yes" ],[ ac_cv_msg_nosignal="no" ]) ]) case "$ac_cv_msg_nosignal" in yes) AC_DEFINE_UNQUOTED(HAVE_MSG_NOSIGNAL, 1, [Define to 1 if you have the MSG_NOSIGNAL flag.]) ;; esac ]) dnl CURL_CHECK_STRUCT_TIMEVAL dnl ------------------------------------------------- dnl Check for timeval struct AC_DEFUN([CURL_CHECK_STRUCT_TIMEVAL], [ AC_REQUIRE([AC_HEADER_TIME])dnl AC_REQUIRE([CURL_CHECK_HEADER_WINSOCK])dnl AC_REQUIRE([CURL_CHECK_HEADER_WINSOCK2])dnl AC_CHECK_HEADERS(sys/types.h sys/time.h time.h sys/socket.h) AC_CACHE_CHECK([for struct timeval], [ac_cv_struct_timeval], [ AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #undef inline #ifdef HAVE_WINDOWS_H #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #include #ifdef HAVE_WINSOCK2_H #include #else #ifdef HAVE_WINSOCK_H #include #endif #endif #endif #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_TIME_H #include #ifdef TIME_WITH_SYS_TIME #include #endif #else #ifdef HAVE_TIME_H #include #endif #endif #ifdef HAVE_SYS_SOCKET_H #include #endif ]],[[ struct timeval ts; ts.tv_sec = 0; ts.tv_usec = 0; ]]) ],[ ac_cv_struct_timeval="yes" ],[ ac_cv_struct_timeval="no" ]) ]) case "$ac_cv_struct_timeval" in yes) AC_DEFINE_UNQUOTED(HAVE_STRUCT_TIMEVAL, 1, [Define to 1 if you have the timeval struct.]) ;; esac ]) dnl TYPE_SIG_ATOMIC_T dnl ------------------------------------------------- dnl Check if the sig_atomic_t type is available, and dnl verify if it is already defined as volatile. AC_DEFUN([TYPE_SIG_ATOMIC_T], [ AC_CHECK_HEADERS(signal.h) AC_CHECK_TYPE([sig_atomic_t],[ AC_DEFINE(HAVE_SIG_ATOMIC_T, 1, [Define to 1 if sig_atomic_t is an available typedef.]) ], ,[ #ifdef HAVE_SIGNAL_H #include #endif ]) case "$ac_cv_type_sig_atomic_t" in yes) # AC_MSG_CHECKING([if sig_atomic_t is already defined as volatile]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ #ifdef HAVE_SIGNAL_H #include #endif ]],[[ static volatile sig_atomic_t dummy = 0; ]]) ],[ AC_MSG_RESULT([no]) ac_cv_sig_atomic_t_volatile="no" ],[ AC_MSG_RESULT([yes]) ac_cv_sig_atomic_t_volatile="yes" ]) # if test "$ac_cv_sig_atomic_t_volatile" = "yes"; then AC_DEFINE(HAVE_SIG_ATOMIC_T_VOLATILE, 1, [Define to 1 if sig_atomic_t is already defined as volatile.]) fi ;; esac ]) dnl TYPE_IN_ADDR_T dnl ------------------------------------------------- dnl Check for in_addr_t: it is used to receive the return code of inet_addr() dnl and a few other things. AC_DEFUN([TYPE_IN_ADDR_T], [ AC_CHECK_TYPE([in_addr_t], ,[ dnl in_addr_t not available AC_CACHE_CHECK([for in_addr_t equivalent], [curl_cv_in_addr_t_equiv], [ curl_cv_in_addr_t_equiv="unknown" for t in "unsigned long" int size_t unsigned long; do if test "$curl_cv_in_addr_t_equiv" = "unknown"; then AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ #undef inline #ifdef HAVE_WINDOWS_H #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #include #ifdef HAVE_WINSOCK2_H #include #else #ifdef HAVE_WINSOCK_H #include #endif #endif #else #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_NETINET_IN_H #include #endif #ifdef HAVE_ARPA_INET_H #include #endif #endif ]],[[ $t data = inet_addr ("1.2.3.4"); ]]) ],[ curl_cv_in_addr_t_equiv="$t" ]) fi done ]) case "$curl_cv_in_addr_t_equiv" in unknown) AC_MSG_ERROR([Cannot find a type to use in place of in_addr_t]) ;; *) AC_DEFINE_UNQUOTED(in_addr_t, $curl_cv_in_addr_t_equiv, [Type to use in place of in_addr_t when system does not provide it.]) ;; esac ],[ #undef inline #ifdef HAVE_WINDOWS_H #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #include #ifdef HAVE_WINSOCK2_H #include #else #ifdef HAVE_WINSOCK_H #include #endif #endif #else #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_NETINET_IN_H #include #endif #ifdef HAVE_ARPA_INET_H #include #endif #endif ]) ]) dnl CURL_CHECK_FUNC_CLOCK_GETTIME_MONOTONIC dnl ------------------------------------------------- dnl Check if monotonic clock_gettime is available. AC_DEFUN([CURL_CHECK_FUNC_CLOCK_GETTIME_MONOTONIC], [ AC_REQUIRE([AC_HEADER_TIME])dnl AC_CHECK_HEADERS(sys/types.h sys/time.h time.h) AC_MSG_CHECKING([for monotonic clock_gettime]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_TIME_H #include #ifdef TIME_WITH_SYS_TIME #include #endif #else #ifdef HAVE_TIME_H #include #endif #endif ]],[[ struct timespec ts; (void)clock_gettime(CLOCK_MONOTONIC, &ts); ]]) ],[ AC_MSG_RESULT([yes]) ac_cv_func_clock_gettime="yes" ],[ AC_MSG_RESULT([no]) ac_cv_func_clock_gettime="no" ]) dnl Definition of HAVE_CLOCK_GETTIME_MONOTONIC is intentionally postponed dnl until library linking and run-time checks for clock_gettime succeed. ]) dnl CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC dnl ------------------------------------------------- dnl If monotonic clock_gettime is available then, dnl check and prepended to LIBS any needed libraries. AC_DEFUN([CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC], [ AC_REQUIRE([CURL_CHECK_FUNC_CLOCK_GETTIME_MONOTONIC])dnl # if test "$ac_cv_func_clock_gettime" = "yes"; then # AC_MSG_CHECKING([for clock_gettime in libraries]) # curl_cv_save_LIBS="$LIBS" curl_cv_gclk_LIBS="unknown" # for x_xlibs in '' '-lrt' '-lposix4' ; do if test "$curl_cv_gclk_LIBS" = "unknown"; then if test -z "$x_xlibs"; then LIBS="$curl_cv_save_LIBS" else LIBS="$x_xlibs $curl_cv_save_LIBS" fi AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_TIME_H #include #ifdef TIME_WITH_SYS_TIME #include #endif #else #ifdef HAVE_TIME_H #include #endif #endif ]],[[ struct timespec ts; (void)clock_gettime(CLOCK_MONOTONIC, &ts); ]]) ],[ curl_cv_gclk_LIBS="$x_xlibs" ]) fi done # LIBS="$curl_cv_save_LIBS" # case X-"$curl_cv_gclk_LIBS" in X-unknown) AC_MSG_RESULT([cannot find clock_gettime]) AC_MSG_WARN([HAVE_CLOCK_GETTIME_MONOTONIC will not be defined]) ac_cv_func_clock_gettime="no" ;; X-) AC_MSG_RESULT([no additional lib required]) ac_cv_func_clock_gettime="yes" ;; *) if test -z "$curl_cv_save_LIBS"; then LIBS="$curl_cv_gclk_LIBS" else LIBS="$curl_cv_gclk_LIBS $curl_cv_save_LIBS" fi AC_MSG_RESULT([$curl_cv_gclk_LIBS]) ac_cv_func_clock_gettime="yes" ;; esac # dnl only do runtime verification when not cross-compiling if test "x$cross_compiling" != "xyes" && test "$ac_cv_func_clock_gettime" = "yes"; then AC_MSG_CHECKING([if monotonic clock_gettime works]) AC_RUN_IFELSE([ AC_LANG_PROGRAM([[ #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_TIME_H #include #ifdef TIME_WITH_SYS_TIME #include #endif #else #ifdef HAVE_TIME_H #include #endif #endif ]],[[ struct timespec ts; if (0 == clock_gettime(CLOCK_MONOTONIC, &ts)) exit(0); else exit(1); ]]) ],[ AC_MSG_RESULT([yes]) ],[ AC_MSG_RESULT([no]) AC_MSG_WARN([HAVE_CLOCK_GETTIME_MONOTONIC will not be defined]) ac_cv_func_clock_gettime="no" LIBS="$curl_cv_save_LIBS" ]) fi # case "$ac_cv_func_clock_gettime" in yes) AC_DEFINE_UNQUOTED(HAVE_CLOCK_GETTIME_MONOTONIC, 1, [Define to 1 if you have the clock_gettime function and monotonic timer.]) ;; esac # fi # ]) dnl CARES_CHECK_LIBS_CONNECT dnl ------------------------------------------------- dnl Verify if network connect function is already available dnl using current libraries or if another one is required. AC_DEFUN([CARES_CHECK_LIBS_CONNECT], [ AC_REQUIRE([CARES_INCLUDES_WINSOCK2])dnl AC_MSG_CHECKING([for connect in libraries]) tst_connect_save_LIBS="$LIBS" tst_connect_need_LIBS="unknown" for tst_lib in '' '-lsocket' ; do if test "$tst_connect_need_LIBS" = "unknown"; then LIBS="$tst_lib $tst_connect_save_LIBS" AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ $cares_includes_winsock2 #ifndef HAVE_WINDOWS_H int connect(int, void*, int); #endif ]],[[ if(0 != connect(0, 0, 0)) return 1; ]]) ],[ tst_connect_need_LIBS="$tst_lib" ]) fi done LIBS="$tst_connect_save_LIBS" # case X-"$tst_connect_need_LIBS" in X-unknown) AC_MSG_RESULT([cannot find connect]) AC_MSG_ERROR([cannot find connect function in libraries.]) ;; X-) AC_MSG_RESULT([yes]) ;; *) AC_MSG_RESULT([$tst_connect_need_LIBS]) LIBS="$tst_connect_need_LIBS $tst_connect_save_LIBS" ;; esac ]) dnl CARES_DEFINE_UNQUOTED (VARIABLE, [VALUE]) dnl ------------------------------------------------- dnl Like AC_DEFINE_UNQUOTED this macro will define a C preprocessor dnl symbol that can be further used in custom template configuration dnl files. This macro, unlike AC_DEFINE_UNQUOTED, does not use a third dnl argument for the description. Symbol definitions done with this dnl macro are intended to be exclusively used in handcrafted *.h.in dnl template files. Contrary to what AC_DEFINE_UNQUOTED does, this one dnl prevents autoheader generation and insertion of symbol template dnl stub and definition into the first configuration header file. Do dnl not use this macro as a replacement for AC_DEFINE_UNQUOTED, each dnl one serves different functional needs. AC_DEFUN([CARES_DEFINE_UNQUOTED], [ cat >>confdefs.h <<_EOF [@%:@define] $1 ifelse($#, 2, [$2], 1) _EOF ]) dnl CARES_CONFIGURE_ARES_SOCKLEN_T dnl ------------------------------------------------- dnl Find out suitable ares_socklen_t data type definition and size, making dnl appropriate definitions for template file ares_build.h.in dnl to properly configure and use the library. dnl dnl The need for the ares_socklen_t definition arises mainly to properly dnl interface HP-UX systems which on one hand have a typedef'ed socklen_t dnl data type which is 32 or 64-Bit wide depending on the data model being dnl used, and that on the other hand is only actually used when interfacing dnl the X/Open sockets provided in the xnet library. AC_DEFUN([CARES_CONFIGURE_ARES_SOCKLEN_T], [ AC_REQUIRE([CARES_INCLUDES_WS2TCPIP])dnl AC_REQUIRE([CARES_INCLUDES_SYS_SOCKET])dnl AC_REQUIRE([CARES_PREPROCESS_CALLCONV])dnl # AC_MSG_CHECKING([for ares_socklen_t data type]) cares_typeof_ares_socklen_t="unknown" for arg1 in int SOCKET; do for arg2 in 'struct sockaddr' void; do for t in socklen_t int size_t 'unsigned int' long 'unsigned long' void; do if test "$cares_typeof_ares_socklen_t" = "unknown"; then AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $cares_includes_ws2tcpip $cares_includes_sys_socket $cares_preprocess_callconv extern int FUNCALLCONV getpeername($arg1, $arg2 *, $t *); ]],[[ $t *lenptr = 0; if(0 != getpeername(0, 0, lenptr)) return 1; ]]) ],[ cares_typeof_ares_socklen_t="$t" ]) fi done done done for t in socklen_t int; do if test "$cares_typeof_ares_socklen_t" = "void"; then AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $cares_includes_sys_socket typedef $t ares_socklen_t; ]],[[ ares_socklen_t dummy; ]]) ],[ cares_typeof_ares_socklen_t="$t" ]) fi done AC_MSG_RESULT([$cares_typeof_ares_socklen_t]) if test "$cares_typeof_ares_socklen_t" = "void" || test "$cares_typeof_ares_socklen_t" = "unknown"; then AC_MSG_ERROR([cannot find data type for ares_socklen_t.]) fi # AC_MSG_CHECKING([size of ares_socklen_t]) cares_sizeof_ares_socklen_t="unknown" cares_pull_headers_socklen_t="unknown" if test "$ac_cv_header_ws2tcpip_h" = "yes"; then tst_pull_header_checks='none ws2tcpip' tst_size_checks='4' else tst_pull_header_checks='none systypes syssocket' tst_size_checks='4 8 2' fi for tst_size in $tst_size_checks; do for tst_pull_headers in $tst_pull_header_checks; do if test "$cares_sizeof_ares_socklen_t" = "unknown"; then case $tst_pull_headers in ws2tcpip) tmp_includes="$cares_includes_ws2tcpip" ;; systypes) tmp_includes="$cares_includes_sys_types" ;; syssocket) tmp_includes="$cares_includes_sys_socket" ;; *) tmp_includes="" ;; esac AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $tmp_includes typedef $cares_typeof_ares_socklen_t ares_socklen_t; typedef char dummy_arr[sizeof(ares_socklen_t) == $tst_size ? 1 : -1]; ]],[[ ares_socklen_t dummy; ]]) ],[ cares_sizeof_ares_socklen_t="$tst_size" cares_pull_headers_socklen_t="$tst_pull_headers" ]) fi done done AC_MSG_RESULT([$cares_sizeof_ares_socklen_t]) if test "$cares_sizeof_ares_socklen_t" = "unknown"; then AC_MSG_ERROR([cannot find out size of ares_socklen_t.]) fi # case $cares_pull_headers_socklen_t in ws2tcpip) CARES_DEFINE_UNQUOTED([CARES_PULL_WS2TCPIP_H]) ;; systypes) CARES_DEFINE_UNQUOTED([CARES_PULL_SYS_TYPES_H]) ;; syssocket) CARES_DEFINE_UNQUOTED([CARES_PULL_SYS_TYPES_H]) CARES_DEFINE_UNQUOTED([CARES_PULL_SYS_SOCKET_H]) ;; esac CARES_DEFINE_UNQUOTED([CARES_TYPEOF_ARES_SOCKLEN_T], [$cares_typeof_ares_socklen_t]) CARES_DEFINE_UNQUOTED([CARES_SIZEOF_ARES_SOCKLEN_T], [$cares_sizeof_ares_socklen_t]) ]) dnl This macro determines if the specified struct exists in the specified file dnl Syntax: dnl CARES_CHECK_STRUCT(headers, struct name, if found, [if not found]) AC_DEFUN([CARES_CHECK_STRUCT], [ AC_MSG_CHECKING([for struct $2]) AC_TRY_COMPILE([$1], [ struct $2 struct_instance; ], ac_struct="yes", ac_found="no") if test "$ac_struct" = "yes" ; then AC_MSG_RESULT(yes) $3 else AC_MSG_RESULT(no) $4 fi ]) dnl This macro determines if the specified constant exists in the specified file dnl Syntax: dnl CARES_CHECK_CONSTANT(headers, constant name, if found, [if not found]) AC_DEFUN([CARES_CHECK_CONSTANT], [ AC_MSG_CHECKING([for $2]) AC_EGREP_CPP(VARIABLEWASDEFINED, [ $1 #ifdef $2 VARIABLEWASDEFINED #else NJET #endif ], ac_constant="yes", ac_constant="no" ) if test "$ac_constant" = "yes" ; then AC_MSG_RESULT(yes) $3 else AC_MSG_RESULT(no) $4 fi ]) ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/appveyor.yml0000644000175100001770000001272100000000000020473 0ustar00runnerdocker00000000000000image: Visual Studio 2015 # Github/Bitbucket only: get source code for one particular commit as zip archive, instead of git clone'ing. shallow_clone: true # Github/Bitbucket only: per-file commit filtering skip_commits: files: - .gitignore - '**/*.md' - .travis.yml # List of build configurations to test. configuration: - RelWithDebInfo # Note: You can set extra cmake args for a particular matrix entry with CMAKE_EXTRA_OPTIONS. For example: # CMAKE_EXTRA_OPTIONS: -DOPENSSL_ROOT_DIR=C:/OpenSSL-Win32 environment: matrix: # MSVC 2015, 32-bit x86 (cmake) - COMPILER: MSVC BUILDTOOL: CMAKE MSVC_SETUP_ARG: x86 MSVC_SETUP_PATH: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat # MSVC 2015, 64-bit x86 (cmake) - COMPILER: MSVC BUILDTOOL: CMAKE MSVC_SETUP_ARG: x64 MSVC_SETUP_PATH: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat # MinGW, 32-bit x86 (cmake) - COMPILER: MINGW BUILDTOOL: CMAKE PATH: C:\mingw-w64\i686-5.3.0-posix-dwarf-rt_v4-rev0\mingw32\bin;%PATH% # MinGW, 32-bit x86 (cmake static only) - COMPILER: MINGW BUILDTOOL: CMAKESTATIC PATH: C:\mingw-w64\i686-5.3.0-posix-dwarf-rt_v4-rev0\mingw32\bin;%PATH% # MSVC 2015, 32-bit x86 (nmake) - COMPILER: MSVC BUILDTOOL: NMAKE MSVC_SETUP_ARG: x86 MSVC_SETUP_PATH: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat # MSVC 2015, 64-bit x86 (nmake) - COMPILER: MSVC BUILDTOOL: NMAKE MSVC_SETUP_ARG: x64 MSVC_SETUP_PATH: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat # MinGW, 32-bit x86 (makefiles) - COMPILER: MINGW BUILDTOOL: MAKE PATH: C:\mingw-w64\i686-5.3.0-posix-dwarf-rt_v4-rev0\mingw32\bin;%PATH% install: - if "%COMPILER%" == "MINGW" rename "C:\Program Files\Git\usr\bin\sh.exe" "sh2.exe" before_build: # Setup build environment for the selected compiler (not all compilers need to do anything here). # -- Visual Studio -- - if "%COMPILER%" == "MSVC" call "%MSVC_SETUP_PATH%" %MSVC_SETUP_ARG% build_script: - if "%BUILDTOOL%" == "NMAKE" copy .\include\ares_build.h.dist .\include\ares_build.h - if "%BUILDTOOL%" == "NMAKE" nmake /NOLOGO /f .\Makefile.msvc - if "%BUILDTOOL%" == "CMAKE" mkdir C:\projects\build-cares - if "%BUILDTOOL%" == "CMAKE" cd C:\projects\build-cares - if "%BUILDTOOL%" == "CMAKE" cmake -GNinja -DCMAKE_BUILD_TYPE=%configuration% -DCMAKE_INSTALL_PREFIX=C:\projects\build-cares\test_install -DCARES_STATIC=ON -DCARES_STATIC_PIC=ON -DCARES_BUILD_TESTS=ON %CMAKE_EXTRA_OPTIONS% %APPVEYOR_BUILD_FOLDER% - if "%BUILDTOOL%" == "CMAKE" ninja -v install - if "%BUILDTOOL%" == "CMAKESTATIC" mkdir C:\projects\build-cares - if "%BUILDTOOL%" == "CMAKESTATIC" cd C:\projects\build-cares - if "%BUILDTOOL%" == "CMAKESTATIC" cmake -GNinja -DCMAKE_BUILD_TYPE=%configuration% -DCMAKE_INSTALL_PREFIX=C:\projects\build-cares\test_install -DCARES_SHARED=OFF -DCARES_STATIC=ON -DCARES_STATIC_PIC=ON -DCARES_BUILD_TESTS=ON %CMAKE_EXTRA_OPTIONS% %APPVEYOR_BUILD_FOLDER% - if "%BUILDTOOL%" == "CMAKESTATIC" ninja -v install - if "%BUILDTOOL%" == "MAKE" copy .\include\ares_build.h.dist .\include\ares_build.h - if "%BUILDTOOL%" == "MAKE" mingw32-make.exe -f Makefile.m32 demos test_script: # We can't use powershell for tests due to treating stderr as an error - if "%BUILDTOOL%" == "NMAKE" cd test - if "%BUILDTOOL%" == "NMAKE" nmake /NOLOGO /f .\Makefile.msvc vtest - if "%BUILDTOOL%" == "NMAKE" nmake /NOLOGO /f .\Makefile.msvc aresfuzz aresfuzzname dnsdump - if "%BUILDTOOL%" == "NMAKE" .\msvc\arestest\lib-debug\dnsdump.exe fuzzinput\answer_a fuzzinput\answer_aaaa - if "%BUILDTOOL%" == "MAKE" cd test - if "%BUILDTOOL%" == "MAKE" mingw32-make.exe -f Makefile.m32 - if "%BUILDTOOL%" == "MAKE" mingw32-make.exe -f Makefile.m32 aresfuzz.exe aresfuzzname.exe dnsdump.exe - if "%BUILDTOOL%" == "MAKE" .\dnsdump.exe fuzzinput\answer_a fuzzinput\answer_aaaa - if "%BUILDTOOL%" == "CMAKE" cd C:\projects\build-cares\bin - if "%BUILDTOOL%" == "CMAKE" .\adig.exe www.google.com - if "%BUILDTOOL%" == "CMAKE" .\acountry.exe www.google.com - if "%BUILDTOOL%" == "CMAKE" .\ahost.exe www.google.com - if "%BUILDTOOL%" == "CMAKE" .\arestest.exe -4 -v - if "%BUILDTOOL%" == "CMAKE" .\dnsdump.exe "%APPVEYOR_BUILD_FOLDER%\test\fuzzinput\answer_a" "%APPVEYOR_BUILD_FOLDER%\test\fuzzinput\answer_aaaa" - if "%BUILDTOOL%" == "CMAKESTATIC" cd C:\projects\build-cares\bin - if "%BUILDTOOL%" == "CMAKESTATIC" .\adig.exe www.google.com - if "%BUILDTOOL%" == "CMAKESTATIC" .\acountry.exe www.google.com - if "%BUILDTOOL%" == "CMAKESTATIC" .\ahost.exe www.google.com - if "%BUILDTOOL%" == "CMAKESTATIC" .\arestest.exe -4 -v - if "%BUILDTOOL%" == "CMAKESTATIC" .\dnsdump.exe "%APPVEYOR_BUILD_FOLDER%\test\fuzzinput\answer_a" "%APPVEYOR_BUILD_FOLDER%\test\fuzzinput\answer_aaaa" #on_finish: # - cd C:\projects\build-cares\test # - dir /B *.log > list.txt # - cmake -E tar cfv all_tests.zip --format=zip --files-from=list.txt # - appveyor PushArtifact all_tests.zip # - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) # Force build worker to stay open after build is done, so we can RDP into it. # Enable RDP connections into build worker. #init: # - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/buildconf0000755000175100001770000000017400000000000017775 0ustar00runnerdocker00000000000000#!/bin/sh echo "*** Do not use buildconf. Instead, just use: autoreconf -fi" >&2 exec ${AUTORECONF:-autoreconf} -fi "${@}" ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/buildconf.bat0000644000175100001770000000104700000000000020537 0ustar00runnerdocker00000000000000@echo off REM REM REM This batch file must be used to set up a git tree to build on REM systems where there is no autotools support (i.e. Microsoft). REM REM This file is not included nor needed for c-ares' release REM archives, neither for c-ares' daily snapshot archives. if exist GIT-INFO goto start_doing ECHO ERROR: This file shall only be used with a c-ares git checkout. goto end_all :start_doing if not exist include\ares_build.h.dist goto end_ares_build_h copy /Y include\ares_build.h.dist include\ares_build.h :end_ares_build_h :end_all ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/c-ares-config.cmake.in0000644000175100001770000000132500000000000022125 0ustar00runnerdocker00000000000000@PACKAGE_INIT@ set_and_check(c-ares_INCLUDE_DIR "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@") include("${CMAKE_CURRENT_LIST_DIR}/c-ares-config-version.cmake") include("${CMAKE_CURRENT_LIST_DIR}/c-ares-targets.cmake") set(c-ares_LIBRARY c-ares::cares) if(@CARES_SHARED@) add_library(c-ares::cares_shared INTERFACE IMPORTED) set_target_properties(c-ares::cares_shared PROPERTIES INTERFACE_LINK_LIBRARIES "c-ares::cares") set(c-ares_SHARED_LIBRARY c-ares::cares_shared) elseif(@CARES_STATIC@) add_library(c-ares::cares_static INTERFACE IMPORTED) set_target_properties(c-ares::cares_static PROPERTIES INTERFACE_LINK_LIBRARIES "c-ares::cares") endif() if(@CARES_STATIC@) set(c-ares_STATIC_LIBRARY c-ares::cares_static) endif() ././@PaxHeader0000000000000000000000000000003400000000000011452 xustar000000000000000028 mtime=1696604226.9714146 pycares-4.4.0/deps/c-ares/ci/0000755000175100001770000000000000000000000016473 5ustar00runnerdocker00000000000000././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/ci/build.sh0000755000175100001770000000241700000000000020135 0ustar00runnerdocker00000000000000#!/bin/sh set -e OS="" if [ "$TRAVIS_OS_NAME" != "" ]; then OS="$TRAVIS_OS_NAME" elif [ "$CIRRUS_OS" != "" ]; then OS="$CIRRUS_OS" fi if [ "$BUILD_TYPE" != "cmake" -a "$BUILD_TYPE" != "valgrind" -a "$BUILD_TYPE" != "ios-cmake" ]; then autoreconf -fi mkdir atoolsbld cd atoolsbld $SCAN_WRAP ../configure --disable-symbol-hiding --enable-expose-statics --enable-maintainer-mode --enable-debug $CONFIG_OPTS $SCAN_WRAP make else if [ "$BUILD_TYPE" = "ios-cmake" ]; then mkdir cmakebld cd cmakebld cmake \ -DCMAKE_BUILD_TYPE=DEBUG \ -DCARES_STATIC=ON \ -DCARES_STATIC_PIC=ON \ -DCARES_BUILD_TESTS=OFF \ -DCMAKE_C_FLAGS=$CFLAGS \ -DCMAKE_CXX_FLAGS=$CXXFLAGS \ -DCMAKE_OSX_SYSROOT=$SYSROOT \ -DCMAKE_OSX_ARCHITECTURES=$ARCHITECTURES \ .. make else # Use cmake for valgrind to prevent libtool script wrapping of tests that interfere with valgrind mkdir cmakebld cd cmakebld cmake -DCMAKE_BUILD_TYPE=DEBUG -DCARES_STATIC=ON -DCARES_STATIC_PIC=ON -DCARES_BUILD_TESTS=ON .. make fi fi ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/ci/covupload.sh0000755000175100001770000000014000000000000021021 0ustar00runnerdocker00000000000000#!/bin/sh set -e if [ "$BUILD_TYPE" = "coverage" ]; then coveralls --gcov-options '\-lp' fi ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/ci/distcheck.sh0000755000175100001770000000147600000000000021003 0ustar00runnerdocker00000000000000#!/bin/sh set -e OS="" if [ "$TRAVIS_OS_NAME" != "" ]; then OS="$TRAVIS_OS_NAME" elif [ "$CIRRUS_OS" != "" ]; then OS="$CIRRUS_OS" fi if [ "$OS" = "linux" ]; then # Make distribution tarball ./maketgz 99.98.97 # Extract distribution tarball for building tar xvf c-ares-99.98.97.tar.gz cd c-ares-99.98.97 # Build autotools mkdir build-autotools cd build-autotools ../configure --disable-symbol-hiding --enable-expose-statics --enable-maintainer-mode --enable-debug make cd test $TEST_WRAP ./arestest -4 -v $TEST_FILTER cd ../.. # Build CMake mkdir build-cmake cd build-cmake cmake -DCMAKE_BUILD_TYPE=DEBUG -DCARES_STATIC=ON -DCARES_STATIC_PIC=ON -DCARES_BUILD_TESTS=ON .. make cd bin $TEST_WRAP ./arestest -4 -v $TEST_FILTER cd ../.. fi ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/ci/test.sh0000755000175100001770000000214100000000000020007 0ustar00runnerdocker00000000000000#!/bin/sh set -e # Travis on MacOS uses CloudFlare's DNS (1.1.1.1/1.0.0.1) which rejects ANY requests # Note res_ninit() and /etc/resolv.conf actually have different configs, bad Travis [ -z "$TEST_FILTER" ] && export TEST_FILTER="--gtest_filter=-*LiveSearchANY*" # No tests for ios as it is a cross-compile if [ "$BUILD_TYPE" = "ios" -o "$BUILD_TYPE" = "ios-cmake" ] ; then exit 0 fi # Analyze tests don't need runtime, its static analysis if [ "$BUILD_TYPE" = "analyze" ] ; then exit 0 fi PWD=`pwd` TESTDIR="${PWD}/test" if [ "$BUILD_TYPE" = "cmake" -o "$BUILD_TYPE" = "valgrind" ] ; then TOOLSBIN="${PWD}/cmakebld/bin" TESTSBIN="${PWD}/cmakebld/bin" else TOOLSBIN="${PWD}/atoolsbld/src/tools" TESTSBIN="${PWD}/atoolsbld/test" fi $TEST_WRAP "${TOOLSBIN}/adig" www.google.com $TEST_WRAP "${TOOLSBIN}/acountry" www.google.com $TEST_WRAP "${TOOLSBIN}/ahost" www.google.com cd "${TESTSBIN}" $TEST_WRAP ./arestest -4 -v $TEST_FILTER ./aresfuzz ${TESTDIR}/fuzzinput/* ./aresfuzzname ${TESTDIR}/fuzznames/* ./dnsdump "${TESTDIR}/fuzzinput/answer_a" "${TESTDIR}/fuzzinput/answer_aaaa" cd "${PWD}" ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/configure.ac0000644000175100001770000006143000000000000020372 0ustar00runnerdocker00000000000000AC_PREREQ([2.60]) AC_INIT([c-ares], [1.18.1], [c-ares mailing list: http://lists.haxx.se/listinfo/c-ares]) CARES_VERSION_INFO="7:1:5" 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. dnl dnl If either revision or age are omitted, they default to 0. Also note that age dnl must be less than or equal to the current interface number. dnl dnl Here are a set of rules to help you update your library version information: dnl dnl 1.Start with version information of 0:0:0 for each libtool library. dnl dnl 2.Update the version information only immediately before a public release of dnl your software. More frequent updates are unnecessary, and only guarantee dnl that the current interface number gets larger faster. dnl dnl 3.If the library source code has changed at all since the last update, then dnl increment revision (c:r+1:a) dnl dnl 4.If any interfaces have been added, removed, or changed since the last dnl update, increment current, and set revision to 0. (c+1:r=0:a) dnl dnl 5.If any interfaces have been added since the last public release, then dnl increment age. (c:r:a+1) dnl dnl 6.If any interfaces have been removed since the last public release, then dnl set age to 0. (c:r:a=0) dnl AC_SUBST([CARES_VERSION_INFO]) AC_CONFIG_SRCDIR([src/lib/ares_ipv6.h]) AC_CONFIG_HEADERS([src/lib/ares_config.h include/ares_build.h]) AC_CONFIG_MACRO_DIR([m4]) AM_MAINTAINER_MODE m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) AX_REQUIRE_DEFINED([AX_CXX_COMPILE_STDCXX_11]) CARES_CHECK_OPTION_DEBUG CARES_CHECK_OPTION_OPTIMIZE CARES_CHECK_OPTION_WARNINGS CARES_CHECK_OPTION_WERROR CARES_CHECK_OPTION_SYMBOL_HIDING CARES_CHECK_OPTION_EXPOSE_STATICS XC_CHECK_PATH_SEPARATOR dnl SED is mandatory for configure process and libtool. dnl Set it now, allowing it to be changed later. AC_PATH_PROG([SED], [sed], [not_found], [$PATH:/usr/bin:/usr/local/bin]) if test -z "$SED" || test "$SED" = "not_found"; then AC_MSG_ERROR([sed not found in PATH. Cannot continue without sed.]) fi AC_SUBST([SED]) dnl GREP is mandatory for configure process and libtool. dnl Set it now, allowing it to be changed later. AC_PATH_PROG([GREP], [grep], [not_found], [$PATH:/usr/bin:/usr/local/bin]) if test -z "$GREP" || test "$GREP" = "not_found"; then AC_MSG_ERROR([grep not found in PATH. Cannot continue without grep.]) fi AC_SUBST([GREP]) dnl EGREP is mandatory for configure process and libtool. dnl Set it now, allowing it to be changed later. if echo a | ($GREP -E '(a|b)') >/dev/null 2>&1; then AC_MSG_CHECKING([for egrep]) EGREP="$GREP -E" AC_MSG_RESULT([$EGREP]) else AC_PATH_PROG([EGREP], [egrep], [not_found], [$PATH:/usr/bin:/usr/local/bin]) fi if test -z "$EGREP" || test "$EGREP" = "not_found"; then AC_MSG_ERROR([egrep not found in PATH. Cannot continue without egrep.]) fi AC_SUBST([EGREP]) dnl AR is mandatory for configure process and libtool. dnl This is target dependent, so check it as a tool. if test -z "$AR"; then dnl allow it to be overridden AC_PATH_TOOL([AR], [ar], [not_found], [$PATH:/usr/bin:/usr/local/bin]) if test -z "$AR" || test "$AR" = "not_found"; then AC_MSG_ERROR([ar not found in PATH. Cannot continue without ar.]) fi fi AC_SUBST([AR]) AX_CODE_COVERAGE dnl dnl Detect the canonical host and target build environment dnl AC_CANONICAL_HOST dnl Get system canonical name AC_DEFINE_UNQUOTED(OS, "${host}", [cpu-machine-OS]) XC_CHECK_PROG_CC AX_CXX_COMPILE_STDCXX_11([noext],[optional]) XC_AUTOMAKE dnl This defines _ALL_SOURCE for AIX CARES_CHECK_AIX_ALL_SOURCE dnl Our configure and build reentrant settings CARES_CONFIGURE_THREAD_SAFE CARES_CONFIGURE_REENTRANT dnl check for how to do large files AC_SYS_LARGEFILE case $host_os in solaris*) AC_DEFINE(ETC_INET, 1, [if a /etc/inet dir is being used]) ;; esac XC_LIBTOOL # # Automake conditionals based on libtool related checks # AM_CONDITIONAL([CARES_LT_SHLIB_USE_VERSION_INFO], [test "x$xc_lt_shlib_use_version_info" = 'xyes']) AM_CONDITIONAL([CARES_LT_SHLIB_USE_NO_UNDEFINED], [test "x$xc_lt_shlib_use_no_undefined" = 'xyes']) AM_CONDITIONAL([CARES_LT_SHLIB_USE_MIMPURE_TEXT], [test "x$xc_lt_shlib_use_mimpure_text" = 'xyes']) # # Due to libtool and automake machinery limitations of not allowing # specifying separate CPPFLAGS or CFLAGS when compiling objects for # inclusion of these in shared or static libraries, we are forced to # build using separate configure runs for shared and static libraries # on systems where different CPPFLAGS or CFLAGS are mandatory in order # to compile objects for each kind of library. Notice that relying on # the '-DPIC' CFLAG that libtool provides is not valid given that the # user might for example choose to build static libraries with PIC. # # # Make our Makefile.am files use the staticlib CPPFLAG only when strictly # targeting a static library and not building its shared counterpart. # AM_CONDITIONAL([USE_CPPFLAG_CARES_STATICLIB], [test "x$xc_lt_build_static_only" = 'xyes']) # # Make staticlib CPPFLAG variable and its definition visible in output # files unconditionally, providing an empty definition unless strictly # targeting a static library and not building its shared counterpart. # CPPFLAG_CARES_STATICLIB= if test "x$xc_lt_build_static_only" = 'xyes'; then CPPFLAG_CARES_STATICLIB='-DCARES_STATICLIB' fi AC_SUBST([CPPFLAG_CARES_STATICLIB]) dnl ********************************************************************** dnl platform/compiler/architecture specific checks/flags dnl ********************************************************************** CARES_CHECK_COMPILER CARES_SET_COMPILER_BASIC_OPTS CARES_SET_COMPILER_DEBUG_OPTS CARES_SET_COMPILER_OPTIMIZE_OPTS CARES_SET_COMPILER_WARNING_OPTS if test "$compiler_id" = "INTEL_UNIX_C"; then # if test "$compiler_num" -ge "1000"; then dnl icc 10.X or later CFLAGS="$CFLAGS -shared-intel" elif test "$compiler_num" -ge "900"; then dnl icc 9.X specific CFLAGS="$CFLAGS -i-dynamic" fi # fi CARES_CHECK_COMPILER_HALT_ON_ERROR CARES_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE CARES_CHECK_COMPILER_PROTOTYPE_MISMATCH CARES_CHECK_COMPILER_SYMBOL_HIDING dnl ********************************************************************** dnl Compilation based checks should not be done before this point. dnl ********************************************************************** dnl ********************************************************************** dnl Make sure that our checks for headers windows.h winsock.h winsock2.h dnl and ws2tcpip.h take precedence over any other further checks which dnl could be done later using AC_CHECK_HEADER or AC_CHECK_HEADERS for dnl this specific header files. And do them before its results are used. dnl ********************************************************************** CURL_CHECK_HEADER_WINDOWS CURL_CHECK_NATIVE_WINDOWS case X-"$ac_cv_native_windows" in X-yes) CURL_CHECK_HEADER_WINSOCK CURL_CHECK_HEADER_WINSOCK2 CURL_CHECK_HEADER_WS2TCPIP CPPFLAGS="$CPPFLAGS -D_WIN32_WINNT=0x0600" ;; *) ac_cv_header_winsock_h="no" ac_cv_header_winsock2_h="no" ac_cv_header_ws2tcpip_h="no" ;; esac dnl ********************************************************************** dnl Checks for libraries. dnl ********************************************************************** CARES_CHECK_LIB_XNET dnl gethostbyname without lib or in the nsl lib? AC_CHECK_FUNC(gethostbyname, [HAVE_GETHOSTBYNAME="1" ], [ AC_CHECK_LIB(nsl, gethostbyname, [HAVE_GETHOSTBYNAME="1" LIBS="$LIBS -lnsl" ]) ]) if test "$HAVE_GETHOSTBYNAME" != "1" then dnl gethostbyname in the socket lib? AC_CHECK_LIB(socket, gethostbyname, [HAVE_GETHOSTBYNAME="1" LIBS="$LIBS -lsocket" ]) fi dnl At least one system has been identified to require BOTH nsl and socket dnl libs at the same time to link properly. if test "$HAVE_GETHOSTBYNAME" != "1" then AC_MSG_CHECKING([for gethostbyname with both nsl and socket libs]) my_ac_save_LIBS=$LIBS LIBS="-lnsl -lsocket $LIBS" AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ ]],[[ gethostbyname(); ]]) ],[ AC_MSG_RESULT([yes]) HAVE_GETHOSTBYNAME="1" ],[ AC_MSG_RESULT([no]) LIBS=$my_ac_save_LIBS ]) fi if test "$HAVE_GETHOSTBYNAME" != "1" then dnl This is for winsock systems if test "$ac_cv_header_windows_h" = "yes"; then if test "$ac_cv_header_winsock_h" = "yes"; then case $host in *-*-mingw32ce*) winsock_LIB="-lwinsock" ;; *) winsock_LIB="-lwsock32" ;; esac fi if test "$ac_cv_header_winsock2_h" = "yes"; then winsock_LIB="-lws2_32" fi if test ! -z "$winsock_LIB"; then my_ac_save_LIBS=$LIBS LIBS="$winsock_LIB $LIBS" AC_MSG_CHECKING([for gethostbyname in $winsock_LIB]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ #ifdef HAVE_WINDOWS_H #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #include #ifdef HAVE_WINSOCK2_H #include #else #ifdef HAVE_WINSOCK_H #include #endif #endif #endif ]],[[ gethostbyname("www.dummysite.com"); ]]) ],[ AC_MSG_RESULT([yes]) HAVE_GETHOSTBYNAME="1" ],[ AC_MSG_RESULT([no]) winsock_LIB="" LIBS=$my_ac_save_LIBS ]) fi fi fi if test "$HAVE_GETHOSTBYNAME" != "1" then dnl This is for Minix 3.1 AC_MSG_CHECKING([for gethostbyname for Minix 3]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ /* Older Minix versions may need here instead */ #include ]],[[ gethostbyname("www.dummysite.com"); ]]) ],[ AC_MSG_RESULT([yes]) HAVE_GETHOSTBYNAME="1" ],[ AC_MSG_RESULT([no]) ]) fi if test "$HAVE_GETHOSTBYNAME" != "1" then dnl This is for eCos with a stubbed DNS implementation AC_MSG_CHECKING([for gethostbyname for eCos]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ #include #include ]],[[ gethostbyname("www.dummysite.com"); ]]) ],[ AC_MSG_RESULT([yes]) HAVE_GETHOSTBYNAME="1" ],[ AC_MSG_RESULT([no]) ]) fi if test "$HAVE_GETHOSTBYNAME" != "1" then dnl gethostbyname in the net lib - for BeOS AC_CHECK_LIB(net, gethostbyname, [HAVE_GETHOSTBYNAME="1" LIBS="$LIBS -lnet" ]) fi if test "$HAVE_GETHOSTBYNAME" != "1"; then AC_MSG_ERROR([couldn't find libraries for gethostbyname()]) fi dnl resolv lib for Apple (MacOS and iOS) AS_IF([test "x$host_vendor" = "xapple"], [ AC_SEARCH_LIBS([res_servicename], [resolv], [ AC_DEFINE([CARES_USE_LIBRESOLV], [1], [Use resolver library to configure cares]) ], [ AC_MSG_ERROR([Unable to find libresolv which is required for iPhone targets]) ]) ]) dnl resolv lib for z/OS AS_IF([test "x$host_vendor" = "xibm" -a "x$host_os" = "xopenedition" ], [ AC_SEARCH_LIBS([res_init], [resolv], [ AC_DEFINE([CARES_USE_LIBRESOLV], [1], [Use resolver library to configure cares]) ], [ AC_MSG_ERROR([Unable to find libresolv which is required for z/OS]) ]) ]) dnl resolve lib? AC_CHECK_FUNC(strcasecmp, , [ AC_CHECK_LIB(resolve, strcasecmp) ]) if test "$ac_cv_lib_resolve_strcasecmp" = "$ac_cv_func_strcasecmp"; then AC_CHECK_LIB(resolve, strcasecmp, [LIBS="-lresolve $LIBS"], , -lnsl) fi ac_cv_func_strcasecmp="no" dnl Windows builds require linking to iphlpapi if test "$ac_cv_header_winsock2_h" = "yes"; then LIBS="$LIBS -liphlpapi" fi CARES_CHECK_LIBS_CONNECT dnl iOS 10? AS_IF([test "x$host_vendor" = "xapple"], [ AC_MSG_CHECKING([for iOS minimum version 10 or later]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #include #include ]], [[ #if TARGET_OS_IPHONE == 0 || __IPHONE_OS_VERSION_MIN_REQUIRED < 100000 #error Not iOS 10 or later #endif return 0; ]]) ],[ AC_MSG_RESULT([yes]) ac_cv_ios_10="yes" ],[ AC_MSG_RESULT([no]) ]) ]) dnl macOS 10.12? AS_IF([test "x$host_vendor" = "xapple"], [ AC_MSG_CHECKING([for macOS minimum version 10.12 or later]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #include #include ]], [[ #ifndef MAC_OS_X_VERSION_10_12 # define MAC_OS_X_VERSION_10_12 101200 #endif #if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_12 #error Not macOS 10.12 or later #endif return 0; ]]) ],[ AC_MSG_RESULT([yes]) ac_cv_macos_10_12="yes" ],[ AC_MSG_RESULT([no]) ]) ]) dnl ********************************************************************** dnl In case that function clock_gettime with monotonic timer is available, dnl check for additional required libraries. dnl ********************************************************************** dnl Xcode 8 bug: iOS when targeting less than 10, or macOS when targeting less than 10.12 will dnl say clock_gettime exists, it is a weak symbol that only exists in iOS 10 or macOS 10.12 and will dnl cause a crash at runtime when running on older versions. Skip finding CLOCK_MONOTONIC on older dnl Apple OS's. if test "x$host_vendor" != "xapple" || test "x$ac_cv_ios_10" = "xyes" || test "x$ac_cv_macos_10_12" = "xyes"; then CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC fi AC_MSG_CHECKING([whether to use libgcc]) AC_ARG_ENABLE(libgcc, AS_HELP_STRING([--enable-libgcc],[use libgcc when linking]), [ case "$enableval" in yes) LIBS="$LIBS -lgcc" AC_MSG_RESULT(yes) ;; *) AC_MSG_RESULT(no) ;; esac ], AC_MSG_RESULT(no) ) dnl Let's hope this split URL remains working: dnl http://publibn.boulder.ibm.com/doc_link/en_US/a_doc_lib/aixprggd/ \ dnl genprogc/thread_quick_ref.htm dnl ********************************************************************** dnl Back to "normal" configuring dnl ********************************************************************** dnl Checks for header files. STDC_HEADERS AC_PROG_EGREP CURL_CHECK_HEADER_MALLOC CURL_CHECK_HEADER_MEMORY dnl check for a few basic system headers we need AC_CHECK_HEADERS( sys/types.h \ sys/time.h \ sys/select.h \ sys/socket.h \ sys/ioctl.h \ sys/param.h \ sys/uio.h \ assert.h \ netdb.h \ netinet/in.h \ netinet/tcp.h \ net/if.h \ errno.h \ socket.h \ strings.h \ stdbool.h \ time.h \ limits.h \ arpa/nameser.h \ arpa/nameser_compat.h \ arpa/inet.h, dnl to do if not found [], dnl to do if found [], dnl default includes [ #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_TIME_H #include #endif dnl We do this default-include simply to make sure that the nameser_compat.h dnl header *REALLY* can be include after the new nameser.h. It seems AIX 5.1 dnl (and others?) is not designed to allow this. #ifdef HAVE_ARPA_NAMESER_H #include #endif dnl *Sigh* these are needed in order for net/if.h to get properly detected. #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_NETINET_IN_H #include #endif ] ) dnl Test and set CARES_HAVE_ARPA_NAMESER_H / CARES_HAVE_ARPA_NAMESER_COMPAT_H AC_CHECK_DECL([HAVE_ARPA_NAMESER_H], [ CARES_DEFINE_UNQUOTED([CARES_HAVE_ARPA_NAMESER_H]) ], [] ) AC_CHECK_DECL([HAVE_ARPA_NAMESER_COMPAT_H], [ CARES_DEFINE_UNQUOTED([CARES_HAVE_ARPA_NAMESER_COMPAT_H]) ], [] ) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_SIZE_T m4_warn([obsolete], [Update your code to rely only on HAVE_SYS_TIME_H, then remove this warning and the obsolete code below it. All current systems provide time.h; it need not be checked for. Not all systems provide sys/time.h, but those that do, all allow you to include it and time.h simultaneously.])dnl AC_CHECK_HEADERS_ONCE([sys/time.h]) # Obsolete code to be removed. if test $ac_cv_header_sys_time_h = yes; then AC_DEFINE([TIME_WITH_SYS_TIME],[1],[Define to 1 if you can safely include both and . This macro is obsolete.]) fi # End of obsolete code. CURL_CHECK_STRUCT_TIMEVAL AC_CHECK_TYPE(long long, [AC_DEFINE(HAVE_LONGLONG, 1, [Define to 1 if the compiler supports the 'long long' data type.])] longlong="yes" ) if test "xyes" = "x$longlong"; then AC_MSG_CHECKING([if numberLL works]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ ]],[[ long long val = 1000LL; ]]) ],[ AC_MSG_RESULT([yes]) AC_DEFINE(HAVE_LL, 1, [if your compiler supports LL]) ],[ AC_MSG_RESULT([no]) ]) fi # check for ssize_t AC_CHECK_TYPE(ssize_t, [ CARES_TYPEOF_ARES_SSIZE_T=ssize_t ], [ CARES_TYPEOF_ARES_SSIZE_T=int ]) AC_DEFINE_UNQUOTED([CARES_TYPEOF_ARES_SSIZE_T], ${CARES_TYPEOF_ARES_SSIZE_T}, [the signed version of size_t]) # check for bool type AC_CHECK_TYPE([bool],[ AC_DEFINE(HAVE_BOOL_T, 1, [Define to 1 if bool is an available type.]) ], ,[ #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_STDBOOL_H #include #endif ]) CARES_CONFIGURE_ARES_SOCKLEN_T TYPE_IN_ADDR_T TYPE_SOCKADDR_STORAGE TYPE_SIG_ATOMIC_T m4_warn([obsolete], [your code may safely assume C89 semantics that RETSIGTYPE is void. Remove this warning and the `AC_CACHE_CHECK' when you adjust the code.])dnl AC_CACHE_CHECK([return type of signal handlers],[ac_cv_type_signal],[AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([#include #include ], [return *(signal (0, 0)) (0) == 1;])], [ac_cv_type_signal=int], [ac_cv_type_signal=void])]) AC_DEFINE_UNQUOTED([RETSIGTYPE],[$ac_cv_type_signal],[Define as the return type of signal handlers (`int' or `void').]) CURL_CHECK_FUNC_RECV CURL_CHECK_FUNC_RECVFROM CURL_CHECK_FUNC_SEND CURL_CHECK_MSG_NOSIGNAL CARES_CHECK_FUNC_CLOSESOCKET CARES_CHECK_FUNC_CLOSESOCKET_CAMEL CARES_CHECK_FUNC_CONNECT CARES_CHECK_FUNC_FCNTL CARES_CHECK_FUNC_FREEADDRINFO CARES_CHECK_FUNC_GETADDRINFO CARES_CHECK_FUNC_GETENV CARES_CHECK_FUNC_GETHOSTBYADDR CARES_CHECK_FUNC_GETHOSTBYNAME CARES_CHECK_FUNC_GETHOSTNAME CARES_CHECK_FUNC_GETSERVBYPORT_R CARES_CHECK_FUNC_INET_NET_PTON CARES_CHECK_FUNC_INET_NTOP CARES_CHECK_FUNC_INET_PTON CARES_CHECK_FUNC_IOCTL CARES_CHECK_FUNC_IOCTLSOCKET CARES_CHECK_FUNC_IOCTLSOCKET_CAMEL CARES_CHECK_FUNC_SETSOCKOPT CARES_CHECK_FUNC_SOCKET CARES_CHECK_FUNC_STRCASECMP CARES_CHECK_FUNC_STRCMPI CARES_CHECK_FUNC_STRDUP CARES_CHECK_FUNC_STRICMP CARES_CHECK_FUNC_STRNCASECMP CARES_CHECK_FUNC_STRNCMPI CARES_CHECK_FUNC_STRNICMP CARES_CHECK_FUNC_WRITEV dnl check for AF_INET6 CARES_CHECK_CONSTANT( [ #undef inline #ifdef HAVE_WINDOWS_H #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #include #ifdef HAVE_WINSOCK2_H #include #endif #else #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif #endif ], [PF_INET6], AC_DEFINE_UNQUOTED(HAVE_PF_INET6,1,[Define to 1 if you have PF_INET6.]) ) dnl check for PF_INET6 CARES_CHECK_CONSTANT( [ #undef inline #ifdef HAVE_WINDOWS_H #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #include #ifdef HAVE_WINSOCK2_H #include #endif #else #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif #endif ], [AF_INET6], AC_DEFINE_UNQUOTED(HAVE_AF_INET6,1,[Define to 1 if you have AF_INET6.]) ) dnl check for the in6_addr structure CARES_CHECK_STRUCT( [ #undef inline #ifdef HAVE_WINDOWS_H #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #include #ifdef HAVE_WINSOCK2_H #include #ifdef HAVE_WS2TCPIP_H #include #endif #endif #else #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_NETINET_IN_H #include #endif #endif ], [in6_addr], AC_DEFINE_UNQUOTED(HAVE_STRUCT_IN6_ADDR,1,[Define to 1 if you have struct in6_addr.]) ) dnl check for the sockaddr_in6 structure CARES_CHECK_STRUCT( [ #undef inline #ifdef HAVE_WINDOWS_H #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #include #ifdef HAVE_WINSOCK2_H #include #ifdef HAVE_WS2TCPIP_H #include #endif #endif #else #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_NETINET_IN_H #include #endif #endif ], [sockaddr_in6], AC_DEFINE_UNQUOTED(HAVE_STRUCT_SOCKADDR_IN6,1, [Define to 1 if you have struct sockaddr_in6.]) ac_have_sockaddr_in6=yes ) AC_CHECK_MEMBER(struct sockaddr_in6.sin6_scope_id, AC_DEFINE_UNQUOTED(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID,1, [Define to 1 if your struct sockaddr_in6 has sin6_scope_id.]) , , [ #undef inline #ifdef HAVE_WINDOWS_H #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #include #ifdef HAVE_WINSOCK2_H #include #ifdef HAVE_WS2TCPIP_H #include #endif #endif #else #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_NETINET_IN_H #include #endif #endif ]) dnl check for the addrinfo structure AC_CHECK_MEMBER(struct addrinfo.ai_flags, AC_DEFINE_UNQUOTED(HAVE_STRUCT_ADDRINFO,1, [Define to 1 if you have struct addrinfo.]),, [ #undef inline #ifdef HAVE_WINDOWS_H #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #include #ifdef HAVE_WINSOCK2_H #include #ifdef HAVE_WS2TCPIP_H #include #endif #endif #else #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_NETINET_IN_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_NETDB_H #include #endif #endif ] ) AC_CHECK_FUNCS([bitncmp \ gettimeofday \ if_indextoname ],[ ],[ func="$ac_func" AC_MSG_CHECKING([deeper for $func]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ ]],[[ $func (); ]]) ],[ AC_MSG_RESULT([yes]) eval "ac_cv_func_$func=yes" AC_DEFINE_UNQUOTED(XC_SH_TR_CPP([HAVE_$func]), [1], [Define to 1 if you have the $func function.]) ],[ AC_MSG_RESULT([but still no]) ]) ]) dnl Android. Some variants like arm64 may no longer have __system_property_get dnl in libc, but they are defined in the headers. Perform a link check. AC_CHECK_FUNC([__system_property_get], [ AC_DEFINE([HAVE___SYSTEM_PROPERTY_GET], [1], [Define if __system_property_get exists.]) ]) dnl Check if the getnameinfo function is available dnl and get the types of five of its arguments. CURL_CHECK_FUNC_GETNAMEINFO AC_C_BIGENDIAN( [AC_DEFINE(ARES_BIG_ENDIAN, 1, [define this if ares is built for a big endian system])], , [AC_MSG_WARN([couldn't figure out endianess, assuming little endian!])] ) dnl Check for user-specified random device AC_ARG_WITH(random, AS_HELP_STRING([--with-random=FILE], [read randomness from FILE (default=/dev/urandom)]), [ CARES_RANDOM_FILE="$withval" ], [ dnl Check for random device. If we're cross compiling, we can't dnl check, and it's better to assume it doesn't exist than it is dnl to fail on AC_CHECK_FILE or later. if test "$cross_compiling" = "no"; then AC_CHECK_FILE("/dev/urandom", [ CARES_RANDOM_FILE="/dev/urandom"] ) else AC_MSG_WARN([cannot check for /dev/urandom while cross compiling; assuming none]) fi ] ) if test -n "$CARES_RANDOM_FILE" && test X"$CARES_RANDOM_FILE" != Xno ; then AC_SUBST(CARES_RANDOM_FILE) AC_DEFINE_UNQUOTED(CARES_RANDOM_FILE, "$CARES_RANDOM_FILE", [a suitable file/device to read random data from]) fi CARES_CHECK_OPTION_NONBLOCKING CARES_CHECK_NONBLOCKING_SOCKET CARES_CONFIGURE_SYMBOL_HIDING CARES_PRIVATE_LIBS="$LIBS" AC_SUBST(CARES_PRIVATE_LIBS) CARES_CFLAG_EXTRAS="" if test X"$want_werror" = Xyes; then CARES_CFLAG_EXTRAS="-Werror" fi AC_SUBST(CARES_CFLAG_EXTRAS) dnl squeeze whitespace out of some variables squeeze CFLAGS squeeze CPPFLAGS squeeze DEFS squeeze LDFLAGS squeeze LIBS squeeze CARES_PRIVATE_LIBS XC_CHECK_BUILD_FLAGS AC_MSG_CHECKING([whether to build tests]) AC_ARG_ENABLE(tests, AS_HELP_STRING([--enable-tests], [build test suite]), [ build_tests="$enableval" ], [ if test "x$HAVE_CXX11" = "x1" && test "x$cross_compiling" = "xno" ; then build_tests="yes" else build_tests="no" fi ] ) if test "x$build_tests" = "xyes" ; then if test "x$HAVE_CXX11" = "0" ; then AC_MSG_ERROR([*** Building tests requires a CXX11 compiler]) fi if test "x$cross_compiling" = "xyes" ; then AC_MSG_ERROR([*** Tests not supported when cross compiling]) fi fi AC_MSG_RESULT([$build_tests]) BUILD_SUBDIRS="include src docs" if test "x$build_tests" = "xyes" ; then AC_CONFIG_SUBDIRS([test]) BUILD_SUBDIRS="${BUILD_SUBDIRS} test" fi AC_SUBST(BUILD_SUBDIRS) AC_CONFIG_FILES([Makefile \ include/Makefile \ src/Makefile \ src/lib/Makefile \ src/tools/Makefile \ docs/Makefile \ libcares.pc ]) AC_OUTPUT XC_AMEND_DISTCLEAN(['.']) ././@PaxHeader0000000000000000000000000000003300000000000011451 xustar000000000000000027 mtime=1696604226.987415 pycares-4.4.0/deps/c-ares/docs/0000755000175100001770000000000000000000000017030 5ustar00runnerdocker00000000000000././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/docs/CMakeLists.txt0000644000175100001770000000060600000000000021572 0ustar00runnerdocker00000000000000# Headers and Man Pages installation target IF (CARES_INSTALL) # ManPages FILE (GLOB DevelManPages "." "*.3") INSTALL (FILES ${DevelManPages} DESTINATION ${CMAKE_INSTALL_MANDIR}/man3 COMPONENT Devel ) IF (CARES_BUILD_TOOLS) FILE (GLOB ToolManPages "." "*.1") INSTALL (FILES ${ToolManPages} DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 COMPONENT Tools ) ENDIF () ENDIF () ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/docs/Makefile.am0000644000175100001770000000052300000000000021064 0ustar00runnerdocker00000000000000#*************************************************************************** ########################################################################### AUTOMAKE_OPTIONS = foreign subdir-objects no-dependencies include Makefile.inc man_MANS = $(MANPAGES) EXTRA_DIST = $(MANPAGES) ahost.1 adig.1 acountry.1 Makefile.inc CMakeLists.txt ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/docs/Makefile.inc0000644000175100001770000000300400000000000021235 0ustar00runnerdocker00000000000000MANPAGES = ares_cancel.3 \ ares_create_query.3 \ ares_destroy.3 \ ares_destroy_options.3 \ ares_dup.3 \ ares_expand_name.3 \ ares_expand_string.3 \ ares_fds.3 \ ares_free_data.3 \ ares_free_hostent.3 \ ares_free_string.3 \ ares_freeaddrinfo.3 \ ares_get_servers.3 \ ares_get_servers_ports.3 \ ares_getaddrinfo.3 \ ares_gethostbyaddr.3 \ ares_gethostbyname.3 \ ares_gethostbyname_file.3 \ ares_getnameinfo.3 \ ares_getsock.3 \ ares_inet_ntop.3 \ ares_inet_pton.3 \ ares_init.3 \ ares_init_options.3 \ ares_library_cleanup.3 \ ares_library_init.3 \ ares_library_init_android.3 \ ares_library_initialized.3 \ ares_mkquery.3 \ ares_parse_a_reply.3 \ ares_parse_aaaa_reply.3 \ ares_parse_caa_reply.3 \ ares_parse_mx_reply.3 \ ares_parse_naptr_reply.3 \ ares_parse_ns_reply.3 \ ares_parse_ptr_reply.3 \ ares_parse_soa_reply.3 \ ares_parse_srv_reply.3 \ ares_parse_txt_reply.3 \ ares_parse_uri_reply.3 \ ares_process.3 \ ares_query.3 \ ares_save_options.3 \ ares_search.3 \ ares_send.3 \ ares_set_local_dev.3 \ ares_set_local_ip4.3 \ ares_set_local_ip6.3 \ ares_set_servers.3 \ ares_set_servers_csv.3 \ ares_set_servers_ports.3 \ ares_set_servers_ports_csv.3 \ ares_set_socket_callback.3 \ ares_set_socket_configure_callback.3 \ ares_set_socket_functions.3 \ ares_set_sortlist.3 \ ares_strerror.3 \ ares_timeout.3 \ ares_version.3 ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/docs/acountry.10000644000175100001770000000333400000000000020761 0ustar00runnerdocker00000000000000.TH ACOUNTRY "1" "April 2011" "c-ares utilities" .SH NAME acountry \- print the country where an IPv4 address or host is located .SH SYNOPSIS .B acountry [\fIOPTION\fR]... \fIHOST\fR... .SH DESCRIPTION .PP .\" Add any additional description here .PP Print the country where HOST (an IPv4 address or hostname) is located, using the countries.nerd.dk DNS domain to identify the country. .PP This utility comes with the \fBc\-ares\fR asynchronous resolver library. .SH OPTIONS .TP \fB\-d\fR Print some extra debugging output. .TP \fB\-h\fR, \fB\-\-help\fR Display this help and exit. .TP \fB\-v\fR Be more verbose. Print extra information. .SH "REPORTING BUGS" Report bugs to the c-ares mailing list: .br \fBhttps://lists.haxx.se/listinfo/c-ares\fR .SH "SEE ALSO" .PP adig(1), ahost(1). .PP The DNSBL countries.nerd.dk .br \fBhttp://countries.nerd.dk/\fR .SH COPYRIGHT This utility is based on code/ideas contained in sofware written by Greg Hudson (ares) carrying the following notice: .br Copyright 1998 by the Massachusetts Institute of Technology. .br Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of M.I.T. not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. M.I.T. makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. .br No further copyright claims are being made by the author(s) of this utility. .SH AUTHOR Gisle Vanem ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/docs/adig.10000644000175100001770000000534300000000000020023 0ustar00runnerdocker00000000000000.TH ADIG "1" "April 2011" "c-ares utilities" .SH NAME adig \- print information collected from Domain Name System (DNS) servers .SH SYNOPSIS .B adig [\fIOPTION\fR]... \fINAME\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, 1.2.3.10.in-addr.arpa). .PP This utility comes with the \fBc\-ares\fR asynchronous resolver library. .SH OPTIONS .TP \fB\-c\fR class Set the query class. Possible values for class are NY, CHAOS, HS, IN (default). .TP \fB\-d\fR Print some extra debugging output. .TP \fB\-f\fR flag Add a flag. Possible values for flag are igntc, noaliases, norecurse, primary, stayopen, usevc. .TP \fB\-h\fR, \fB\-\-help\fR Display this help and exit. .TP \fB\-T\fR port Use specified TCP port to connect to DNS server. .TP \fB\-s\fR server Connect to specified DNS server, instead of the system's default one(s). .TP \fB\-t\fR type Query records of specified type. Possible values for type are A (default), AAAA, AFSDB, ANY, AXFR, CNAME, GPOS, HINFO, ISDN, KEY, LOC, MAILA, MAILB, MB, MD, MF, MG, MINFO, MR, MX, NAPTR, NS, NSAP, NSAP_PTR, NULL, PTR, PX, RP, RT, SIG, SOA, SRV, TXT, URI, WKS, X25, .TP \fB\-U\fR port Use specified UDP port to connect to DNS server. .TP \fB\-x\fR For an IPv4 \fB-t PTR a.b.c.d\fR lookup, query for .br \fBd.c.b.a.in-addr.arpa.\fR This more often gives correct names in the \fBANSWER\fR. .br For an IPv6 \fB-t PTR addr\fR lookup, query for \fBa.b.c....z.IP6.ARPA.\fR .TP \fB\-xx\fR As for \fB-x\fR and an IPv6 address, compact \fBa.b.c....z.IP6.ARPA.\fR into a RFC-2673 bit-string. This compacted \fBbit-string\fR form is not supported by many DNS-servers. .SH "REPORTING BUGS" Report bugs to the c-ares mailing list: .br \fBhttps://lists.haxx.se/listinfo/c-ares\fR .SH "SEE ALSO" .PP acountry(1), ahost(1). .SH COPYRIGHT This utility is based on code/ideas contained in sofware written by Greg Hudson (ares) carrying the following notice: .br Copyright 1998 by the Massachusetts Institute of Technology. .br Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of M.I.T. not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. M.I.T. makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. .br No further copyright claims are being made by the author(s) of this utility. ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/docs/ahost.10000644000175100001770000000374500000000000020241 0ustar00runnerdocker00000000000000.TH AHOST "1" "April 2011" "c-ares utilities" .SH NAME ahost \- print the A or AAAA record associated with a hostname or IP address .SH SYNOPSIS .B ahost [\fIOPTION\fR]... \fIHOST\fR... .SH DESCRIPTION .PP .\" Add any additional description here .PP Look up the DNS A or AAAA record associated with HOST (a hostname or an IP address). .PP This utility comes with the \fBc\-ares\fR asynchronous resolver library. .SH OPTIONS .TP \fB\-d\fR Print some extra debugging output. .TP \fB\-h\fR, \fB\-\-help\fR Display this help and exit. .TP \fB\-t\fR type If type is "a", print the A record (default). If type is "aaaa", print the AAAA record. If type is "u", look for either AAAA or A record (in that order). .TP \fB\-s\fR \fIdomain\fP Specify the \fIdomain\fP to search instead of using the default values from .br /etc/resolv.conf. This option only has an effect on platforms that use .br /etc/resolv.conf for DNS configuration; it has no effect on other platforms (such as Win32 or Android). .SH "REPORTING BUGS" Report bugs to the c-ares mailing list: .br \fBhttps://lists.haxx.se/listinfo/c-ares\fR .SH "SEE ALSO" .PP acountry(1), adig(1). .SH COPYRIGHT This utility is based on code/ideas contained in sofware written by Greg Hudson (ares) carrying the following notice: .br Copyright 1998 by the Massachusetts Institute of Technology. .br Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of M.I.T. not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. M.I.T. makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. .br No further copyright claims are being made by the author(s) of this utility. ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/docs/ares_cancel.30000644000175100001770000000314600000000000021357 0ustar00runnerdocker00000000000000.\" .\" Copyright 1998 by the Massachusetts Institute of Technology. .\" .\" Permission to use, copy, modify, and distribute this .\" software and its documentation for any purpose and without .\" fee is hereby granted, provided that the above copyright .\" notice appear in all copies and that both that copyright .\" notice and this permission notice appear in supporting .\" documentation, and that the name of M.I.T. not be used in .\" advertising or publicity pertaining to distribution of the .\" software without specific, written prior permission. .\" M.I.T. makes no representations about the suitability of .\" this software for any purpose. It is provided "as is" .\" without express or implied warranty. .\" .TH ARES_CANCEL 3 "31 March 2004" .SH NAME ares_cancel \- Cancel a resolve .SH SYNOPSIS .nf #include void ares_cancel(ares_channel \fIchannel\fP) .fi .SH DESCRIPTION The \fBares_cancel(3)\fP function cancels all lookups/requests made on the the name service channel identified by \fIchannel\fP. \fBares_cancel(3)\fP invokes the callbacks for each pending query on the channel, passing a status of .BR ARES_ECANCELLED . These calls give the callbacks a chance to clean up any state which might have been stored in their arguments. If such a callback invocation adds a new request to the channel, that request will \fInot\fP be cancelled by the current invocation of \fBares_cancel(3)\fP. .SH SEE ALSO .BR ares_init (3) .BR ares_destroy (3) .SH NOTES This function was added in c-ares 1.2.0 c-ares 1.6.0 and earlier pass a status of .BR ARES_ETIMEOUT instead of .BR ARES_ECANCELLED . .SH AUTHOR Dirk Manske ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/docs/ares_create_query.30000644000175100001770000000556600000000000022632 0ustar00runnerdocker00000000000000.\" .\" Copyright 1998 by the Massachusetts Institute of Technology. .\" .\" Permission to use, copy, modify, and distribute this .\" software and its documentation for any purpose and without .\" fee is hereby granted, provided that the above copyright .\" notice appear in all copies and that both that copyright .\" notice and this permission notice appear in supporting .\" documentation, and that the name of M.I.T. not be used in .\" advertising or publicity pertaining to distribution of the .\" software without specific, written prior permission. .\" M.I.T. makes no representations about the suitability of .\" this software for any purpose. It is provided "as is" .\" without express or implied warranty. .\" .TH ARES_CREATE_QUERY 3 "17 Aug 2012" .SH NAME ares_create_query \- Compose a single-question DNS query buffer .SH SYNOPSIS .nf #include int ares_create_query(const char *\fIname\fP, int \fIdnsclass\fP, int \fItype\fP, unsigned short \fIid\fP, int \fIrd\fP, unsigned char **\fIbuf\fP, int *\fIbuflen\fP, int \fImax_udp_size\fP) .fi .SH DESCRIPTION The \fIares_create_query(3)\fP function composes a DNS query with a single question. The parameter \fIname\fP gives the query name as a NUL-terminated C string of period-separated labels optionally ending with a period; periods and backslashes within a label must be escaped with a backlash. The parameters \fIdnsclass\fP and \fItype\fP give the class and type of the query using the values defined in \fB\fP. The parameter \fIid\fP gives a 16-bit identifier for the query. The parameter \fIrd\fP should be nonzero if recursion is desired, zero if not. The query will be placed in an allocated buffer, a pointer to which will be stored in the variable pointed to by \fIbuf\fP, and the length of which will be stored in the variable pointed to by \fIbuflen\fP. It is the caller's responsibility to free this buffer using \fIares_free_string(3)\fP when it is no longer needed. The parameter \fImax_udp_size\fP should be nonzero to activate EDNS. Usage of \fIares_create_query(3)\fP\ with \fImax_udp_size\fP set to zero is equivalent to using \fIares_mkquery(3)\fP. .SH RETURN VALUES .B ares_create_query can return any of the following values: .TP 15 .B ARES_SUCCESS Construction of the DNS query succeeded. .TP 15 .B ARES_ENOTFOUND The query name .I name refers to a .I .onion domain name. See RFC 7686. .TP 15 .B ARES_EBADNAME The query name .I name could not be encoded as a domain name, either because it contained a zero-length label or because it contained a label of more than 63 characters. .TP 15 .B ARES_ENOMEM Memory was exhausted. .SH AVAILABILITY Added in c-ares 1.10.0 .SH SEE ALSO .BR ares_expand_name (3), .BR ares_free_string (3), .BR ares_mkquery (3) .SH AUTHOR ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/docs/ares_destroy.30000644000175100001770000000301200000000000021613 0ustar00runnerdocker00000000000000.\" .\" Copyright 1998 by the Massachusetts Institute of Technology. .\" .\" Permission to use, copy, modify, and distribute this .\" software and its documentation for any purpose and without .\" fee is hereby granted, provided that the above copyright .\" notice appear in all copies and that both that copyright .\" notice and this permission notice appear in supporting .\" documentation, and that the name of M.I.T. not be used in .\" advertising or publicity pertaining to distribution of the .\" software without specific, written prior permission. .\" M.I.T. makes no representations about the suitability of .\" this software for any purpose. It is provided "as is" .\" without express or implied warranty. .\" .TH ARES_DESTROY 3 "7 December 2004" .SH NAME ares_destroy \- Destroy a resolver channel .SH SYNOPSIS .nf #include void ares_destroy(ares_channel \fIchannel\fP) .fi .SH DESCRIPTION The \fBares_destroy(3)\fP function destroys the name service channel identified by \fIchannel\fP, freeing all memory and closing all sockets used by the channel. \fBares_destroy(3)\fP invokes the callbacks for each pending query on the channel, passing a status of \fIARES_EDESTRUCTION\fP. These calls give the callbacks a chance to clean up any state which might have been stored in their arguments. A callback must not add new requests to a channel being destroyed. .SH SEE ALSO .BR ares_init (3), .BR ares_cancel (3) .SH AUTHOR Greg Hudson, MIT Information Systems .br Copyright 1998 by the Massachusetts Institute of Technology. ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/docs/ares_destroy_options.30000644000175100001770000000240500000000000023373 0ustar00runnerdocker00000000000000.\" .\" Copyright 1998 by the Massachusetts Institute of Technology. .\" .\" Permission to use, copy, modify, and distribute this .\" software and its documentation for any purpose and without .\" fee is hereby granted, provided that the above copyright .\" notice appear in all copies and that both that copyright .\" notice and this permission notice appear in supporting .\" documentation, and that the name of M.I.T. not be used in .\" advertising or publicity pertaining to distribution of the .\" software without specific, written prior permission. .\" M.I.T. makes no representations about the suitability of .\" this software for any purpose. It is provided "as is" .\" without express or implied warranty. .\" .TH ARES_DESTROY_OPTIONS 3 "1 June 2007" .SH NAME ares_destroy_options \- Destroy options initialized with ares_save_options .SH SYNOPSIS .nf .B #include .PP .B void ares_destroy_options(struct ares_options *\fIoptions\fP) .fi .SH DESCRIPTION The \fBares_destroy_options(3)\fP function destroys the options struct identified by \Ioptions\fP, freeing all memory allocated by \fBares_save_options(3)\fP. .SH SEE ALSO .BR ares_save_options (3), .BR ares_init_options (3) .SH AUTHOR Brad House .br Copyright 1998 by the Massachusetts Institute of Technology. ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/docs/ares_dup.30000644000175100001770000000262700000000000020725 0ustar00runnerdocker00000000000000.\" .\" Copyright (C) 2004-2009 by Daniel Stenberg .\" .\" Permission to use, copy, modify, and distribute this .\" software and its documentation for any purpose and without .\" fee is hereby granted, provided that the above copyright .\" notice appear in all copies and that both that copyright .\" notice and this permission notice appear in supporting .\" documentation, and that the name of M.I.T. not be used in .\" advertising or publicity pertaining to distribution of the .\" software without specific, written prior permission. .\" M.I.T. makes no representations about the suitability of .\" this software for any purpose. It is provided "as is" .\" without express or implied warranty. .\" .TH ARES_DUP 3 "26 May 2009" .SH NAME ares_dup \- Duplicate a resolver channel .SH SYNOPSIS .nf .B #include .PP .B int ares_dup(ares_channel *\fIdest\fP, ares_channel \fIsource\fP) .fi .SH DESCRIPTION The \fBares_dup(3)\fP function duplicates an existing communications channel for name service lookups. If it returns successfully, \fBares_dup(3)\fP will set the variable pointed to by \fIdest\fP to a handle used to identify the name service channel. The caller should invoke \fIares_destroy(3)\fP on the handle when the channel is no longer needed. .SH SEE ALSO .BR ares_destroy(3), .BR ares_init(3), .BR ares_library_init(3) .SH AVAILABILITY \fIares_dup(3)\fP was added in c-ares 1.6.0 .SH AUTHOR Daniel Stenberg ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/docs/ares_expand_name.30000644000175100001770000000420500000000000022406 0ustar00runnerdocker00000000000000.\" .\" Copyright 1998 by the Massachusetts Institute of Technology. .\" .\" Permission to use, copy, modify, and distribute this .\" software and its documentation for any purpose and without .\" fee is hereby granted, provided that the above copyright .\" notice appear in all copies and that both that copyright .\" notice and this permission notice appear in supporting .\" documentation, and that the name of M.I.T. not be used in .\" advertising or publicity pertaining to distribution of the .\" software without specific, written prior permission. .\" M.I.T. makes no representations about the suitability of .\" this software for any purpose. It is provided "as is" .\" without express or implied warranty. .\" .TH ARES_EXPAND_NAME 3 "20 Nov 2009" .SH NAME ares_expand_name \- Expand a DNS-encoded domain name .SH SYNOPSIS .nf .B #include .PP .B int ares_expand_name(const unsigned char *\fIencoded\fP, .B const unsigned char *\fIabuf\fP, int \fIalen\fP, char **\fIs\fP, .B long *\fIenclen\fP) .fi .SH DESCRIPTION The .B ares_expand_name function converts a DNS-encoded domain name to a dot-separated C string. The argument .I encoded gives the beginning of the encoded domain name, and the arguments .I abuf and .I alen give the containing message buffer (necessary for the processing of indirection pointers within the encoded domain name). The result is placed in a NUL-terminated allocated buffer, a pointer to which is stored in the variable pointed to by .IR s . The length of the encoded name is stored in the variable pointed to by .I enclen so that the caller can advance past the encoded domain name to read further data in the message. Use \fIares_free_string(3)\fP to free the allocated hostname. .SH RETURN VALUES .B ares_expand_name can return any of the following values: .TP 15 .B ARES_SUCCESS Expansion of the encoded name succeeded. .TP 15 .B ARES_EBADNAME The encoded domain name was malformed and could not be expanded. .TP 15 .B ARES_ENOMEM Memory was exhausted. .SH SEE ALSO .BR ares_mkquery (3), ares_free_string (3) .SH AUTHOR Greg Hudson, MIT Information Systems .br Copyright 1998 by the Massachusetts Institute of Technology. ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/docs/ares_expand_string.30000644000175100001770000000374000000000000022777 0ustar00runnerdocker00000000000000.\" .\" Copyright 1998 by the Massachusetts Institute of Technology. .\" .\" Permission to use, copy, modify, and distribute this .\" software and its documentation for any purpose and without .\" fee is hereby granted, provided that the above copyright .\" notice appear in all copies and that both that copyright .\" notice and this permission notice appear in supporting .\" documentation, and that the name of M.I.T. not be used in .\" advertising or publicity pertaining to distribution of the .\" software without specific, written prior permission. .\" M.I.T. makes no representations about the suitability of .\" this software for any purpose. It is provided "as is" .\" without express or implied warranty. .\" .TH ARES_EXPAND_NAME 3 "20 Nov 2009" .SH NAME ares_expand_string \- Expand a length encoded string .SH SYNOPSIS .nf .B #include .PP .B int ares_expand_string(const unsigned char *\fIencoded\fP, .B const unsigned char *\fIabuf\fP, int \fIalen\fP, unsigned char **\fIs\fP, .B long *\fIenclen\fP) .fi .SH DESCRIPTION The .B ares_expand_string function converts a length encoded string to a NUL-terminated C string. The argument .I encoded gives the beginning of the encoded string, and the arguments .I abuf and .I alen give the containing message buffer (necessary for the processing of indirection pointers within the encoded domain name). The result is placed in a NUL-terminated allocated buffer, a pointer to which is stored in the variable pointed to by .IR s . The length of the encoded string is stored in the variable pointed to by .I enclen so that the caller can advance past the encoded string to read further data in the message. .SH RETURN VALUES .B ares_expand_string can return any of the following values: .TP 15 .B ARES_SUCCESS Expansion of the encoded string succeeded. .TP 15 .B ARES_EBADSTR The encoded string was malformed and could not be expanded. .TP 15 .B ARES_ENOMEM Memory was exhausted. .SH SEE ALSO .BR ares_free_string (3) .SH AUTHOR Dominick Meglio ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/docs/ares_fds.30000644000175100001770000000357400000000000020713 0ustar00runnerdocker00000000000000.\" .\" Copyright 1998 by the Massachusetts Institute of Technology. .\" .\" Permission to use, copy, modify, and distribute this .\" software and its documentation for any purpose and without .\" fee is hereby granted, provided that the above copyright .\" notice appear in all copies and that both that copyright .\" notice and this permission notice appear in supporting .\" documentation, and that the name of M.I.T. not be used in .\" advertising or publicity pertaining to distribution of the .\" software without specific, written prior permission. .\" M.I.T. makes no representations about the suitability of .\" this software for any purpose. It is provided "as is" .\" without express or implied warranty. .\" .TH ARES_FDS 3 "23 July 1998" .SH NAME ares_fds \- return file descriptors to select on .SH SYNOPSIS .nf #include int ares_fds(ares_channel \fIchannel\fP, fd_set *\fIread_fds\fP, fd_set *\fIwrite_fds\fP) .fi .SH DESCRIPTION The \fBares_fds(3)\fP function retrieves the set of file descriptors which the calling application should select on for reading and writing for the processing of name service queries pending on the name service channel identified by \fIchannel\fP. File descriptors will be set in the file descriptor sets pointed to by \fIread_fds\fP and \fIwrite_fds\fP as appropriate. File descriptors already set in \fIread_fds\fP and \fIwrite_fds\fP will remain set; initialization of the file descriptor sets (using \fBFD_ZERO\fP) is the responsibility of the caller. .SH RETURN VALUES \fBares_fds(3)\fP returns a value that is one greater than the number of the highest socket set in either \fIread_fds\fP or \fIwrite_fds\fP. If no queries are active, \fBares_fds(3)\fP returns 0. .SH SEE ALSO .BR ares_timeout (3), .BR ares_process (3) .SH AUTHOR Greg Hudson, MIT Information Systems .br Copyright 1998 by the Massachusetts Institute of Technology. ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/docs/ares_free_data.30000644000175100001770000000577200000000000022053 0ustar00runnerdocker00000000000000.\" .\" Copyright 1998 by the Massachusetts Institute of Technology. .\" Copyright (C) 2004-2010 by Daniel Stenberg .\" .\" Permission to use, copy, modify, and distribute this .\" software and its documentation for any purpose and without .\" fee is hereby granted, provided that the above copyright .\" notice appear in all copies and that both that copyright .\" notice and this permission notice appear in supporting .\" documentation, and that the name of M.I.T. not be used in .\" advertising or publicity pertaining to distribution of the .\" software without specific, written prior permission. .\" M.I.T. makes no representations about the suitability of .\" this software for any purpose. It is provided "as is" .\" without express or implied warranty. .\" .TH ARES_FREE_DATA 3 "5 March 2010" .SH NAME ares_free_data \- Free data allocated by several c-ares functions .SH SYNOPSIS .nf .B #include .PP .B void ares_free_data(void *\fIdataptr\fP) .PP .B cc file.c -lcares .fi .SH DESCRIPTION .PP The .B ares_free_data(3) function frees one or more data structures allocated and returned by several c-ares functions. Specifically the data returned by the following list of functions must be deallocated using this function. .TP 5 .B ares_get_servers(3) When used to free the data returned by ares_get_servers(3) this will free the whole linked list of ares_addr_node structures returned by ares_get_servers(3). .TP .B ares_parse_srv_reply(3) When used to free the data returned by ares_parse_srv_reply(3) this will free the whole linked list of ares_srv_reply structures returned by ares_parse_srv_reply(3), along with any additional storage associated with those structures. .TP .B ares_parse_mx_reply(3) When used to free the data returned by ares_parse_mx_reply(3) this will free the whole linked list of ares_mx_reply structures returned by ares_parse_mx_reply(3), along with any additional storage associated with those structures. .TP .B ares_parse_txt_reply(3) When used to free the data returned by ares_parse_txt_reply(3) this will free the whole linked list of ares_txt_reply structures returned by ares_parse_txt_reply(3), along with any additional storage associated with those structures. .TP .B ares_parse_soa_reply(3) When used to free the data returned by ares_parse_soa_reply(3) this will free the ares_soa_reply structure, along with any additional storage associated with those structure. .B ares_parse_uri_reply(3) When used to free the data returned by ares_parse_uri_reply(3) this will free list of ares_uri_reply structures, along with any additional storage associated with those structure. .SH RETURN VALUE The ares_free_data() function does not return a value. .SH AVAILABILITY This function was first introduced in c-ares version 1.7.0. .SH SEE ALSO .BR ares_get_servers(3), .BR ares_parse_srv_reply(3), .BR ares_parse_mx_reply(3), .BR ares_parse_txt_reply(3), .BR ares_parse_soa_reply(3) .SH AUTHOR Yang Tse .PP Copyright 1998 by the Massachusetts Institute of Technology. .br Copyright (C) 2004-2010 by Daniel Stenberg. ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/docs/ares_free_hostent.30000644000175100001770000000315000000000000022612 0ustar00runnerdocker00000000000000.\" .\" Copyright 1998 by the Massachusetts Institute of Technology. .\" .\" Permission to use, copy, modify, and distribute this .\" software and its documentation for any purpose and without .\" fee is hereby granted, provided that the above copyright .\" notice appear in all copies and that both that copyright .\" notice and this permission notice appear in supporting .\" documentation, and that the name of M.I.T. not be used in .\" advertising or publicity pertaining to distribution of the .\" software without specific, written prior permission. .\" M.I.T. makes no representations about the suitability of .\" this software for any purpose. It is provided "as is" .\" without express or implied warranty. .\" .TH ARES_FREE_HOSTENT 3 "23 July 1998" .SH NAME ares_free_hostent \- Free host structure allocated by ares functions .SH SYNOPSIS .nf .B #include .PP .B void ares_free_hostent(struct hostent *\fIhost\fP) .fi .SH DESCRIPTION The .I ares_free_hostent function frees a .B struct hostent allocated by one of the functions \fIares_parse_a_reply(3)\fP, \fIares_parse_aaaa_reply(3)\fP, or \fIares_parse_ptr_reply(3)\fP. .SH NOTES It is not necessary (and is not correct) to free the host structure passed to the callback functions for \fIares_gethostbyname(3)\fP or \fIares_gethostbyaddr(3)\fP. c-ares will automatically free such host structures when the callback returns. .SH SEE ALSO .BR ares_parse_a_reply (3), .BR ares_parse_aaaa_reply (3), .BR ares_parse_ptr_reply (3), .BR ares_parse_ns_reply (3) .SH AUTHOR Greg Hudson, MIT Information Systems .br Copyright 1998 by the Massachusetts Institute of Technology. ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/docs/ares_free_string.30000644000175100001770000000225300000000000022437 0ustar00runnerdocker00000000000000.\" .\" Copyright 2000 by the Massachusetts Institute of Technology. .\" .\" Permission to use, copy, modify, and distribute this .\" software and its documentation for any purpose and without .\" fee is hereby granted, provided that the above copyright .\" notice appear in all copies and that both that copyright .\" notice and this permission notice appear in supporting .\" documentation, and that the name of M.I.T. not be used in .\" advertising or publicity pertaining to distribution of the .\" software without specific, written prior permission. .\" M.I.T. makes no representations about the suitability of .\" this software for any purpose. It is provided "as is" .\" without express or implied warranty. .\" .TH ARES_FREE_STRING 3 "4 February 2004" .SH NAME ares_free_string \- Free strings allocated by ares functions .SH SYNOPSIS .nf .B #include .PP .B void ares_free_string(void *\fIstr\fP) .fi .SH DESCRIPTION The \fIares_free_string(3)\fP function frees a string allocated by an ares function. .SH SEE ALSO .BR ares_mkquery (3) .BR ares_expand_string (3) .SH AUTHOR Greg Hudson, MIT Information Systems .br Copyright 2000 by the Massachusetts Institute of Technology. ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/docs/ares_freeaddrinfo.30000644000175100001770000000225000000000000022555 0ustar00runnerdocker00000000000000.\" .\" Copyright 1998 by the Massachusetts Institute of Technology. .\" .\" Permission to use, copy, modify, and distribute this .\" software and its documentation for any purpose and without .\" fee is hereby granted, provided that the above copyright .\" notice appear in all copies and that both that copyright .\" notice and this permission notice appear in supporting .\" documentation, and that the name of M.I.T. not be used in .\" advertising or publicity pertaining to distribution of the .\" software without specific, written prior permission. .\" M.I.T. makes no representations about the suitability of .\" this software for any purpose. It is provided "as is" .\" without express or implied warranty. .\" .TH ARES_FREEADDRINFO 3 "31 October 2018" .SH NAME ares_freeaddrinfo \- Free addrinfo structure allocated by ares functions .SH SYNOPSIS .nf #include void ares_freeaddrinfo(struct ares_addrinfo *\fIai\fP) .fi .SH DESCRIPTION The .B ares_freeaddrinfo function frees a .B struct ares_addrinfo returned in \fIresult\fP of .B ares_addrinfo_callback .SH SEE ALSO .BR ares_getaddrinfo (3), .SH AUTHOR Christian Ammer .BR Andrew Selivanov ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/docs/ares_get_servers.30000644000175100001770000000633500000000000022465 0ustar00runnerdocker00000000000000.\" .\" Copyright 1998 by the Massachusetts Institute of Technology. .\" Copyright (C) 2008-2010 by Daniel Stenberg .\" .\" Permission to use, copy, modify, and distribute this .\" software and its documentation for any purpose and without .\" fee is hereby granted, provided that the above copyright .\" notice appear in all copies and that both that copyright .\" notice and this permission notice appear in supporting .\" documentation, and that the name of M.I.T. not be used in .\" advertising or publicity pertaining to distribution of the .\" software without specific, written prior permission. .\" M.I.T. makes no representations about the suitability of .\" this software for any purpose. It is provided "as is" .\" without express or implied warranty. .\" .TH ARES_GET_SERVERS 3 "5 March 2010" .SH NAME ares_get_servers, ares_get_servers_ports \- Retrieve name servers from an initialized ares_channel .SH SYNOPSIS .nf .B #include .PP .B int ares_get_servers(ares_channel \fIchannel\fP, struct ares_addr_node **\fIservers\fP) .B int ares_get_servers_ports(ares_channel \fIchannel\fP, struct ares_addr_port_node **\fIservers\fP) .fi .SH DESCRIPTION The \fBares_get_servers(3)\fP function retrieves name servers configuration from the channel data identified by .IR channel , as a linked list of ares_addr_node structs storing a pointer to the first node at the address specified by .IR servers . The \fBares_get_servers_ports(3)\fP function also retrieves any per-server port information that may have been previously configured, returning a linked list of ares_addr_port structures. Function caller may traverse the returned name server linked list, or may use it directly as suitable input for the \fBares_set_servers(3)\fP / \fBares_set_servers_ports(3)\fP functions, but shall not shrink or extend the list on its own. Each node of the name server linked list is stored in memory dynamically allocated and managed by c-ares. It is the caller's responsibility to free the resulting linked list, using \fBares_free_data(3)\fP , once the caller does not need it any longer. This function is capable of handling IPv4 and IPv6 name server addresses simultaneously, rendering \fBares_save_options(3)\fP with optmask \fBARES_OPT_SERVERS\fP functionally obsolete except for IPv4-only name server usage. .SH RETURN VALUES This function may return any of the following values: .TP 15 .B ARES_SUCCESS The name servers configuration was successfully retrieved .TP 15 .B ARES_ENOMEM The memory was exhausted .TP 15 .B ARES_ENODATA The channel data identified by .IR channel was invalid. .SH SEE ALSO .BR ares_set_servers (3), .BR ares_init_options (3), .BR ares_save_options(3) .SH AVAILABILITY \fBares_get_servers(3)\fP was added in c-ares 1.7.1; \fBares_get_servers_ports(3)\fP was added in c-ares 1.11.0. .SH AUTHOR Implementation of this function and associated library internals are based on code, comments and feedback provided in November and December of 2008 by Daniel Stenberg, Gregor Jasny, Phil Blundell and Yang Tse, December 2009 by Cedric Bail, February 2010 by Jakub Hrozek. On March 2010 Yang Tse shuffled all the bits and this function popped out. .br Copyright 1998 by the Massachusetts Institute of Technology. .br Copyright (C) 2008-2010 by Daniel Stenberg ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/docs/ares_get_servers_ports.30000644000175100001770000000003400000000000023702 0ustar00runnerdocker00000000000000.so man3/ares_get_servers.3 ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/docs/ares_getaddrinfo.30000644000175100001770000001213400000000000022415 0ustar00runnerdocker00000000000000.\" .\" Copyright 1998 by the Massachusetts Institute of Technology. .\" .\" Permission to use, copy, modify, and distribute this .\" software and its documentation for any purpose and without .\" fee is hereby granted, provided that the above copyright .\" notice appear in all copies and that both that copyright .\" notice and this permission notice appear in supporting .\" documentation, and that the name of M.I.T. not be used in .\" advertising or publicity pertaining to distribution of the .\" software without specific, written prior permission. .\" M.I.T. makes no representations about the suitability of .\" this software for any purpose. It is provided "as is" .\" without express or implied warranty. .\" .TH ARES_GETADDRINFO 3 "4 November 2018" .SH NAME ares_getaddrinfo \- Initiate a host query by name and service .SH SYNOPSIS .nf .B #include .PP .B typedef void (*ares_addrinfo_callback)(void *\fIarg\fP, int \fIstatus\fP, .B int \fItimeouts\fP, struct ares_addrinfo *\fIresult\fP) .PP .B void ares_getaddrinfo(ares_channel \fIchannel\fP, const char *\fIname\fP, .B const char* \fIservice\fP, const struct ares_addrinfo_hints *\fIhints\fP, .B ares_addrinfo_callback \fIcallback\fP, void *\fIarg\fP) .fi .SH DESCRIPTION The .B ares_getaddrinfo function initiates a host query by name on the name service channel identified by .IR channel . The .I name and .I service parameters give the hostname and service as NULL-terminated C strings. The .I hints parameter is an .BR ares_addrinfo_hints structure: .PP .RS .EX struct ares_addrinfo_hints { int ai_flags; int ai_family; int ai_socktype; int ai_protocol; }; .EE .RE .TP .I ai_family Specifies desired address family. AF_UNSPEC means return both AF_INET and AF_INET6. .TP .I ai_socktype Specifies desired socket type, for example SOCK_STREAM or SOCK_DGRAM. Setting this to 0 means any type. .TP .I ai_protocol Setting this to 0 means any protocol. .TP .I ai_flags Specifies additional options, see below. .PP .TP 19 .B ARES_AI_NUMERICSERV If this option is set .I service field will be treated as a numeric value. .TP 19 .B ARES_AI_CANONNAME The ares_addrinfo structure will return a canonical names list. .TP 19 .B ARES_AI_NOSORT Result addresses will not be sorted and no connections to resolved addresses will be attempted. .TP 19 .B ARES_AI_ENVHOSTS Read hosts file path from the environment variable .I CARES_HOSTS . .PP When the query is complete or has failed, the ares library will invoke \fIcallback\fP. Completion or failure of the query may happen immediately, or may happen during a later call to \fIares_process(3)\fP, \fIares_destroy(3)\fP or \fIares_cancel(3)\fP. .PP The callback argument .I arg is copied from the .B ares_getaddrinfo argument .IR arg . The callback argument .I status indicates whether the query succeeded and, if not, how it failed. It may have any of the following values: .TP 19 .B ARES_SUCCESS The host lookup completed successfully. .TP 19 .B ARES_ENOTIMP The ares library does not know how to find addresses of type .IR family . .TP 19 .B ARES_ENOTFOUND The .I name was not found. .TP 19 .B ARES_ENOMEM Memory was exhausted. .TP 19 .B ARES_ECANCELLED The query was cancelled. .TP 19 .B ARES_EDESTRUCTION The name service channel .I channel is being destroyed; the query will not be completed. .PP On successful completion of the query, the callback argument .I result points to a .B struct ares_addrinfo which contains two linked lists, one with resolved addresses and another with canonical names. Also included is the official name of the host (analogous to gethostbyname() h_name). .PP .RS .EX struct ares_addrinfo { struct ares_addrinfo_cname *cnames; struct ares_addrinfo_node *nodes; char *name; }; .EE .RE .PP .I ares_addrinfo_node structure is similar to RFC3493 addrinfo, but without canonname and with extra ttl field. .RS .PP .EX struct ares_addrinfo_node { int ai_ttl; int ai_flags; int ai_family; int ai_socktype; int ai_protocol; ares_socklen_t ai_addrlen; struct sockaddr *ai_addr; struct ares_addrinfo_node *ai_next; }; .EE .RE .PP .I ares_addrinfo_cname structure is a linked list of CNAME records where .I ttl is a time to live .I alias is a label of the resource record and .I name is a value (canonical name) of the resource record. See RFC2181 10.1.1. CNAME terminology. .RS .PP .EX struct ares_addrinfo_cname { int ttl; char *alias; char *name; struct ares_addrinfo_cname *next; }; .EE .RE .PP The reserved memory has to be deleted by .B ares_freeaddrinfo. The result is sorted according to RFC6724 except: - Rule 3 (Avoid deprecated addresses) - Rule 4 (Prefer home addresses) - Rule 7 (Prefer native transport) Please note that the function will attempt a connection on each of the resolved addresses as per RFC6724. .SH AVAILABILITY This function was added in c-ares 1.16.0, released in March 2020. .SH SEE ALSO .BR ares_freeaddrinfo (3) .SH AUTHOR Christian Ammer .br Andrew Selivanov ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/docs/ares_gethostbyaddr.30000644000175100001770000000574300000000000023002 0ustar00runnerdocker00000000000000.\" .\" Copyright 1998 by the Massachusetts Institute of Technology. .\" .\" Permission to use, copy, modify, and distribute this .\" software and its documentation for any purpose and without .\" fee is hereby granted, provided that the above copyright .\" notice appear in all copies and that both that copyright .\" notice and this permission notice appear in supporting .\" documentation, and that the name of M.I.T. not be used in .\" advertising or publicity pertaining to distribution of the .\" software without specific, written prior permission. .\" M.I.T. makes no representations about the suitability of .\" this software for any purpose. It is provided "as is" .\" without express or implied warranty. .\" .TH ARES_GETHOSTBYADDR 3 "24 July 1998" .SH NAME ares_gethostbyaddr \- Initiate a host query by address .SH SYNOPSIS .nf .B #include .PP .B typedef void (*ares_host_callback)(void *\fIarg\fP, int \fIstatus\fP, .B int \fItimeouts\fP, struct hostent *\fIhostent\fP) .PP .B void ares_gethostbyaddr(ares_channel \fIchannel\fP, const void *\fIaddr\fP, .B int \fIaddrlen\fP, int \fIfamily\fP, ares_host_callback \fIcallback\fP, .B void *\fIarg\fP) .fi .SH DESCRIPTION The .B ares_gethostbyaddr function initiates a host query by address on the name service channel identified by .IR channel . The parameters .I addr and .I addrlen give the address as a series of bytes, and .I family gives the type of address. When the query is complete or has failed, the ares library will invoke \fIcallback\fP. Completion or failure of the query may happen immediately, or may happen during a later call to \fIares_process(3)\fP, \fIares_destroy(3)\fP or \fIares_cancel(3)\fP. .PP The callback argument .I arg is copied from the .B ares_gethostbyaddr argument .IR arg . The callback argument .I status indicates whether the query succeeded and, if not, how it failed. It may have any of the following values: .TP 19 .B ARES_SUCCESS The host lookup completed successfully. .TP 19 .B ARES_ENOTIMP The ares library does not know how to look up addresses of type .IR family . .TP 19 .B ARES_ENOTFOUND The address .I addr was not found. .TP 19 .B ARES_ENOMEM Memory was exhausted. .TP 19 .B ARES_ECANCELLED The query was cancelled. .TP 19 .B ARES_EDESTRUCTION The name service channel .I channel is being destroyed; the query will not be completed. .PP The callback argument .I timeouts reports how many times a query timed out during the execution of the given request. .PP On successful completion of the query, the callback argument .I hostent points to a .B struct hostent containing the name of the host returned by the query. The callback need not and should not attempt to free the memory pointed to by .IR hostent ; the ares library will free it when the callback returns. If the query did not complete successfully, .I hostent will be .BR NULL . .SH SEE ALSO .BR ares_process (3), .BR ares_gethostbyname (3) .SH AUTHOR Greg Hudson, MIT Information Systems .br Copyright 1998 by the Massachusetts Institute of Technology. ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/docs/ares_gethostbyname.30000644000175100001770000000627600000000000023012 0ustar00runnerdocker00000000000000.\" .\" Copyright 1998 by the Massachusetts Institute of Technology. .\" .\" Permission to use, copy, modify, and distribute this .\" software and its documentation for any purpose and without .\" fee is hereby granted, provided that the above copyright .\" notice appear in all copies and that both that copyright .\" notice and this permission notice appear in supporting .\" documentation, and that the name of M.I.T. not be used in .\" advertising or publicity pertaining to distribution of the .\" software without specific, written prior permission. .\" M.I.T. makes no representations about the suitability of .\" this software for any purpose. It is provided "as is" .\" without express or implied warranty. .\" .TH ARES_GETHOSTBYNAME 3 "25 July 1998" .SH NAME ares_gethostbyname \- Initiate a host query by name .SH SYNOPSIS .nf .B #include .PP .B typedef void (*ares_host_callback)(void *\fIarg\fP, int \fIstatus\fP, .B int \fItimeouts\fP, struct hostent *\fIhostent\fP) .PP .B void ares_gethostbyname(ares_channel \fIchannel\fP, const char *\fIname\fP, .B int \fIfamily\fP, ares_host_callback \fIcallback\fP, void *\fIarg\fP) .fi .SH DESCRIPTION The .B ares_gethostbyname function initiates a host query by name on the name service channel identified by .IR channel . The parameter .I name gives the hostname as a NUL-terminated C string, and .I family gives the desired type of address for the resulting host entry. When the query is complete or has failed, the ares library will invoke \fIcallback\fP. Completion or failure of the query may happen immediately, or may happen during a later call to \fIares_process(3)\fP, \fIares_destroy(3)\fP or \fIares_cancel(3)\fP. .PP The callback argument .I arg is copied from the .B ares_gethostbyname argument .IR arg . The callback argument .I status indicates whether the query succeeded and, if not, how it failed. It may have any of the following values: .TP 19 .B ARES_SUCCESS The host lookup completed successfully. .TP 19 .B ARES_ENOTIMP The ares library does not know how to find addresses of type .IR family . .TP 19 .B ARES_EBADNAME The hostname .B name is composed entirely of numbers and periods, but is not a valid representation of an Internet address. .TP 19 .B ARES_ENODATA There was no data returned to extract a result from. .TP 19 .B ARES_ENOTFOUND The name .I name was not found. .TP 19 .B ARES_ENOMEM Memory was exhausted. .TP 19 .B ARES_ECANCELLED The query was cancelled. .TP 19 .B ARES_EDESTRUCTION The name service channel .I channel is being destroyed; the query will not be completed. .PP The callback argument .I timeouts reports how many times a query timed out during the execution of the given request. .PP On successful completion of the query, the callback argument .I hostent points to a .B struct hostent containing the name of the host returned by the query. The callback need not and should not attempt to free the memory pointed to by .IR hostent ; the ares library will free it when the callback returns. If the query did not complete successfully, .I hostent will be .BR NULL . .SH SEE ALSO .BR ares_process (3), .BR ares_gethostbyaddr (3) .SH AUTHOR Greg Hudson, MIT Information Systems .br Copyright 1998 by the Massachusetts Institute of Technology. ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/docs/ares_gethostbyname_file.30000644000175100001770000000504200000000000023777 0ustar00runnerdocker00000000000000.\" .\" Copyright 1998 by the Massachusetts Institute of Technology. .\" .\" Permission to use, copy, modify, and distribute this .\" software and its documentation for any purpose and without .\" fee is hereby granted, provided that the above copyright .\" notice appear in all copies and that both that copyright .\" notice and this permission notice appear in supporting .\" documentation, and that the name of M.I.T. not be used in .\" advertising or publicity pertaining to distribution of the .\" software without specific, written prior permission. .\" M.I.T. makes no representations about the suitability of .\" this software for any purpose. It is provided "as is" .\" without express or implied warranty. .\" .TH ARES_GETHOSTBYNAME 3 "25 July 1998" .SH NAME ares_gethostbyname_file \- Lookup a name in the system's hosts file .SH SYNOPSIS .nf .B #include .PP .B int ares_gethostbyname_file(ares_channel \fIchannel\fP, const char *\fIname\fP, .B int \fIfamily\fP, struct hostent **host) .fi .SH DESCRIPTION The .B ares_gethostbyname_file function performs a host lookup by name against the system's hosts file (or equivalent local hostname database). The .IR channel parameter is required, but no asynchronous queries are performed. Instead, the lookup is done via the same mechanism used to perform 'f' lookups (see the .I lookups options field in \fIares_init_options(3)\fP). The parameter .I name gives the hostname as a NUL-terminated C string, and .I family gives the desired type of address for the resulting host entry. .PP The return value indicates whether the query succeeded and, if not, how it failed. It may have any of the following values: .TP 19 .B ARES_SUCCESS The host lookup completed successfully and .I host now points to the result (and must be freed with \fIares_free_hostent(3)\fP). .TP 19 .B ARES_ENOTFOUND The hostname .I name was not found. .TP 19 .B ARES_EFILE There was a file I/O error while performing the lookup. .TP 19 .B ARES_ENOMEM Memory was exhausted. .PP On successful completion of the query, the pointer pointed to by .I host points to a .B struct hostent containing the address of the host returned by the lookup. The user must free the memory pointed to by .IR host when finished with it by calling \fIares_free_hostent(3)\fP. If the lookup did not complete successfully, .I host will be .BR NULL . .SH AVAILABILITY Added in c-ares 1.5.4 .SH SEE ALSO .BR ares_gethostbyname (3), .BR ares_free_hostent (3), .BR ares_init_options (3) .SH AUTHOR Brad Spencer .br Copyright 1998 by the Massachusetts Institute of Technology. ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/docs/ares_getnameinfo.30000644000175100001770000001035200000000000022423 0ustar00runnerdocker00000000000000.\" .\" Copyright 2005 by Dominick Meglio. .\" .\" Permission to use, copy, modify, and distribute this .\" software and its documentation for any purpose and without .\" fee is hereby granted, provided that the above copyright .\" notice appear in all copies and that both that copyright .\" notice and this permission notice appear in supporting .\" documentation, and that the name of M.I.T. not be used in .\" advertising or publicity pertaining to distribution of the .\" software without specific, written prior permission. .\" M.I.T. makes no representations about the suitability of .\" this software for any purpose. It is provided "as is" .\" without express or implied warranty. .\" .TH ARES_GETNAMEINFO 3 "1 May 2009" .SH NAME ares_getnameinfo \- Address-to-nodename translation in protocol-independent manner .SH SYNOPSIS .nf .B #include .PP .B typedef void (*ares_nameinfo_callback)(void *\fIarg\fP, int \fIstatus\fP, .B int \fItimeouts\fP, char *\fInode\fP, char *\fIservice\fP) .PP .B void ares_getnameinfo(ares_channel \fIchannel\fP, const struct sockaddr *\fIsa\fP, .B ares_socklen_t \fIsalen\fP, int \fIflags\fP, ares_nameinfo_callback \fIcallback\fP, .B void *\fIarg\fP) .fi .SH DESCRIPTION The .B ares_getnameinfo function is defined for protocol-independent address translation. The function is a combination of \fIares_gethostbyaddr(3)\fP and \fIgetservbyport(3)\fP. The function will translate the address either by executing a host query on the name service channel identified by .IR channel or it will attempt to resolve it locally if possible. The parameters .I sa and .I len give the address as a sockaddr structure, and .I flags gives the options that the function will use. Valid flags are listed below: .TP 19 .B ARES_NI_NOFQDN Only the nodename portion of the FQDN is returned for local hosts. .TP 19 .B ARES_NI_NUMERICHOST The numeric form of the hostname is returned rather than the name. .TP 19 .B ARES_NI_NAMEREQD An error is returned if the hostname cannot be found in the DNS. .TP 19 .B ARES_NI_NUMERICSERV The numeric form of the service is returned rather than the name. .TP 19 .B ARES_NI_TCP The service name is to be looked up for the TCP protocol. .TP 19 .B ARES_NI_UDP The service name is to be looked up for the UDP protocol. .TP 19 .B ARES_NI_SCTP The service name is to be looked up for the SCTP protocol. .TP 19 .B ARES_NI_DCCP The service name is to be looked up for the DCCP protocol. .TP 19 .B ARES_NI_NUMERICSCOPE The numeric form of the scope ID is returned rather than the name. .TP 19 .B ARES_NI_LOOKUPHOST A hostname lookup is being requested. .TP 19 .B ARES_NI_LOOKUPSERVICE A service name lookup is being requested. .PP When the query is complete or has failed, the ares library will invoke \fIcallback\fP. Completion or failure of the query may happen immediately, or may happen during a later call to \fIares_process(3)\fP, \fIares_destroy(3)\fP or \fIares_cancel(3)\fP. .PP The callback argument .I arg is copied from the .B ares_getnameinfo argument .IR arg . The callback argument .I status indicates whether the query succeeded and, if not, how it failed. It may have any of the following values: .TP 19 .B ARES_SUCCESS The host lookup completed successfully. .TP 19 .B ARES_ENOTIMP The ares library does not know how to look up addresses of type .IR family . .TP 19 .B ARES_ENOTFOUND The address .I addr was not found. .TP 19 .B ARES_ENOMEM Memory was exhausted. .TP 19 .B ARES_ECANCELLED The query was cancelled. .TP 19 .B ARES_EDESTRUCTION The name service channel .I channel is being destroyed; the query will not be completed. .TP 19 .B ARES_EBADFLAGS The .I flags parameter contains an illegal value. .PP The callback argument .I timeouts reports how many times a query timed out during the execution of the given request. .PP On successful completion of the query, the callback argument .I node contains a string representing the hostname (assuming .B ARES_NI_LOOKUPHOST was specified). Additionally, .I service contains a string representing the service name (assuming .B ARES_NI_LOOKUPSERVICE was specified). If the query did not complete successfully, or one of the values was not requested, .I node or .I service will be .BR NULL . .SH SEE ALSO .BR ares_process (3), .SH AUTHOR Dominick Meglio .br Copyright 2005 by Dominick Meglio. ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/docs/ares_getsock.30000644000175100001770000000415700000000000021574 0ustar00runnerdocker00000000000000.\" .\" Copyright 1998 by Daniel Stenberg .\" .\" Permission to use, copy, modify, and distribute this .\" software and its documentation for any purpose and without .\" fee is hereby granted, provided that the above copyright .\" notice appear in all copies and that both that copyright .\" notice and this permission notice appear in supporting .\" documentation, and that the name of M.I.T. not be used in .\" advertising or publicity pertaining to distribution of the .\" software without specific, written prior permission. .\" M.I.T. makes no representations about the suitability of .\" this software for any purpose. It is provided "as is" .\" without express or implied warranty. .\" .TH ARES_GETSOCK 3 "11 March 2010" .SH NAME ares_getsock \- get socket descriptors to wait on .SH SYNOPSIS .nf .B #include .PP .B int ares_getsock(ares_channel \fIchannel\fP, ares_socket_t *\fIsocks\fP, .B int \fInumsocks\fP); .fi .SH DESCRIPTION The .B ares_getsock function retrieves the set of socket descriptors which the calling application should wait on for reading and/or writing for the processing of name service queries pending on the name service channel identified by .IR channel . Socket descriptors will be set in the socket descriptor array pointed to by \fIsocks\fP. \fInumsocks\fP is the size of the given array in number of ints. This function can only return information about up to 16 sockets. If more are in use (however unlikely that is), they are simply not reported back. .SH RETURN VALUES \fBares_getsock\fP returns a bitmask for what actions to wait for on the different sockets. The ares.h header file provides these convenience macros to extract the information appropriately: .nf #define ARES_GETSOCK_MAXNUM 16 /* ares_getsock() can return info about this many sockets */ #define ARES_GETSOCK_READABLE(bits,num) (bits & (1<< (num))) #define ARES_GETSOCK_WRITABLE(bits,num) (bits & (1 << ((num) + \ ARES_GETSOCK_MAXNUM))) .fi .SH NOTES This function was added in c-ares 1.3.1 .SH SEE ALSO .BR ares_timeout (3), .BR ares_fds (3), .BR ares_process (3) ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/docs/ares_inet_ntop.30000644000175100001770000000363400000000000022133 0ustar00runnerdocker00000000000000.\" .\" Copyright (C) 2013 by Daniel Stenberg .\" .\" Permission to use, copy, modify, and distribute this .\" software and its documentation for any purpose and without .\" fee is hereby granted, provided that the above copyright .\" notice appear in all copies and that both that copyright .\" notice and this permission notice appear in supporting .\" documentation, and that the name of M.I.T. not be used in .\" advertising or publicity pertaining to distribution of the .\" software without specific, written prior permission. .\" M.I.T. makes no representations about the suitability of .\" this software for any purpose. It is provided "as is" .\" without express or implied warranty. .\" .TH ARES_INET_NTOP 3 "17 Feb 2013" .SH NAME ares_inet_ntop \- convert a network format address to presentation format .SH SYNOPSIS .nf .B #include .PP .B const char * .B ares_inet_ntop(int af, const void *src, char *dst, ares_socklen_t size); .fi .SH DESCRIPTION This is a portable version with the identical functionality of the commonly available \fIinet_ntop\fP. The ares_inet_ntop() function converts a numeric address into a text string suitable for presentation. The \fBaf\fP argument shall specify the family of the address. This can be AF_INET or AF_INET6. The \fBsrc\fP argument points to a buffer holding an IPv4 address if the af argument is AF_INET, or an IPv6 address if the af argument is AF_INET6; the address must be in network byte order. The \fBdst\fP argument points to a buffer where the function stores the resulting text string; it shall not be NULL. The \fBsize\fP argument specifies the size of this buffer, which shall be large enough to hold the text string (INET_ADDRSTRLEN (16) characters for IPv4, INET6_ADDRSTRLEN (46) characters for IPv6). .SH SEE ALSO .BR ares_init(3), .BR ares_inet_pton(3) .SH AVAILABILITY made properly publicly available in c-ares for real in version 1.10.0 .SH AUTHOR Daniel Stenberg ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/docs/ares_inet_pton.30000644000175100001770000000326700000000000022135 0ustar00runnerdocker00000000000000.\" .\" Copyright (C) 2013 by Daniel Stenberg .\" .\" Permission to use, copy, modify, and distribute this .\" software and its documentation for any purpose and without .\" fee is hereby granted, provided that the above copyright .\" notice appear in all copies and that both that copyright .\" notice and this permission notice appear in supporting .\" documentation, and that the name of M.I.T. not be used in .\" advertising or publicity pertaining to distribution of the .\" software without specific, written prior permission. .\" M.I.T. makes no representations about the suitability of .\" this software for any purpose. It is provided "as is" .\" without express or implied warranty. .\" .TH ARES_INET_PTON 3 "17 Feb 2013" .SH NAME ares_inet_pton \- convert an IPv4 or IPv6 address from text to binary form .SH SYNOPSIS .nf .B #include .PP .B const char *ares_inet_pton(int af, const char *src, void *dst); .fi .SH DESCRIPTION This is a portable version with the identical functionality of the commonly available \fIinet_pton\fP. The ares_inet_pton() function converts the address in its standard text presentation form into its numeric binary form. The \fBaf\fP argument shall specify the family of the address. The AF_INET and AF_INET6 address families 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). .SH SEE ALSO .BR ares_init(3), .BR ares_inet_ntop(3) .SH AVAILABILITY made properly publicly available in c-ares for real in version 1.10.0 .SH AUTHOR Daniel Stenberg ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/docs/ares_init.30000644000175100001770000000460500000000000021076 0ustar00runnerdocker00000000000000.\" .\" Copyright 1998 by the Massachusetts Institute of Technology. .\" Copyright (C) 2004-2010 by Daniel Stenberg .\" .\" Permission to use, copy, modify, and distribute this .\" software and its documentation for any purpose and without .\" fee is hereby granted, provided that the above copyright .\" notice appear in all copies and that both that copyright .\" notice and this permission notice appear in supporting .\" documentation, and that the name of M.I.T. not be used in .\" advertising or publicity pertaining to distribution of the .\" software without specific, written prior permission. .\" M.I.T. makes no representations about the suitability of .\" this software for any purpose. It is provided "as is" .\" without express or implied warranty. .\" .TH ARES_INIT 3 "5 March 2010" .SH NAME ares_init \- Initialize a resolver channel .SH SYNOPSIS .nf #include int ares_init(ares_channel *\fIchannelptr\fP) .fi .SH DESCRIPTION The \fBares_init(3)\fP function initializes a communications channel for name service lookups. If it returns successfully, \fBares_init(3)\fP will set the variable pointed to by \fIchannelptr\fP to a handle used to identify the name service channel. The caller should invoke \fIares_destroy(3)\fP on the handle when the channel is no longer needed. The \fIares_init_options(3)\fP function is provide to offer more init alternatives. .SH RETURN VALUES \fIares_init(3)\fP can return any of the following values: .TP 14 .B ARES_SUCCESS Initialization succeeded. .TP 14 .B ARES_EFILE A configuration file could not be read. .TP 14 .B ARES_ENOMEM The process's available memory was exhausted. .TP 14 .B ARES_ENOTINITIALIZED c-ares library initialization not yet performed. .SH NOTES When initializing from .B /etc/resolv.conf, .BR ares_init (3) reads the .I domain and .I search directives to allow lookups of short names relative to the domains specified. The .I domain and .I search directives override one another. If more that one instance of either .I domain or .I search directives is specified, the last occurrence wins. For more information, please see the .BR resolv.conf (5) manual page. .SH SEE ALSO .BR ares_init_options(3), .BR ares_destroy(3), .BR ares_dup(3), .BR ares_library_init(3), .BR ares_set_servers(3) .SH AUTHOR Greg Hudson, MIT Information Systems .br Copyright 1998 by the Massachusetts Institute of Technology. .br Copyright (C) 2004-2010 by Daniel Stenberg. ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/docs/ares_init_options.30000644000175100001770000002251400000000000022650 0ustar00runnerdocker00000000000000.\" .\" Copyright 1998 by the Massachusetts Institute of Technology. .\" Copyright (C) 2004-2010 by Daniel Stenberg .\" .\" Permission to use, copy, modify, and distribute this .\" software and its documentation for any purpose and without .\" fee is hereby granted, provided that the above copyright .\" notice appear in all copies and that both that copyright .\" notice and this permission notice appear in supporting .\" documentation, and that the name of M.I.T. not be used in .\" advertising or publicity pertaining to distribution of the .\" software without specific, written prior permission. .\" M.I.T. makes no representations about the suitability of .\" this software for any purpose. It is provided "as is" .\" without express or implied warranty. .\" .TH ARES_INIT 3 "5 March 2010" .SH NAME ares_init_options \- Initialize a resolver channel .SH SYNOPSIS .nf #include struct ares_options { int flags; int timeout; /* in seconds or milliseconds, depending on options */ int tries; int ndots; unsigned short udp_port; unsigned short tcp_port; int socket_send_buffer_size; int socket_receive_buffer_size; struct in_addr *servers; int nservers; char **domains; int ndomains; char *lookups; ares_sock_state_cb sock_state_cb; void *sock_state_cb_data; struct apattern *sortlist; int nsort; int ednspsz; char *resolvconf_path; }; int ares_init_options(ares_channel *\fIchannelptr\fP, struct ares_options *\fIoptions\fP, int \fIoptmask\fP) .fi .SH DESCRIPTION The \fBares_init_options(3)\fP function initializes a communications channel for name service lookups. If it returns successfully, \fBares_init_options(3)\fP will set the variable pointed to by \fIchannelptr\fP to a handle used to identify the name service channel. The caller should invoke \fIares_destroy(3)\fP on the handle when the channel is no longer needed. The \fIoptmask\fP parameter generally specifies which fields in the structure pointed to by \fIoptions\fP are set, as follows: .TP 18 .B ARES_OPT_FLAGS .B int \fIflags\fP; .br Flags controlling the behavior of the resolver. See below for a description of possible flag values. .TP 18 .B ARES_OPT_TIMEOUT .B int \fItimeout\fP; .br The number of seconds each name server is given to respond to a query on the first try. (After the first try, the timeout algorithm becomes more complicated, but scales linearly with the value of \fItimeout\fP.) The default is five seconds. This option is being deprecated by \fIARES_OPT_TIMEOUTMS\fP starting in c-ares 1.5.2. .TP 18 .B ARES_OPT_TIMEOUTMS .B int \fItimeout\fP; .br The number of milliseconds each name server is given to respond to a query on the first try. (After the first try, the timeout algorithm becomes more complicated, but scales linearly with the value of \fItimeout\fP.) The default is five seconds. Note that this option is specified with the same struct field as the former \fIARES_OPT_TIMEOUT\fP, it is but the option bits that tell c-ares how to interpret the number. This option was added in c-ares 1.5.2. .TP 18 .B ARES_OPT_TRIES .B int \fItries\fP; .br The number of tries the resolver will try contacting each name server before giving up. The default is four tries. .TP 18 .B ARES_OPT_NDOTS .B int \fIndots\fP; .br The number of dots which must be present in a domain name for it to be queried for "as is" prior to querying for it with the default domain extensions appended. The default value is 1 unless set otherwise by resolv.conf or the RES_OPTIONS environment variable. .TP 18 .B ARES_OPT_UDP_PORT .B unsigned short \fIudp_port\fP; .br The port to use for queries over UDP, in network byte order. The default value is 53 (in network byte order), the standard name service port. .TP 18 .B ARES_OPT_TCP_PORT .B unsigned short \fItcp_port\fP; .br The port to use for queries over TCP, in network byte order. The default value is 53 (in network byte order), the standard name service port. .TP 18 .B ARES_OPT_SERVERS .B struct in_addr *\fIservers\fP; .br .B int \fInservers\fP; .br The list of IPv4 servers to contact, instead of the servers specified in resolv.conf or the local named. In order to allow specification of either IPv4 or IPv6 name servers, the .BR ares_set_servers(3) function must be used instead. .TP 18 .B ARES_OPT_DOMAINS .B char **\fIdomains\fP; .br .B int \fIndomains\fP; .br The domains to search, instead of the domains specified in resolv.conf or the domain derived from the kernel hostname variable. .TP 18 .B ARES_OPT_LOOKUPS .B char *\fIlookups\fP; .br The lookups to perform for host queries. .I lookups should be set to a string of the characters "b" or "f", where "b" indicates a DNS lookup and "f" indicates a lookup in the hosts file. .TP 18 .B ARES_OPT_SOCK_STATE_CB .B void (*\fIsock_state_cb\fP)(void *data, ares_socket_t socket_fd, int readable, int writable); .br .B void *\fIsock_state_cb_data\fP; .br A callback function to be invoked when a socket changes state. .I socket_fd will be passed the socket whose state has changed; .I readable will be set to true if the socket should listen for read events, and .I writable will be set to true if the socket should listen for write events. The value of .I sock_state_cb_data will be passed as the .I data argument. .TP 18 .B ARES_OPT_SORTLIST .B struct apattern *\fIsortlist\fP; .br .B int \fInsort\fP; .br A list of IP address ranges that specifies the order of preference that results from \fIares_gethostbyname\fP should be returned in. Note that this can only be used with a sortlist retrieved via \fBares_save_options(3)\fP (because .B struct apattern is opaque); to set a fresh sort list, use \fBares_set_sortlist(3)\fP. .TP 18 .B ARES_OPT_SOCK_SNDBUF .B int \fIsocket_send_buffer_size\fP; .br The send buffer size to set for the socket. .TP 18 .B ARES_OPT_SOCK_RCVBUF .B int \fIsocket_receive_buffer_size\fP; .br The receive buffer size to set for the socket. .TP 18 .B ARES_OPT_EDNSPSZ .B int \fIednspsz\fP; .br The message size to be advertized in EDNS; only takes effect if the .B ARES_FLAG_EDNS flag is set. .TP 18 .B ARES_OPT_RESOLVCONF .B char *\fIresolvconf_path\fP; .br The path to use for reading the resolv.conf file. The .I resolvconf_path should be set to a path string, and will be honoured on *nix like systems. The default is .B /etc/resolv.conf .br .PP The \fIoptmask\fP parameter also includes options without a corresponding field in the .B ares_options structure, as follows: .TP 23 .B ARES_OPT_ROTATE Perform round-robin selection of the nameservers configured for the channel 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. .PP The .I flags field should be the bitwise or of some subset of the following values: .TP 23 .B ARES_FLAG_USEVC Always use TCP queries (the "virtual circuit") instead of UDP queries. Normally, TCP is only used if a UDP query yields a truncated result. .TP 23 .B ARES_FLAG_PRIMARY Only query the first server in the list of servers to query. .TP 23 .B ARES_FLAG_IGNTC If a truncated response to a UDP query is received, do not fall back to TCP; simply continue on with the truncated response. .TP 23 .B ARES_FLAG_NORECURSE Do not set the "recursion desired" bit on outgoing queries, so that the name server being contacted will not try to fetch the answer from other servers if it doesn't know the answer locally. Be aware that ares will not do the recursion for you. Recursion must be handled by the application calling ares if \fIARES_FLAG_NORECURSE\fP is set. .TP 23 .B ARES_FLAG_STAYOPEN Do not close communications sockets when the number of active queries drops to zero. .TP 23 .B ARES_FLAG_NOSEARCH Do not use the default search domains; only query hostnames as-is or as aliases. .TP 23 .B ARES_FLAG_NOALIASES Do not honor the HOSTALIASES environment variable, which normally specifies a file of hostname translations. .TP 23 .B ARES_FLAG_NOCHECKRESP Do not discard responses with the SERVFAIL, NOTIMP, or REFUSED response code or responses whose questions don't match the questions in the request. Primarily useful for writing clients which might be used to test or debug name servers. .TP 23 .B ARES_FLAG_EDNS Include an EDNS pseudo-resource record (RFC 2671) in generated requests. .SH RETURN VALUES \fBares_init_options(3)\fP can return any of the following values: .TP 14 .B ARES_SUCCESS Initialization succeeded. .TP 14 .B ARES_EFILE A configuration file could not be read. .TP 14 .B ARES_ENOMEM The process's available memory was exhausted. .TP 14 .B ARES_ENOTINITIALIZED c-ares library initialization not yet performed. .SH NOTES When initializing from .B /etc/resolv.conf, (or, alternatively when specified by the .I resolvconf_path path location) \fBares_init_options(3)\fP reads the \fIdomain\fP and \fIsearch\fP directives to allow lookups of short names relative to the domains specified. The \fIdomain\fP and \fIsearch\fP directives override one another. If more that one instance of either \fIdomain\fP or \fIsearch\fP directives is specified, the last occurrence wins. For more information, please see the .BR resolv.conf (5) manual page. .SH SEE ALSO .BR ares_init(3), .BR ares_destroy(3), .BR ares_dup(3), .BR ares_library_init(3), .BR ares_save_options(3), .BR ares_set_servers(3), .BR ares_set_sortlist(3) .SH AUTHOR Greg Hudson, MIT Information Systems .br Copyright 1998 by the Massachusetts Institute of Technology. .br Copyright (C) 2004-2010 by Daniel Stenberg. ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/docs/ares_library_cleanup.30000644000175100001770000000721400000000000023305 0ustar00runnerdocker00000000000000.\" .\" Copyright 1998 by the Massachusetts Institute of Technology. .\" Copyright (C) 2004-2009 by Daniel Stenberg .\" .\" Permission to use, copy, modify, and distribute this .\" software and its documentation for any purpose and without .\" fee is hereby granted, provided that the above copyright .\" notice appear in all copies and that both that copyright .\" notice and this permission notice appear in supporting .\" documentation, and that the name of M.I.T. not be used in .\" advertising or publicity pertaining to distribution of the .\" software without specific, written prior permission. .\" M.I.T. makes no representations about the suitability of .\" this software for any purpose. It is provided "as is" .\" without express or implied warranty. .\" .TH ARES_LIBRARY_CLEANUP 3 "19 May 2009" .SH NAME ares_library_cleanup \- c-ares library deinitialization .SH SYNOPSIS .nf #include void ares_library_cleanup(void) .fi .SH DESCRIPTION .PP The .B ares_library_cleanup function uninitializes the c-ares library, freeing all resources previously acquired by \fIares_library_init(3)\fP when the library was initialized, provided there was only one single previous call to \fIares_library_init(3)\fP. If there was more than one previous call to \fIares_library_init(3)\fP, this function uninitializes the c-ares library only if it is the call matching the call to \fIares_library_init(3)\fP which initialized the library (usually the very first call to \fIares_library_init(3)\fP). Other calls to \fIares_library_cleanup(3)\fP have no effect other than decrementing an internal counter. .PP This function must be called when the program using c-ares will no longer need any c-ares function. Once the program has called \fIares_library_cleanup(3)\fP sufficiently often such that the library is uninitialised, it shall not make any further call to any c-ares function. .PP This function does not cancel any pending c-ares lookups or requests previously done. Program must use \fIares_cancel(3)\fP for this purpose. .PP .B This function is not thread safe. You have to call it once the program is about to terminate, but this call must be done once the program has terminated every single thread that it could have initiated. This is required to avoid potential race conditions in library deinitialization, and also due to the fact that \fIares_library_cleanup(3)\fP might call functions from other libraries that are thread unsafe, and could conflict with any other thread that is already using these other libraries. .PP Win32/64 application DLLs shall not call \fIares_library_cleanup(3)\fP from the DllMain function. Doing so will produce deadlocks and other problems. .SH AVAILABILITY This function was first introduced in c-ares version 1.7.0 along with the definition of preprocessor symbol \fICARES_HAVE_ARES_LIBRARY_CLEANUP\fP as an indication of the availability of this function. Reference counting in \fIares_library_init()\fP and \fIares_library_cleanup()\fP, which requires calls to the former function to match calls to the latter, is present since c-ares version 1.10.0. Earlier versions would deinitialize the library on the first call to \fIares_library_cleanup()\fP. .PP Since the introduction of this function, it is absolutely mandatory to call it for any Win32/64 program using c-ares. .PP Non-Win32/64 systems can still use c-ares version 1.7.0 without calling \fIares_library_cleanup(3)\fP due to the fact that \fIcurrently\fP it is nearly a do-nothing function on non-Win32/64 platforms. .SH SEE ALSO .BR ares_library_init(3), .BR ares_cancel(3) .SH AUTHOR Yang Tse .PP Copyright 1998 by the Massachusetts Institute of Technology. .br Copyright (C) 2004-2009 by Daniel Stenberg. ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/docs/ares_library_init.30000644000175100001770000001112000000000000022610 0ustar00runnerdocker00000000000000.\" .\" Copyright 1998 by the Massachusetts Institute of Technology. .\" Copyright (C) 2004-2009 by Daniel Stenberg .\" .\" Permission to use, copy, modify, and distribute this .\" software and its documentation for any purpose and without .\" fee is hereby granted, provided that the above copyright .\" notice appear in all copies and that both that copyright .\" notice and this permission notice appear in supporting .\" documentation, and that the name of M.I.T. not be used in .\" advertising or publicity pertaining to distribution of the .\" software without specific, written prior permission. .\" M.I.T. makes no representations about the suitability of .\" this software for any purpose. It is provided "as is" .\" without express or implied warranty. .\" .TH ARES_LIBRARY_INIT 3 "19 May 2009" .SH NAME ares_library_init \- c-ares library initialization .SH SYNOPSIS .nf #include int ares_library_init(int \fIflags\fP) int ares_library_init_mem(int \fIflags\fP, void *(*\fIamalloc\fP)(size_t), void (*\fIafree\fP)(void *ptr), void (*\fIarealloc\fP)(void *ptr, size_t size)) .fi .SH DESCRIPTION .PP The .B ares_library_init function performs initializations internally required by the c-ares library that must take place before any other function provided by c-ares can be used in a program. .PP This function must be called at least once within the life of a program, before the program actually executes any other c-ares library function. Initializations done by this function remain effective until a number of calls to \fIares_library_cleanup(3)\fP equal to the number of calls to this function are performed. .PP Successive calls to this function do nothing further, only the first call done when c-ares is in an uninitialized state is actually effective. .PP The .I flags parameter is a bit pattern that tells c-ares exactly which features should be initialized, as described below. Set the desired bits by ORing the values together. In normal operation you should specify \fIARES_LIB_INIT_ALL\fP. Don't use any other value unless you are familiar with it and trying to control some internal c-ares feature. .PP The .B ares_library_init_mem function allows the caller to provide memory management functions that the c-ares library will be use instead of \fImalloc(3)\fP, \fIfree(3)\fP and \fIrealloc(3)\fP. .PP .B This function is not thread safe. You have to call it once the program has started, but this call must be done before the program starts any other thread. This is required to avoid potential race conditions in library initialization, and also due to the fact that \fIares_library_init(3)\fP might call functions from other libraries that are thread unsafe, and could conflict with any other thread that is already using these other libraries. .PP On Windows platforms, the library user should ensure that \fIWSAStartup()\fP is called before the c-ares library is initialized and used. .PP Win32/64 application DLLs shall not call \fIares_library_init(3)\fP from the DllMain function. Doing so will produce deadlocks and other problems. .SH FLAGS .TP 5 .B ARES_LIB_INIT_ALL Initialize everything possible. This sets all known bits. .TP .B ARES_LIB_INIT_WIN32 Initialize Win32/64 specific libraries. .TP .B ARES_LIB_INIT_NONE Initialize nothing extra. This sets no bit. .SH RETURN VALUE Upon successful completion, ares_library_init() will return 0. Otherwise, a non-zero error number will be returned to indicate the error. Except for \fIares_strerror(3)\fP, you shall not call any other c-ares function upon \fIares_library_init(3)\fP failure. .SH AVAILABILITY This function was first introduced in c-ares version 1.7.0 along with the definition of preprocessor symbol \fICARES_HAVE_ARES_LIBRARY_INIT\fP as an indication of the availability of this function. Its recursive behavior, which requires a matching number of calls to \fIares_library_cleanup()\fP in order to deinitialize the library, is present since c-ares version 1.10.0. Earlier versions would deinitialize the library on the first call to \fIares_library_cleanup()\fP. .PP Since the introduction of this function it is absolutely mandatory to call it for any Win32/64 program using c-ares. .PP Non-Win32/64 systems can still use c-ares version 1.7.0 without calling \fIares_library_init(3)\fP due to the fact that \fIcurrently\fP it is nearly a do-nothing function on non-Win32/64 platforms at this point. .SH SEE ALSO .BR ares_library_cleanup(3), .BR ares_strerror(3) .SH AUTHOR Yang Tse .PP Copyright 1998 by the Massachusetts Institute of Technology. .br Copyright (C) 2004-2009 by Daniel Stenberg. ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/docs/ares_library_init_android.30000644000175100001770000001215100000000000024315 0ustar00runnerdocker00000000000000.\" .\" Copyright (C) 2017 by John Schember .\" .\" Permission to use, copy, modify, and distribute this .\" software and its documentation for any purpose and without .\" fee is hereby granted, provided that the above copyright .\" notice appear in all copies and that both that copyright .\" notice and this permission notice appear in supporting .\" documentation, and that the name of M.I.T. not be used in .\" advertising or publicity pertaining to distribution of the .\" software without specific, written prior permission. .\" M.I.T. makes no representations about the suitability of .\" this software for any purpose. It is provided "as is" .\" without express or implied warranty. .\" .TH ARES_LIBRARY_INIT_ANDROID 3 "13 Sept 2017" .SH NAME ares_library_init_android \- c-ares library Android initialization .SH SYNOPSIS .nf #include int ares_library_init_android(jobject \fIconnectivity_manager\fP) int ares_library_android_initialized(); void ares_library_init_jvm(JavaVM *\fIjvm\fP) .fi .SH DESCRIPTION The \fIares_library_init_android(3)\fP function performs initializations internally required by the c-ares library when used on Android. This can take place anytime after \fIares_library_init(3)\fP. It must take place after \fIares_library_init_jvm\fP. ares_library_init_android must be called before DNS resolution will work on Android 8 (Oreo) or newer when targetSdkVersion is set to 26+. As of Android 8 (API level 26) getting DNS server information has becomei more restrictive and can only be accessed using the Connectivity Manager. It is necessary to pass the connectivity manager to c-ares via JNI. Also, the ACCESS_NETWORK_STATE permission must be present in the Android application. Android older than 8 do not need to to be initialized as they are less restrictive. However, this is a run time not compile time limitation. Proper Android initialization should take place regardless of the targeted Android version. Deinitialization will take place though \fIares_library_cleanup(3)\fP. The \fBares_library_init_jvm\fP function allows the caller to register the JVM with c-ares. It's meant to be called during JNI_OnLoad because you're guaranteed to have the JVM in that function. The JVM is required in order to use the Connectivty Manager registered using \fIares_library_init_android(3)\fP. This must be call before \fIares_library_init_android(3)\fP. The \fBares_library_android_initialized\fP function can be used to check whether c-ares has been initialized for use with Android. .SH RETURN VALUES ARES_SUCCESS will be returned on success otherwise an error code will be returned. .SH THREAD SAFETY .B These init functions are not thread safe. You have to call it once the program has started, but this call must be done before the program starts any other thread. This is required to avoid potential race conditions in library initialization, and also due to the fact these might call functions from other libraries that are thread unsafe, and could conflict with any other thread that is already using these other libraries. .SH JNI Accessing the Connectivity Manager though Java: Register the \fIares_library_android_init\fP. .nf static JNINativeMethod funcs[] = { { "initialize_native", "(Landroid/net/ConnectivityManager;)I", (void *)&ares_library_init_android} }; JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved) { JNIEnv *env = NULL; jclass cls = NULL; jint res; if ((*vm)->GetEnv(vm, (void **)&env, JNI_VERSION_1_6) != JNI_OK) return -1; cls = (*env)->FindClass(env, JNIT_CLASS); if (cls == NULL) return -1; res = (*env)->RegisterNatives(env, cls, funcs, sizeof(funcs)/sizeof(funcs[0])); if (res != 0) return -1; ares_library_init_jvm(vm); return JNI_VERSION_1_6; } .fi Calling the registered function from Java: .nf public class MyObject { static { System.loadLibrary("cares"); } private static native boolean initialize_native(ConnectivityManager connectivity_manager); public static boolean initialize(Context context) { initialize_native((ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE)); } } .fi Initializing the Connectivity Manager in JNI directly using an Android Context. It is assumed the JVM has aleady been registered through \fIJNI_OnLoad\fP. .nf void initialize(jobject android_context) { jclass obj_cls = jni_get_class(env, "android/content/Context"); jmethodID obj_mid = jni_get_method_id(env, obj_cls, "getSystemService", "(Ljava/lang/String;)Ljava/lang/Object;"); jfieldID fid = (*env)->GetStaticFieldID(env, obj_cls, "CONNECTIVITY_SERVICE", "Ljava/lang/String;"); jstring str = (*env)->GetStaticObjectField(env, obj_cls, fid); connectivity_manager = (*env)->CallObjectMethod(env, android_context, obj_mid, str); if (connectivity_manager == NULL) return; ares_library_init_android(connectivity_manager); } .fi .SH AVAILABILITY This function was first introduced in c-ares version 1.15.0. .SH SEE ALSO .BR ares_library_init(3), .BR ares_library_cleanup(3), .SH AUTHOR John Schember .PP Copyright (C) 2017 by John Schember ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/docs/ares_library_initialized.30000644000175100001770000000230200000000000024154 0ustar00runnerdocker00000000000000.\" .\" Copyright (C) 2016 by Daniel Stenberg .\" .\" Permission to use, copy, modify, and distribute this .\" software and its documentation for any purpose and without .\" fee is hereby granted, provided that the above copyright .\" notice appear in all copies and that both that copyright .\" notice and this permission notice appear in supporting .\" documentation, and that the name of M.I.T. not be used in .\" advertising or publicity pertaining to distribution of the .\" software without specific, written prior permission. .\" M.I.T. makes no representations about the suitability of .\" this software for any purpose. It is provided "as is" .\" without express or implied warranty. .\" .TH ARES_LIBRARY_INITIALIZED 3 "29 Sep 2016" .SH NAME ares_library_initialized \- get the initialization state .SH SYNOPSIS .nf #include int ares_library_initialized(void) .fi .SH DESCRIPTION Returns information if c-ares needs to get initialized. .SH RETURN VALUE \fIARES_ENOTINITIALIZED\fP if not initialized and \fIARES_SUCCESS\fP if no initialization is needed. .SH AVAILABILITY This function was first introduced in c-ares version 1.11.0 .SH SEE ALSO .BR ares_library_init(3), .BR ares_library_cleanup(3) ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/docs/ares_mkquery.30000644000175100001770000000534700000000000021634 0ustar00runnerdocker00000000000000.\" .\" Copyright 1998, 2000 by the Massachusetts Institute of Technology. .\" .\" Permission to use, copy, modify, and distribute this .\" software and its documentation for any purpose and without .\" fee is hereby granted, provided that the above copyright .\" notice appear in all copies and that both that copyright .\" notice and this permission notice appear in supporting .\" documentation, and that the name of M.I.T. not be used in .\" advertising or publicity pertaining to distribution of the .\" software without specific, written prior permission. .\" M.I.T. makes no representations about the suitability of .\" this software for any purpose. It is provided "as is" .\" without express or implied warranty. .\" .TH ARES_MKQUERY 3 "20 Nov 2009" .SH NAME ares_mkquery \- Compose a single-question DNS query buffer .SH SYNOPSIS .nf .B #include .PP .B int ares_mkquery(const char *\fIname\fP, int \fIdnsclass\fP, int \fItype\fP, .B unsigned short \fIid\fP, int \fIrd\fP, unsigned char **\fIbuf\fP, .B int *\fIbuflen\fP) .fi .SH DESCRIPTION Deprecated function. See \fIares_create_query(3)\fP instead! The .B ares_mkquery function composes a DNS query with a single question. The parameter .I name gives the query name as a NUL-terminated C string of period-separated labels optionally ending with a period; periods and backslashes within a label must be escaped with a backlash. The parameters .I dnsclass and .I type give the class and type of the query using the values defined in .BR . The parameter .I id gives a 16-bit identifier for the query. The parameter .I rd should be nonzero if recursion is desired, zero if not. The query will be placed in an allocated buffer, a pointer to which will be stored in the variable pointed to by .IR buf , and the length of which will be stored in the variable pointed to by .IR buflen . It is the caller's responsibility to free this buffer using \fIares_free_string(3)\fP when it is no longer needed. Usage of \fIares_mkquery(3)\fP is deprecated, whereas the function is equivalent to \fIares_create_query(3)\fP with \fBmax_udp_size\fP set to 0. .SH RETURN VALUES .B ares_mkquery can return any of the following values: .TP 15 .B ARES_SUCCESS Construction of the DNS query succeeded. .TP 15 .B ARES_ENOTFOUND The query name .I name refers to a .I .onion domain name. See RFC 7686. .TP 15 .B ARES_EBADNAME The query name .I name could not be encoded as a domain name, either because it contained a zero-length label or because it contained a label of more than 63 characters. .TP 15 .B ARES_ENOMEM Memory was exhausted. .SH SEE ALSO .BR ares_expand_name (3), .BR ares_free_string (3) .SH AUTHOR Greg Hudson, MIT Information Systems .br Copyright 1998, 2000 by the Massachusetts Institute of Technology. ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/docs/ares_parse_a_reply.30000644000175100001770000000452700000000000022763 0ustar00runnerdocker00000000000000.\" .\" Copyright 1998 by the Massachusetts Institute of Technology. .\" .\" Permission to use, copy, modify, and distribute this .\" software and its documentation for any purpose and without .\" fee is hereby granted, provided that the above copyright .\" notice appear in all copies and that both that copyright .\" notice and this permission notice appear in supporting .\" documentation, and that the name of M.I.T. not be used in .\" advertising or publicity pertaining to distribution of the .\" software without specific, written prior permission. .\" M.I.T. makes no representations about the suitability of .\" this software for any purpose. It is provided "as is" .\" without express or implied warranty. .\" .TH ARES_PARSE_A_REPLY 3 "25 July 1998" .SH NAME ares_parse_a_reply \- Parse a reply to a DNS query of type A .SH SYNOPSIS .nf .B #include .PP .B int ares_parse_a_reply(const unsigned char *\fIabuf\fP, int \fIalen\fP, .B struct hostent **\fIhost\fP, .B struct ares_addrttl *\fIaddrttls\fP, int *\fInaddrttls\fP); .fi .SH DESCRIPTION The .B ares_parse_a_reply function parses the response to a query of type A into a .BR "struct hostent" and/or an array of .BR "struct ares_addrttls" . The parameters .I abuf and .I alen give the contents of the response. The result is stored in allocated memory and a pointer to it stored into the variable pointed to by .IR host , if host is nonnull. It is the caller's responsibility to free the resulting host structure using .BR ares_free_hostent (3) when it is no longer needed. .PP If .IR addrttls and .IR naddrttls are both nonnull, then up to *naddrttls .BR "struct ares_addrttl" records are stored in the array pointed to by addrttls, and then *naddrttls is set to the number of records so stored. Note that the memory for these records is supplied by the caller. .SH RETURN VALUES .B ares_parse_a_reply can return any of the following values: .TP 15 .B ARES_SUCCESS The response was successfully parsed. .TP 15 .B ARES_EBADRESP The response was malformatted. .TP 15 .B ARES_ENODATA The response did not contain an answer to the query. .TP 15 .B ARES_ENOMEM Memory was exhausted. .SH SEE ALSO .BR ares_gethostbyname (3), .BR ares_free_hostent (3) .SH AUTHOR Greg Hudson, MIT Information Systems .br Andrew Selivanov .br Copyright 1998 by the Massachusetts Institute of Technology. ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/docs/ares_parse_aaaa_reply.30000644000175100001770000000445500000000000023426 0ustar00runnerdocker00000000000000.\" .\" Copyright 2005 by Dominick Meglio. .\" .\" Permission to use, copy, modify, and distribute this .\" software and its documentation for any purpose and without .\" fee is hereby granted, provided that the above copyright .\" notice appear in all copies and that both that copyright .\" notice and this permission notice appear in supporting .\" documentation, and that the name of M.I.T. not be used in .\" advertising or publicity pertaining to distribution of the .\" software without specific, written prior permission. .\" M.I.T. makes no representations about the suitability of .\" this software for any purpose. It is provided "as is" .\" without express or implied warranty. .\" .TH ARES_PARSE_AAAA_REPLY 3 "20 Nov 2009" .SH NAME ares_parse_aaaa_reply \- Parse a reply to a DNS query of type AAAA .SH SYNOPSIS .nf .B #include .PP .B int ares_parse_aaaa_reply(const unsigned char *\fIabuf\fP, int \fIalen\fP, .B struct hostent **\fIhost\fP, .B struct ares_addr6ttl *\fIaddrttls\fP, int *\fInaddrttls\fP); .fi .SH DESCRIPTION The .B ares_parse_aaaa_reply function parses the response to a query of type AAAA into a .BR "struct hostent" and/or an array of .BR "struct ares_addr6ttl" . The parameters .I abuf and .I alen give the contents of the response. The result is stored in allocated memory and a pointer to it stored into the variable pointed to by .IR host , if host is nonnull. It is the caller's responsibility to free the resulting host structure using .BR ares_free_hostent (3) when it is no longer needed. .PP If .IR addrttls and .IR naddrttls are both nonnull, then up to *naddrttls .BR "struct ares_addr6ttl" records are stored in the array pointed to by addrttls, and then *naddrttls is set to the number of records so stored. Note that the memory for these records is supplied by the caller. .SH RETURN VALUES .B ares_parse_aaaa_reply can return any of the following values: .TP 15 .B ARES_SUCCESS The response was successfully parsed. .TP 15 .B ARES_EBADRESP The response was malformatted. .TP 15 .B ARES_ENODATA The response did not contain an answer to the query. .TP 15 .B ARES_ENOMEM Memory was exhausted. .SH SEE ALSO .BR ares_gethostbyname (3), .BR ares_free_hostent (3) .SH AUTHOR Dominick Meglio .br Copyright 2005 by Dominick Meglio. .BR Andrew Selivanov ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/docs/ares_parse_caa_reply.30000644000175100001770000001075200000000000023264 0ustar00runnerdocker00000000000000.\" .\" Copyright 2020 Danny Sonnenschein .\" .\" Permission to use, copy, modify, and distribute this .\" software and its documentation for any purpose and without .\" fee is hereby granted, provided that the above copyright .\" notice appear in all copies and that both that copyright .\" notice and this permission notice appear in supporting .\" documentation, and that the name of M.I.T. not be used in .\" advertising or publicity pertaining to distribution of the .\" software without specific, written prior permission. .\" M.I.T. makes no representations about the suitability of .\" this software for any purpose. It is provided "as is" .\" without express or implied warranty. .\" .TH ARES_PARSE_CAA_REPLY 3 "16 September 2020" .SH NAME ares_parse_caa_reply \- Parse a reply to a DNS query of type CAA .SH SYNOPSIS .nf #include int ares_parse_caa_reply(const unsigned char* \fIabuf\fP, int \fIalen\fP, struct ares_caa_reply **\fIcaa_out\fP); .fi .SH DESCRIPTION The .BR "ares_parse_caa_reply" function parses the response to a query of type CAA into a linked list (one element per sub-string) of .IR "struct ares_caa_reply" The parameters .I abuf and .I alen give the contents of the response. The result is stored in allocated memory and a pointer to it stored into the variable pointed to by .IR caa_out . It is the caller's responsibility to free the resulting .IR caa_out structure when it is no longer needed using the function .B ares_free_data(3) .PP The structure .I ares_caa_reply(3) contains the following fields: .sp .in +4n .nf struct ares_caa_reply { struct ares_caa_reply *next; int critical; unsigned char *property; size_t plength; /* plength excludes null */ unsigned char *value; size_t length; /* length excludes null */ }; .fi .in .PP .SH RETURN VALUES .BR "ares_parse_caa_reply" can return any of the following values: .TP 15 .B ARES_SUCCESS The response was successfully parsed. .TP 15 .B ARES_EBADRESP The response was malformatted. .TP 15 .B ARES_ENODATA The response did not contain an answer to the query. .TP 15 .B ARES_ENOMEM Memory was exhausted. .SH EXAMPLE .nf #include #include #include #include #include #include #include #include "ares.h" static void dns_callback(void *arg, int status, int timeouts, unsigned char *abuf, int alen) { struct ares_caa_reply *caa_out; int err; err = ares_parse_caa_reply (abuf, alen, &caa_out); if (err == ARES_SUCCESS) { struct ares_caa_reply *caa_curr; for (caa_curr=caa_out; caa_curr; caa_curr=caa_curr->next) printf ("%s. CAA %i %s \\"%s\\"\\n", arg, caa_curr->critical, caa_curr->property, caa_curr->value); } else { printf ("err=%i\\n", err); } ares_free_data (caa_out); } static void main_loop(ares_channel *channel) { 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); } } int main(int argc, char **argv) { const char *sversion; int iversion; int err; sversion = ares_version (&iversion); printf ("c-ares version %s\\n", sversion); char *domain = "wikipedia.org"; if (argc > 1) domain = argv[1]; ares_channel channel; if ((err = ares_init (&channel)) != ARES_SUCCESS) { printf ("ares_init() failed (%i)\\n", err); exit (EXIT_FAILURE); } ares_query (channel, domain, 1, /* ns_c_in */ 257, /* T_CAA */ dns_callback, domain); main_loop (&channel); ares_destroy (channel); exit (EXIT_SUCCESS); } .fi .SH AVAILABILITY This function was first introduced in c-ares version 1.17.0. .SH SEE ALSO .BR ares_query (3) .BR ares_free_data (3) .SH AUTHOR Written by Danny Sonnenschein , on behalf of platynum, https://platynum.ch ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/docs/ares_parse_mx_reply.30000644000175100001770000000421600000000000023162 0ustar00runnerdocker00000000000000.\" .\" Copyright 1998 by the Massachusetts Institute of Technology. .\" .\" Permission to use, copy, modify, and distribute this .\" software and its documentation for any purpose and without .\" fee is hereby granted, provided that the above copyright .\" notice appear in all copies and that both that copyright .\" notice and this permission notice appear in supporting .\" documentation, and that the name of M.I.T. not be used in .\" advertising or publicity pertaining to distribution of the .\" software without specific, written prior permission. .\" M.I.T. makes no representations about the suitability of .\" this software for any purpose. It is provided "as is" .\" without express or implied warranty. .\" .TH ARES_PARSE_MX_REPLY 3 "4 August 2009" .SH NAME ares_parse_mx_reply \- Parse a reply to a DNS query of type MX .SH SYNOPSIS .nf .B #include .PP .B int ares_parse_mx_reply(const unsigned char* \fIabuf\fP, int \fIalen\fP, .B struct ares_mx_reply** \fImx_out\fP); .fi .SH DESCRIPTION The .B ares_parse_mx_reply function parses the response to a query of type MX into a linked list of .I struct ares_mx_reply The parameters .I abuf and .I alen give the contents of the response. The result is stored in allocated memory and a pointer to it stored into the variable pointed to by .IR mx_out . It is the caller's responsibility to free the resulting .IR mx_out structure when it is no longer needed using the function .B ares_free_data .PP The structure .I ares_mx_reply contains the following fields: .sp .in +4n .nf struct ares_mx_reply { struct ares_mx_reply *next; char *host; unsigned short priority; }; .fi .in .PP .SH RETURN VALUES .B ares_parse_mx_reply can return any of the following values: .TP 15 .B ARES_SUCCESS The response was successfully parsed. .TP 15 .B ARES_EBADRESP The response was malformatted. .TP 15 .B ARES_ENODATA The response did not contain an answer to the query. .TP 15 .B ARES_ENOMEM Memory was exhausted. .SH AVAILABILITY This function was first introduced in c-ares version 1.7.2. .SH SEE ALSO .BR ares_query (3) .BR ares_free_data (3) .SH AUTHOR Written by Jeremy Lal ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/docs/ares_parse_naptr_reply.30000644000175100001770000000454600000000000023670 0ustar00runnerdocker00000000000000.\" .\" Copyright 1998 by the Massachusetts Institute of Technology. .\" .\" Permission to use, copy, modify, and distribute this .\" software and its documentation for any purpose and without .\" fee is hereby granted, provided that the above copyright .\" notice appear in all copies and that both that copyright .\" notice and this permission notice appear in supporting .\" documentation, and that the name of M.I.T. not be used in .\" advertising or publicity pertaining to distribution of the .\" software without specific, written prior permission. .\" M.I.T. makes no representations about the suitability of .\" this software for any purpose. It is provided "as is" .\" without express or implied warranty. .\" .TH ARES_PARSE_NAPTR_REPLY 3 "23 February 2012" .SH NAME ares_parse_naptr_reply \- Parse a reply to a DNS query of type NAPTR .SH SYNOPSIS .nf .B #include .PP .B int ares_parse_naptr_reply(const unsigned char* \fIabuf\fP, int \fIalen\fP, .B struct ares_naptr_reply** \fInaptr_out\fP); .fi .SH DESCRIPTION The .B ares_parse_naptr_reply function parses the response to a query of type NAPTR into a linked list of .I struct ares_naptr_reply The parameters .I abuf and .I alen give the contents of the response. The result is stored in allocated memory and a pointer to it stored into the variable pointed to by .IR naptr_out . It is the caller's responsibility to free the resulting .IR naptr_out structure when it is no longer needed using the function .B ares_free_data .PP The structure .I ares_naptr_reply contains the following fields: .sp .in +4n .nf struct ares_naptr_reply { struct ares_naptr_reply *next; unsigned char *flags; unsigned char *service; unsigned char *regexp; char *replacement; unsigned short order; unsigned short preference; }; .fi .in .PP .SH RETURN VALUES .B ares_parse_naptr_reply can return any of the following values: .TP 15 .B ARES_SUCCESS The response was successfully parsed. .TP 15 .B ARES_EBADRESP The response was malformatted. .TP 15 .B ARES_ENODATA The response did not contain an answer to the query. .TP 15 .B ARES_ENOMEM Memory was exhausted. .SH AVAILABILITY This function was first introduced in c-ares version 1.7.6. .SH SEE ALSO .BR ares_query (3) .BR ares_free_data (3) .SH AUTHOR Written by Jakub Hrozek , on behalf of Red Hat, Inc http://www.redhat.com ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/docs/ares_parse_ns_reply.30000644000175100001770000000374400000000000023163 0ustar00runnerdocker00000000000000.\" .\" Copyright 1998 by the Massachusetts Institute of Technology. .\" .\" Permission to use, copy, modify, and distribute this .\" software and its documentation for any purpose and without .\" fee is hereby granted, provided that the above copyright .\" notice appear in all copies and that both that copyright .\" notice and this permission notice appear in supporting .\" documentation, and that the name of M.I.T. not be used in .\" advertising or publicity pertaining to distribution of the .\" software without specific, written prior permission. .\" M.I.T. makes no representations about the suitability of .\" this software for any purpose. It is provided "as is" .\" without express or implied warranty. .\" .TH ARES_PARSE_NS_REPLY 3 "10 February 2007" .SH NAME ares_parse_ns_reply \- Parse a reply to a DNS query of type NS into a hostent .SH SYNOPSIS .nf .B #include .PP .B int ares_parse_ns_reply(const unsigned char *\fIabuf\fP, int \fIalen\fP, .B struct hostent **\fIhost\fP); .fi .SH DESCRIPTION The .B ares_parse_ns_reply function parses the response to a query of type NS into a .BR "struct hostent" . The parameters .I abuf and .I alen give the contents of the response. The result is stored in allocated memory and a pointer to it stored into the variable pointed to by .IR host . The nameservers are stored into the .BR aliases field of the .IR host structure. It is the caller's responsibility to free the resulting host structure using .BR ares_free_hostent (3) when it is no longer needed. .SH RETURN VALUES .B ares_parse_ns_reply can return any of the following values: .TP 15 .B ARES_SUCCESS The response was successfully parsed. .TP 15 .B ARES_EBADRESP The response was malformatted. .TP 15 .B ARES_ENODATA The response did not contain an answer to the query. .TP 15 .B ARES_ENOMEM Memory was exhausted. .SH SEE ALSO .BR ares_query (3), .BR ares_free_hostent (3) .SH AUTHOR Written by Vlad Dinulescu , on behalf of AVIRA Gmbh http://www.avira.com ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/docs/ares_parse_ptr_reply.30000644000175100001770000000427000000000000023343 0ustar00runnerdocker00000000000000.\" .\" Copyright 1998 by the Massachusetts Institute of Technology. .\" .\" Permission to use, copy, modify, and distribute this .\" software and its documentation for any purpose and without .\" fee is hereby granted, provided that the above copyright .\" notice appear in all copies and that both that copyright .\" notice and this permission notice appear in supporting .\" documentation, and that the name of M.I.T. not be used in .\" advertising or publicity pertaining to distribution of the .\" software without specific, written prior permission. .\" M.I.T. makes no representations about the suitability of .\" this software for any purpose. It is provided "as is" .\" without express or implied warranty. .\" .TH ARES_PARSE_PTR_REPLY 3 "25 July 1998" .SH NAME ares_parse_ptr_reply \- Parse a reply to a DNS query of type PTR into a hostent .SH SYNOPSIS .nf .B #include .PP .B int ares_parse_ptr_reply(const unsigned char *\fIabuf\fP, int \fIalen\fP, .B const void *\fIaddr\fP, int \fIaddrlen\fP, int \fIfamily\fP, .B struct hostent **\fIhost\fP); .fi .SH DESCRIPTION The .B ares_parse_ptr_reply function parses the response to a query of type PTR into a .BR "struct hostent" . The parameters .I abuf and .I alen give the contents of the response. The parameters .IR addr , .IR addrlen , and .I family specify which address was queried for; they are not used to verify the response, merely used to fill in the address of the .BR "struct hostent" . The resulting .B struct hostent is stored in allocated memory and a pointer to it stored into the variable pointed to by .IR host . It is the caller's responsibility to free the resulting host structure using .BR ares_free_hostent (3) when it is no longer needed. .SH RETURN VALUES .B ares_parse_ptr_reply can return any of the following values: .TP 15 .B ARES_SUCCESS The response was successfully parsed. .TP 15 .B ARES_EBADRESP The response was malformatted. .TP 15 .B ARES_ENODATA The response did not contain an answer to the query. .TP 15 .B ARES_ENOMEM Memory was exhausted. .SH SEE ALSO .BR ares_gethostbyaddr (3), .BR ares_free_hostent (3) .SH AUTHOR Greg Hudson, MIT Information Systems .br Copyright 1998 by the Massachusetts Institute of Technology. ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/docs/ares_parse_soa_reply.30000644000175100001770000000420600000000000023317 0ustar00runnerdocker00000000000000.\" .\" Copyright 1998 by the Massachusetts Institute of Technology. .\" .\" Permission to use, copy, modify, and distribute this .\" software and its documentation for any purpose and without .\" fee is hereby granted, provided that the above copyright .\" notice appear in all copies and that both that copyright .\" notice and this permission notice appear in supporting .\" documentation, and that the name of M.I.T. not be used in .\" advertising or publicity pertaining to distribution of the .\" software without specific, written prior permission. .\" M.I.T. makes no representations about the suitability of .\" this software for any purpose. It is provided "as is" .\" without express or implied warranty. .\" .TH ARES_PARSE_SOA_REPLY 3 "29 May 2012" .SH NAME ares_parse_soa_reply \- Parse a reply to a DNS query of type SOA .SH SYNOPSIS .nf .B #include .PP .B int ares_parse_soa_reply(const unsigned char* \fIabuf\fP, int \fIalen\fP, .B struct ares_soa_reply** \fIsoa_out\fP); .fi .SH DESCRIPTION The .B ares_parse_soa_reply function parses the response to a query of type SOA into a .IR struct\ ares_soa_reply . The parameters .I abuf and .I alen give the contents of the response. The result is stored in allocated memory and a pointer to it stored into the variable pointed to by .IR soa_out . It is the caller's responsibility to free the resulting .IR soa_out structure when it is no longer needed using the function .B ares_free_data .PP The structure .I ares_soa_reply contains the following fields: .sp .in +4n .nf struct ares_soa_reply { char *nsname; char *hostmaster; unsigned int serial; unsigned int refresh; unsigned int retry; unsigned int expire; unsigned int minttl; }; .fi .in .PP .SH RETURN VALUES .B ares_parse_soa_reply can return any of the following values: .TP 15 .B ARES_SUCCESS The response was successfully parsed. .TP 15 .B ARES_EBADRESP The response was malformatted. .TP 15 .B ARES_ENODATA The response did not contain an answer to the query. .TP 15 .B ARES_ENOMEM Memory was exhausted. .SH AVAILABILITY This function was first introduced in c-ares version 1.9.0. .SH SEE ALSO .BR ares_query (3) .BR ares_free_data (3) ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/docs/ares_parse_srv_reply.30000644000175100001770000000440600000000000023351 0ustar00runnerdocker00000000000000.\" .\" Copyright 1998 by the Massachusetts Institute of Technology. .\" .\" Permission to use, copy, modify, and distribute this .\" software and its documentation for any purpose and without .\" fee is hereby granted, provided that the above copyright .\" notice appear in all copies and that both that copyright .\" notice and this permission notice appear in supporting .\" documentation, and that the name of M.I.T. not be used in .\" advertising or publicity pertaining to distribution of the .\" software without specific, written prior permission. .\" M.I.T. makes no representations about the suitability of .\" this software for any purpose. It is provided "as is" .\" without express or implied warranty. .\" .TH ARES_PARSE_SRV_REPLY 3 "4 August 2009" .SH NAME ares_parse_srv_reply \- Parse a reply to a DNS query of type SRV .SH SYNOPSIS .nf .B #include .PP .B int ares_parse_srv_reply(const unsigned char* \fIabuf\fP, int \fIalen\fP, .B struct ares_srv_reply** \fIsrv_out\fP); .fi .SH DESCRIPTION The .B ares_parse_srv_reply function parses the response to a query of type SRV into a linked list of .I struct ares_srv_reply The parameters .I abuf and .I alen give the contents of the response. The result is stored in allocated memory and a pointer to it stored into the variable pointed to by .IR srv_out . It is the caller's responsibility to free the resulting .IR srv_out structure when it is no longer needed using the function .B ares_free_data .PP The structure .I ares_srv_reply contains the following fields: .sp .in +4n .nf struct ares_srv_reply { struct ares_srv_reply *next; unsigned short weight; unsigned short priority; unsigned short port; char *host; }; .fi .in .PP .SH RETURN VALUES .B ares_parse_srv_reply can return any of the following values: .TP 15 .B ARES_SUCCESS The response was successfully parsed. .TP 15 .B ARES_EBADRESP The response was malformatted. .TP 15 .B ARES_ENODATA The response did not contain an answer to the query. .TP 15 .B ARES_ENOMEM Memory was exhausted. .SH AVAILABILITY This function was first introduced in c-ares version 1.7.0. .SH SEE ALSO .BR ares_query (3) .BR ares_free_data (3) .SH AUTHOR Written by Jakub Hrozek , on behalf of Red Hat, Inc http://www.redhat.com ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/docs/ares_parse_txt_reply.30000644000175100001770000000664600000000000023366 0ustar00runnerdocker00000000000000.\" .\" Copyright 1998 by the Massachusetts Institute of Technology. .\" .\" Permission to use, copy, modify, and distribute this .\" software and its documentation for any purpose and without .\" fee is hereby granted, provided that the above copyright .\" notice appear in all copies and that both that copyright .\" notice and this permission notice appear in supporting .\" documentation, and that the name of M.I.T. not be used in .\" advertising or publicity pertaining to distribution of the .\" software without specific, written prior permission. .\" M.I.T. makes no representations about the suitability of .\" this software for any purpose. It is provided "as is" .\" without express or implied warranty. .\" .TH ARES_PARSE_TXT_REPLY 3 "27 October 2009" .SH NAME ares_parse_txt_reply \- Parse a reply to a DNS query of type TXT .SH SYNOPSIS .nf .B #include .PP .B int ares_parse_txt_reply(const unsigned char* \fIabuf\fP, int \fIalen\fP, .B struct ares_txt_reply **\fItxt_out\fP); .PP .B int ares_parse_txt_reply_ext(const unsigned char* \fIabuf\fP, int \fIalen\fP, .B struct ares_txt_ext **\fItxt_out\fP); .fi .SH DESCRIPTION The .BR "ares_parse_txt_reply" " (" "ares_parse_txt_reply_ext" ")" function parses the response to a query of type TXT into a linked list (one element per sub-string) of .IR "struct ares_txt_reply" " (" "struct ares_txt_ext" ")" The parameters .I abuf and .I alen give the contents of the response. The result is stored in allocated memory and a pointer to it stored into the variable pointed to by .IR txt_out . It is the caller's responsibility to free the resulting .IR txt_out structure when it is no longer needed using the function .B ares_free_data .PP The structure .I ares_txt_reply contains the following fields: .sp .in +4n .nf struct ares_txt_reply { struct ares_txt_reply *next; unsigned int length; unsigned char *txt; }; .fi .in .PP The structure .I ares_txt_ext contains the following fields: .sp .in +4n .nf struct ares_txt_ext { struct ares_txt_ext *next; unsigned int length; unsigned char *txt; unsigned char record_start; }; .fi .in .PP The .I record_start field in .I struct ares_txt_ext is 1 if this structure is a start of a TXT record, and 0 if the structure is a continuation of a previous record. The linked list of the .I struct ares_txt_ext will have at least one item with .I record_start equal to 1, and may have some items with .I record_start equal to 0 between them. .PP These sequences of .I struct ares_txt_ext (starting from the item with .I record_start equal to 1, and ending right before the record start item) may be treated as either components of a single TXT record or as a multi-parted TXT record, depending on particular use case. .PP .SH RETURN VALUES .BR "ares_parse_txt_reply" " (" "ares_parse_txt_reply_ext" ")" can return any of the following values: .TP 15 .B ARES_SUCCESS The response was successfully parsed. .TP 15 .B ARES_EBADRESP The response was malformatted. .TP 15 .B ARES_ENODATA The response did not contain an answer to the query. .TP 15 .B ARES_ENOMEM Memory was exhausted. .SH AVAILABILITY This function was first introduced in c-ares version 1.7.0. .SH SEE ALSO .BR ares_query (3) .BR ares_free_data (3) .SH AUTHOR Written by Jakub Hrozek , on behalf of Red Hat, Inc http://www.redhat.com .PP Amended by Fedor Indutny , on behalf of PayPal, Inc https://www.paypal.com ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/docs/ares_parse_uri_reply.30000644000175100001770000000433100000000000023333 0ustar00runnerdocker00000000000000.\" .\" Copyright 1998 by the Massachusetts Institute of Technology. .\" .\" Permission to use, copy, modify, and distribute this .\" software and its documentation for any purpose and without .\" fee is hereby granted, provided that the above copyright .\" notice appear in all copies and that both that copyright .\" notice and this permission notice appear in supporting .\" documentation, and that the name of M.I.T. not be used in .\" advertising or publicity pertaining to distribution of the .\" software without specific, written prior permission. .\" M.I.T. makes no representations about the suitability of .\" this software for any purpose. It is provided "as is" .\" without express or implied warranty. .\" .TH ARES_PARSE_URI_REPLY 3 "14 August 2020" .SH NAME ares_parse_uri_reply \- Parse a reply to a DNS query of type URI .SH SYNOPSIS .nf .B #include .PP .B int ares_parse_uri_reply(const unsigned char* \fIabuf\fP, int \fIalen\fP, .B struct ares_uri_reply** \fIuri_out\fP); .fi .SH DESCRIPTION The .B ares_parse_uri_reply function parses the response to a query of type URI into a linked list of .I struct ares_uri_reply The parameters .I abuf and .I alen give the contents of the response. The result is stored in allocated memory and a pointer to it stored into the variable pointed to by .IR uri_out . It is the caller's responsibility to free the resulting .IR uri_out structure when it is no longer needed using the function .B ares_free_data .PP The structure .I ares_uri_reply contains the following fields: .sp .in +4n .nf struct ares_uri_reply { struct ares_uri_reply *next; unsigned short weight; unsigned short priority; char *uri; int ttl; }; .fi .in .PP .SH RETURN VALUES .B ares_parse_uri_reply can return any of the following values: .TP 15 .B ARES_SUCCESS The response was successfully parsed. .TP 15 .B ARES_EBADRESP The response was malformatted. .TP 15 .B ARES_ENODATA The response did not contain an answer to the query. .TP 15 .B ARES_ENOMEM Memory was exhausted. .SH AVAILABILITY .SH SEE ALSO .BR ares_query (3) .BR ares_free_data (3) .SH AUTHOR Written by Jan Petrasek ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/docs/ares_process.30000644000175100001770000000565700000000000021621 0ustar00runnerdocker00000000000000.\" .\" Copyright 1998 by the Massachusetts Institute of Technology. .\" .\" Permission to use, copy, modify, and distribute this .\" software and its documentation for any purpose and without .\" fee is hereby granted, provided that the above copyright .\" notice appear in all copies and that both that copyright .\" notice and this permission notice appear in supporting .\" documentation, and that the name of M.I.T. not be used in .\" advertising or publicity pertaining to distribution of the .\" software without specific, written prior permission. .\" M.I.T. makes no representations about the suitability of .\" this software for any purpose. It is provided "as is" .\" without express or implied warranty. .\" .TH ARES_PROCESS 3 "25 July 1998" .SH NAME ares_process \- Process events for name resolution .SH SYNOPSIS .nf #include void ares_process(ares_channel \fIchannel\fP, fd_set *\fIread_fds\fP, fd_set *\fIwrite_fds\fP) void ares_process_fd(ares_channel \fIchannel\fP, ares_socket_t \fIread_fd\fP, ares_socket_t \fIwrite_fd\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 void \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: .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) .SH AUTHOR Greg Hudson, MIT Information Systems .br Copyright 1998 by the Massachusetts Institute of Technology. ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/docs/ares_query.30000644000175100001770000001033600000000000021276 0ustar00runnerdocker00000000000000.\" .\" Copyright 1998 by the Massachusetts Institute of Technology. .\" .\" Permission to use, copy, modify, and distribute this .\" software and its documentation for any purpose and without .\" fee is hereby granted, provided that the above copyright .\" notice appear in all copies and that both that copyright .\" notice and this permission notice appear in supporting .\" documentation, and that the name of M.I.T. not be used in .\" advertising or publicity pertaining to distribution of the .\" software without specific, written prior permission. .\" M.I.T. makes no representations about the suitability of .\" this software for any purpose. It is provided "as is" .\" without express or implied warranty. .\" .TH ARES_QUERY 3 "24 July 1998" .SH NAME ares_query \- Initiate a single-question DNS query .SH SYNOPSIS .nf .B #include .PP .B typedef void (*ares_callback)(void *\fIarg\fP, int \fIstatus\fP, .B int \fItimeouts\fP, unsigned char *\fIabuf\fP, int \fIalen\fP) .PP .B void ares_query(ares_channel \fIchannel\fP, const char *\fIname\fP, .B int \fIdnsclass\fP, int \fItype\fP, ares_callback \fIcallback\fP, .B void *\fIarg\fP) .fi .SH DESCRIPTION The .B ares_query function initiates a single-question DNS query on the name service channel identified by .IR channel . The parameter .I name gives the query name as a NUL-terminated C string of period-separated labels optionally ending with a period; periods and backslashes within a label must be escaped with a backslash. The parameters .I dnsclass and .I type give the class and type of the query using the values defined in .BR . When the query is complete or has failed, the ares library will invoke .IR callback . Completion or failure of the query may happen immediately, or may happen during a later call to .BR ares_process (3) or .BR ares_destroy (3). .PP The callback argument .I arg is copied from the .B ares_query argument .IR arg . The callback argument .I status indicates whether the query succeeded and, if not, how it failed. It may have any of the following values: .TP 19 .B ARES_SUCCESS The query completed successfully. .TP 19 .B ARES_ENODATA The query completed but contains no answers. .TP 19 .B ARES_EFORMERR The query completed but the server claims that the query was malformatted. .TP 19 .B ARES_ESERVFAIL The query completed but the server claims to have experienced a failure. (This code can only occur if the .B ARES_FLAG_NOCHECKRESP flag was specified at channel initialization time; otherwise, such responses are ignored at the .BR ares_send (3) level.) .TP 19 .B ARES_ENOTFOUND The query completed but the queried-for domain name was not found. .TP 19 .B ARES_ENOTIMP The query completed but the server does not implement the operation requested by the query. (This code can only occur if the .B ARES_FLAG_NOCHECKRESP flag was specified at channel initialization time; otherwise, such responses are ignored at the .BR ares_send (3) level.) .TP 19 .B ARES_EREFUSED The query completed but the server refused the query. (This code can only occur if the .B ARES_FLAG_NOCHECKRESP flag was specified at channel initialization time; otherwise, such responses are ignored at the .BR ares_send (3) level.) .TP 19 .B ARES_EBADNAME The query name .I name could not be encoded as a domain name, either because it contained a zero-length label or because it contained a label of more than 63 characters. .TP 19 .B ARES_ETIMEOUT No name servers responded within the timeout period. .TP 19 .B ARES_ECONNREFUSED No name servers could be contacted. .TP 19 .B ARES_ENOMEM Memory was exhausted. .TP 19 .B ARES_ECANCELLED The query was cancelled. .TP 19 .B ARES_EDESTRUCTION The name service channel .I channel is being destroyed; the query will not be completed. .PP The callback argument .I timeouts reports how many times a query timed out during the execution of the given request. .PP If the query completed (even if there was something wrong with it, as indicated by some of the above error codes), the callback argument .I abuf points to a result buffer of length .IR alen . If the query did not complete, .I abuf will be NULL and .I alen will be 0. .SH SEE ALSO .BR ares_process (3) .SH AUTHOR Greg Hudson, MIT Information Systems .br Copyright 1998 by the Massachusetts Institute of Technology. ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/docs/ares_save_options.30000644000175100001770000000522300000000000022641 0ustar00runnerdocker00000000000000.\" .\" Copyright 1998 by the Massachusetts Institute of Technology. .\" .\" Permission to use, copy, modify, and distribute this .\" software and its documentation for any purpose and without .\" fee is hereby granted, provided that the above copyright .\" notice appear in all copies and that both that copyright .\" notice and this permission notice appear in supporting .\" documentation, and that the name of M.I.T. not be used in .\" advertising or publicity pertaining to distribution of the .\" software without specific, written prior permission. .\" M.I.T. makes no representations about the suitability of .\" this software for any purpose. It is provided "as is" .\" without express or implied warranty. .\" .TH ARES_SAVE_OPTIONS 3 "5 March 2010" .SH NAME ares_save_options \- Save configuration values obtained from initialized ares_channel .SH SYNOPSIS .nf .B #include .PP .B int ares_save_options(ares_channel \fIchannel\fP, struct ares_options *\fIoptions\fP, int *\fIoptmask\fP) .fi .SH DESCRIPTION The \fBares_save_options(3)\fP function saves the channel data identified by .IR channel , into the options struct identified by .IR options , and saves the mask of options which are set to the integer pointer (passed by reference) identified by .IR optmask . The resultant options and optmask are then able to be passed directly to ares_init_options. When the options are no longer needed, ares_destroy_options should be called to free any associated memory. .SH RETURN VALUES .B ares_save_options(3) can return any of the following values: .TP 15 .B ARES_SUCCESS The channel data was successfully stored .TP 15 .B ARES_ENOMEM The memory was exhausted .TP 15 .B ARES_ENODATA The channel data identified by .IR channel were invalid. .SH NOTE Since c-ares 1.6.0 the ares_options struct has been "locked" meaning that it won't be extended to cover new functions. This function will remain functioning, but it can only return config data that can be represented in this config struct, which may no longer be the complete set of config options. \fBares_dup(3)\fP will not have that restriction. The ares_options struct can not handle potential IPv6 name servers the ares_channel might be configured to use. The \fBares_save_options(3)\fP function will only return IPv4 servers, if any. In order to retrieve all name servers an ares_channel might be using, the \fBares_get_servers(3)\fP function must be used instead. .SH SEE ALSO .BR ares_destroy_options (3), .BR ares_init_options (3), .BR ares_get_servers (3), .BR ares_dup (3) .SH AVAILABILITY ares_save_options(3) was added in c-ares 1.4.0 .SH AUTHOR Brad House .br Copyright 1998 by the Massachusetts Institute of Technology. ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/docs/ares_search.30000644000175100001770000001110300000000000021367 0ustar00runnerdocker00000000000000.\" .\" Copyright 1998 by the Massachusetts Institute of Technology. .\" .\" Permission to use, copy, modify, and distribute this .\" software and its documentation for any purpose and without .\" fee is hereby granted, provided that the above copyright .\" notice appear in all copies and that both that copyright .\" notice and this permission notice appear in supporting .\" documentation, and that the name of M.I.T. not be used in .\" advertising or publicity pertaining to distribution of the .\" software without specific, written prior permission. .\" M.I.T. makes no representations about the suitability of .\" this software for any purpose. It is provided "as is" .\" without express or implied warranty. .\" .TH ARES_SEARCH 3 "24 July 1998" .SH NAME ares_search \- Initiate a DNS query with domain search .SH SYNOPSIS .nf .B #include .PP .B typedef void (*ares_callback)(void *\fIarg\fP, int \fIstatus\fP, .B int \fItimeouts\fP, unsigned char *\fIabuf\fP, int \fIalen\fP) .PP .B void ares_search(ares_channel \fIchannel\fP, const char *\fIname\fP, .B int \fIdnsclass\fP, int \fItype\fP, ares_callback \fIcallback\fP, .B void *\fIarg\fP) .fi .SH DESCRIPTION The .B ares_search function initiates a series of single-question DNS queries on the name service channel identified by .IR channel , using the channel's search domains as well as a host alias file given by the HOSTALIAS environment variable. The parameter .I name gives the alias name or the base of the query name as a NUL-terminated C string of period-separated labels; if it ends with a period, the channel's search domains will not be used. Periods and backslashes within a label must be escaped with a backslash. The parameters .I dnsclass and .I type give the class and type of the query using the values defined in .BR . When the query sequence is complete or has failed, the ares library will invoke .IR callback . Completion or failure of the query sequence may happen immediately, or may happen during a later call to .BR ares_process (3) or .BR ares_destroy (3). .PP The callback argument .I arg is copied from the .B ares_search argument .IR arg . The callback argument .I status indicates whether the query sequence ended with a successful query and, if not, how the query sequence failed. It may have any of the following values: .TP 19 .B ARES_SUCCESS A query completed successfully. .TP 19 .B ARES_ENODATA No query completed successfully; when the query was tried without a search domain appended, a response was returned with no answers. .TP 19 .B ARES_EFORMERR A query completed but the server claimed that the query was malformatted. .TP 19 .B ARES_ESERVFAIL No query completed successfully; when the query was tried without a search domain appended, the server claimed to have experienced a failure. (This code can only occur if the .B ARES_FLAG_NOCHECKRESP flag was specified at channel initialization time; otherwise, such responses are ignored at the .BR ares_send (3) level.) .TP 19 .B ARES_ENOTFOUND No query completed successfully; when the query was tried without a search domain appended, the server reported that the queried-for domain name was not found. .TP 19 .B ARES_ENOTIMP A query completed but the server does not implement the operation requested by the query. (This code can only occur if the .B ARES_FLAG_NOCHECKRESP flag was specified at channel initialization time; otherwise, such responses are ignored at the .BR ares_send (3) level.) .TP 19 .B ARES_EREFUSED A query completed but the server refused the query. (This code can only occur returned if the .B ARES_FLAG_NOCHECKRESP flag was specified at channel initialization time; otherwise, such responses are ignored at the .BR ares_send (3) level.) .TP 19 .B ARES_TIMEOUT No name servers responded to a query within the timeout period. .TP 19 .B ARES_ECONNREFUSED No name servers could be contacted. .TP 19 .B ARES_ENOMEM Memory was exhausted. .TP 19 .B ARES_ECANCELLED The query was cancelled. .TP 19 .B ARES_EDESTRUCTION The name service channel .I channel is being destroyed; the query will not be completed. .PP The callback argument .I timeouts reports how many times a query timed out during the execution of the given request. .PP If a query completed successfully, the callback argument .I abuf points to a result buffer of length .IR alen . If the query did not complete successfully, .I abuf will usually be NULL and .I alen will usually be 0, but in some cases an unsuccessful query result may be placed in .IR abuf . .SH SEE ALSO .BR ares_process (3) .SH AUTHOR Greg Hudson, MIT Information Systems .br Copyright 1998 by the Massachusetts Institute of Technology. ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/docs/ares_send.30000644000175100001770000000642200000000000021063 0ustar00runnerdocker00000000000000.\" .\" Copyright 1998 by the Massachusetts Institute of Technology. .\" .\" Permission to use, copy, modify, and distribute this .\" software and its documentation for any purpose and without .\" fee is hereby granted, provided that the above copyright .\" notice appear in all copies and that both that copyright .\" notice and this permission notice appear in supporting .\" documentation, and that the name of M.I.T. not be used in .\" advertising or publicity pertaining to distribution of the .\" software without specific, written prior permission. .\" M.I.T. makes no representations about the suitability of .\" this software for any purpose. It is provided "as is" .\" without express or implied warranty. .\" .TH ARES_SEND 3 "25 July 1998" .SH NAME ares_send \- Initiate a DNS query .SH SYNOPSIS .nf .B #include .PP .B typedef void (*ares_callback)(void *\fIarg\fP, int \fIstatus\fP, .B int \fItimeouts\fP, unsigned char *\fIabuf\fP, int \fIalen\fP) .PP .B void ares_send(ares_channel \fIchannel\fP, const unsigned char *\fIqbuf\fP, .B int \fIqlen\fP, ares_callback \fIcallback\fP, void *\fIarg\fP) .fi .SH DESCRIPTION The .B ares_send function initiates a DNS query on the name service channel identified by .IR channel . The parameters .I qbuf and .I qlen give the DNS query, which should already have been formatted according to the DNS protocol. When the query is complete or has failed, the ares library will invoke .IR callback . Completion or failure of the query may happen immediately, or may happen during a later call to .BR ares_process (3) or .BR ares_destroy (3). .PP The callback argument .I arg is copied from the .B ares_send argument .IR arg . The callback argument .I status indicates whether the query succeeded and, if not, how it failed. It may have any of the following values: .TP 19 .B ARES_SUCCESS The query completed. .TP 19 .B ARES_EBADQUERY The query buffer was poorly formed (was not long enough for a DNS header or was too long for TCP transmission). .TP 19 .B ARES_ETIMEOUT No name servers responded within the timeout period. .TP 19 .B ARES_ECONNREFUSED No name servers could be contacted. .TP 19 .B ARES_ENOMEM Memory was exhausted. .TP 19 .B ARES_ECANCELLED The query was cancelled. .TP 19 .B ARES_EDESTRUCTION The name service channel .I channel is being destroyed; the query will not be completed. .PP The callback argument .I timeouts reports how many times a query timed out during the execution of the given request. .PP If the query completed, the callback argument .I abuf points to a result buffer of length .IR alen . If the query did not complete, .I abuf will be NULL and .I alen will be 0. .PP Unless the flag .B ARES_FLAG_NOCHECKRESP was set at channel initialization time, .B ares_send will normally ignore responses whose questions do not match the questions in .IR qbuf , as well as responses with reply codes of .BR SERVFAIL , .BR NOTIMP , and .BR REFUSED . Unlike other query functions in the ares library, however, .B ares_send does not inspect the header of the reply packet to determine the error status, so a callback status of .B ARES_SUCCESS does not reflect as much about the response as for other query functions. .SH SEE ALSO .BR ares_process (3) .SH AUTHOR Greg Hudson, MIT Information Systems .br Copyright 1998 by the Massachusetts Institute of Technology. ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/docs/ares_set_local_dev.30000644000175100001770000000305400000000000022733 0ustar00runnerdocker00000000000000.\" .\" Copyright 2010 by Ben Greear .\" .\" Permission to use, copy, modify, and distribute this .\" software and its documentation for any purpose and without .\" fee is hereby granted, provided that the above copyright .\" notice appear in all copies and that both that copyright .\" notice and this permission notice appear in supporting .\" documentation, and that the name of M.I.T. not be used in .\" advertising or publicity pertaining to distribution of the .\" software without specific, written prior permission. .\" M.I.T. makes no representations about the suitability of .\" this software for any purpose. It is provided "as is" .\" without express or implied warranty. .\" .TH ARES_SET_LOCAL_DEV 3 "30 June 2010" .SH NAME ares_set_local_dev \- Bind to a specific network device when creating sockets. .SH SYNOPSIS .nf .B #include .PP .B void ares_set_local_dev(ares_channel \fIchannel\fP, const char* \fIlocal_dev_name\fP) .fi .SH DESCRIPTION The \fBares_set_local_dev\fP function causes all future sockets 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 silently ignored. .SH SEE ALSO .BR ares_set_local_ip4 (3) .BR ares_set_local_ip6 (3) .SH NOTES This function was added in c-ares 1.7.4 .SH AUTHOR Ben Greear ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/docs/ares_set_local_ip4.30000644000175100001770000000244200000000000022651 0ustar00runnerdocker00000000000000.\" .\" Copyright 2010 by Ben Greear .\" .\" Permission to use, copy, modify, and distribute this .\" software and its documentation for any purpose and without .\" fee is hereby granted, provided that the above copyright .\" notice appear in all copies and that both that copyright .\" notice and this permission notice appear in supporting .\" documentation, and that the name of M.I.T. not be used in .\" advertising or publicity pertaining to distribution of the .\" software without specific, written prior permission. .\" M.I.T. makes no representations about the suitability of .\" this software for any purpose. It is provided "as is" .\" without express or implied warranty. .\" .TH ARES_SET_LOCAL_IP4 3 "30 June 2010" .SH NAME ares_set_local_ip4 \- Set local IPv4 address outgoing requests. .SH SYNOPSIS .nf .B #include .PP .B void ares_set_local_ip4(ares_channel \fIchannel\fP, unsigned int \fIlocal_ip\fP) .fi .SH DESCRIPTION The \fBares_set_local_ip4\fP function sets the IP address for outbound requests. The parameter \fIlocal_ip\fP is specified in host byte order. This allows users to specify outbound interfaces when used on multi-homed systems. .SH SEE ALSO .BR ares_set_local_ip6 (3) .SH NOTES This function was added in c-ares 1.7.4 .SH AUTHOR Ben Greear ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/docs/ares_set_local_ip6.30000644000175100001770000000255200000000000022655 0ustar00runnerdocker00000000000000.\" .\" Copyright 2010 by Ben Greear .\" .\" Permission to use, copy, modify, and distribute this .\" software and its documentation for any purpose and without .\" fee is hereby granted, provided that the above copyright .\" notice appear in all copies and that both that copyright .\" notice and this permission notice appear in supporting .\" documentation, and that the name of M.I.T. not be used in .\" advertising or publicity pertaining to distribution of the .\" software without specific, written prior permission. .\" M.I.T. makes no representations about the suitability of .\" this software for any purpose. It is provided "as is" .\" without express or implied warranty. .\" .TH ARES_SET_LOCAL_IP6 3 "30 June 2010" .SH NAME ares_set_local_ip6 \- Set local IPv6 address outgoing requests. .SH SYNOPSIS .nf .B #include .PP .B void ares_set_local_ip6(ares_channel \fIchannel\fP, const unsigned char* \fIlocal_ip6\fP) .fi .SH DESCRIPTION The \fBares_set_local_ip6\fP function sets the IPv6 address for outbound IPv6 requests. The parameter \fIlocal_ip6\fP is specified in network byte order. This allows users to specify outbound interfaces when used on multi-homed systems. The local_ip6 argument must be 16 bytes in length. .SH SEE ALSO .BR ares_set_local_ip4 (3) .SH NOTES This function was added in c-ares 1.7.4 .SH AUTHOR Ben Greear ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/docs/ares_set_servers.30000644000175100001770000000715500000000000022502 0ustar00runnerdocker00000000000000.\" .\" Copyright 2010 by Ben Greear .\" .\" Permission to use, copy, modify, and distribute this .\" software and its documentation for any purpose and without .\" fee is hereby granted, provided that the above copyright .\" notice appear in all copies and that both that copyright .\" notice and this permission notice appear in supporting .\" documentation, and that the name of M.I.T. not be used in .\" advertising or publicity pertaining to distribution of the .\" software without specific, written prior permission. .\" M.I.T. makes no representations about the suitability of .\" this software for any purpose. It is provided "as is" .\" without express or implied warranty. .\" .TH ARES_SET_SERVERS 3 "5 March 2010" .SH NAME ares_set_servers, ares_set_servers_ports \- Initialize an ares_channel name servers configuration .SH SYNOPSIS .nf .B #include .PP .B int ares_set_servers(ares_channel \fIchannel\fP, struct ares_addr_node *\fIservers\fP) .B int ares_set_servers_ports(ares_channel \fIchannel\fP, struct ares_addr_port_node *\fIservers\fP) .fi .SH DESCRIPTION The \fBares_set_servers(3)\fP function initializes name servers configuration for the channel data identified by .IR channel , from a .IR servers pointer to a linked list of ares_addr_node structs holding name servers address data. .PP The name server linked list pointer argument may be the result of a previous call to \fBares_get_servers(3)\fP or a linked list of \fBares_addr_node\fP structs set up by other means. .PP The \fBares_set_servers(3)\fP function also allows the specification of UDP and TCP ports to be used for communication on a per-server basis. The provided linked list argument may be the result of a previous call to \fBares_get_servers_ports(3)\fP or a linked list of \fBares_addr_port_node\fP structs set up by other means. .PP This function replaces any potentially previously configured name servers with the ones given in the linked list. So, in order to configure a channel with more than one name server all the desired ones must be specified in a single list. .PP The function does not take ownership of the linked list argument. The caller is responsible for freeing the linked list when no longer needed. .PP This function is capable of handling IPv4 and IPv6 name server addresses simultaneously, rendering \fBares_init_options(3)\fP with optmask \fBARES_OPT_SERVERS\fP functionally obsolete except for IPv4-only name server usage. .SH RETURN VALUES .B ares_set_servers(3) may return any of the following values: .TP 15 .B ARES_SUCCESS The name servers configuration was successfully initialized. .TP 15 .B ARES_ENOMEM The process's available memory was exhausted. .TP 15 .B ARES_ENODATA The channel data identified by .IR channel was invalid. .TP 15 .B ARES_ENOTINITIALIZED c-ares library initialization not yet performed. .TP 15 .B ARES_ENOTIMP Changing name servers configuration while queries are outstanding is not implemented. .SH SEE ALSO .BR ares_set_servers_csv (3), .BR ares_get_servers (3), .BR ares_init_options (3), .BR ares_dup(3) .SH AVAILABILITY \fBares_set_servers(3)\fP was added in c-ares 1.7.1; \fBares_set_servers_ports(3)\fP was added in c-ares 1.11.0. .SH AUTHOR Implementation of this function and associated library internals are based on code, comments and feedback provided in November and December of 2008 by Daniel Stenberg, Gregor Jasny, Phil Blundell and Yang Tse, December 2009 by Cedric Bail, February 2010 by Jakub Hrozek. On March 2010 Yang Tse shuffled all the bits and this function popped out. .br Copyright 1998 by the Massachusetts Institute of Technology. .br Copyright (C) 2008-2010 by Daniel Stenberg ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/docs/ares_set_servers_csv.30000644000175100001770000000440400000000000023347 0ustar00runnerdocker00000000000000.\" .\" Copyright 2010 by Ben Greear .\" .\" Permission to use, copy, modify, and distribute this .\" software and its documentation for any purpose and without .\" fee is hereby granted, provided that the above copyright .\" notice appear in all copies and that both that copyright .\" notice and this permission notice appear in supporting .\" documentation, and that the name of M.I.T. not be used in .\" advertising or publicity pertaining to distribution of the .\" software without specific, written prior permission. .\" M.I.T. makes no representations about the suitability of .\" this software for any purpose. It is provided "as is" .\" without express or implied warranty. .\" .TH ARES_SET_SERVERS_CSV 3 "30 June 2010" .SH NAME ares_set_servers_csv, ares_set_servers_ports_csv \- Set list of DNS servers to be used. .SH SYNOPSIS .nf .B #include .PP .B int ares_set_servers_csv(ares_channel \fIchannel\fP, const char* \fIservers\fP) .B int ares_set_servers_ports_csv(ares_channel \fIchannel\fP, const char* \fIservers\fP) .fi .SH DESCRIPTION The \fBares_set_servers_csv\fP and \fBares_set_servers_ports_csv\fPfunctions set the list of DNS servers that ARES will query. The format of the servers option is: host[:port][,host[:port]]... For example: 192.168.1.100,192.168.1.101,3.4.5.6 .PP The \fBares_set_servers_csv\fP function will ignore any port values specified in the input string, whereare the \fBares_set_servers_ports_csv\fP function will apply any specified port values as the UDP and TCP port to be used for that particular nameserver. .SH RETURN VALUES .B ares_set_servers_csv(3) This function may return any of the following values: .TP 15 .B ARES_SUCCESS The name servers configuration was successfully initialized. .TP 15 .B ARES_ENOMEM The process's available memory was exhausted. .TP 15 .B ARES_ENODATA The channel data identified by .IR channel was invalid. .TP 15 .B ARES_ENOTINITIALIZED c-ares library initialization not yet performed. .TP 15 .B ARES_ENOTIMP Changing name servers configuration while queries are outstanding is not implemented. .SH SEE ALSO .BR ares_set_servers (3) .SH AVAILABILITY \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. .SH AUTHOR Ben Greear ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/docs/ares_set_servers_ports.30000644000175100001770000000003400000000000023716 0ustar00runnerdocker00000000000000.so man3/ares_set_servers.3 ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/docs/ares_set_servers_ports_csv.30000644000175100001770000000004000000000000024566 0ustar00runnerdocker00000000000000.so man3/ares_set_servers_csv.3 ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/docs/ares_set_socket_callback.30000644000175100001770000000207400000000000024110 0ustar00runnerdocker00000000000000.\" .TH ARES_SET_SOCKET_CALLBACK 3 "20 Nov 2009" .SH NAME ares_set_socket_callback \- Set a socket creation callback .SH SYNOPSIS .nf .B #include .PP .B typedef int (*ares_sock_create_callback)(ares_socket_t \fIsocket_fd\fP, int \fItype\fP, void *\fIuserdata\fP) .PP .B void ares_set_socket_callback(ares_channel \fIchannel\fP, ares_sock_create_callback \fIcallback\fP, void *\fIuserdata\fP) .PP .B cc file.c -lcares .fi .SH DESCRIPTION .PP This function sets a \fIcallback\fP in the given ares channel handle. This callback function will be invoked after the socket has been created, and connected to the remote server. The callback must return ARES_SUCCESS if things are fine, or return -1 to signal an error. A returned error will abort the ares operation. .SH SEE ALSO .BR ares_init_options (3), ares_set_socket_configure_callback (3) .SH AVAILABILITY ares_set_socket_callback(3) was added in c-ares 1.6.0 .SH AUTHOR Gregor Jasny ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/docs/ares_set_socket_configure_callback.30000644000175100001770000000225600000000000026153 0ustar00runnerdocker00000000000000.\" .TH ARES_SET_SOCKET_CONFIGURE_CALLBACK 3 "6 Feb 2016" .SH NAME ares_set_socket_configure_callback \- Set a socket configuration callback .SH SYNOPSIS .nf .B #include .PP .B typedef int (*ares_sock_config_callback)(ares_socket_t \fIsocket_fd\fP, int \fItype\fP, void *\fIuserdata\fP) .PP .B void ares_set_socket_configure_callback(ares_channel \fIchannel\fP, ares_sock_config_callback \fIcallback\fP, void *\fIuserdata\fP) .PP .B cc file.c -lcares .fi .SH DESCRIPTION .PP This function sets a \fIcallback\fP in the given ares channel handle. This callback function will be invoked after the socket has been created, but before it has been connected to the remote server, which is an ideal time to configure various socket options. The callback must return ARES_SUCCESS if things are fine, or return -1 to signal an error. A returned error will abort the ares operation. .SH SEE ALSO .BR ares_init_options (3), ares_set_socket_callback (3) .SH AVAILABILITY ares_set_socket_configure_callback(3) was added in c-ares 1.11.0 .SH AUTHOR Andrew Ayer ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/docs/ares_set_socket_functions.30000644000175100001770000000657100000000000024372 0ustar00runnerdocker00000000000000.\" .TH ARES_SET_SOCKET_FUNCTIONS 3 "13 Dec 2016" .SH NAME ares_set_socket_functions \- Set socket io callbacks .SH SYNOPSIS .nf .B #include .PP .B struct ares_socket_functions { ares_socket_t(*\fIasocket\fP)(int, int, int, void *); int(*\fIaclose\fP)(ares_socket_t, void *); int(*\fIaconnect\fP)(ares_socket_t, const struct sockaddr *, ares_socklen_t, void *); ares_ssize_t(*\fIarecvfrom\fP)(ares_socket_t, void *, size_t, int, struct sockaddr *, ares_socklen_t *, void *); ares_ssize_t(*\fIasendv\fP)(ares_socket_t, const struct iovec *, int, void *); }; .PP .B void ares_set_socket_functions(ares_channel \fIchannel\fP, const struct ares_socket_functions * \fIfunctions\fP, void *\fIuser_data\fP); .fi .SH DESCRIPTION .PP This function sets a set of callback \fIfunctions\fP in the given ares channel handle. 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. .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. .PP 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) .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) .br Initiate a connection to the address indicated by \fIaddr\fP on a socket. See .BR connect(2) .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) .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) .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) .br Send data, as provided by the iovec array \fIdata\fP, to the socket endpoint. See .BR writev(2), .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. .SH AVAILABILITY Added in c-ares 1.13.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 writev(2) .SH AUTHOR Carl Wilund ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/docs/ares_set_sortlist.30000644000175100001770000000373700000000000022676 0ustar00runnerdocker00000000000000.\" .\" Permission to use, copy, modify, and distribute this .\" software and its documentation for any purpose and without .\" fee is hereby granted, provided that the above copyright .\" notice appear in all copies and that both that copyright .\" notice and this permission notice appear in supporting .\" documentation, and that the name of M.I.T. not be used in .\" advertising or publicity pertaining to distribution of the .\" software without specific, written prior permission. .\" M.I.T. makes no representations about the suitability of .\" this software for any purpose. It is provided "as is" .\" without express or implied warranty. .\" .TH ARES_SET_SORTLIST 3 "23 November 2015" .SH NAME ares_set_sortlist \- Initialize an ares_channel sortlist configuration .SH SYNOPSIS .nf .B #include .PP .B int ares_set_sortlist(ares_channel \fIchannel\fP, const char *\fIsortstr\fP) .fi .SH DESCRIPTION The \fBares_set_sortlist(3)\fP function initializes an address sortlist configuration for the channel data identified by .IR channel , so that addresses returned by \fBares_gethostbyname(3)\fP are sorted according to the sortlist. The provided .IR sortstr string that holds a space separated list of IP-address-netmask pairs. The netmask is optional but follows the address after a slash if present. For example, "130.155.160.0/255.255.240.0 130.155.0.0". This function replaces any potentially previously configured address sortlist with the ones given in the configuration string. .SH RETURN VALUES .B ares_set_sortlist(3) may return any of the following values: .TP 15 .B ARES_SUCCESS The sortlist configuration was successfully initialized. .TP 15 .B ARES_ENOMEM The process's available memory was exhausted. .TP 15 .B ARES_ENODATA The channel data identified by .IR channel was invalid. .TP 15 .B ARES_ENOTINITIALIZED c-ares library initialization not yet performed. .SH SEE ALSO .BR ares_init_options (3), .BR ares_dup(3) .SH AVAILABILITY ares_set_sortlist(3) was added in c-ares 1.11.0 ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/docs/ares_strerror.30000644000175100001770000000241000000000000022005 0ustar00runnerdocker00000000000000.\" .\" Copyright 1998 by the Massachusetts Institute of Technology. .\" .\" Permission to use, copy, modify, and distribute this .\" software and its documentation for any purpose and without .\" fee is hereby granted, provided that the above copyright .\" notice appear in all copies and that both that copyright .\" notice and this permission notice appear in supporting .\" documentation, and that the name of M.I.T. not be used in .\" advertising or publicity pertaining to distribution of the .\" software without specific, written prior permission. .\" M.I.T. makes no representations about the suitability of .\" this software for any purpose. It is provided "as is" .\" without express or implied warranty. .\" .TH ARES_STRERROR 3 "25 July 1998" .SH NAME ares_strerror \- Get the description of an ares library error code .SH SYNOPSIS .nf .B #include .PP .B const char *ares_strerror(int \fIcode\fP) .fi .SH DESCRIPTION The .B ares_strerror function gets the description of the ares library error code .IR code , returning the result as a NUL-terminated C string. .SH NOTES This function is not compatible with ares, it takes a different set of arguments. .SH AUTHOR Greg Hudson, MIT Information Systems .br Copyright 1998 by the Massachusetts Institute of Technology. ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/docs/ares_timeout.30000644000175100001770000000362200000000000021617 0ustar00runnerdocker00000000000000.\" .\" Copyright 1998 by the Massachusetts Institute of Technology. .\" .\" Permission to use, copy, modify, and distribute this .\" software and its documentation for any purpose and without .\" fee is hereby granted, provided that the above copyright .\" notice appear in all copies and that both that copyright .\" notice and this permission notice appear in supporting .\" documentation, and that the name of M.I.T. not be used in .\" advertising or publicity pertaining to distribution of the .\" software without specific, written prior permission. .\" M.I.T. makes no representations about the suitability of .\" this software for any purpose. It is provided "as is" .\" without express or implied warranty. .\" .TH ARES_TIMEOUT 3 "25 July 1998" .SH NAME ares_timeout \- return maximum time to wait .SH SYNOPSIS .nf #include struct timeval *ares_timeout(ares_channel \fIchannel\fP, struct timeval *\fImaxtv\fP, struct timeval *\fItv\fP) .fi .SH DESCRIPTION The \fBares_timeout(3)\fP function determines the maximum time for which the caller should wait before invoking \fIares_process(3)\fP to process timeouts. The parameter \fImaxtv\fP specifies a existing maximum timeout, or \fBNULL\fP if the caller does not wish to apply a maximum timeout. The parameter \fItv\fP must point to a writable buffer of type \fBstruct timeval\fP It is valid for \fImaxtv\fP and \fItv\fP to have the same value. If no queries have timeouts pending sooner than the given maximum timeout, \fBares_timeout(3)\fP returns the value of \fImaxtv\fP; otherwise \fBares_timeout(3)\fP stores the appropriate timeout value into the buffer pointed to by \fItv\fP and returns the value of \fItv\fP. .SH SEE ALSO .BR ares_fds (3), .BR ares_process (3), .BR ares_process_fd (3) .SH AUTHOR Greg Hudson, MIT Information Systems .br Copyright 1998 by the Massachusetts Institute of Technology. ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/docs/ares_version.30000644000175100001770000000254600000000000021622 0ustar00runnerdocker00000000000000.\" .\" Copyright 2004 by Daniel Stenberg .\" .\" Permission to use, copy, modify, and distribute this .\" software and its documentation for any purpose and without .\" fee is hereby granted, provided that the above copyright .\" notice appear in all copies and that both that copyright .\" notice and this permission notice appear in supporting .\" documentation, and that the name of M.I.T. not be used in .\" advertising or publicity pertaining to distribution of the .\" software without specific, written prior permission. .\" M.I.T. makes no representations about the suitability of .\" this software for any purpose. It is provided "as is" .\" without express or implied warranty. .\" .TH ARES_VERSION 3 "29 January 2004" .SH NAME ares_version \- Get the version number of the library .SH SYNOPSIS .nf #include const char *ares_version(int *\fIversion\fP) .fi .SH DESCRIPTION The \fBares_version(3)\fP function gets the library version as a string and optionally as an integer stored in the \fIversion\fP argument. If you pass a NULL, no integer is attempted to be returned. The integer is built up as 24bit number, with 8 separate bits used for major number, minor number and patch number. This makes a version string such as 1.2.3 will be returned as the hexadecimal number 0x010203 (decimal 66051). .SH "SEE ALSO" .BR ares_init (3), .BR ares_library_init (3) ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/get_ver.awk0000644000175100001770000000223400000000000020240 0ustar00runnerdocker00000000000000# *************************************************************************** # * Project: c-ares # * # *************************************************************************** # awk script which fetches c-ares version number and string from input # file and writes them to STDOUT. Here you can get an awk version for Win32: # http://www.gknw.net/development/prgtools/awk-20100523.zip # BEGIN { while ((getline < ARGV[1]) > 0) { sub("\r", "") # make MSYS gawk work with CRLF header input. if (match ($0, /^#define ARES_COPYRIGHT "[^"]+"$/)) copyright_string = substr($0, 25, length($0)-25) else if (match ($0, /^#define ARES_VERSION_STR "[^"]+"$/)) version_string = substr($3, 2, length($3)-2) else if (match ($0, /^#define ARES_VERSION_MAJOR [0-9]+$/)) version_major = $3 else if (match ($0, /^#define ARES_VERSION_MINOR [0-9]+$/)) version_minor = $3 else if (match ($0, /^#define ARES_VERSION_PATCH [0-9]+$/)) version_patch = $3 } print "LIBCARES_VERSION = " version_major "," version_minor "," version_patch print "LIBCARES_VERSION_STR = " version_string print "LIBCARES_COPYRIGHT_STR = " copyright_string } ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/git2changes.pl0000755000175100001770000000325100000000000020637 0ustar00runnerdocker00000000000000#!/usr/bin/perl # git log --pretty=fuller --no-color --date=short --decorate=full my @mname = ('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' ); sub nicedate { my ($date)=$_; if($date =~ /(\d\d\d\d)-(\d\d)-(\d\d)/) { return sprintf("%d %s %4d", $3, $mname[$2-1], $1); } return $date; } print ' Changelog for the c-ares project. Generated with git2changes.pl '; my $line; my $tag; while() { my $l = $_; if($l =~/^commit ([[:xdigit:]]*) ?(.*)/) { $co = $1; my $ref = $2; if ($ref =~ /refs\/tags\/c[-]*ares-([0-9._]*)/) { $tag = $1; $tag =~ s/_/./g; } else { $tag = ''; } } elsif($l =~ /^Author: *(.*) + /* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish libc5-based Linux systems. Only include it on system that are known to require it! */ #if defined(_AIX) || defined(__NOVELL_LIBC__) || defined(__NetBSD__) || \ defined(__minix) || defined(__SYMBIAN32__) || defined(__INTEGRITY) || \ defined(ANDROID) || defined(__ANDROID__) || defined(__OpenBSD__) || \ defined(__QNXNTO__) || defined(__MVS__) || defined(__HAIKU__) #include #endif #if (defined(NETWARE) && !defined(__NOVELL_LIBC__)) #include #endif #if defined(WATT32) # include # include # include #elif defined(_WIN32_WCE) # ifndef WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN # endif # include # include #elif defined(WIN32) # ifndef WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN # endif # include # include # include #else # include # include #endif #if defined(ANDROID) || defined(__ANDROID__) #include #endif #ifdef __cplusplus extern "C" { #endif /* ** c-ares external API function linkage decorations. */ #ifdef CARES_STATICLIB # define CARES_EXTERN #elif defined(WIN32) || defined(_WIN32) || defined(__SYMBIAN32__) # if defined(CARES_BUILDING_LIBRARY) # define CARES_EXTERN __declspec(dllexport) # else # define CARES_EXTERN __declspec(dllimport) # endif #elif defined(CARES_BUILDING_LIBRARY) && defined(CARES_SYMBOL_HIDING) # define CARES_EXTERN CARES_SYMBOL_SCOPE_EXTERN #else # define CARES_EXTERN #endif #define ARES_SUCCESS 0 /* Server error codes (ARES_ENODATA indicates no relevant answer) */ #define ARES_ENODATA 1 #define ARES_EFORMERR 2 #define ARES_ESERVFAIL 3 #define ARES_ENOTFOUND 4 #define ARES_ENOTIMP 5 #define ARES_EREFUSED 6 /* Locally generated error codes */ #define ARES_EBADQUERY 7 #define ARES_EBADNAME 8 #define ARES_EBADFAMILY 9 #define ARES_EBADRESP 10 #define ARES_ECONNREFUSED 11 #define ARES_ETIMEOUT 12 #define ARES_EOF 13 #define ARES_EFILE 14 #define ARES_ENOMEM 15 #define ARES_EDESTRUCTION 16 #define ARES_EBADSTR 17 /* ares_getnameinfo error codes */ #define ARES_EBADFLAGS 18 /* ares_getaddrinfo error codes */ #define ARES_ENONAME 19 #define ARES_EBADHINTS 20 /* Uninitialized library error code */ #define ARES_ENOTINITIALIZED 21 /* introduced in 1.7.0 */ /* ares_library_init error codes */ #define ARES_ELOADIPHLPAPI 22 /* introduced in 1.7.0 */ #define ARES_EADDRGETNETWORKPARAMS 23 /* introduced in 1.7.0 */ /* More error codes */ #define ARES_ECANCELLED 24 /* introduced in 1.7.0 */ /* More ares_getaddrinfo error codes */ #define ARES_ESERVICE 25 /* introduced in 1.?.0 */ /* Flag values */ #define ARES_FLAG_USEVC (1 << 0) #define ARES_FLAG_PRIMARY (1 << 1) #define ARES_FLAG_IGNTC (1 << 2) #define ARES_FLAG_NORECURSE (1 << 3) #define ARES_FLAG_STAYOPEN (1 << 4) #define ARES_FLAG_NOSEARCH (1 << 5) #define ARES_FLAG_NOALIASES (1 << 6) #define ARES_FLAG_NOCHECKRESP (1 << 7) #define ARES_FLAG_EDNS (1 << 8) /* Option mask values */ #define ARES_OPT_FLAGS (1 << 0) #define ARES_OPT_TIMEOUT (1 << 1) #define ARES_OPT_TRIES (1 << 2) #define ARES_OPT_NDOTS (1 << 3) #define ARES_OPT_UDP_PORT (1 << 4) #define ARES_OPT_TCP_PORT (1 << 5) #define ARES_OPT_SERVERS (1 << 6) #define ARES_OPT_DOMAINS (1 << 7) #define ARES_OPT_LOOKUPS (1 << 8) #define ARES_OPT_SOCK_STATE_CB (1 << 9) #define ARES_OPT_SORTLIST (1 << 10) #define ARES_OPT_SOCK_SNDBUF (1 << 11) #define ARES_OPT_SOCK_RCVBUF (1 << 12) #define ARES_OPT_TIMEOUTMS (1 << 13) #define ARES_OPT_ROTATE (1 << 14) #define ARES_OPT_EDNSPSZ (1 << 15) #define ARES_OPT_NOROTATE (1 << 16) #define ARES_OPT_RESOLVCONF (1 << 17) /* Nameinfo flag values */ #define ARES_NI_NOFQDN (1 << 0) #define ARES_NI_NUMERICHOST (1 << 1) #define ARES_NI_NAMEREQD (1 << 2) #define ARES_NI_NUMERICSERV (1 << 3) #define ARES_NI_DGRAM (1 << 4) #define ARES_NI_TCP 0 #define ARES_NI_UDP ARES_NI_DGRAM #define ARES_NI_SCTP (1 << 5) #define ARES_NI_DCCP (1 << 6) #define ARES_NI_NUMERICSCOPE (1 << 7) #define ARES_NI_LOOKUPHOST (1 << 8) #define ARES_NI_LOOKUPSERVICE (1 << 9) /* Reserved for future use */ #define ARES_NI_IDN (1 << 10) #define ARES_NI_IDN_ALLOW_UNASSIGNED (1 << 11) #define ARES_NI_IDN_USE_STD3_ASCII_RULES (1 << 12) /* Addrinfo flag values */ #define ARES_AI_CANONNAME (1 << 0) #define ARES_AI_NUMERICHOST (1 << 1) #define ARES_AI_PASSIVE (1 << 2) #define ARES_AI_NUMERICSERV (1 << 3) #define ARES_AI_V4MAPPED (1 << 4) #define ARES_AI_ALL (1 << 5) #define ARES_AI_ADDRCONFIG (1 << 6) #define ARES_AI_NOSORT (1 << 7) #define ARES_AI_ENVHOSTS (1 << 8) /* Reserved for future use */ #define ARES_AI_IDN (1 << 10) #define ARES_AI_IDN_ALLOW_UNASSIGNED (1 << 11) #define ARES_AI_IDN_USE_STD3_ASCII_RULES (1 << 12) #define ARES_AI_CANONIDN (1 << 13) #define ARES_AI_MASK (ARES_AI_CANONNAME|ARES_AI_NUMERICHOST|ARES_AI_PASSIVE| \ ARES_AI_NUMERICSERV|ARES_AI_V4MAPPED|ARES_AI_ALL| \ ARES_AI_ADDRCONFIG) #define ARES_GETSOCK_MAXNUM 16 /* ares_getsock() can return info about this many sockets */ #define ARES_GETSOCK_READABLE(bits,num) (bits & (1<< (num))) #define ARES_GETSOCK_WRITABLE(bits,num) (bits & (1 << ((num) + \ ARES_GETSOCK_MAXNUM))) /* c-ares library initialization flag values */ #define ARES_LIB_INIT_NONE (0) #define ARES_LIB_INIT_WIN32 (1 << 0) #define ARES_LIB_INIT_ALL (ARES_LIB_INIT_WIN32) /* * Typedef our socket type */ #ifndef ares_socket_typedef #ifdef WIN32 typedef SOCKET ares_socket_t; #define ARES_SOCKET_BAD INVALID_SOCKET #else typedef int ares_socket_t; #define ARES_SOCKET_BAD -1 #endif #define ares_socket_typedef #endif /* ares_socket_typedef */ typedef void (*ares_sock_state_cb)(void *data, ares_socket_t socket_fd, int readable, int writable); struct apattern; /* NOTE about the ares_options struct to users and developers. This struct will remain looking like this. It will not be extended nor shrunk in future releases, but all new options will be set by ares_set_*() options instead of with the ares_init_options() function. Eventually (in a galaxy far far away), all options will be settable by ares_set_*() options and the ares_init_options() function will become deprecated. When new options are added to c-ares, they are not added to this struct. And they are not "saved" with the ares_save_options() function but instead we encourage the use of the ares_dup() function. Needless to say, if you add config options to c-ares you need to make sure ares_dup() duplicates this new option. */ struct ares_options { int flags; int timeout; /* in seconds or milliseconds, depending on options */ int tries; int ndots; unsigned short udp_port; unsigned short tcp_port; int socket_send_buffer_size; int socket_receive_buffer_size; struct in_addr *servers; int nservers; char **domains; int ndomains; char *lookups; ares_sock_state_cb sock_state_cb; void *sock_state_cb_data; struct apattern *sortlist; int nsort; int ednspsz; char *resolvconf_path; }; struct hostent; struct timeval; struct sockaddr; struct ares_channeldata; struct ares_addrinfo; struct ares_addrinfo_hints; typedef struct ares_channeldata *ares_channel; typedef void (*ares_callback)(void *arg, int status, int timeouts, unsigned char *abuf, int alen); typedef void (*ares_host_callback)(void *arg, int status, int timeouts, struct hostent *hostent); typedef void (*ares_nameinfo_callback)(void *arg, int status, int timeouts, char *node, char *service); typedef int (*ares_sock_create_callback)(ares_socket_t socket_fd, int type, void *data); typedef int (*ares_sock_config_callback)(ares_socket_t socket_fd, int type, void *data); typedef void (*ares_addrinfo_callback)(void *arg, int status, int timeouts, struct ares_addrinfo *res); CARES_EXTERN int ares_library_init(int flags); CARES_EXTERN int ares_library_init_mem(int flags, void *(*amalloc)(size_t size), void (*afree)(void *ptr), void *(*arealloc)(void *ptr, size_t size)); #if defined(ANDROID) || defined(__ANDROID__) CARES_EXTERN void ares_library_init_jvm(JavaVM *jvm); CARES_EXTERN int ares_library_init_android(jobject connectivity_manager); CARES_EXTERN int ares_library_android_initialized(void); #endif CARES_EXTERN int ares_library_initialized(void); CARES_EXTERN void ares_library_cleanup(void); CARES_EXTERN const char *ares_version(int *version); CARES_EXTERN int ares_init(ares_channel *channelptr); CARES_EXTERN int ares_init_options(ares_channel *channelptr, struct ares_options *options, int optmask); CARES_EXTERN int ares_save_options(ares_channel channel, struct ares_options *options, int *optmask); CARES_EXTERN void ares_destroy_options(struct ares_options *options); CARES_EXTERN int ares_dup(ares_channel *dest, ares_channel src); CARES_EXTERN void ares_destroy(ares_channel channel); CARES_EXTERN void ares_cancel(ares_channel channel); /* These next 3 configure local binding for the out-going socket * connection. Use these to specify source IP and/or network device * on multi-homed systems. */ CARES_EXTERN void ares_set_local_ip4(ares_channel channel, unsigned int local_ip); /* local_ip6 should be 16 bytes in length */ CARES_EXTERN void ares_set_local_ip6(ares_channel channel, const unsigned char* local_ip6); /* local_dev_name should be null terminated. */ CARES_EXTERN void ares_set_local_dev(ares_channel channel, const char* local_dev_name); CARES_EXTERN void ares_set_socket_callback(ares_channel channel, ares_sock_create_callback callback, void *user_data); CARES_EXTERN void ares_set_socket_configure_callback(ares_channel channel, ares_sock_config_callback callback, void *user_data); CARES_EXTERN int ares_set_sortlist(ares_channel channel, const char *sortstr); CARES_EXTERN void ares_getaddrinfo(ares_channel channel, const char* node, const char* service, const struct ares_addrinfo_hints* hints, ares_addrinfo_callback callback, void* arg); CARES_EXTERN void ares_freeaddrinfo(struct ares_addrinfo* ai); /* * Virtual function set to have user-managed socket IO. * Note that all functions need to be defined, and when * set, the library will not do any bind nor set any * socket options, assuming the client handles these * through either socket creation or the * ares_sock_config_callback call. */ struct iovec; struct ares_socket_functions { ares_socket_t(*asocket)(int, int, int, void *); int(*aclose)(ares_socket_t, void *); int(*aconnect)(ares_socket_t, const struct sockaddr *, ares_socklen_t, void *); ares_ssize_t(*arecvfrom)(ares_socket_t, void *, size_t, int, struct sockaddr *, ares_socklen_t *, void *); ares_ssize_t(*asendv)(ares_socket_t, const struct iovec *, int, void *); }; CARES_EXTERN void ares_set_socket_functions(ares_channel channel, const struct ares_socket_functions * funcs, void *user_data); CARES_EXTERN void ares_send(ares_channel channel, const unsigned char *qbuf, int qlen, ares_callback callback, void *arg); CARES_EXTERN void ares_query(ares_channel channel, const char *name, int dnsclass, int type, ares_callback callback, void *arg); CARES_EXTERN void ares_search(ares_channel channel, const char *name, int dnsclass, int type, ares_callback callback, void *arg); CARES_EXTERN void ares_gethostbyname(ares_channel channel, const char *name, int family, ares_host_callback callback, void *arg); CARES_EXTERN int ares_gethostbyname_file(ares_channel channel, const char *name, int family, struct hostent **host); CARES_EXTERN void ares_gethostbyaddr(ares_channel channel, const void *addr, int addrlen, int family, ares_host_callback callback, void *arg); CARES_EXTERN void ares_getnameinfo(ares_channel channel, const struct sockaddr *sa, ares_socklen_t salen, int flags, ares_nameinfo_callback callback, void *arg); CARES_EXTERN int ares_fds(ares_channel channel, fd_set *read_fds, fd_set *write_fds); CARES_EXTERN int ares_getsock(ares_channel channel, ares_socket_t *socks, int numsocks); CARES_EXTERN struct timeval *ares_timeout(ares_channel channel, struct timeval *maxtv, struct timeval *tv); CARES_EXTERN void ares_process(ares_channel channel, fd_set *read_fds, fd_set *write_fds); CARES_EXTERN void ares_process_fd(ares_channel channel, ares_socket_t read_fd, ares_socket_t write_fd); CARES_EXTERN int ares_create_query(const char *name, int dnsclass, int type, unsigned short id, int rd, unsigned char **buf, int *buflen, int max_udp_size); CARES_EXTERN int ares_mkquery(const char *name, int dnsclass, int type, unsigned short id, int rd, unsigned char **buf, int *buflen); CARES_EXTERN int ares_expand_name(const unsigned char *encoded, const unsigned char *abuf, int alen, char **s, long *enclen); CARES_EXTERN int ares_expand_string(const unsigned char *encoded, const unsigned char *abuf, int alen, unsigned char **s, long *enclen); /* * NOTE: before c-ares 1.7.0 we would most often use the system in6_addr * struct below when ares itself was built, but many apps would use this * private version since the header checked a HAVE_* define for it. Starting * with 1.7.0 we always declare and use our own to stop relying on the * system's one. */ struct ares_in6_addr { union { unsigned char _S6_u8[16]; } _S6_un; }; struct ares_addrttl { struct in_addr ipaddr; int ttl; }; struct ares_addr6ttl { struct ares_in6_addr ip6addr; int ttl; }; struct ares_caa_reply { struct ares_caa_reply *next; int critical; unsigned char *property; size_t plength; /* plength excludes null termination */ unsigned char *value; size_t length; /* length excludes null termination */ }; struct ares_srv_reply { struct ares_srv_reply *next; char *host; unsigned short priority; unsigned short weight; unsigned short port; }; struct ares_mx_reply { struct ares_mx_reply *next; char *host; unsigned short priority; }; struct ares_txt_reply { struct ares_txt_reply *next; unsigned char *txt; size_t length; /* length excludes null termination */ }; /* NOTE: This structure is a superset of ares_txt_reply */ struct ares_txt_ext { struct ares_txt_ext *next; unsigned char *txt; size_t length; /* 1 - if start of new record * 0 - if a chunk in the same record */ unsigned char record_start; }; struct ares_naptr_reply { struct ares_naptr_reply *next; unsigned char *flags; unsigned char *service; unsigned char *regexp; char *replacement; unsigned short order; unsigned short preference; }; struct ares_soa_reply { char *nsname; char *hostmaster; unsigned int serial; unsigned int refresh; unsigned int retry; unsigned int expire; unsigned int minttl; }; struct ares_uri_reply { struct ares_uri_reply *next; unsigned short priority; unsigned short weight; char *uri; int ttl; }; /* * Similar to addrinfo, but with extra ttl and missing canonname. */ struct ares_addrinfo_node { int ai_ttl; int ai_flags; int ai_family; int ai_socktype; int ai_protocol; ares_socklen_t ai_addrlen; struct sockaddr *ai_addr; struct ares_addrinfo_node *ai_next; }; /* * alias - label of the resource record. * name - value (canonical name) of the resource record. * See RFC2181 10.1.1. CNAME terminology. */ struct ares_addrinfo_cname { int ttl; char *alias; char *name; struct ares_addrinfo_cname *next; }; struct ares_addrinfo { struct ares_addrinfo_cname *cnames; struct ares_addrinfo_node *nodes; char *name; }; struct ares_addrinfo_hints { int ai_flags; int ai_family; int ai_socktype; int ai_protocol; }; /* ** Parse the buffer, starting at *abuf and of length alen bytes, previously ** obtained from an ares_search call. Put the results in *host, if nonnull. ** Also, if addrttls is nonnull, put up to *naddrttls IPv4 addresses along with ** their TTLs in that array, and set *naddrttls to the number of addresses ** so written. */ CARES_EXTERN int ares_parse_a_reply(const unsigned char *abuf, int alen, struct hostent **host, struct ares_addrttl *addrttls, int *naddrttls); CARES_EXTERN int ares_parse_aaaa_reply(const unsigned char *abuf, int alen, struct hostent **host, struct ares_addr6ttl *addrttls, int *naddrttls); CARES_EXTERN int ares_parse_caa_reply(const unsigned char* abuf, int alen, struct ares_caa_reply** caa_out); CARES_EXTERN int ares_parse_ptr_reply(const unsigned char *abuf, int alen, const void *addr, int addrlen, int family, struct hostent **host); CARES_EXTERN int ares_parse_ns_reply(const unsigned char *abuf, int alen, struct hostent **host); CARES_EXTERN int ares_parse_srv_reply(const unsigned char* abuf, int alen, struct ares_srv_reply** srv_out); CARES_EXTERN int ares_parse_mx_reply(const unsigned char* abuf, int alen, struct ares_mx_reply** mx_out); CARES_EXTERN int ares_parse_txt_reply(const unsigned char* abuf, int alen, struct ares_txt_reply** txt_out); CARES_EXTERN int ares_parse_txt_reply_ext(const unsigned char* abuf, int alen, struct ares_txt_ext** txt_out); CARES_EXTERN int ares_parse_naptr_reply(const unsigned char* abuf, int alen, struct ares_naptr_reply** naptr_out); CARES_EXTERN int ares_parse_soa_reply(const unsigned char* abuf, int alen, struct ares_soa_reply** soa_out); CARES_EXTERN int ares_parse_uri_reply(const unsigned char* abuf, int alen, struct ares_uri_reply** uri_out); CARES_EXTERN void ares_free_string(void *str); CARES_EXTERN void ares_free_hostent(struct hostent *host); CARES_EXTERN void ares_free_data(void *dataptr); CARES_EXTERN const char *ares_strerror(int code); struct ares_addr_node { struct ares_addr_node *next; int family; union { struct in_addr addr4; struct ares_in6_addr addr6; } addr; }; struct ares_addr_port_node { struct ares_addr_port_node *next; int family; union { struct in_addr addr4; struct ares_in6_addr addr6; } addr; int udp_port; int tcp_port; }; CARES_EXTERN int ares_set_servers(ares_channel channel, struct ares_addr_node *servers); CARES_EXTERN int ares_set_servers_ports(ares_channel channel, struct ares_addr_port_node *servers); /* Incomming string format: host[:port][,host[:port]]... */ CARES_EXTERN int ares_set_servers_csv(ares_channel channel, const char* servers); CARES_EXTERN int ares_set_servers_ports_csv(ares_channel channel, const char* servers); CARES_EXTERN int ares_get_servers(ares_channel channel, struct ares_addr_node **servers); CARES_EXTERN int ares_get_servers_ports(ares_channel channel, struct ares_addr_port_node **servers); CARES_EXTERN const char *ares_inet_ntop(int af, const void *src, char *dst, ares_socklen_t size); CARES_EXTERN int ares_inet_pton(int af, const char *src, void *dst); #ifdef __cplusplus } #endif #endif /* ARES__H */ ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/include/ares_build.h.cmake0000644000175100001770000000210600000000000023063 0ustar00runnerdocker00000000000000#ifndef __CARES_BUILD_H #define __CARES_BUILD_H #define CARES_TYPEOF_ARES_SOCKLEN_T @CARES_TYPEOF_ARES_SOCKLEN_T@ #define CARES_TYPEOF_ARES_SSIZE_T @CARES_TYPEOF_ARES_SSIZE_T@ /* Prefix names with CARES_ to make sure they don't conflict with other config.h * files. We need to include some dependent headers that may be system specific * for C-Ares */ #cmakedefine CARES_HAVE_SYS_TYPES_H #cmakedefine CARES_HAVE_SYS_SOCKET_H #cmakedefine CARES_HAVE_WINDOWS_H #cmakedefine CARES_HAVE_WS2TCPIP_H #cmakedefine CARES_HAVE_WINSOCK2_H #cmakedefine CARES_HAVE_WINDOWS_H #cmakedefine CARES_HAVE_ARPA_NAMESER_H #cmakedefine CARES_HAVE_ARPA_NAMESER_COMPAT_H #ifdef CARES_HAVE_SYS_TYPES_H # include #endif #ifdef CARES_HAVE_SYS_SOCKET_H # include #endif #ifdef CARES_HAVE_WINSOCK2_H # include #endif #ifdef CARES_HAVE_WS2TCPIP_H # include #endif #ifdef CARES_HAVE_WINDOWS_H # include #endif typedef CARES_TYPEOF_ARES_SOCKLEN_T ares_socklen_t; typedef CARES_TYPEOF_ARES_SSIZE_T ares_ssize_t; #endif /* __CARES_BUILD_H */ ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/include/ares_build.h.dist0000644000175100001770000001536300000000000022757 0ustar00runnerdocker00000000000000#ifndef __CARES_BUILD_H #define __CARES_BUILD_H /* Copyright (C) 2009 - 2021 by Daniel Stenberg et al * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose and without fee is hereby granted, provided * that the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. M.I.T. makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. */ /* ================================================================ */ /* NOTES FOR CONFIGURE CAPABLE SYSTEMS */ /* ================================================================ */ /* * NOTE 1: * ------- * * See file ares_build.h.in, run configure, and forget that this file * exists it is only used for non-configure systems. * But you can keep reading if you want ;-) * */ /* ================================================================ */ /* NOTES FOR NON-CONFIGURE SYSTEMS */ /* ================================================================ */ /* * NOTE 1: * ------- * * Nothing in this file is intended to be modified or adjusted by the * c-ares library user nor by the c-ares library builder. * * If you think that something actually needs to be changed, adjusted * or fixed in this file, then, report it on the c-ares development * mailing list: http://lists.haxx.se/listinfo/c-ares/ * * Try to keep one section per platform, compiler and architecture, * otherwise, if an existing section is reused for a different one and * later on the original is adjusted, probably the piggybacking one can * be adversely changed. * * In order to differentiate between platforms/compilers/architectures * use only compiler built in predefined preprocessor symbols. * * This header file shall only export symbols which are 'cares' or 'CARES' * prefixed, otherwise public name space would be polluted. * * NOTE 2: * ------- * * Right now you might be staring at file ares_build.h.dist or ares_build.h, * this is due to the following reason: file ares_build.h.dist is renamed * to ares_build.h when the c-ares source code distribution archive file is * created. * * File ares_build.h.dist is not included in the distribution archive. * File ares_build.h is not present in the git tree. * * The distributed ares_build.h file is only intended to be used on systems * which can not run the also distributed configure script. * * On systems capable of running the configure script, the configure process * will overwrite the distributed ares_build.h file with one that is suitable * and specific to the library being configured and built, which is generated * from the ares_build.h.in template file. * * If you check out from git on a non-configure platform, you must run the * appropriate buildconf* script to set up ares_build.h and other local files. * */ /* ================================================================ */ /* DEFINITION OF THESE SYMBOLS SHALL NOT TAKE PLACE ANYWHERE ELSE */ /* ================================================================ */ #ifdef CARES_TYPEOF_ARES_SOCKLEN_T # error "CARES_TYPEOF_ARES_SOCKLEN_T shall not be defined except in ares_build.h" Error Compilation_aborted_CARES_TYPEOF_ARES_SOCKLEN_T_already_defined #endif /* ================================================================ */ /* EXTERNAL INTERFACE SETTINGS FOR NON-CONFIGURE SYSTEMS ONLY */ /* ================================================================ */ #if defined(__DJGPP__) || defined(__GO32__) # define CARES_TYPEOF_ARES_SOCKLEN_T int #elif defined(__SALFORDC__) # define CARES_TYPEOF_ARES_SOCKLEN_T int #elif defined(__BORLANDC__) # define CARES_TYPEOF_ARES_SOCKLEN_T int #elif defined(__TURBOC__) # define CARES_TYPEOF_ARES_SOCKLEN_T int #elif defined(__WATCOMC__) # define CARES_TYPEOF_ARES_SOCKLEN_T int #elif defined(__POCC__) # define CARES_TYPEOF_ARES_SOCKLEN_T int #elif defined(__LCC__) # define CARES_TYPEOF_ARES_SOCKLEN_T int #elif defined(__SYMBIAN32__) # define CARES_TYPEOF_ARES_SOCKLEN_T unsigned int #elif defined(__MWERKS__) # define CARES_TYPEOF_ARES_SOCKLEN_T int #elif defined(_WIN32_WCE) # define CARES_TYPEOF_ARES_SOCKLEN_T int #elif defined(__MINGW32__) # define CARES_TYPEOF_ARES_SOCKLEN_T int #elif defined(__VMS) # define CARES_TYPEOF_ARES_SOCKLEN_T unsigned int #elif defined(__OS400__) # if defined(__ILEC400__) # define CARES_TYPEOF_ARES_SOCKLEN_T socklen_t # define CARES_PULL_SYS_TYPES_H 1 # define CARES_PULL_SYS_SOCKET_H 1 # endif #elif defined(__MVS__) # if defined(__IBMC__) || defined(__IBMCPP__) # define CARES_TYPEOF_ARES_SOCKLEN_T socklen_t # define CARES_PULL_SYS_TYPES_H 1 # define CARES_PULL_SYS_SOCKET_H 1 # endif #elif defined(__370__) # if defined(__IBMC__) || defined(__IBMCPP__) # define CARES_TYPEOF_ARES_SOCKLEN_T socklen_t # define CARES_PULL_SYS_TYPES_H 1 # define CARES_PULL_SYS_SOCKET_H 1 # endif #elif defined(TPF) # define CARES_TYPEOF_ARES_SOCKLEN_T int /* ===================================== */ /* KEEP MSVC THE PENULTIMATE ENTRY */ /* ===================================== */ #elif defined(_MSC_VER) # define CARES_TYPEOF_ARES_SOCKLEN_T int /* ===================================== */ /* KEEP GENERIC GCC THE LAST ENTRY */ /* ===================================== */ #elif defined(__GNUC__) # define CARES_TYPEOF_ARES_SOCKLEN_T socklen_t # define CARES_PULL_SYS_TYPES_H 1 # define CARES_PULL_SYS_SOCKET_H 1 #else # error "Unknown non-configure build target!" Error Compilation_aborted_Unknown_non_configure_build_target #endif /* CARES_PULL_SYS_TYPES_H is defined above when inclusion of header file */ /* sys/types.h is required here to properly make type definitions below. */ #ifdef CARES_PULL_SYS_TYPES_H # include #endif /* CARES_PULL_SYS_SOCKET_H is defined above when inclusion of header file */ /* sys/socket.h is required here to properly make type definitions below. */ #ifdef CARES_PULL_SYS_SOCKET_H # include #endif /* Data type definition of ares_socklen_t. */ #ifdef CARES_TYPEOF_ARES_SOCKLEN_T typedef CARES_TYPEOF_ARES_SOCKLEN_T ares_socklen_t; #endif /* Data type definition of ares_ssize_t. */ #ifdef _WIN32 # ifdef _WIN64 # define CARES_TYPEOF_ARES_SSIZE_T __int64 # else # define CARES_TYPEOF_ARES_SSIZE_T long # endif #else # define CARES_TYPEOF_ARES_SSIZE_T ssize_t #endif typedef CARES_TYPEOF_ARES_SSIZE_T ares_ssize_t; #endif /* __CARES_BUILD_H */ ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/include/ares_build.h.in0000644000175100001770000000733500000000000022422 0ustar00runnerdocker00000000000000#ifndef __CARES_BUILD_H #define __CARES_BUILD_H /* Copyright (C) 2009 - 2021 by Daniel Stenberg et al * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose and without fee is hereby granted, provided * that the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. M.I.T. makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. */ /* ================================================================ */ /* NOTES FOR CONFIGURE CAPABLE SYSTEMS */ /* ================================================================ */ /* * NOTE 1: * ------- * * Nothing in this file is intended to be modified or adjusted by the * c-ares library user nor by the c-ares library builder. * * If you think that something actually needs to be changed, adjusted * or fixed in this file, then, report it on the c-ares development * mailing list: http://lists.haxx.se/listinfo/c-ares/ * * This header file shall only export symbols which are 'cares' or 'CARES' * prefixed, otherwise public name space would be polluted. * * NOTE 2: * ------- * * Right now you might be staring at file ares_build.h.in or ares_build.h, * this is due to the following reason: * * On systems capable of running the configure script, the configure process * will overwrite the distributed ares_build.h file with one that is suitable * and specific to the library being configured and built, which is generated * from the ares_build.h.in template file. * */ /* ================================================================ */ /* DEFINITION OF THESE SYMBOLS SHALL NOT TAKE PLACE ANYWHERE ELSE */ /* ================================================================ */ #ifdef CARES_TYPEOF_ARES_SOCKLEN_T # error "CARES_TYPEOF_ARES_SOCKLEN_T shall not be defined except in ares_build.h" Error Compilation_aborted_CARES_TYPEOF_ARES_SOCKLEN_T_already_defined #endif #undef CARES_HAVE_ARPA_NAMESER_H #undef CARES_HAVE_ARPA_NAMESER_COMPAT_H /* ================================================================ */ /* EXTERNAL INTERFACE SETTINGS FOR CONFIGURE CAPABLE SYSTEMS ONLY */ /* ================================================================ */ /* Configure process defines this to 1 when it finds out that system */ /* header file ws2tcpip.h must be included by the external interface. */ #undef CARES_PULL_WS2TCPIP_H #ifdef CARES_PULL_WS2TCPIP_H # ifndef WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN # endif # include # include # include #endif /* Configure process defines this to 1 when it finds out that system */ /* header file sys/types.h must be included by the external interface. */ #undef CARES_PULL_SYS_TYPES_H #ifdef CARES_PULL_SYS_TYPES_H # include #endif /* Configure process defines this to 1 when it finds out that system */ /* header file sys/socket.h must be included by the external interface. */ #undef CARES_PULL_SYS_SOCKET_H #ifdef CARES_PULL_SYS_SOCKET_H # include #endif /* Integral data type used for ares_socklen_t. */ #undef CARES_TYPEOF_ARES_SOCKLEN_T /* Data type definition of ares_socklen_t. */ typedef CARES_TYPEOF_ARES_SOCKLEN_T ares_socklen_t; /* Integral data type used for ares_ssize_t. */ #undef CARES_TYPEOF_ARES_SSIZE_T /* Data type definition of ares_ssize_t. */ typedef CARES_TYPEOF_ARES_SSIZE_T ares_ssize_t; #endif /* __CARES_BUILD_H */ ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/include/ares_dns.h0000644000175100001770000001264400000000000021501 0ustar00runnerdocker00000000000000#ifndef HEADER_CARES_DNS_H #define HEADER_CARES_DNS_H /* Copyright 1998, 2011 by the Massachusetts Institute of Technology. * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ /* * NOTE TO INTEGRATORS: * * This header is made public due to legacy projects relying on it. * Please do not use the macros within this header, or include this * header in your project as it may be removed in the future. */ /* * Macro DNS__16BIT reads a network short (16 bit) given in network * byte order, and returns its value as an unsigned short. */ #define DNS__16BIT(p) ((unsigned short)((unsigned int) 0xffff & \ (((unsigned int)((unsigned char)(p)[0]) << 8U) | \ ((unsigned int)((unsigned char)(p)[1]))))) /* * Macro DNS__32BIT reads a network long (32 bit) given in network * byte order, and returns its value as an unsigned int. */ #define DNS__32BIT(p) ((unsigned int) \ (((unsigned int)((unsigned char)(p)[0]) << 24U) | \ ((unsigned int)((unsigned char)(p)[1]) << 16U) | \ ((unsigned int)((unsigned char)(p)[2]) << 8U) | \ ((unsigned int)((unsigned char)(p)[3])))) #define DNS__SET16BIT(p, v) (((p)[0] = (unsigned char)(((v) >> 8) & 0xff)), \ ((p)[1] = (unsigned char)((v) & 0xff))) #define DNS__SET32BIT(p, v) (((p)[0] = (unsigned char)(((v) >> 24) & 0xff)), \ ((p)[1] = (unsigned char)(((v) >> 16) & 0xff)), \ ((p)[2] = (unsigned char)(((v) >> 8) & 0xff)), \ ((p)[3] = (unsigned char)((v) & 0xff))) #if 0 /* we cannot use this approach on systems where we can't access 16/32 bit data on un-aligned addresses */ #define DNS__16BIT(p) ntohs(*(unsigned short*)(p)) #define DNS__32BIT(p) ntohl(*(unsigned long*)(p)) #define DNS__SET16BIT(p, v) *(unsigned short*)(p) = htons(v) #define DNS__SET32BIT(p, v) *(unsigned long*)(p) = htonl(v) #endif /* Macros for parsing a DNS header */ #define DNS_HEADER_QID(h) DNS__16BIT(h) #define DNS_HEADER_QR(h) (((h)[2] >> 7) & 0x1) #define DNS_HEADER_OPCODE(h) (((h)[2] >> 3) & 0xf) #define DNS_HEADER_AA(h) (((h)[2] >> 2) & 0x1) #define DNS_HEADER_TC(h) (((h)[2] >> 1) & 0x1) #define DNS_HEADER_RD(h) ((h)[2] & 0x1) #define DNS_HEADER_RA(h) (((h)[3] >> 7) & 0x1) #define DNS_HEADER_Z(h) (((h)[3] >> 4) & 0x7) #define DNS_HEADER_RCODE(h) ((h)[3] & 0xf) #define DNS_HEADER_QDCOUNT(h) DNS__16BIT((h) + 4) #define DNS_HEADER_ANCOUNT(h) DNS__16BIT((h) + 6) #define DNS_HEADER_NSCOUNT(h) DNS__16BIT((h) + 8) #define DNS_HEADER_ARCOUNT(h) DNS__16BIT((h) + 10) /* Macros for constructing a DNS header */ #define DNS_HEADER_SET_QID(h, v) DNS__SET16BIT(h, v) #define DNS_HEADER_SET_QR(h, v) ((h)[2] |= (unsigned char)(((v) & 0x1) << 7)) #define DNS_HEADER_SET_OPCODE(h, v) ((h)[2] |= (unsigned char)(((v) & 0xf) << 3)) #define DNS_HEADER_SET_AA(h, v) ((h)[2] |= (unsigned char)(((v) & 0x1) << 2)) #define DNS_HEADER_SET_TC(h, v) ((h)[2] |= (unsigned char)(((v) & 0x1) << 1)) #define DNS_HEADER_SET_RD(h, v) ((h)[2] |= (unsigned char)((v) & 0x1)) #define DNS_HEADER_SET_RA(h, v) ((h)[3] |= (unsigned char)(((v) & 0x1) << 7)) #define DNS_HEADER_SET_Z(h, v) ((h)[3] |= (unsigned char)(((v) & 0x7) << 4)) #define DNS_HEADER_SET_RCODE(h, v) ((h)[3] |= (unsigned char)((v) & 0xf)) #define DNS_HEADER_SET_QDCOUNT(h, v) DNS__SET16BIT((h) + 4, v) #define DNS_HEADER_SET_ANCOUNT(h, v) DNS__SET16BIT((h) + 6, v) #define DNS_HEADER_SET_NSCOUNT(h, v) DNS__SET16BIT((h) + 8, v) #define DNS_HEADER_SET_ARCOUNT(h, v) DNS__SET16BIT((h) + 10, v) /* Macros for parsing the fixed part of a DNS question */ #define DNS_QUESTION_TYPE(q) DNS__16BIT(q) #define DNS_QUESTION_CLASS(q) DNS__16BIT((q) + 2) /* Macros for constructing the fixed part of a DNS question */ #define DNS_QUESTION_SET_TYPE(q, v) DNS__SET16BIT(q, v) #define DNS_QUESTION_SET_CLASS(q, v) DNS__SET16BIT((q) + 2, v) /* Macros for parsing the fixed part of a DNS resource record */ #define DNS_RR_TYPE(r) DNS__16BIT(r) #define DNS_RR_CLASS(r) DNS__16BIT((r) + 2) #define DNS_RR_TTL(r) DNS__32BIT((r) + 4) #define DNS_RR_LEN(r) DNS__16BIT((r) + 8) /* Macros for constructing the fixed part of a DNS resource record */ #define DNS_RR_SET_TYPE(r, v) DNS__SET16BIT(r, v) #define DNS_RR_SET_CLASS(r, v) DNS__SET16BIT((r) + 2, v) #define DNS_RR_SET_TTL(r, v) DNS__SET32BIT((r) + 4, v) #define DNS_RR_SET_LEN(r, v) DNS__SET16BIT((r) + 8, v) #endif /* HEADER_CARES_DNS_H */ ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/include/ares_nameser.h0000644000175100001770000003220700000000000022344 0ustar00runnerdocker00000000000000 #ifndef ARES_NAMESER_H #define ARES_NAMESER_H #include "ares_build.h" #ifdef CARES_HAVE_ARPA_NAMESER_H # include #endif #ifdef CARES_HAVE_ARPA_NAMESER_COMPAT_H # include #endif /* ============================================================================ * arpa/nameser.h may or may not provide ALL of the below defines, so check * each one individually and set if not * ============================================================================ */ #ifndef NS_PACKETSZ # define NS_PACKETSZ 512 /* maximum packet size */ #endif #ifndef NS_MAXDNAME # define NS_MAXDNAME 256 /* maximum domain name */ #endif #ifndef NS_MAXCDNAME # define NS_MAXCDNAME 255 /* maximum compressed domain name */ #endif #ifndef NS_MAXLABEL # define NS_MAXLABEL 63 #endif #ifndef NS_HFIXEDSZ # define NS_HFIXEDSZ 12 /* #/bytes of fixed data in header */ #endif #ifndef NS_QFIXEDSZ # define NS_QFIXEDSZ 4 /* #/bytes of fixed data in query */ #endif #ifndef NS_RRFIXEDSZ # define NS_RRFIXEDSZ 10 /* #/bytes of fixed data in r record */ #endif #ifndef NS_INT16SZ # define NS_INT16SZ 2 #endif #ifndef NS_INADDRSZ # define NS_INADDRSZ 4 #endif #ifndef NS_IN6ADDRSZ # define NS_IN6ADDRSZ 16 #endif #ifndef NS_CMPRSFLGS # define NS_CMPRSFLGS 0xc0 /* Flag bits indicating name compression. */ #endif #ifndef NS_DEFAULTPORT # define NS_DEFAULTPORT 53 /* For both TCP and UDP. */ #endif /* ============================================================================ * arpa/nameser.h should provide these enumerations always, so if not found, * provide them * ============================================================================ */ #ifndef CARES_HAVE_ARPA_NAMESER_H typedef enum __ns_class { ns_c_invalid = 0, /* Cookie. */ ns_c_in = 1, /* Internet. */ ns_c_2 = 2, /* unallocated/unsupported. */ ns_c_chaos = 3, /* MIT Chaos-net. */ ns_c_hs = 4, /* MIT Hesiod. */ /* Query class values which do not appear in resource records */ ns_c_none = 254, /* for prereq. sections in update requests */ ns_c_any = 255, /* Wildcard match. */ ns_c_max = 65536 } ns_class; typedef enum __ns_type { ns_t_invalid = 0, /* Cookie. */ ns_t_a = 1, /* Host address. */ ns_t_ns = 2, /* Authoritative server. */ ns_t_md = 3, /* Mail destination. */ ns_t_mf = 4, /* Mail forwarder. */ ns_t_cname = 5, /* Canonical name. */ ns_t_soa = 6, /* Start of authority zone. */ ns_t_mb = 7, /* Mailbox domain name. */ ns_t_mg = 8, /* Mail group member. */ ns_t_mr = 9, /* Mail rename name. */ ns_t_null = 10, /* Null resource record. */ ns_t_wks = 11, /* Well known service. */ ns_t_ptr = 12, /* Domain name pointer. */ ns_t_hinfo = 13, /* Host information. */ ns_t_minfo = 14, /* Mailbox information. */ ns_t_mx = 15, /* Mail routing information. */ ns_t_txt = 16, /* Text strings. */ ns_t_rp = 17, /* Responsible person. */ ns_t_afsdb = 18, /* AFS cell database. */ ns_t_x25 = 19, /* X_25 calling address. */ ns_t_isdn = 20, /* ISDN calling address. */ ns_t_rt = 21, /* Router. */ ns_t_nsap = 22, /* NSAP address. */ ns_t_nsap_ptr = 23, /* Reverse NSAP lookup (deprecated). */ ns_t_sig = 24, /* Security signature. */ ns_t_key = 25, /* Security key. */ ns_t_px = 26, /* X.400 mail mapping. */ ns_t_gpos = 27, /* Geographical position (withdrawn). */ ns_t_aaaa = 28, /* Ip6 Address. */ ns_t_loc = 29, /* Location Information. */ ns_t_nxt = 30, /* Next domain (security). */ ns_t_eid = 31, /* Endpoint identifier. */ ns_t_nimloc = 32, /* Nimrod Locator. */ ns_t_srv = 33, /* Server Selection. */ ns_t_atma = 34, /* ATM Address */ ns_t_naptr = 35, /* Naming Authority PoinTeR */ ns_t_kx = 36, /* Key Exchange */ ns_t_cert = 37, /* Certification record */ ns_t_a6 = 38, /* IPv6 address (deprecates AAAA) */ ns_t_dname = 39, /* Non-terminal DNAME (for IPv6) */ ns_t_sink = 40, /* Kitchen sink (experimentatl) */ ns_t_opt = 41, /* EDNS0 option (meta-RR) */ ns_t_apl = 42, /* Address prefix list (RFC3123) */ ns_t_ds = 43, /* Delegation Signer (RFC4034) */ ns_t_sshfp = 44, /* SSH Key Fingerprint (RFC4255) */ ns_t_rrsig = 46, /* Resource Record Signature (RFC4034) */ ns_t_nsec = 47, /* Next Secure (RFC4034) */ ns_t_dnskey = 48, /* DNS Public Key (RFC4034) */ ns_t_tkey = 249, /* Transaction key */ ns_t_tsig = 250, /* Transaction signature. */ ns_t_ixfr = 251, /* Incremental zone transfer. */ ns_t_axfr = 252, /* Transfer zone of authority. */ ns_t_mailb = 253, /* Transfer mailbox records. */ ns_t_maila = 254, /* Transfer mail agent records. */ ns_t_any = 255, /* Wildcard match. */ ns_t_uri = 256, /* Uniform Resource Identifier (RFC7553) */ ns_t_caa = 257, /* Certification Authority Authorization. */ ns_t_max = 65536 } ns_type; typedef enum __ns_opcode { ns_o_query = 0, /* Standard query. */ ns_o_iquery = 1, /* Inverse query (deprecated/unsupported). */ ns_o_status = 2, /* Name server status query (unsupported). */ /* Opcode 3 is undefined/reserved. */ ns_o_notify = 4, /* Zone change notification. */ ns_o_update = 5, /* Zone update message. */ ns_o_max = 6 } ns_opcode; typedef enum __ns_rcode { ns_r_noerror = 0, /* No error occurred. */ ns_r_formerr = 1, /* Format error. */ ns_r_servfail = 2, /* Server failure. */ ns_r_nxdomain = 3, /* Name error. */ ns_r_notimpl = 4, /* Unimplemented. */ ns_r_refused = 5, /* Operation refused. */ /* these are for BIND_UPDATE */ ns_r_yxdomain = 6, /* Name exists */ ns_r_yxrrset = 7, /* RRset exists */ ns_r_nxrrset = 8, /* RRset does not exist */ ns_r_notauth = 9, /* Not authoritative for zone */ ns_r_notzone = 10, /* Zone of record different from zone section */ ns_r_max = 11, /* The following are TSIG extended errors */ ns_r_badsig = 16, ns_r_badkey = 17, ns_r_badtime = 18 } ns_rcode; #endif /* CARES_HAVE_ARPA_NAMESER_H */ /* ============================================================================ * arpa/nameser_compat.h typically sets these. However on some systems * arpa/nameser.h does, but may not set all of them. Lets conditionally * define each * ============================================================================ */ #ifndef PACKETSZ # define PACKETSZ NS_PACKETSZ #endif #ifndef MAXDNAME # define MAXDNAME NS_MAXDNAME #endif #ifndef MAXCDNAME # define MAXCDNAME NS_MAXCDNAME #endif #ifndef MAXLABEL # define MAXLABEL NS_MAXLABEL #endif #ifndef HFIXEDSZ # define HFIXEDSZ NS_HFIXEDSZ #endif #ifndef QFIXEDSZ # define QFIXEDSZ NS_QFIXEDSZ #endif #ifndef RRFIXEDSZ # define RRFIXEDSZ NS_RRFIXEDSZ #endif #ifndef INDIR_MASK # define INDIR_MASK NS_CMPRSFLGS #endif #ifndef NAMESERVER_PORT # define NAMESERVER_PORT NS_DEFAULTPORT #endif /* opcodes */ #ifndef O_QUERY # define O_QUERY 0 /* ns_o_query */ #endif #ifndef O_IQUERY # define O_IQUERY 1 /* ns_o_iquery */ #endif #ifndef O_STATUS # define O_STATUS 2 /* ns_o_status */ #endif #ifndef O_NOTIFY # define O_NOTIFY 4 /* ns_o_notify */ #endif #ifndef O_UPDATE # define O_UPDATE 5 /* ns_o_update */ #endif /* response codes */ #ifndef SERVFAIL # define SERVFAIL ns_r_servfail #endif #ifndef NOTIMP # define NOTIMP ns_r_notimpl #endif #ifndef REFUSED # define REFUSED ns_r_refused #endif #if defined(_WIN32) && !defined(HAVE_ARPA_NAMESER_COMPAT_H) && defined(NOERROR) # undef NOERROR /* it seems this is already defined in winerror.h */ #endif #ifndef NOERROR # define NOERROR ns_r_noerror #endif #ifndef FORMERR # define FORMERR ns_r_formerr #endif #ifndef NXDOMAIN # define NXDOMAIN ns_r_nxdomain #endif /* Non-standard response codes, use numeric values */ #ifndef YXDOMAIN # define YXDOMAIN 6 /* ns_r_yxdomain */ #endif #ifndef YXRRSET # define YXRRSET 7 /* ns_r_yxrrset */ #endif #ifndef NXRRSET # define NXRRSET 8 /* ns_r_nxrrset */ #endif #ifndef NOTAUTH # define NOTAUTH 9 /* ns_r_notauth */ #endif #ifndef NOTZONE # define NOTZONE 10 /* ns_r_notzone */ #endif #ifndef TSIG_BADSIG # define TSIG_BADSIG 16 /* ns_r_badsig */ #endif #ifndef TSIG_BADKEY # define TSIG_BADKEY 17 /* ns_r_badkey */ #endif #ifndef TSIG_BADTIME # define TSIG_BADTIME 18 /* ns_r_badtime */ #endif /* classes */ #ifndef C_IN # define C_IN 1 /* ns_c_in */ #endif #ifndef C_CHAOS # define C_CHAOS 3 /* ns_c_chaos */ #endif #ifndef C_HS # define C_HS 4 /* ns_c_hs */ #endif #ifndef C_NONE # define C_NONE 254 /* ns_c_none */ #endif #ifndef C_ANY # define C_ANY 255 /* ns_c_any */ #endif /* types */ #ifndef T_A # define T_A 1 /* ns_t_a */ #endif #ifndef T_NS # define T_NS 2 /* ns_t_ns */ #endif #ifndef T_MD # define T_MD 3 /* ns_t_md */ #endif #ifndef T_MF # define T_MF 4 /* ns_t_mf */ #endif #ifndef T_CNAME # define T_CNAME 5 /* ns_t_cname */ #endif #ifndef T_SOA # define T_SOA 6 /* ns_t_soa */ #endif #ifndef T_MB # define T_MB 7 /* ns_t_mb */ #endif #ifndef T_MG # define T_MG 8 /* ns_t_mg */ #endif #ifndef T_MR # define T_MR 9 /* ns_t_mr */ #endif #ifndef T_NULL # define T_NULL 10 /* ns_t_null */ #endif #ifndef T_WKS # define T_WKS 11 /* ns_t_wks */ #endif #ifndef T_PTR # define T_PTR 12 /* ns_t_ptr */ #endif #ifndef T_HINFO # define T_HINFO 13 /* ns_t_hinfo */ #endif #ifndef T_MINFO # define T_MINFO 14 /* ns_t_minfo */ #endif #ifndef T_MX # define T_MX 15 /* ns_t_mx */ #endif #ifndef T_TXT # define T_TXT 16 /* ns_t_txt */ #endif #ifndef T_RP # define T_RP 17 /* ns_t_rp */ #endif #ifndef T_AFSDB # define T_AFSDB 18 /* ns_t_afsdb */ #endif #ifndef T_X25 # define T_X25 19 /* ns_t_x25 */ #endif #ifndef T_ISDN # define T_ISDN 20 /* ns_t_isdn */ #endif #ifndef T_RT # define T_RT 21 /* ns_t_rt */ #endif #ifndef T_NSAP # define T_NSAP 22 /* ns_t_nsap */ #endif #ifndef T_NSAP_PTR # define T_NSAP_PTR 23 /* ns_t_nsap_ptr */ #endif #ifndef T_SIG # define T_SIG 24 /* ns_t_sig */ #endif #ifndef T_KEY # define T_KEY 25 /* ns_t_key */ #endif #ifndef T_PX # define T_PX 26 /* ns_t_px */ #endif #ifndef T_GPOS # define T_GPOS 27 /* ns_t_gpos */ #endif #ifndef T_AAAA # define T_AAAA 28 /* ns_t_aaaa */ #endif #ifndef T_LOC # define T_LOC 29 /* ns_t_loc */ #endif #ifndef T_NXT # define T_NXT 30 /* ns_t_nxt */ #endif #ifndef T_EID # define T_EID 31 /* ns_t_eid */ #endif #ifndef T_NIMLOC # define T_NIMLOC 32 /* ns_t_nimloc */ #endif #ifndef T_SRV # define T_SRV 33 /* ns_t_srv */ #endif #ifndef T_ATMA # define T_ATMA 34 /* ns_t_atma */ #endif #ifndef T_NAPTR # define T_NAPTR 35 /* ns_t_naptr */ #endif #ifndef T_KX # define T_KX 36 /* ns_t_kx */ #endif #ifndef T_CERT # define T_CERT 37 /* ns_t_cert */ #endif #ifndef T_A6 # define T_A6 38 /* ns_t_a6 */ #endif #ifndef T_DNAME # define T_DNAME 39 /* ns_t_dname */ #endif #ifndef T_SINK # define T_SINK 40 /* ns_t_sink */ #endif #ifndef T_OPT # define T_OPT 41 /* ns_t_opt */ #endif #ifndef T_APL # define T_APL 42 /* ns_t_apl */ #endif #ifndef T_DS # define T_DS 43 /* ns_t_ds */ #endif #ifndef T_SSHFP # define T_SSHFP 44 /* ns_t_sshfp */ #endif #ifndef T_RRSIG # define T_RRSIG 46 /* ns_t_rrsig */ #endif #ifndef T_NSEC # define T_NSEC 47 /* ns_t_nsec */ #endif #ifndef T_DNSKEY # define T_DNSKEY 48 /* ns_t_dnskey */ #endif #ifndef T_TKEY # define T_TKEY 249 /* ns_t_tkey */ #endif #ifndef T_TSIG # define T_TSIG 250 /* ns_t_tsig */ #endif #ifndef T_IXFR # define T_IXFR 251 /* ns_t_ixfr */ #endif #ifndef T_AXFR # define T_AXFR 252 /* ns_t_axfr */ #endif #ifndef T_MAILB # define T_MAILB 253 /* ns_t_mailb */ #endif #ifndef T_MAILA # define T_MAILA 254 /* ns_t_maila */ #endif #ifndef T_ANY # define T_ANY 255 /* ns_t_any */ #endif #ifndef T_URI # define T_URI 256 /* ns_t_uri */ #endif #ifndef T_CAA # define T_CAA 257 /* ns_t_caa */ #endif #ifndef T_MAX # define T_MAX 65536 /* ns_t_max */ #endif #endif /* ARES_NAMESER_H */ ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/include/ares_rules.h0000644000175100001770000001026200000000000022041 0ustar00runnerdocker00000000000000#ifndef __CARES_RULES_H #define __CARES_RULES_H /* Copyright (C) 2009 - 2021 by Daniel Stenberg et al * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose and without fee is hereby granted, provided * that the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. M.I.T. makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. */ /* ================================================================ */ /* COMPILE TIME SANITY CHECKS */ /* ================================================================ */ /* * NOTE 1: * ------- * * All checks done in this file are intentionally placed in a public * header file which is pulled by ares.h when an application is * being built using an already built c-ares library. Additionally * this file is also included and used when building the library. * * If compilation fails on this file it is certainly sure that the * problem is elsewhere. It could be a problem in the ares_build.h * header file, or simply that you are using different compilation * settings than those used to build the library. * * Nothing in this file is intended to be modified or adjusted by the * c-ares library user nor by the c-ares library builder. * * Do not deactivate any check, these are done to make sure that the * library is properly built and used. * * You can find further help on the c-ares development mailing list: * http://lists.haxx.se/listinfo/c-ares/ * * NOTE 2 * ------ * * Some of the following compile time checks are based on the fact * that the dimension of a constant array can not be a negative one. * In this way if the compile time verification fails, the compilation * will fail issuing an error. The error description wording is compiler * dependent but it will be quite similar to one of the following: * * "negative subscript or subscript is too large" * "array must have at least one element" * "-1 is an illegal array size" * "size of array is negative" * * If you are building an application which tries to use an already * built c-ares library and you are getting this kind of errors on * this file, it is a clear indication that there is a mismatch between * how the library was built and how you are trying to use it for your * application. Your already compiled or binary library provider is the * only one who can give you the details you need to properly use it. */ /* * Verify that some macros are actually defined. */ #ifndef CARES_TYPEOF_ARES_SOCKLEN_T # error "CARES_TYPEOF_ARES_SOCKLEN_T definition is missing!" Error Compilation_aborted_CARES_TYPEOF_ARES_SOCKLEN_T_is_missing #endif /* * Macros private to this header file. */ #define CareschkszEQ(t, s) sizeof(t) == s ? 1 : -1 #define CareschkszGE(t1, t2) sizeof(t1) >= sizeof(t2) ? 1 : -1 /* * Verify that the size previously defined and expected for * ares_socklen_t is actually the same as the one reported * by sizeof() at compile time. */ typedef char __cares_rule_02__ [CareschkszEQ(ares_socklen_t, sizeof(CARES_TYPEOF_ARES_SOCKLEN_T))]; /* * Verify at compile time that the size of ares_socklen_t as reported * by sizeof() is greater or equal than the one reported for int for * the current compilation. */ typedef char __cares_rule_03__ [CareschkszGE(ares_socklen_t, int)]; /* ================================================================ */ /* EXTERNALLY AND INTERNALLY VISIBLE DEFINITIONS */ /* ================================================================ */ /* * Get rid of macros private to this header file. */ #undef CareschkszEQ #undef CareschkszGE /* * Get rid of macros not intended to exist beyond this point. */ #undef CARES_PULL_WS2TCPIP_H #undef CARES_PULL_SYS_TYPES_H #undef CARES_PULL_SYS_SOCKET_H #undef CARES_TYPEOF_ARES_SOCKLEN_T #endif /* __CARES_RULES_H */ ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/include/ares_version.h0000644000175100001770000000121000000000000022365 0ustar00runnerdocker00000000000000 #ifndef ARES__VERSION_H #define ARES__VERSION_H /* This is the global package copyright */ #define ARES_COPYRIGHT "2004 - 2021 Daniel Stenberg, ." #define ARES_VERSION_MAJOR 1 #define ARES_VERSION_MINOR 18 #define ARES_VERSION_PATCH 1 #define ARES_VERSION ((ARES_VERSION_MAJOR<<16)|\ (ARES_VERSION_MINOR<<8)|\ (ARES_VERSION_PATCH)) #define ARES_VERSION_STR "1.18.1" #if (ARES_VERSION >= 0x010700) # define CARES_HAVE_ARES_LIBRARY_INIT 1 # define CARES_HAVE_ARES_LIBRARY_CLEANUP 1 #else # undef CARES_HAVE_ARES_LIBRARY_INIT # undef CARES_HAVE_ARES_LIBRARY_CLEANUP #endif #endif ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/libcares.pc.cmake0000644000175100001770000000125000000000000021265 0ustar00runnerdocker00000000000000#*************************************************************************** # Project ___ __ _ _ __ ___ ___ # / __|____ / _` | '__/ _ \/ __| # | (_|_____| (_| | | | __/\__ \ # \___| \__,_|_| \___||___/ # prefix=@CMAKE_INSTALL_PREFIX@ exec_prefix=${prefix}/@CMAKE_INSTALL_BINDIR@ libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@ includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@ Name: c-ares URL: https://c-ares.org/ Description: asynchronous DNS lookup library Version: @CARES_VERSION@ Requires: Requires.private: Cflags: -I${includedir} @CPPFLAG_CARES_STATICLIB@ Libs: -L${libdir} -lcares Libs.private: @CARES_PRIVATE_LIBS@ ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/libcares.pc.in0000644000175100001770000000112000000000000020607 0ustar00runnerdocker00000000000000#*************************************************************************** # Project ___ __ _ _ __ ___ ___ # / __|____ / _` | '__/ _ \/ __| # | (_|_____| (_| | | | __/\__ \ # \___| \__,_|_| \___||___/ # prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: c-ares URL: http://c-ares.org/ Description: asynchronous DNS lookup library Version: @VERSION@ Requires: Requires.private: Cflags: -I${includedir} @CPPFLAG_CARES_STATICLIB@ Libs: -L${libdir} -lcares Libs.private: @CARES_PRIVATE_LIBS@ ././@PaxHeader0000000000000000000000000000003300000000000011451 xustar000000000000000027 mtime=1696604226.991415 pycares-4.4.0/deps/c-ares/m4/0000755000175100001770000000000000000000000016420 5ustar00runnerdocker00000000000000././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/m4/.gitignore0000644000175100001770000000011600000000000020406 0ustar00runnerdocker00000000000000libtool.m4 libtool.m4.tmp ltoptions.m4 ltsugar.m4 ltversion.m4 lt~obsolete.m4 ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/m4/ax_ac_append_to_file.m40000644000175100001770000000162200000000000022766 0ustar00runnerdocker00000000000000# =========================================================================== # https://www.gnu.org/software/autoconf-archive/ax_ac_append_to_file.html # =========================================================================== # # SYNOPSIS # # AX_AC_APPEND_TO_FILE([FILE],[DATA]) # # DESCRIPTION # # Appends the specified data to the specified Autoconf is run. If you want # to append to a file when configure is run use AX_APPEND_TO_FILE instead. # # LICENSE # # Copyright (c) 2009 Allan Caffee # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. This file is offered as-is, without any # warranty. #serial 10 AC_DEFUN([AX_AC_APPEND_TO_FILE],[ AC_REQUIRE([AX_FILE_ESCAPES]) m4_esyscmd( AX_FILE_ESCAPES [ printf "%s" "$2" >> "$1" ]) ]) ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/m4/ax_ac_print_to_file.m40000644000175100001770000000161100000000000022651 0ustar00runnerdocker00000000000000# =========================================================================== # https://www.gnu.org/software/autoconf-archive/ax_ac_print_to_file.html # =========================================================================== # # SYNOPSIS # # AX_AC_PRINT_TO_FILE([FILE],[DATA]) # # DESCRIPTION # # Writes the specified data to the specified file when Autoconf is run. If # you want to print to a file when configure is run use AX_PRINT_TO_FILE # instead. # # LICENSE # # Copyright (c) 2009 Allan Caffee # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. This file is offered as-is, without any # warranty. #serial 10 AC_DEFUN([AX_AC_PRINT_TO_FILE],[ m4_esyscmd( AC_REQUIRE([AX_FILE_ESCAPES]) [ printf "%s" "$2" > "$1" ]) ]) ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/m4/ax_add_am_macro_static.m40000644000175100001770000000152500000000000023312 0ustar00runnerdocker00000000000000# =========================================================================== # https://www.gnu.org/software/autoconf-archive/ax_add_am_macro_static.html # =========================================================================== # # SYNOPSIS # # AX_ADD_AM_MACRO_STATIC([RULE]) # # DESCRIPTION # # Adds the specified rule to $AMINCLUDE. # # LICENSE # # Copyright (c) 2009 Tom Howard # Copyright (c) 2009 Allan Caffee # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. This file is offered as-is, without any # warranty. #serial 8 AC_DEFUN([AX_ADD_AM_MACRO_STATIC],[ AC_REQUIRE([AX_AM_MACROS_STATIC]) AX_AC_APPEND_TO_FILE(AMINCLUDE_STATIC,[$1]) ]) ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/m4/ax_am_macros_static.m40000644000175100001770000000212500000000000022662 0ustar00runnerdocker00000000000000# =========================================================================== # https://www.gnu.org/software/autoconf-archive/ax_am_macros_static.html # =========================================================================== # # SYNOPSIS # # AX_AM_MACROS_STATIC # # DESCRIPTION # # Adds support for macros that create Automake rules. You must manually # add the following line # # include $(top_srcdir)/aminclude_static.am # # to your Makefile.am files. # # LICENSE # # Copyright (c) 2009 Tom Howard # Copyright (c) 2009 Allan Caffee # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. This file is offered as-is, without any # warranty. #serial 11 AC_DEFUN([AMINCLUDE_STATIC],[aminclude_static.am]) AC_DEFUN([AX_AM_MACROS_STATIC], [ AX_AC_PRINT_TO_FILE(AMINCLUDE_STATIC,[ # ]AMINCLUDE_STATIC[ generated automatically by Autoconf # from AX_AM_MACROS_STATIC on ]m4_esyscmd([LC_ALL=C date])[ ]) ]) ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/m4/ax_check_gnu_make.m40000644000175100001770000000772700000000000022312 0ustar00runnerdocker00000000000000# =========================================================================== # https://www.gnu.org/software/autoconf-archive/ax_check_gnu_make.html # =========================================================================== # # SYNOPSIS # # AX_CHECK_GNU_MAKE([run-if-true],[run-if-false]) # # DESCRIPTION # # This macro searches for a GNU version of make. If a match is found: # # * The makefile variable `ifGNUmake' is set to the empty string, otherwise # it is set to "#". This is useful for including a special features in a # Makefile, which cannot be handled by other versions of make. # * The makefile variable `ifnGNUmake' is set to #, otherwise # it is set to the empty string. This is useful for including a special # features in a Makefile, which can be handled # by other versions of make or to specify else like clause. # * The variable `_cv_gnu_make_command` is set to the command to invoke # GNU make if it exists, the empty string otherwise. # * The variable `ax_cv_gnu_make_command` is set to the command to invoke # GNU make by copying `_cv_gnu_make_command`, otherwise it is unset. # * If GNU Make is found, its version is extracted from the output of # `make --version` as the last field of a record of space-separated # columns and saved into the variable `ax_check_gnu_make_version`. # * Additionally if GNU Make is found, run shell code run-if-true # else run shell code run-if-false. # # Here is an example of its use: # # Makefile.in might contain: # # # A failsafe way of putting a dependency rule into a makefile # $(DEPEND): # $(CC) -MM $(srcdir)/*.c > $(DEPEND) # # @ifGNUmake@ ifeq ($(DEPEND),$(wildcard $(DEPEND))) # @ifGNUmake@ include $(DEPEND) # @ifGNUmake@ else # fallback code # @ifGNUmake@ endif # # Then configure.in would normally contain: # # AX_CHECK_GNU_MAKE() # AC_OUTPUT(Makefile) # # Then perhaps to cause gnu make to override any other make, we could do # something like this (note that GNU make always looks for GNUmakefile # first): # # if ! test x$_cv_gnu_make_command = x ; then # mv Makefile GNUmakefile # echo .DEFAULT: > Makefile ; # echo \ $_cv_gnu_make_command \$@ >> Makefile; # fi # # Then, if any (well almost any) other make is called, and GNU make also # exists, then the other make wraps the GNU make. # # LICENSE # # Copyright (c) 2008 John Darrington # Copyright (c) 2015 Enrico M. Crisostomo # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. This file is offered as-is, without any # warranty. #serial 12 AC_DEFUN([AX_CHECK_GNU_MAKE],dnl [AC_PROG_AWK AC_CACHE_CHECK([for GNU make],[_cv_gnu_make_command],[dnl _cv_gnu_make_command="" ; dnl Search all the common names for GNU make for a in "$MAKE" make gmake gnumake ; do if test -z "$a" ; then continue ; fi ; if "$a" --version 2> /dev/null | grep GNU 2>&1 > /dev/null ; then _cv_gnu_make_command=$a ; AX_CHECK_GNU_MAKE_HEADLINE=$("$a" --version 2> /dev/null | grep "GNU Make") ax_check_gnu_make_version=$(echo ${AX_CHECK_GNU_MAKE_HEADLINE} | ${AWK} -F " " '{ print $(NF); }') break ; fi done ;]) dnl If there was a GNU version, then set @ifGNUmake@ to the empty string, '#' otherwise AS_VAR_IF([_cv_gnu_make_command], [""], [AS_VAR_SET([ifGNUmake], ["#"])], [AS_VAR_SET([ifGNUmake], [""])]) AS_VAR_IF([_cv_gnu_make_command], [""], [AS_VAR_SET([ifnGNUmake], [""])], [AS_VAR_SET([ifnGNUmake], ["#"])]) AS_VAR_IF([_cv_gnu_make_command], [""], [AS_UNSET(ax_cv_gnu_make_command)], [AS_VAR_SET([ax_cv_gnu_make_command], [${_cv_gnu_make_command}])]) AS_VAR_IF([_cv_gnu_make_command], [""],[$2],[$1]) AC_SUBST([ifGNUmake]) AC_SUBST([ifnGNUmake]) ]) ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/m4/ax_check_user_namespace.m40000644000175100001770000000261200000000000023502 0ustar00runnerdocker00000000000000# -*- Autoconf -*- # SYNOPSIS # # AX_CHECK_USER_NAMESPACE # # DESCRIPTION # # This macro checks whether the local system supports Linux user namespaces. # If so, it calls AC_DEFINE(HAVE_USER_NAMESPACE). AC_DEFUN([AX_CHECK_USER_NAMESPACE],[dnl AC_CACHE_CHECK([whether user namespaces are supported], ax_cv_user_namespace,[ AC_LANG_PUSH([C]) AC_RUN_IFELSE([AC_LANG_SOURCE([[ #define _GNU_SOURCE #include #include #include #include #include #include #include int userfn(void *d) { usleep(100000); /* synchronize by sleep */ return (getuid() != 0); } char userst[1024*1024]; int main() { char buffer[1024]; int rc, status, fd; pid_t child = clone(userfn, userst + 1024*1024, CLONE_NEWUSER|SIGCHLD, 0); if (child < 0) return 1; sprintf(buffer, "/proc/%d/uid_map", child); fd = open(buffer, O_CREAT|O_WRONLY|O_TRUNC, 0755); sprintf(buffer, "0 %d 1\n", getuid()); write(fd, buffer, strlen(buffer)); close(fd); rc = waitpid(child, &status, 0); if (rc <= 0) return 1; if (!WIFEXITED(status)) return 1; return WEXITSTATUS(status); } ]])],[ax_cv_user_namespace=yes],[ax_cv_user_namespace=no],[ax_cv_user_namespace=no]) AC_LANG_POP([C]) ]) if test "$ax_cv_user_namespace" = yes; then AC_DEFINE([HAVE_USER_NAMESPACE],[1],[Whether user namespaces are available]) fi ]) # AX_CHECK_USER_NAMESPACE ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/m4/ax_check_uts_namespace.m40000644000175100001770000000373100000000000023342 0ustar00runnerdocker00000000000000# -*- Autoconf -*- # SYNOPSIS # # AX_CHECK_UTS_NAMESPACE # # DESCRIPTION # # This macro checks whether the local system supports Linux UTS namespaces. # Also requires user namespaces to be available, so that non-root users # can enter the namespace. # If so, it calls AC_DEFINE(HAVE_UTS_NAMESPACE). AC_DEFUN([AX_CHECK_UTS_NAMESPACE],[dnl AC_CACHE_CHECK([whether UTS namespaces are supported], ax_cv_uts_namespace,[ AC_LANG_PUSH([C]) AC_RUN_IFELSE([AC_LANG_SOURCE([[ #define _GNU_SOURCE #include #include #include #include #include #include #include #include int utsfn(void *d) { char buffer[1024]; const char *name = "autoconftest"; int rc = sethostname(name, strlen(name)); if (rc != 0) return 1; gethostname(buffer, 1024); return (strcmp(buffer, name) != 0); } char st2[1024*1024]; int fn(void *d) { pid_t child; int rc, status; usleep(100000); /* synchronize by sleep */ if (getuid() != 0) return 1; child = clone(utsfn, st2 + 1024*1024, CLONE_NEWUTS|SIGCHLD, 0); if (child < 0) return 1; rc = waitpid(child, &status, 0); if (rc <= 0) return 1; if (!WIFEXITED(status)) return 1; return WEXITSTATUS(status); } char st[1024*1024]; int main() { char buffer[1024]; int rc, status, fd; pid_t child = clone(fn, st + 1024*1024, CLONE_NEWUSER|SIGCHLD, 0); if (child < 0) return 1; sprintf(buffer, "/proc/%d/uid_map", child); fd = open(buffer, O_CREAT|O_WRONLY|O_TRUNC, 0755); sprintf(buffer, "0 %d 1\n", getuid()); write(fd, buffer, strlen(buffer)); close(fd); rc = waitpid(child, &status, 0); if (rc <= 0) return 1; if (!WIFEXITED(status)) return 1; return WEXITSTATUS(status); } ]]) ],[ax_cv_uts_namespace=yes],[ax_cv_uts_namespace=no],[ax_cv_uts_namespace=no]) AC_LANG_POP([C]) ]) if test "$ax_cv_uts_namespace" = yes; then AC_DEFINE([HAVE_UTS_NAMESPACE],[1],[Whether UTS namespaces are available]) fi ]) # AX_CHECK_UTS_NAMESPACE ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/m4/ax_code_coverage.m40000644000175100001770000002761200000000000022147 0ustar00runnerdocker00000000000000# =========================================================================== # https://www.gnu.org/software/autoconf-archive/ax_code_coverage.html # =========================================================================== # # SYNOPSIS # # AX_CODE_COVERAGE() # # DESCRIPTION # # Defines CODE_COVERAGE_CPPFLAGS, CODE_COVERAGE_CFLAGS, # CODE_COVERAGE_CXXFLAGS and CODE_COVERAGE_LIBS which should be included # in the CPPFLAGS, CFLAGS CXXFLAGS and LIBS/LIBADD variables of every # build target (program or library) which should be built with code # coverage support. Also add rules using AX_ADD_AM_MACRO_STATIC; and # $enable_code_coverage which can be used in subsequent configure output. # CODE_COVERAGE_ENABLED is defined and substituted, and corresponds to the # value of the --enable-code-coverage option, which defaults to being # disabled. # # Test also for gcov program and create GCOV variable that could be # substituted. # # Note that all optimization flags in CFLAGS must be disabled when code # coverage is enabled. # # Usage example: # # configure.ac: # # AX_CODE_COVERAGE # # Makefile.am: # # include $(top_srcdir)/aminclude_static.am # # my_program_LIBS = ... $(CODE_COVERAGE_LIBS) ... # my_program_CPPFLAGS = ... $(CODE_COVERAGE_CPPFLAGS) ... # my_program_CFLAGS = ... $(CODE_COVERAGE_CFLAGS) ... # my_program_CXXFLAGS = ... $(CODE_COVERAGE_CXXFLAGS) ... # # clean-local: code-coverage-clean # distclean-local: code-coverage-dist-clean # # This results in a "check-code-coverage" rule being added to any # Makefile.am which do "include $(top_srcdir)/aminclude_static.am" # (assuming the module has been configured with --enable-code-coverage). # Running `make check-code-coverage` in that directory will run the # module's test suite (`make check`) and build a code coverage report # detailing the code which was touched, then print the URI for the report. # # This code was derived from Makefile.decl in GLib, originally licensed # under LGPLv2.1+. # # LICENSE # # Copyright (c) 2012, 2016 Philip Withnall # Copyright (c) 2012 Xan Lopez # Copyright (c) 2012 Christian Persch # Copyright (c) 2012 Paolo Borelli # Copyright (c) 2012 Dan Winship # Copyright (c) 2015,2018 Bastien ROUCARIES # # This library is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 2.1 of the License, or (at # your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser # General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with this program. If not, see . #serial 34 m4_define(_AX_CODE_COVERAGE_RULES,[ AX_ADD_AM_MACRO_STATIC([ # Code coverage # # Optional: # - CODE_COVERAGE_DIRECTORY: Top-level directory for code coverage reporting. # Multiple directories may be specified, separated by whitespace. # (Default: \$(top_builddir)) # - CODE_COVERAGE_OUTPUT_FILE: Filename and path for the .info file generated # by lcov for code coverage. (Default: # \$(PACKAGE_NAME)-\$(PACKAGE_VERSION)-coverage.info) # - CODE_COVERAGE_OUTPUT_DIRECTORY: Directory for generated code coverage # reports to be created. (Default: # \$(PACKAGE_NAME)-\$(PACKAGE_VERSION)-coverage) # - CODE_COVERAGE_BRANCH_COVERAGE: Set to 1 to enforce branch coverage, # set to 0 to disable it and leave empty to stay with the default. # (Default: empty) # - CODE_COVERAGE_LCOV_SHOPTS_DEFAULT: Extra options shared between both lcov # instances. (Default: based on $CODE_COVERAGE_BRANCH_COVERAGE) # - CODE_COVERAGE_LCOV_SHOPTS: Extra options to shared between both lcov # instances. (Default: $CODE_COVERAGE_LCOV_SHOPTS_DEFAULT) # - CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH: --gcov-tool pathtogcov # - CODE_COVERAGE_LCOV_OPTIONS_DEFAULT: Extra options to pass to the # collecting lcov instance. (Default: $CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH) # - CODE_COVERAGE_LCOV_OPTIONS: Extra options to pass to the collecting lcov # instance. (Default: $CODE_COVERAGE_LCOV_OPTIONS_DEFAULT) # - CODE_COVERAGE_LCOV_RMOPTS_DEFAULT: Extra options to pass to the filtering # lcov instance. (Default: empty) # - CODE_COVERAGE_LCOV_RMOPTS: Extra options to pass to the filtering lcov # instance. (Default: $CODE_COVERAGE_LCOV_RMOPTS_DEFAULT) # - CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT: Extra options to pass to the # genhtml instance. (Default: based on $CODE_COVERAGE_BRANCH_COVERAGE) # - CODE_COVERAGE_GENHTML_OPTIONS: Extra options to pass to the genhtml # instance. (Default: $CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT) # - CODE_COVERAGE_IGNORE_PATTERN: Extra glob pattern of files to ignore # # The generated report will be titled using the \$(PACKAGE_NAME) and # \$(PACKAGE_VERSION). In order to add the current git hash to the title, # use the git-version-gen script, available online. # Optional variables # run only on top dir if CODE_COVERAGE_ENABLED ifeq (\$(abs_builddir), \$(abs_top_builddir)) CODE_COVERAGE_DIRECTORY ?= \$(top_builddir) CODE_COVERAGE_OUTPUT_FILE ?= \$(PACKAGE_NAME)-\$(PACKAGE_VERSION)-coverage.info CODE_COVERAGE_OUTPUT_DIRECTORY ?= \$(PACKAGE_NAME)-\$(PACKAGE_VERSION)-coverage CODE_COVERAGE_BRANCH_COVERAGE ?= CODE_COVERAGE_LCOV_SHOPTS_DEFAULT ?= \$(if \$(CODE_COVERAGE_BRANCH_COVERAGE),\ --rc lcov_branch_coverage=\$(CODE_COVERAGE_BRANCH_COVERAGE)) CODE_COVERAGE_LCOV_SHOPTS ?= \$(CODE_COVERAGE_LCOV_SHOPTS_DEFAULT) CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH ?= --gcov-tool \"\$(GCOV)\" CODE_COVERAGE_LCOV_OPTIONS_DEFAULT ?= \$(CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH) CODE_COVERAGE_LCOV_OPTIONS ?= \$(CODE_COVERAGE_LCOV_OPTIONS_DEFAULT) CODE_COVERAGE_LCOV_RMOPTS_DEFAULT ?= CODE_COVERAGE_LCOV_RMOPTS ?= \$(CODE_COVERAGE_LCOV_RMOPTS_DEFAULT) CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT ?=\ \$(if \$(CODE_COVERAGE_BRANCH_COVERAGE),\ --rc genhtml_branch_coverage=\$(CODE_COVERAGE_BRANCH_COVERAGE)) CODE_COVERAGE_GENHTML_OPTIONS ?= \$(CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT) CODE_COVERAGE_IGNORE_PATTERN ?= GITIGNOREFILES := \$(GITIGNOREFILES) \$(CODE_COVERAGE_OUTPUT_FILE) \$(CODE_COVERAGE_OUTPUT_DIRECTORY) code_coverage_v_lcov_cap = \$(code_coverage_v_lcov_cap_\$(V)) code_coverage_v_lcov_cap_ = \$(code_coverage_v_lcov_cap_\$(AM_DEFAULT_VERBOSITY)) code_coverage_v_lcov_cap_0 = @echo \" LCOV --capture\" \$(CODE_COVERAGE_OUTPUT_FILE); code_coverage_v_lcov_ign = \$(code_coverage_v_lcov_ign_\$(V)) code_coverage_v_lcov_ign_ = \$(code_coverage_v_lcov_ign_\$(AM_DEFAULT_VERBOSITY)) code_coverage_v_lcov_ign_0 = @echo \" LCOV --remove /tmp/*\" \$(CODE_COVERAGE_IGNORE_PATTERN); code_coverage_v_genhtml = \$(code_coverage_v_genhtml_\$(V)) code_coverage_v_genhtml_ = \$(code_coverage_v_genhtml_\$(AM_DEFAULT_VERBOSITY)) code_coverage_v_genhtml_0 = @echo \" GEN \" \"\$(CODE_COVERAGE_OUTPUT_DIRECTORY)\"; code_coverage_quiet = \$(code_coverage_quiet_\$(V)) code_coverage_quiet_ = \$(code_coverage_quiet_\$(AM_DEFAULT_VERBOSITY)) code_coverage_quiet_0 = --quiet # sanitizes the test-name: replaces with underscores: dashes and dots code_coverage_sanitize = \$(subst -,_,\$(subst .,_,\$(1))) # Use recursive makes in order to ignore errors during check check-code-coverage: -\$(AM_V_at)\$(MAKE) \$(AM_MAKEFLAGS) -k check \$(AM_V_at)\$(MAKE) \$(AM_MAKEFLAGS) code-coverage-capture # Capture code coverage data code-coverage-capture: code-coverage-capture-hook \$(code_coverage_v_lcov_cap)\$(LCOV) \$(code_coverage_quiet) \$(addprefix --directory ,\$(CODE_COVERAGE_DIRECTORY)) --capture --output-file \"\$(CODE_COVERAGE_OUTPUT_FILE).tmp\" --test-name \"\$(call code_coverage_sanitize,\$(PACKAGE_NAME)-\$(PACKAGE_VERSION))\" --no-checksum --compat-libtool \$(CODE_COVERAGE_LCOV_SHOPTS) \$(CODE_COVERAGE_LCOV_OPTIONS) \$(code_coverage_v_lcov_ign)\$(LCOV) \$(code_coverage_quiet) \$(addprefix --directory ,\$(CODE_COVERAGE_DIRECTORY)) --remove \"\$(CODE_COVERAGE_OUTPUT_FILE).tmp\" \"/tmp/*\" \$(CODE_COVERAGE_IGNORE_PATTERN) --output-file \"\$(CODE_COVERAGE_OUTPUT_FILE)\" \$(CODE_COVERAGE_LCOV_SHOPTS) \$(CODE_COVERAGE_LCOV_RMOPTS) -@rm -f \"\$(CODE_COVERAGE_OUTPUT_FILE).tmp\" \$(code_coverage_v_genhtml)LANG=C \$(GENHTML) \$(code_coverage_quiet) \$(addprefix --prefix ,\$(CODE_COVERAGE_DIRECTORY)) --output-directory \"\$(CODE_COVERAGE_OUTPUT_DIRECTORY)\" --title \"\$(PACKAGE_NAME)-\$(PACKAGE_VERSION) Code Coverage\" --legend --show-details \"\$(CODE_COVERAGE_OUTPUT_FILE)\" \$(CODE_COVERAGE_GENHTML_OPTIONS) @echo \"file://\$(abs_builddir)/\$(CODE_COVERAGE_OUTPUT_DIRECTORY)/index.html\" code-coverage-clean: -\$(LCOV) --directory \$(top_builddir) -z -rm -rf \"\$(CODE_COVERAGE_OUTPUT_FILE)\" \"\$(CODE_COVERAGE_OUTPUT_FILE).tmp\" \"\$(CODE_COVERAGE_OUTPUT_DIRECTORY)\" -find . \\( -name \"*.gcda\" -o -name \"*.gcno\" -o -name \"*.gcov\" \\) -delete code-coverage-dist-clean: A][M_DISTCHECK_CONFIGURE_FLAGS := \$(A][M_DISTCHECK_CONFIGURE_FLAGS) --disable-code-coverage else # ifneq (\$(abs_builddir), \$(abs_top_builddir)) check-code-coverage: code-coverage-capture: code-coverage-capture-hook code-coverage-clean: code-coverage-dist-clean: endif # ifeq (\$(abs_builddir), \$(abs_top_builddir)) else #! CODE_COVERAGE_ENABLED # Use recursive makes in order to ignore errors during check check-code-coverage: @echo \"Need to reconfigure with --enable-code-coverage\" # Capture code coverage data code-coverage-capture: code-coverage-capture-hook @echo \"Need to reconfigure with --enable-code-coverage\" code-coverage-clean: code-coverage-dist-clean: endif #CODE_COVERAGE_ENABLED # Hook rule executed before code-coverage-capture, overridable by the user code-coverage-capture-hook: .PHONY: check-code-coverage code-coverage-capture code-coverage-dist-clean code-coverage-clean code-coverage-capture-hook ]) ]) AC_DEFUN([_AX_CODE_COVERAGE_ENABLED],[ AX_CHECK_GNU_MAKE([],AC_MSG_ERROR([not using GNU make that is needed for coverage])) AC_REQUIRE([AX_ADD_AM_MACRO_STATIC]) # check for gcov AC_CHECK_TOOL([GCOV], [$_AX_CODE_COVERAGE_GCOV_PROG_WITH], [:]) AS_IF([test "X$GCOV" = "X:"], AC_MSG_ERROR([gcov is needed to do coverage])) AC_SUBST([GCOV]) dnl Check if gcc is being used AS_IF([ test "$GCC" = "no" ], [ AC_MSG_ERROR([not compiling with gcc, which is required for gcov code coverage]) ]) AC_CHECK_PROG([LCOV], [lcov], [lcov]) AC_CHECK_PROG([GENHTML], [genhtml], [genhtml]) AS_IF([ test x"$LCOV" = x ], [ AC_MSG_ERROR([To enable code coverage reporting you must have lcov installed]) ]) AS_IF([ test x"$GENHTML" = x ], [ AC_MSG_ERROR([Could not find genhtml from the lcov package]) ]) dnl Build the code coverage flags dnl Define CODE_COVERAGE_LDFLAGS for backwards compatibility CODE_COVERAGE_CPPFLAGS="-DNDEBUG" CODE_COVERAGE_CFLAGS="-O0 -g -fprofile-arcs -ftest-coverage" CODE_COVERAGE_CXXFLAGS="-O0 -g -fprofile-arcs -ftest-coverage" CODE_COVERAGE_LIBS="-lgcov" AC_SUBST([CODE_COVERAGE_CPPFLAGS]) AC_SUBST([CODE_COVERAGE_CFLAGS]) AC_SUBST([CODE_COVERAGE_CXXFLAGS]) AC_SUBST([CODE_COVERAGE_LIBS]) ]) AC_DEFUN([AX_CODE_COVERAGE],[ dnl Check for --enable-code-coverage # allow to override gcov location AC_ARG_WITH([gcov], [AS_HELP_STRING([--with-gcov[=GCOV]], [use given GCOV for coverage (GCOV=gcov).])], [_AX_CODE_COVERAGE_GCOV_PROG_WITH=$with_gcov], [_AX_CODE_COVERAGE_GCOV_PROG_WITH=gcov]) AC_MSG_CHECKING([whether to build with code coverage support]) AC_ARG_ENABLE([code-coverage], AS_HELP_STRING([--enable-code-coverage], [Whether to enable code coverage support]),, enable_code_coverage=no) AM_CONDITIONAL([CODE_COVERAGE_ENABLED], [test "x$enable_code_coverage" = xyes]) AC_SUBST([CODE_COVERAGE_ENABLED], [$enable_code_coverage]) AC_MSG_RESULT($enable_code_coverage) AS_IF([ test "x$enable_code_coverage" = xyes ], [ _AX_CODE_COVERAGE_ENABLED ]) _AX_CODE_COVERAGE_RULES ]) ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/m4/ax_cxx_compile_stdcxx_11.m40000644000175100001770000001235400000000000023567 0ustar00runnerdocker00000000000000# ============================================================================ # http://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_11.html # ============================================================================ # # SYNOPSIS # # AX_CXX_COMPILE_STDCXX_11([ext|noext],[mandatory|optional]) # # DESCRIPTION # # Check for baseline language coverage in the compiler for the C++11 # standard; if necessary, add switches to CXXFLAGS to enable support. # # The first argument, if specified, indicates whether you insist on an # extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g. # -std=c++11). If neither is specified, you get whatever works, with # preference for an extended mode. # # The second argument, if specified 'mandatory' or if left unspecified, # indicates that baseline C++11 support is required and that the macro # should error out if no mode with that support is found. If specified # 'optional', then configuration proceeds regardless, after defining # HAVE_CXX11 if and only if a supporting mode is found. # # LICENSE # # Copyright (c) 2008 Benjamin Kosnik # Copyright (c) 2012 Zack Weinberg # Copyright (c) 2013 Roy Stogner # Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. This file is offered as-is, without any # warranty. #serial 9 m4_define([_AX_CXX_COMPILE_STDCXX_11_testbody], [[ template struct check { static_assert(sizeof(int) <= sizeof(T), "not big enough"); }; struct Base { virtual void f() {} }; struct Child : public Base { virtual void f() override {} }; typedef check> right_angle_brackets; int a; decltype(a) b; typedef check check_type; check_type c; check_type&& cr = static_cast(c); auto d = a; auto l = [](){}; // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function because of this namespace test_template_alias_sfinae { struct foo {}; template using member = typename T::member_type; template void func(...) {} template void func(member*) {} void test(); void test() { func(0); } } ]]) AC_DEFUN([AX_CXX_COMPILE_STDCXX_11], [dnl m4_if([$1], [], [], [$1], [ext], [], [$1], [noext], [], [m4_fatal([invalid argument `$1' to AX_CXX_COMPILE_STDCXX_11])])dnl m4_if([$2], [], [ax_cxx_compile_cxx11_required=true], [$2], [mandatory], [ax_cxx_compile_cxx11_required=true], [$2], [optional], [ax_cxx_compile_cxx11_required=false], [m4_fatal([invalid second argument `$2' to AX_CXX_COMPILE_STDCXX_11])]) AC_LANG_PUSH([C++])dnl ac_success=no AC_CACHE_CHECK(whether $CXX supports C++11 features by default, ax_cv_cxx_compile_cxx11, [AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_11_testbody])], [ax_cv_cxx_compile_cxx11=yes], [ax_cv_cxx_compile_cxx11=no])]) if test x$ax_cv_cxx_compile_cxx11 = xyes; then ac_success=yes fi m4_if([$1], [noext], [], [dnl if test x$ac_success = xno; then for switch in -std=gnu++11 -std=gnu++0x; do cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx11_$switch]) AC_CACHE_CHECK(whether $CXX supports C++11 features with $switch, $cachevar, [ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$CXXFLAGS $switch" AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_11_testbody])], [eval $cachevar=yes], [eval $cachevar=no]) CXXFLAGS="$ac_save_CXXFLAGS"]) if eval test x\$$cachevar = xyes; then CXXFLAGS="$CXXFLAGS $switch" ac_success=yes break fi done fi]) m4_if([$1], [ext], [], [dnl if test x$ac_success = xno; then for switch in -std=c++11 -std=c++0x; do cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx11_$switch]) AC_CACHE_CHECK(whether $CXX supports C++11 features with $switch, $cachevar, [ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$CXXFLAGS $switch" AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_11_testbody])], [eval $cachevar=yes], [eval $cachevar=no]) CXXFLAGS="$ac_save_CXXFLAGS"]) if eval test x\$$cachevar = xyes; then CXXFLAGS="$CXXFLAGS $switch" ac_success=yes break fi done fi]) AC_LANG_POP([C++]) if test x$ax_cxx_compile_cxx11_required = xtrue; then if test x$ac_success = xno; then AC_MSG_ERROR([*** A compiler with support for C++11 language features is required.]) fi else if test x$ac_success = xno; then HAVE_CXX11=0 AC_MSG_NOTICE([No compiler with C++11 support was found]) else HAVE_CXX11=1 AC_DEFINE(HAVE_CXX11,1, [define if the compiler supports basic C++11 syntax]) fi AC_SUBST(HAVE_CXX11) fi ]) ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/m4/ax_file_escapes.m40000644000175100001770000000137300000000000022000 0ustar00runnerdocker00000000000000# =========================================================================== # https://www.gnu.org/software/autoconf-archive/ax_file_escapes.html # =========================================================================== # # SYNOPSIS # # AX_FILE_ESCAPES # # DESCRIPTION # # Writes the specified data to the specified file. # # LICENSE # # Copyright (c) 2008 Tom Howard # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. This file is offered as-is, without any # warranty. #serial 8 AC_DEFUN([AX_FILE_ESCAPES],[ AX_DOLLAR="\$" AX_SRB="\\135" AX_SLB="\\133" AX_BS="\\\\" AX_DQ="\"" ]) ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/m4/ax_pthread.m40000644000175100001770000003267600000000000021017 0ustar00runnerdocker00000000000000# =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_pthread.html # =========================================================================== # # SYNOPSIS # # AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) # # DESCRIPTION # # This macro figures out how to build C programs using POSIX threads. It # sets the PTHREAD_LIBS output variable to the threads library and linker # flags, and the PTHREAD_CFLAGS output variable to any special C compiler # flags that are needed. (The user can also force certain compiler # flags/libs to be tested by setting these environment variables.) # # Also sets PTHREAD_CC to any special C compiler that is needed for # multi-threaded programs (defaults to the value of CC otherwise). (This # is necessary on AIX to use the special cc_r compiler alias.) # # NOTE: You are assumed to not only compile your program with these flags, # but also link it with them as well. e.g. you should link with # $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS # # If you are only building threads programs, you may wish to use these # variables in your default LIBS, CFLAGS, and CC: # # LIBS="$PTHREAD_LIBS $LIBS" # CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # CC="$PTHREAD_CC" # # In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant # has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name # (e.g. PTHREAD_CREATE_UNDETACHED on AIX). # # Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the # PTHREAD_PRIO_INHERIT symbol is defined when compiling with # PTHREAD_CFLAGS. # # ACTION-IF-FOUND is a list of shell commands to run if a threads library # is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it # is not found. If ACTION-IF-FOUND is not specified, the default action # will define HAVE_PTHREAD. # # Please let the authors know if this macro fails on any platform, or if # you have any other suggestions or comments. This macro was based on work # by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help # from M. Frigo), as well as ac_pthread and hb_pthread macros posted by # Alejandro Forero Cuervo to the autoconf macro repository. We are also # grateful for the helpful feedback of numerous users. # # Updated for Autoconf 2.68 by Daniel Richard G. # # LICENSE # # Copyright (c) 2008 Steven G. Johnson # Copyright (c) 2011 Daniel Richard G. # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation, either version 3 of the License, or (at your # option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General # Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 21 AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD]) AC_DEFUN([AX_PTHREAD], [ AC_REQUIRE([AC_CANONICAL_HOST]) AC_LANG_PUSH([C]) ax_pthread_ok=no # We used to check for pthread.h first, but this fails if pthread.h # requires special compiler flags (e.g. on True64 or Sequent). # It gets checked for in the link test anyway. # First of all, check if the user has set any of the PTHREAD_LIBS, # etcetera environment variables, and if threads linking works using # them: if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS]) AC_TRY_LINK_FUNC([pthread_join], [ax_pthread_ok=yes]) AC_MSG_RESULT([$ax_pthread_ok]) if test x"$ax_pthread_ok" = xno; then PTHREAD_LIBS="" PTHREAD_CFLAGS="" fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" fi # We must check for the threads library under a number of different # names; the ordering is very important because some systems # (e.g. DEC) have both -lpthread and -lpthreads, where one of the # libraries is broken (non-POSIX). # Create a list of thread flags to try. Items starting with a "-" are # C compiler flags, and other items are library names, except for "none" # which indicates that we try without any flags at all, and "pthread-config" # which is a program returning the flags for the Pth emulation library. ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" # The ordering *is* (sometimes) important. Some notes on the # individual items follow: # pthreads: AIX (must check this before -lpthread) # none: in case threads are in libc; should be tried before -Kthread and # other compiler flags to prevent continual compiler warnings # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) # -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) # -pthreads: Solaris/gcc # -mthreads: Mingw32/gcc, Lynx/gcc # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it # doesn't hurt to check since this sometimes defines pthreads too; # also defines -D_REENTRANT) # ... -mt is also the pthreads flag for HP/aCC # pthread: Linux, etcetera # --thread-safe: KAI C++ # pthread-config: use pthread-config program (for GNU Pth library) case ${host_os} in solaris*) # On Solaris (at least, for some versions), libc contains stubbed # (non-functional) versions of the pthreads routines, so link-based # tests will erroneously succeed. (We need to link with -pthreads/-mt/ # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather # a function called by this macro, so we could check for that, but # who knows whether they'll stub that too in a future libc.) So, # we'll just look for -pthreads and -lpthread first: ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags" ;; darwin*) ax_pthread_flags="-pthread $ax_pthread_flags" ;; esac # Clang doesn't consider unrecognized options an error unless we specify # -Werror. We throw in some extra Clang-specific options to ensure that # this doesn't happen for GCC, which also accepts -Werror. AC_MSG_CHECKING([if compiler needs -Werror to reject unknown flags]) save_CFLAGS="$CFLAGS" ax_pthread_extra_flags="-Werror" CFLAGS="$CFLAGS $ax_pthread_extra_flags -Wunknown-warning-option -Wsizeof-array-argument" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([int foo(void);],[foo()])], [AC_MSG_RESULT([yes])], [ax_pthread_extra_flags= AC_MSG_RESULT([no])]) CFLAGS="$save_CFLAGS" if test x"$ax_pthread_ok" = xno; then for flag in $ax_pthread_flags; do case $flag in none) AC_MSG_CHECKING([whether pthreads work without any flags]) ;; -*) AC_MSG_CHECKING([whether pthreads work with $flag]) PTHREAD_CFLAGS="$flag" ;; pthread-config) AC_CHECK_PROG([ax_pthread_config], [pthread-config], [yes], [no]) if test x"$ax_pthread_config" = xno; then continue; fi PTHREAD_CFLAGS="`pthread-config --cflags`" PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" ;; *) AC_MSG_CHECKING([for the pthreads library -l$flag]) PTHREAD_LIBS="-l$flag" ;; esac save_LIBS="$LIBS" save_CFLAGS="$CFLAGS" LIBS="$PTHREAD_LIBS $LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS $ax_pthread_extra_flags" # Check for various functions. We must include pthread.h, # since some functions may be macros. (On the Sequent, we # need a special flag -Kthread to make this header compile.) # We check for pthread_join because it is in -lpthread on IRIX # while pthread_create is in libc. We check for pthread_attr_init # due to DEC craziness with -lpthreads. We check for # pthread_cleanup_push because it is one of the few pthread # functions on Solaris that doesn't have a non-functional libc stub. # We try pthread_create on general principles. AC_LINK_IFELSE([AC_LANG_PROGRAM([#include static void routine(void *a) { a = 0; } static void *start_routine(void *a) { return a; }], [pthread_t th; pthread_attr_t attr; pthread_create(&th, 0, start_routine, 0); pthread_join(th, 0); pthread_attr_init(&attr); pthread_cleanup_push(routine, 0); pthread_cleanup_pop(0) /* ; */])], [ax_pthread_ok=yes], []) LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" AC_MSG_RESULT([$ax_pthread_ok]) if test "x$ax_pthread_ok" = xyes; then break; fi PTHREAD_LIBS="" PTHREAD_CFLAGS="" done fi # Various other checks: if test "x$ax_pthread_ok" = xyes; then save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. AC_MSG_CHECKING([for joinable pthread attribute]) attr_name=unknown for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do AC_LINK_IFELSE([AC_LANG_PROGRAM([#include ], [int attr = $attr; return attr /* ; */])], [attr_name=$attr; break], []) done AC_MSG_RESULT([$attr_name]) if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then AC_DEFINE_UNQUOTED([PTHREAD_CREATE_JOINABLE], [$attr_name], [Define to necessary symbol if this constant uses a non-standard name on your system.]) fi AC_MSG_CHECKING([if more special flags are required for pthreads]) flag=no case ${host_os} in aix* | freebsd* | darwin*) flag="-D_THREAD_SAFE";; osf* | hpux*) flag="-D_REENTRANT";; solaris*) if test "$GCC" = "yes"; then flag="-D_REENTRANT" else # TODO: What about Clang on Solaris? flag="-mt -D_REENTRANT" fi ;; esac AC_MSG_RESULT([$flag]) if test "x$flag" != xno; then PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" fi AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT], [ax_cv_PTHREAD_PRIO_INHERIT], [ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[int i = PTHREAD_PRIO_INHERIT;]])], [ax_cv_PTHREAD_PRIO_INHERIT=yes], [ax_cv_PTHREAD_PRIO_INHERIT=no]) ]) AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes"], [AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], [1], [Have PTHREAD_PRIO_INHERIT.])]) LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" # More AIX lossage: compile with *_r variant if test "x$GCC" != xyes; then case $host_os in aix*) AS_CASE(["x/$CC"], [x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6], [#handle absolute path differently from PATH based program lookup AS_CASE(["x$CC"], [x/*], [AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"])], [AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC])])]) ;; esac fi fi test -n "$PTHREAD_CC" || PTHREAD_CC="$CC" AC_SUBST([PTHREAD_LIBS]) AC_SUBST([PTHREAD_CFLAGS]) AC_SUBST([PTHREAD_CC]) # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: if test x"$ax_pthread_ok" = xyes; then ifelse([$1],,[AC_DEFINE([HAVE_PTHREAD],[1],[Define if you have POSIX threads libraries and header files.])],[$1]) : else ax_pthread_ok=no $2 fi AC_LANG_POP ])dnl AX_PTHREAD ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/m4/ax_require_defined.m40000644000175100001770000000230200000000000022501 0ustar00runnerdocker00000000000000# =========================================================================== # https://www.gnu.org/software/autoconf-archive/ax_require_defined.html # =========================================================================== # # SYNOPSIS # # AX_REQUIRE_DEFINED(MACRO) # # DESCRIPTION # # AX_REQUIRE_DEFINED is a simple helper for making sure other macros have # been defined and thus are available for use. This avoids random issues # where a macro isn't expanded. Instead the configure script emits a # non-fatal: # # ./configure: line 1673: AX_CFLAGS_WARN_ALL: command not found # # It's like AC_REQUIRE except it doesn't expand the required macro. # # Here's an example: # # AX_REQUIRE_DEFINED([AX_CHECK_LINK_FLAG]) # # LICENSE # # Copyright (c) 2014 Mike Frysinger # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. This file is offered as-is, without any # warranty. #serial 2 AC_DEFUN([AX_REQUIRE_DEFINED], [dnl m4_ifndef([$1], [m4_fatal([macro ]$1[ is not defined; is a m4 file missing?])]) ])dnl AX_REQUIRE_DEFINED ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/m4/cares-compilers.m40000644000175100001770000013242500000000000021761 0ustar00runnerdocker00000000000000#*************************************************************************** # # Copyright (C) 2009 - 2021 by Daniel Stenberg et al # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, provided # that the above copyright notice appear in all copies and that both that # copyright notice and this permission notice appear in supporting # documentation, and that the name of M.I.T. not be used in advertising or # publicity pertaining to distribution of the software without specific, # written prior permission. M.I.T. makes no representations about the # suitability of this software for any purpose. It is provided "as is" # without express or implied warranty. # #*************************************************************************** # File version for 'aclocal' use. Keep it a single number. # serial 75 dnl CARES_CHECK_COMPILER dnl ------------------------------------------------- dnl Verify if the C compiler being used is known. AC_DEFUN([CARES_CHECK_COMPILER], [ # compiler_id="unknown" compiler_num="0" # flags_dbg_all="unknown" flags_dbg_yes="unknown" flags_dbg_off="unknown" flags_opt_all="unknown" flags_opt_yes="unknown" flags_opt_off="unknown" # flags_prefer_cppflags="no" # CARES_CHECK_COMPILER_DEC_C CARES_CHECK_COMPILER_HPUX_C CARES_CHECK_COMPILER_IBM_C CARES_CHECK_COMPILER_INTEL_C CARES_CHECK_COMPILER_CLANG CARES_CHECK_COMPILER_GNU_C CARES_CHECK_COMPILER_LCC CARES_CHECK_COMPILER_SGI_MIPSPRO_C CARES_CHECK_COMPILER_SGI_MIPS_C CARES_CHECK_COMPILER_SUNPRO_C CARES_CHECK_COMPILER_TINY_C CARES_CHECK_COMPILER_WATCOM_C # if test "$compiler_id" = "unknown"; then cat <<_EOF 1>&2 *** *** Warning: This configure script does not have information about the *** compiler you are using, relative to the flags required to enable or *** disable generation of debug info, optimization options or warnings. *** *** Whatever settings are present in CFLAGS will be used for this run. *** *** If you wish to help the c-ares project to better support your compiler *** you can report this and the required info on the c-ares development *** mailing list: http://lists.haxx.se/listinfo/c-ares/ *** _EOF fi ]) dnl CARES_CHECK_COMPILER_CLANG dnl ------------------------------------------------- dnl Verify if compiler being used is clang. AC_DEFUN([CARES_CHECK_COMPILER_CLANG], [ AC_BEFORE([$0],[CARES_CHECK_COMPILER_GNU_C])dnl AC_MSG_CHECKING([if compiler is clang]) CURL_CHECK_DEF([__clang__], [], [silent]) if test "$curl_cv_have_def___clang__" = "yes"; then AC_MSG_RESULT([yes]) compiler_id="CLANG" clangver=`$CC -dumpversion` clangvhi=`echo $clangver | cut -d . -f1` clangvlo=`echo $clangver | cut -d . -f2` compiler_num=`(expr $clangvhi "*" 100 + $clangvlo) 2>/dev/null` flags_dbg_all="-g -g0 -g1 -g2 -g3" flags_dbg_all="$flags_dbg_all -ggdb" flags_dbg_all="$flags_dbg_all -gstabs" flags_dbg_all="$flags_dbg_all -gstabs+" flags_dbg_all="$flags_dbg_all -gcoff" flags_dbg_all="$flags_dbg_all -gxcoff" flags_dbg_all="$flags_dbg_all -gdwarf-2" flags_dbg_all="$flags_dbg_all -gvms" flags_dbg_yes="-g" flags_dbg_off="-g0" flags_opt_all="-O -O0 -O1 -O2 -Os -O3 -O4" flags_opt_yes="-Os" flags_opt_off="-O0" else AC_MSG_RESULT([no]) fi ]) dnl CARES_CHECK_COMPILER_DEC_C dnl ------------------------------------------------- dnl Verify if compiler being used is DEC C. AC_DEFUN([CARES_CHECK_COMPILER_DEC_C], [ AC_MSG_CHECKING([if compiler is DEC/Compaq/HP C]) CURL_CHECK_DEF([__DECC], [], [silent]) CURL_CHECK_DEF([__DECC_VER], [], [silent]) if test "$curl_cv_have_def___DECC" = "yes" && test "$curl_cv_have_def___DECC_VER" = "yes"; then AC_MSG_RESULT([yes]) compiler_id="DEC_C" flags_dbg_all="-g -g0 -g1 -g2 -g3" flags_dbg_yes="-g2" flags_dbg_off="-g0" flags_opt_all="-O -O0 -O1 -O2 -O3 -O4" flags_opt_yes="-O1" flags_opt_off="-O0" else AC_MSG_RESULT([no]) fi ]) dnl CARES_CHECK_COMPILER_GNU_C dnl ------------------------------------------------- dnl Verify if compiler being used is GNU C. AC_DEFUN([CARES_CHECK_COMPILER_GNU_C], [ AC_REQUIRE([CARES_CHECK_COMPILER_INTEL_C])dnl AC_REQUIRE([CARES_CHECK_COMPILER_CLANG])dnl AC_MSG_CHECKING([if compiler is GNU C]) CURL_CHECK_DEF([__GNUC__], [], [silent]) if test "$curl_cv_have_def___GNUC__" = "yes" && test "$compiler_id" = "unknown"; then AC_MSG_RESULT([yes]) compiler_id="GNU_C" gccver=`$CC -dumpversion` gccvhi=`echo $gccver | cut -d . -f1` gccvlo=`echo $gccver | cut -d . -f2` compiler_num=`(expr $gccvhi "*" 100 + $gccvlo) 2>/dev/null` flags_dbg_all="-g -g0 -g1 -g2 -g3" flags_dbg_all="$flags_dbg_all -ggdb" flags_dbg_all="$flags_dbg_all -gstabs" flags_dbg_all="$flags_dbg_all -gstabs+" flags_dbg_all="$flags_dbg_all -gcoff" flags_dbg_all="$flags_dbg_all -gxcoff" flags_dbg_all="$flags_dbg_all -gdwarf-2" flags_dbg_all="$flags_dbg_all -gvms" flags_dbg_yes="-g" flags_dbg_off="-g0" flags_opt_all="-O -O0 -O1 -O2 -O3 -Os" flags_opt_yes="-O2" flags_opt_off="-O0" CURL_CHECK_DEF([_WIN32], [], [silent]) else AC_MSG_RESULT([no]) fi ]) dnl CARES_CHECK_COMPILER_HPUX_C dnl ------------------------------------------------- dnl Verify if compiler being used is HP-UX C. AC_DEFUN([CARES_CHECK_COMPILER_HPUX_C], [ AC_MSG_CHECKING([if compiler is HP-UX C]) CURL_CHECK_DEF([__HP_cc], [], [silent]) if test "$curl_cv_have_def___HP_cc" = "yes"; then AC_MSG_RESULT([yes]) compiler_id="HP_UX_C" flags_dbg_all="-g -s" flags_dbg_yes="-g" flags_dbg_off="-s" flags_opt_all="-O +O0 +O1 +O2 +O3 +O4" flags_opt_yes="+O2" flags_opt_off="+O0" else AC_MSG_RESULT([no]) fi ]) dnl CARES_CHECK_COMPILER_IBM_C dnl ------------------------------------------------- dnl Verify if compiler being used is IBM C. AC_DEFUN([CARES_CHECK_COMPILER_IBM_C], [ AC_MSG_CHECKING([if compiler is IBM C]) CURL_CHECK_DEF([__IBMC__], [], [silent]) if test "$curl_cv_have_def___IBMC__" = "yes"; then AC_MSG_RESULT([yes]) compiler_id="IBM_C" flags_dbg_all="-g -g0 -g1 -g2 -g3" flags_dbg_yes="-g" flags_dbg_off="" flags_opt_all="-O -O0 -O1 -O2 -O3 -O4 -O5" flags_opt_all="$flags_opt_all -qnooptimize" flags_opt_all="$flags_opt_all -qoptimize=0" flags_opt_all="$flags_opt_all -qoptimize=1" flags_opt_all="$flags_opt_all -qoptimize=2" flags_opt_all="$flags_opt_all -qoptimize=3" flags_opt_all="$flags_opt_all -qoptimize=4" flags_opt_all="$flags_opt_all -qoptimize=5" flags_opt_yes="-O2" flags_opt_off="-qnooptimize" flags_prefer_cppflags="yes" else AC_MSG_RESULT([no]) fi ]) dnl CARES_CHECK_COMPILER_INTEL_C dnl ------------------------------------------------- dnl Verify if compiler being used is Intel C. AC_DEFUN([CARES_CHECK_COMPILER_INTEL_C], [ AC_BEFORE([$0],[CARES_CHECK_COMPILER_GNU_C])dnl AC_MSG_CHECKING([if compiler is Intel C]) CURL_CHECK_DEF([__INTEL_COMPILER], [], [silent]) if test "$curl_cv_have_def___INTEL_COMPILER" = "yes"; then AC_MSG_RESULT([yes]) compiler_num="$curl_cv_def___INTEL_COMPILER" CURL_CHECK_DEF([__unix__], [], [silent]) if test "$curl_cv_have_def___unix__" = "yes"; then compiler_id="INTEL_UNIX_C" flags_dbg_all="-g -g0" flags_dbg_yes="-g" flags_dbg_off="-g0" flags_opt_all="-O -O0 -O1 -O2 -O3 -Os" flags_opt_yes="-O2" flags_opt_off="-O0" else compiler_id="INTEL_WINDOWS_C" flags_dbg_all="/ZI /Zi /zI /zi /ZD /Zd /zD /zd /Z7 /z7 /Oy /Oy-" flags_dbg_all="$flags_dbg_all /debug" flags_dbg_all="$flags_dbg_all /debug:none" flags_dbg_all="$flags_dbg_all /debug:minimal" flags_dbg_all="$flags_dbg_all /debug:partial" flags_dbg_all="$flags_dbg_all /debug:full" flags_dbg_all="$flags_dbg_all /debug:semantic_stepping" flags_dbg_all="$flags_dbg_all /debug:extended" flags_dbg_yes="/Zi /Oy-" flags_dbg_off="/debug:none /Oy-" flags_opt_all="/O /O0 /O1 /O2 /O3 /Od /Og /Og- /Oi /Oi-" flags_opt_yes="/O2" flags_opt_off="/Od" fi else AC_MSG_RESULT([no]) fi ]) dnl CARES_CHECK_COMPILER_LCC dnl ------------------------------------------------- dnl Verify if compiler being used is LCC. AC_DEFUN([CARES_CHECK_COMPILER_LCC], [ AC_MSG_CHECKING([if compiler is LCC]) CURL_CHECK_DEF([__LCC__], [], [silent]) if test "$curl_cv_have_def___LCC__" = "yes"; then AC_MSG_RESULT([yes]) compiler_id="LCC" flags_dbg_all="-g" flags_dbg_yes="-g" flags_dbg_off="" flags_opt_all="" flags_opt_yes="" flags_opt_off="" else AC_MSG_RESULT([no]) fi ]) dnl CARES_CHECK_COMPILER_SGI_MIPS_C dnl ------------------------------------------------- dnl Verify if compiler being used is SGI MIPS C. AC_DEFUN([CARES_CHECK_COMPILER_SGI_MIPS_C], [ AC_REQUIRE([CARES_CHECK_COMPILER_SGI_MIPSPRO_C])dnl AC_MSG_CHECKING([if compiler is SGI MIPS C]) CURL_CHECK_DEF([__GNUC__], [], [silent]) CURL_CHECK_DEF([__sgi], [], [silent]) if test "$curl_cv_have_def___GNUC__" = "no" && test "$curl_cv_have_def___sgi" = "yes" && test "$compiler_id" = "unknown"; then AC_MSG_RESULT([yes]) compiler_id="SGI_MIPS_C" flags_dbg_all="-g -g0 -g1 -g2 -g3" flags_dbg_yes="-g" flags_dbg_off="-g0" flags_opt_all="-O -O0 -O1 -O2 -O3 -Ofast" flags_opt_yes="-O2" flags_opt_off="-O0" else AC_MSG_RESULT([no]) fi ]) dnl CARES_CHECK_COMPILER_SGI_MIPSPRO_C dnl ------------------------------------------------- dnl Verify if compiler being used is SGI MIPSpro C. AC_DEFUN([CARES_CHECK_COMPILER_SGI_MIPSPRO_C], [ AC_BEFORE([$0],[CARES_CHECK_COMPILER_SGI_MIPS_C])dnl AC_MSG_CHECKING([if compiler is SGI MIPSpro C]) CURL_CHECK_DEF([__GNUC__], [], [silent]) CURL_CHECK_DEF([_COMPILER_VERSION], [], [silent]) CURL_CHECK_DEF([_SGI_COMPILER_VERSION], [], [silent]) if test "$curl_cv_have_def___GNUC__" = "no" && (test "$curl_cv_have_def__SGI_COMPILER_VERSION" = "yes" || test "$curl_cv_have_def__COMPILER_VERSION" = "yes"); then AC_MSG_RESULT([yes]) compiler_id="SGI_MIPSPRO_C" flags_dbg_all="-g -g0 -g1 -g2 -g3" flags_dbg_yes="-g" flags_dbg_off="-g0" flags_opt_all="-O -O0 -O1 -O2 -O3 -Ofast" flags_opt_yes="-O2" flags_opt_off="-O0" else AC_MSG_RESULT([no]) fi ]) dnl CARES_CHECK_COMPILER_SUNPRO_C dnl ------------------------------------------------- dnl Verify if compiler being used is SunPro C. AC_DEFUN([CARES_CHECK_COMPILER_SUNPRO_C], [ AC_MSG_CHECKING([if compiler is SunPro C]) CURL_CHECK_DEF([__SUNPRO_C], [], [silent]) if test "$curl_cv_have_def___SUNPRO_C" = "yes"; then AC_MSG_RESULT([yes]) compiler_id="SUNPRO_C" flags_dbg_all="-g -s" flags_dbg_yes="-g" flags_dbg_off="-s" flags_opt_all="-O -xO -xO1 -xO2 -xO3 -xO4 -xO5" flags_opt_yes="-xO2" flags_opt_off="" else AC_MSG_RESULT([no]) fi ]) dnl CARES_CHECK_COMPILER_TINY_C dnl ------------------------------------------------- dnl Verify if compiler being used is Tiny C. AC_DEFUN([CARES_CHECK_COMPILER_TINY_C], [ AC_MSG_CHECKING([if compiler is Tiny C]) CURL_CHECK_DEF([__TINYC__], [], [silent]) if test "$curl_cv_have_def___TINYC__" = "yes"; then AC_MSG_RESULT([yes]) compiler_id="TINY_C" flags_dbg_all="-g -b" flags_dbg_yes="-g" flags_dbg_off="" flags_opt_all="" flags_opt_yes="" flags_opt_off="" else AC_MSG_RESULT([no]) fi ]) dnl CARES_CHECK_COMPILER_WATCOM_C dnl ------------------------------------------------- dnl Verify if compiler being used is Watcom C. AC_DEFUN([CARES_CHECK_COMPILER_WATCOM_C], [ AC_MSG_CHECKING([if compiler is Watcom C]) CURL_CHECK_DEF([__WATCOMC__], [], [silent]) if test "$curl_cv_have_def___WATCOMC__" = "yes"; then AC_MSG_RESULT([yes]) CURL_CHECK_DEF([__UNIX__], [], [silent]) if test "$curl_cv_have_def___UNIX__" = "yes"; then compiler_id="WATCOM_UNIX_C" flags_dbg_all="-g1 -g1+ -g2 -g3" flags_dbg_yes="-g2" flags_dbg_off="" flags_opt_all="-O0 -O1 -O2 -O3" flags_opt_yes="-O2" flags_opt_off="-O0" else compiler_id="WATCOM_WINDOWS_C" flags_dbg_all="" flags_dbg_yes="" flags_dbg_off="" flags_opt_all="" flags_opt_yes="" flags_opt_off="" fi else AC_MSG_RESULT([no]) fi ]) dnl CARES_CONVERT_INCLUDE_TO_ISYSTEM dnl ------------------------------------------------- dnl Changes standard include paths present in CFLAGS dnl and CPPFLAGS into isystem include paths. This is dnl done to prevent GNUC from generating warnings on dnl headers from these locations, although on ancient dnl GNUC versions these warnings are not silenced. AC_DEFUN([CARES_CONVERT_INCLUDE_TO_ISYSTEM], [ AC_REQUIRE([CARES_SHFUNC_SQUEEZE])dnl AC_REQUIRE([CARES_CHECK_COMPILER])dnl if test "$compiler_id" = "GNU_C" || test "$compiler_id" = "CLANG"; then tmp_has_include="no" tmp_chg_FLAGS="$CFLAGS" for word1 in $tmp_chg_FLAGS; do case "$word1" in -I*) tmp_has_include="yes" ;; esac done if test "$tmp_has_include" = "yes"; then tmp_chg_FLAGS=`echo "$tmp_chg_FLAGS" | "$SED" 's/^-I/ -isystem /g'` tmp_chg_FLAGS=`echo "$tmp_chg_FLAGS" | "$SED" 's/ -I/ -isystem /g'` CFLAGS="$tmp_chg_FLAGS" squeeze CFLAGS fi tmp_has_include="no" tmp_chg_FLAGS="$CPPFLAGS" for word1 in $tmp_chg_FLAGS; do case "$word1" in -I*) tmp_has_include="yes" ;; esac done if test "$tmp_has_include" = "yes"; then tmp_chg_FLAGS=`echo "$tmp_chg_FLAGS" | "$SED" 's/^-I/ -isystem /g'` tmp_chg_FLAGS=`echo "$tmp_chg_FLAGS" | "$SED" 's/ -I/ -isystem /g'` CPPFLAGS="$tmp_chg_FLAGS" squeeze CPPFLAGS fi fi ]) dnl CARES_COMPILER_WORKS_IFELSE ([ACTION-IF-WORKS], [ACTION-IF-NOT-WORKS]) dnl ------------------------------------------------- dnl Verify if the C compiler seems to work with the dnl settings that are 'active' at the time the test dnl is performed. AC_DEFUN([CARES_COMPILER_WORKS_IFELSE], [ dnl compilation capability verification tmp_compiler_works="unknown" AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ ]],[[ int i = 1; return i; ]]) ],[ tmp_compiler_works="yes" ],[ tmp_compiler_works="no" echo " " >&6 sed 's/^/cc-fail: /' conftest.err >&6 echo " " >&6 ]) dnl linking capability verification if test "$tmp_compiler_works" = "yes"; then AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ ]],[[ int i = 1; return i; ]]) ],[ tmp_compiler_works="yes" ],[ tmp_compiler_works="no" echo " " >&6 sed 's/^/link-fail: /' conftest.err >&6 echo " " >&6 ]) fi dnl only do runtime verification when not cross-compiling if test "x$cross_compiling" != "xyes" && test "$tmp_compiler_works" = "yes"; then AC_RUN_IFELSE([ AC_LANG_PROGRAM([[ # ifdef __STDC__ # include # endif ]],[[ int i = 0; exit(i); ]]) ],[ tmp_compiler_works="yes" ],[ tmp_compiler_works="no" echo " " >&6 echo "run-fail: test program exited with status $ac_status" >&6 echo " " >&6 ]) fi dnl branch upon test result if test "$tmp_compiler_works" = "yes"; then ifelse($1,,:,[$1]) ifelse($2,,,[else $2]) fi ]) dnl CARES_SET_COMPILER_BASIC_OPTS dnl ------------------------------------------------- dnl Sets compiler specific options/flags which do not dnl depend on configure's debug, optimize or warnings dnl options. AC_DEFUN([CARES_SET_COMPILER_BASIC_OPTS], [ AC_REQUIRE([CARES_CHECK_COMPILER])dnl AC_REQUIRE([CARES_SHFUNC_SQUEEZE])dnl # if test "$compiler_id" != "unknown"; then # if test "$compiler_id" = "GNU_C" || test "$compiler_id" = "CLANG"; then CARES_CONVERT_INCLUDE_TO_ISYSTEM fi # tmp_save_CPPFLAGS="$CPPFLAGS" tmp_save_CFLAGS="$CFLAGS" tmp_CPPFLAGS="" tmp_CFLAGS="" # case "$compiler_id" in # CLANG) # dnl Disable warnings for unused arguments, otherwise clang will dnl warn about compile-time arguments used during link-time, like dnl -O and -g and -pedantic. tmp_CFLAGS="$tmp_CFLAGS -Qunused-arguments" ;; # DEC_C) # dnl Select strict ANSI C compiler mode tmp_CFLAGS="$tmp_CFLAGS -std1" dnl Turn off optimizer ANSI C aliasing rules tmp_CFLAGS="$tmp_CFLAGS -noansi_alias" dnl Generate warnings for missing function prototypes tmp_CFLAGS="$tmp_CFLAGS -warnprotos" dnl Change some warnings into fatal errors tmp_CFLAGS="$tmp_CFLAGS -msg_fatal toofewargs,toomanyargs" ;; # GNU_C) # dnl Placeholder tmp_CFLAGS="$tmp_CFLAGS" ;; # HP_UX_C) # dnl Disallow run-time dereferencing of null pointers tmp_CFLAGS="$tmp_CFLAGS -z" dnl Disable some remarks dnl #4227: padding struct with n bytes to align member dnl #4255: padding size of struct with n bytes to alignment boundary tmp_CFLAGS="$tmp_CFLAGS +W 4227,4255" ;; # IBM_C) # dnl Ensure that compiler optimizations are always thread-safe. tmp_CPPFLAGS="$tmp_CPPFLAGS -qthreaded" dnl Disable type based strict aliasing optimizations, using worst dnl case aliasing assumptions when compiling. Type based aliasing dnl would restrict the lvalues that could be safely used to access dnl a data object. tmp_CPPFLAGS="$tmp_CPPFLAGS -qnoansialias" dnl Force compiler to stop after the compilation phase, without dnl generating an object code file when compilation has errors. tmp_CPPFLAGS="$tmp_CPPFLAGS -qhalt=e" ;; # INTEL_UNIX_C) # dnl On unix this compiler uses gcc's header files, so dnl we select ANSI C89 dialect plus GNU extensions. tmp_CFLAGS="$tmp_CFLAGS -std=gnu89" dnl Change some warnings into errors dnl #140: too many arguments in function call dnl #147: declaration is incompatible with 'previous one' dnl #165: too few arguments in function call dnl #266: function declared implicitly tmp_CPPFLAGS="$tmp_CPPFLAGS -we 140,147,165,266" dnl Disable some remarks dnl #279: controlling expression is constant dnl #981: operands are evaluated in unspecified order dnl #1469: "cc" clobber ignored tmp_CPPFLAGS="$tmp_CPPFLAGS -wd 279,981,1469" ;; # INTEL_WINDOWS_C) # dnl Placeholder tmp_CFLAGS="$tmp_CFLAGS" ;; # LCC) # dnl Disallow run-time dereferencing of null pointers tmp_CFLAGS="$tmp_CFLAGS -n" ;; # SGI_MIPS_C) # dnl Placeholder tmp_CFLAGS="$tmp_CFLAGS" ;; # SGI_MIPSPRO_C) # dnl Placeholder tmp_CFLAGS="$tmp_CFLAGS" ;; # SUNPRO_C) # dnl Placeholder tmp_CFLAGS="$tmp_CFLAGS" ;; # TINY_C) # dnl Placeholder tmp_CFLAGS="$tmp_CFLAGS" ;; # WATCOM_UNIX_C) # dnl Placeholder tmp_CFLAGS="$tmp_CFLAGS" ;; # WATCOM_WINDOWS_C) # dnl Placeholder tmp_CFLAGS="$tmp_CFLAGS" ;; # esac # squeeze tmp_CPPFLAGS squeeze tmp_CFLAGS # if test ! -z "$tmp_CFLAGS" || test ! -z "$tmp_CPPFLAGS"; then AC_MSG_CHECKING([if compiler accepts some basic options]) CPPFLAGS="$tmp_save_CPPFLAGS $tmp_CPPFLAGS" CFLAGS="$tmp_save_CFLAGS $tmp_CFLAGS" squeeze CPPFLAGS squeeze CFLAGS CARES_COMPILER_WORKS_IFELSE([ AC_MSG_RESULT([yes]) AC_MSG_NOTICE([compiler options added: $tmp_CFLAGS $tmp_CPPFLAGS]) ],[ AC_MSG_RESULT([no]) AC_MSG_WARN([compiler options rejected: $tmp_CFLAGS $tmp_CPPFLAGS]) dnl restore initial settings CPPFLAGS="$tmp_save_CPPFLAGS" CFLAGS="$tmp_save_CFLAGS" ]) fi # fi ]) dnl CARES_SET_COMPILER_DEBUG_OPTS dnl ------------------------------------------------- dnl Sets compiler specific options/flags which depend dnl on configure's debug option. AC_DEFUN([CARES_SET_COMPILER_DEBUG_OPTS], [ AC_REQUIRE([CARES_CHECK_OPTION_DEBUG])dnl AC_REQUIRE([CARES_CHECK_COMPILER])dnl AC_REQUIRE([CARES_SHFUNC_SQUEEZE])dnl # if test "$compiler_id" != "unknown"; then # tmp_save_CFLAGS="$CFLAGS" tmp_save_CPPFLAGS="$CPPFLAGS" # tmp_options="" tmp_CFLAGS="$CFLAGS" tmp_CPPFLAGS="$CPPFLAGS" CARES_VAR_STRIP([tmp_CFLAGS],[$flags_dbg_all]) CARES_VAR_STRIP([tmp_CPPFLAGS],[$flags_dbg_all]) # if test "$want_debug" = "yes"; then AC_MSG_CHECKING([if compiler accepts debug enabling options]) tmp_options="$flags_dbg_yes" fi if test "$want_debug" = "no"; then AC_MSG_CHECKING([if compiler accepts debug disabling options]) tmp_options="$flags_dbg_off" fi # if test "$flags_prefer_cppflags" = "yes"; then CPPFLAGS="$tmp_CPPFLAGS $tmp_options" CFLAGS="$tmp_CFLAGS" else CPPFLAGS="$tmp_CPPFLAGS" CFLAGS="$tmp_CFLAGS $tmp_options" fi squeeze CPPFLAGS squeeze CFLAGS CARES_COMPILER_WORKS_IFELSE([ AC_MSG_RESULT([yes]) AC_MSG_NOTICE([compiler options added: $tmp_options]) ],[ AC_MSG_RESULT([no]) AC_MSG_WARN([compiler options rejected: $tmp_options]) dnl restore initial settings CPPFLAGS="$tmp_save_CPPFLAGS" CFLAGS="$tmp_save_CFLAGS" ]) # fi ]) dnl CARES_SET_COMPILER_OPTIMIZE_OPTS dnl ------------------------------------------------- dnl Sets compiler specific options/flags which depend dnl on configure's optimize option. AC_DEFUN([CARES_SET_COMPILER_OPTIMIZE_OPTS], [ AC_REQUIRE([CARES_CHECK_OPTION_OPTIMIZE])dnl AC_REQUIRE([CARES_CHECK_COMPILER])dnl AC_REQUIRE([CARES_SHFUNC_SQUEEZE])dnl # if test "$compiler_id" != "unknown"; then # tmp_save_CFLAGS="$CFLAGS" tmp_save_CPPFLAGS="$CPPFLAGS" # tmp_options="" tmp_CFLAGS="$CFLAGS" tmp_CPPFLAGS="$CPPFLAGS" honor_optimize_option="yes" # dnl If optimization request setting has not been explicitly specified, dnl it has been derived from the debug setting and initially assumed. dnl This initially assumed optimizer setting will finally be ignored dnl if CFLAGS or CPPFLAGS already hold optimizer flags. This implies dnl that an initially assumed optimizer setting might not be honored. # if test "$want_optimize" = "assume_no" || test "$want_optimize" = "assume_yes"; then AC_MSG_CHECKING([if compiler optimizer assumed setting might be used]) CARES_VAR_MATCH_IFELSE([tmp_CFLAGS],[$flags_opt_all],[ honor_optimize_option="no" ]) CARES_VAR_MATCH_IFELSE([tmp_CPPFLAGS],[$flags_opt_all],[ honor_optimize_option="no" ]) AC_MSG_RESULT([$honor_optimize_option]) if test "$honor_optimize_option" = "yes"; then if test "$want_optimize" = "assume_yes"; then want_optimize="yes" fi if test "$want_optimize" = "assume_no"; then want_optimize="no" fi fi fi # if test "$honor_optimize_option" = "yes"; then CARES_VAR_STRIP([tmp_CFLAGS],[$flags_opt_all]) CARES_VAR_STRIP([tmp_CPPFLAGS],[$flags_opt_all]) if test "$want_optimize" = "yes"; then AC_MSG_CHECKING([if compiler accepts optimizer enabling options]) tmp_options="$flags_opt_yes" fi if test "$want_optimize" = "no"; then AC_MSG_CHECKING([if compiler accepts optimizer disabling options]) tmp_options="$flags_opt_off" fi if test "$flags_prefer_cppflags" = "yes"; then CPPFLAGS="$tmp_CPPFLAGS $tmp_options" CFLAGS="$tmp_CFLAGS" else CPPFLAGS="$tmp_CPPFLAGS" CFLAGS="$tmp_CFLAGS $tmp_options" fi squeeze CPPFLAGS squeeze CFLAGS CARES_COMPILER_WORKS_IFELSE([ AC_MSG_RESULT([yes]) AC_MSG_NOTICE([compiler options added: $tmp_options]) ],[ AC_MSG_RESULT([no]) AC_MSG_WARN([compiler options rejected: $tmp_options]) dnl restore initial settings CPPFLAGS="$tmp_save_CPPFLAGS" CFLAGS="$tmp_save_CFLAGS" ]) fi # fi ]) dnl CARES_SET_COMPILER_WARNING_OPTS dnl ------------------------------------------------- dnl Sets compiler options/flags which depend on dnl configure's warnings given option. AC_DEFUN([CARES_SET_COMPILER_WARNING_OPTS], [ AC_REQUIRE([CARES_CHECK_OPTION_WARNINGS])dnl AC_REQUIRE([CARES_CHECK_COMPILER])dnl AC_REQUIRE([CARES_SHFUNC_SQUEEZE])dnl # if test "$compiler_id" != "unknown"; then # tmp_save_CPPFLAGS="$CPPFLAGS" tmp_save_CFLAGS="$CFLAGS" tmp_CPPFLAGS="" tmp_CFLAGS="" # case "$compiler_id" in # CLANG) # if test "$want_warnings" = "yes"; then tmp_CFLAGS="$tmp_CFLAGS -pedantic" tmp_CFLAGS="$tmp_CFLAGS -Wall -Wextra" tmp_CFLAGS="$tmp_CFLAGS -Wpointer-arith -Wwrite-strings" tmp_CFLAGS="$tmp_CFLAGS -Wshadow" tmp_CFLAGS="$tmp_CFLAGS -Winline -Wnested-externs" tmp_CFLAGS="$tmp_CFLAGS -Wmissing-declarations" tmp_CFLAGS="$tmp_CFLAGS -Wmissing-prototypes" tmp_CFLAGS="$tmp_CFLAGS -Wno-long-long" tmp_CFLAGS="$tmp_CFLAGS -Wfloat-equal" tmp_CFLAGS="$tmp_CFLAGS -Wno-multichar -Wsign-compare" tmp_CFLAGS="$tmp_CFLAGS -Wundef" tmp_CFLAGS="$tmp_CFLAGS -Wno-format-nonliteral" tmp_CFLAGS="$tmp_CFLAGS -Wendif-labels -Wstrict-prototypes" tmp_CFLAGS="$tmp_CFLAGS -Wdeclaration-after-statement" tmp_CFLAGS="$tmp_CFLAGS -Wcast-align" tmp_CFLAGS="$tmp_CFLAGS -Wno-system-headers" tmp_CFLAGS="$tmp_CFLAGS -Wshorten-64-to-32" # dnl Only clang 1.1 or later if test "$compiler_num" -ge "101"; then tmp_CFLAGS="$tmp_CFLAGS -Wunused" fi fi ;; # DEC_C) # if test "$want_warnings" = "yes"; then dnl Select a higher warning level than default level2 tmp_CFLAGS="$tmp_CFLAGS -msg_enable level3" fi ;; # GNU_C) # if test "$want_warnings" = "yes"; then # dnl Do not enable -pedantic when cross-compiling with a gcc older dnl than 3.0, to avoid warnings from third party system headers. if test "x$cross_compiling" != "xyes" || test "$compiler_num" -ge "300"; then tmp_CFLAGS="$tmp_CFLAGS -pedantic" fi # dnl Set of options we believe *ALL* gcc versions support: tmp_CFLAGS="$tmp_CFLAGS -Wall -W" # dnl Only gcc 1.4 or later if test "$compiler_num" -ge "104"; then tmp_CFLAGS="$tmp_CFLAGS -Wpointer-arith -Wwrite-strings" dnl If not cross-compiling with a gcc older than 3.0 if test "x$cross_compiling" != "xyes" || test "$compiler_num" -ge "300"; then tmp_CFLAGS="$tmp_CFLAGS -Wunused -Wshadow" fi fi # dnl Only gcc 2.7 or later if test "$compiler_num" -ge "207"; then tmp_CFLAGS="$tmp_CFLAGS -Winline -Wnested-externs" dnl If not cross-compiling with a gcc older than 3.0 if test "x$cross_compiling" != "xyes" || test "$compiler_num" -ge "300"; then tmp_CFLAGS="$tmp_CFLAGS -Wmissing-declarations" tmp_CFLAGS="$tmp_CFLAGS -Wmissing-prototypes" fi fi # dnl Only gcc 2.95 or later if test "$compiler_num" -ge "295"; then tmp_CFLAGS="$tmp_CFLAGS -Wno-long-long" fi # dnl Only gcc 2.96 or later if test "$compiler_num" -ge "296"; then tmp_CFLAGS="$tmp_CFLAGS -Wfloat-equal" tmp_CFLAGS="$tmp_CFLAGS -Wno-multichar -Wsign-compare" dnl -Wundef used only if gcc is 2.96 or later since we get dnl lots of "`_POSIX_C_SOURCE' is not defined" in system dnl headers with gcc 2.95.4 on FreeBSD 4.9 tmp_CFLAGS="$tmp_CFLAGS -Wundef" fi # dnl Only gcc 2.97 or later if test "$compiler_num" -ge "297"; then tmp_CFLAGS="$tmp_CFLAGS -Wno-format-nonliteral" fi # dnl Only gcc 3.0 or later if test "$compiler_num" -ge "300"; then dnl -Wunreachable-code seems totally unreliable on my gcc 3.3.2 on dnl on i686-Linux as it gives us heaps with false positives. dnl Also, on gcc 4.0.X it is totally unbearable and complains all dnl over making it unusable for generic purposes. Let's not use it. tmp_CFLAGS="$tmp_CFLAGS" fi # dnl Only gcc 3.3 or later if test "$compiler_num" -ge "303"; then tmp_CFLAGS="$tmp_CFLAGS -Wendif-labels -Wstrict-prototypes" fi # dnl Only gcc 3.4 or later if test "$compiler_num" -ge "304"; then tmp_CFLAGS="$tmp_CFLAGS -Wdeclaration-after-statement" fi # dnl Only gcc 4.0 or later if test "$compiler_num" -ge "400"; then tmp_CFLAGS="$tmp_CFLAGS -Wstrict-aliasing=3" fi # dnl Only gcc 4.2 or later if test "$compiler_num" -ge "402"; then tmp_CFLAGS="$tmp_CFLAGS -Wcast-align" fi # dnl Only gcc 4.3 or later if test "$compiler_num" -ge "403"; then tmp_CFLAGS="$tmp_CFLAGS -Wtype-limits -Wold-style-declaration" tmp_CFLAGS="$tmp_CFLAGS -Wmissing-parameter-type -Wempty-body" tmp_CFLAGS="$tmp_CFLAGS -Wclobbered -Wignored-qualifiers" tmp_CFLAGS="$tmp_CFLAGS -Wconversion -Wno-sign-conversion -Wvla" fi # dnl Only gcc 4.5 or later if test "$compiler_num" -ge "405"; then dnl Only windows targets if test "$curl_cv_have_def__WIN32" = "yes"; then tmp_CFLAGS="$tmp_CFLAGS -Wno-pedantic-ms-format" fi fi # fi # dnl Do not issue warnings for code in system include paths. if test "$compiler_num" -ge "300"; then tmp_CFLAGS="$tmp_CFLAGS -Wno-system-headers" else dnl When cross-compiling with a gcc older than 3.0, disable dnl some warnings triggered on third party system headers. if test "x$cross_compiling" = "xyes"; then if test "$compiler_num" -ge "104"; then dnl gcc 1.4 or later tmp_CFLAGS="$tmp_CFLAGS -Wno-unused -Wno-shadow" fi if test "$compiler_num" -ge "207"; then dnl gcc 2.7 or later tmp_CFLAGS="$tmp_CFLAGS -Wno-missing-declarations" tmp_CFLAGS="$tmp_CFLAGS -Wno-missing-prototypes" fi fi fi ;; # HP_UX_C) # if test "$want_warnings" = "yes"; then dnl Issue all warnings tmp_CFLAGS="$tmp_CFLAGS +w1" fi ;; # IBM_C) # dnl Placeholder tmp_CFLAGS="$tmp_CFLAGS" ;; # INTEL_UNIX_C) # if test "$want_warnings" = "yes"; then if test "$compiler_num" -gt "600"; then dnl Show errors, warnings, and remarks tmp_CPPFLAGS="$tmp_CPPFLAGS -Wall -w2" dnl Perform extra compile-time code checking tmp_CPPFLAGS="$tmp_CPPFLAGS -Wcheck" dnl Warn on nested comments tmp_CPPFLAGS="$tmp_CPPFLAGS -Wcomment" dnl Show warnings relative to deprecated features tmp_CPPFLAGS="$tmp_CPPFLAGS -Wdeprecated" dnl Enable warnings for missing prototypes tmp_CPPFLAGS="$tmp_CPPFLAGS -Wmissing-prototypes" dnl Enable warnings for 64-bit portability issues tmp_CPPFLAGS="$tmp_CPPFLAGS -Wp64" dnl Enable warnings for questionable pointer arithmetic tmp_CPPFLAGS="$tmp_CPPFLAGS -Wpointer-arith" dnl Check for function return typw issues tmp_CPPFLAGS="$tmp_CPPFLAGS -Wreturn-type" dnl Warn on variable declarations hiding a previous one tmp_CPPFLAGS="$tmp_CPPFLAGS -Wshadow" dnl Warn when a variable is used before initialized tmp_CPPFLAGS="$tmp_CPPFLAGS -Wuninitialized" dnl Warn if a declared function is not used tmp_CPPFLAGS="$tmp_CPPFLAGS -Wunused-function" fi fi dnl Disable using EBP register in optimizations tmp_CFLAGS="$tmp_CFLAGS -fno-omit-frame-pointer" dnl Disable use of ANSI C aliasing rules in optimizations tmp_CFLAGS="$tmp_CFLAGS -fno-strict-aliasing" dnl Value-safe optimizations on floating-point data tmp_CFLAGS="$tmp_CFLAGS -fp-model precise" dnl Only icc 10.0 or later if test "$compiler_num" -ge "1000"; then dnl Disable vectorizer diagnostic information tmp_CFLAGS="$tmp_CFLAGS -vec-report0" fi ;; # INTEL_WINDOWS_C) # dnl Placeholder tmp_CFLAGS="$tmp_CFLAGS" ;; # LCC) # if test "$want_warnings" = "yes"; then dnl Highest warning level is double -A, next is single -A. dnl Due to the big number of warnings these trigger on third dnl party header files it is impractical for us to use any of dnl them here. If you want them simply define it in CPPFLAGS. tmp_CFLAGS="$tmp_CFLAGS" fi ;; # SGI_MIPS_C) # if test "$want_warnings" = "yes"; then dnl Perform stricter semantic and lint-like checks tmp_CFLAGS="$tmp_CFLAGS -fullwarn" fi ;; # SGI_MIPSPRO_C) # if test "$want_warnings" = "yes"; then dnl Perform stricter semantic and lint-like checks tmp_CFLAGS="$tmp_CFLAGS -fullwarn" dnl Disable some remarks dnl #1209: controlling expression is constant tmp_CFLAGS="$tmp_CFLAGS -woff 1209" fi ;; # SUNPRO_C) # if test "$want_warnings" = "yes"; then dnl Perform stricter semantic and lint-like checks tmp_CFLAGS="$tmp_CFLAGS -v" fi ;; # TINY_C) # if test "$want_warnings" = "yes"; then dnl Activate all warnings tmp_CFLAGS="$tmp_CFLAGS -Wall" dnl Make string constants be of type const char * tmp_CFLAGS="$tmp_CFLAGS -Wwrite-strings" dnl Warn use of unsupported GCC features ignored by TCC tmp_CFLAGS="$tmp_CFLAGS -Wunsupported" fi ;; # WATCOM_UNIX_C) # if test "$want_warnings" = "yes"; then dnl Issue all warnings tmp_CFLAGS="$tmp_CFLAGS -Wall -Wextra" fi ;; # WATCOM_WINDOWS_C) # dnl Placeholder tmp_CFLAGS="$tmp_CFLAGS" ;; # esac # squeeze tmp_CPPFLAGS squeeze tmp_CFLAGS # if test ! -z "$tmp_CFLAGS" || test ! -z "$tmp_CPPFLAGS"; then AC_MSG_CHECKING([if compiler accepts strict warning options]) CPPFLAGS="$tmp_save_CPPFLAGS $tmp_CPPFLAGS" CFLAGS="$tmp_save_CFLAGS $tmp_CFLAGS" squeeze CPPFLAGS squeeze CFLAGS CARES_COMPILER_WORKS_IFELSE([ AC_MSG_RESULT([yes]) AC_MSG_NOTICE([compiler options added: $tmp_CFLAGS $tmp_CPPFLAGS]) ],[ AC_MSG_RESULT([no]) AC_MSG_WARN([compiler options rejected: $tmp_CFLAGS $tmp_CPPFLAGS]) dnl restore initial settings CPPFLAGS="$tmp_save_CPPFLAGS" CFLAGS="$tmp_save_CFLAGS" ]) fi # fi ]) dnl CARES_SHFUNC_SQUEEZE dnl ------------------------------------------------- dnl Declares a shell function squeeze() which removes dnl redundant whitespace out of a shell variable. AC_DEFUN([CARES_SHFUNC_SQUEEZE], [ squeeze() { _sqz_result="" eval _sqz_input=\[$][$]1 for _sqz_token in $_sqz_input; do if test -z "$_sqz_result"; then _sqz_result="$_sqz_token" else _sqz_result="$_sqz_result $_sqz_token" fi done eval [$]1=\$_sqz_result return 0 } ]) dnl CARES_CHECK_COMPILER_HALT_ON_ERROR dnl ------------------------------------------------- dnl Verifies if the compiler actually halts after the dnl compilation phase without generating any object dnl code file, when the source compiles with errors. AC_DEFUN([CARES_CHECK_COMPILER_HALT_ON_ERROR], [ AC_MSG_CHECKING([if compiler halts on compilation errors]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ ]],[[ force compilation error ]]) ],[ AC_MSG_RESULT([no]) AC_MSG_ERROR([compiler does not halt on compilation errors.]) ],[ AC_MSG_RESULT([yes]) ]) ]) dnl CARES_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE dnl ------------------------------------------------- dnl Verifies if the compiler actually halts after the dnl compilation phase without generating any object dnl code file, when the source code tries to define a dnl type for a constant array with negative dimension. AC_DEFUN([CARES_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE], [ AC_REQUIRE([CARES_CHECK_COMPILER_HALT_ON_ERROR])dnl AC_MSG_CHECKING([if compiler halts on negative sized arrays]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ typedef char bad_t[sizeof(char) == sizeof(int) ? -1 : -1 ]; ]],[[ bad_t dummy; ]]) ],[ AC_MSG_RESULT([no]) AC_MSG_ERROR([compiler does not halt on negative sized arrays.]) ],[ AC_MSG_RESULT([yes]) ]) ]) dnl CARES_CHECK_COMPILER_STRUCT_MEMBER_SIZE dnl ------------------------------------------------- dnl Verifies if the compiler is capable of handling the dnl size of a struct member, struct which is a function dnl result, as a compilation-time condition inside the dnl type definition of a constant array. AC_DEFUN([CARES_CHECK_COMPILER_STRUCT_MEMBER_SIZE], [ AC_REQUIRE([CARES_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE])dnl AC_MSG_CHECKING([if compiler struct member size checking works]) tst_compiler_check_one_works="unknown" AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ struct mystruct { int mi; char mc; struct mystruct *next; }; struct mystruct myfunc(); typedef char good_t1[sizeof(myfunc().mi) == sizeof(int) ? 1 : -1 ]; typedef char good_t2[sizeof(myfunc().mc) == sizeof(char) ? 1 : -1 ]; ]],[[ good_t1 dummy1; good_t2 dummy2; ]]) ],[ tst_compiler_check_one_works="yes" ],[ tst_compiler_check_one_works="no" sed 's/^/cc-src: /' conftest.$ac_ext >&6 sed 's/^/cc-err: /' conftest.err >&6 ]) tst_compiler_check_two_works="unknown" AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ struct mystruct { int mi; char mc; struct mystruct *next; }; struct mystruct myfunc(); typedef char bad_t1[sizeof(myfunc().mi) != sizeof(int) ? 1 : -1 ]; typedef char bad_t2[sizeof(myfunc().mc) != sizeof(char) ? 1 : -1 ]; ]],[[ bad_t1 dummy1; bad_t2 dummy2; ]]) ],[ tst_compiler_check_two_works="no" ],[ tst_compiler_check_two_works="yes" ]) if test "$tst_compiler_check_one_works" = "yes" && test "$tst_compiler_check_two_works" = "yes"; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) AC_MSG_ERROR([compiler fails struct member size checking.]) fi ]) dnl CARES_CHECK_COMPILER_SYMBOL_HIDING dnl ------------------------------------------------- dnl Verify if compiler supports hiding library internal symbols, setting dnl shell variable supports_symbol_hiding value as appropriate, as well as dnl variables symbol_hiding_CFLAGS and symbol_hiding_EXTERN when supported. AC_DEFUN([CARES_CHECK_COMPILER_SYMBOL_HIDING], [ AC_REQUIRE([CARES_CHECK_COMPILER])dnl AC_BEFORE([$0],[CARES_CONFIGURE_SYMBOL_HIDING])dnl AC_MSG_CHECKING([if compiler supports hiding library internal symbols]) supports_symbol_hiding="no" symbol_hiding_CFLAGS="" symbol_hiding_EXTERN="" tmp_CFLAGS="" tmp_EXTERN="" case "$compiler_id" in CLANG) dnl All versions of clang support -fvisibility= tmp_EXTERN="__attribute__ ((__visibility__ (\"default\")))" tmp_CFLAGS="-fvisibility=hidden" supports_symbol_hiding="yes" ;; GNU_C) dnl Only gcc 3.4 or later if test "$compiler_num" -ge "304"; then if $CC --help --verbose 2>&1 | grep fvisibility= > /dev/null ; then tmp_EXTERN="__attribute__ ((__visibility__ (\"default\")))" tmp_CFLAGS="-fvisibility=hidden" supports_symbol_hiding="yes" fi fi ;; INTEL_UNIX_C) dnl Only icc 9.0 or later if test "$compiler_num" -ge "900"; then if $CC --help --verbose 2>&1 | grep fvisibility= > /dev/null ; then tmp_save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fvisibility=hidden" AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ # include ]],[[ printf("icc fvisibility bug test"); ]]) ],[ tmp_EXTERN="__attribute__ ((__visibility__ (\"default\")))" tmp_CFLAGS="-fvisibility=hidden" supports_symbol_hiding="yes" ]) CFLAGS="$tmp_save_CFLAGS" fi fi ;; SUNPRO_C) if $CC 2>&1 | grep flags >/dev/null && $CC -flags | grep xldscope= >/dev/null ; then tmp_EXTERN="__global" tmp_CFLAGS="-xldscope=hidden" supports_symbol_hiding="yes" fi ;; esac if test "$supports_symbol_hiding" = "yes"; then tmp_save_CFLAGS="$CFLAGS" CFLAGS="$tmp_save_CFLAGS $tmp_CFLAGS" squeeze CFLAGS AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $tmp_EXTERN char *dummy(char *buff); char *dummy(char *buff) { if(buff) return ++buff; else return buff; } ]],[[ char b[16]; char *r = dummy(&b[0]); if(r) return (int)*r; ]]) ],[ supports_symbol_hiding="yes" if test -f conftest.err; then grep 'visibility' conftest.err >/dev/null if test "$?" -eq "0"; then supports_symbol_hiding="no" fi fi ],[ supports_symbol_hiding="no" echo " " >&6 sed 's/^/cc-src: /' conftest.$ac_ext >&6 sed 's/^/cc-err: /' conftest.err >&6 echo " " >&6 ]) CFLAGS="$tmp_save_CFLAGS" fi if test "$supports_symbol_hiding" = "yes"; then AC_MSG_RESULT([yes]) symbol_hiding_CFLAGS="$tmp_CFLAGS" symbol_hiding_EXTERN="$tmp_EXTERN" else AC_MSG_RESULT([no]) fi ]) dnl CARES_CHECK_COMPILER_PROTOTYPE_MISMATCH dnl ------------------------------------------------- dnl Verifies if the compiler actually halts after the dnl compilation phase without generating any object dnl code file, when the source code tries to redefine dnl a prototype which does not match previous one. AC_DEFUN([CARES_CHECK_COMPILER_PROTOTYPE_MISMATCH], [ AC_REQUIRE([CARES_CHECK_COMPILER_HALT_ON_ERROR])dnl AC_MSG_CHECKING([if compiler halts on function prototype mismatch]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ # include int rand(int n); int rand(int n) { if(n) return ++n; else return n; } ]],[[ int i[2]; int j = rand(i[0]); if(j) return j; ]]) ],[ AC_MSG_RESULT([no]) AC_MSG_ERROR([compiler does not halt on function prototype mismatch.]) ],[ AC_MSG_RESULT([yes]) ]) ]) dnl CARES_VAR_MATCH (VARNAME, VALUE) dnl ------------------------------------------------- dnl Verifies if shell variable VARNAME contains VALUE. dnl Contents of variable VARNAME and VALUE are handled dnl as whitespace separated lists of words. If at least dnl one word of VALUE is present in VARNAME the match dnl is considered positive, otherwise false. AC_DEFUN([CARES_VAR_MATCH], [ ac_var_match_word="no" for word1 in $[$1]; do for word2 in [$2]; do if test "$word1" = "$word2"; then ac_var_match_word="yes" fi done done ]) dnl CARES_VAR_MATCH_IFELSE (VARNAME, VALUE, dnl [ACTION-IF-MATCH], [ACTION-IF-NOT-MATCH]) dnl ------------------------------------------------- dnl This performs a CURL_VAR_MATCH check and executes dnl first branch if the match is positive, otherwise dnl the second branch is executed. AC_DEFUN([CARES_VAR_MATCH_IFELSE], [ CARES_VAR_MATCH([$1],[$2]) if test "$ac_var_match_word" = "yes"; then ifelse($3,,:,[$3]) ifelse($4,,,[else $4]) fi ]) dnl CARES_VAR_STRIP (VARNAME, VALUE) dnl ------------------------------------------------- dnl Contents of variable VARNAME and VALUE are handled dnl as whitespace separated lists of words. Each word dnl from VALUE is removed from VARNAME when present. AC_DEFUN([CARES_VAR_STRIP], [ AC_REQUIRE([CARES_SHFUNC_SQUEEZE])dnl ac_var_stripped="" for word1 in $[$1]; do ac_var_strip_word="no" for word2 in [$2]; do if test "$word1" = "$word2"; then ac_var_strip_word="yes" fi done if test "$ac_var_strip_word" = "no"; then ac_var_stripped="$ac_var_stripped $word1" fi done dnl squeeze whitespace out of result [$1]="$ac_var_stripped" squeeze [$1] ]) ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/m4/cares-confopts.m40000644000175100001770000003134400000000000021615 0ustar00runnerdocker00000000000000#*************************************************************************** # # Copyright (C) 2008 - 2013 by Daniel Stenberg et al # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, provided # that the above copyright notice appear in all copies and that both that # copyright notice and this permission notice appear in supporting # documentation, and that the name of M.I.T. not be used in advertising or # publicity pertaining to distribution of the software without specific, # written prior permission. M.I.T. makes no representations about the # suitability of this software for any purpose. It is provided "as is" # without express or implied warranty. # #*************************************************************************** # File version for 'aclocal' use. Keep it a single number. # serial 11 dnl CARES_CHECK_OPTION_DEBUG dnl ------------------------------------------------- dnl Verify if configure has been invoked with option dnl --enable-debug or --disable-debug, and set shell dnl variable want_debug value as appropriate. AC_DEFUN([CARES_CHECK_OPTION_DEBUG], [ AC_BEFORE([$0],[CARES_CHECK_OPTION_WARNINGS])dnl AC_BEFORE([$0],[XC_CHECK_PROG_CC])dnl AC_MSG_CHECKING([whether to enable debug build options]) OPT_DEBUG_BUILD="default" AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug],[Enable debug build options]) AS_HELP_STRING([--disable-debug],[Disable debug build options]), OPT_DEBUG_BUILD=$enableval) case "$OPT_DEBUG_BUILD" in no) dnl --disable-debug option used want_debug="no" ;; default) dnl configure option not specified want_debug="no" ;; *) dnl --enable-debug option used want_debug="yes" ;; esac AC_MSG_RESULT([$want_debug]) ]) dnl CARES_CHECK_OPTION_NONBLOCKING dnl ------------------------------------------------- dnl Verify if configure has been invoked with option dnl --enable-nonblocking or --disable-nonblocking, and dnl set shell variable want_nonblocking as appropriate. AC_DEFUN([CARES_CHECK_OPTION_NONBLOCKING], [ AC_BEFORE([$0],[CARES_CHECK_NONBLOCKING_SOCKET])dnl AC_MSG_CHECKING([whether to enable non-blocking communications]) OPT_NONBLOCKING="default" AC_ARG_ENABLE(nonblocking, AS_HELP_STRING([--enable-nonblocking],[Enable non-blocking communications]) AS_HELP_STRING([--disable-nonblocking],[Disable non-blocking communications]), OPT_NONBLOCKING=$enableval) case "$OPT_NONBLOCKING" in no) dnl --disable-nonblocking option used want_nonblocking="no" ;; default) dnl configure option not specified want_nonblocking="yes" ;; *) dnl --enable-nonblocking option used want_nonblocking="yes" ;; esac AC_MSG_RESULT([$want_nonblocking]) ]) dnl CARES_CHECK_OPTION_OPTIMIZE dnl ------------------------------------------------- dnl Verify if configure has been invoked with option dnl --enable-optimize or --disable-optimize, and set dnl shell variable want_optimize value as appropriate. AC_DEFUN([CARES_CHECK_OPTION_OPTIMIZE], [ AC_REQUIRE([CARES_CHECK_OPTION_DEBUG])dnl AC_BEFORE([$0],[XC_CHECK_PROG_CC])dnl AC_MSG_CHECKING([whether to enable compiler optimizer]) OPT_COMPILER_OPTIMIZE="default" AC_ARG_ENABLE(optimize, AS_HELP_STRING([--enable-optimize(=OPT)],[Enable compiler optimizations (default=-O2)]) AS_HELP_STRING([--disable-optimize],[Disable compiler optimizations]), OPT_COMPILER_OPTIMIZE=$enableval) case "$OPT_COMPILER_OPTIMIZE" in no) dnl --disable-optimize option used. We will handle this as dnl a request to disable compiler optimizations if possible. dnl If the compiler is known CFLAGS and CPPFLAGS will be dnl overridden, otherwise this can not be honored. want_optimize="no" AC_MSG_RESULT([no]) ;; default) dnl configure's optimize option not specified. Initially we will dnl handle this as a a request contrary to configure's setting dnl for --enable-debug. IOW, initially, for debug-enabled builds dnl this will be handled as a request to disable optimizations if dnl possible, and for debug-disabled builds this will be handled dnl initially as a request to enable optimizations if possible. dnl Finally, if the compiler is known and CFLAGS and CPPFLAGS do dnl not have any optimizer flag the request will be honored, in dnl any other case the request can not be honored. dnl IOW, existing optimizer flags defined in CFLAGS or CPPFLAGS dnl will always take precedence over any initial assumption. if test "$want_debug" = "yes"; then want_optimize="assume_no" AC_MSG_RESULT([not specified (assuming no)]) else want_optimize="assume_yes" AC_MSG_RESULT([not specified (assuming yes)]) fi ;; *) dnl --enable-optimize option used. We will handle this as dnl a request to enable compiler optimizations if possible. dnl If the compiler is known CFLAGS and CPPFLAGS will be dnl overridden, otherwise this can not be honored. want_optimize="yes" AC_MSG_RESULT([yes]) ;; esac ]) dnl CARES_CHECK_OPTION_SYMBOL_HIDING dnl ------------------------------------------------- dnl Verify if configure has been invoked with option dnl --enable-symbol-hiding or --disable-symbol-hiding, dnl setting shell variable want_symbol_hiding value. AC_DEFUN([CARES_CHECK_OPTION_SYMBOL_HIDING], [ AC_BEFORE([$0],[CARES_CHECK_COMPILER_SYMBOL_HIDING])dnl AC_MSG_CHECKING([whether to enable hiding of library internal symbols]) OPT_SYMBOL_HIDING="default" AC_ARG_ENABLE(symbol-hiding, AS_HELP_STRING([--enable-symbol-hiding],[Enable hiding of library internal symbols]) AS_HELP_STRING([--disable-symbol-hiding],[Disable hiding of library internal symbols]), OPT_SYMBOL_HIDING=$enableval) case "$OPT_SYMBOL_HIDING" in no) dnl --disable-symbol-hiding option used. dnl This is an indication to not attempt hiding of library internal dnl symbols. Default symbol visibility will be used, which normally dnl exposes all library internal symbols. want_symbol_hiding="no" AC_MSG_RESULT([no]) ;; default) dnl configure's symbol-hiding option not specified. dnl Handle this as if --enable-symbol-hiding option was given. want_symbol_hiding="yes" AC_MSG_RESULT([yes]) ;; *) dnl --enable-symbol-hiding option used. dnl This is an indication to attempt hiding of library internal dnl symbols. This is only supported on some compilers/linkers. want_symbol_hiding="yes" AC_MSG_RESULT([yes]) ;; esac ]) dnl CARES_CHECK_OPTION_EXPOSE_STATICS dnl ------------------------------------------------- dnl Verify if configure has been invoked with option dnl --enable-expose-statics or --disable-expose-statics, dnl setting shell variable want_expose_statics value. AC_DEFUN([CARES_CHECK_OPTION_EXPOSE_STATICS], [ AC_MSG_CHECKING([whether to expose internal static functions for testing]) OPT_EXPOSE_STATICS="default" AC_ARG_ENABLE(expose-statics, AS_HELP_STRING([--enable-expose-statics],[Enable exposure of internal static functions for testing]) AS_HELP_STRING([--disable-expose-statics],[Disable exposure of internal static functions for testing]), OPT_EXPOSE_STATICS=$enableval) case "$OPT_EXPOSE_STATICS" in no) dnl --disable-expose-statics option used. want_expose_statics="no" AC_MSG_RESULT([no]) ;; default) dnl configure's expose-statics option not specified. dnl Handle this as if --disable-expose-statics option was given. want_expose_statics="no" AC_MSG_RESULT([no]) ;; *) dnl --enable-expose-statics option used. want_expose_statics="yes" AC_MSG_RESULT([yes]) ;; esac if test "$want_expose_statics" = "yes"; then AC_DEFINE_UNQUOTED(CARES_EXPOSE_STATICS, 1, [Defined for build that exposes internal static functions for testing.]) fi ]) dnl CARES_CHECK_OPTION_WARNINGS dnl ------------------------------------------------- dnl Verify if configure has been invoked with option dnl --enable-warnings or --disable-warnings, and set dnl shell variable want_warnings as appropriate. AC_DEFUN([CARES_CHECK_OPTION_WARNINGS], [ AC_REQUIRE([CARES_CHECK_OPTION_DEBUG])dnl AC_BEFORE([$0],[CARES_CHECK_OPTION_WERROR])dnl AC_BEFORE([$0],[XC_CHECK_PROG_CC])dnl AC_MSG_CHECKING([whether to enable strict compiler warnings]) OPT_COMPILER_WARNINGS="default" AC_ARG_ENABLE(warnings, AS_HELP_STRING([--enable-warnings],[Enable strict compiler warnings]) AS_HELP_STRING([--disable-warnings],[Disable strict compiler warnings]), OPT_COMPILER_WARNINGS=$enableval) case "$OPT_COMPILER_WARNINGS" in no) dnl --disable-warnings option used want_warnings="no" ;; default) dnl configure option not specified, so dnl use same setting as --enable-debug want_warnings="$want_debug" ;; *) dnl --enable-warnings option used want_warnings="yes" ;; esac AC_MSG_RESULT([$want_warnings]) ]) dnl CARES_CHECK_OPTION_WERROR dnl ------------------------------------------------- dnl Verify if configure has been invoked with option dnl --enable-werror or --disable-werror, and set dnl shell variable want_werror as appropriate. AC_DEFUN([CARES_CHECK_OPTION_WERROR], [ AC_BEFORE([$0],[CARES_CHECK_COMPILER])dnl AC_MSG_CHECKING([whether to enable compiler warnings as errors]) OPT_COMPILER_WERROR="default" AC_ARG_ENABLE(werror, AS_HELP_STRING([--enable-werror],[Enable compiler warnings as errors]) AS_HELP_STRING([--disable-werror],[Disable compiler warnings as errors]), OPT_COMPILER_WERROR=$enableval) case "$OPT_COMPILER_WERROR" in no) dnl --disable-werror option used want_werror="no" ;; default) dnl configure option not specified want_werror="no" ;; *) dnl --enable-werror option used want_werror="yes" ;; esac AC_MSG_RESULT([$want_werror]) ]) dnl CARES_CHECK_NONBLOCKING_SOCKET dnl ------------------------------------------------- dnl Check for how to set a socket into non-blocking state. AC_DEFUN([CARES_CHECK_NONBLOCKING_SOCKET], [ AC_REQUIRE([CARES_CHECK_OPTION_NONBLOCKING])dnl AC_REQUIRE([CARES_CHECK_FUNC_FCNTL])dnl AC_REQUIRE([CARES_CHECK_FUNC_IOCTL])dnl AC_REQUIRE([CARES_CHECK_FUNC_IOCTLSOCKET])dnl AC_REQUIRE([CARES_CHECK_FUNC_IOCTLSOCKET_CAMEL])dnl AC_REQUIRE([CARES_CHECK_FUNC_SETSOCKOPT])dnl # tst_method="unknown" if test "$want_nonblocking" = "yes"; then AC_MSG_CHECKING([how to set a socket into non-blocking mode]) if test "x$ac_cv_func_fcntl_o_nonblock" = "xyes"; then tst_method="fcntl O_NONBLOCK" elif test "x$ac_cv_func_ioctl_fionbio" = "xyes"; then tst_method="ioctl FIONBIO" elif test "x$ac_cv_func_ioctlsocket_fionbio" = "xyes"; then tst_method="ioctlsocket FIONBIO" elif test "x$ac_cv_func_ioctlsocket_camel_fionbio" = "xyes"; then tst_method="IoctlSocket FIONBIO" elif test "x$ac_cv_func_setsockopt_so_nonblock" = "xyes"; then tst_method="setsockopt SO_NONBLOCK" fi AC_MSG_RESULT([$tst_method]) if test "$tst_method" = "unknown"; then AC_MSG_WARN([cannot determine non-blocking socket method.]) fi fi if test "$tst_method" = "unknown"; then AC_DEFINE_UNQUOTED(USE_BLOCKING_SOCKETS, 1, [Define to disable non-blocking sockets.]) AC_MSG_WARN([non-blocking sockets disabled.]) fi ]) dnl CARES_CONFIGURE_SYMBOL_HIDING dnl ------------------------------------------------- dnl Depending on --enable-symbol-hiding or --disable-symbol-hiding dnl configure option, and compiler capability to actually honor such dnl option, this will modify compiler flags as appropriate and also dnl provide needed definitions for configuration and Makefile.am files. dnl This macro should not be used until all compilation tests have dnl been done to prevent interferences on other tests. AC_DEFUN([CARES_CONFIGURE_SYMBOL_HIDING], [ AC_MSG_CHECKING([whether hiding of library internal symbols will actually happen]) CFLAG_CARES_SYMBOL_HIDING="" doing_symbol_hiding="no" if test x"$ac_cv_native_windows" != "xyes" && test "$want_symbol_hiding" = "yes" && test "$supports_symbol_hiding" = "yes"; then doing_symbol_hiding="yes" CFLAG_CARES_SYMBOL_HIDING="$symbol_hiding_CFLAGS" AC_DEFINE_UNQUOTED(CARES_SYMBOL_SCOPE_EXTERN, $symbol_hiding_EXTERN, [Definition to make a library symbol externally visible.]) AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi AM_CONDITIONAL(DOING_CARES_SYMBOL_HIDING, test x$doing_symbol_hiding = xyes) AC_SUBST(CFLAG_CARES_SYMBOL_HIDING) if test "$doing_symbol_hiding" = "yes"; then AC_DEFINE_UNQUOTED(CARES_SYMBOL_HIDING, 1, [Defined for build with symbol hiding.]) fi ]) ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/m4/cares-functions.m40000644000175100001770000031246100000000000021774 0ustar00runnerdocker00000000000000#*************************************************************************** # # Copyright (C) 2008 - 2012 by Daniel Stenberg et al # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, provided # that the above copyright notice appear in all copies and that both that # copyright notice and this permission notice appear in supporting # documentation, and that the name of M.I.T. not be used in advertising or # publicity pertaining to distribution of the software without specific, # written prior permission. M.I.T. makes no representations about the # suitability of this software for any purpose. It is provided "as is" # without express or implied warranty. # #*************************************************************************** # File version for 'aclocal' use. Keep it a single number. # serial 46 dnl CARES_INCLUDES_ARPA_INET dnl ------------------------------------------------- dnl Set up variable with list of headers that must be dnl included when arpa/inet.h is to be included. AC_DEFUN([CARES_INCLUDES_ARPA_INET], [ cares_includes_arpa_inet="\ /* includes start */ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_SOCKET_H # include #endif #ifdef HAVE_NETINET_IN_H # include #endif #ifdef HAVE_ARPA_INET_H # include #endif /* includes end */" AC_CHECK_HEADERS( sys/types.h sys/socket.h netinet/in.h arpa/inet.h, [], [], [$cares_includes_arpa_inet]) ]) dnl CARES_INCLUDES_FCNTL dnl ------------------------------------------------- dnl Set up variable with list of headers that must be dnl included when fcntl.h is to be included. AC_DEFUN([CARES_INCLUDES_FCNTL], [ cares_includes_fcntl="\ /* includes start */ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_UNISTD_H # include #endif #ifdef HAVE_FCNTL_H # include #endif /* includes end */" AC_CHECK_HEADERS( sys/types.h unistd.h fcntl.h, [], [], [$cares_includes_fcntl]) ]) dnl CARES_INCLUDES_NETDB dnl ------------------------------------------------- dnl Set up variable with list of headers that must be dnl included when netdb.h is to be included. AC_DEFUN([CARES_INCLUDES_NETDB], [ cares_includes_netdb="\ /* includes start */ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_NETDB_H # include #endif /* includes end */" AC_CHECK_HEADERS( sys/types.h netdb.h, [], [], [$cares_includes_netdb]) ]) dnl CARES_INCLUDES_SOCKET dnl ------------------------------------------------- dnl Set up variable with list of headers that must be dnl included when socket.h is to be included. AC_DEFUN([CARES_INCLUDES_SOCKET], [ cares_includes_socket="\ /* includes start */ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SOCKET_H # include #endif /* includes end */" AC_CHECK_HEADERS( sys/types.h socket.h, [], [], [$cares_includes_socket]) ]) dnl CARES_INCLUDES_STDLIB dnl ------------------------------------------------- dnl Set up variable with list of headers that must be dnl included when stdlib.h is to be included. AC_DEFUN([CARES_INCLUDES_STDLIB], [ cares_includes_stdlib="\ /* includes start */ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_STDLIB_H # include #endif /* includes end */" AC_CHECK_HEADERS( sys/types.h stdlib.h, [], [], [$cares_includes_stdlib]) ]) dnl CARES_INCLUDES_STRING dnl ------------------------------------------------- dnl Set up variable with list of headers that must be dnl included when string(s).h is to be included. AC_DEFUN([CARES_INCLUDES_STRING], [ cares_includes_string="\ /* includes start */ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_STRING_H # include #endif #ifdef HAVE_STRINGS_H # include #endif /* includes end */" AC_CHECK_HEADERS( sys/types.h string.h strings.h, [], [], [$cares_includes_string]) ]) dnl CARES_INCLUDES_STROPTS dnl ------------------------------------------------- dnl Set up variable with list of headers that must be dnl included when stropts.h is to be included. AC_DEFUN([CARES_INCLUDES_STROPTS], [ cares_includes_stropts="\ /* includes start */ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_UNISTD_H # include #endif #ifdef HAVE_SYS_SOCKET_H # include #endif #ifdef HAVE_SYS_IOCTL_H # include #endif #ifdef HAVE_STROPTS_H # include #endif /* includes end */" AC_CHECK_HEADERS( sys/types.h unistd.h sys/socket.h sys/ioctl.h stropts.h, [], [], [$cares_includes_stropts]) ]) dnl CARES_INCLUDES_SYS_SOCKET dnl ------------------------------------------------- dnl Set up variable with list of headers that must be dnl included when sys/socket.h is to be included. AC_DEFUN([CARES_INCLUDES_SYS_SOCKET], [ cares_includes_sys_socket="\ /* includes start */ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_SOCKET_H # include #endif /* includes end */" AC_CHECK_HEADERS( sys/types.h sys/socket.h, [], [], [$cares_includes_sys_socket]) ]) dnl CARES_INCLUDES_SYS_TYPES dnl ------------------------------------------------- dnl Set up variable with list of headers that must be dnl included when sys/types.h is to be included. AC_DEFUN([CARES_INCLUDES_SYS_TYPES], [ cares_includes_sys_types="\ /* includes start */ #ifdef HAVE_SYS_TYPES_H # include #endif /* includes end */" AC_CHECK_HEADERS( sys/types.h, [], [], [$cares_includes_sys_types]) ]) dnl CARES_INCLUDES_SYS_UIO dnl ------------------------------------------------- dnl Set up variable with list of headers that must be dnl included when sys/uio.h is to be included. AC_DEFUN([CARES_INCLUDES_SYS_UIO], [ cares_includes_sys_uio="\ /* includes start */ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_UIO_H # include #endif /* includes end */" AC_CHECK_HEADERS( sys/types.h sys/uio.h, [], [], [$cares_includes_sys_uio]) ]) dnl CARES_INCLUDES_UNISTD dnl ------------------------------------------------- dnl Set up variable with list of headers that must be dnl included when unistd.h is to be included. AC_DEFUN([CARES_INCLUDES_UNISTD], [ cares_includes_unistd="\ /* includes start */ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_UNISTD_H # include #endif /* includes end */" AC_CHECK_HEADERS( sys/types.h unistd.h, [], [], [$cares_includes_unistd]) ]) dnl CARES_INCLUDES_WINSOCK2 dnl ------------------------------------------------- dnl Set up variable with list of headers that must be dnl included when winsock(2).h is to be included. AC_DEFUN([CARES_INCLUDES_WINSOCK2], [ cares_includes_winsock2="\ /* includes start */ #ifdef HAVE_WINDOWS_H # ifndef WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN # endif # include # ifdef HAVE_WINSOCK2_H # include # else # ifdef HAVE_WINSOCK_H # include # endif # endif #endif /* includes end */" CURL_CHECK_HEADER_WINDOWS CURL_CHECK_HEADER_WINSOCK CURL_CHECK_HEADER_WINSOCK2 ]) dnl CARES_INCLUDES_WS2TCPIP dnl ------------------------------------------------- dnl Set up variable with list of headers that must be dnl included when ws2tcpip.h is to be included. AC_DEFUN([CARES_INCLUDES_WS2TCPIP], [ cares_includes_ws2tcpip="\ /* includes start */ #ifdef HAVE_WINDOWS_H # ifndef WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN # endif # include # ifdef HAVE_WINSOCK2_H # include # ifdef HAVE_WS2TCPIP_H # include # endif # endif #endif /* includes end */" CURL_CHECK_HEADER_WINDOWS CURL_CHECK_HEADER_WINSOCK2 CURL_CHECK_HEADER_WS2TCPIP ]) dnl CARES_PREPROCESS_CALLCONV dnl ------------------------------------------------- dnl Set up variable with a preprocessor block which dnl defines function calling convention. AC_DEFUN([CARES_PREPROCESS_CALLCONV], [ cares_preprocess_callconv="\ /* preprocess start */ #ifdef HAVE_WINDOWS_H # define FUNCALLCONV __stdcall #else # define FUNCALLCONV #endif /* preprocess end */" ]) dnl CARES_CHECK_FUNC_CLOSESOCKET dnl ------------------------------------------------- dnl Verify if closesocket is available, prototyped, and dnl can be compiled. If all of these are true, and dnl usage has not been previously disallowed with dnl shell variable cares_disallow_closesocket, then dnl HAVE_CLOSESOCKET will be defined. AC_DEFUN([CARES_CHECK_FUNC_CLOSESOCKET], [ AC_REQUIRE([CARES_INCLUDES_WINSOCK2])dnl AC_REQUIRE([CARES_INCLUDES_SOCKET])dnl # tst_links_closesocket="unknown" tst_proto_closesocket="unknown" tst_compi_closesocket="unknown" tst_allow_closesocket="unknown" # AC_MSG_CHECKING([if closesocket can be linked]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ $cares_includes_winsock2 $cares_includes_socket ]],[[ if(0 != closesocket(0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_links_closesocket="yes" ],[ AC_MSG_RESULT([no]) tst_links_closesocket="no" ]) # if test "$tst_links_closesocket" = "yes"; then AC_MSG_CHECKING([if closesocket is prototyped]) AC_EGREP_CPP([closesocket],[ $cares_includes_winsock2 $cares_includes_socket ],[ AC_MSG_RESULT([yes]) tst_proto_closesocket="yes" ],[ AC_MSG_RESULT([no]) tst_proto_closesocket="no" ]) fi # if test "$tst_proto_closesocket" = "yes"; then AC_MSG_CHECKING([if closesocket is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $cares_includes_winsock2 $cares_includes_socket ]],[[ if(0 != closesocket(0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_closesocket="yes" ],[ AC_MSG_RESULT([no]) tst_compi_closesocket="no" ]) fi # if test "$tst_compi_closesocket" = "yes"; then AC_MSG_CHECKING([if closesocket usage allowed]) if test "x$cares_disallow_closesocket" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_closesocket="yes" else AC_MSG_RESULT([no]) tst_allow_closesocket="no" fi fi # AC_MSG_CHECKING([if closesocket might be used]) if test "$tst_links_closesocket" = "yes" && test "$tst_proto_closesocket" = "yes" && test "$tst_compi_closesocket" = "yes" && test "$tst_allow_closesocket" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_CLOSESOCKET, 1, [Define to 1 if you have the closesocket function.]) ac_cv_func_closesocket="yes" else AC_MSG_RESULT([no]) ac_cv_func_closesocket="no" fi ]) dnl CARES_CHECK_FUNC_CLOSESOCKET_CAMEL dnl ------------------------------------------------- dnl Verify if CloseSocket is available, prototyped, and dnl can be compiled. If all of these are true, and dnl usage has not been previously disallowed with dnl shell variable cares_disallow_closesocket_camel, dnl then HAVE_CLOSESOCKET_CAMEL will be defined. AC_DEFUN([CARES_CHECK_FUNC_CLOSESOCKET_CAMEL], [ AC_REQUIRE([CARES_INCLUDES_SYS_SOCKET])dnl # tst_links_closesocket_camel="unknown" tst_proto_closesocket_camel="unknown" tst_compi_closesocket_camel="unknown" tst_allow_closesocket_camel="unknown" # AC_MSG_CHECKING([if CloseSocket can be linked]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ $cares_includes_sys_socket ]],[[ if(0 != CloseSocket(0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_links_closesocket_camel="yes" ],[ AC_MSG_RESULT([no]) tst_links_closesocket_camel="no" ]) # if test "$tst_links_closesocket_camel" = "yes"; then AC_MSG_CHECKING([if CloseSocket is prototyped]) AC_EGREP_CPP([CloseSocket],[ $cares_includes_sys_socket ],[ AC_MSG_RESULT([yes]) tst_proto_closesocket_camel="yes" ],[ AC_MSG_RESULT([no]) tst_proto_closesocket_camel="no" ]) fi # if test "$tst_proto_closesocket_camel" = "yes"; then AC_MSG_CHECKING([if CloseSocket is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $cares_includes_sys_socket ]],[[ if(0 != CloseSocket(0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_closesocket_camel="yes" ],[ AC_MSG_RESULT([no]) tst_compi_closesocket_camel="no" ]) fi # if test "$tst_compi_closesocket_camel" = "yes"; then AC_MSG_CHECKING([if CloseSocket usage allowed]) if test "x$cares_disallow_closesocket_camel" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_closesocket_camel="yes" else AC_MSG_RESULT([no]) tst_allow_closesocket_camel="no" fi fi # AC_MSG_CHECKING([if CloseSocket might be used]) if test "$tst_links_closesocket_camel" = "yes" && test "$tst_proto_closesocket_camel" = "yes" && test "$tst_compi_closesocket_camel" = "yes" && test "$tst_allow_closesocket_camel" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_CLOSESOCKET_CAMEL, 1, [Define to 1 if you have the CloseSocket camel case function.]) ac_cv_func_closesocket_camel="yes" else AC_MSG_RESULT([no]) ac_cv_func_closesocket_camel="no" fi ]) dnl CARES_CHECK_FUNC_CONNECT dnl ------------------------------------------------- dnl Verify if connect is available, prototyped, and dnl can be compiled. If all of these are true, and dnl usage has not been previously disallowed with dnl shell variable cares_disallow_connect, then dnl HAVE_CONNECT will be defined. AC_DEFUN([CARES_CHECK_FUNC_CONNECT], [ AC_REQUIRE([CARES_INCLUDES_WINSOCK2])dnl AC_REQUIRE([CARES_INCLUDES_SYS_SOCKET])dnl AC_REQUIRE([CARES_INCLUDES_SOCKET])dnl # tst_links_connect="unknown" tst_proto_connect="unknown" tst_compi_connect="unknown" tst_allow_connect="unknown" # AC_MSG_CHECKING([if connect can be linked]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ $cares_includes_winsock2 $cares_includes_sys_socket $cares_includes_socket ]],[[ if(0 != connect(0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_links_connect="yes" ],[ AC_MSG_RESULT([no]) tst_links_connect="no" ]) # if test "$tst_links_connect" = "yes"; then AC_MSG_CHECKING([if connect is prototyped]) AC_EGREP_CPP([connect],[ $cares_includes_winsock2 $cares_includes_sys_socket $cares_includes_socket ],[ AC_MSG_RESULT([yes]) tst_proto_connect="yes" ],[ AC_MSG_RESULT([no]) tst_proto_connect="no" ]) fi # if test "$tst_proto_connect" = "yes"; then AC_MSG_CHECKING([if connect is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $cares_includes_winsock2 $cares_includes_sys_socket $cares_includes_socket ]],[[ if(0 != connect(0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_connect="yes" ],[ AC_MSG_RESULT([no]) tst_compi_connect="no" ]) fi # if test "$tst_compi_connect" = "yes"; then AC_MSG_CHECKING([if connect usage allowed]) if test "x$cares_disallow_connect" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_connect="yes" else AC_MSG_RESULT([no]) tst_allow_connect="no" fi fi # AC_MSG_CHECKING([if connect might be used]) if test "$tst_links_connect" = "yes" && test "$tst_proto_connect" = "yes" && test "$tst_compi_connect" = "yes" && test "$tst_allow_connect" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_CONNECT, 1, [Define to 1 if you have the connect function.]) ac_cv_func_connect="yes" else AC_MSG_RESULT([no]) ac_cv_func_connect="no" fi ]) dnl CARES_CHECK_FUNC_FCNTL dnl ------------------------------------------------- dnl Verify if fcntl is available, prototyped, and dnl can be compiled. If all of these are true, and dnl usage has not been previously disallowed with dnl shell variable cares_disallow_fcntl, then dnl HAVE_FCNTL will be defined. AC_DEFUN([CARES_CHECK_FUNC_FCNTL], [ AC_REQUIRE([CARES_INCLUDES_FCNTL])dnl # tst_links_fcntl="unknown" tst_proto_fcntl="unknown" tst_compi_fcntl="unknown" tst_allow_fcntl="unknown" # AC_MSG_CHECKING([if fcntl can be linked]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([fcntl]) ],[ AC_MSG_RESULT([yes]) tst_links_fcntl="yes" ],[ AC_MSG_RESULT([no]) tst_links_fcntl="no" ]) # if test "$tst_links_fcntl" = "yes"; then AC_MSG_CHECKING([if fcntl is prototyped]) AC_EGREP_CPP([fcntl],[ $cares_includes_fcntl ],[ AC_MSG_RESULT([yes]) tst_proto_fcntl="yes" ],[ AC_MSG_RESULT([no]) tst_proto_fcntl="no" ]) fi # if test "$tst_proto_fcntl" = "yes"; then AC_MSG_CHECKING([if fcntl is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $cares_includes_fcntl ]],[[ if(0 != fcntl(0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_fcntl="yes" ],[ AC_MSG_RESULT([no]) tst_compi_fcntl="no" ]) fi # if test "$tst_compi_fcntl" = "yes"; then AC_MSG_CHECKING([if fcntl usage allowed]) if test "x$cares_disallow_fcntl" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_fcntl="yes" else AC_MSG_RESULT([no]) tst_allow_fcntl="no" fi fi # AC_MSG_CHECKING([if fcntl might be used]) if test "$tst_links_fcntl" = "yes" && test "$tst_proto_fcntl" = "yes" && test "$tst_compi_fcntl" = "yes" && test "$tst_allow_fcntl" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_FCNTL, 1, [Define to 1 if you have the fcntl function.]) ac_cv_func_fcntl="yes" CARES_CHECK_FUNC_FCNTL_O_NONBLOCK else AC_MSG_RESULT([no]) ac_cv_func_fcntl="no" fi ]) dnl CARES_CHECK_FUNC_FCNTL_O_NONBLOCK dnl ------------------------------------------------- dnl Verify if fcntl with status flag O_NONBLOCK is dnl available, can be compiled, and seems to work. If dnl all of these are true, then HAVE_FCNTL_O_NONBLOCK dnl will be defined. AC_DEFUN([CARES_CHECK_FUNC_FCNTL_O_NONBLOCK], [ # tst_compi_fcntl_o_nonblock="unknown" tst_allow_fcntl_o_nonblock="unknown" # case $host_os in sunos4* | aix3* | beos*) dnl O_NONBLOCK does not work on these platforms cares_disallow_fcntl_o_nonblock="yes" ;; esac # if test "$ac_cv_func_fcntl" = "yes"; then AC_MSG_CHECKING([if fcntl O_NONBLOCK is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $cares_includes_fcntl ]],[[ int flags = 0; if(0 != fcntl(0, F_SETFL, flags | O_NONBLOCK)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_fcntl_o_nonblock="yes" ],[ AC_MSG_RESULT([no]) tst_compi_fcntl_o_nonblock="no" ]) fi # if test "$tst_compi_fcntl_o_nonblock" = "yes"; then AC_MSG_CHECKING([if fcntl O_NONBLOCK usage allowed]) if test "x$cares_disallow_fcntl_o_nonblock" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_fcntl_o_nonblock="yes" else AC_MSG_RESULT([no]) tst_allow_fcntl_o_nonblock="no" fi fi # AC_MSG_CHECKING([if fcntl O_NONBLOCK might be used]) if test "$tst_compi_fcntl_o_nonblock" = "yes" && test "$tst_allow_fcntl_o_nonblock" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_FCNTL_O_NONBLOCK, 1, [Define to 1 if you have a working fcntl O_NONBLOCK function.]) ac_cv_func_fcntl_o_nonblock="yes" else AC_MSG_RESULT([no]) ac_cv_func_fcntl_o_nonblock="no" fi ]) dnl CARES_CHECK_FUNC_FREEADDRINFO dnl ------------------------------------------------- dnl Verify if freeaddrinfo is available, prototyped, dnl and can be compiled. If all of these are true, dnl and usage has not been previously disallowed with dnl shell variable cares_disallow_freeaddrinfo, then dnl HAVE_FREEADDRINFO will be defined. AC_DEFUN([CARES_CHECK_FUNC_FREEADDRINFO], [ AC_REQUIRE([CARES_INCLUDES_WS2TCPIP])dnl AC_REQUIRE([CARES_INCLUDES_SYS_SOCKET])dnl AC_REQUIRE([CARES_INCLUDES_NETDB])dnl # tst_links_freeaddrinfo="unknown" tst_proto_freeaddrinfo="unknown" tst_compi_freeaddrinfo="unknown" tst_allow_freeaddrinfo="unknown" # AC_MSG_CHECKING([if freeaddrinfo can be linked]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ $cares_includes_ws2tcpip $cares_includes_sys_socket $cares_includes_netdb ]],[[ freeaddrinfo(0); ]]) ],[ AC_MSG_RESULT([yes]) tst_links_freeaddrinfo="yes" ],[ AC_MSG_RESULT([no]) tst_links_freeaddrinfo="no" ]) # if test "$tst_links_freeaddrinfo" = "yes"; then AC_MSG_CHECKING([if freeaddrinfo is prototyped]) AC_EGREP_CPP([freeaddrinfo],[ $cares_includes_ws2tcpip $cares_includes_sys_socket $cares_includes_netdb ],[ AC_MSG_RESULT([yes]) tst_proto_freeaddrinfo="yes" ],[ AC_MSG_RESULT([no]) tst_proto_freeaddrinfo="no" ]) fi # if test "$tst_proto_freeaddrinfo" = "yes"; then AC_MSG_CHECKING([if freeaddrinfo is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $cares_includes_ws2tcpip $cares_includes_sys_socket $cares_includes_netdb ]],[[ freeaddrinfo(0); ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_freeaddrinfo="yes" ],[ AC_MSG_RESULT([no]) tst_compi_freeaddrinfo="no" ]) fi # if test "$tst_compi_freeaddrinfo" = "yes"; then AC_MSG_CHECKING([if freeaddrinfo usage allowed]) if test "x$cares_disallow_freeaddrinfo" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_freeaddrinfo="yes" else AC_MSG_RESULT([no]) tst_allow_freeaddrinfo="no" fi fi # AC_MSG_CHECKING([if freeaddrinfo might be used]) if test "$tst_links_freeaddrinfo" = "yes" && test "$tst_proto_freeaddrinfo" = "yes" && test "$tst_compi_freeaddrinfo" = "yes" && test "$tst_allow_freeaddrinfo" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_FREEADDRINFO, 1, [Define to 1 if you have the freeaddrinfo function.]) ac_cv_func_freeaddrinfo="yes" else AC_MSG_RESULT([no]) ac_cv_func_freeaddrinfo="no" fi ]) dnl CARES_CHECK_FUNC_GETADDRINFO dnl ------------------------------------------------- dnl Verify if getaddrinfo is available, prototyped, can dnl be compiled and seems to work. If all of these are dnl true, and usage has not been previously disallowed dnl with shell variable cares_disallow_getaddrinfo, then dnl HAVE_GETADDRINFO will be defined. Additionally when dnl HAVE_GETADDRINFO gets defined this will also attempt dnl to find out if getaddrinfo happens to be threadsafe, dnl defining HAVE_GETADDRINFO_THREADSAFE when true. AC_DEFUN([CARES_CHECK_FUNC_GETADDRINFO], [ AC_REQUIRE([CARES_INCLUDES_WS2TCPIP])dnl AC_REQUIRE([CARES_INCLUDES_STDLIB])dnl AC_REQUIRE([CARES_INCLUDES_STRING])dnl AC_REQUIRE([CARES_INCLUDES_SYS_SOCKET])dnl AC_REQUIRE([CARES_INCLUDES_NETDB])dnl AC_REQUIRE([CURL_CHECK_NATIVE_WINDOWS])dnl # tst_links_getaddrinfo="unknown" tst_proto_getaddrinfo="unknown" tst_compi_getaddrinfo="unknown" tst_works_getaddrinfo="unknown" tst_allow_getaddrinfo="unknown" tst_tsafe_getaddrinfo="unknown" # AC_MSG_CHECKING([if getaddrinfo can be linked]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ $cares_includes_ws2tcpip $cares_includes_sys_socket $cares_includes_netdb ]],[[ if(0 != getaddrinfo(0, 0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_links_getaddrinfo="yes" ],[ AC_MSG_RESULT([no]) tst_links_getaddrinfo="no" ]) # if test "$tst_links_getaddrinfo" = "yes"; then AC_MSG_CHECKING([if getaddrinfo is prototyped]) AC_EGREP_CPP([getaddrinfo],[ $cares_includes_ws2tcpip $cares_includes_sys_socket $cares_includes_netdb ],[ AC_MSG_RESULT([yes]) tst_proto_getaddrinfo="yes" ],[ AC_MSG_RESULT([no]) tst_proto_getaddrinfo="no" ]) fi # if test "$tst_proto_getaddrinfo" = "yes"; then AC_MSG_CHECKING([if getaddrinfo is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $cares_includes_ws2tcpip $cares_includes_sys_socket $cares_includes_netdb ]],[[ if(0 != getaddrinfo(0, 0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_getaddrinfo="yes" ],[ AC_MSG_RESULT([no]) tst_compi_getaddrinfo="no" ]) fi # dnl only do runtime verification when not cross-compiling if test "x$cross_compiling" != "xyes" && test "$tst_compi_getaddrinfo" = "yes"; then AC_MSG_CHECKING([if getaddrinfo seems to work]) AC_RUN_IFELSE([ AC_LANG_PROGRAM([[ $cares_includes_ws2tcpip $cares_includes_stdlib $cares_includes_string $cares_includes_sys_socket $cares_includes_netdb ]],[[ struct addrinfo hints; struct addrinfo *ai = 0; int error; memset(&hints, 0, sizeof(hints)); hints.ai_flags = AI_NUMERICHOST; hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; error = getaddrinfo("127.0.0.1", 0, &hints, &ai); if(error || !ai) exit(1); /* fail */ else exit(0); ]]) ],[ AC_MSG_RESULT([yes]) tst_works_getaddrinfo="yes" ],[ AC_MSG_RESULT([no]) tst_works_getaddrinfo="no" ]) fi # if test "$tst_compi_getaddrinfo" = "yes" && test "$tst_works_getaddrinfo" != "no"; then AC_MSG_CHECKING([if getaddrinfo usage allowed]) if test "x$cares_disallow_getaddrinfo" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_getaddrinfo="yes" else AC_MSG_RESULT([no]) tst_allow_getaddrinfo="no" fi fi # AC_MSG_CHECKING([if getaddrinfo might be used]) if test "$tst_links_getaddrinfo" = "yes" && test "$tst_proto_getaddrinfo" = "yes" && test "$tst_compi_getaddrinfo" = "yes" && test "$tst_allow_getaddrinfo" = "yes" && test "$tst_works_getaddrinfo" != "no"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_GETADDRINFO, 1, [Define to 1 if you have a working getaddrinfo function.]) ac_cv_func_getaddrinfo="yes" else AC_MSG_RESULT([no]) ac_cv_func_getaddrinfo="no" ac_cv_func_getaddrinfo_threadsafe="no" fi # if test "$ac_cv_func_getaddrinfo" = "yes"; then AC_MSG_CHECKING([if getaddrinfo is threadsafe]) case $host_os in aix[[1234]].* | aix5.[[01]].*) dnl aix 5.1 and older tst_tsafe_getaddrinfo="no" ;; aix*) dnl aix 5.2 and newer tst_tsafe_getaddrinfo="yes" ;; darwin[[12345]].*) dnl darwin 5.0 and mac os x 10.1.X and older tst_tsafe_getaddrinfo="no" ;; darwin*) dnl darwin 6.0 and mac os x 10.2.X and newer tst_tsafe_getaddrinfo="yes" ;; freebsd[[1234]].* | freebsd5.[[1234]]*) dnl freebsd 5.4 and older tst_tsafe_getaddrinfo="no" ;; freebsd*) dnl freebsd 5.5 and newer tst_tsafe_getaddrinfo="yes" ;; hpux[[123456789]].* | hpux10.* | hpux11.0* | hpux11.10*) dnl hpux 11.10 and older tst_tsafe_getaddrinfo="no" ;; hpux*) dnl hpux 11.11 and newer tst_tsafe_getaddrinfo="yes" ;; netbsd[[123]].*) dnl netbsd 3.X and older tst_tsafe_getaddrinfo="no" ;; netbsd*) dnl netbsd 4.X and newer tst_tsafe_getaddrinfo="yes" ;; *bsd*) dnl All other bsd's tst_tsafe_getaddrinfo="no" ;; solaris2*) dnl solaris which have it tst_tsafe_getaddrinfo="yes" ;; esac if test "$tst_tsafe_getaddrinfo" = "unknown" && test "$ac_cv_native_windows" = "yes"; then tst_tsafe_getaddrinfo="yes" fi if test "$tst_tsafe_getaddrinfo" = "unknown"; then CURL_CHECK_DEF_CC([h_errno], [ $cares_includes_sys_socket $cares_includes_netdb ], [silent]) if test "$curl_cv_have_def_h_errno" = "yes"; then tst_h_errno_macro="yes" else tst_h_errno_macro="no" fi AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $cares_includes_sys_socket $cares_includes_netdb ]],[[ h_errno = 2; if(0 != h_errno) return 1; ]]) ],[ tst_h_errno_modifiable_lvalue="yes" ],[ tst_h_errno_modifiable_lvalue="no" ]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ ]],[[ #if defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200809L) return 0; #elif defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 700) return 0; #else force compilation error #endif ]]) ],[ tst_h_errno_sbs_issue_7="yes" ],[ tst_h_errno_sbs_issue_7="no" ]) if test "$tst_h_errno_macro" = "no" && test "$tst_h_errno_modifiable_lvalue" = "no" && test "$tst_h_errno_sbs_issue_7" = "no"; then tst_tsafe_getaddrinfo="no" else tst_tsafe_getaddrinfo="yes" fi fi AC_MSG_RESULT([$tst_tsafe_getaddrinfo]) if test "$tst_tsafe_getaddrinfo" = "yes"; then AC_DEFINE_UNQUOTED(HAVE_GETADDRINFO_THREADSAFE, 1, [Define to 1 if the getaddrinfo function is threadsafe.]) ac_cv_func_getaddrinfo_threadsafe="yes" else ac_cv_func_getaddrinfo_threadsafe="no" fi fi ]) dnl CARES_CHECK_FUNC_GETENV dnl ------------------------------------------------- dnl Verify if getenv is available, prototyped, and dnl can be compiled. If all of these are true, and dnl usage has not been previously disallowed with dnl shell variable cares_disallow_getenv, then dnl HAVE_GETENV will be defined. AC_DEFUN([CARES_CHECK_FUNC_GETENV], [ AC_REQUIRE([CARES_INCLUDES_STDLIB])dnl # tst_links_getenv="unknown" tst_proto_getenv="unknown" tst_compi_getenv="unknown" tst_allow_getenv="unknown" # AC_MSG_CHECKING([if getenv can be linked]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([getenv]) ],[ AC_MSG_RESULT([yes]) tst_links_getenv="yes" ],[ AC_MSG_RESULT([no]) tst_links_getenv="no" ]) # if test "$tst_links_getenv" = "yes"; then AC_MSG_CHECKING([if getenv is prototyped]) AC_EGREP_CPP([getenv],[ $cares_includes_stdlib ],[ AC_MSG_RESULT([yes]) tst_proto_getenv="yes" ],[ AC_MSG_RESULT([no]) tst_proto_getenv="no" ]) fi # if test "$tst_proto_getenv" = "yes"; then AC_MSG_CHECKING([if getenv is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $cares_includes_stdlib ]],[[ if(0 != getenv(0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_getenv="yes" ],[ AC_MSG_RESULT([no]) tst_compi_getenv="no" ]) fi # if test "$tst_compi_getenv" = "yes"; then AC_MSG_CHECKING([if getenv usage allowed]) if test "x$cares_disallow_getenv" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_getenv="yes" else AC_MSG_RESULT([no]) tst_allow_getenv="no" fi fi # AC_MSG_CHECKING([if getenv might be used]) if test "$tst_links_getenv" = "yes" && test "$tst_proto_getenv" = "yes" && test "$tst_compi_getenv" = "yes" && test "$tst_allow_getenv" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_GETENV, 1, [Define to 1 if you have the getenv function.]) ac_cv_func_getenv="yes" else AC_MSG_RESULT([no]) ac_cv_func_getenv="no" fi ]) dnl CARES_CHECK_FUNC_GETHOSTBYADDR dnl ------------------------------------------------- dnl Verify if gethostbyaddr is available, prototyped, dnl and can be compiled. If all of these are true, dnl and usage has not been previously disallowed with dnl shell variable cares_disallow_gethostbyaddr, then dnl HAVE_GETHOSTBYADDR will be defined. AC_DEFUN([CARES_CHECK_FUNC_GETHOSTBYADDR], [ AC_REQUIRE([CARES_INCLUDES_WINSOCK2])dnl AC_REQUIRE([CARES_INCLUDES_NETDB])dnl # tst_links_gethostbyaddr="unknown" tst_proto_gethostbyaddr="unknown" tst_compi_gethostbyaddr="unknown" tst_allow_gethostbyaddr="unknown" # AC_MSG_CHECKING([if gethostbyaddr can be linked]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ $cares_includes_winsock2 $cares_includes_netdb ]],[[ if(0 != gethostbyaddr(0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_links_gethostbyaddr="yes" ],[ AC_MSG_RESULT([no]) tst_links_gethostbyaddr="no" ]) # if test "$tst_links_gethostbyaddr" = "yes"; then AC_MSG_CHECKING([if gethostbyaddr is prototyped]) AC_EGREP_CPP([gethostbyaddr],[ $cares_includes_winsock2 $cares_includes_netdb ],[ AC_MSG_RESULT([yes]) tst_proto_gethostbyaddr="yes" ],[ AC_MSG_RESULT([no]) tst_proto_gethostbyaddr="no" ]) fi # if test "$tst_proto_gethostbyaddr" = "yes"; then AC_MSG_CHECKING([if gethostbyaddr is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $cares_includes_winsock2 $cares_includes_netdb ]],[[ if(0 != gethostbyaddr(0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_gethostbyaddr="yes" ],[ AC_MSG_RESULT([no]) tst_compi_gethostbyaddr="no" ]) fi # if test "$tst_compi_gethostbyaddr" = "yes"; then AC_MSG_CHECKING([if gethostbyaddr usage allowed]) if test "x$cares_disallow_gethostbyaddr" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_gethostbyaddr="yes" else AC_MSG_RESULT([no]) tst_allow_gethostbyaddr="no" fi fi # AC_MSG_CHECKING([if gethostbyaddr might be used]) if test "$tst_links_gethostbyaddr" = "yes" && test "$tst_proto_gethostbyaddr" = "yes" && test "$tst_compi_gethostbyaddr" = "yes" && test "$tst_allow_gethostbyaddr" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_GETHOSTBYADDR, 1, [Define to 1 if you have the gethostbyaddr function.]) ac_cv_func_gethostbyaddr="yes" else AC_MSG_RESULT([no]) ac_cv_func_gethostbyaddr="no" fi ]) dnl CARES_CHECK_FUNC_GETHOSTBYNAME dnl ------------------------------------------------- dnl Verify if gethostbyname is available, prototyped, dnl and can be compiled. If all of these are true, dnl and usage has not been previously disallowed with dnl shell variable cares_disallow_gethostbyname, then dnl HAVE_GETHOSTBYNAME will be defined. AC_DEFUN([CARES_CHECK_FUNC_GETHOSTBYNAME], [ AC_REQUIRE([CARES_INCLUDES_WINSOCK2])dnl AC_REQUIRE([CARES_INCLUDES_NETDB])dnl # tst_links_gethostbyname="unknown" tst_proto_gethostbyname="unknown" tst_compi_gethostbyname="unknown" tst_allow_gethostbyname="unknown" # AC_MSG_CHECKING([if gethostbyname can be linked]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ $cares_includes_winsock2 $cares_includes_netdb ]],[[ if(0 != gethostbyname(0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_links_gethostbyname="yes" ],[ AC_MSG_RESULT([no]) tst_links_gethostbyname="no" ]) # if test "$tst_links_gethostbyname" = "yes"; then AC_MSG_CHECKING([if gethostbyname is prototyped]) AC_EGREP_CPP([gethostbyname],[ $cares_includes_winsock2 $cares_includes_netdb ],[ AC_MSG_RESULT([yes]) tst_proto_gethostbyname="yes" ],[ AC_MSG_RESULT([no]) tst_proto_gethostbyname="no" ]) fi # if test "$tst_proto_gethostbyname" = "yes"; then AC_MSG_CHECKING([if gethostbyname is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $cares_includes_winsock2 $cares_includes_netdb ]],[[ if(0 != gethostbyname(0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_gethostbyname="yes" ],[ AC_MSG_RESULT([no]) tst_compi_gethostbyname="no" ]) fi # if test "$tst_compi_gethostbyname" = "yes"; then AC_MSG_CHECKING([if gethostbyname usage allowed]) if test "x$cares_disallow_gethostbyname" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_gethostbyname="yes" else AC_MSG_RESULT([no]) tst_allow_gethostbyname="no" fi fi # AC_MSG_CHECKING([if gethostbyname might be used]) if test "$tst_links_gethostbyname" = "yes" && test "$tst_proto_gethostbyname" = "yes" && test "$tst_compi_gethostbyname" = "yes" && test "$tst_allow_gethostbyname" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_GETHOSTBYNAME, 1, [Define to 1 if you have the gethostbyname function.]) ac_cv_func_gethostbyname="yes" else AC_MSG_RESULT([no]) ac_cv_func_gethostbyname="no" fi ]) dnl CARES_CHECK_FUNC_GETHOSTNAME dnl ------------------------------------------------- dnl Verify if gethostname is available, prototyped, and dnl can be compiled. If all of these are true, and dnl usage has not been previously disallowed with dnl shell variable cares_disallow_gethostname, then dnl HAVE_GETHOSTNAME will be defined. AC_DEFUN([CARES_CHECK_FUNC_GETHOSTNAME], [ AC_REQUIRE([CARES_INCLUDES_WINSOCK2])dnl AC_REQUIRE([CARES_INCLUDES_UNISTD])dnl AC_REQUIRE([CARES_PREPROCESS_CALLCONV])dnl # tst_links_gethostname="unknown" tst_proto_gethostname="unknown" tst_compi_gethostname="unknown" tst_allow_gethostname="unknown" # AC_MSG_CHECKING([if gethostname can be linked]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ $cares_includes_winsock2 $cares_includes_unistd ]],[[ if(0 != gethostname(0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_links_gethostname="yes" ],[ AC_MSG_RESULT([no]) tst_links_gethostname="no" ]) # if test "$tst_links_gethostname" = "yes"; then AC_MSG_CHECKING([if gethostname is prototyped]) AC_EGREP_CPP([gethostname],[ $cares_includes_winsock2 $cares_includes_unistd ],[ AC_MSG_RESULT([yes]) tst_proto_gethostname="yes" ],[ AC_MSG_RESULT([no]) tst_proto_gethostname="no" ]) fi # if test "$tst_proto_gethostname" = "yes"; then AC_MSG_CHECKING([if gethostname is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $cares_includes_winsock2 $cares_includes_unistd ]],[[ if(0 != gethostname(0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_gethostname="yes" ],[ AC_MSG_RESULT([no]) tst_compi_gethostname="no" ]) fi # if test "$tst_compi_gethostname" = "yes"; then AC_MSG_CHECKING([for gethostname arg 2 data type]) tst_gethostname_type_arg2="unknown" for tst_arg1 in 'char *' 'unsigned char *' 'void *'; do for tst_arg2 in 'int' 'unsigned int' 'size_t'; do if test "$tst_gethostname_type_arg2" = "unknown"; then AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $cares_includes_winsock2 $cares_includes_unistd $cares_preprocess_callconv extern int FUNCALLCONV gethostname($tst_arg1, $tst_arg2); ]],[[ if(0 != gethostname(0, 0)) return 1; ]]) ],[ tst_gethostname_type_arg2="$tst_arg2" ]) fi done done AC_MSG_RESULT([$tst_gethostname_type_arg2]) if test "$tst_gethostname_type_arg2" != "unknown"; then AC_DEFINE_UNQUOTED(GETHOSTNAME_TYPE_ARG2, $tst_gethostname_type_arg2, [Define to the type of arg 2 for gethostname.]) fi fi # if test "$tst_compi_gethostname" = "yes"; then AC_MSG_CHECKING([if gethostname usage allowed]) if test "x$cares_disallow_gethostname" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_gethostname="yes" else AC_MSG_RESULT([no]) tst_allow_gethostname="no" fi fi # AC_MSG_CHECKING([if gethostname might be used]) if test "$tst_links_gethostname" = "yes" && test "$tst_proto_gethostname" = "yes" && test "$tst_compi_gethostname" = "yes" && test "$tst_allow_gethostname" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_GETHOSTNAME, 1, [Define to 1 if you have the gethostname function.]) ac_cv_func_gethostname="yes" else AC_MSG_RESULT([no]) ac_cv_func_gethostname="no" fi ]) dnl CARES_CHECK_FUNC_GETSERVBYPORT_R dnl ------------------------------------------------- dnl Verify if getservbyport_r is available, prototyped, dnl and can be compiled. If all of these are true, and dnl usage has not been previously disallowed with dnl shell variable cares_disallow_getservbyport_r, then dnl HAVE_GETSERVBYPORT_R will be defined. AC_DEFUN([CARES_CHECK_FUNC_GETSERVBYPORT_R], [ AC_REQUIRE([CARES_INCLUDES_NETDB])dnl # tst_links_getservbyport_r="unknown" tst_proto_getservbyport_r="unknown" tst_compi_getservbyport_r="unknown" tst_allow_getservbyport_r="unknown" tst_nargs_getservbyport_r="unknown" # AC_MSG_CHECKING([if getservbyport_r can be linked]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([getservbyport_r]) ],[ AC_MSG_RESULT([yes]) tst_links_getservbyport_r="yes" ],[ AC_MSG_RESULT([no]) tst_links_getservbyport_r="no" ]) # if test "$tst_links_getservbyport_r" = "yes"; then AC_MSG_CHECKING([if getservbyport_r is prototyped]) AC_EGREP_CPP([getservbyport_r],[ $cares_includes_netdb ],[ AC_MSG_RESULT([yes]) tst_proto_getservbyport_r="yes" ],[ AC_MSG_RESULT([no]) tst_proto_getservbyport_r="no" ]) fi # if test "$tst_proto_getservbyport_r" = "yes"; then if test "$tst_nargs_getservbyport_r" = "unknown"; then AC_MSG_CHECKING([if getservbyport_r takes 4 args.]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $cares_includes_netdb ]],[[ if(0 != getservbyport_r(0, 0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_getservbyport_r="yes" tst_nargs_getservbyport_r="4" ],[ AC_MSG_RESULT([no]) tst_compi_getservbyport_r="no" ]) fi if test "$tst_nargs_getservbyport_r" = "unknown"; then AC_MSG_CHECKING([if getservbyport_r takes 5 args.]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $cares_includes_netdb ]],[[ if(0 != getservbyport_r(0, 0, 0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_getservbyport_r="yes" tst_nargs_getservbyport_r="5" ],[ AC_MSG_RESULT([no]) tst_compi_getservbyport_r="no" ]) fi if test "$tst_nargs_getservbyport_r" = "unknown"; then AC_MSG_CHECKING([if getservbyport_r takes 6 args.]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $cares_includes_netdb ]],[[ if(0 != getservbyport_r(0, 0, 0, 0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_getservbyport_r="yes" tst_nargs_getservbyport_r="6" ],[ AC_MSG_RESULT([no]) tst_compi_getservbyport_r="no" ]) fi AC_MSG_CHECKING([if getservbyport_r is compilable]) if test "$tst_compi_getservbyport_r" = "yes"; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi fi # if test "$tst_compi_getservbyport_r" = "yes"; then AC_MSG_CHECKING([if getservbyport_r usage allowed]) if test "x$cares_disallow_getservbyport_r" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_getservbyport_r="yes" else AC_MSG_RESULT([no]) tst_allow_getservbyport_r="no" fi fi # AC_MSG_CHECKING([if getservbyport_r might be used]) if test "$tst_links_getservbyport_r" = "yes" && test "$tst_proto_getservbyport_r" = "yes" && test "$tst_compi_getservbyport_r" = "yes" && test "$tst_allow_getservbyport_r" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_GETSERVBYPORT_R, 1, [Define to 1 if you have the getservbyport_r function.]) AC_DEFINE_UNQUOTED(GETSERVBYPORT_R_ARGS, $tst_nargs_getservbyport_r, [Specifies the number of arguments to getservbyport_r]) if test "$tst_nargs_getservbyport_r" -eq "4"; then AC_DEFINE(GETSERVBYPORT_R_BUFSIZE, sizeof(struct servent_data), [Specifies the size of the buffer to pass to getservbyport_r]) else AC_DEFINE(GETSERVBYPORT_R_BUFSIZE, 4096, [Specifies the size of the buffer to pass to getservbyport_r]) fi ac_cv_func_getservbyport_r="yes" else AC_MSG_RESULT([no]) ac_cv_func_getservbyport_r="no" fi ]) dnl CARES_CHECK_FUNC_GETSERVBYNAME_R dnl ------------------------------------------------- dnl Verify if getservbyname_r is available, prototyped, dnl and can be compiled. If all of these are true, and dnl usage has not been previously disallowed with dnl shell variable cares_disallow_getservbyname_r, then dnl HAVE_GETSERVBYNAME_R will be defined. AC_DEFUN([CARES_CHECK_FUNC_GETSERVBYNAME_R], [ AC_REQUIRE([CARES_INCLUDES_NETDB])dnl # tst_links_getservbyname_r="unknown" tst_proto_getservbyname_r="unknown" tst_compi_getservbyname_r="unknown" tst_allow_getservbyname_r="unknown" tst_nargs_getservbyname_r="unknown" # AC_MSG_CHECKING([if getservbyname_r can be linked]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([getservbyname_r]) ],[ AC_MSG_RESULT([yes]) tst_links_getservbyname_r="yes" ],[ AC_MSG_RESULT([no]) tst_links_getservbyname_r="no" ]) # if test "$tst_links_getservbyname_r" = "yes"; then AC_MSG_CHECKING([if getservbyname_r is prototyped]) AC_EGREP_CPP([getservbyname_r],[ $cares_includes_netdb ],[ AC_MSG_RESULT([yes]) tst_proto_getservbyname_r="yes" ],[ AC_MSG_RESULT([no]) tst_proto_getservbyname_r="no" ]) fi # if test "$tst_proto_getservbyname_r" = "yes"; then if test "$tst_nargs_getservbyname_r" = "unknown"; then AC_MSG_CHECKING([if getservbyname_r takes 4 args.]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $cares_includes_netdb ]],[[ if(0 != getservbyname_r(0, 0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_getservbyname_r="yes" tst_nargs_getservbyname_r="4" ],[ AC_MSG_RESULT([no]) tst_compi_getservbyname_r="no" ]) fi if test "$tst_nargs_getservbyname_r" = "unknown"; then AC_MSG_CHECKING([if getservbyname_r takes 5 args.]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $cares_includes_netdb ]],[[ if(0 != getservbyname_r(0, 0, 0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_getservbyname_r="yes" tst_nargs_getservbyname_r="5" ],[ AC_MSG_RESULT([no]) tst_compi_getservbyname_r="no" ]) fi if test "$tst_nargs_getservbyname_r" = "unknown"; then AC_MSG_CHECKING([if getservbyname_r takes 6 args.]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $cares_includes_netdb ]],[[ if(0 != getservbyname_r(0, 0, 0, 0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_getservbyname_r="yes" tst_nargs_getservbyname_r="6" ],[ AC_MSG_RESULT([no]) tst_compi_getservbyname_r="no" ]) fi AC_MSG_CHECKING([if getservbyname_r is compilable]) if test "$tst_compi_getservbyname_r" = "yes"; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi fi # if test "$tst_compi_getservbyname_r" = "yes"; then AC_MSG_CHECKING([if getservbyname_r usage allowed]) if test "x$cares_disallow_getservbyname_r" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_getservbyname_r="yes" else AC_MSG_RESULT([no]) tst_allow_getservbyname_r="no" fi fi # AC_MSG_CHECKING([if getservbyname_r might be used]) if test "$tst_links_getservbyname_r" = "yes" && test "$tst_proto_getservbyname_r" = "yes" && test "$tst_compi_getservbyname_r" = "yes" && test "$tst_allow_getservbyname_r" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_GETSERVBYNAME_R, 1, [Define to 1 if you have the getservbyname_r function.]) AC_DEFINE_UNQUOTED(GETSERVBYNAME_R_ARGS, $tst_nargs_getservbyname_r, [Specifies the number of arguments to getservbyname_r]) if test "$tst_nargs_getservbyname_r" -eq "4"; then AC_DEFINE(GETSERVBYNAME_R_BUFSIZE, sizeof(struct servent_data), [Specifies the size of the buffer to pass to getservbyname_r]) else AC_DEFINE(GETSERVBYNAME_R_BUFSIZE, 4096, [Specifies the size of the buffer to pass to getservbyname_r]) fi ac_cv_func_getservbyname_r="yes" else AC_MSG_RESULT([no]) ac_cv_func_getservbyname_r="no" fi ]) dnl CARES_CHECK_FUNC_INET_NET_PTON dnl ------------------------------------------------- dnl Verify if inet_net_pton is available, prototyped, can dnl be compiled and seems to work. If all of these are dnl true, and usage has not been previously disallowed dnl with shell variable cares_disallow_inet_net_pton, then dnl HAVE_INET_NET_PTON will be defined. AC_DEFUN([CARES_CHECK_FUNC_INET_NET_PTON], [ AC_REQUIRE([CARES_INCLUDES_STDLIB])dnl AC_REQUIRE([CARES_INCLUDES_ARPA_INET])dnl AC_REQUIRE([CARES_INCLUDES_STRING])dnl # tst_links_inet_net_pton="unknown" tst_proto_inet_net_pton="unknown" tst_compi_inet_net_pton="unknown" tst_works_inet_net_pton="unknown" tst_allow_inet_net_pton="unknown" # AC_MSG_CHECKING([if inet_net_pton can be linked]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([inet_net_pton]) ],[ AC_MSG_RESULT([yes]) tst_links_inet_net_pton="yes" ],[ AC_MSG_RESULT([no]) tst_links_inet_net_pton="no" ]) # if test "$tst_links_inet_net_pton" = "yes"; then AC_MSG_CHECKING([if inet_net_pton is prototyped]) AC_EGREP_CPP([inet_net_pton],[ $cares_includes_arpa_inet ],[ AC_MSG_RESULT([yes]) tst_proto_inet_net_pton="yes" ],[ AC_MSG_RESULT([no]) tst_proto_inet_net_pton="no" ]) fi # if test "$tst_proto_inet_net_pton" = "yes"; then AC_MSG_CHECKING([if inet_net_pton is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $cares_includes_arpa_inet ]],[[ if(0 != inet_net_pton(0, 0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_inet_net_pton="yes" ],[ AC_MSG_RESULT([no]) tst_compi_inet_net_pton="no" ]) fi # dnl only do runtime verification when not cross-compiling if test "x$cross_compiling" != "xyes" && test "$tst_compi_inet_net_pton" = "yes"; then AC_MSG_CHECKING([if inet_net_pton seems to work]) AC_RUN_IFELSE([ AC_LANG_PROGRAM([[ $cares_includes_stdlib $cares_includes_arpa_inet $cares_includes_string ]],[[ unsigned char ipv6a[16+1]; unsigned char ipv4a[4+1]; const char *ipv6net1 = "fe80::214:4fff:fe0b:76c8"; const char *ipv6net2 = "::fffe:7f00:1"; const char *ipv6net3 = "7f20:1::/64"; const char *ipv6net4 = "7f20:1::/2147483649"; const char *ipv4net1 = "192.168.100.1"; const char *ipv4net2 = "192.168.100/32"; const char *ipv4net3 = "192.168.100.1/2147483649"; /* - */ memset(ipv4a, 1, sizeof(ipv4a)); if(32 != inet_net_pton(AF_INET, ipv4net1, ipv4a, 4)) exit(1); /* fail */ /* - */ if( (ipv4a[0x00] != 0xc0) || (ipv4a[0x01] != 0xa8) || (ipv4a[0x02] != 0x64) || (ipv4a[0x03] != 0x01) || (ipv4a[0x04] != 0x01) ) exit(1); /* fail */ /* - */ memset(ipv4a, 1, sizeof(ipv4a)); if(32 != inet_net_pton(AF_INET, ipv4net2, ipv4a, 4)) exit(1); /* fail */ /* - */ if( (ipv4a[0x00] != 0xc0) || (ipv4a[0x01] != 0xa8) || (ipv4a[0x02] != 0x64) || (ipv4a[0x03] != 0x00) || (ipv4a[0x04] != 0x01) ) exit(1); /* fail */ /* - */ memset(ipv4a, 1, sizeof(ipv4a)); if(-1 != inet_net_pton(AF_INET, ipv4net3, ipv4a, 4)) exit(1); /* fail */ /* - */ memset(ipv6a, 1, sizeof(ipv6a)); if(128 != inet_net_pton(AF_INET6, ipv6net1, ipv6a, 16)) exit(1); /* fail */ /* - */ if( (ipv6a[0x00] != 0xfe) || (ipv6a[0x01] != 0x80) || (ipv6a[0x08] != 0x02) || (ipv6a[0x09] != 0x14) || (ipv6a[0x0a] != 0x4f) || (ipv6a[0x0b] != 0xff) || (ipv6a[0x0c] != 0xfe) || (ipv6a[0x0d] != 0x0b) || (ipv6a[0x0e] != 0x76) || (ipv6a[0x0f] != 0xc8) || (ipv6a[0x10] != 0x01) ) exit(1); /* fail */ /* - */ if( (ipv6a[0x02] != 0x0) || (ipv6a[0x03] != 0x0) || (ipv6a[0x04] != 0x0) || (ipv6a[0x05] != 0x0) || (ipv6a[0x06] != 0x0) || (ipv6a[0x07] != 0x0) ) exit(1); /* fail */ /* - */ memset(ipv6a, 0, sizeof(ipv6a)); ipv6a[0x10] = 0x01; if(128 != inet_net_pton(AF_INET6, ipv6net2, ipv6a, 16)) exit(1); /* fail */ /* - */ if( (ipv6a[0x0a] != 0xff) || (ipv6a[0x0b] != 0xfe) || (ipv6a[0x0c] != 0x7f) || (ipv6a[0x0f] != 0x01) || (ipv6a[0x10] != 0x01) ) exit(1); /* fail */ /* - */ if( (ipv6a[0x00] != 0x0) || (ipv6a[0x01] != 0x0) || (ipv6a[0x02] != 0x0) || (ipv6a[0x03] != 0x0) || (ipv6a[0x04] != 0x0) || (ipv6a[0x05] != 0x0) || (ipv6a[0x06] != 0x0) || (ipv6a[0x07] != 0x0) || (ipv6a[0x08] != 0x0) || (ipv6a[0x09] != 0x0) || (ipv6a[0x0d] != 0x0) || (ipv6a[0x0e] != 0x0) ) exit(1); /* fail */ /* - */ memset(ipv6a, 1, sizeof(ipv6a)); if(64 != inet_net_pton(AF_INET6, ipv6net3, ipv6a, 16)) exit(1); /* fail */ if( (ipv6a[0x00] != 0x7f) || (ipv6a[0x01] != 0x20) || (ipv6a[0x03] != 0x01) || (ipv6a[0x08] != 0x01) || (ipv6a[0x09] != 0x01) || (ipv6a[0x0a] != 0x01) || (ipv6a[0x0b] != 0x01) || (ipv6a[0x0c] != 0x01) || (ipv6a[0x0d] != 0x01) || (ipv6a[0x0e] != 0x01) || (ipv6a[0x0f] != 0x01) || (ipv6a[0x10] != 0x01) ) exit(1); /* fail */ if( (ipv6a[0x02] != 0x0) || (ipv6a[0x04] != 0x0) || (ipv6a[0x05] != 0x0) || (ipv6a[0x06] != 0x0) || (ipv6a[0x07] != 0x0) || (ipv6a[0x07] != 0x0) ) exit(1); /* fail */ /* - */ memset(ipv6a, 1, sizeof(ipv6a)); if(-1 != inet_net_pton(AF_INET6, ipv6net4, ipv6a, 16)) exit(1); /* fail */ /* - */ exit(0); ]]) ],[ AC_MSG_RESULT([yes]) tst_works_inet_net_pton="yes" ],[ AC_MSG_RESULT([no]) tst_works_inet_net_pton="no" ]) fi # if test "$tst_compi_inet_net_pton" = "yes" && test "$tst_works_inet_net_pton" != "no"; then AC_MSG_CHECKING([if inet_net_pton usage allowed]) if test "x$cares_disallow_inet_net_pton" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_inet_net_pton="yes" else AC_MSG_RESULT([no]) tst_allow_inet_net_pton="no" fi fi # AC_MSG_CHECKING([if inet_net_pton might be used]) if test "$tst_links_inet_net_pton" = "yes" && test "$tst_proto_inet_net_pton" = "yes" && test "$tst_compi_inet_net_pton" = "yes" && test "$tst_allow_inet_net_pton" = "yes" && test "$tst_works_inet_net_pton" != "no"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_INET_NET_PTON, 1, [Define to 1 if you have a IPv6 capable working inet_net_pton function.]) ac_cv_func_inet_net_pton="yes" else AC_MSG_RESULT([no]) ac_cv_func_inet_net_pton="no" fi ]) dnl CARES_CHECK_FUNC_INET_NTOP dnl ------------------------------------------------- dnl Verify if inet_ntop is available, prototyped, can dnl be compiled and seems to work. If all of these are dnl true, and usage has not been previously disallowed dnl with shell variable cares_disallow_inet_ntop, then dnl HAVE_INET_NTOP will be defined. AC_DEFUN([CARES_CHECK_FUNC_INET_NTOP], [ AC_REQUIRE([CARES_INCLUDES_STDLIB])dnl AC_REQUIRE([CARES_INCLUDES_ARPA_INET])dnl AC_REQUIRE([CARES_INCLUDES_STRING])dnl # tst_links_inet_ntop="unknown" tst_proto_inet_ntop="unknown" tst_compi_inet_ntop="unknown" tst_works_inet_ntop="unknown" tst_allow_inet_ntop="unknown" # AC_MSG_CHECKING([if inet_ntop can be linked]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([inet_ntop]) ],[ AC_MSG_RESULT([yes]) tst_links_inet_ntop="yes" ],[ AC_MSG_RESULT([no]) tst_links_inet_ntop="no" ]) # if test "$tst_links_inet_ntop" = "yes"; then AC_MSG_CHECKING([if inet_ntop is prototyped]) AC_EGREP_CPP([inet_ntop],[ $cares_includes_arpa_inet ],[ AC_MSG_RESULT([yes]) tst_proto_inet_ntop="yes" ],[ AC_MSG_RESULT([no]) tst_proto_inet_ntop="no" ]) fi # if test "$tst_proto_inet_ntop" = "yes"; then AC_MSG_CHECKING([if inet_ntop is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $cares_includes_arpa_inet ]],[[ if(0 != inet_ntop(0, 0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_inet_ntop="yes" ],[ AC_MSG_RESULT([no]) tst_compi_inet_ntop="no" ]) fi # dnl only do runtime verification when not cross-compiling if test "x$cross_compiling" != "xyes" && test "$tst_compi_inet_ntop" = "yes"; then AC_MSG_CHECKING([if inet_ntop seems to work]) AC_RUN_IFELSE([ AC_LANG_PROGRAM([[ $cares_includes_stdlib $cares_includes_arpa_inet $cares_includes_string ]],[[ char ipv6res[sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")]; char ipv4res[sizeof "255.255.255.255"]; unsigned char ipv6a[26]; unsigned char ipv4a[5]; char *ipv6ptr = 0; char *ipv4ptr = 0; /* - */ ipv4res[0] = '\0'; ipv4a[0] = 0xc0; ipv4a[1] = 0xa8; ipv4a[2] = 0x64; ipv4a[3] = 0x01; ipv4a[4] = 0x01; /* - */ ipv4ptr = inet_ntop(AF_INET, ipv4a, ipv4res, sizeof(ipv4res)); if(!ipv4ptr) exit(1); /* fail */ if(ipv4ptr != ipv4res) exit(1); /* fail */ if(!ipv4ptr[0]) exit(1); /* fail */ if(memcmp(ipv4res, "192.168.100.1", 13) != 0) exit(1); /* fail */ /* - */ ipv6res[0] = '\0'; memset(ipv6a, 0, sizeof(ipv6a)); ipv6a[0] = 0xfe; ipv6a[1] = 0x80; ipv6a[8] = 0x02; ipv6a[9] = 0x14; ipv6a[10] = 0x4f; ipv6a[11] = 0xff; ipv6a[12] = 0xfe; ipv6a[13] = 0x0b; ipv6a[14] = 0x76; ipv6a[15] = 0xc8; ipv6a[25] = 0x01; /* - */ ipv6ptr = inet_ntop(AF_INET6, ipv6a, ipv6res, sizeof(ipv6res)); if(!ipv6ptr) exit(1); /* fail */ if(ipv6ptr != ipv6res) exit(1); /* fail */ if(!ipv6ptr[0]) exit(1); /* fail */ if(memcmp(ipv6res, "fe80::214:4fff:fe0b:76c8", 24) != 0) exit(1); /* fail */ /* - */ exit(0); ]]) ],[ AC_MSG_RESULT([yes]) tst_works_inet_ntop="yes" ],[ AC_MSG_RESULT([no]) tst_works_inet_ntop="no" ]) fi # if test "$tst_compi_inet_ntop" = "yes" && test "$tst_works_inet_ntop" != "no"; then AC_MSG_CHECKING([if inet_ntop usage allowed]) if test "x$cares_disallow_inet_ntop" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_inet_ntop="yes" else AC_MSG_RESULT([no]) tst_allow_inet_ntop="no" fi fi # AC_MSG_CHECKING([if inet_ntop might be used]) if test "$tst_links_inet_ntop" = "yes" && test "$tst_proto_inet_ntop" = "yes" && test "$tst_compi_inet_ntop" = "yes" && test "$tst_allow_inet_ntop" = "yes" && test "$tst_works_inet_ntop" != "no"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_INET_NTOP, 1, [Define to 1 if you have a IPv6 capable working inet_ntop function.]) ac_cv_func_inet_ntop="yes" else AC_MSG_RESULT([no]) ac_cv_func_inet_ntop="no" fi ]) dnl CARES_CHECK_FUNC_INET_PTON dnl ------------------------------------------------- dnl Verify if inet_pton is available, prototyped, can dnl be compiled and seems to work. If all of these are dnl true, and usage has not been previously disallowed dnl with shell variable cares_disallow_inet_pton, then dnl HAVE_INET_PTON will be defined. AC_DEFUN([CARES_CHECK_FUNC_INET_PTON], [ AC_REQUIRE([CARES_INCLUDES_STDLIB])dnl AC_REQUIRE([CARES_INCLUDES_ARPA_INET])dnl AC_REQUIRE([CARES_INCLUDES_STRING])dnl # tst_links_inet_pton="unknown" tst_proto_inet_pton="unknown" tst_compi_inet_pton="unknown" tst_works_inet_pton="unknown" tst_allow_inet_pton="unknown" # AC_MSG_CHECKING([if inet_pton can be linked]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([inet_pton]) ],[ AC_MSG_RESULT([yes]) tst_links_inet_pton="yes" ],[ AC_MSG_RESULT([no]) tst_links_inet_pton="no" ]) # if test "$tst_links_inet_pton" = "yes"; then AC_MSG_CHECKING([if inet_pton is prototyped]) AC_EGREP_CPP([inet_pton],[ $cares_includes_arpa_inet ],[ AC_MSG_RESULT([yes]) tst_proto_inet_pton="yes" ],[ AC_MSG_RESULT([no]) tst_proto_inet_pton="no" ]) fi # if test "$tst_proto_inet_pton" = "yes"; then AC_MSG_CHECKING([if inet_pton is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $cares_includes_arpa_inet ]],[[ if(0 != inet_pton(0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_inet_pton="yes" ],[ AC_MSG_RESULT([no]) tst_compi_inet_pton="no" ]) fi # dnl only do runtime verification when not cross-compiling if test "x$cross_compiling" != "xyes" && test "$tst_compi_inet_pton" = "yes"; then AC_MSG_CHECKING([if inet_pton seems to work]) AC_RUN_IFELSE([ AC_LANG_PROGRAM([[ $cares_includes_stdlib $cares_includes_arpa_inet $cares_includes_string ]],[[ unsigned char ipv6a[16+1]; unsigned char ipv4a[4+1]; const char *ipv6src = "fe80::214:4fff:fe0b:76c8"; const char *ipv4src = "192.168.100.1"; /* - */ memset(ipv4a, 1, sizeof(ipv4a)); if(1 != inet_pton(AF_INET, ipv4src, ipv4a)) exit(1); /* fail */ /* - */ if( (ipv4a[0] != 0xc0) || (ipv4a[1] != 0xa8) || (ipv4a[2] != 0x64) || (ipv4a[3] != 0x01) || (ipv4a[4] != 0x01) ) exit(1); /* fail */ /* - */ memset(ipv6a, 1, sizeof(ipv6a)); if(1 != inet_pton(AF_INET6, ipv6src, ipv6a)) exit(1); /* fail */ /* - */ if( (ipv6a[0] != 0xfe) || (ipv6a[1] != 0x80) || (ipv6a[8] != 0x02) || (ipv6a[9] != 0x14) || (ipv6a[10] != 0x4f) || (ipv6a[11] != 0xff) || (ipv6a[12] != 0xfe) || (ipv6a[13] != 0x0b) || (ipv6a[14] != 0x76) || (ipv6a[15] != 0xc8) || (ipv6a[16] != 0x01) ) exit(1); /* fail */ /* - */ if( (ipv6a[2] != 0x0) || (ipv6a[3] != 0x0) || (ipv6a[4] != 0x0) || (ipv6a[5] != 0x0) || (ipv6a[6] != 0x0) || (ipv6a[7] != 0x0) ) exit(1); /* fail */ /* - */ exit(0); ]]) ],[ AC_MSG_RESULT([yes]) tst_works_inet_pton="yes" ],[ AC_MSG_RESULT([no]) tst_works_inet_pton="no" ]) fi # if test "$tst_compi_inet_pton" = "yes" && test "$tst_works_inet_pton" != "no"; then AC_MSG_CHECKING([if inet_pton usage allowed]) if test "x$cares_disallow_inet_pton" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_inet_pton="yes" else AC_MSG_RESULT([no]) tst_allow_inet_pton="no" fi fi # AC_MSG_CHECKING([if inet_pton might be used]) if test "$tst_links_inet_pton" = "yes" && test "$tst_proto_inet_pton" = "yes" && test "$tst_compi_inet_pton" = "yes" && test "$tst_allow_inet_pton" = "yes" && test "$tst_works_inet_pton" != "no"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_INET_PTON, 1, [Define to 1 if you have a IPv6 capable working inet_pton function.]) ac_cv_func_inet_pton="yes" else AC_MSG_RESULT([no]) ac_cv_func_inet_pton="no" fi ]) dnl CARES_CHECK_FUNC_IOCTL dnl ------------------------------------------------- dnl Verify if ioctl is available, prototyped, and dnl can be compiled. If all of these are true, and dnl usage has not been previously disallowed with dnl shell variable cares_disallow_ioctl, then dnl HAVE_IOCTL will be defined. AC_DEFUN([CARES_CHECK_FUNC_IOCTL], [ AC_REQUIRE([CARES_INCLUDES_STROPTS])dnl # tst_links_ioctl="unknown" tst_proto_ioctl="unknown" tst_compi_ioctl="unknown" tst_allow_ioctl="unknown" # AC_MSG_CHECKING([if ioctl can be linked]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([ioctl]) ],[ AC_MSG_RESULT([yes]) tst_links_ioctl="yes" ],[ AC_MSG_RESULT([no]) tst_links_ioctl="no" ]) # if test "$tst_links_ioctl" = "yes"; then AC_MSG_CHECKING([if ioctl is prototyped]) AC_EGREP_CPP([ioctl],[ $cares_includes_stropts ],[ AC_MSG_RESULT([yes]) tst_proto_ioctl="yes" ],[ AC_MSG_RESULT([no]) tst_proto_ioctl="no" ]) fi # if test "$tst_proto_ioctl" = "yes"; then AC_MSG_CHECKING([if ioctl is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $cares_includes_stropts ]],[[ if(0 != ioctl(0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_ioctl="yes" ],[ AC_MSG_RESULT([no]) tst_compi_ioctl="no" ]) fi # if test "$tst_compi_ioctl" = "yes"; then AC_MSG_CHECKING([if ioctl usage allowed]) if test "x$cares_disallow_ioctl" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_ioctl="yes" else AC_MSG_RESULT([no]) tst_allow_ioctl="no" fi fi # AC_MSG_CHECKING([if ioctl might be used]) if test "$tst_links_ioctl" = "yes" && test "$tst_proto_ioctl" = "yes" && test "$tst_compi_ioctl" = "yes" && test "$tst_allow_ioctl" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_IOCTL, 1, [Define to 1 if you have the ioctl function.]) ac_cv_func_ioctl="yes" CARES_CHECK_FUNC_IOCTL_FIONBIO CARES_CHECK_FUNC_IOCTL_SIOCGIFADDR else AC_MSG_RESULT([no]) ac_cv_func_ioctl="no" fi ]) dnl CARES_CHECK_FUNC_IOCTL_FIONBIO dnl ------------------------------------------------- dnl Verify if ioctl with the FIONBIO command is dnl available, can be compiled, and seems to work. If dnl all of these are true, then HAVE_IOCTL_FIONBIO dnl will be defined. AC_DEFUN([CARES_CHECK_FUNC_IOCTL_FIONBIO], [ # tst_compi_ioctl_fionbio="unknown" tst_allow_ioctl_fionbio="unknown" # if test "$ac_cv_func_ioctl" = "yes"; then AC_MSG_CHECKING([if ioctl FIONBIO is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $cares_includes_stropts ]],[[ int flags = 0; if(0 != ioctl(0, FIONBIO, &flags)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_ioctl_fionbio="yes" ],[ AC_MSG_RESULT([no]) tst_compi_ioctl_fionbio="no" ]) fi # if test "$tst_compi_ioctl_fionbio" = "yes"; then AC_MSG_CHECKING([if ioctl FIONBIO usage allowed]) if test "x$cares_disallow_ioctl_fionbio" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_ioctl_fionbio="yes" else AC_MSG_RESULT([no]) tst_allow_ioctl_fionbio="no" fi fi # AC_MSG_CHECKING([if ioctl FIONBIO might be used]) if test "$tst_compi_ioctl_fionbio" = "yes" && test "$tst_allow_ioctl_fionbio" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_IOCTL_FIONBIO, 1, [Define to 1 if you have a working ioctl FIONBIO function.]) ac_cv_func_ioctl_fionbio="yes" else AC_MSG_RESULT([no]) ac_cv_func_ioctl_fionbio="no" fi ]) dnl CARES_CHECK_FUNC_IOCTL_SIOCGIFADDR dnl ------------------------------------------------- dnl Verify if ioctl with the SIOCGIFADDR command is available, dnl struct ifreq is defined, they can be compiled, and seem to dnl work. If all of these are true, then HAVE_IOCTL_SIOCGIFADDR dnl will be defined. AC_DEFUN([CARES_CHECK_FUNC_IOCTL_SIOCGIFADDR], [ # tst_compi_ioctl_siocgifaddr="unknown" tst_allow_ioctl_siocgifaddr="unknown" # if test "$ac_cv_func_ioctl" = "yes"; then AC_MSG_CHECKING([if ioctl SIOCGIFADDR is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $cares_includes_stropts #include ]],[[ struct ifreq ifr; if(0 != ioctl(0, SIOCGIFADDR, &ifr)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_ioctl_siocgifaddr="yes" ],[ AC_MSG_RESULT([no]) tst_compi_ioctl_siocgifaddr="no" ]) fi # if test "$tst_compi_ioctl_siocgifaddr" = "yes"; then AC_MSG_CHECKING([if ioctl SIOCGIFADDR usage allowed]) if test "x$cares_disallow_ioctl_siocgifaddr" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_ioctl_siocgifaddr="yes" else AC_MSG_RESULT([no]) tst_allow_ioctl_siocgifaddr="no" fi fi # AC_MSG_CHECKING([if ioctl SIOCGIFADDR might be used]) if test "$tst_compi_ioctl_siocgifaddr" = "yes" && test "$tst_allow_ioctl_siocgifaddr" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_IOCTL_SIOCGIFADDR, 1, [Define to 1 if you have a working ioctl SIOCGIFADDR function.]) ac_cv_func_ioctl_siocgifaddr="yes" else AC_MSG_RESULT([no]) ac_cv_func_ioctl_siocgifaddr="no" fi ]) dnl CARES_CHECK_FUNC_IOCTLSOCKET dnl ------------------------------------------------- dnl Verify if ioctlsocket is available, prototyped, and dnl can be compiled. If all of these are true, and dnl usage has not been previously disallowed with dnl shell variable cares_disallow_ioctlsocket, then dnl HAVE_IOCTLSOCKET will be defined. AC_DEFUN([CARES_CHECK_FUNC_IOCTLSOCKET], [ AC_REQUIRE([CARES_INCLUDES_WINSOCK2])dnl # tst_links_ioctlsocket="unknown" tst_proto_ioctlsocket="unknown" tst_compi_ioctlsocket="unknown" tst_allow_ioctlsocket="unknown" # AC_MSG_CHECKING([if ioctlsocket can be linked]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ $cares_includes_winsock2 ]],[[ if(0 != ioctlsocket(0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_links_ioctlsocket="yes" ],[ AC_MSG_RESULT([no]) tst_links_ioctlsocket="no" ]) # if test "$tst_links_ioctlsocket" = "yes"; then AC_MSG_CHECKING([if ioctlsocket is prototyped]) AC_EGREP_CPP([ioctlsocket],[ $cares_includes_winsock2 ],[ AC_MSG_RESULT([yes]) tst_proto_ioctlsocket="yes" ],[ AC_MSG_RESULT([no]) tst_proto_ioctlsocket="no" ]) fi # if test "$tst_proto_ioctlsocket" = "yes"; then AC_MSG_CHECKING([if ioctlsocket is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $cares_includes_winsock2 ]],[[ if(0 != ioctlsocket(0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_ioctlsocket="yes" ],[ AC_MSG_RESULT([no]) tst_compi_ioctlsocket="no" ]) fi # if test "$tst_compi_ioctlsocket" = "yes"; then AC_MSG_CHECKING([if ioctlsocket usage allowed]) if test "x$cares_disallow_ioctlsocket" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_ioctlsocket="yes" else AC_MSG_RESULT([no]) tst_allow_ioctlsocket="no" fi fi # AC_MSG_CHECKING([if ioctlsocket might be used]) if test "$tst_links_ioctlsocket" = "yes" && test "$tst_proto_ioctlsocket" = "yes" && test "$tst_compi_ioctlsocket" = "yes" && test "$tst_allow_ioctlsocket" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_IOCTLSOCKET, 1, [Define to 1 if you have the ioctlsocket function.]) ac_cv_func_ioctlsocket="yes" CARES_CHECK_FUNC_IOCTLSOCKET_FIONBIO else AC_MSG_RESULT([no]) ac_cv_func_ioctlsocket="no" fi ]) dnl CARES_CHECK_FUNC_IOCTLSOCKET_FIONBIO dnl ------------------------------------------------- dnl Verify if ioctlsocket with the FIONBIO command is dnl available, can be compiled, and seems to work. If dnl all of these are true, then HAVE_IOCTLSOCKET_FIONBIO dnl will be defined. AC_DEFUN([CARES_CHECK_FUNC_IOCTLSOCKET_FIONBIO], [ # tst_compi_ioctlsocket_fionbio="unknown" tst_allow_ioctlsocket_fionbio="unknown" # if test "$ac_cv_func_ioctlsocket" = "yes"; then AC_MSG_CHECKING([if ioctlsocket FIONBIO is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $cares_includes_winsock2 ]],[[ int flags = 0; if(0 != ioctlsocket(0, FIONBIO, &flags)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_ioctlsocket_fionbio="yes" ],[ AC_MSG_RESULT([no]) tst_compi_ioctlsocket_fionbio="no" ]) fi # if test "$tst_compi_ioctlsocket_fionbio" = "yes"; then AC_MSG_CHECKING([if ioctlsocket FIONBIO usage allowed]) if test "x$cares_disallow_ioctlsocket_fionbio" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_ioctlsocket_fionbio="yes" else AC_MSG_RESULT([no]) tst_allow_ioctlsocket_fionbio="no" fi fi # AC_MSG_CHECKING([if ioctlsocket FIONBIO might be used]) if test "$tst_compi_ioctlsocket_fionbio" = "yes" && test "$tst_allow_ioctlsocket_fionbio" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_IOCTLSOCKET_FIONBIO, 1, [Define to 1 if you have a working ioctlsocket FIONBIO function.]) ac_cv_func_ioctlsocket_fionbio="yes" else AC_MSG_RESULT([no]) ac_cv_func_ioctlsocket_fionbio="no" fi ]) dnl CARES_CHECK_FUNC_IOCTLSOCKET_CAMEL dnl ------------------------------------------------- dnl Verify if IoctlSocket is available, prototyped, and dnl can be compiled. If all of these are true, and dnl usage has not been previously disallowed with dnl shell variable cares_disallow_ioctlsocket_camel, dnl then HAVE_IOCTLSOCKET_CAMEL will be defined. AC_DEFUN([CARES_CHECK_FUNC_IOCTLSOCKET_CAMEL], [ AC_REQUIRE([CARES_INCLUDES_STROPTS])dnl # tst_links_ioctlsocket_camel="unknown" tst_proto_ioctlsocket_camel="unknown" tst_compi_ioctlsocket_camel="unknown" tst_allow_ioctlsocket_camel="unknown" # AC_MSG_CHECKING([if IoctlSocket can be linked]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([IoctlSocket]) ],[ AC_MSG_RESULT([yes]) tst_links_ioctlsocket_camel="yes" ],[ AC_MSG_RESULT([no]) tst_links_ioctlsocket_camel="no" ]) # if test "$tst_links_ioctlsocket_camel" = "yes"; then AC_MSG_CHECKING([if IoctlSocket is prototyped]) AC_EGREP_CPP([IoctlSocket],[ $cares_includes_stropts ],[ AC_MSG_RESULT([yes]) tst_proto_ioctlsocket_camel="yes" ],[ AC_MSG_RESULT([no]) tst_proto_ioctlsocket_camel="no" ]) fi # if test "$tst_proto_ioctlsocket_camel" = "yes"; then AC_MSG_CHECKING([if IoctlSocket is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $cares_includes_stropts ]],[[ if(0 != IoctlSocket(0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_ioctlsocket_camel="yes" ],[ AC_MSG_RESULT([no]) tst_compi_ioctlsocket_camel="no" ]) fi # if test "$tst_compi_ioctlsocket_camel" = "yes"; then AC_MSG_CHECKING([if IoctlSocket usage allowed]) if test "x$cares_disallow_ioctlsocket_camel" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_ioctlsocket_camel="yes" else AC_MSG_RESULT([no]) tst_allow_ioctlsocket_camel="no" fi fi # AC_MSG_CHECKING([if IoctlSocket might be used]) if test "$tst_links_ioctlsocket_camel" = "yes" && test "$tst_proto_ioctlsocket_camel" = "yes" && test "$tst_compi_ioctlsocket_camel" = "yes" && test "$tst_allow_ioctlsocket_camel" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_IOCTLSOCKET_CAMEL, 1, [Define to 1 if you have the IoctlSocket camel case function.]) ac_cv_func_ioctlsocket_camel="yes" CARES_CHECK_FUNC_IOCTLSOCKET_CAMEL_FIONBIO else AC_MSG_RESULT([no]) ac_cv_func_ioctlsocket_camel="no" fi ]) dnl CARES_CHECK_FUNC_IOCTLSOCKET_CAMEL_FIONBIO dnl ------------------------------------------------- dnl Verify if IoctlSocket with FIONBIO command is available, dnl can be compiled, and seems to work. If all of these are dnl true, then HAVE_IOCTLSOCKET_CAMEL_FIONBIO will be defined. AC_DEFUN([CARES_CHECK_FUNC_IOCTLSOCKET_CAMEL_FIONBIO], [ # tst_compi_ioctlsocket_camel_fionbio="unknown" tst_allow_ioctlsocket_camel_fionbio="unknown" # if test "$ac_cv_func_ioctlsocket_camel" = "yes"; then AC_MSG_CHECKING([if IoctlSocket FIONBIO is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $cares_includes_stropts ]],[[ long flags = 0; if(0 != ioctlsocket(0, FIONBIO, &flags)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_ioctlsocket_camel_fionbio="yes" ],[ AC_MSG_RESULT([no]) tst_compi_ioctlsocket_camel_fionbio="no" ]) fi # if test "$tst_compi_ioctlsocket_camel_fionbio" = "yes"; then AC_MSG_CHECKING([if IoctlSocket FIONBIO usage allowed]) if test "x$cares_disallow_ioctlsocket_camel_fionbio" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_ioctlsocket_camel_fionbio="yes" else AC_MSG_RESULT([no]) tst_allow_ioctlsocket_camel_fionbio="no" fi fi # AC_MSG_CHECKING([if IoctlSocket FIONBIO might be used]) if test "$tst_compi_ioctlsocket_camel_fionbio" = "yes" && test "$tst_allow_ioctlsocket_camel_fionbio" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_IOCTLSOCKET_CAMEL_FIONBIO, 1, [Define to 1 if you have a working IoctlSocket camel case FIONBIO function.]) ac_cv_func_ioctlsocket_camel_fionbio="yes" else AC_MSG_RESULT([no]) ac_cv_func_ioctlsocket_camel_fionbio="no" fi ]) dnl CARES_CHECK_FUNC_SETSOCKOPT dnl ------------------------------------------------- dnl Verify if setsockopt is available, prototyped, and dnl can be compiled. If all of these are true, and dnl usage has not been previously disallowed with dnl shell variable cares_disallow_setsockopt, then dnl HAVE_SETSOCKOPT will be defined. AC_DEFUN([CARES_CHECK_FUNC_SETSOCKOPT], [ AC_REQUIRE([CARES_INCLUDES_WINSOCK2])dnl AC_REQUIRE([CARES_INCLUDES_SYS_SOCKET])dnl # tst_links_setsockopt="unknown" tst_proto_setsockopt="unknown" tst_compi_setsockopt="unknown" tst_allow_setsockopt="unknown" # AC_MSG_CHECKING([if setsockopt can be linked]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ $cares_includes_winsock2 $cares_includes_sys_socket ]],[[ if(0 != setsockopt(0, 0, 0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_links_setsockopt="yes" ],[ AC_MSG_RESULT([no]) tst_links_setsockopt="no" ]) # if test "$tst_links_setsockopt" = "yes"; then AC_MSG_CHECKING([if setsockopt is prototyped]) AC_EGREP_CPP([setsockopt],[ $cares_includes_winsock2 $cares_includes_sys_socket ],[ AC_MSG_RESULT([yes]) tst_proto_setsockopt="yes" ],[ AC_MSG_RESULT([no]) tst_proto_setsockopt="no" ]) fi # if test "$tst_proto_setsockopt" = "yes"; then AC_MSG_CHECKING([if setsockopt is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $cares_includes_winsock2 $cares_includes_sys_socket ]],[[ if(0 != setsockopt(0, 0, 0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_setsockopt="yes" ],[ AC_MSG_RESULT([no]) tst_compi_setsockopt="no" ]) fi # if test "$tst_compi_setsockopt" = "yes"; then AC_MSG_CHECKING([if setsockopt usage allowed]) if test "x$cares_disallow_setsockopt" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_setsockopt="yes" else AC_MSG_RESULT([no]) tst_allow_setsockopt="no" fi fi # AC_MSG_CHECKING([if setsockopt might be used]) if test "$tst_links_setsockopt" = "yes" && test "$tst_proto_setsockopt" = "yes" && test "$tst_compi_setsockopt" = "yes" && test "$tst_allow_setsockopt" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_SETSOCKOPT, 1, [Define to 1 if you have the setsockopt function.]) ac_cv_func_setsockopt="yes" CARES_CHECK_FUNC_SETSOCKOPT_SO_NONBLOCK else AC_MSG_RESULT([no]) ac_cv_func_setsockopt="no" fi ]) dnl CARES_CHECK_FUNC_SETSOCKOPT_SO_NONBLOCK dnl ------------------------------------------------- dnl Verify if setsockopt with the SO_NONBLOCK command is dnl available, can be compiled, and seems to work. If dnl all of these are true, then HAVE_SETSOCKOPT_SO_NONBLOCK dnl will be defined. AC_DEFUN([CARES_CHECK_FUNC_SETSOCKOPT_SO_NONBLOCK], [ # tst_compi_setsockopt_so_nonblock="unknown" tst_allow_setsockopt_so_nonblock="unknown" # if test "$ac_cv_func_setsockopt" = "yes"; then AC_MSG_CHECKING([if setsockopt SO_NONBLOCK is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $cares_includes_winsock2 $cares_includes_sys_socket ]],[[ if(0 != setsockopt(0, SOL_SOCKET, SO_NONBLOCK, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_setsockopt_so_nonblock="yes" ],[ AC_MSG_RESULT([no]) tst_compi_setsockopt_so_nonblock="no" ]) fi # if test "$tst_compi_setsockopt_so_nonblock" = "yes"; then AC_MSG_CHECKING([if setsockopt SO_NONBLOCK usage allowed]) if test "x$cares_disallow_setsockopt_so_nonblock" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_setsockopt_so_nonblock="yes" else AC_MSG_RESULT([no]) tst_allow_setsockopt_so_nonblock="no" fi fi # AC_MSG_CHECKING([if setsockopt SO_NONBLOCK might be used]) if test "$tst_compi_setsockopt_so_nonblock" = "yes" && test "$tst_allow_setsockopt_so_nonblock" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_SETSOCKOPT_SO_NONBLOCK, 1, [Define to 1 if you have a working setsockopt SO_NONBLOCK function.]) ac_cv_func_setsockopt_so_nonblock="yes" else AC_MSG_RESULT([no]) ac_cv_func_setsockopt_so_nonblock="no" fi ]) dnl CARES_CHECK_FUNC_SOCKET dnl ------------------------------------------------- dnl Verify if socket is available, prototyped, and dnl can be compiled. If all of these are true, and dnl usage has not been previously disallowed with dnl shell variable cares_disallow_socket, then dnl HAVE_SOCKET will be defined. AC_DEFUN([CARES_CHECK_FUNC_SOCKET], [ AC_REQUIRE([CARES_INCLUDES_WINSOCK2])dnl AC_REQUIRE([CARES_INCLUDES_SYS_SOCKET])dnl AC_REQUIRE([CARES_INCLUDES_SOCKET])dnl # tst_links_socket="unknown" tst_proto_socket="unknown" tst_compi_socket="unknown" tst_allow_socket="unknown" # AC_MSG_CHECKING([if socket can be linked]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ $cares_includes_winsock2 $cares_includes_sys_socket $cares_includes_socket ]],[[ if(0 != socket(0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_links_socket="yes" ],[ AC_MSG_RESULT([no]) tst_links_socket="no" ]) # if test "$tst_links_socket" = "yes"; then AC_MSG_CHECKING([if socket is prototyped]) AC_EGREP_CPP([socket],[ $cares_includes_winsock2 $cares_includes_sys_socket $cares_includes_socket ],[ AC_MSG_RESULT([yes]) tst_proto_socket="yes" ],[ AC_MSG_RESULT([no]) tst_proto_socket="no" ]) fi # if test "$tst_proto_socket" = "yes"; then AC_MSG_CHECKING([if socket is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $cares_includes_winsock2 $cares_includes_sys_socket $cares_includes_socket ]],[[ if(0 != socket(0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_socket="yes" ],[ AC_MSG_RESULT([no]) tst_compi_socket="no" ]) fi # if test "$tst_compi_socket" = "yes"; then AC_MSG_CHECKING([if socket usage allowed]) if test "x$cares_disallow_socket" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_socket="yes" else AC_MSG_RESULT([no]) tst_allow_socket="no" fi fi # AC_MSG_CHECKING([if socket might be used]) if test "$tst_links_socket" = "yes" && test "$tst_proto_socket" = "yes" && test "$tst_compi_socket" = "yes" && test "$tst_allow_socket" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_SOCKET, 1, [Define to 1 if you have the socket function.]) ac_cv_func_socket="yes" else AC_MSG_RESULT([no]) ac_cv_func_socket="no" fi ]) dnl CARES_CHECK_FUNC_STRCASECMP dnl ------------------------------------------------- dnl Verify if strcasecmp is available, prototyped, and dnl can be compiled. If all of these are true, and dnl usage has not been previously disallowed with dnl shell variable cares_disallow_strcasecmp, then dnl HAVE_STRCASECMP will be defined. AC_DEFUN([CARES_CHECK_FUNC_STRCASECMP], [ AC_REQUIRE([CARES_INCLUDES_STRING])dnl # tst_links_strcasecmp="unknown" tst_proto_strcasecmp="unknown" tst_compi_strcasecmp="unknown" tst_allow_strcasecmp="unknown" # AC_MSG_CHECKING([if strcasecmp can be linked]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([strcasecmp]) ],[ AC_MSG_RESULT([yes]) tst_links_strcasecmp="yes" ],[ AC_MSG_RESULT([no]) tst_links_strcasecmp="no" ]) # if test "$tst_links_strcasecmp" = "yes"; then AC_MSG_CHECKING([if strcasecmp is prototyped]) AC_EGREP_CPP([strcasecmp],[ $cares_includes_string ],[ AC_MSG_RESULT([yes]) tst_proto_strcasecmp="yes" ],[ AC_MSG_RESULT([no]) tst_proto_strcasecmp="no" ]) fi # if test "$tst_proto_strcasecmp" = "yes"; then AC_MSG_CHECKING([if strcasecmp is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $cares_includes_string ]],[[ if(0 != strcasecmp(0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_strcasecmp="yes" ],[ AC_MSG_RESULT([no]) tst_compi_strcasecmp="no" ]) fi # if test "$tst_compi_strcasecmp" = "yes"; then AC_MSG_CHECKING([if strcasecmp usage allowed]) if test "x$cares_disallow_strcasecmp" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_strcasecmp="yes" else AC_MSG_RESULT([no]) tst_allow_strcasecmp="no" fi fi # AC_MSG_CHECKING([if strcasecmp might be used]) if test "$tst_links_strcasecmp" = "yes" && test "$tst_proto_strcasecmp" = "yes" && test "$tst_compi_strcasecmp" = "yes" && test "$tst_allow_strcasecmp" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_STRCASECMP, 1, [Define to 1 if you have the strcasecmp function.]) ac_cv_func_strcasecmp="yes" else AC_MSG_RESULT([no]) ac_cv_func_strcasecmp="no" fi ]) dnl CARES_CHECK_FUNC_STRCMPI dnl ------------------------------------------------- dnl Verify if strcmpi is available, prototyped, and dnl can be compiled. If all of these are true, and dnl usage has not been previously disallowed with dnl shell variable cares_disallow_strcmpi, then dnl HAVE_STRCMPI will be defined. AC_DEFUN([CARES_CHECK_FUNC_STRCMPI], [ AC_REQUIRE([CARES_INCLUDES_STRING])dnl # tst_links_strcmpi="unknown" tst_proto_strcmpi="unknown" tst_compi_strcmpi="unknown" tst_allow_strcmpi="unknown" # AC_MSG_CHECKING([if strcmpi can be linked]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([strcmpi]) ],[ AC_MSG_RESULT([yes]) tst_links_strcmpi="yes" ],[ AC_MSG_RESULT([no]) tst_links_strcmpi="no" ]) # if test "$tst_links_strcmpi" = "yes"; then AC_MSG_CHECKING([if strcmpi is prototyped]) AC_EGREP_CPP([strcmpi],[ $cares_includes_string ],[ AC_MSG_RESULT([yes]) tst_proto_strcmpi="yes" ],[ AC_MSG_RESULT([no]) tst_proto_strcmpi="no" ]) fi # if test "$tst_proto_strcmpi" = "yes"; then AC_MSG_CHECKING([if strcmpi is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $cares_includes_string ]],[[ if(0 != strcmpi(0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_strcmpi="yes" ],[ AC_MSG_RESULT([no]) tst_compi_strcmpi="no" ]) fi # if test "$tst_compi_strcmpi" = "yes"; then AC_MSG_CHECKING([if strcmpi usage allowed]) if test "x$cares_disallow_strcmpi" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_strcmpi="yes" else AC_MSG_RESULT([no]) tst_allow_strcmpi="no" fi fi # AC_MSG_CHECKING([if strcmpi might be used]) if test "$tst_links_strcmpi" = "yes" && test "$tst_proto_strcmpi" = "yes" && test "$tst_compi_strcmpi" = "yes" && test "$tst_allow_strcmpi" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_STRCMPI, 1, [Define to 1 if you have the strcmpi function.]) ac_cv_func_strcmpi="yes" else AC_MSG_RESULT([no]) ac_cv_func_strcmpi="no" fi ]) dnl CARES_CHECK_FUNC_STRDUP dnl ------------------------------------------------- dnl Verify if strdup is available, prototyped, and dnl can be compiled. If all of these are true, and dnl usage has not been previously disallowed with dnl shell variable cares_disallow_strdup, then dnl HAVE_STRDUP will be defined. AC_DEFUN([CARES_CHECK_FUNC_STRDUP], [ AC_REQUIRE([CARES_INCLUDES_STRING])dnl # tst_links_strdup="unknown" tst_proto_strdup="unknown" tst_compi_strdup="unknown" tst_allow_strdup="unknown" # AC_MSG_CHECKING([if strdup can be linked]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([strdup]) ],[ AC_MSG_RESULT([yes]) tst_links_strdup="yes" ],[ AC_MSG_RESULT([no]) tst_links_strdup="no" ]) # if test "$tst_links_strdup" = "yes"; then AC_MSG_CHECKING([if strdup is prototyped]) AC_EGREP_CPP([strdup],[ $cares_includes_string ],[ AC_MSG_RESULT([yes]) tst_proto_strdup="yes" ],[ AC_MSG_RESULT([no]) tst_proto_strdup="no" ]) fi # if test "$tst_proto_strdup" = "yes"; then AC_MSG_CHECKING([if strdup is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $cares_includes_string ]],[[ if(0 != strdup(0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_strdup="yes" ],[ AC_MSG_RESULT([no]) tst_compi_strdup="no" ]) fi # if test "$tst_compi_strdup" = "yes"; then AC_MSG_CHECKING([if strdup usage allowed]) if test "x$cares_disallow_strdup" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_strdup="yes" else AC_MSG_RESULT([no]) tst_allow_strdup="no" fi fi # AC_MSG_CHECKING([if strdup might be used]) if test "$tst_links_strdup" = "yes" && test "$tst_proto_strdup" = "yes" && test "$tst_compi_strdup" = "yes" && test "$tst_allow_strdup" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_STRDUP, 1, [Define to 1 if you have the strdup function.]) ac_cv_func_strdup="yes" else AC_MSG_RESULT([no]) ac_cv_func_strdup="no" fi ]) dnl CARES_CHECK_FUNC_STRICMP dnl ------------------------------------------------- dnl Verify if stricmp is available, prototyped, and dnl can be compiled. If all of these are true, and dnl usage has not been previously disallowed with dnl shell variable cares_disallow_stricmp, then dnl HAVE_STRICMP will be defined. AC_DEFUN([CARES_CHECK_FUNC_STRICMP], [ AC_REQUIRE([CARES_INCLUDES_STRING])dnl # tst_links_stricmp="unknown" tst_proto_stricmp="unknown" tst_compi_stricmp="unknown" tst_allow_stricmp="unknown" # AC_MSG_CHECKING([if stricmp can be linked]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([stricmp]) ],[ AC_MSG_RESULT([yes]) tst_links_stricmp="yes" ],[ AC_MSG_RESULT([no]) tst_links_stricmp="no" ]) # if test "$tst_links_stricmp" = "yes"; then AC_MSG_CHECKING([if stricmp is prototyped]) AC_EGREP_CPP([stricmp],[ $cares_includes_string ],[ AC_MSG_RESULT([yes]) tst_proto_stricmp="yes" ],[ AC_MSG_RESULT([no]) tst_proto_stricmp="no" ]) fi # if test "$tst_proto_stricmp" = "yes"; then AC_MSG_CHECKING([if stricmp is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $cares_includes_string ]],[[ if(0 != stricmp(0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_stricmp="yes" ],[ AC_MSG_RESULT([no]) tst_compi_stricmp="no" ]) fi # if test "$tst_compi_stricmp" = "yes"; then AC_MSG_CHECKING([if stricmp usage allowed]) if test "x$cares_disallow_stricmp" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_stricmp="yes" else AC_MSG_RESULT([no]) tst_allow_stricmp="no" fi fi # AC_MSG_CHECKING([if stricmp might be used]) if test "$tst_links_stricmp" = "yes" && test "$tst_proto_stricmp" = "yes" && test "$tst_compi_stricmp" = "yes" && test "$tst_allow_stricmp" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_STRICMP, 1, [Define to 1 if you have the stricmp function.]) ac_cv_func_stricmp="yes" else AC_MSG_RESULT([no]) ac_cv_func_stricmp="no" fi ]) dnl CARES_CHECK_FUNC_STRNCASECMP dnl ------------------------------------------------- dnl Verify if strncasecmp is available, prototyped, and dnl can be compiled. If all of these are true, and dnl usage has not been previously disallowed with dnl shell variable cares_disallow_strncasecmp, then dnl HAVE_STRNCASECMP will be defined. AC_DEFUN([CARES_CHECK_FUNC_STRNCASECMP], [ AC_REQUIRE([CARES_INCLUDES_STRING])dnl # tst_links_strncasecmp="unknown" tst_proto_strncasecmp="unknown" tst_compi_strncasecmp="unknown" tst_allow_strncasecmp="unknown" # AC_MSG_CHECKING([if strncasecmp can be linked]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([strncasecmp]) ],[ AC_MSG_RESULT([yes]) tst_links_strncasecmp="yes" ],[ AC_MSG_RESULT([no]) tst_links_strncasecmp="no" ]) # if test "$tst_links_strncasecmp" = "yes"; then AC_MSG_CHECKING([if strncasecmp is prototyped]) AC_EGREP_CPP([strncasecmp],[ $cares_includes_string ],[ AC_MSG_RESULT([yes]) tst_proto_strncasecmp="yes" ],[ AC_MSG_RESULT([no]) tst_proto_strncasecmp="no" ]) fi # if test "$tst_proto_strncasecmp" = "yes"; then AC_MSG_CHECKING([if strncasecmp is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $cares_includes_string ]],[[ if(0 != strncasecmp(0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_strncasecmp="yes" ],[ AC_MSG_RESULT([no]) tst_compi_strncasecmp="no" ]) fi # if test "$tst_compi_strncasecmp" = "yes"; then AC_MSG_CHECKING([if strncasecmp usage allowed]) if test "x$cares_disallow_strncasecmp" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_strncasecmp="yes" else AC_MSG_RESULT([no]) tst_allow_strncasecmp="no" fi fi # AC_MSG_CHECKING([if strncasecmp might be used]) if test "$tst_links_strncasecmp" = "yes" && test "$tst_proto_strncasecmp" = "yes" && test "$tst_compi_strncasecmp" = "yes" && test "$tst_allow_strncasecmp" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_STRNCASECMP, 1, [Define to 1 if you have the strncasecmp function.]) ac_cv_func_strncasecmp="yes" else AC_MSG_RESULT([no]) ac_cv_func_strncasecmp="no" fi ]) dnl CARES_CHECK_FUNC_STRNCMPI dnl ------------------------------------------------- dnl Verify if strncmpi is available, prototyped, and dnl can be compiled. If all of these are true, and dnl usage has not been previously disallowed with dnl shell variable cares_disallow_strncmpi, then dnl HAVE_STRNCMPI will be defined. AC_DEFUN([CARES_CHECK_FUNC_STRNCMPI], [ AC_REQUIRE([CARES_INCLUDES_STRING])dnl # tst_links_strncmpi="unknown" tst_proto_strncmpi="unknown" tst_compi_strncmpi="unknown" tst_allow_strncmpi="unknown" # AC_MSG_CHECKING([if strncmpi can be linked]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([strncmpi]) ],[ AC_MSG_RESULT([yes]) tst_links_strncmpi="yes" ],[ AC_MSG_RESULT([no]) tst_links_strncmpi="no" ]) # if test "$tst_links_strncmpi" = "yes"; then AC_MSG_CHECKING([if strncmpi is prototyped]) AC_EGREP_CPP([strncmpi],[ $cares_includes_string ],[ AC_MSG_RESULT([yes]) tst_proto_strncmpi="yes" ],[ AC_MSG_RESULT([no]) tst_proto_strncmpi="no" ]) fi # if test "$tst_proto_strncmpi" = "yes"; then AC_MSG_CHECKING([if strncmpi is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $cares_includes_string ]],[[ if(0 != strncmpi(0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_strncmpi="yes" ],[ AC_MSG_RESULT([no]) tst_compi_strncmpi="no" ]) fi # if test "$tst_compi_strncmpi" = "yes"; then AC_MSG_CHECKING([if strncmpi usage allowed]) if test "x$cares_disallow_strncmpi" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_strncmpi="yes" else AC_MSG_RESULT([no]) tst_allow_strncmpi="no" fi fi # AC_MSG_CHECKING([if strncmpi might be used]) if test "$tst_links_strncmpi" = "yes" && test "$tst_proto_strncmpi" = "yes" && test "$tst_compi_strncmpi" = "yes" && test "$tst_allow_strncmpi" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_STRNCMPI, 1, [Define to 1 if you have the strncmpi function.]) ac_cv_func_strncmpi="yes" else AC_MSG_RESULT([no]) ac_cv_func_strncmpi="no" fi ]) dnl CARES_CHECK_FUNC_STRNICMP dnl ------------------------------------------------- dnl Verify if strnicmp is available, prototyped, and dnl can be compiled. If all of these are true, and dnl usage has not been previously disallowed with dnl shell variable cares_disallow_strnicmp, then dnl HAVE_STRNICMP will be defined. AC_DEFUN([CARES_CHECK_FUNC_STRNICMP], [ AC_REQUIRE([CARES_INCLUDES_STRING])dnl # tst_links_strnicmp="unknown" tst_proto_strnicmp="unknown" tst_compi_strnicmp="unknown" tst_allow_strnicmp="unknown" # AC_MSG_CHECKING([if strnicmp can be linked]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([strnicmp]) ],[ AC_MSG_RESULT([yes]) tst_links_strnicmp="yes" ],[ AC_MSG_RESULT([no]) tst_links_strnicmp="no" ]) # if test "$tst_links_strnicmp" = "yes"; then AC_MSG_CHECKING([if strnicmp is prototyped]) AC_EGREP_CPP([strnicmp],[ $cares_includes_string ],[ AC_MSG_RESULT([yes]) tst_proto_strnicmp="yes" ],[ AC_MSG_RESULT([no]) tst_proto_strnicmp="no" ]) fi # if test "$tst_proto_strnicmp" = "yes"; then AC_MSG_CHECKING([if strnicmp is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $cares_includes_string ]],[[ if(0 != strnicmp(0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_strnicmp="yes" ],[ AC_MSG_RESULT([no]) tst_compi_strnicmp="no" ]) fi # if test "$tst_compi_strnicmp" = "yes"; then AC_MSG_CHECKING([if strnicmp usage allowed]) if test "x$cares_disallow_strnicmp" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_strnicmp="yes" else AC_MSG_RESULT([no]) tst_allow_strnicmp="no" fi fi # AC_MSG_CHECKING([if strnicmp might be used]) if test "$tst_links_strnicmp" = "yes" && test "$tst_proto_strnicmp" = "yes" && test "$tst_compi_strnicmp" = "yes" && test "$tst_allow_strnicmp" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_STRNICMP, 1, [Define to 1 if you have the strnicmp function.]) ac_cv_func_strnicmp="yes" else AC_MSG_RESULT([no]) ac_cv_func_strnicmp="no" fi ]) dnl CARES_CHECK_FUNC_WRITEV dnl ------------------------------------------------- dnl Verify if writev is available, prototyped, and dnl can be compiled. If all of these are true, and dnl usage has not been previously disallowed with dnl shell variable cares_disallow_writev, then dnl HAVE_WRITEV will be defined. AC_DEFUN([CARES_CHECK_FUNC_WRITEV], [ AC_REQUIRE([CARES_INCLUDES_SYS_UIO])dnl # tst_links_writev="unknown" tst_proto_writev="unknown" tst_compi_writev="unknown" tst_allow_writev="unknown" # AC_MSG_CHECKING([if writev can be linked]) AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([writev]) ],[ AC_MSG_RESULT([yes]) tst_links_writev="yes" ],[ AC_MSG_RESULT([no]) tst_links_writev="no" ]) # if test "$tst_links_writev" = "yes"; then AC_MSG_CHECKING([if writev is prototyped]) AC_EGREP_CPP([writev],[ $cares_includes_sys_uio ],[ AC_MSG_RESULT([yes]) tst_proto_writev="yes" ],[ AC_MSG_RESULT([no]) tst_proto_writev="no" ]) fi # if test "$tst_proto_writev" = "yes"; then AC_MSG_CHECKING([if writev is compilable]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $cares_includes_sys_uio ]],[[ if(0 != writev(0, 0, 0)) return 1; ]]) ],[ AC_MSG_RESULT([yes]) tst_compi_writev="yes" ],[ AC_MSG_RESULT([no]) tst_compi_writev="no" ]) fi # if test "$tst_compi_writev" = "yes"; then AC_MSG_CHECKING([if writev usage allowed]) if test "x$cares_disallow_writev" != "xyes"; then AC_MSG_RESULT([yes]) tst_allow_writev="yes" else AC_MSG_RESULT([no]) tst_allow_writev="no" fi fi # AC_MSG_CHECKING([if writev might be used]) if test "$tst_links_writev" = "yes" && test "$tst_proto_writev" = "yes" && test "$tst_compi_writev" = "yes" && test "$tst_allow_writev" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_WRITEV, 1, [Define to 1 if you have the writev function.]) ac_cv_func_writev="yes" else AC_MSG_RESULT([no]) ac_cv_func_writev="no" fi ]) ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/m4/cares-reentrant.m40000644000175100001770000003706500000000000021772 0ustar00runnerdocker00000000000000#*************************************************************************** # $Id$ # # Copyright (C) 2008 - 2009 by Daniel Stenberg et al # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, provided # that the above copyright notice appear in all copies and that both that # copyright notice and this permission notice appear in supporting # documentation, and that the name of M.I.T. not be used in advertising or # publicity pertaining to distribution of the software without specific, # written prior permission. M.I.T. makes no representations about the # suitability of this software for any purpose. It is provided "as is" # without express or implied warranty. # #*************************************************************************** # File version for 'aclocal' use. Keep it a single number. # serial 6 dnl Note 1 dnl ------ dnl None of the CARES_CHECK_NEED_REENTRANT_* macros shall use HAVE_FOO_H to dnl conditionally include header files. These macros are used early in the dnl configure process much before header file availability is known. dnl CARES_CHECK_NEED_REENTRANT_ERRNO dnl ------------------------------------------------- dnl Checks if the preprocessor _REENTRANT definition dnl makes errno available as a preprocessor macro. AC_DEFUN([CARES_CHECK_NEED_REENTRANT_ERRNO], [ AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #include ]],[[ if(0 != errno) return 1; ]]) ],[ tmp_errno="yes" ],[ tmp_errno="no" ]) if test "$tmp_errno" = "yes"; then AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #include ]],[[ #ifdef errno int dummy=1; #else force compilation error #endif ]]) ],[ tmp_errno="errno_macro_defined" ],[ AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #define _REENTRANT #include ]],[[ #ifdef errno int dummy=1; #else force compilation error #endif ]]) ],[ tmp_errno="errno_macro_needs_reentrant" tmp_need_reentrant="yes" ]) ]) fi ]) dnl CARES_CHECK_NEED_REENTRANT_GMTIME_R dnl ------------------------------------------------- dnl Checks if the preprocessor _REENTRANT definition dnl makes function gmtime_r compiler visible. AC_DEFUN([CARES_CHECK_NEED_REENTRANT_GMTIME_R], [ AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([gmtime_r]) ],[ tmp_gmtime_r="yes" ],[ tmp_gmtime_r="no" ]) if test "$tmp_gmtime_r" = "yes"; then AC_EGREP_CPP([gmtime_r],[ #include #include ],[ tmp_gmtime_r="proto_declared" ],[ AC_EGREP_CPP([gmtime_r],[ #define _REENTRANT #include #include ],[ tmp_gmtime_r="proto_needs_reentrant" tmp_need_reentrant="yes" ]) ]) fi ]) dnl CARES_CHECK_NEED_REENTRANT_LOCALTIME_R dnl ------------------------------------------------- dnl Checks if the preprocessor _REENTRANT definition dnl makes function localtime_r compiler visible. AC_DEFUN([CARES_CHECK_NEED_REENTRANT_LOCALTIME_R], [ AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([localtime_r]) ],[ tmp_localtime_r="yes" ],[ tmp_localtime_r="no" ]) if test "$tmp_localtime_r" = "yes"; then AC_EGREP_CPP([localtime_r],[ #include #include ],[ tmp_localtime_r="proto_declared" ],[ AC_EGREP_CPP([localtime_r],[ #define _REENTRANT #include #include ],[ tmp_localtime_r="proto_needs_reentrant" tmp_need_reentrant="yes" ]) ]) fi ]) dnl CARES_CHECK_NEED_REENTRANT_STRERROR_R dnl ------------------------------------------------- dnl Checks if the preprocessor _REENTRANT definition dnl makes function strerror_r compiler visible. AC_DEFUN([CARES_CHECK_NEED_REENTRANT_STRERROR_R], [ AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([strerror_r]) ],[ tmp_strerror_r="yes" ],[ tmp_strerror_r="no" ]) if test "$tmp_strerror_r" = "yes"; then AC_EGREP_CPP([strerror_r],[ #include #include ],[ tmp_strerror_r="proto_declared" ],[ AC_EGREP_CPP([strerror_r],[ #define _REENTRANT #include #include ],[ tmp_strerror_r="proto_needs_reentrant" tmp_need_reentrant="yes" ]) ]) fi ]) dnl CARES_CHECK_NEED_REENTRANT_STRTOK_R dnl ------------------------------------------------- dnl Checks if the preprocessor _REENTRANT definition dnl makes function strtok_r compiler visible. AC_DEFUN([CARES_CHECK_NEED_REENTRANT_STRTOK_R], [ AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([strtok_r]) ],[ tmp_strtok_r="yes" ],[ tmp_strtok_r="no" ]) if test "$tmp_strtok_r" = "yes"; then AC_EGREP_CPP([strtok_r],[ #include #include ],[ tmp_strtok_r="proto_declared" ],[ AC_EGREP_CPP([strtok_r],[ #define _REENTRANT #include #include ],[ tmp_strtok_r="proto_needs_reentrant" tmp_need_reentrant="yes" ]) ]) fi ]) dnl CARES_CHECK_NEED_REENTRANT_INET_NTOA_R dnl ------------------------------------------------- dnl Checks if the preprocessor _REENTRANT definition dnl makes function inet_ntoa_r compiler visible. AC_DEFUN([CARES_CHECK_NEED_REENTRANT_INET_NTOA_R], [ AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([inet_ntoa_r]) ],[ tmp_inet_ntoa_r="yes" ],[ tmp_inet_ntoa_r="no" ]) if test "$tmp_inet_ntoa_r" = "yes"; then AC_EGREP_CPP([inet_ntoa_r],[ #include #include #include #include ],[ tmp_inet_ntoa_r="proto_declared" ],[ AC_EGREP_CPP([inet_ntoa_r],[ #define _REENTRANT #include #include #include #include ],[ tmp_inet_ntoa_r="proto_needs_reentrant" tmp_need_reentrant="yes" ]) ]) fi ]) dnl CARES_CHECK_NEED_REENTRANT_GETHOSTBYADDR_R dnl ------------------------------------------------- dnl Checks if the preprocessor _REENTRANT definition dnl makes function gethostbyaddr_r compiler visible. AC_DEFUN([CARES_CHECK_NEED_REENTRANT_GETHOSTBYADDR_R], [ AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([gethostbyaddr_r]) ],[ tmp_gethostbyaddr_r="yes" ],[ tmp_gethostbyaddr_r="no" ]) if test "$tmp_gethostbyaddr_r" = "yes"; then AC_EGREP_CPP([gethostbyaddr_r],[ #include #include ],[ tmp_gethostbyaddr_r="proto_declared" ],[ AC_EGREP_CPP([gethostbyaddr_r],[ #define _REENTRANT #include #include ],[ tmp_gethostbyaddr_r="proto_needs_reentrant" tmp_need_reentrant="yes" ]) ]) fi ]) dnl CARES_CHECK_NEED_REENTRANT_GETHOSTBYNAME_R dnl ------------------------------------------------- dnl Checks if the preprocessor _REENTRANT definition dnl makes function gethostbyname_r compiler visible. AC_DEFUN([CARES_CHECK_NEED_REENTRANT_GETHOSTBYNAME_R], [ AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([gethostbyname_r]) ],[ tmp_gethostbyname_r="yes" ],[ tmp_gethostbyname_r="no" ]) if test "$tmp_gethostbyname_r" = "yes"; then AC_EGREP_CPP([gethostbyname_r],[ #include #include ],[ tmp_gethostbyname_r="proto_declared" ],[ AC_EGREP_CPP([gethostbyname_r],[ #define _REENTRANT #include #include ],[ tmp_gethostbyname_r="proto_needs_reentrant" tmp_need_reentrant="yes" ]) ]) fi ]) dnl CARES_CHECK_NEED_REENTRANT_GETPROTOBYNAME_R dnl ------------------------------------------------- dnl Checks if the preprocessor _REENTRANT definition dnl makes function getprotobyname_r compiler visible. AC_DEFUN([CARES_CHECK_NEED_REENTRANT_GETPROTOBYNAME_R], [ AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([getprotobyname_r]) ],[ tmp_getprotobyname_r="yes" ],[ tmp_getprotobyname_r="no" ]) if test "$tmp_getprotobyname_r" = "yes"; then AC_EGREP_CPP([getprotobyname_r],[ #include #include ],[ tmp_getprotobyname_r="proto_declared" ],[ AC_EGREP_CPP([getprotobyname_r],[ #define _REENTRANT #include #include ],[ tmp_getprotobyname_r="proto_needs_reentrant" tmp_need_reentrant="yes" ]) ]) fi ]) dnl CARES_CHECK_NEED_REENTRANT_GETSERVBYPORT_R dnl ------------------------------------------------- dnl Checks if the preprocessor _REENTRANT definition dnl makes function getservbyport_r compiler visible. AC_DEFUN([CARES_CHECK_NEED_REENTRANT_GETSERVBYPORT_R], [ AC_LINK_IFELSE([ AC_LANG_FUNC_LINK_TRY([getservbyport_r]) ],[ tmp_getservbyport_r="yes" ],[ tmp_getservbyport_r="no" ]) if test "$tmp_getservbyport_r" = "yes"; then AC_EGREP_CPP([getservbyport_r],[ #include #include ],[ tmp_getservbyport_r="proto_declared" ],[ AC_EGREP_CPP([getservbyport_r],[ #define _REENTRANT #include #include ],[ tmp_getservbyport_r="proto_needs_reentrant" tmp_need_reentrant="yes" ]) ]) fi ]) dnl CARES_CHECK_NEED_REENTRANT_FUNCTIONS_R dnl ------------------------------------------------- dnl Checks if the preprocessor _REENTRANT definition dnl makes several _r functions compiler visible. dnl Internal macro for CARES_CONFIGURE_REENTRANT. AC_DEFUN([CARES_CHECK_NEED_REENTRANT_FUNCTIONS_R], [ if test "$tmp_need_reentrant" = "no"; then CARES_CHECK_NEED_REENTRANT_GMTIME_R fi if test "$tmp_need_reentrant" = "no"; then CARES_CHECK_NEED_REENTRANT_LOCALTIME_R fi if test "$tmp_need_reentrant" = "no"; then CARES_CHECK_NEED_REENTRANT_STRERROR_R fi if test "$tmp_need_reentrant" = "no"; then CARES_CHECK_NEED_REENTRANT_STRTOK_R fi if test "$tmp_need_reentrant" = "no"; then CARES_CHECK_NEED_REENTRANT_INET_NTOA_R fi if test "$tmp_need_reentrant" = "no"; then CARES_CHECK_NEED_REENTRANT_GETHOSTBYADDR_R fi if test "$tmp_need_reentrant" = "no"; then CARES_CHECK_NEED_REENTRANT_GETHOSTBYNAME_R fi if test "$tmp_need_reentrant" = "no"; then CARES_CHECK_NEED_REENTRANT_GETPROTOBYNAME_R fi if test "$tmp_need_reentrant" = "no"; then CARES_CHECK_NEED_REENTRANT_GETSERVBYPORT_R fi ]) dnl CARES_CHECK_NEED_REENTRANT_SYSTEM dnl ------------------------------------------------- dnl Checks if the preprocessor _REENTRANT definition dnl must be unconditionally done for this platform. dnl Internal macro for CARES_CONFIGURE_REENTRANT. AC_DEFUN([CARES_CHECK_NEED_REENTRANT_SYSTEM], [ case $host_os in solaris*) tmp_need_reentrant="yes" ;; *) tmp_need_reentrant="no" ;; esac ]) dnl CARES_CHECK_NEED_THREAD_SAFE_SYSTEM dnl ------------------------------------------------- dnl Checks if the preprocessor _THREAD_SAFE definition dnl must be unconditionally done for this platform. dnl Internal macro for CARES_CONFIGURE_THREAD_SAFE. AC_DEFUN([CARES_CHECK_NEED_THREAD_SAFE_SYSTEM], [ case $host_os in aix[[123]].* | aix4.[[012]].*) dnl aix 4.2 and older tmp_need_thread_safe="no" ;; aix*) dnl AIX 4.3 and newer tmp_need_thread_safe="yes" ;; *) tmp_need_thread_safe="no" ;; esac ]) dnl CARES_CONFIGURE_FROM_NOW_ON_WITH_REENTRANT dnl ------------------------------------------------- dnl This macro ensures that configuration tests done dnl after this will execute with preprocessor symbol dnl _REENTRANT defined. This macro also ensures that dnl the generated config file defines NEED_REENTRANT dnl and that in turn setup.h will define _REENTRANT. dnl Internal macro for CARES_CONFIGURE_REENTRANT. AC_DEFUN([CARES_CONFIGURE_FROM_NOW_ON_WITH_REENTRANT], [ AC_DEFINE(NEED_REENTRANT, 1, [Define to 1 if _REENTRANT preprocessor symbol must be defined.]) cat >>confdefs.h <<_EOF #ifndef _REENTRANT # define _REENTRANT #endif _EOF ]) dnl CARES_CONFIGURE_FROM_NOW_ON_WITH_THREAD_SAFE dnl ------------------------------------------------- dnl This macro ensures that configuration tests done dnl after this will execute with preprocessor symbol dnl _THREAD_SAFE defined. This macro also ensures that dnl the generated config file defines NEED_THREAD_SAFE dnl and that in turn setup.h will define _THREAD_SAFE. dnl Internal macro for CARES_CONFIGURE_THREAD_SAFE. AC_DEFUN([CARES_CONFIGURE_FROM_NOW_ON_WITH_THREAD_SAFE], [ AC_DEFINE(NEED_THREAD_SAFE, 1, [Define to 1 if _THREAD_SAFE preprocessor symbol must be defined.]) cat >>confdefs.h <<_EOF #ifndef _THREAD_SAFE # define _THREAD_SAFE #endif _EOF ]) dnl CARES_CONFIGURE_REENTRANT dnl ------------------------------------------------- dnl This first checks if the preprocessor _REENTRANT dnl symbol is already defined. If it isn't currently dnl defined a set of checks are performed to verify dnl if its definition is required to make visible to dnl the compiler a set of *_r functions. Finally, if dnl _REENTRANT is already defined or needed it takes dnl care of making adjustments necessary to ensure dnl that it is defined equally for further configure dnl tests and generated config file. AC_DEFUN([CARES_CONFIGURE_REENTRANT], [ AC_PREREQ([2.50])dnl # AC_MSG_CHECKING([if _REENTRANT is already defined]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ ]],[[ #ifdef _REENTRANT int dummy=1; #else force compilation error #endif ]]) ],[ AC_MSG_RESULT([yes]) tmp_reentrant_initially_defined="yes" ],[ AC_MSG_RESULT([no]) tmp_reentrant_initially_defined="no" ]) # if test "$tmp_reentrant_initially_defined" = "no"; then AC_MSG_CHECKING([if _REENTRANT is actually needed]) CARES_CHECK_NEED_REENTRANT_SYSTEM if test "$tmp_need_reentrant" = "no"; then CARES_CHECK_NEED_REENTRANT_ERRNO fi if test "$tmp_need_reentrant" = "no"; then CARES_CHECK_NEED_REENTRANT_FUNCTIONS_R fi if test "$tmp_need_reentrant" = "yes"; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi fi # AC_MSG_CHECKING([if _REENTRANT is onwards defined]) if test "$tmp_reentrant_initially_defined" = "yes" || test "$tmp_need_reentrant" = "yes"; then CARES_CONFIGURE_FROM_NOW_ON_WITH_REENTRANT AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi # ]) dnl CARES_CONFIGURE_THREAD_SAFE dnl ------------------------------------------------- dnl This first checks if the preprocessor _THREAD_SAFE dnl symbol is already defined. If it isn't currently dnl defined a set of checks are performed to verify dnl if its definition is required. Finally, if dnl _THREAD_SAFE is already defined or needed it takes dnl care of making adjustments necessary to ensure dnl that it is defined equally for further configure dnl tests and generated config file. AC_DEFUN([CARES_CONFIGURE_THREAD_SAFE], [ AC_PREREQ([2.50])dnl # AC_MSG_CHECKING([if _THREAD_SAFE is already defined]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ ]],[[ #ifdef _THREAD_SAFE int dummy=1; #else force compilation error #endif ]]) ],[ AC_MSG_RESULT([yes]) tmp_thread_safe_initially_defined="yes" ],[ AC_MSG_RESULT([no]) tmp_thread_safe_initially_defined="no" ]) # if test "$tmp_thread_safe_initially_defined" = "no"; then AC_MSG_CHECKING([if _THREAD_SAFE is actually needed]) CARES_CHECK_NEED_THREAD_SAFE_SYSTEM if test "$tmp_need_thread_safe" = "yes"; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi fi # AC_MSG_CHECKING([if _THREAD_SAFE is onwards defined]) if test "$tmp_thread_safe_initially_defined" = "yes" || test "$tmp_need_thread_safe" = "yes"; then CARES_CONFIGURE_FROM_NOW_ON_WITH_THREAD_SAFE AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi # ]) ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/m4/xc-am-iface.m40000644000175100001770000001663000000000000020742 0ustar00runnerdocker00000000000000#--------------------------------------------------------------------------- # # xc-am-iface.m4 # # Copyright (c) 2013 Daniel Stenberg # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # #--------------------------------------------------------------------------- # serial 1 dnl _XC_AUTOMAKE_BODY dnl ------------------------------------------------- dnl Private macro. dnl dnl This macro performs embedding of automake initialization dnl code into configure script. When automake version 1.14 or dnl newer is used at configure script generation time, this dnl results in 'subdir-objects' automake option being used. dnl When using automake versions older than 1.14 this option dnl is not used when generating configure script. dnl dnl Existence of automake _AM_PROG_CC_C_O m4 private macro dnl is used to differentiate automake version 1.14 from older dnl ones which lack this macro. m4_define([_XC_AUTOMAKE_BODY], [dnl ## --------------------------------------- ## ## Start of automake initialization code ## ## --------------------------------------- ## m4_ifdef([_AM_PROG_CC_C_O], [ AM_INIT_AUTOMAKE([subdir-objects]) ],[ AM_INIT_AUTOMAKE ])dnl ## ------------------------------------- ## ## End of automake initialization code ## ## ------------------------------------- ## dnl m4_define([$0], [])[]dnl ]) dnl XC_AUTOMAKE dnl ------------------------------------------------- dnl Public macro. dnl dnl This macro embeds automake machinery into configure dnl script regardless of automake version used in order dnl to generate configure script. dnl dnl When using automake version 1.14 or newer, automake dnl initialization option 'subdir-objects' is used to dnl generate the configure script, otherwise this option dnl is not used. AC_DEFUN([XC_AUTOMAKE], [dnl AC_PREREQ([2.50])dnl dnl AC_BEFORE([$0],[AM_INIT_AUTOMAKE])dnl dnl _XC_AUTOMAKE_BODY dnl m4_ifdef([AM_INIT_AUTOMAKE], [m4_undefine([AM_INIT_AUTOMAKE])])dnl dnl m4_define([$0], [])[]dnl ]) dnl _XC_AMEND_DISTCLEAN_BODY ([LIST-OF-SUBDIRS]) dnl ------------------------------------------------- dnl Private macro. dnl dnl This macro performs shell code embedding into dnl configure script in order to modify distclean dnl and maintainer-clean targets of makefiles which dnl are located in given list of subdirs. dnl dnl See XC_AMEND_DISTCLEAN comments for details. m4_define([_XC_AMEND_DISTCLEAN_BODY], [dnl ## ---------------------------------- ## ## Start of distclean amending code ## ## ---------------------------------- ## for xc_subdir in [$1] do if test ! -f "$xc_subdir/Makefile"; then echo "$xc_msg_err $xc_subdir/Makefile file not found. $xc_msg_abrt" >&2 exit 1 fi # Fetch dependency tracking file list from Makefile include lines. xc_inc_lines=`grep '^include .*(DEPDIR)' "$xc_subdir/Makefile" 2>/dev/null` xc_cnt_words=`echo "$xc_inc_lines" | wc -w | tr -d "$xc_space$xc_tab"` # --disable-dependency-tracking might have been used, consequently # there is nothing to amend without a dependency tracking file list. if test $xc_cnt_words -gt 0; then AC_MSG_NOTICE([amending $xc_subdir/Makefile]) # Build Makefile specific patch hunk. xc_p="$xc_subdir/xc_patch.tmp" xc_rm_depfiles=`echo "$xc_inc_lines" \ | $SED 's%include% -rm -f%' 2>/dev/null` xc_dep_subdirs=`echo "$xc_inc_lines" \ | $SED 's%include[[ ]][[ ]]*%%' 2>/dev/null \ | $SED 's%(DEPDIR)/.*%(DEPDIR)%' 2>/dev/null \ | sort | uniq` echo "$xc_rm_depfiles" >$xc_p for xc_dep_dir in $xc_dep_subdirs; do echo "${xc_tab}@xm_dep_cnt=\`ls $xc_dep_dir | wc -l 2>/dev/null\`; \\" >>$xc_p echo "${xc_tab}if test \$\$xm_dep_cnt -eq 0 && test -d $xc_dep_dir; then \\" >>$xc_p echo "${xc_tab} rm -rf $xc_dep_dir; \\" >>$xc_p echo "${xc_tab}fi" >>$xc_p done # Build Makefile patching sed scripts. xc_s1="$xc_subdir/xc_script_1.tmp" xc_s2="$xc_subdir/xc_script_2.tmp" xc_s3="$xc_subdir/xc_script_3.tmp" cat >$xc_s1 <<\_EOT /^distclean[[ ]]*:/,/^[[^ ]][[^ ]]*:/{ s/^.*(DEPDIR)/___xc_depdir_line___/ } /^maintainer-clean[[ ]]*:/,/^[[^ ]][[^ ]]*:/{ s/^.*(DEPDIR)/___xc_depdir_line___/ } _EOT cat >$xc_s2 <<\_EOT /___xc_depdir_line___$/{ N /___xc_depdir_line___$/D } _EOT cat >$xc_s3 <<_EOT /^___xc_depdir_line___/{ r $xc_p d } _EOT # Apply patch to Makefile and cleanup. $SED -f "$xc_s1" "$xc_subdir/Makefile" >"$xc_subdir/Makefile.tmp1" $SED -f "$xc_s2" "$xc_subdir/Makefile.tmp1" >"$xc_subdir/Makefile.tmp2" $SED -f "$xc_s3" "$xc_subdir/Makefile.tmp2" >"$xc_subdir/Makefile.tmp3" if test -f "$xc_subdir/Makefile.tmp3"; then mv -f "$xc_subdir/Makefile.tmp3" "$xc_subdir/Makefile" fi test -f "$xc_subdir/Makefile.tmp1" && rm -f "$xc_subdir/Makefile.tmp1" test -f "$xc_subdir/Makefile.tmp2" && rm -f "$xc_subdir/Makefile.tmp2" test -f "$xc_subdir/Makefile.tmp3" && rm -f "$xc_subdir/Makefile.tmp3" test -f "$xc_p" && rm -f "$xc_p" test -f "$xc_s1" && rm -f "$xc_s1" test -f "$xc_s2" && rm -f "$xc_s2" test -f "$xc_s3" && rm -f "$xc_s3" fi done ## -------------------------------- ## ## End of distclean amending code ## ## -------------------------------- ## dnl m4_define([$0], [])[]dnl ]) dnl XC_AMEND_DISTCLEAN ([LIST-OF-SUBDIRS]) dnl ------------------------------------------------- dnl Public macro. dnl dnl This macro embeds shell code into configure script dnl that amends, at configure runtime, the distclean dnl and maintainer-clean targets of Makefiles located dnl in all subdirs given in the mandatory white-space dnl separated list argument. dnl dnl Embedding only takes place when using automake 1.14 dnl or newer, otherwise amending code is not included dnl in generated configure script. dnl dnl distclean and maintainer-clean targets are modified dnl to avoid unconditional removal of dependency subdirs dnl which triggers distclean and maintainer-clean errors dnl when using automake 'subdir-objects' option along dnl with per-target objects and source files existing in dnl multiple subdirs used for different build targets. dnl dnl New behavior first removes each dependency tracking dnl file independently, and only removes each dependency dnl subdir when it finds out that it no longer holds any dnl dependency tracking file. dnl dnl When configure option --disable-dependency-tracking dnl is used no amending takes place given that there are dnl no dependency tracking files. AC_DEFUN([XC_AMEND_DISTCLEAN], [dnl AC_PREREQ([2.50])dnl dnl m4_ifdef([_AC_OUTPUT_MAIN_LOOP], [m4_provide_if([_AC_OUTPUT_MAIN_LOOP], [], [m4_fatal([call to AC_OUTPUT needed before $0])])])dnl dnl m4_if([$#], [1], [], [m4_fatal([$0: wrong number of arguments])])dnl m4_if([$1], [], [m4_fatal([$0: missing argument])])dnl dnl AC_REQUIRE([XC_CONFIGURE_PREAMBLE])dnl dnl m4_ifdef([_AM_PROG_CC_C_O], [ _XC_AMEND_DISTCLEAN_BODY([$1]) ])dnl m4_define([$0], [])[]dnl ]) ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/m4/xc-cc-check.m40000644000175100001770000000560600000000000020741 0ustar00runnerdocker00000000000000#--------------------------------------------------------------------------- # # xc-cc-check.m4 # # Copyright (c) 2013 Daniel Stenberg # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # #--------------------------------------------------------------------------- # serial 1 dnl _XC_PROG_CC_PREAMBLE dnl ------------------------------------------------- dnl Private macro. AC_DEFUN([_XC_PROG_CC_PREAMBLE], [ xc_prog_cc_prev_IFS=$IFS xc_prog_cc_prev_LIBS=$LIBS xc_prog_cc_prev_CFLAGS=$CFLAGS xc_prog_cc_prev_LDFLAGS=$LDFLAGS xc_prog_cc_prev_CPPFLAGS=$CPPFLAGS ]) dnl _XC_PROG_CC_POSTLUDE dnl ------------------------------------------------- dnl Private macro. AC_DEFUN([_XC_PROG_CC_POSTLUDE], [ IFS=$xc_prog_cc_prev_IFS LIBS=$xc_prog_cc_prev_LIBS CFLAGS=$xc_prog_cc_prev_CFLAGS LDFLAGS=$xc_prog_cc_prev_LDFLAGS CPPFLAGS=$xc_prog_cc_prev_CPPFLAGS AC_SUBST([CC])dnl AC_SUBST([CPP])dnl AC_SUBST([LIBS])dnl AC_SUBST([CFLAGS])dnl AC_SUBST([LDFLAGS])dnl AC_SUBST([CPPFLAGS])dnl ]) dnl _XC_PROG_CC dnl ------------------------------------------------- dnl Private macro. AC_DEFUN([_XC_PROG_CC], [ AC_REQUIRE([_XC_PROG_CC_PREAMBLE])dnl AC_REQUIRE([XC_CHECK_BUILD_FLAGS])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AM_PROG_CC_C_O])dnl AC_REQUIRE([AC_PROG_CPP])dnl AC_REQUIRE([_XC_PROG_CC_POSTLUDE])dnl ]) dnl XC_CHECK_PROG_CC dnl ------------------------------------------------- dnl Public macro. dnl dnl Checks for C compiler and C preprocessor programs, dnl while doing some previous sanity validation on user dnl provided LIBS, LDFLAGS, CPPFLAGS and CFLAGS values dnl that must succeed in order to continue execution. dnl dnl This sets variables CC and CPP, while preventing dnl LIBS, LDFLAGS, CFLAGS, CPPFLAGS and IFS from being dnl unexpectedly changed by underlying macros. AC_DEFUN([XC_CHECK_PROG_CC], [ AC_PREREQ([2.50])dnl AC_BEFORE([$0],[_XC_PROG_CC_PREAMBLE])dnl AC_BEFORE([$0],[AC_PROG_INSTALL])dnl AC_BEFORE([$0],[AC_PROG_CC])dnl AC_BEFORE([$0],[AM_PROG_CC_C_O])dnl AC_BEFORE([$0],[AC_PROG_CPP])dnl AC_BEFORE([$0],[AC_PROG_LIBTOOL])dnl AC_BEFORE([$0],[AM_INIT_AUTOMAKE])dnl AC_BEFORE([$0],[_XC_PROG_CC_POSTLUDE])dnl AC_REQUIRE([_XC_PROG_CC])dnl ]) ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/m4/xc-lt-iface.m40000644000175100001770000002770700000000000020773 0ustar00runnerdocker00000000000000#--------------------------------------------------------------------------- # # xc-lt-iface.m4 # # Copyright (c) 2013 Daniel Stenberg # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # #--------------------------------------------------------------------------- # serial 1 dnl _XC_LIBTOOL_PREAMBLE dnl ------------------------------------------------- dnl Private macro. dnl dnl Checks some configure script options related with dnl libtool and customizes its default behavior before dnl libtool code is actually used in script. m4_define([_XC_LIBTOOL_PREAMBLE], [dnl # ------------------------------------ # # Determine libtool default behavior # # ------------------------------------ # # # Default behavior is to enable shared and static libraries on systems # where libtool knows how to build both library versions, and does not # require separate configuration and build runs for each flavor. # xc_lt_want_enable_shared='yes' xc_lt_want_enable_static='yes' # # User may have disabled shared or static libraries. # case "x$enable_shared" in @%:@ ( xno) xc_lt_want_enable_shared='no' ;; esac case "x$enable_static" in @%:@ ( xno) xc_lt_want_enable_static='no' ;; esac if test "x$xc_lt_want_enable_shared" = 'xno' && test "x$xc_lt_want_enable_static" = 'xno'; then AC_MSG_ERROR([can not disable shared and static libraries simultaneously]) fi # # Default behavior on systems that require independent configuration # and build runs for shared and static is to enable shared libraries # and disable static ones. On these systems option '--disable-shared' # must be used in order to build a proper static library. # if test "x$xc_lt_want_enable_shared" = 'xyes' && test "x$xc_lt_want_enable_static" = 'xyes'; then case $host_os in @%:@ ( mingw* | pw32* | cegcc* | os2* | aix*) xc_lt_want_enable_static='no' ;; esac fi # # Make libtool aware of current shared and static library preferences # taking in account that, depending on host characteristics, libtool # may modify these option preferences later in this configure script. # enable_shared=$xc_lt_want_enable_shared enable_static=$xc_lt_want_enable_static # # Default behavior is to build PIC objects for shared libraries and # non-PIC objects for static libraries. # xc_lt_want_with_pic='default' # # User may have specified PIC preference. # case "x$with_pic" in @%:@ (( xno) xc_lt_want_with_pic='no' ;; xyes) xc_lt_want_with_pic='yes' ;; esac # # Default behavior on some systems where building a shared library out # of non-PIC compiled objects will fail with following linker error # "relocation R_X86_64_32 can not be used when making a shared object" # is to build PIC objects even for static libraries. This behavior may # be overriden using 'configure --disable-shared --without-pic'. # if test "x$xc_lt_want_with_pic" = 'xdefault'; then case $host_cpu in @%:@ ( x86_64 | amd64 | ia64) case $host_os in @%:@ ( linux* | freebsd*) xc_lt_want_with_pic='yes' ;; esac ;; esac fi # # Make libtool aware of current PIC preference taking in account that, # depending on host characteristics, libtool may modify PIC default # behavior to fit host system idiosyncrasies later in this script. # with_pic=$xc_lt_want_with_pic dnl m4_define([$0],[])dnl ]) dnl _XC_LIBTOOL_BODY dnl ------------------------------------------------- dnl Private macro. dnl dnl This macro performs embedding of libtool code into dnl configure script, regardless of libtool version in dnl use when generating configure script. m4_define([_XC_LIBTOOL_BODY], [dnl ## ----------------------- ## ## Start of libtool code ## ## ----------------------- ## m4_ifdef([LT_INIT], [dnl LT_INIT([win32-dll]) ],[dnl AC_LIBTOOL_WIN32_DLL AC_PROG_LIBTOOL ])dnl ## --------------------- ## ## End of libtool code ## ## --------------------- ## dnl m4_define([$0], [])[]dnl ]) dnl _XC_CHECK_LT_BUILD_LIBRARIES dnl ------------------------------------------------- dnl Private macro. dnl dnl Checks wether libtool shared and static libraries dnl are finally built depending on user input, default dnl behavior and knowledge that libtool has about host dnl characteristics. dnl Results stored in following shell variables: dnl xc_lt_build_shared dnl xc_lt_build_static m4_define([_XC_CHECK_LT_BUILD_LIBRARIES], [dnl # # Verify if finally libtool shared libraries will be built # case "x$enable_shared" in @%:@ (( xyes | xno) xc_lt_build_shared=$enable_shared ;; *) AC_MSG_ERROR([unexpected libtool enable_shared value: $enable_shared]) ;; esac # # Verify if finally libtool static libraries will be built # case "x$enable_static" in @%:@ (( xyes | xno) xc_lt_build_static=$enable_static ;; *) AC_MSG_ERROR([unexpected libtool enable_static value: $enable_static]) ;; esac dnl m4_define([$0],[])dnl ]) dnl _XC_CHECK_LT_SHLIB_USE_VERSION_INFO dnl ------------------------------------------------- dnl Private macro. dnl dnl Checks if the -version-info linker flag must be dnl provided when building libtool shared libraries. dnl Result stored in xc_lt_shlib_use_version_info. m4_define([_XC_CHECK_LT_SHLIB_USE_VERSION_INFO], [dnl # # Verify if libtool shared libraries should be linked using flag -version-info # AC_MSG_CHECKING([whether to build shared libraries with -version-info]) xc_lt_shlib_use_version_info='yes' if test "x$version_type" = 'xnone'; then xc_lt_shlib_use_version_info='no' fi case $host_os in @%:@ ( amigaos*) xc_lt_shlib_use_version_info='yes' ;; esac AC_MSG_RESULT([$xc_lt_shlib_use_version_info]) dnl m4_define([$0], [])[]dnl ]) dnl _XC_CHECK_LT_SHLIB_USE_NO_UNDEFINED dnl ------------------------------------------------- dnl Private macro. dnl dnl Checks if the -no-undefined linker flag must be dnl provided when building libtool shared libraries. dnl Result stored in xc_lt_shlib_use_no_undefined. m4_define([_XC_CHECK_LT_SHLIB_USE_NO_UNDEFINED], [dnl # # Verify if libtool shared libraries should be linked using flag -no-undefined # AC_MSG_CHECKING([whether to build shared libraries with -no-undefined]) xc_lt_shlib_use_no_undefined='no' if test "x$allow_undefined" = 'xno'; then xc_lt_shlib_use_no_undefined='yes' elif test "x$allow_undefined_flag" = 'xunsupported'; then xc_lt_shlib_use_no_undefined='yes' fi case $host_os in @%:@ ( cygwin* | mingw* | pw32* | cegcc* | os2* | aix*) xc_lt_shlib_use_no_undefined='yes' ;; esac AC_MSG_RESULT([$xc_lt_shlib_use_no_undefined]) dnl m4_define([$0], [])[]dnl ]) dnl _XC_CHECK_LT_SHLIB_USE_MIMPURE_TEXT dnl ------------------------------------------------- dnl Private macro. dnl dnl Checks if the -mimpure-text linker flag must be dnl provided when building libtool shared libraries. dnl Result stored in xc_lt_shlib_use_mimpure_text. m4_define([_XC_CHECK_LT_SHLIB_USE_MIMPURE_TEXT], [dnl # # Verify if libtool shared libraries should be linked using flag -mimpure-text # AC_MSG_CHECKING([whether to build shared libraries with -mimpure-text]) xc_lt_shlib_use_mimpure_text='no' case $host_os in @%:@ ( solaris2*) if test "x$GCC" = 'xyes'; then xc_lt_shlib_use_mimpure_text='yes' fi ;; esac AC_MSG_RESULT([$xc_lt_shlib_use_mimpure_text]) dnl m4_define([$0], [])[]dnl ]) dnl _XC_CHECK_LT_BUILD_WITH_PIC dnl ------------------------------------------------- dnl Private macro. dnl dnl Checks wether libtool shared and static libraries dnl would be built with PIC depending on user input, dnl default behavior and knowledge that libtool has dnl about host characteristics. dnl Results stored in following shell variables: dnl xc_lt_build_shared_with_pic dnl xc_lt_build_static_with_pic m4_define([_XC_CHECK_LT_BUILD_WITH_PIC], [dnl # # Find out wether libtool libraries would be built wit PIC # case "x$pic_mode" in @%:@ (((( xdefault) xc_lt_build_shared_with_pic='yes' xc_lt_build_static_with_pic='no' ;; xyes) xc_lt_build_shared_with_pic='yes' xc_lt_build_static_with_pic='yes' ;; xno) xc_lt_build_shared_with_pic='no' xc_lt_build_static_with_pic='no' ;; *) xc_lt_build_shared_with_pic='unknown' xc_lt_build_static_with_pic='unknown' AC_MSG_WARN([unexpected libtool pic_mode value: $pic_mode]) ;; esac AC_MSG_CHECKING([whether to build shared libraries with PIC]) AC_MSG_RESULT([$xc_lt_build_shared_with_pic]) AC_MSG_CHECKING([whether to build static libraries with PIC]) AC_MSG_RESULT([$xc_lt_build_static_with_pic]) dnl m4_define([$0],[])dnl ]) dnl _XC_CHECK_LT_BUILD_SINGLE_VERSION dnl ------------------------------------------------- dnl Private macro. dnl dnl Checks wether a libtool shared or static library dnl is finally built exclusively without the other. dnl Results stored in following shell variables: dnl xc_lt_build_shared_only dnl xc_lt_build_static_only m4_define([_XC_CHECK_LT_BUILD_SINGLE_VERSION], [dnl # # Verify if libtool shared libraries will be built while static not built # AC_MSG_CHECKING([whether to build shared libraries only]) if test "$xc_lt_build_shared" = 'yes' && test "$xc_lt_build_static" = 'no'; then xc_lt_build_shared_only='yes' else xc_lt_build_shared_only='no' fi AC_MSG_RESULT([$xc_lt_build_shared_only]) # # Verify if libtool static libraries will be built while shared not built # AC_MSG_CHECKING([whether to build static libraries only]) if test "$xc_lt_build_static" = 'yes' && test "$xc_lt_build_shared" = 'no'; then xc_lt_build_static_only='yes' else xc_lt_build_static_only='no' fi AC_MSG_RESULT([$xc_lt_build_static_only]) dnl m4_define([$0],[])dnl ]) dnl _XC_LIBTOOL_POSTLUDE dnl ------------------------------------------------- dnl Private macro. dnl dnl Performs several checks related with libtool that dnl can not be done unless libtool code has already dnl been executed. See individual check descriptions dnl for further info. m4_define([_XC_LIBTOOL_POSTLUDE], [dnl _XC_CHECK_LT_BUILD_LIBRARIES _XC_CHECK_LT_SHLIB_USE_VERSION_INFO _XC_CHECK_LT_SHLIB_USE_NO_UNDEFINED _XC_CHECK_LT_SHLIB_USE_MIMPURE_TEXT _XC_CHECK_LT_BUILD_WITH_PIC _XC_CHECK_LT_BUILD_SINGLE_VERSION dnl m4_define([$0],[])dnl ]) dnl XC_LIBTOOL dnl ------------------------------------------------- dnl Public macro. dnl dnl This macro embeds libtool machinery into configure dnl script, regardless of libtool version, and performs dnl several additional checks whose results can be used dnl later on. dnl dnl Usage of this macro ensures that generated configure dnl script uses equivalent logic irrespective of autoconf dnl or libtool version being used to generate configure dnl script. dnl dnl Results stored in following shell variables: dnl xc_lt_build_shared dnl xc_lt_build_static dnl xc_lt_shlib_use_version_info dnl xc_lt_shlib_use_no_undefined dnl xc_lt_shlib_use_mimpure_text dnl xc_lt_build_shared_with_pic dnl xc_lt_build_static_with_pic dnl xc_lt_build_shared_only dnl xc_lt_build_static_only AC_DEFUN([XC_LIBTOOL], [dnl AC_PREREQ([2.50])dnl dnl AC_BEFORE([$0],[LT_INIT])dnl AC_BEFORE([$0],[AC_PROG_LIBTOOL])dnl AC_BEFORE([$0],[AC_LIBTOOL_WIN32_DLL])dnl dnl AC_REQUIRE([XC_CHECK_PATH_SEPARATOR])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl dnl _XC_LIBTOOL_PREAMBLE _XC_LIBTOOL_BODY _XC_LIBTOOL_POSTLUDE dnl m4_ifdef([AC_LIBTOOL_WIN32_DLL], [m4_undefine([AC_LIBTOOL_WIN32_DLL])])dnl m4_ifdef([AC_PROG_LIBTOOL], [m4_undefine([AC_PROG_LIBTOOL])])dnl m4_ifdef([LT_INIT], [m4_undefine([LT_INIT])])dnl dnl m4_define([$0],[])dnl ]) ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/m4/xc-translit.m40000644000175100001770000001323700000000000021140 0ustar00runnerdocker00000000000000#--------------------------------------------------------------------------- # # xc-translit.m4 # # Copyright (c) 2011 Daniel Stenberg # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # #--------------------------------------------------------------------------- # File version for 'aclocal' use. Keep it a single number. # serial 2 dnl XC_SH_TR_SH (expression) dnl ------------------------------------------------- dnl Shell execution time transliteration of 'expression' dnl argument, where all non-alfanumeric characters are dnl converted to the underscore '_' character. dnl Normal shell expansion and substitution takes place dnl for given 'expression' at shell execution time before dnl transliteration is applied to it. AC_DEFUN([XC_SH_TR_SH], [`echo "$1" | sed 's/[[^a-zA-Z0-9_]]/_/g'`]) dnl XC_SH_TR_SH_EX (expression, [extra]) dnl ------------------------------------------------- dnl Like XC_SH_TR_SH but transliterating characters dnl given in 'extra' argument to lowercase 'p'. For dnl example [*+], [*], and [+] are valid 'extra' args. AC_DEFUN([XC_SH_TR_SH_EX], [ifelse([$2], [], [XC_SH_TR_SH([$1])], [`echo "$1" | sed 's/[[$2]]/p/g' | sed 's/[[^a-zA-Z0-9_]]/_/g'`])]) dnl XC_M4_TR_SH (expression) dnl ------------------------------------------------- dnl m4 execution time transliteration of 'expression' dnl argument, where all non-alfanumeric characters are dnl converted to the underscore '_' character. AC_DEFUN([XC_M4_TR_SH], [patsubst(XC_QPATSUBST(XC_QUOTE($1), [[^a-zA-Z0-9_]], [_]), [\(_\(.*\)_\)], [\2])]) dnl XC_M4_TR_SH_EX (expression, [extra]) dnl ------------------------------------------------- dnl Like XC_M4_TR_SH but transliterating characters dnl given in 'extra' argument to lowercase 'p'. For dnl example [*+], [*], and [+] are valid 'extra' args. AC_DEFUN([XC_M4_TR_SH_EX], [ifelse([$2], [], [XC_M4_TR_SH([$1])], [patsubst(XC_QPATSUBST(XC_QPATSUBST(XC_QUOTE($1), [[$2]], [p]), [[^a-zA-Z0-9_]], [_]), [\(_\(.*\)_\)], [\2])])]) dnl XC_SH_TR_CPP (expression) dnl ------------------------------------------------- dnl Shell execution time transliteration of 'expression' dnl argument, where all non-alfanumeric characters are dnl converted to the underscore '_' character and alnum dnl characters are converted to uppercase. dnl Normal shell expansion and substitution takes place dnl for given 'expression' at shell execution time before dnl transliteration is applied to it. AC_DEFUN([XC_SH_TR_CPP], [`echo "$1" | dnl sed 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' | dnl sed 's/[[^A-Z0-9_]]/_/g'`]) dnl XC_SH_TR_CPP_EX (expression, [extra]) dnl ------------------------------------------------- dnl Like XC_SH_TR_CPP but transliterating characters dnl given in 'extra' argument to uppercase 'P'. For dnl example [*+], [*], and [+] are valid 'extra' args. AC_DEFUN([XC_SH_TR_CPP_EX], [ifelse([$2], [], [XC_SH_TR_CPP([$1])], [`echo "$1" | dnl sed 's/[[$2]]/P/g' | dnl sed 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' | dnl sed 's/[[^A-Z0-9_]]/_/g'`])]) dnl XC_M4_TR_CPP (expression) dnl ------------------------------------------------- dnl m4 execution time transliteration of 'expression' dnl argument, where all non-alfanumeric characters are dnl converted to the underscore '_' character and alnum dnl characters are converted to uppercase. AC_DEFUN([XC_M4_TR_CPP], [patsubst(XC_QPATSUBST(XC_QTRANSLIT(XC_QUOTE($1), [abcdefghijklmnopqrstuvwxyz], [ABCDEFGHIJKLMNOPQRSTUVWXYZ]), [[^A-Z0-9_]], [_]), [\(_\(.*\)_\)], [\2])]) dnl XC_M4_TR_CPP_EX (expression, [extra]) dnl ------------------------------------------------- dnl Like XC_M4_TR_CPP but transliterating characters dnl given in 'extra' argument to uppercase 'P'. For dnl example [*+], [*], and [+] are valid 'extra' args. AC_DEFUN([XC_M4_TR_CPP_EX], [ifelse([$2], [], [XC_M4_TR_CPP([$1])], [patsubst(XC_QPATSUBST(XC_QTRANSLIT(XC_QPATSUBST(XC_QUOTE($1), [[$2]], [P]), [abcdefghijklmnopqrstuvwxyz], [ABCDEFGHIJKLMNOPQRSTUVWXYZ]), [[^A-Z0-9_]], [_]), [\(_\(.*\)_\)], [\2])])]) dnl XC_QUOTE (expression) dnl ------------------------------------------------- dnl Expands to quoted result of 'expression' expansion. AC_DEFUN([XC_QUOTE], [[$@]]) dnl XC_QPATSUBST (string, regexp[, repl]) dnl ------------------------------------------------- dnl Expands to quoted result of 'patsubst' expansion. AC_DEFUN([XC_QPATSUBST], [XC_QUOTE(patsubst([$1], [$2], [$3]))]) dnl XC_QTRANSLIT (string, chars, repl) dnl ------------------------------------------------- dnl Expands to quoted result of 'translit' expansion. AC_DEFUN([XC_QTRANSLIT], [XC_QUOTE(translit([$1], [$2], [$3]))]) ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/m4/xc-val-flgs.m40000644000175100001770000001550600000000000021014 0ustar00runnerdocker00000000000000#--------------------------------------------------------------------------- # # xc-val-flgs.m4 # # Copyright (c) 2013 Daniel Stenberg # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # #--------------------------------------------------------------------------- # serial 1 dnl _XC_CHECK_VAR_LIBS dnl ------------------------------------------------- dnl Private macro. AC_DEFUN([_XC_CHECK_VAR_LIBS], [ xc_bad_var_libs=no for xc_word in $LIBS; do case "$xc_word" in -l* | --library=*) : ;; *) xc_bad_var_libs=yes ;; esac done if test $xc_bad_var_libs = yes; then AC_MSG_NOTICE([using LIBS: $LIBS]) AC_MSG_NOTICE([LIBS error: LIBS may only be used to specify libraries (-lname).]) fi ]) dnl _XC_CHECK_VAR_LDFLAGS dnl ------------------------------------------------- dnl Private macro. AC_DEFUN([_XC_CHECK_VAR_LDFLAGS], [ xc_bad_var_ldflags=no for xc_word in $LDFLAGS; do case "$xc_word" in -D*) xc_bad_var_ldflags=yes ;; -U*) xc_bad_var_ldflags=yes ;; -I*) xc_bad_var_ldflags=yes ;; -l* | --library=*) xc_bad_var_ldflags=yes ;; esac done if test $xc_bad_var_ldflags = yes; then AC_MSG_NOTICE([using LDFLAGS: $LDFLAGS]) xc_bad_var_msg="LDFLAGS error: LDFLAGS may only be used to specify linker flags, not" for xc_word in $LDFLAGS; do case "$xc_word" in -D*) AC_MSG_NOTICE([$xc_bad_var_msg macro definitions. Use CPPFLAGS for: $xc_word]) ;; -U*) AC_MSG_NOTICE([$xc_bad_var_msg macro suppressions. Use CPPFLAGS for: $xc_word]) ;; -I*) AC_MSG_NOTICE([$xc_bad_var_msg include directories. Use CPPFLAGS for: $xc_word]) ;; -l* | --library=*) AC_MSG_NOTICE([$xc_bad_var_msg libraries. Use LIBS for: $xc_word]) ;; esac done fi ]) dnl _XC_CHECK_VAR_CPPFLAGS dnl ------------------------------------------------- dnl Private macro. AC_DEFUN([_XC_CHECK_VAR_CPPFLAGS], [ xc_bad_var_cppflags=no for xc_word in $CPPFLAGS; do case "$xc_word" in -rpath*) xc_bad_var_cppflags=yes ;; -L* | --library-path=*) xc_bad_var_cppflags=yes ;; -l* | --library=*) xc_bad_var_cppflags=yes ;; esac done if test $xc_bad_var_cppflags = yes; then AC_MSG_NOTICE([using CPPFLAGS: $CPPFLAGS]) xc_bad_var_msg="CPPFLAGS error: CPPFLAGS may only be used to specify C preprocessor flags, not" for xc_word in $CPPFLAGS; do case "$xc_word" in -rpath*) AC_MSG_NOTICE([$xc_bad_var_msg library runtime directories. Use LDFLAGS for: $xc_word]) ;; -L* | --library-path=*) AC_MSG_NOTICE([$xc_bad_var_msg library directories. Use LDFLAGS for: $xc_word]) ;; -l* | --library=*) AC_MSG_NOTICE([$xc_bad_var_msg libraries. Use LIBS for: $xc_word]) ;; esac done fi ]) dnl _XC_CHECK_VAR_CFLAGS dnl ------------------------------------------------- dnl Private macro. AC_DEFUN([_XC_CHECK_VAR_CFLAGS], [ xc_bad_var_cflags=no for xc_word in $CFLAGS; do case "$xc_word" in -D*) xc_bad_var_cflags=yes ;; -U*) xc_bad_var_cflags=yes ;; -I*) xc_bad_var_cflags=yes ;; -rpath*) xc_bad_var_cflags=yes ;; -L* | --library-path=*) xc_bad_var_cflags=yes ;; -l* | --library=*) xc_bad_var_cflags=yes ;; esac done if test $xc_bad_var_cflags = yes; then AC_MSG_NOTICE([using CFLAGS: $CFLAGS]) xc_bad_var_msg="CFLAGS error: CFLAGS may only be used to specify C compiler flags, not" for xc_word in $CFLAGS; do case "$xc_word" in -D*) AC_MSG_NOTICE([$xc_bad_var_msg macro definitions. Use CPPFLAGS for: $xc_word]) ;; -U*) AC_MSG_NOTICE([$xc_bad_var_msg macro suppressions. Use CPPFLAGS for: $xc_word]) ;; -I*) AC_MSG_NOTICE([$xc_bad_var_msg include directories. Use CPPFLAGS for: $xc_word]) ;; -rpath*) AC_MSG_NOTICE([$xc_bad_var_msg library runtime directories. Use LDFLAGS for: $xc_word]) ;; -L* | --library-path=*) AC_MSG_NOTICE([$xc_bad_var_msg library directories. Use LDFLAGS for: $xc_word]) ;; -l* | --library=*) AC_MSG_NOTICE([$xc_bad_var_msg libraries. Use LIBS for: $xc_word]) ;; esac done fi ]) dnl XC_CHECK_USER_FLAGS dnl ------------------------------------------------- dnl Public macro. dnl dnl Performs some sanity checks for LIBS, LDFLAGS, dnl CPPFLAGS and CFLAGS values that the user might dnl have set. When checks fails, user is noticed dnl about errors detected in all of them and script dnl execution is halted. dnl dnl Intended to be used early in configure script. AC_DEFUN([XC_CHECK_USER_FLAGS], [ AC_PREREQ([2.50])dnl AC_BEFORE([$0],[XC_CHECK_PROG_CC])dnl dnl check order below matters _XC_CHECK_VAR_LIBS _XC_CHECK_VAR_LDFLAGS _XC_CHECK_VAR_CPPFLAGS _XC_CHECK_VAR_CFLAGS if test $xc_bad_var_libs = yes || test $xc_bad_var_cflags = yes || test $xc_bad_var_ldflags = yes || test $xc_bad_var_cppflags = yes; then AC_MSG_ERROR([Can not continue. Fix errors mentioned immediately above this line.]) fi ]) dnl XC_CHECK_BUILD_FLAGS dnl ------------------------------------------------- dnl Public macro. dnl dnl Performs some sanity checks for LIBS, LDFLAGS, dnl CPPFLAGS and CFLAGS values that the configure dnl script might have set. When checks fails, user dnl is noticed about errors detected in all of them dnl but script continues execution. dnl dnl Intended to be used very late in configure script. AC_DEFUN([XC_CHECK_BUILD_FLAGS], [ AC_PREREQ([2.50])dnl dnl check order below matters _XC_CHECK_VAR_LIBS _XC_CHECK_VAR_LDFLAGS _XC_CHECK_VAR_CPPFLAGS _XC_CHECK_VAR_CFLAGS if test $xc_bad_var_libs = yes || test $xc_bad_var_cflags = yes || test $xc_bad_var_ldflags = yes || test $xc_bad_var_cppflags = yes; then AC_MSG_WARN([Continuing even with errors mentioned immediately above this line.]) fi ]) ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/m4/zz40-xc-ovr.m40000644000175100001770000004351300000000000020713 0ustar00runnerdocker00000000000000#--------------------------------------------------------------------------- # # zz40-xc-ovr.m4 # # Copyright (c) 2013 Daniel Stenberg # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # #--------------------------------------------------------------------------- # serial 1 dnl The funny name of this file is intentional in order to make it dnl sort alphabetically after any libtool, autoconf or automake dnl provided .m4 macro file that might get copied into this same dnl subdirectory. This allows that macro (re)definitions from this dnl file may override those provided in other files. dnl Version macros dnl ------------------------------------------------- dnl Public macros. m4_define([XC_CONFIGURE_PREAMBLE_VER_MAJOR],[1])dnl m4_define([XC_CONFIGURE_PREAMBLE_VER_MINOR],[0])dnl dnl _XC_CFG_PRE_PREAMBLE dnl ------------------------------------------------- dnl Private macro. AC_DEFUN([_XC_CFG_PRE_PREAMBLE], [ ## -------------------------------- ## @%:@@%:@ [XC_CONFIGURE_PREAMBLE] ver: []dnl XC_CONFIGURE_PREAMBLE_VER_MAJOR.[]dnl XC_CONFIGURE_PREAMBLE_VER_MINOR ## ## -------------------------------- ## xc_configure_preamble_ver_major='XC_CONFIGURE_PREAMBLE_VER_MAJOR' xc_configure_preamble_ver_minor='XC_CONFIGURE_PREAMBLE_VER_MINOR' # # Set IFS to space, tab and newline. # xc_space=' ' xc_tab=' ' xc_newline=' ' IFS="$xc_space$xc_tab$xc_newline" # # Set internationalization behavior variables. # LANG='C' LC_ALL='C' LANGUAGE='C' export LANG export LC_ALL export LANGUAGE # # Some useful variables. # xc_msg_warn='configure: WARNING:' xc_msg_abrt='Can not continue.' xc_msg_err='configure: error:' ]) dnl _XC_CFG_PRE_BASIC_CHK_CMD_ECHO dnl ------------------------------------------------- dnl Private macro. dnl dnl Emits shell code that verifies that 'echo' command dnl is available, otherwise aborts execution. AC_DEFUN([_XC_CFG_PRE_BASIC_CHK_CMD_ECHO], [dnl AC_REQUIRE([_XC_CFG_PRE_PREAMBLE])dnl # # Verify that 'echo' command is available, otherwise abort. # xc_tst_str='unknown' (`echo "$xc_tst_str" >/dev/null 2>&1`) && xc_tst_str='success' case "x$xc_tst_str" in @%:@ (( xsuccess) : ;; *) # Try built-in echo, and fail. echo "$xc_msg_err 'echo' command not found. $xc_msg_abrt" >&2 exit 1 ;; esac ]) dnl _XC_CFG_PRE_BASIC_CHK_CMD_TEST dnl ------------------------------------------------- dnl Private macro. dnl dnl Emits shell code that verifies that 'test' command dnl is available, otherwise aborts execution. AC_DEFUN([_XC_CFG_PRE_BASIC_CHK_CMD_TEST], [dnl AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_CMD_ECHO])dnl # # Verify that 'test' command is available, otherwise abort. # xc_tst_str='unknown' (`test -n "$xc_tst_str" >/dev/null 2>&1`) && xc_tst_str='success' case "x$xc_tst_str" in @%:@ (( xsuccess) : ;; *) echo "$xc_msg_err 'test' command not found. $xc_msg_abrt" >&2 exit 1 ;; esac ]) dnl _XC_CFG_PRE_BASIC_CHK_VAR_PATH dnl ------------------------------------------------- dnl Private macro. dnl dnl Emits shell code that verifies that 'PATH' variable dnl is set, otherwise aborts execution. AC_DEFUN([_XC_CFG_PRE_BASIC_CHK_VAR_PATH], [dnl AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_CMD_TEST])dnl # # Verify that 'PATH' variable is set, otherwise abort. # xc_tst_str='unknown' (`test -n "$PATH" >/dev/null 2>&1`) && xc_tst_str='success' case "x$xc_tst_str" in @%:@ (( xsuccess) : ;; *) echo "$xc_msg_err 'PATH' variable not set. $xc_msg_abrt" >&2 exit 1 ;; esac ]) dnl _XC_CFG_PRE_BASIC_CHK_CMD_EXPR dnl ------------------------------------------------- dnl Private macro. dnl dnl Emits shell code that verifies that 'expr' command dnl is available, otherwise aborts execution. AC_DEFUN([_XC_CFG_PRE_BASIC_CHK_CMD_EXPR], [dnl AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_VAR_PATH])dnl # # Verify that 'expr' command is available, otherwise abort. # xc_tst_str='unknown' xc_tst_str=`expr "$xc_tst_str" : '.*' 2>/dev/null` case "x$xc_tst_str" in @%:@ (( x7) : ;; *) echo "$xc_msg_err 'expr' command not found. $xc_msg_abrt" >&2 exit 1 ;; esac ]) dnl _XC_CFG_PRE_BASIC_CHK_UTIL_SED dnl ------------------------------------------------- dnl Private macro. dnl dnl Emits shell code that verifies that 'sed' utility dnl is found within 'PATH', otherwise aborts execution. dnl dnl This 'sed' is required in order to allow configure dnl script bootstrapping itself. No fancy testing for a dnl proper 'sed' this early, that should be done later. AC_DEFUN([_XC_CFG_PRE_BASIC_CHK_UTIL_SED], [dnl AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_VAR_PATH])dnl # # Verify that 'sed' utility is found within 'PATH', otherwise abort. # xc_tst_str='unknown' xc_tst_str=`echo "$xc_tst_str" 2>/dev/null \ | sed -e 's:unknown:success:' 2>/dev/null` case "x$xc_tst_str" in @%:@ (( xsuccess) : ;; *) echo "$xc_msg_err 'sed' utility not found in 'PATH'. $xc_msg_abrt" >&2 exit 1 ;; esac ]) dnl _XC_CFG_PRE_BASIC_CHK_UTIL_GREP dnl ------------------------------------------------- dnl Private macro. dnl dnl Emits shell code that verifies that 'grep' utility dnl is found within 'PATH', otherwise aborts execution. dnl dnl This 'grep' is required in order to allow configure dnl script bootstrapping itself. No fancy testing for a dnl proper 'grep' this early, that should be done later. AC_DEFUN([_XC_CFG_PRE_BASIC_CHK_UTIL_GREP], [dnl AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_VAR_PATH])dnl # # Verify that 'grep' utility is found within 'PATH', otherwise abort. # xc_tst_str='unknown' (`echo "$xc_tst_str" 2>/dev/null \ | grep 'unknown' >/dev/null 2>&1`) && xc_tst_str='success' case "x$xc_tst_str" in @%:@ (( xsuccess) : ;; *) echo "$xc_msg_err 'grep' utility not found in 'PATH'. $xc_msg_abrt" >&2 exit 1 ;; esac ]) dnl _XC_CFG_PRE_BASIC_CHK_UTIL_TR dnl ------------------------------------------------- dnl Private macro. dnl dnl Emits shell code that verifies that 'tr' utility dnl is found within 'PATH', otherwise aborts execution. AC_DEFUN([_XC_CFG_PRE_BASIC_CHK_UTIL_TR], [dnl AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_VAR_PATH])dnl # # Verify that 'tr' utility is found within 'PATH', otherwise abort. # xc_tst_str="${xc_tab}98s7u6c5c4e3s2s10" xc_tst_str=`echo "$xc_tst_str" 2>/dev/null \ | tr -d "0123456789$xc_tab" 2>/dev/null` case "x$xc_tst_str" in @%:@ (( xsuccess) : ;; *) echo "$xc_msg_err 'tr' utility not found in 'PATH'. $xc_msg_abrt" >&2 exit 1 ;; esac ]) dnl _XC_CFG_PRE_BASIC_CHK_UTIL_WC dnl ------------------------------------------------- dnl Private macro. dnl dnl Emits shell code that verifies that 'wc' utility dnl is found within 'PATH', otherwise aborts execution. AC_DEFUN([_XC_CFG_PRE_BASIC_CHK_UTIL_WC], [dnl AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_TR])dnl # # Verify that 'wc' utility is found within 'PATH', otherwise abort. # xc_tst_str='unknown unknown unknown unknown' xc_tst_str=`echo "$xc_tst_str" 2>/dev/null \ | wc -w 2>/dev/null | tr -d "$xc_space$xc_tab" 2>/dev/null` case "x$xc_tst_str" in @%:@ (( x4) : ;; *) echo "$xc_msg_err 'wc' utility not found in 'PATH'. $xc_msg_abrt" >&2 exit 1 ;; esac ]) dnl _XC_CFG_PRE_BASIC_CHK_UTIL_CAT dnl ------------------------------------------------- dnl Private macro. dnl dnl Emits shell code that verifies that 'cat' utility dnl is found within 'PATH', otherwise aborts execution. AC_DEFUN([_XC_CFG_PRE_BASIC_CHK_UTIL_CAT], [dnl AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_WC])dnl # # Verify that 'cat' utility is found within 'PATH', otherwise abort. # xc_tst_str='unknown' xc_tst_str=`cat <<_EOT 2>/dev/null \ | wc -l 2>/dev/null | tr -d "$xc_space$xc_tab" 2>/dev/null unknown unknown unknown _EOT` case "x$xc_tst_str" in @%:@ (( x3) : ;; *) echo "$xc_msg_err 'cat' utility not found in 'PATH'. $xc_msg_abrt" >&2 exit 1 ;; esac ]) dnl _XC_CFG_PRE_CHECK_PATH_SEPARATOR dnl ------------------------------------------------- dnl Private macro. dnl dnl Emits shell code that computes the path separator dnl and stores the result in 'PATH_SEPARATOR', unless dnl the user has already set it with a non-empty value. dnl dnl This path separator is the symbol used to separate dnl or diferentiate paths inside the 'PATH' environment dnl variable. dnl dnl Non-empty user provided 'PATH_SEPARATOR' always dnl overrides the auto-detected one. AC_DEFUN([_XC_CFG_PRE_CHECK_PATH_SEPARATOR], [dnl AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_CMD_EXPR])dnl # # Auto-detect and set 'PATH_SEPARATOR', unless it is already non-empty set. # # Directory count in 'PATH' when using a colon separator. xc_tst_dirs_col='x' xc_tst_prev_IFS=$IFS; IFS=':' for xc_tst_dir in $PATH; do IFS=$xc_tst_prev_IFS xc_tst_dirs_col="x$xc_tst_dirs_col" done IFS=$xc_tst_prev_IFS xc_tst_dirs_col=`expr "$xc_tst_dirs_col" : '.*'` # Directory count in 'PATH' when using a semicolon separator. xc_tst_dirs_sem='x' xc_tst_prev_IFS=$IFS; IFS=';' for xc_tst_dir in $PATH; do IFS=$xc_tst_prev_IFS xc_tst_dirs_sem="x$xc_tst_dirs_sem" done IFS=$xc_tst_prev_IFS xc_tst_dirs_sem=`expr "$xc_tst_dirs_sem" : '.*'` if test $xc_tst_dirs_sem -eq $xc_tst_dirs_col; then # When both counting methods give the same result we do not want to # chose one over the other, and consider auto-detection not possible. if test -z "$PATH_SEPARATOR"; then # Stop dead until user provides 'PATH_SEPARATOR' definition. echo "$xc_msg_err 'PATH_SEPARATOR' variable not set. $xc_msg_abrt" >&2 exit 1 fi else # Separator with the greater directory count is the auto-detected one. if test $xc_tst_dirs_sem -gt $xc_tst_dirs_col; then xc_tst_auto_separator=';' else xc_tst_auto_separator=':' fi if test -z "$PATH_SEPARATOR"; then # Simply use the auto-detected one when not already set. PATH_SEPARATOR=$xc_tst_auto_separator elif test "x$PATH_SEPARATOR" != "x$xc_tst_auto_separator"; then echo "$xc_msg_warn 'PATH_SEPARATOR' does not match auto-detected one." >&2 fi fi xc_PATH_SEPARATOR=$PATH_SEPARATOR AC_SUBST([PATH_SEPARATOR])dnl ]) dnl _XC_CFG_PRE_POSTLUDE dnl ------------------------------------------------- dnl Private macro. AC_DEFUN([_XC_CFG_PRE_POSTLUDE], [dnl AC_REQUIRE([_XC_CFG_PRE_PREAMBLE])dnl AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_CMD_ECHO])dnl AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_CMD_TEST])dnl AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_VAR_PATH])dnl AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_CMD_EXPR])dnl AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_SED])dnl AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_GREP])dnl AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_TR])dnl AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_WC])dnl AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_CAT])dnl AC_REQUIRE([_XC_CFG_PRE_CHECK_PATH_SEPARATOR])dnl dnl xc_configure_preamble_result='yes' ]) dnl XC_CONFIGURE_PREAMBLE dnl ------------------------------------------------- dnl Public macro. dnl dnl This macro emits shell code which does some dnl very basic checks related with the availability dnl of some commands and utilities needed to allow dnl configure script bootstrapping itself when using dnl these to figure out other settings. Also emits dnl code that performs PATH_SEPARATOR auto-detection dnl and sets its value unless it is already set with dnl a non-empty value. dnl dnl These basic checks are intended to be placed and dnl executed as early as possible in the resulting dnl configure script, and as such these must be pure dnl and portable shell code. dnl dnl This macro may be used directly, or indirectly dnl when using other macros that AC_REQUIRE it such dnl as XC_CHECK_PATH_SEPARATOR. dnl dnl Currently the mechanism used to ensure that this dnl macro expands early enough in generated configure dnl script is making it override autoconf and libtool dnl PATH_SEPARATOR check. AC_DEFUN([XC_CONFIGURE_PREAMBLE], [dnl AC_PREREQ([2.50])dnl dnl AC_BEFORE([$0],[_XC_CFG_PRE_PREAMBLE])dnl AC_BEFORE([$0],[_XC_CFG_PRE_BASIC_CHK_CMD_ECHO])dnl AC_BEFORE([$0],[_XC_CFG_PRE_BASIC_CHK_CMD_TEST])dnl AC_BEFORE([$0],[_XC_CFG_PRE_BASIC_CHK_VAR_PATH])dnl AC_BEFORE([$0],[_XC_CFG_PRE_BASIC_CHK_CMD_EXPR])dnl AC_BEFORE([$0],[_XC_CFG_PRE_BASIC_CHK_UTIL_SED])dnl AC_BEFORE([$0],[_XC_CFG_PRE_BASIC_CHK_UTIL_GREP])dnl AC_BEFORE([$0],[_XC_CFG_PRE_BASIC_CHK_UTIL_TR])dnl AC_BEFORE([$0],[_XC_CFG_PRE_BASIC_CHK_UTIL_WC])dnl AC_BEFORE([$0],[_XC_CFG_PRE_BASIC_CHK_UTIL_CAT])dnl AC_BEFORE([$0],[_XC_CFG_PRE_CHECK_PATH_SEPARATOR])dnl AC_BEFORE([$0],[_XC_CFG_PRE_POSTLUDE])dnl dnl AC_BEFORE([$0],[AC_CHECK_TOOL])dnl AC_BEFORE([$0],[AC_CHECK_PROG])dnl AC_BEFORE([$0],[AC_CHECK_TOOLS])dnl AC_BEFORE([$0],[AC_CHECK_PROGS])dnl dnl AC_BEFORE([$0],[AC_PATH_TOOL])dnl AC_BEFORE([$0],[AC_PATH_PROG])dnl AC_BEFORE([$0],[AC_PATH_PROGS])dnl dnl AC_BEFORE([$0],[AC_PROG_SED])dnl AC_BEFORE([$0],[AC_PROG_GREP])dnl AC_BEFORE([$0],[AC_PROG_LN_S])dnl AC_BEFORE([$0],[AC_PROG_MKDIR_P])dnl AC_BEFORE([$0],[AC_PROG_INSTALL])dnl AC_BEFORE([$0],[AC_PROG_MAKE_SET])dnl AC_BEFORE([$0],[AC_PROG_LIBTOOL])dnl dnl AC_BEFORE([$0],[LT_INIT])dnl AC_BEFORE([$0],[AM_INIT_AUTOMAKE])dnl AC_BEFORE([$0],[AC_LIBTOOL_WIN32_DLL])dnl dnl AC_REQUIRE([_XC_CFG_PRE_PREAMBLE])dnl AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_CMD_ECHO])dnl AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_CMD_TEST])dnl AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_VAR_PATH])dnl AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_CMD_EXPR])dnl AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_SED])dnl AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_GREP])dnl AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_TR])dnl AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_WC])dnl AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_CAT])dnl AC_REQUIRE([_XC_CFG_PRE_CHECK_PATH_SEPARATOR])dnl AC_REQUIRE([_XC_CFG_PRE_POSTLUDE])dnl dnl m4_pattern_forbid([^_*XC])dnl m4_define([$0],[])dnl ]) dnl Override autoconf and libtool PATH_SEPARATOR check dnl ------------------------------------------------- dnl Macros overriding. dnl dnl This is done to ensure that the same check is dnl used across different autoconf versions and to dnl allow expansion of XC_CONFIGURE_PREAMBLE macro dnl early enough in the generated configure script. dnl dnl Override when using autoconf 2.53 and newer. dnl m4_ifdef([_AS_PATH_SEPARATOR_PREPARE], [dnl m4_undefine([_AS_PATH_SEPARATOR_PREPARE])dnl m4_defun([_AS_PATH_SEPARATOR_PREPARE], [dnl AC_REQUIRE([XC_CONFIGURE_PREAMBLE])dnl m4_define([$0],[])dnl ])dnl ]) dnl dnl Override when using autoconf 2.50 to 2.52 dnl m4_ifdef([_AC_INIT_PREPARE_FS_SEPARATORS], [dnl m4_undefine([_AC_INIT_PREPARE_FS_SEPARATORS])dnl m4_defun([_AC_INIT_PREPARE_FS_SEPARATORS], [dnl AC_REQUIRE([XC_CONFIGURE_PREAMBLE])dnl ac_path_separator=$PATH_SEPARATOR m4_define([$0],[])dnl ])dnl ]) dnl dnl Override when using libtool 1.4.2 dnl m4_ifdef([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR], [dnl m4_undefine([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR])dnl m4_defun([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR], [dnl AC_REQUIRE([XC_CONFIGURE_PREAMBLE])dnl lt_cv_sys_path_separator=$PATH_SEPARATOR m4_define([$0],[])dnl ])dnl ]) dnl XC_CHECK_PATH_SEPARATOR dnl ------------------------------------------------- dnl Public macro. dnl dnl Usage of this macro ensures that generated configure dnl script uses the same PATH_SEPARATOR check irrespective dnl of autoconf or libtool version being used to generate dnl configure script. dnl dnl Emits shell code that computes the path separator dnl and stores the result in 'PATH_SEPARATOR', unless dnl the user has already set it with a non-empty value. dnl dnl This path separator is the symbol used to separate dnl or diferentiate paths inside the 'PATH' environment dnl variable. dnl dnl Non-empty user provided 'PATH_SEPARATOR' always dnl overrides the auto-detected one. dnl dnl Strictly speaking the check is done in two steps. The dnl first, which does the actual check, takes place in dnl XC_CONFIGURE_PREAMBLE macro and happens very early in dnl generated configure script. The second one shows and dnl logs the result of the check into config.log at a later dnl configure stage. Placement of this second stage in dnl generated configure script will be done where first dnl direct or indirect usage of this macro happens. AC_DEFUN([XC_CHECK_PATH_SEPARATOR], [dnl AC_PREREQ([2.50])dnl dnl AC_BEFORE([$0],[AC_CHECK_TOOL])dnl AC_BEFORE([$0],[AC_CHECK_PROG])dnl AC_BEFORE([$0],[AC_CHECK_TOOLS])dnl AC_BEFORE([$0],[AC_CHECK_PROGS])dnl dnl AC_BEFORE([$0],[AC_PATH_TOOL])dnl AC_BEFORE([$0],[AC_PATH_PROG])dnl AC_BEFORE([$0],[AC_PATH_PROGS])dnl dnl AC_BEFORE([$0],[AC_PROG_SED])dnl AC_BEFORE([$0],[AC_PROG_GREP])dnl AC_BEFORE([$0],[AC_PROG_LN_S])dnl AC_BEFORE([$0],[AC_PROG_MKDIR_P])dnl AC_BEFORE([$0],[AC_PROG_INSTALL])dnl AC_BEFORE([$0],[AC_PROG_MAKE_SET])dnl AC_BEFORE([$0],[AC_PROG_LIBTOOL])dnl dnl AC_BEFORE([$0],[LT_INIT])dnl AC_BEFORE([$0],[AM_INIT_AUTOMAKE])dnl AC_BEFORE([$0],[AC_LIBTOOL_WIN32_DLL])dnl dnl AC_REQUIRE([XC_CONFIGURE_PREAMBLE])dnl dnl # # Check that 'XC_CONFIGURE_PREAMBLE' has already run. # if test -z "$xc_configure_preamble_result"; then AC_MSG_ERROR([xc_configure_preamble_result not set (internal problem)]) fi # # Check that 'PATH_SEPARATOR' has already been set. # if test -z "$xc_PATH_SEPARATOR"; then AC_MSG_ERROR([xc_PATH_SEPARATOR not set (internal problem)]) fi if test -z "$PATH_SEPARATOR"; then AC_MSG_ERROR([PATH_SEPARATOR not set (internal or config.site problem)]) fi AC_MSG_CHECKING([for path separator]) AC_MSG_RESULT([$PATH_SEPARATOR]) if test "x$PATH_SEPARATOR" != "x$xc_PATH_SEPARATOR"; then AC_MSG_CHECKING([for initial path separator]) AC_MSG_RESULT([$xc_PATH_SEPARATOR]) AC_MSG_ERROR([path separator mismatch (internal or config.site problem)]) fi dnl m4_pattern_forbid([^_*XC])dnl m4_define([$0],[])dnl ]) ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/maketgz0000755000175100001770000000375600000000000017503 0ustar00runnerdocker00000000000000#!/usr/bin/env perl $version = $ARGV[0]; if($version eq "") { print "Enter version number!\n"; exit; } if(!-f "include/ares.h") { print "run this script in the ares source root dir\n"; exit; } my ($major, $minor, $patch)=split(/\./, $version); $major += 0; $minor += 0; $patch += 0; open(VER, "include/ares_version.h.dist"); while() { $_ =~ s/^\#define ARES_VERSION_MAJOR .*/\#define ARES_VERSION_MAJOR $major/; $_ =~ s/^\#define ARES_VERSION_MINOR .*/\#define ARES_VERSION_MINOR $minor/; $_ =~ s/^\#define ARES_VERSION_PATCH .*/\#define ARES_VERSION_PATCH $patch/; $_ =~ s/^\#define ARES_VERSION_STR .*/\#define ARES_VERSION_STR \"$version\"/; print NEWV $_; } close(VER); close(NEWV); print "include/ares_version.h.dist created\n"; if(!-f "configure") { print "running buildconf\n"; `./buildconf`; } print "adding $version in the configure.ac file\n"; `sed -e 's/AC_INIT.*/AC_INIT([c-ares], [$version],/' < configure.ac > configure.ac.dist`; print "adding $version in the CMakeLists.txt file\n"; `sed -e 's/SET.*CARES_VERSION.*/SET (CARES_VERSION "$version")/' < CMakeLists.txt > CMakeLists.txt.dist && rm -f CMakeLists.txt && mv CMakeLists.txt.dist CMakeLists.txt`; # now make a new configure script with this print "makes a new configure script\n"; `autoconf configure.ac.dist >configure`; # now run this new configure to get a fine makefile print "running configure\n"; `./configure`; print "produce CHANGES\n"; `git log --pretty=fuller --no-color --date=short --decorate=full -1000 | ./git2changes.pl > CHANGES.dist`; # now make the actual tarball print "running make dist\n"; `make dist VERSION=$version`; # remove temporay sourced man pages `make -s clean-sourced-manpages`; print "removing temporary configure.ac file\n"; `rm configure.ac.dist`; print "removing temporary ares_version.h file\n"; `rm include/ares_version.h.dist`; print "NOTE: now tag this release!\n"; ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/msvc_ver.inc0000644000175100001770000000124600000000000020422 0ustar00runnerdocker00000000000000# ----------------------------------------------- # Detect NMAKE version deducing old MSVC versions # ----------------------------------------------- !IFNDEF _NMAKE_VER ! MESSAGE Macro _NMAKE_VER not defined. ! MESSAGE Use MSVC's NMAKE to process this makefile. ! ERROR See previous message. !ENDIF !IF "$(_NMAKE_VER)" == "6.00.8168.0" CC_VERS_NUM = 60 !ELSEIF "$(_NMAKE_VER)" == "6.00.9782.0" CC_VERS_NUM = 60 !ELSEIF "$(_NMAKE_VER)" == "7.00.8882" CC_VERS_NUM = 70 !ELSEIF "$(_NMAKE_VER)" == "7.00.9466" CC_VERS_NUM = 70 !ELSEIF "$(_NMAKE_VER)" == "7.00.9955" CC_VERS_NUM = 70 !ELSE # Pick an arbitrary bigger number for all later versions CC_VERS_NUM = 199 !ENDIF ././@PaxHeader0000000000000000000000000000003300000000000011451 xustar000000000000000027 mtime=1696604226.991415 pycares-4.4.0/deps/c-ares/src/0000755000175100001770000000000000000000000016667 5ustar00runnerdocker00000000000000././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/CMakeLists.txt0000644000175100001770000000006000000000000021423 0ustar00runnerdocker00000000000000ADD_SUBDIRECTORY (lib) ADD_SUBDIRECTORY (tools) ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/Makefile.am0000644000175100001770000000005400000000000020722 0ustar00runnerdocker00000000000000EXTRA_DIST=CMakeLists.txt SUBDIRS=lib tools ././@PaxHeader0000000000000000000000000000003400000000000011452 xustar000000000000000028 mtime=1696604226.9994152 pycares-4.4.0/deps/c-ares/src/lib/0000755000175100001770000000000000000000000017435 5ustar00runnerdocker00000000000000././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/CMakeLists.txt0000644000175100001770000001010500000000000022172 0ustar00runnerdocker00000000000000 # Transform Makefile.inc transform_makefile_inc("Makefile.inc" "${PROJECT_BINARY_DIR}/src/lib/Makefile.inc.cmake") include(${PROJECT_BINARY_DIR}/src/lib/Makefile.inc.cmake) # Write ares_config.h configuration file. This is used only for the build. CONFIGURE_FILE (ares_config.h.cmake ${PROJECT_BINARY_DIR}/ares_config.h) # Build the dynamic/shared library IF (CARES_SHARED) ADD_LIBRARY (${PROJECT_NAME} SHARED ${CSOURCES}) # Convert CARES_LIB_VERSIONINFO libtool version format into VERSION and SOVERSION # Convert from ":" separated into CMake list format using ";" STRING (REPLACE ":" ";" CARES_LIB_VERSIONINFO ${CARES_LIB_VERSIONINFO}) LIST (GET CARES_LIB_VERSIONINFO 0 CARES_LIB_VERSION_CURRENT) LIST (GET CARES_LIB_VERSIONINFO 1 CARES_LIB_VERSION_REVISION) LIST (GET CARES_LIB_VERSIONINFO 2 CARES_LIB_VERSION_AGE) MATH (EXPR CARES_LIB_VERSION_MAJOR "${CARES_LIB_VERSION_CURRENT} - ${CARES_LIB_VERSION_AGE}") SET (CARES_LIB_VERSION_MINOR "${CARES_LIB_VERSION_AGE}") SET (CARES_LIB_VERSION_RELEASE "${CARES_LIB_VERSION_REVISION}") SET_TARGET_PROPERTIES (${PROJECT_NAME} PROPERTIES EXPORT_NAME cares OUTPUT_NAME cares COMPILE_PDB_NAME cares COMPILE_PDB_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} SOVERSION ${CARES_LIB_VERSION_MAJOR} VERSION "${CARES_LIB_VERSION_MAJOR}.${CARES_LIB_VERSION_MINOR}.${CARES_LIB_VERSION_RELEASE}" ) TARGET_INCLUDE_DIRECTORIES (${PROJECT_NAME} PUBLIC "$" "$" "$" "$" PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}" ) TARGET_COMPILE_DEFINITIONS (${PROJECT_NAME} PRIVATE HAVE_CONFIG_H=1 CARES_BUILDING_LIBRARY) TARGET_LINK_LIBRARIES (${PROJECT_NAME} PUBLIC ${CARES_DEPENDENT_LIBS}) IF (CARES_INSTALL) INSTALL (TARGETS ${PROJECT_NAME} EXPORT ${PROJECT_NAME}-targets COMPONENT Library ${TARGETS_INST_DEST} ) INSTALL(FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/cares.pdb DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT Library OPTIONAL ) ENDIF () SET (STATIC_SUFFIX "_static") # For chain building: add alias targets that look like import libs that would be returned by find_package(c-ares). ADD_LIBRARY (${PROJECT_NAME}::cares_shared ALIAS ${PROJECT_NAME}) ADD_LIBRARY (${PROJECT_NAME}::cares ALIAS ${PROJECT_NAME}) ENDIF () # Build the static library IF (CARES_STATIC) SET (LIBNAME ${PROJECT_NAME}${STATIC_SUFFIX}) ADD_LIBRARY (${LIBNAME} STATIC ${CSOURCES}) SET_TARGET_PROPERTIES (${LIBNAME} PROPERTIES EXPORT_NAME cares${STATIC_SUFFIX} OUTPUT_NAME cares${STATIC_SUFFIX} COMPILE_PDB_NAME cares${STATIC_SUFFIX} COMPILE_PDB_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ) IF (CARES_STATIC_PIC) SET_TARGET_PROPERTIES (${LIBNAME} PROPERTIES POSITION_INDEPENDENT_CODE True) ENDIF () TARGET_INCLUDE_DIRECTORIES (${LIBNAME} PUBLIC "$" "$" "$" "$" PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}" ) TARGET_COMPILE_DEFINITIONS (${LIBNAME} PUBLIC CARES_STATICLIB PRIVATE HAVE_CONFIG_H=1 ) TARGET_LINK_LIBRARIES (${LIBNAME} PUBLIC ${CARES_DEPENDENT_LIBS}) IF (CARES_INSTALL) INSTALL (TARGETS ${LIBNAME} EXPORT ${PROJECT_NAME}-targets COMPONENT Devel ${TARGETS_INST_DEST} ) INSTALL(FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/cares${STATIC_SUFFIX}.pdb DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT Library OPTIONAL ) ENDIF () # For chain building: add alias targets that look like import libs that would be returned by find_package(c-ares). ADD_LIBRARY (${PROJECT_NAME}::cares_static ALIAS ${LIBNAME}) IF (NOT TARGET ${PROJECT_NAME}::cares) # Only use static for the generic alias if shared lib wasn't built. ADD_LIBRARY (${PROJECT_NAME}::cares ALIAS ${LIBNAME}) ENDIF () ENDIF () ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/Makefile.am0000644000175100001770000000404500000000000021474 0ustar00runnerdocker00000000000000AUTOMAKE_OPTIONS = foreign subdir-objects nostdinc 1.9.6 ACLOCAL_AMFLAGS = -I m4 --install # Specify our include paths here, and do it relative to $(top_srcdir) and # $(top_builddir), to ensure that these paths which belong to the library # being currently built and tested are searched before the library which # might possibly already be installed in the system. AM_CPPFLAGS = -I$(top_builddir)/include \ -I$(top_builddir)/src/lib \ -I$(top_srcdir)/include \ -I$(top_srcdir)/src/lib lib_LTLIBRARIES = libcares.la man_MANS = $(MANPAGES) # adig and ahost are just sample programs and thus not mentioned with the # regular sources and headers EXTRA_DIST = Makefile.inc config-win32.h CMakeLists.txt \ ares_config.h.in ares_config.h.cmake cares.rc \ $(CSOURCES) $(HHEADERS) config-dos.h DISTCLEANFILES = ares_config.h DIST_SUBDIRS = AM_LDFLAGS = libcares_la_LDFLAGS_EXTRA = if CARES_LT_SHLIB_USE_VERSION_INFO libcares_la_LDFLAGS_EXTRA += -version-info @CARES_VERSION_INFO@ endif if CARES_LT_SHLIB_USE_NO_UNDEFINED libcares_la_LDFLAGS_EXTRA += -no-undefined endif if CARES_LT_SHLIB_USE_MIMPURE_TEXT libcares_la_LDFLAGS_EXTRA += -mimpure-text endif libcares_la_LDFLAGS = $(AM_LDFLAGS) $(libcares_la_LDFLAGS_EXTRA) # Add -Werror if defined CFLAGS += @CARES_CFLAG_EXTRAS@ if USE_CPPFLAG_CARES_STATICLIB AM_CPPFLAGS += $(CPPFLAG_CARES_STATICLIB) endif libcares_la_CFLAGS_EXTRA = libcares_la_CPPFLAGS_EXTRA = -DCARES_BUILDING_LIBRARY if DOING_CARES_SYMBOL_HIDING libcares_la_CFLAGS_EXTRA += $(CFLAG_CARES_SYMBOL_HIDING) libcares_la_CPPFLAGS_EXTRA += -DCARES_SYMBOL_HIDING endif include $(top_srcdir)/aminclude_static.am libcares_la_LIBS = $(CODE_COVERAGE_LIBS) libcares_la_CFLAGS_EXTRA += $(CODE_COVERAGE_CFLAGS) libcares_la_CPPFLAGS_EXTRA += $(CODE_COVERAGE_CPPFLAGS) libcares_la_CFLAGS = $(AM_CFLAGS) $(libcares_la_CFLAGS_EXTRA) libcares_la_CPPFLAGS = $(AM_CPPFLAGS) $(libcares_la_CPPFLAGS_EXTRA) # Makefile.inc provides the CSOURCES and HHEADERS defines include Makefile.inc libcares_la_SOURCES = $(CSOURCES) $(HHEADERS) ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/Makefile.inc0000644000175100001770000000345400000000000021653 0ustar00runnerdocker00000000000000 CSOURCES = ares__addrinfo2hostent.c \ ares__addrinfo_localhost.c \ ares__close_sockets.c \ ares__get_hostent.c \ ares__parse_into_addrinfo.c \ ares__readaddrinfo.c \ ares__sortaddrinfo.c \ ares__read_line.c \ ares__timeval.c \ ares_android.c \ ares_cancel.c \ ares_data.c \ ares_destroy.c \ ares_expand_name.c \ ares_expand_string.c \ ares_fds.c \ ares_free_hostent.c \ ares_free_string.c \ ares_freeaddrinfo.c \ ares_getaddrinfo.c \ ares_getenv.c \ ares_gethostbyaddr.c \ ares_gethostbyname.c \ ares_getnameinfo.c \ ares_getsock.c \ ares_init.c \ ares_library_init.c \ ares_llist.c \ ares_mkquery.c \ ares_create_query.c \ ares_nowarn.c \ ares_options.c \ ares_parse_a_reply.c \ ares_parse_aaaa_reply.c \ ares_parse_caa_reply.c \ ares_parse_mx_reply.c \ ares_parse_naptr_reply.c \ ares_parse_ns_reply.c \ ares_parse_ptr_reply.c \ ares_parse_soa_reply.c \ ares_parse_srv_reply.c \ ares_parse_txt_reply.c \ ares_parse_uri_reply.c \ ares_platform.c \ ares_process.c \ ares_query.c \ ares_search.c \ ares_send.c \ ares_strcasecmp.c \ ares_strdup.c \ ares_strerror.c \ ares_strsplit.c \ ares_timeout.c \ ares_version.c \ ares_writev.c \ bitncmp.c \ inet_net_pton.c \ inet_ntop.c \ windows_port.c HHEADERS = ares_android.h \ ares_data.h \ ares_getenv.h \ ares_inet_net_pton.h \ ares_iphlpapi.h \ ares_ipv6.h \ ares_library_init.h \ ares_llist.h \ ares_nowarn.h \ ares_platform.h \ ares_private.h \ ares_strcasecmp.h \ ares_strdup.h \ ares_strsplit.h \ ares_writev.h \ bitncmp.h \ ares_setup.h \ setup_once.h ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares__addrinfo2hostent.c0000644000175100001770000001520100000000000024226 0ustar00runnerdocker00000000000000/* Copyright 1998 by the Massachusetts Institute of Technology. * Copyright 2005 Dominick Meglio * Copyright (C) 2019 by Andrew Selivanov * Copyright (C) 2021 by Brad House * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ #include "ares_setup.h" #ifdef HAVE_NETINET_IN_H # include #endif #ifdef HAVE_NETDB_H # include #endif #ifdef HAVE_ARPA_INET_H # include #endif #include "ares_nameser.h" #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_LIMITS_H # include #endif #include "ares.h" #include "ares_dns.h" #include "ares_inet_net_pton.h" #include "ares_private.h" int ares__addrinfo2hostent(const struct ares_addrinfo *ai, int family, struct hostent **host) { struct ares_addrinfo_node *next; struct ares_addrinfo_cname *next_cname; char **aliases = NULL; char *addrs = NULL; int naliases = 0, naddrs = 0, alias = 0, i; if (ai == NULL || host == NULL) return ARES_EBADQUERY; *host = ares_malloc(sizeof(**host)); if (!(*host)) { goto enomem; } memset(*host, 0, sizeof(**host)); /* Use the first node of the response as the family, since hostent can only * represent one family. We assume getaddrinfo() returned a sorted list if * the user requested AF_UNSPEC. */ if (family == AF_UNSPEC && ai->nodes) family = ai->nodes->ai_family; next = ai->nodes; while (next) { if(next->ai_family == family) { ++naddrs; } next = next->ai_next; } next_cname = ai->cnames; while (next_cname) { if(next_cname->alias) ++naliases; next_cname = next_cname->next; } aliases = ares_malloc((naliases + 1) * sizeof(char *)); if (!aliases) { goto enomem; } (*host)->h_aliases = aliases; memset(aliases, 0, (naliases + 1) * sizeof(char *)); if (naliases) { next_cname = ai->cnames; while (next_cname) { if(next_cname->alias) { aliases[alias] = ares_strdup(next_cname->alias); if (!aliases[alias]) { goto enomem; } alias++; } next_cname = next_cname->next; } } (*host)->h_addr_list = ares_malloc((naddrs + 1) * sizeof(char *)); if (!(*host)->h_addr_list) { goto enomem; } memset((*host)->h_addr_list, 0, (naddrs + 1) * sizeof(char *)); if (ai->cnames) { (*host)->h_name = ares_strdup(ai->cnames->name); if ((*host)->h_name == NULL && ai->cnames->name) { goto enomem; } } else { (*host)->h_name = ares_strdup(ai->name); if ((*host)->h_name == NULL && ai->name) { goto enomem; } } (*host)->h_addrtype = family; (*host)->h_length = (family == AF_INET)? sizeof(struct in_addr):sizeof(struct ares_in6_addr); if (naddrs) { addrs = ares_malloc(naddrs * (*host)->h_length); if (!addrs) { goto enomem; } i = 0; next = ai->nodes; while (next) { if(next->ai_family == family) { (*host)->h_addr_list[i] = addrs + (i * (*host)->h_length); if (family == AF_INET6) { memcpy((*host)->h_addr_list[i], &(CARES_INADDR_CAST(struct sockaddr_in6 *, next->ai_addr)->sin6_addr), (*host)->h_length); } else { memcpy((*host)->h_addr_list[i], &(CARES_INADDR_CAST(struct sockaddr_in *, next->ai_addr)->sin_addr), (*host)->h_length); } ++i; } next = next->ai_next; } if (i == 0) { ares_free(addrs); } } if (naddrs == 0 && naliases == 0) { ares_free_hostent(*host); *host = NULL; return ARES_ENODATA; } return ARES_SUCCESS; enomem: ares_free_hostent(*host); *host = NULL; return ARES_ENOMEM; } int ares__addrinfo2addrttl(const struct ares_addrinfo *ai, int family, int req_naddrttls, struct ares_addrttl *addrttls, struct ares_addr6ttl *addr6ttls, int *naddrttls) { struct ares_addrinfo_node *next; struct ares_addrinfo_cname *next_cname; int cname_ttl = INT_MAX; if (family != AF_INET && family != AF_INET6) return ARES_EBADQUERY; if (ai == NULL || naddrttls == NULL) return ARES_EBADQUERY; if (family == AF_INET && addrttls == NULL) return ARES_EBADQUERY; if (family == AF_INET6 && addr6ttls == NULL) return ARES_EBADQUERY; if (req_naddrttls == 0) return ARES_EBADQUERY; *naddrttls = 0; next_cname = ai->cnames; while (next_cname) { if(next_cname->ttl < cname_ttl) cname_ttl = next_cname->ttl; next_cname = next_cname->next; } next = ai->nodes; while (next) { if(next->ai_family == family) { if (*naddrttls < req_naddrttls) { if (family == AF_INET6) { if(next->ai_ttl > cname_ttl) addr6ttls[*naddrttls].ttl = cname_ttl; else addr6ttls[*naddrttls].ttl = next->ai_ttl; memcpy(&addr6ttls[*naddrttls].ip6addr, &(CARES_INADDR_CAST(struct sockaddr_in6 *, next->ai_addr)->sin6_addr), sizeof(struct ares_in6_addr)); } else { if(next->ai_ttl > cname_ttl) addrttls[*naddrttls].ttl = cname_ttl; else addrttls[*naddrttls].ttl = next->ai_ttl; memcpy(&addrttls[*naddrttls].ipaddr, &(CARES_INADDR_CAST(struct sockaddr_in *, next->ai_addr)->sin_addr), sizeof(struct in_addr)); } (*naddrttls)++; } } next = next->ai_next; } return ARES_SUCCESS; } ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares__addrinfo_localhost.c0000644000175100001770000001356200000000000024617 0ustar00runnerdocker00000000000000/* Copyright (C) 2021 * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ #include "ares_setup.h" #ifdef HAVE_NETINET_IN_H # include #endif #ifdef HAVE_NETDB_H # include #endif #ifdef HAVE_ARPA_INET_H # include #endif #if defined(_WIN32) && defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x0600 #include #include #endif #include "ares.h" #include "ares_inet_net_pton.h" #include "ares_nowarn.h" #include "ares_private.h" int ares_append_ai_node(int aftype, unsigned short port, int ttl, const void *adata, struct ares_addrinfo_node **nodes) { struct ares_addrinfo_node *node; node = ares__append_addrinfo_node(nodes); if (!node) { return ARES_ENOMEM; } memset(node, 0, sizeof(*node)); if (aftype == AF_INET) { struct sockaddr_in *sin = ares_malloc(sizeof(*sin)); if (!sin) { return ARES_ENOMEM; } memset(sin, 0, sizeof(*sin)); memcpy(&sin->sin_addr.s_addr, adata, sizeof(sin->sin_addr.s_addr)); sin->sin_family = AF_INET; sin->sin_port = htons(port); node->ai_addr = (struct sockaddr *)sin; node->ai_family = AF_INET; node->ai_addrlen = sizeof(*sin); node->ai_addr = (struct sockaddr *)sin; node->ai_ttl = ttl; } if (aftype == AF_INET6) { struct sockaddr_in6 *sin6 = ares_malloc(sizeof(*sin6)); if (!sin6) { return ARES_ENOMEM; } memset(sin6, 0, sizeof(*sin6)); memcpy(&sin6->sin6_addr.s6_addr, adata, sizeof(sin6->sin6_addr.s6_addr)); sin6->sin6_family = AF_INET6; sin6->sin6_port = htons(port); node->ai_addr = (struct sockaddr *)sin6; node->ai_family = AF_INET6; node->ai_addrlen = sizeof(*sin6); node->ai_addr = (struct sockaddr *)sin6; node->ai_ttl = ttl; } return ARES_SUCCESS; } static int ares__default_loopback_addrs(int aftype, unsigned short port, struct ares_addrinfo_node **nodes) { int status = ARES_SUCCESS; if (aftype == AF_UNSPEC || aftype == AF_INET6) { struct ares_in6_addr addr6; ares_inet_pton(AF_INET6, "::1", &addr6); status = ares_append_ai_node(AF_INET6, port, 0, &addr6, nodes); if (status != ARES_SUCCESS) { return status; } } if (aftype == AF_UNSPEC || aftype == AF_INET) { struct in_addr addr4; ares_inet_pton(AF_INET, "127.0.0.1", &addr4); status = ares_append_ai_node(AF_INET, port, 0, &addr4, nodes); if (status != ARES_SUCCESS) { return status; } } return status; } static int ares__system_loopback_addrs(int aftype, unsigned short port, struct ares_addrinfo_node **nodes) { #if defined(_WIN32) && defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x0600 PMIB_UNICASTIPADDRESS_TABLE table; unsigned int i; int status; *nodes = NULL; if (GetUnicastIpAddressTable(aftype, &table) != NO_ERROR) return ARES_ENOTFOUND; for (i=0; iNumEntries; i++) { if (table->Table[i].InterfaceLuid.Info.IfType != IF_TYPE_SOFTWARE_LOOPBACK) { continue; } if (table->Table[i].Address.si_family == AF_INET) { status = ares_append_ai_node(table->Table[i].Address.si_family, port, 0, &table->Table[i].Address.Ipv4.sin_addr, nodes); } else if (table->Table[i].Address.si_family == AF_INET6) { status = ares_append_ai_node(table->Table[i].Address.si_family, port, 0, &table->Table[i].Address.Ipv6.sin6_addr, nodes); } else { /* Ignore any others */ continue; } if (status != ARES_SUCCESS) { goto fail; } } if (*nodes == NULL) status = ARES_ENOTFOUND; fail: FreeMibTable(table); if (status != ARES_SUCCESS) { ares__freeaddrinfo_nodes(*nodes); *nodes = NULL; } return status; #else (void)aftype; (void)port; (void)nodes; /* Not supported on any other OS at this time */ return ARES_ENOTFOUND; #endif } int 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; int result; /* Validate family */ switch (hints->ai_family) { case AF_INET: case AF_INET6: case AF_UNSPEC: break; default: return ARES_EBADFAMILY; } ai->name = ares_strdup(name); if(!ai->name) { goto enomem; } result = ares__system_loopback_addrs(hints->ai_family, port, &nodes); if (result == ARES_ENOTFOUND) { result = ares__default_loopback_addrs(hints->ai_family, port, &nodes); } ares__addrinfo_cat_nodes(&ai->nodes, nodes); return result; enomem: ares__freeaddrinfo_nodes(nodes); ares_free(ai->name); ai->name = NULL; return ARES_ENOMEM; } ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares__close_sockets.c0000644000175100001770000000371400000000000023617 0ustar00runnerdocker00000000000000 /* Copyright 1998 by the Massachusetts Institute of Technology. * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ #include "ares_setup.h" #include "ares.h" #include "ares_private.h" void ares__close_sockets(ares_channel channel, struct server_state *server) { struct send_request *sendreq; /* Free all pending output buffers. */ while (server->qhead) { /* Advance server->qhead; pull out query as we go. */ sendreq = server->qhead; server->qhead = sendreq->next; if (sendreq->data_storage != NULL) ares_free(sendreq->data_storage); ares_free(sendreq); } server->qtail = NULL; /* Reset any existing input buffer. */ if (server->tcp_buffer) ares_free(server->tcp_buffer); server->tcp_buffer = NULL; server->tcp_lenbuf_pos = 0; /* Reset brokenness */ server->is_broken = 0; /* Close the TCP and UDP sockets. */ if (server->tcp_socket != ARES_SOCKET_BAD) { SOCK_STATE_CALLBACK(channel, server->tcp_socket, 0, 0); ares__close_socket(channel, server->tcp_socket); server->tcp_socket = ARES_SOCKET_BAD; server->tcp_connection_generation = ++channel->tcp_connection_generation; } if (server->udp_socket != ARES_SOCKET_BAD) { SOCK_STATE_CALLBACK(channel, server->udp_socket, 0, 0); ares__close_socket(channel, server->udp_socket); server->udp_socket = ARES_SOCKET_BAD; } } ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares__get_hostent.c0000644000175100001770000001541300000000000023301 0ustar00runnerdocker00000000000000 /* Copyright 1998, 2011 by the Massachusetts Institute of Technology. * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ #include "ares_setup.h" #ifdef HAVE_NETINET_IN_H # include #endif #ifdef HAVE_NETDB_H # include #endif #ifdef HAVE_ARPA_INET_H # include #endif #include "ares.h" #include "ares_inet_net_pton.h" #include "ares_nowarn.h" #include "ares_private.h" int ares__get_hostent(FILE *fp, int family, struct hostent **host) { char *line = NULL, *p, *q, **alias; char *txtaddr, *txthost, *txtalias; int status; size_t addrlen, linesize, naliases; struct ares_addr addr; struct hostent *hostent = NULL; *host = NULL; /* Assume failure */ /* Validate family */ switch (family) { case AF_INET: case AF_INET6: case AF_UNSPEC: break; default: return ARES_EBADFAMILY; } while ((status = ares__read_line(fp, &line, &linesize)) == ARES_SUCCESS) { /* Trim line comment. */ p = line; while (*p && (*p != '#')) p++; *p = '\0'; /* Trim trailing whitespace. */ q = p - 1; while ((q >= line) && ISSPACE(*q)) q--; *++q = '\0'; /* Skip leading whitespace. */ p = line; while (*p && ISSPACE(*p)) p++; if (!*p) /* Ignore line if empty. */ continue; /* Pointer to start of IPv4 or IPv6 address part. */ txtaddr = p; /* Advance past address part. */ while (*p && !ISSPACE(*p)) p++; if (!*p) /* Ignore line if reached end of line. */ continue; /* Null terminate address part. */ *p = '\0'; /* Advance to host name */ p++; while (*p && ISSPACE(*p)) p++; if (!*p) /* Ignore line if reached end of line. */ continue; /* LCOV_EXCL_LINE: trailing whitespace already stripped */ /* Pointer to start of host name. */ txthost = p; /* Advance past host name. */ while (*p && !ISSPACE(*p)) p++; /* Pointer to start of first alias. */ txtalias = NULL; if (*p) { q = p + 1; while (*q && ISSPACE(*q)) q++; if (*q) txtalias = q; } /* Null terminate host name. */ *p = '\0'; /* find out number of aliases. */ naliases = 0; if (txtalias) { p = txtalias; while (*p) { while (*p && !ISSPACE(*p)) p++; while (*p && ISSPACE(*p)) p++; naliases++; } } /* Convert address string to network address for the requested family. */ addrlen = 0; addr.family = AF_UNSPEC; addr.addrV4.s_addr = INADDR_NONE; if ((family == AF_INET) || (family == AF_UNSPEC)) { if (ares_inet_pton(AF_INET, txtaddr, &addr.addrV4) > 0) { /* Actual network address family and length. */ addr.family = AF_INET; addrlen = sizeof(addr.addrV4); } } if ((family == AF_INET6) || ((family == AF_UNSPEC) && (!addrlen))) { if (ares_inet_pton(AF_INET6, txtaddr, &addr.addrV6) > 0) { /* Actual network address family and length. */ addr.family = AF_INET6; addrlen = sizeof(addr.addrV6); } } if (!addrlen) /* Ignore line if invalid address string for the requested family. */ continue; /* ** Actual address family possible values are AF_INET and AF_INET6 only. */ /* Allocate memory for the hostent structure. */ hostent = ares_malloc(sizeof(struct hostent)); if (!hostent) break; /* Initialize fields for out of memory condition. */ hostent->h_aliases = NULL; hostent->h_addr_list = NULL; /* Copy official host name. */ hostent->h_name = ares_strdup(txthost); if (!hostent->h_name) break; /* Copy network address. */ hostent->h_addr_list = ares_malloc(2 * sizeof(char *)); if (!hostent->h_addr_list) break; hostent->h_addr_list[1] = NULL; hostent->h_addr_list[0] = ares_malloc(addrlen); if (!hostent->h_addr_list[0]) break; if (addr.family == AF_INET) memcpy(hostent->h_addr_list[0], &addr.addrV4, sizeof(addr.addrV4)); else memcpy(hostent->h_addr_list[0], &addr.addrV6, sizeof(addr.addrV6)); /* Copy aliases. */ hostent->h_aliases = ares_malloc((naliases + 1) * sizeof(char *)); if (!hostent->h_aliases) break; alias = hostent->h_aliases; while (naliases) *(alias + naliases--) = NULL; *alias = NULL; while (txtalias) { p = txtalias; while (*p && !ISSPACE(*p)) p++; q = p; while (*q && ISSPACE(*q)) q++; *p = '\0'; if ((*alias = ares_strdup(txtalias)) == NULL) break; alias++; txtalias = *q ? q : NULL; } if (txtalias) /* Alias memory allocation failure. */ break; /* Copy actual network address family and length. */ hostent->h_addrtype = aresx_sitoss(addr.family); hostent->h_length = aresx_uztoss(addrlen); /* Free line buffer. */ ares_free(line); /* Return hostent successfully */ *host = hostent; return ARES_SUCCESS; } /* If allocated, free line buffer. */ if (line) ares_free(line); if (status == ARES_SUCCESS) { /* Memory allocation failure; clean up. */ if (hostent) { if (hostent->h_name) ares_free((char *) hostent->h_name); if (hostent->h_aliases) { for (alias = hostent->h_aliases; *alias; alias++) ares_free(*alias); ares_free(hostent->h_aliases); } if (hostent->h_addr_list) { if (hostent->h_addr_list[0]) ares_free(hostent->h_addr_list[0]); ares_free(hostent->h_addr_list); } ares_free(hostent); } return ARES_ENOMEM; } return status; } ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares__parse_into_addrinfo.c0000644000175100001770000001451700000000000024773 0ustar00runnerdocker00000000000000/* Copyright (C) 2019 by Andrew Selivanov * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ #include "ares_setup.h" #ifdef HAVE_NETINET_IN_H # include #endif #ifdef HAVE_NETDB_H # include #endif #ifdef HAVE_ARPA_INET_H # include #endif #include "ares_nameser.h" #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_LIMITS_H # include #endif #include "ares.h" #include "ares_dns.h" #include "ares_private.h" int ares__parse_into_addrinfo(const unsigned char *abuf, int alen, int cname_only_is_enodata, unsigned short port, struct ares_addrinfo *ai) { unsigned int qdcount, ancount; int status, i, rr_type, rr_class, rr_len, rr_ttl; int got_a = 0, got_aaaa = 0, got_cname = 0; long len; const unsigned char *aptr; char *question_hostname = NULL; char *hostname, *rr_name = NULL, *rr_data; struct ares_addrinfo_cname *cname, *cnames = NULL; struct ares_addrinfo_node *nodes = NULL; /* Give up if abuf doesn't have room for a header. */ if (alen < HFIXEDSZ) return ARES_EBADRESP; /* Fetch the question and answer count from the header. */ qdcount = DNS_HEADER_QDCOUNT(abuf); ancount = DNS_HEADER_ANCOUNT(abuf); if (qdcount != 1) return ARES_EBADRESP; /* Expand the name from the question, and skip past the question. */ aptr = abuf + HFIXEDSZ; status = ares__expand_name_for_response(aptr, abuf, alen, &question_hostname, &len, 0); if (status != ARES_SUCCESS) return status; if (aptr + len + QFIXEDSZ > abuf + alen) { status = ARES_EBADRESP; goto failed_stat; } hostname = question_hostname; aptr += len + QFIXEDSZ; /* Examine each answer resource record (RR) in turn. */ for (i = 0; i < (int)ancount; i++) { /* Decode the RR up to the data field. */ status = ares__expand_name_for_response(aptr, abuf, alen, &rr_name, &len, 0); if (status != ARES_SUCCESS) { rr_name = NULL; goto failed_stat; } aptr += len; if (aptr + RRFIXEDSZ > abuf + alen) { status = ARES_EBADRESP; goto failed_stat; } rr_type = DNS_RR_TYPE(aptr); rr_class = DNS_RR_CLASS(aptr); rr_len = DNS_RR_LEN(aptr); rr_ttl = DNS_RR_TTL(aptr); aptr += RRFIXEDSZ; if (aptr + rr_len > abuf + alen) { status = ARES_EBADRESP; goto failed_stat; } if (rr_class == C_IN && rr_type == T_A && rr_len == sizeof(struct in_addr) && strcasecmp(rr_name, hostname) == 0) { got_a = 1; if (aptr + sizeof(struct in_addr) > abuf + alen) { /* LCOV_EXCL_START: already checked above */ status = ARES_EBADRESP; goto failed_stat; } /* LCOV_EXCL_STOP */ status = ares_append_ai_node(AF_INET, port, rr_ttl, aptr, &nodes); if (status != ARES_SUCCESS) goto failed_stat; } else if (rr_class == C_IN && rr_type == T_AAAA && rr_len == sizeof(struct ares_in6_addr) && strcasecmp(rr_name, hostname) == 0) { got_aaaa = 1; if (aptr + sizeof(struct ares_in6_addr) > abuf + alen) { /* LCOV_EXCL_START: already checked above */ status = ARES_EBADRESP; goto failed_stat; } /* LCOV_EXCL_STOP */ status = ares_append_ai_node(AF_INET6, port, rr_ttl, aptr, &nodes); if (status != ARES_SUCCESS) goto failed_stat; } if (rr_class == C_IN && rr_type == T_CNAME) { got_cname = 1; status = ares__expand_name_for_response(aptr, abuf, alen, &rr_data, &len, 1); if (status != ARES_SUCCESS) { goto failed_stat; } /* Decode the RR data and replace the hostname with it. */ /* SA: Seems wrong as it introduses order dependency. */ hostname = rr_data; cname = ares__append_addrinfo_cname(&cnames); if (!cname) { status = ARES_ENOMEM; ares_free(rr_data); goto failed_stat; } cname->ttl = rr_ttl; cname->alias = rr_name; cname->name = rr_data; rr_name = NULL; } else { /* rr_name is only saved for cname */ ares_free(rr_name); rr_name = NULL; } aptr += rr_len; if (aptr > abuf + alen) { /* LCOV_EXCL_START: already checked above */ status = ARES_EBADRESP; goto failed_stat; } /* LCOV_EXCL_STOP */ } if (status == ARES_SUCCESS) { if (!got_a && !got_aaaa) { if (!got_cname || (got_cname && cname_only_is_enodata)) { status = ARES_ENODATA; goto failed_stat; } } /* save the question hostname as ai->name */ if (ai->name == NULL || strcasecmp(ai->name, question_hostname) != 0) { ares_free(ai->name); ai->name = ares_strdup(question_hostname); if (!ai->name) { status = ARES_ENOMEM; goto failed_stat; } } if (got_a || got_aaaa) { ares__addrinfo_cat_nodes(&ai->nodes, nodes); nodes = NULL; } if (got_cname) { ares__addrinfo_cat_cnames(&ai->cnames, cnames); cnames = NULL; } } ares_free(question_hostname); return status; failed_stat: ares_free(question_hostname); ares_free(rr_name); ares__freeaddrinfo_cnames(cnames); ares__freeaddrinfo_nodes(nodes); return status; } ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares__read_line.c0000644000175100001770000000422000000000000022672 0ustar00runnerdocker00000000000000 /* Copyright 1998 by the Massachusetts Institute of Technology. * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ #include "ares_setup.h" #include "ares.h" #include "ares_nowarn.h" #include "ares_private.h" /* This is an internal function. Its contract is to read a line from * a file into a dynamically allocated buffer, zeroing the trailing * newline if there is one. The calling routine may call * ares__read_line multiple times with the same buf and bufsize * pointers; *buf will be reallocated and *bufsize adjusted as * appropriate. The initial value of *buf should be NULL. After the * calling routine is done reading lines, it should free *buf. */ int ares__read_line(FILE *fp, char **buf, size_t *bufsize) { char *newbuf; size_t offset = 0; size_t len; if (*buf == NULL) { *buf = ares_malloc(128); if (!*buf) return ARES_ENOMEM; *bufsize = 128; } for (;;) { int bytestoread = aresx_uztosi(*bufsize - offset); if (!fgets(*buf + offset, bytestoread, fp)) return (offset != 0) ? 0 : (ferror(fp)) ? ARES_EFILE : ARES_EOF; len = offset + strlen(*buf + offset); if ((*buf)[len - 1] == '\n') { (*buf)[len - 1] = 0; break; } offset = len; if(len < *bufsize - 1) continue; /* Allocate more space. */ newbuf = ares_realloc(*buf, *bufsize * 2); if (!newbuf) { ares_free(*buf); *buf = NULL; return ARES_ENOMEM; } *buf = newbuf; *bufsize *= 2; } return ARES_SUCCESS; } ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares__readaddrinfo.c0000644000175100001770000001476300000000000023407 0ustar00runnerdocker00000000000000/* Copyright (C) 2019 by Andrew Selivanov * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ #include "ares_setup.h" #ifdef HAVE_NETINET_IN_H # include #endif #ifdef HAVE_NETDB_H # include #endif #ifdef HAVE_ARPA_INET_H # include #endif #include "ares.h" #include "ares_inet_net_pton.h" #include "ares_nowarn.h" #include "ares_private.h" #define MAX_ALIASES 40 int ares__readaddrinfo(FILE *fp, const char *name, unsigned short port, const struct ares_addrinfo_hints *hints, struct ares_addrinfo *ai) { char *line = NULL, *p, *q; char *txtaddr, *txthost, *txtalias; char *aliases[MAX_ALIASES]; unsigned int i, alias_count; int status = ARES_SUCCESS; size_t linesize; struct ares_addrinfo_cname *cname = NULL, *cnames = NULL; struct ares_addrinfo_node *nodes = NULL; int match_with_alias, match_with_canonical; int want_cname = hints->ai_flags & ARES_AI_CANONNAME; /* Validate family */ switch (hints->ai_family) { case AF_INET: case AF_INET6: case AF_UNSPEC: break; default: return ARES_EBADFAMILY; } ai->name = ares_strdup(name); if(!ai->name) { status = ARES_ENOMEM; goto fail; } while ((status = ares__read_line(fp, &line, &linesize)) == ARES_SUCCESS) { match_with_alias = 0; match_with_canonical = 0; alias_count = 0; /* Trim line comment. */ p = line; while (*p && (*p != '#')) p++; *p = '\0'; /* Trim trailing whitespace. */ q = p - 1; while ((q >= line) && ISSPACE(*q)) q--; *++q = '\0'; /* Skip leading whitespace. */ p = line; while (*p && ISSPACE(*p)) p++; if (!*p) /* Ignore line if empty. */ continue; /* Pointer to start of IPv4 or IPv6 address part. */ txtaddr = p; /* Advance past address part. */ while (*p && !ISSPACE(*p)) p++; if (!*p) /* Ignore line if reached end of line. */ continue; /* Null terminate address part. */ *p = '\0'; /* Advance to host name */ p++; while (*p && ISSPACE(*p)) p++; if (!*p) /* Ignore line if reached end of line. */ continue; /* LCOV_EXCL_LINE: trailing whitespace already stripped */ /* Pointer to start of host name. */ txthost = p; /* Advance past host name. */ while (*p && !ISSPACE(*p)) p++; /* Pointer to start of first alias. */ txtalias = NULL; if (*p) { q = p + 1; while (*q && ISSPACE(*q)) q++; if (*q) txtalias = q; } /* Null terminate host name. */ *p = '\0'; /* Find out if host name matches with canonical host name. */ if (strcasecmp(txthost, name) == 0) { match_with_canonical = 1; } /* Find out if host name matches with one of the aliases. */ while (txtalias) { p = txtalias; while (*p && !ISSPACE(*p)) p++; q = p; while (*q && ISSPACE(*q)) q++; *p = '\0'; if (strcasecmp(txtalias, name) == 0) { match_with_alias = 1; if (!want_cname) break; } if (alias_count < MAX_ALIASES) { aliases[alias_count++] = txtalias; } txtalias = *q ? q : NULL; } /* Try next line if host does not match. */ if (!match_with_alias && !match_with_canonical) { continue; } /* * Convert address string to network address for the requested families. * Actual address family possible values are AF_INET and AF_INET6 only. */ if ((hints->ai_family == AF_INET) || (hints->ai_family == AF_UNSPEC)) { struct in_addr addr4; if (ares_inet_pton(AF_INET, txtaddr, &addr4) == 1) { status = ares_append_ai_node(AF_INET, port, 0, &addr4, &nodes); if (status != ARES_SUCCESS) { goto fail; } } } if ((hints->ai_family == AF_INET6) || (hints->ai_family == AF_UNSPEC)) { struct ares_in6_addr addr6; if (ares_inet_pton(AF_INET6, txtaddr, &addr6) == 1) { status = ares_append_ai_node(AF_INET6, port, 0, &addr6, &nodes); if (status != ARES_SUCCESS) { goto fail; } } } if (status != ARES_SUCCESS) /* Ignore line if invalid address string for the requested family. */ continue; if (want_cname) { for (i = 0; i < alias_count; ++i) { cname = ares__append_addrinfo_cname(&cnames); if (!cname) { status = ARES_ENOMEM; goto fail; } cname->alias = ares_strdup(aliases[i]); cname->name = ares_strdup(txthost); } /* No aliases, cname only. */ if(!alias_count) { cname = ares__append_addrinfo_cname(&cnames); if (!cname) { status = ARES_ENOMEM; goto fail; } cname->name = ares_strdup(txthost); } } } /* Last read failed. */ if (status == ARES_ENOMEM) { goto fail; } /* Free line buffer. */ ares_free(line); ares__addrinfo_cat_cnames(&ai->cnames, cnames); ares__addrinfo_cat_nodes(&ai->nodes, nodes); return nodes ? ARES_SUCCESS : ARES_ENOTFOUND; fail: ares_free(line); ares__freeaddrinfo_cnames(cnames); ares__freeaddrinfo_nodes(nodes); ares_free(ai->name); ai->name = NULL; return status; } ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares__sortaddrinfo.c0000644000175100001770000003366400000000000023464 0ustar00runnerdocker00000000000000/* * Original file name getaddrinfo.c * Lifted from the 'Android Bionic' project with the BSD license. */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. * Copyright (C) 2018 The Android Open Source Project * Copyright (C) 2019 by Andrew Selivanov * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the project nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include "ares_setup.h" #ifdef HAVE_NETINET_IN_H # include #endif #ifdef HAVE_NETDB_H # include #endif #ifdef HAVE_STRINGS_H # include #endif #include #include #include "ares.h" #include "ares_private.h" struct addrinfo_sort_elem { struct ares_addrinfo_node *ai; int has_src_addr; ares_sockaddr src_addr; int original_order; }; #define ARES_IPV6_ADDR_MC_SCOPE(a) ((a)->s6_addr[1] & 0x0f) #define ARES_IPV6_ADDR_SCOPE_NODELOCAL 0x01 #define ARES_IPV6_ADDR_SCOPE_INTFACELOCAL 0x01 #define ARES_IPV6_ADDR_SCOPE_LINKLOCAL 0x02 #define ARES_IPV6_ADDR_SCOPE_SITELOCAL 0x05 #define ARES_IPV6_ADDR_SCOPE_ORGLOCAL 0x08 #define ARES_IPV6_ADDR_SCOPE_GLOBAL 0x0e #define ARES_IN_LOOPBACK(a) ((((long int)(a)) & 0xff000000) == 0x7f000000) /* RFC 4193. */ #define ARES_IN6_IS_ADDR_ULA(a) (((a)->s6_addr[0] & 0xfe) == 0xfc) /* These macros are modelled after the ones in . */ /* RFC 4380, section 2.6 */ #define ARES_IN6_IS_ADDR_TEREDO(a) \ ((*(const unsigned int *)(const void *)(&(a)->s6_addr[0]) == ntohl(0x20010000))) /* RFC 3056, section 2. */ #define ARES_IN6_IS_ADDR_6TO4(a) \ (((a)->s6_addr[0] == 0x20) && ((a)->s6_addr[1] == 0x02)) /* 6bone testing address area (3ffe::/16), deprecated in RFC 3701. */ #define ARES_IN6_IS_ADDR_6BONE(a) \ (((a)->s6_addr[0] == 0x3f) && ((a)->s6_addr[1] == 0xfe)) static int get_scope(const struct sockaddr *addr) { if (addr->sa_family == AF_INET6) { const struct sockaddr_in6 *addr6 = CARES_INADDR_CAST(const struct sockaddr_in6 *, addr); if (IN6_IS_ADDR_MULTICAST(&addr6->sin6_addr)) { return ARES_IPV6_ADDR_MC_SCOPE(&addr6->sin6_addr); } else if (IN6_IS_ADDR_LOOPBACK(&addr6->sin6_addr) || IN6_IS_ADDR_LINKLOCAL(&addr6->sin6_addr)) { /* * RFC 4291 section 2.5.3 says loopback is to be treated as having * link-local scope. */ return ARES_IPV6_ADDR_SCOPE_LINKLOCAL; } else if (IN6_IS_ADDR_SITELOCAL(&addr6->sin6_addr)) { return ARES_IPV6_ADDR_SCOPE_SITELOCAL; } else { return ARES_IPV6_ADDR_SCOPE_GLOBAL; } } else if (addr->sa_family == AF_INET) { const struct sockaddr_in *addr4 = CARES_INADDR_CAST(const struct sockaddr_in *, addr); unsigned long int na = ntohl(addr4->sin_addr.s_addr); if (ARES_IN_LOOPBACK(na) || /* 127.0.0.0/8 */ (na & 0xffff0000) == 0xa9fe0000) /* 169.254.0.0/16 */ { return ARES_IPV6_ADDR_SCOPE_LINKLOCAL; } else { /* * RFC 6724 section 3.2. Other IPv4 addresses, including private * addresses and shared addresses (100.64.0.0/10), are assigned global * scope. */ return ARES_IPV6_ADDR_SCOPE_GLOBAL; } } else { /* * This should never happen. * Return a scope with low priority as a last resort. */ return ARES_IPV6_ADDR_SCOPE_NODELOCAL; } } static int get_label(const struct sockaddr *addr) { if (addr->sa_family == AF_INET) { return 4; } else if (addr->sa_family == AF_INET6) { const struct sockaddr_in6 *addr6 = CARES_INADDR_CAST(const struct sockaddr_in6 *, addr); if (IN6_IS_ADDR_LOOPBACK(&addr6->sin6_addr)) { return 0; } else if (IN6_IS_ADDR_V4MAPPED(&addr6->sin6_addr)) { return 4; } else if (ARES_IN6_IS_ADDR_6TO4(&addr6->sin6_addr)) { return 2; } else if (ARES_IN6_IS_ADDR_TEREDO(&addr6->sin6_addr)) { return 5; } else if (ARES_IN6_IS_ADDR_ULA(&addr6->sin6_addr)) { return 13; } else if (IN6_IS_ADDR_V4COMPAT(&addr6->sin6_addr)) { return 3; } else if (IN6_IS_ADDR_SITELOCAL(&addr6->sin6_addr)) { return 11; } else if (ARES_IN6_IS_ADDR_6BONE(&addr6->sin6_addr)) { return 12; } else { /* All other IPv6 addresses, including global unicast addresses. */ return 1; } } else { /* * This should never happen. * Return a semi-random label as a last resort. */ return 1; } } /* * Get the precedence for a given IPv4/IPv6 address. * RFC 6724, section 2.1. */ static int get_precedence(const struct sockaddr *addr) { if (addr->sa_family == AF_INET) { return 35; } else if (addr->sa_family == AF_INET6) { const struct sockaddr_in6 *addr6 = CARES_INADDR_CAST(const struct sockaddr_in6 *, addr); if (IN6_IS_ADDR_LOOPBACK(&addr6->sin6_addr)) { return 50; } else if (IN6_IS_ADDR_V4MAPPED(&addr6->sin6_addr)) { return 35; } else if (ARES_IN6_IS_ADDR_6TO4(&addr6->sin6_addr)) { return 30; } else if (ARES_IN6_IS_ADDR_TEREDO(&addr6->sin6_addr)) { return 5; } else if (ARES_IN6_IS_ADDR_ULA(&addr6->sin6_addr)) { return 3; } else if (IN6_IS_ADDR_V4COMPAT(&addr6->sin6_addr) || IN6_IS_ADDR_SITELOCAL(&addr6->sin6_addr) || ARES_IN6_IS_ADDR_6BONE(&addr6->sin6_addr)) { return 1; } else { /* All other IPv6 addresses, including global unicast addresses. */ return 40; } } else { return 1; } } /* * Find number of matching initial bits between the two addresses a1 and a2. */ static int common_prefix_len(const struct in6_addr *a1, const struct in6_addr *a2) { const char *p1 = (const char *)a1; const char *p2 = (const char *)a2; unsigned i; for (i = 0; i < sizeof(*a1); ++i) { int x, j; if (p1[i] == p2[i]) { continue; } x = p1[i] ^ p2[i]; for (j = 0; j < CHAR_BIT; ++j) { if (x & (1 << (CHAR_BIT - 1))) { return i * CHAR_BIT + j; } x <<= 1; } } return sizeof(*a1) * CHAR_BIT; } /* * Compare two source/destination address pairs. * RFC 6724, section 6. */ static int rfc6724_compare(const void *ptr1, const void *ptr2) { const struct addrinfo_sort_elem *a1 = (const struct addrinfo_sort_elem *)ptr1; const struct addrinfo_sort_elem *a2 = (const struct addrinfo_sort_elem *)ptr2; int scope_src1, scope_dst1, scope_match1; int scope_src2, scope_dst2, scope_match2; int label_src1, label_dst1, label_match1; int label_src2, label_dst2, label_match2; int precedence1, precedence2; int prefixlen1, prefixlen2; /* Rule 1: Avoid unusable destinations. */ if (a1->has_src_addr != a2->has_src_addr) { return a2->has_src_addr - a1->has_src_addr; } /* Rule 2: Prefer matching scope. */ scope_src1 = ARES_IPV6_ADDR_SCOPE_NODELOCAL; if (a1->has_src_addr) scope_src1 = get_scope(&a1->src_addr.sa); scope_dst1 = get_scope(a1->ai->ai_addr); scope_match1 = (scope_src1 == scope_dst1); scope_src2 = ARES_IPV6_ADDR_SCOPE_NODELOCAL; if (a2->has_src_addr) scope_src2 = get_scope(&a2->src_addr.sa); scope_dst2 = get_scope(a2->ai->ai_addr); scope_match2 = (scope_src2 == scope_dst2); if (scope_match1 != scope_match2) { return scope_match2 - scope_match1; } /* Rule 3: Avoid deprecated addresses. */ /* Rule 4: Prefer home addresses. */ /* Rule 5: Prefer matching label. */ label_src1 = 1; if (a1->has_src_addr) label_src1 = get_label(&a1->src_addr.sa); label_dst1 = get_label(a1->ai->ai_addr); label_match1 = (label_src1 == label_dst1); label_src2 = 1; if (a2->has_src_addr) label_src2 = get_label(&a2->src_addr.sa); label_dst2 = get_label(a2->ai->ai_addr); label_match2 = (label_src2 == label_dst2); if (label_match1 != label_match2) { return label_match2 - label_match1; } /* Rule 6: Prefer higher precedence. */ precedence1 = get_precedence(a1->ai->ai_addr); precedence2 = get_precedence(a2->ai->ai_addr); if (precedence1 != precedence2) { return precedence2 - precedence1; } /* Rule 7: Prefer native transport. */ /* Rule 8: Prefer smaller scope. */ if (scope_dst1 != scope_dst2) { return scope_dst1 - scope_dst2; } /* Rule 9: Use longest matching prefix. */ if (a1->has_src_addr && a1->ai->ai_addr->sa_family == AF_INET6 && a2->has_src_addr && a2->ai->ai_addr->sa_family == AF_INET6) { const struct sockaddr_in6 *a1_src = &a1->src_addr.sa6; const struct sockaddr_in6 *a1_dst = CARES_INADDR_CAST(const struct sockaddr_in6 *, a1->ai->ai_addr); const struct sockaddr_in6 *a2_src = &a2->src_addr.sa6; const struct sockaddr_in6 *a2_dst = CARES_INADDR_CAST(const struct sockaddr_in6 *, a2->ai->ai_addr); prefixlen1 = common_prefix_len(&a1_src->sin6_addr, &a1_dst->sin6_addr); prefixlen2 = common_prefix_len(&a2_src->sin6_addr, &a2_dst->sin6_addr); if (prefixlen1 != prefixlen2) { return prefixlen2 - prefixlen1; } } /* * Rule 10: Leave the order unchanged. * We need this since qsort() is not necessarily stable. */ return a1->original_order - a2->original_order; } /* * Find the source address that will be used if trying to connect to the given * address. * * Returns 1 if a source address was found, 0 if the address is unreachable, * and -1 if a fatal error occurred. If 0 or 1, the contents of src_addr are * undefined. */ static int find_src_addr(ares_channel channel, const struct sockaddr *addr, struct sockaddr *src_addr) { ares_socket_t sock; int ret; ares_socklen_t len; switch (addr->sa_family) { case AF_INET: len = sizeof(struct sockaddr_in); break; case AF_INET6: len = sizeof(struct sockaddr_in6); break; default: /* No known usable source address for non-INET families. */ return 0; } sock = ares__open_socket(channel, addr->sa_family, SOCK_DGRAM, IPPROTO_UDP); if (sock == ARES_SOCKET_BAD) { if (errno == EAFNOSUPPORT) { return 0; } else { return -1; } } do { ret = ares__connect_socket(channel, sock, addr, len); } while (ret == -1 && errno == EINTR); if (ret == -1) { ares__close_socket(channel, sock); return 0; } if (getsockname(sock, src_addr, &len) != 0) { ares__close_socket(channel, sock); return -1; } ares__close_socket(channel, sock); return 1; } /* * Sort the linked list starting at sentinel->ai_next in RFC6724 order. * Will leave the list unchanged if an error occurs. */ int ares__sortaddrinfo(ares_channel channel, struct ares_addrinfo_node *list_sentinel) { struct ares_addrinfo_node *cur; int nelem = 0, i; int has_src_addr; struct addrinfo_sort_elem *elems; cur = list_sentinel->ai_next; while (cur) { ++nelem; cur = cur->ai_next; } if (!nelem) return ARES_ENODATA; elems = (struct addrinfo_sort_elem *)ares_malloc( nelem * sizeof(struct addrinfo_sort_elem)); if (!elems) { return ARES_ENOMEM; } /* * Convert the linked list to an array that also contains the candidate * source address for each destination address. */ for (i = 0, cur = list_sentinel->ai_next; i < nelem; ++i, cur = cur->ai_next) { assert(cur != NULL); elems[i].ai = cur; elems[i].original_order = i; has_src_addr = find_src_addr(channel, cur->ai_addr, &elems[i].src_addr.sa); if (has_src_addr == -1) { ares_free(elems); return ARES_ENOTFOUND; } elems[i].has_src_addr = has_src_addr; } /* Sort the addresses, and rearrange the linked list so it matches the sorted * order. */ qsort((void *)elems, nelem, sizeof(struct addrinfo_sort_elem), rfc6724_compare); list_sentinel->ai_next = elems[0].ai; for (i = 0; i < nelem - 1; ++i) { elems[i].ai->ai_next = elems[i + 1].ai; } elems[nelem - 1].ai->ai_next = NULL; ares_free(elems); return ARES_SUCCESS; } ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares__timeval.c0000644000175100001770000000605300000000000022417 0ustar00runnerdocker00000000000000 /* Copyright (C) 2008 by Daniel Stenberg et al * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose and without fee is hereby granted, provided * that the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. M.I.T. makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. */ #include "ares_setup.h" #include "ares.h" #include "ares_private.h" #if defined(WIN32) && !defined(MSDOS) struct timeval ares__tvnow(void) { /* ** GetTickCount() is available on _all_ Windows versions from W95 up ** to nowadays. Returns milliseconds elapsed since last system boot, ** increases monotonically and wraps once 49.7 days have elapsed. */ struct timeval now; DWORD milliseconds = GetTickCount(); now.tv_sec = milliseconds / 1000; now.tv_usec = (milliseconds % 1000) * 1000; return now; } #elif defined(HAVE_CLOCK_GETTIME_MONOTONIC) struct timeval ares__tvnow(void) { /* ** clock_gettime() is granted to be increased monotonically when the ** monotonic clock is queried. Time starting point is unspecified, it ** could be the system start-up time, the Epoch, or something else, ** in any case the time starting point does not change once that the ** system has started up. */ struct timeval now; struct timespec tsnow; if(0 == clock_gettime(CLOCK_MONOTONIC, &tsnow)) { now.tv_sec = tsnow.tv_sec; now.tv_usec = tsnow.tv_nsec / 1000; } /* ** Even when the configure process has truly detected monotonic clock ** availability, it might happen that it is not actually available at ** run-time. When this occurs simply fallback to other time source. */ #ifdef HAVE_GETTIMEOFDAY else (void)gettimeofday(&now, NULL); /* LCOV_EXCL_LINE */ #else else { now.tv_sec = (long)time(NULL); now.tv_usec = 0; } #endif return now; } #elif defined(HAVE_GETTIMEOFDAY) struct timeval ares__tvnow(void) { /* ** gettimeofday() is not granted to be increased monotonically, due to ** clock drifting and external source time synchronization it can jump ** forward or backward in time. */ struct timeval now; (void)gettimeofday(&now, NULL); return now; } #else struct timeval ares__tvnow(void) { /* ** time() returns the value of time in seconds since the Epoch. */ struct timeval now; now.tv_sec = (long)time(NULL); now.tv_usec = 0; return now; } #endif #if 0 /* Not used */ /* * Make sure that the first argument is the more recent time, as otherwise * we'll get a weird negative time-diff back... * * Returns: the time difference in number of milliseconds. */ long ares__tvdiff(struct timeval newer, struct timeval older) { return (newer.tv_sec-older.tv_sec)*1000+ (newer.tv_usec-older.tv_usec)/1000; } #endif ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares_android.c0000644000175100001770000003172700000000000022245 0ustar00runnerdocker00000000000000/* Copyright (C) 2017 by John Schember * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ #if defined(ANDROID) || defined(__ANDROID__) #include #include "ares_setup.h" #include "ares.h" #include "ares_android.h" #include "ares_private.h" static JavaVM *android_jvm = NULL; static jobject android_connectivity_manager = NULL; /* ConnectivityManager.getActiveNetwork */ static jmethodID android_cm_active_net_mid = NULL; /* ConnectivityManager.getLinkProperties */ static jmethodID android_cm_link_props_mid = NULL; /* LinkProperties.getDnsServers */ static jmethodID android_lp_dns_servers_mid = NULL; /* LinkProperties.getDomains */ static jmethodID android_lp_domains_mid = NULL; /* List.size */ static jmethodID android_list_size_mid = NULL; /* List.get */ static jmethodID android_list_get_mid = NULL; /* InetAddress.getHostAddress */ static jmethodID android_ia_host_addr_mid = NULL; static jclass jni_get_class(JNIEnv *env, const char *path) { jclass cls = NULL; if (env == NULL || path == NULL || *path == '\0') return NULL; cls = (*env)->FindClass(env, path); if ((*env)->ExceptionOccurred(env)) { (*env)->ExceptionClear(env); return NULL; } return cls; } static jmethodID jni_get_method_id(JNIEnv *env, jclass cls, const char *func_name, const char *signature) { jmethodID mid = NULL; if (env == NULL || cls == NULL || func_name == NULL || *func_name == '\0' || signature == NULL || *signature == '\0') { return NULL; } mid = (*env)->GetMethodID(env, cls, func_name, signature); if ((*env)->ExceptionOccurred(env)) { (*env)->ExceptionClear(env); return NULL; } return mid; } void ares_library_init_jvm(JavaVM *jvm) { android_jvm = jvm; } int ares_library_init_android(jobject connectivity_manager) { JNIEnv *env = NULL; int need_detatch = 0; int res; int ret = ARES_ENOTINITIALIZED; jclass obj_cls = NULL; if (android_jvm == NULL) goto cleanup; res = (*android_jvm)->GetEnv(android_jvm, (void **)&env, JNI_VERSION_1_6); if (res == JNI_EDETACHED) { env = NULL; res = (*android_jvm)->AttachCurrentThread(android_jvm, &env, NULL); need_detatch = 1; } if (res != JNI_OK || env == NULL) goto cleanup; android_connectivity_manager = (*env)->NewGlobalRef(env, connectivity_manager); if (android_connectivity_manager == NULL) goto cleanup; /* Initialization has succeeded. Now attempt to cache the methods that will be * called by ares_get_android_server_list. */ ret = ARES_SUCCESS; /* ConnectivityManager in API 1. */ obj_cls = jni_get_class(env, "android/net/ConnectivityManager"); if (obj_cls == NULL) goto cleanup; /* ConnectivityManager.getActiveNetwork in API 23. */ android_cm_active_net_mid = jni_get_method_id(env, obj_cls, "getActiveNetwork", "()Landroid/net/Network;"); if (android_cm_active_net_mid == NULL) goto cleanup; /* ConnectivityManager.getLinkProperties in API 21. */ android_cm_link_props_mid = jni_get_method_id(env, obj_cls, "getLinkProperties", "(Landroid/net/Network;)Landroid/net/LinkProperties;"); if (android_cm_link_props_mid == NULL) goto cleanup; /* LinkProperties in API 21. */ (*env)->DeleteLocalRef(env, obj_cls); obj_cls = jni_get_class(env, "android/net/LinkProperties"); if (obj_cls == NULL) goto cleanup; /* getDnsServers in API 21. */ android_lp_dns_servers_mid = jni_get_method_id(env, obj_cls, "getDnsServers", "()Ljava/util/List;"); if (android_lp_dns_servers_mid == NULL) goto cleanup; /* getDomains in API 21. */ android_lp_domains_mid = jni_get_method_id(env, obj_cls, "getDomains", "()Ljava/lang/String;"); if (android_lp_domains_mid == NULL) goto cleanup; (*env)->DeleteLocalRef(env, obj_cls); obj_cls = jni_get_class(env, "java/util/List"); if (obj_cls == NULL) goto cleanup; android_list_size_mid = jni_get_method_id(env, obj_cls, "size", "()I"); if (android_list_size_mid == NULL) goto cleanup; android_list_get_mid = jni_get_method_id(env, obj_cls, "get", "(I)Ljava/lang/Object;"); if (android_list_get_mid == NULL) goto cleanup; (*env)->DeleteLocalRef(env, obj_cls); obj_cls = jni_get_class(env, "java/net/InetAddress"); if (obj_cls == NULL) goto cleanup; android_ia_host_addr_mid = jni_get_method_id(env, obj_cls, "getHostAddress", "()Ljava/lang/String;"); if (android_ia_host_addr_mid == NULL) goto cleanup; (*env)->DeleteLocalRef(env, obj_cls); goto done; cleanup: if (obj_cls != NULL) (*env)->DeleteLocalRef(env, obj_cls); android_cm_active_net_mid = NULL; android_cm_link_props_mid = NULL; android_lp_dns_servers_mid = NULL; android_lp_domains_mid = NULL; android_list_size_mid = NULL; android_list_get_mid = NULL; android_ia_host_addr_mid = NULL; done: if (need_detatch) (*android_jvm)->DetachCurrentThread(android_jvm); return ret; } int ares_library_android_initialized(void) { if (android_jvm == NULL || android_connectivity_manager == NULL) return ARES_ENOTINITIALIZED; return ARES_SUCCESS; } void ares_library_cleanup_android(void) { JNIEnv *env = NULL; int need_detatch = 0; int res; if (android_jvm == NULL || android_connectivity_manager == NULL) return; res = (*android_jvm)->GetEnv(android_jvm, (void **)&env, JNI_VERSION_1_6); if (res == JNI_EDETACHED) { env = NULL; res = (*android_jvm)->AttachCurrentThread(android_jvm, &env, NULL); need_detatch = 1; } if (res != JNI_OK || env == NULL) return; android_cm_active_net_mid = NULL; android_cm_link_props_mid = NULL; android_lp_dns_servers_mid = NULL; android_lp_domains_mid = NULL; android_list_size_mid = NULL; android_list_get_mid = NULL; android_ia_host_addr_mid = NULL; (*env)->DeleteGlobalRef(env, android_connectivity_manager); android_connectivity_manager = NULL; if (need_detatch) (*android_jvm)->DetachCurrentThread(android_jvm); } char **ares_get_android_server_list(size_t max_servers, size_t *num_servers) { JNIEnv *env = NULL; jobject active_network = NULL; jobject link_properties = NULL; jobject server_list = NULL; jobject server = NULL; jstring str = NULL; jint nserv; const char *ch_server_address; int res; size_t i; char **dns_list = NULL; int need_detatch = 0; if (android_jvm == NULL || android_connectivity_manager == NULL || max_servers == 0 || num_servers == NULL) { return NULL; } if (android_cm_active_net_mid == NULL || android_cm_link_props_mid == NULL || android_lp_dns_servers_mid == NULL || android_list_size_mid == NULL || android_list_get_mid == NULL || android_ia_host_addr_mid == NULL) { return NULL; } res = (*android_jvm)->GetEnv(android_jvm, (void **)&env, JNI_VERSION_1_6); if (res == JNI_EDETACHED) { env = NULL; res = (*android_jvm)->AttachCurrentThread(android_jvm, &env, NULL); need_detatch = 1; } if (res != JNI_OK || env == NULL) goto done; /* JNI below is equivalent to this Java code. import android.content.Context; import android.net.ConnectivityManager; import android.net.LinkProperties; import android.net.Network; import java.net.InetAddress; import java.util.List; ConnectivityManager cm = (ConnectivityManager)this.getApplicationContext() .getSystemService(Context.CONNECTIVITY_SERVICE); Network an = cm.getActiveNetwork(); LinkProperties lp = cm.getLinkProperties(an); List dns = lp.getDnsServers(); for (InetAddress ia: dns) { String ha = ia.getHostAddress(); } Note: The JNI ConnectivityManager object and all method IDs were previously initialized in ares_library_init_android. */ active_network = (*env)->CallObjectMethod(env, android_connectivity_manager, android_cm_active_net_mid); if (active_network == NULL) goto done; link_properties = (*env)->CallObjectMethod(env, android_connectivity_manager, android_cm_link_props_mid, active_network); if (link_properties == NULL) goto done; server_list = (*env)->CallObjectMethod(env, link_properties, android_lp_dns_servers_mid); if (server_list == NULL) goto done; nserv = (*env)->CallIntMethod(env, server_list, android_list_size_mid); if (nserv > (jint)max_servers) nserv = (jint)max_servers; if (nserv <= 0) goto done; *num_servers = (size_t)nserv; dns_list = ares_malloc(sizeof(*dns_list)*(*num_servers)); for (i=0; i<*num_servers; i++) { server = (*env)->CallObjectMethod(env, server_list, android_list_get_mid, (jint)i); dns_list[i] = ares_malloc(64); dns_list[i][0] = 0; if (server == NULL) { continue; } str = (*env)->CallObjectMethod(env, server, android_ia_host_addr_mid); ch_server_address = (*env)->GetStringUTFChars(env, str, 0); strncpy(dns_list[i], ch_server_address, 64); (*env)->ReleaseStringUTFChars(env, str, ch_server_address); (*env)->DeleteLocalRef(env, str); (*env)->DeleteLocalRef(env, server); } done: if ((*env)->ExceptionOccurred(env)) (*env)->ExceptionClear(env); if (server_list != NULL) (*env)->DeleteLocalRef(env, server_list); if (link_properties != NULL) (*env)->DeleteLocalRef(env, link_properties); if (active_network != NULL) (*env)->DeleteLocalRef(env, active_network); if (need_detatch) (*android_jvm)->DetachCurrentThread(android_jvm); return dns_list; } char *ares_get_android_search_domains_list(void) { JNIEnv *env = NULL; jobject active_network = NULL; jobject link_properties = NULL; jstring domains = NULL; const char *domain; int res; char *domain_list = NULL; int need_detatch = 0; if (android_jvm == NULL || android_connectivity_manager == NULL) { return NULL; } if (android_cm_active_net_mid == NULL || android_cm_link_props_mid == NULL || android_lp_domains_mid == NULL) { return NULL; } res = (*android_jvm)->GetEnv(android_jvm, (void **)&env, JNI_VERSION_1_6); if (res == JNI_EDETACHED) { env = NULL; res = (*android_jvm)->AttachCurrentThread(android_jvm, &env, NULL); need_detatch = 1; } if (res != JNI_OK || env == NULL) goto done; /* JNI below is equivalent to this Java code. import android.content.Context; import android.net.ConnectivityManager; import android.net.LinkProperties; ConnectivityManager cm = (ConnectivityManager)this.getApplicationContext() .getSystemService(Context.CONNECTIVITY_SERVICE); Network an = cm.getActiveNetwork(); LinkProperties lp = cm.getLinkProperties(an); String domains = lp.getDomains(); for (String domain: domains.split(",")) { String d = domain; } Note: The JNI ConnectivityManager object and all method IDs were previously initialized in ares_library_init_android. */ active_network = (*env)->CallObjectMethod(env, android_connectivity_manager, android_cm_active_net_mid); if (active_network == NULL) goto done; link_properties = (*env)->CallObjectMethod(env, android_connectivity_manager, android_cm_link_props_mid, active_network); if (link_properties == NULL) goto done; /* Get the domains. It is a common separated list of domains to search. */ domains = (*env)->CallObjectMethod(env, link_properties, android_lp_domains_mid); if (domains == NULL) goto done; /* Split on , */ domain = (*env)->GetStringUTFChars(env, domains, 0); domain_list = ares_strdup(domain); (*env)->ReleaseStringUTFChars(env, domains, domain); (*env)->DeleteLocalRef(env, domains); done: if ((*env)->ExceptionOccurred(env)) (*env)->ExceptionClear(env); if (link_properties != NULL) (*env)->DeleteLocalRef(env, link_properties); if (active_network != NULL) (*env)->DeleteLocalRef(env, active_network); if (need_detatch) (*android_jvm)->DetachCurrentThread(android_jvm); return domain_list; } #else /* warning: ISO C forbids an empty translation unit */ typedef int dummy_make_iso_compilers_happy; #endif ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares_android.h0000644000175100001770000000176600000000000022252 0ustar00runnerdocker00000000000000/* Copyright (C) 2017 by John Schember * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ #ifndef __ARES_ANDROID_H__ #define __ARES_ANDROID_H__ #if defined(ANDROID) || defined(__ANDROID__) char **ares_get_android_server_list(size_t max_servers, size_t *num_servers); char *ares_get_android_search_domains_list(void); void ares_library_cleanup_android(void); #endif #endif /* __ARES_ANDROID_H__ */ ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares_cancel.c0000644000175100001770000000426500000000000022047 0ustar00runnerdocker00000000000000 /* Copyright (C) 2004 by Daniel Stenberg et al * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose and without fee is hereby granted, provided * that the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. M.I.T. makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. */ #include "ares_setup.h" #include #include "ares.h" #include "ares_private.h" /* * ares_cancel() cancels all ongoing requests/resolves that might be going on * on the given channel. It does NOT kill the channel, use ares_destroy() for * that. */ void ares_cancel(ares_channel channel) { struct query *query; struct list_node list_head_copy; struct list_node* list_head; struct list_node* list_node; int i; if (!ares__is_list_empty(&(channel->all_queries))) { /* 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. */ list_head = &(channel->all_queries); list_head_copy.prev = list_head->prev; list_head_copy.next = list_head->next; list_head_copy.prev->next = &list_head_copy; list_head_copy.next->prev = &list_head_copy; list_head->prev = list_head; list_head->next = list_head; for (list_node = list_head_copy.next; list_node != &list_head_copy; ) { query = list_node->data; list_node = list_node->next; /* since we're deleting the query */ query->callback(query->arg, ARES_ECANCELLED, 0, NULL, 0); ares__free_query(query); } } if (!(channel->flags & ARES_FLAG_STAYOPEN) && ares__is_list_empty(&(channel->all_queries))) { if (channel->servers) { for (i = 0; i < channel->nservers; i++) ares__close_sockets(channel, &channel->servers[i]); } } } ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares_config.h.cmake0000644000175100001770000003151700000000000023153 0ustar00runnerdocker00000000000000/* Generated from ares_config.h.cmake */ /* Define if building universal (internal helper macro) */ #undef AC_APPLE_UNIVERSAL_BUILD /* define this if ares is built for a big endian system */ #undef ARES_BIG_ENDIAN /* when building as static part of libcurl */ #undef BUILDING_LIBCURL /* Defined for build that exposes internal static functions for testing. */ #undef CARES_EXPOSE_STATICS /* Defined for build with symbol hiding. */ #undef CARES_SYMBOL_HIDING /* Definition to make a library symbol externally visible. */ #undef CARES_SYMBOL_SCOPE_EXTERN /* Use resolver library to configure cares */ #cmakedefine CARES_USE_LIBRESOLV /* if a /etc/inet dir is being used */ #undef ETC_INET /* Define to the type of arg 2 for gethostname. */ #define GETHOSTNAME_TYPE_ARG2 @GETHOSTNAME_TYPE_ARG2@ /* Define to the type qualifier of arg 1 for getnameinfo. */ #define GETNAMEINFO_QUAL_ARG1 @GETNAMEINFO_QUAL_ARG1@ /* Define to the type of arg 1 for getnameinfo. */ #define GETNAMEINFO_TYPE_ARG1 @GETNAMEINFO_TYPE_ARG1@ /* Define to the type of arg 2 for getnameinfo. */ #define GETNAMEINFO_TYPE_ARG2 @GETNAMEINFO_TYPE_ARG2@ /* Define to the type of args 4 and 6 for getnameinfo. */ #define GETNAMEINFO_TYPE_ARG46 @GETNAMEINFO_TYPE_ARG46@ /* Define to the type of arg 7 for getnameinfo. */ #define GETNAMEINFO_TYPE_ARG7 @GETNAMEINFO_TYPE_ARG7@ /* Specifies the number of arguments to getservbyport_r */ #define GETSERVBYPORT_R_ARGS @GETSERVBYPORT_R_ARGS@ /* Specifies the number of arguments to getservbyname_r */ #define GETSERVBYNAME_R_ARGS @GETSERVBYNAME_R_ARGS@ /* Define to 1 if you have AF_INET6. */ #cmakedefine HAVE_AF_INET6 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_ARPA_INET_H /* Define to 1 if you have the header file. */ #cmakedefine HAVE_ARPA_NAMESER_COMPAT_H /* Define to 1 if you have the header file. */ #cmakedefine HAVE_ARPA_NAMESER_H /* Define to 1 if you have the header file. */ #cmakedefine HAVE_ASSERT_H /* Define to 1 if you have the `bitncmp' function. */ #cmakedefine HAVE_BITNCMP /* Define to 1 if bool is an available type. */ #cmakedefine HAVE_BOOL_T /* Define to 1 if you have the clock_gettime function and monotonic timer. */ #cmakedefine HAVE_CLOCK_GETTIME_MONOTONIC /* Define to 1 if you have the closesocket function. */ #cmakedefine HAVE_CLOSESOCKET /* Define to 1 if you have the CloseSocket camel case function. */ #cmakedefine HAVE_CLOSESOCKET_CAMEL /* Define to 1 if you have the connect function. */ #cmakedefine HAVE_CONNECT /* define if the compiler supports basic C++11 syntax */ #cmakedefine HAVE_CXX11 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_DLFCN_H /* Define to 1 if you have the header file. */ #cmakedefine HAVE_ERRNO_H /* Define to 1 if you have the fcntl function. */ #cmakedefine HAVE_FCNTL /* Define to 1 if you have the header file. */ #cmakedefine HAVE_FCNTL_H /* Define to 1 if you have a working fcntl O_NONBLOCK function. */ #cmakedefine HAVE_FCNTL_O_NONBLOCK /* Define to 1 if you have the freeaddrinfo function. */ #cmakedefine HAVE_FREEADDRINFO /* Define to 1 if you have a working getaddrinfo function. */ #cmakedefine HAVE_GETADDRINFO /* Define to 1 if the getaddrinfo function is threadsafe. */ #cmakedefine HAVE_GETADDRINFO_THREADSAFE /* Define to 1 if you have the getenv function. */ #cmakedefine HAVE_GETENV /* Define to 1 if you have the gethostbyaddr function. */ #cmakedefine HAVE_GETHOSTBYADDR /* Define to 1 if you have the gethostbyname function. */ #cmakedefine HAVE_GETHOSTBYNAME /* Define to 1 if you have the gethostname function. */ #cmakedefine HAVE_GETHOSTNAME /* Define to 1 if you have the getnameinfo function. */ #cmakedefine HAVE_GETNAMEINFO /* Define to 1 if you have the getservbyport_r function. */ #cmakedefine HAVE_GETSERVBYPORT_R /* Define to 1 if you have the getservbyname_r function. */ #cmakedefine HAVE_GETSERVBYNAME_R /* Define to 1 if you have the `gettimeofday' function. */ #cmakedefine HAVE_GETTIMEOFDAY /* Define to 1 if you have the `if_indextoname' function. */ #cmakedefine HAVE_IF_INDEXTONAME /* Define to 1 if you have a IPv6 capable working inet_net_pton function. */ #cmakedefine HAVE_INET_NET_PTON /* Define to 1 if you have a IPv6 capable working inet_ntop function. */ #cmakedefine HAVE_INET_NTOP /* Define to 1 if you have a IPv6 capable working inet_pton function. */ #cmakedefine HAVE_INET_PTON /* Define to 1 if you have the header file. */ #cmakedefine HAVE_INTTYPES_H /* Define to 1 if you have the ioctl function. */ #cmakedefine HAVE_IOCTL /* Define to 1 if you have the ioctlsocket function. */ #cmakedefine HAVE_IOCTLSOCKET /* Define to 1 if you have the IoctlSocket camel case function. */ #cmakedefine HAVE_IOCTLSOCKET_CAMEL /* Define to 1 if you have a working IoctlSocket camel case FIONBIO function. */ #cmakedefine HAVE_IOCTLSOCKET_CAMEL_FIONBIO /* Define to 1 if you have a working ioctlsocket FIONBIO function. */ #cmakedefine HAVE_IOCTLSOCKET_FIONBIO /* Define to 1 if you have a working ioctl FIONBIO function. */ #cmakedefine HAVE_IOCTL_FIONBIO /* Define to 1 if you have a working ioctl SIOCGIFADDR function. */ #cmakedefine HAVE_IOCTL_SIOCGIFADDR /* Define to 1 if you have the `resolve' library (-lresolve). */ #cmakedefine HAVE_LIBRESOLV /* Define to 1 if you have the header file. */ #cmakedefine HAVE_LIMITS_H /* if your compiler supports LL */ #cmakedefine HAVE_LL /* Define to 1 if the compiler supports the 'long long' data type. */ #cmakedefine HAVE_LONGLONG /* Define to 1 if you have the malloc.h header file. */ #cmakedefine HAVE_MALLOC_H /* Define to 1 if you have the memory.h header file. */ #cmakedefine HAVE_MEMORY_H /* Define to 1 if you have the MSG_NOSIGNAL flag. */ #cmakedefine HAVE_MSG_NOSIGNAL /* Define to 1 if you have the header file. */ #cmakedefine HAVE_NETDB_H /* Define to 1 if you have the header file. */ #cmakedefine HAVE_NETINET_IN_H /* Define to 1 if you have the header file. */ #cmakedefine HAVE_NETINET_TCP_H /* Define to 1 if you have the header file. */ #cmakedefine HAVE_NET_IF_H /* Define to 1 if you have PF_INET6. */ #cmakedefine HAVE_PF_INET6 /* Define to 1 if you have the recv function. */ #cmakedefine HAVE_RECV /* Define to 1 if you have the recvfrom function. */ #cmakedefine HAVE_RECVFROM /* Define to 1 if you have the send function. */ #cmakedefine HAVE_SEND /* Define to 1 if you have the setsockopt function. */ #cmakedefine HAVE_SETSOCKOPT /* Define to 1 if you have a working setsockopt SO_NONBLOCK function. */ #cmakedefine HAVE_SETSOCKOPT_SO_NONBLOCK /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SIGNAL_H /* Define to 1 if sig_atomic_t is an available typedef. */ #cmakedefine HAVE_SIG_ATOMIC_T /* Define to 1 if sig_atomic_t is already defined as volatile. */ #cmakedefine HAVE_SIG_ATOMIC_T_VOLATILE /* Define to 1 if your struct sockaddr_in6 has sin6_scope_id. */ #cmakedefine HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID /* Define to 1 if you have the socket function. */ #cmakedefine HAVE_SOCKET /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SOCKET_H /* Define to 1 if you have the header file. */ #cmakedefine HAVE_STDBOOL_H /* Define to 1 if you have the header file. */ #cmakedefine HAVE_STDINT_H /* Define to 1 if you have the header file. */ #cmakedefine HAVE_STDLIB_H /* Define to 1 if you have the strcasecmp function. */ #cmakedefine HAVE_STRCASECMP /* Define to 1 if you have the strcmpi function. */ #cmakedefine HAVE_STRCMPI /* Define to 1 if you have the strdup function. */ #cmakedefine HAVE_STRDUP /* Define to 1 if you have the stricmp function. */ #cmakedefine HAVE_STRICMP /* Define to 1 if you have the header file. */ #cmakedefine HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #cmakedefine HAVE_STRING_H /* Define to 1 if you have the strncasecmp function. */ #cmakedefine HAVE_STRNCASECMP /* Define to 1 if you have the strncmpi function. */ #cmakedefine HAVE_STRNCMPI /* Define to 1 if you have the strnicmp function. */ #cmakedefine HAVE_STRNICMP /* Define to 1 if you have the header file. */ #cmakedefine HAVE_STROPTS_H /* Define to 1 if you have struct addrinfo. */ #cmakedefine HAVE_STRUCT_ADDRINFO /* Define to 1 if you have struct in6_addr. */ #cmakedefine HAVE_STRUCT_IN6_ADDR /* Define to 1 if you have struct sockaddr_in6. */ #cmakedefine HAVE_STRUCT_SOCKADDR_IN6 /* if struct sockaddr_storage is defined */ #cmakedefine HAVE_STRUCT_SOCKADDR_STORAGE /* Define to 1 if you have the timeval struct. */ #cmakedefine HAVE_STRUCT_TIMEVAL /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SYS_IOCTL_H /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SYS_PARAM_H /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SYS_SELECT_H /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SYS_SOCKET_H /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SYS_UIO_H /* Define to 1 if you have the header file. */ #cmakedefine HAVE_TIME_H /* Define to 1 if you have the header file. */ #cmakedefine HAVE_UNISTD_H /* Define to 1 if you have the windows.h header file. */ #cmakedefine HAVE_WINDOWS_H /* Define to 1 if you have the winsock2.h header file. */ #cmakedefine HAVE_WINSOCK2_H /* Define to 1 if you have the winsock.h header file. */ #cmakedefine HAVE_WINSOCK_H /* Define to 1 if you have the writev function. */ #cmakedefine HAVE_WRITEV /* Define to 1 if you have the ws2tcpip.h header file. */ #cmakedefine HAVE_WS2TCPIP_H /* Define to 1 if you have the __system_property_get function */ #cmakedefine HAVE___SYSTEM_PROPERTY_GET /* Define to 1 if you need the malloc.h header file even with stdlib.h */ #cmakedefine NEED_MALLOC_H /* Define to 1 if you need the memory.h header file even with stdlib.h */ #cmakedefine NEED_MEMORY_H /* a suitable file/device to read random data from */ #cmakedefine CARES_RANDOM_FILE "@CARES_RANDOM_FILE@" /* Define to the type qualifier pointed by arg 5 for recvfrom. */ #define RECVFROM_QUAL_ARG5 @RECVFROM_QUAL_ARG5@ /* Define to the type of arg 1 for recvfrom. */ #define RECVFROM_TYPE_ARG1 @RECVFROM_TYPE_ARG1@ /* Define to the type pointed by arg 2 for recvfrom. */ #define RECVFROM_TYPE_ARG2 @RECVFROM_TYPE_ARG2@ /* Define to 1 if the type pointed by arg 2 for recvfrom is void. */ #cmakedefine01 RECVFROM_TYPE_ARG2_IS_VOID /* Define to the type of arg 3 for recvfrom. */ #define RECVFROM_TYPE_ARG3 @RECVFROM_TYPE_ARG3@ /* Define to the type of arg 4 for recvfrom. */ #define RECVFROM_TYPE_ARG4 @RECVFROM_TYPE_ARG4@ /* Define to the type pointed by arg 5 for recvfrom. */ #define RECVFROM_TYPE_ARG5 @RECVFROM_TYPE_ARG5@ /* Define to 1 if the type pointed by arg 5 for recvfrom is void. */ #cmakedefine01 RECVFROM_TYPE_ARG5_IS_VOID /* Define to the type pointed by arg 6 for recvfrom. */ #define RECVFROM_TYPE_ARG6 @RECVFROM_TYPE_ARG6@ /* Define to 1 if the type pointed by arg 6 for recvfrom is void. */ #cmakedefine01 RECVFROM_TYPE_ARG6_IS_VOID /* Define to the function return type for recvfrom. */ #define RECVFROM_TYPE_RETV @RECVFROM_TYPE_RETV@ /* Define to the type of arg 1 for recv. */ #define RECV_TYPE_ARG1 @RECV_TYPE_ARG1@ /* Define to the type of arg 2 for recv. */ #define RECV_TYPE_ARG2 @RECV_TYPE_ARG2@ /* Define to the type of arg 3 for recv. */ #define RECV_TYPE_ARG3 @RECV_TYPE_ARG3@ /* Define to the type of arg 4 for recv. */ #define RECV_TYPE_ARG4 @RECV_TYPE_ARG4@ /* Define to the function return type for recv. */ #define RECV_TYPE_RETV @RECV_TYPE_RETV@ /* Define as the return type of signal handlers (`int' or `void'). */ #define RETSIGTYPE @RETSIGTYPE@ /* Define to the type qualifier of arg 2 for send. */ #define SEND_QUAL_ARG2 @SEND_QUAL_ARG2@ /* Define to the type of arg 1 for send. */ #define SEND_TYPE_ARG1 @SEND_TYPE_ARG1@ /* Define to the type of arg 2 for send. */ #define SEND_TYPE_ARG2 @SEND_TYPE_ARG2@ /* Define to the type of arg 3 for send. */ #define SEND_TYPE_ARG3 @SEND_TYPE_ARG3@ /* Define to the type of arg 4 for send. */ #define SEND_TYPE_ARG4 @SEND_TYPE_ARG4@ /* Define to the function return type for send. */ #define SEND_TYPE_RETV @SEND_TYPE_RETV@ /* Define to 1 if you can safely include both and . */ #cmakedefine TIME_WITH_SYS_TIME /* Define to disable non-blocking sockets. */ #undef USE_BLOCKING_SOCKETS /* Define to avoid automatic inclusion of winsock.h */ #undef WIN32_LEAN_AND_MEAN /* Type to use in place of in_addr_t when system does not provide it. */ #undef in_addr_t ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares_create_query.c0000644000175100001770000001377300000000000023316 0ustar00runnerdocker00000000000000 /* Copyright 1998 by the Massachusetts Institute of Technology. * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ #include "ares_setup.h" #ifdef HAVE_NETINET_IN_H # include #endif #include "ares_nameser.h" #include "ares.h" #include "ares_dns.h" #include "ares_private.h" /* Header format, from RFC 1035: * 1 1 1 1 1 1 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ * | ID | * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ * |QR| Opcode |AA|TC|RD|RA| Z | RCODE | * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ * | QDCOUNT | * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ * | ANCOUNT | * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ * | NSCOUNT | * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ * | ARCOUNT | * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ * * AA, TC, RA, and RCODE are only set in responses. Brief description * of the remaining fields: * ID Identifier to match responses with queries * QR Query (0) or response (1) * Opcode For our purposes, always O_QUERY * RD Recursion desired * Z Reserved (zero) * QDCOUNT Number of queries * ANCOUNT Number of answers * NSCOUNT Number of name server records * ARCOUNT Number of additional records * * Question format, from RFC 1035: * 1 1 1 1 1 1 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ * | | * / QNAME / * / / * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ * | QTYPE | * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ * | QCLASS | * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ * * The query name is encoded as a series of labels, each represented * as a one-byte length (maximum 63) followed by the text of the * label. The list is terminated by a label of length zero (which can * be thought of as the root domain). */ int ares_create_query(const char *name, int dnsclass, int type, unsigned short id, int rd, unsigned char **bufp, int *buflenp, int max_udp_size) { size_t len; unsigned char *q; const char *p; size_t buflen; unsigned char *buf; /* Set our results early, in case we bail out early with an error. */ *buflenp = 0; *bufp = NULL; /* Per RFC 7686, reject queries for ".onion" domain names with NXDOMAIN. */ if (ares__is_onion_domain(name)) return ARES_ENOTFOUND; /* Allocate a memory area for the maximum size this packet might need. +2 * is for the length byte and zero termination if no dots or ecscaping is * used. */ len = strlen(name) + 2 + HFIXEDSZ + QFIXEDSZ + (max_udp_size ? EDNSFIXEDSZ : 0); buf = ares_malloc(len); if (!buf) return ARES_ENOMEM; /* Set up the header. */ q = buf; memset(q, 0, HFIXEDSZ); DNS_HEADER_SET_QID(q, id); DNS_HEADER_SET_OPCODE(q, O_QUERY); if (rd) { DNS_HEADER_SET_RD(q, 1); } else { DNS_HEADER_SET_RD(q, 0); } DNS_HEADER_SET_QDCOUNT(q, 1); if (max_udp_size) { DNS_HEADER_SET_ARCOUNT(q, 1); } /* A name of "." is a screw case for the loop below, so adjust it. */ if (strcmp(name, ".") == 0) name++; /* Start writing out the name after the header. */ q += HFIXEDSZ; while (*name) { if (*name == '.') { ares_free (buf); return ARES_EBADNAME; } /* Count the number of bytes in this label. */ len = 0; for (p = name; *p && *p != '.'; p++) { if (*p == '\\' && *(p + 1) != 0) p++; len++; } if (len > MAXLABEL) { ares_free (buf); return ARES_EBADNAME; } /* Encode the length and copy the data. */ *q++ = (unsigned char)len; for (p = name; *p && *p != '.'; p++) { if (*p == '\\' && *(p + 1) != 0) p++; *q++ = *p; } /* Go to the next label and repeat, unless we hit the end. */ if (!*p) break; name = p + 1; } /* Add the zero-length label at the end. */ *q++ = 0; /* Finish off the question with the type and class. */ DNS_QUESTION_SET_TYPE(q, type); DNS_QUESTION_SET_CLASS(q, dnsclass); q += QFIXEDSZ; if (max_udp_size) { memset(q, 0, EDNSFIXEDSZ); q++; DNS_RR_SET_TYPE(q, T_OPT); DNS_RR_SET_CLASS(q, max_udp_size); q += (EDNSFIXEDSZ-1); } buflen = (q - buf); /* Reject names that are longer than the maximum of 255 bytes that's * specified in RFC 1035 ("To simplify implementations, the total length of * a domain name (i.e., label octets and label length octets) is restricted * to 255 octets or less."). */ if (buflen > (size_t)(MAXCDNAME + HFIXEDSZ + QFIXEDSZ + (max_udp_size ? EDNSFIXEDSZ : 0))) { ares_free (buf); return ARES_EBADNAME; } /* we know this fits in an int at this point */ *buflenp = (int) buflen; *bufp = buf; return ARES_SUCCESS; } ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares_data.c0000644000175100001770000001660400000000000021533 0ustar00runnerdocker00000000000000 /* Copyright (C) 2009-2013 by Daniel Stenberg * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ #include "ares_setup.h" #include #include "ares.h" #include "ares_data.h" #include "ares_private.h" /* ** ares_free_data() - c-ares external API function. ** ** This function must be used by the application to free data memory that ** has been internally allocated by some c-ares function and for which a ** pointer has already been returned to the calling application. The list ** of c-ares functions returning pointers that must be free'ed using this ** function is: ** ** ares_get_servers() ** ares_parse_srv_reply() ** ares_parse_txt_reply() */ void ares_free_data(void *dataptr) { while (dataptr != NULL) { struct ares_data *ptr; void *next_data = NULL; #ifdef __INTEL_COMPILER # pragma warning(push) # pragma warning(disable:1684) /* 1684: conversion from pointer to same-sized integral type */ #endif ptr = (void *)((char *)dataptr - offsetof(struct ares_data, data)); #ifdef __INTEL_COMPILER # pragma warning(pop) #endif if (ptr->mark != ARES_DATATYPE_MARK) return; switch (ptr->type) { case ARES_DATATYPE_MX_REPLY: if (ptr->data.mx_reply.next) next_data = ptr->data.mx_reply.next; if (ptr->data.mx_reply.host) ares_free(ptr->data.mx_reply.host); break; case ARES_DATATYPE_SRV_REPLY: if (ptr->data.srv_reply.next) next_data = ptr->data.srv_reply.next; if (ptr->data.srv_reply.host) ares_free(ptr->data.srv_reply.host); break; case ARES_DATATYPE_URI_REPLY: if (ptr->data.uri_reply.next) next_data = ptr->data.uri_reply.next; if (ptr->data.uri_reply.uri) ares_free(ptr->data.uri_reply.uri); break; case ARES_DATATYPE_TXT_REPLY: case ARES_DATATYPE_TXT_EXT: if (ptr->data.txt_reply.next) next_data = ptr->data.txt_reply.next; if (ptr->data.txt_reply.txt) ares_free(ptr->data.txt_reply.txt); break; case ARES_DATATYPE_ADDR_NODE: if (ptr->data.addr_node.next) next_data = ptr->data.addr_node.next; break; case ARES_DATATYPE_ADDR_PORT_NODE: if (ptr->data.addr_port_node.next) next_data = ptr->data.addr_port_node.next; break; case ARES_DATATYPE_NAPTR_REPLY: if (ptr->data.naptr_reply.next) next_data = ptr->data.naptr_reply.next; if (ptr->data.naptr_reply.flags) ares_free(ptr->data.naptr_reply.flags); if (ptr->data.naptr_reply.service) ares_free(ptr->data.naptr_reply.service); if (ptr->data.naptr_reply.regexp) ares_free(ptr->data.naptr_reply.regexp); if (ptr->data.naptr_reply.replacement) ares_free(ptr->data.naptr_reply.replacement); break; case ARES_DATATYPE_SOA_REPLY: if (ptr->data.soa_reply.nsname) ares_free(ptr->data.soa_reply.nsname); if (ptr->data.soa_reply.hostmaster) ares_free(ptr->data.soa_reply.hostmaster); break; case ARES_DATATYPE_CAA_REPLY: if (ptr->data.caa_reply.next) next_data = ptr->data.caa_reply.next; if (ptr->data.caa_reply.property) ares_free(ptr->data.caa_reply.property); if (ptr->data.caa_reply.value) ares_free(ptr->data.caa_reply.value); break; default: return; } ares_free(ptr); dataptr = next_data; } } /* ** ares_malloc_data() - c-ares internal helper function. ** ** This function allocates memory for a c-ares private ares_data struct ** for the specified ares_datatype, initializes c-ares private fields ** and zero initializes those which later might be used from the public ** API. It returns an interior pointer which can be passed by c-ares ** functions to the calling application, and that must be free'ed using ** c-ares external API function ares_free_data(). */ void *ares_malloc_data(ares_datatype type) { struct ares_data *ptr; ptr = ares_malloc(sizeof(struct ares_data)); if (!ptr) return NULL; switch (type) { case ARES_DATATYPE_MX_REPLY: ptr->data.mx_reply.next = NULL; ptr->data.mx_reply.host = NULL; ptr->data.mx_reply.priority = 0; break; case ARES_DATATYPE_SRV_REPLY: ptr->data.srv_reply.next = NULL; ptr->data.srv_reply.host = NULL; ptr->data.srv_reply.priority = 0; ptr->data.srv_reply.weight = 0; ptr->data.srv_reply.port = 0; break; case ARES_DATATYPE_URI_REPLY: ptr->data.uri_reply.next = NULL; ptr->data.uri_reply.priority = 0; ptr->data.uri_reply.weight = 0; ptr->data.uri_reply.uri = NULL; ptr->data.uri_reply.ttl = 0; break; case ARES_DATATYPE_TXT_EXT: ptr->data.txt_ext.record_start = 0; /* FALLTHROUGH */ case ARES_DATATYPE_TXT_REPLY: ptr->data.txt_reply.next = NULL; ptr->data.txt_reply.txt = NULL; ptr->data.txt_reply.length = 0; break; case ARES_DATATYPE_CAA_REPLY: ptr->data.caa_reply.next = NULL; ptr->data.caa_reply.plength = 0; ptr->data.caa_reply.property = NULL; ptr->data.caa_reply.length = 0; ptr->data.caa_reply.value = NULL; break; case ARES_DATATYPE_ADDR_NODE: ptr->data.addr_node.next = NULL; ptr->data.addr_node.family = 0; memset(&ptr->data.addr_node.addrV6, 0, sizeof(ptr->data.addr_node.addrV6)); break; case ARES_DATATYPE_ADDR_PORT_NODE: ptr->data.addr_port_node.next = NULL; ptr->data.addr_port_node.family = 0; ptr->data.addr_port_node.udp_port = 0; ptr->data.addr_port_node.tcp_port = 0; memset(&ptr->data.addr_port_node.addrV6, 0, sizeof(ptr->data.addr_port_node.addrV6)); break; case ARES_DATATYPE_NAPTR_REPLY: ptr->data.naptr_reply.next = NULL; ptr->data.naptr_reply.flags = NULL; ptr->data.naptr_reply.service = NULL; ptr->data.naptr_reply.regexp = NULL; ptr->data.naptr_reply.replacement = NULL; ptr->data.naptr_reply.order = 0; ptr->data.naptr_reply.preference = 0; break; case ARES_DATATYPE_SOA_REPLY: ptr->data.soa_reply.nsname = NULL; ptr->data.soa_reply.hostmaster = NULL; ptr->data.soa_reply.serial = 0; ptr->data.soa_reply.refresh = 0; ptr->data.soa_reply.retry = 0; ptr->data.soa_reply.expire = 0; ptr->data.soa_reply.minttl = 0; break; default: ares_free(ptr); return NULL; } ptr->mark = ARES_DATATYPE_MARK; ptr->type = type; return &ptr->data; } ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares_data.h0000644000175100001770000000641400000000000021536 0ustar00runnerdocker00000000000000 /* Copyright (C) 2009-2013 by Daniel Stenberg * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ typedef enum { ARES_DATATYPE_UNKNOWN = 1, /* unknown data type - introduced in 1.7.0 */ ARES_DATATYPE_SRV_REPLY, /* struct ares_srv_reply - introduced in 1.7.0 */ ARES_DATATYPE_TXT_REPLY, /* struct ares_txt_reply - introduced in 1.7.0 */ ARES_DATATYPE_TXT_EXT, /* struct ares_txt_ext - introduced in 1.11.0 */ ARES_DATATYPE_ADDR_NODE, /* struct ares_addr_node - introduced in 1.7.1 */ ARES_DATATYPE_MX_REPLY, /* struct ares_mx_reply - introduced in 1.7.2 */ ARES_DATATYPE_NAPTR_REPLY,/* struct ares_naptr_reply - introduced in 1.7.6 */ ARES_DATATYPE_SOA_REPLY, /* struct ares_soa_reply - introduced in 1.9.0 */ ARES_DATATYPE_URI_REPLY, /* struct ares_uri_reply */ #if 0 ARES_DATATYPE_ADDR6TTL, /* struct ares_addrttl */ ARES_DATATYPE_ADDRTTL, /* struct ares_addr6ttl */ ARES_DATATYPE_HOSTENT, /* struct hostent */ ARES_DATATYPE_OPTIONS, /* struct ares_options */ #endif ARES_DATATYPE_ADDR_PORT_NODE, /* struct ares_addr_port_node - introduced in 1.11.0 */ ARES_DATATYPE_CAA_REPLY, /* struct ares_caa_reply - introduced in 1.17 */ ARES_DATATYPE_LAST /* not used - introduced in 1.7.0 */ } ares_datatype; #define ARES_DATATYPE_MARK 0xbead /* * ares_data struct definition is internal to c-ares and shall not * be exposed by the public API in order to allow future changes * and extensions to it without breaking ABI. This will be used * internally by c-ares as the container of multiple types of data * dynamically allocated for which a reference will be returned * to the calling application. * * c-ares API functions returning a pointer to c-ares internally * allocated data will actually be returning an interior pointer * into this ares_data struct. * * All this is 'invisible' to the calling application, the only * requirement is that this kind of data must be free'ed by the * calling application using ares_free_data() with the pointer * it has received from a previous c-ares function call. */ struct ares_data { ares_datatype type; /* Actual data type identifier. */ unsigned int mark; /* Private ares_data signature. */ union { struct ares_txt_reply txt_reply; struct ares_txt_ext txt_ext; struct ares_srv_reply srv_reply; struct ares_addr_node addr_node; struct ares_addr_port_node addr_port_node; struct ares_mx_reply mx_reply; struct ares_naptr_reply naptr_reply; struct ares_soa_reply soa_reply; struct ares_caa_reply caa_reply; struct ares_uri_reply uri_reply; } data; }; void *ares_malloc_data(ares_datatype type); ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares_destroy.c0000644000175100001770000000601200000000000022303 0ustar00runnerdocker00000000000000 /* Copyright 1998 by the Massachusetts Institute of Technology. * Copyright (C) 2004-2011 by Daniel Stenberg * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ #include "ares_setup.h" #include #include "ares.h" #include "ares_private.h" void ares_destroy_options(struct ares_options *options) { int i; if(options->servers) ares_free(options->servers); for (i = 0; i < options->ndomains; i++) ares_free(options->domains[i]); if(options->domains) ares_free(options->domains); if(options->sortlist) ares_free(options->sortlist); if(options->lookups) ares_free(options->lookups); if(options->resolvconf_path) ares_free(options->resolvconf_path); } void ares_destroy(ares_channel channel) { int i; struct query *query; struct list_node* list_head; struct list_node* list_node; if (!channel) return; list_head = &(channel->all_queries); for (list_node = list_head->next; list_node != list_head; ) { query = list_node->data; list_node = list_node->next; /* since we're deleting the query */ query->callback(query->arg, ARES_EDESTRUCTION, 0, NULL, 0); ares__free_query(query); } #ifndef NDEBUG /* Freeing the query should remove it from all the lists in which it sits, * so all query lists should be empty now. */ assert(ares__is_list_empty(&(channel->all_queries))); for (i = 0; i < ARES_QID_TABLE_SIZE; i++) { assert(ares__is_list_empty(&(channel->queries_by_qid[i]))); } for (i = 0; i < ARES_TIMEOUT_TABLE_SIZE; i++) { assert(ares__is_list_empty(&(channel->queries_by_timeout[i]))); } #endif ares__destroy_servers_state(channel); if (channel->domains) { for (i = 0; i < channel->ndomains; i++) ares_free(channel->domains[i]); ares_free(channel->domains); } if(channel->sortlist) ares_free(channel->sortlist); if (channel->lookups) ares_free(channel->lookups); if (channel->resolvconf_path) ares_free(channel->resolvconf_path); ares_free(channel); } void ares__destroy_servers_state(ares_channel channel) { struct server_state *server; int i; if (channel->servers) { for (i = 0; i < channel->nservers; i++) { server = &channel->servers[i]; ares__close_sockets(channel, server); assert(ares__is_list_empty(&server->queries_to_server)); } ares_free(channel->servers); channel->servers = NULL; } channel->nservers = -1; } ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares_expand_name.c0000644000175100001770000002145000000000000023074 0ustar00runnerdocker00000000000000 /* Copyright 1998, 2011 by the Massachusetts Institute of Technology. * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ #include "ares_setup.h" #ifdef HAVE_NETINET_IN_H # include #endif #include "ares_nameser.h" #include "ares.h" #include "ares_nowarn.h" #include "ares_private.h" /* for the memdebug */ /* Maximum number of indirections allowed for a name */ #define MAX_INDIRS 50 static int name_length(const unsigned char *encoded, const unsigned char *abuf, int alen, int is_hostname); /* Reserved characters for names that need to be escaped */ static int is_reservedch(int ch) { switch (ch) { case '"': case '.': case ';': case '\\': case '(': case ')': case '@': case '$': return 1; default: break; } return 0; } static int ares__isprint(int ch) { if (ch >= 0x20 && ch <= 0x7E) return 1; return 0; } /* 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) * 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). */ static int is_hostnamech(int ch) { /* [A-Za-z0-9-._/] * Don't use isalnum() as it is locale-specific */ if (ch >= 'A' && ch <= 'Z') return 1; if (ch >= 'a' && ch <= 'z') return 1; if (ch >= '0' && ch <= '9') return 1; if (ch == '-' || ch == '.' || ch == '_' || ch == '/') return 1; return 0; } /* Expand an RFC1035-encoded domain name given by encoded. The * containing message is given by abuf and alen. The result given by * *s, which is set to a NUL-terminated allocated buffer. *enclen is * set to the length of the encoded name (not the length of the * expanded name; the goal is to tell the caller how many bytes to * move forward to get past the encoded name). * * In the simple case, an encoded name is a series of labels, each * composed of a one-byte length (limited to values between 0 and 63 * inclusive) followed by the label contents. The name is terminated * by a zero-length label. * * In the more complicated case, a label may be terminated by an * indirection pointer, specified by two bytes with the high bits of * the first byte (corresponding to INDIR_MASK) set to 11. With the * two high bits of the first byte stripped off, the indirection * pointer gives an offset from the beginning of the containing * message with more labels to decode. Indirection can happen an * arbitrary number of times, so we have to detect loops. * * Since the expanded name uses '.' as a label separator, we use * backslashes to escape periods or backslashes in the expanded name. * * If the result is expected to be a hostname, then no escaped data is allowed * and will return error. */ int ares__expand_name_validated(const unsigned char *encoded, const unsigned char *abuf, int alen, char **s, long *enclen, int is_hostname) { int len, indir = 0; char *q; const unsigned char *p; union { ares_ssize_t sig; size_t uns; } nlen; nlen.sig = name_length(encoded, abuf, alen, is_hostname); if (nlen.sig < 0) return ARES_EBADNAME; *s = ares_malloc(nlen.uns + 1); if (!*s) return ARES_ENOMEM; q = *s; if (nlen.uns == 0) { /* RFC2181 says this should be ".": the root of the DNS tree. * Since this function strips trailing dots though, it becomes "" */ q[0] = '\0'; /* indirect root label (like 0xc0 0x0c) is 2 bytes long (stupid, but valid) */ if ((*encoded & INDIR_MASK) == INDIR_MASK) *enclen = 2L; else *enclen = 1L; /* the caller should move one byte to get past this */ return ARES_SUCCESS; } /* No error-checking necessary; it was all done by name_length(). */ p = encoded; while (*p) { if ((*p & INDIR_MASK) == INDIR_MASK) { if (!indir) { *enclen = aresx_uztosl(p + 2U - encoded); indir = 1; } p = abuf + ((*p & ~INDIR_MASK) << 8 | *(p + 1)); } else { int name_len = *p; len = name_len; p++; while (len--) { /* Output as \DDD for consistency with RFC1035 5.1, except * for the special case of a root name response */ if (!ares__isprint(*p) && !(name_len == 1 && *p == 0)) { *q++ = '\\'; *q++ = '0' + *p / 100; *q++ = '0' + (*p % 100) / 10; *q++ = '0' + (*p % 10); } else if (is_reservedch(*p)) { *q++ = '\\'; *q++ = *p; } else { *q++ = *p; } p++; } *q++ = '.'; } } if (!indir) *enclen = aresx_uztosl(p + 1U - encoded); /* Nuke the trailing period if we wrote one. */ if (q > *s) *(q - 1) = 0; else *q = 0; /* zero terminate; LCOV_EXCL_LINE: empty names exit above */ return ARES_SUCCESS; } int ares_expand_name(const unsigned char *encoded, const unsigned char *abuf, int alen, char **s, long *enclen) { return ares__expand_name_validated(encoded, abuf, alen, s, enclen, 0); } /* Return the length of the expansion of an encoded domain name, or * -1 if the encoding is invalid. */ static int name_length(const unsigned char *encoded, const unsigned char *abuf, int alen, int is_hostname) { int n = 0, offset, indir = 0, top; /* Allow the caller to pass us abuf + alen and have us check for it. */ if (encoded >= abuf + alen) return -1; while (*encoded) { top = (*encoded & INDIR_MASK); if (top == INDIR_MASK) { /* Check the offset and go there. */ if (encoded + 1 >= abuf + alen) return -1; offset = (*encoded & ~INDIR_MASK) << 8 | *(encoded + 1); if (offset >= alen) return -1; encoded = abuf + offset; /* If we've seen more indirects than the message length, * then there's a loop. */ ++indir; if (indir > alen || indir > MAX_INDIRS) return -1; } else if (top == 0x00) { int name_len = *encoded; offset = name_len; if (encoded + offset + 1 >= abuf + alen) return -1; encoded++; while (offset--) { if (!ares__isprint(*encoded) && !(name_len == 1 && *encoded == 0)) { if (is_hostname) return -1; n += 4; } else if (is_reservedch(*encoded)) { if (is_hostname) return -1; n += 2; } else { if (is_hostname && !is_hostnamech(*encoded)) return -1; n += 1; } encoded++; } n++; } else { /* RFC 1035 4.1.4 says other options (01, 10) for top 2 * bits are reserved. */ return -1; } } /* If there were any labels at all, then the number of dots is one * less than the number of labels, so subtract one. */ return (n) ? n - 1 : n; } /* Like ares_expand_name_validated but returns EBADRESP in case of invalid * input. */ int ares__expand_name_for_response(const unsigned char *encoded, const unsigned char *abuf, int alen, char **s, long *enclen, int is_hostname) { int status = ares__expand_name_validated(encoded, abuf, alen, s, enclen, is_hostname); if (status == ARES_EBADNAME) status = ARES_EBADRESP; return status; } ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares_expand_string.c0000644000175100001770000000341400000000000023462 0ustar00runnerdocker00000000000000 /* Copyright 1998 by the Massachusetts Institute of Technology. * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ #include "ares_setup.h" #ifdef HAVE_NETINET_IN_H # include #endif #include "ares_nameser.h" #include "ares.h" #include "ares_private.h" /* for the memdebug */ /* Simply decodes a length-encoded character string. The first byte of the * input is the length of the string to be returned and the bytes thereafter * are the characters of the string. The returned result will be NULL * terminated. */ int ares_expand_string(const unsigned char *encoded, const unsigned char *abuf, int alen, unsigned char **s, long *enclen) { unsigned char *q; union { ares_ssize_t sig; size_t uns; } elen; if (encoded == abuf+alen) return ARES_EBADSTR; elen.uns = *encoded; if (encoded+elen.sig+1 > abuf+alen) return ARES_EBADSTR; encoded++; *s = ares_malloc(elen.uns+1); if (*s == NULL) return ARES_ENOMEM; q = *s; strncpy((char *)q, (char *)encoded, elen.uns); q[elen.uns] = '\0'; *s = q; *enclen = (long)(elen.sig+1); return ARES_SUCCESS; } ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares_fds.c0000644000175100001770000000365700000000000021402 0ustar00runnerdocker00000000000000 /* Copyright 1998 by the Massachusetts Institute of Technology. * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ #include "ares_setup.h" #include "ares.h" #include "ares_nowarn.h" #include "ares_private.h" int ares_fds(ares_channel channel, fd_set *read_fds, fd_set *write_fds) { struct server_state *server; ares_socket_t nfds; int i; /* Are there any active queries? */ int active_queries = !ares__is_list_empty(&(channel->all_queries)); nfds = 0; for (i = 0; i < channel->nservers; i++) { server = &channel->servers[i]; /* We only need to register interest in UDP sockets if we have * outstanding queries. */ if (active_queries && server->udp_socket != ARES_SOCKET_BAD) { FD_SET(server->udp_socket, read_fds); if (server->udp_socket >= nfds) nfds = server->udp_socket + 1; } /* We always register for TCP events, because we want to know * when the other side closes the connection, so we don't waste * time trying to use a broken connection. */ if (server->tcp_socket != ARES_SOCKET_BAD) { FD_SET(server->tcp_socket, read_fds); if (server->qhead) FD_SET(server->tcp_socket, write_fds); if (server->tcp_socket >= nfds) nfds = server->tcp_socket + 1; } } return (int)nfds; } ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares_free_hostent.c0000644000175100001770000000243000000000000023277 0ustar00runnerdocker00000000000000 /* Copyright 1998 by the Massachusetts Institute of Technology. * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ #include "ares_setup.h" #ifdef HAVE_NETDB_H #include #endif #include "ares.h" #include "ares_private.h" /* for memdebug */ void ares_free_hostent(struct hostent *host) { char **p; if (!host) return; ares_free((char *)(host->h_name)); for (p = host->h_aliases; p && *p; p++) ares_free(*p); ares_free(host->h_aliases); if (host->h_addr_list) { ares_free(host->h_addr_list[0]); /* no matter if there is one or many entries, there is only one malloc for all of them */ ares_free(host->h_addr_list); } ares_free(host); } ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares_free_string.c0000644000175100001770000000147700000000000023133 0ustar00runnerdocker00000000000000 /* Copyright 2000 by the Massachusetts Institute of Technology. * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ #include "ares_setup.h" #include "ares.h" #include "ares_private.h" void ares_free_string(void *str) { ares_free(str); } ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares_freeaddrinfo.c0000644000175100001770000000306400000000000023246 0ustar00runnerdocker00000000000000 /* Copyright 1998 by the Massachusetts Institute of Technology. * Copyright (C) 2019 by Andrew Selivanov * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ #include "ares_setup.h" #ifdef HAVE_NETDB_H # include #endif #include "ares.h" #include "ares_private.h" void ares__freeaddrinfo_cnames(struct ares_addrinfo_cname *head) { struct ares_addrinfo_cname *current; while (head) { current = head; head = head->next; ares_free(current->alias); ares_free(current->name); ares_free(current); } } void ares__freeaddrinfo_nodes(struct ares_addrinfo_node *head) { struct ares_addrinfo_node *current; while (head) { current = head; head = head->ai_next; ares_free(current->ai_addr); ares_free(current); } } void ares_freeaddrinfo(struct ares_addrinfo *ai) { if (ai == NULL) return; ares__freeaddrinfo_cnames(ai->cnames); ares__freeaddrinfo_nodes(ai->nodes); ares_free(ai->name); ares_free(ai); } ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares_getaddrinfo.c0000644000175100001770000005026700000000000023113 0ustar00runnerdocker00000000000000 /* Copyright 1998, 2011, 2013 by the Massachusetts Institute of Technology. * Copyright (C) 2017 - 2018 by Christian Ammer * Copyright (C) 2019 by Andrew Selivanov * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ #include "ares_setup.h" #ifdef HAVE_GETSERVBYNAME_R # if !defined(GETSERVBYNAME_R_ARGS) || \ (GETSERVBYNAME_R_ARGS < 4) || (GETSERVBYNAME_R_ARGS > 6) # error "you MUST specifiy a valid number of arguments for getservbyname_r" # endif #endif #ifdef HAVE_NETINET_IN_H # include #endif #ifdef HAVE_NETDB_H # include #endif #ifdef HAVE_ARPA_INET_H # include #endif #include "ares_nameser.h" #ifdef HAVE_STRINGS_H #include #endif #include #ifdef HAVE_LIMITS_H #include #endif #include "ares.h" #include "bitncmp.h" #include "ares_private.h" #ifdef WATT32 #undef WIN32 #endif #ifdef WIN32 # include "ares_platform.h" #endif struct host_query { ares_channel channel; char *name; unsigned short port; /* in host order */ ares_addrinfo_callback callback; void *arg; struct ares_addrinfo_hints hints; int sent_family; /* this family is what was is being used */ int timeouts; /* number of timeouts we saw for this request */ const char *remaining_lookups; /* types of lookup we need to perform ("fb" by default, file and dns respectively) */ struct ares_addrinfo *ai; /* store results between lookups */ int remaining; /* number of DNS answers waiting for */ int next_domain; /* next search domain to try */ int nodata_cnt; /* Track nodata responses to possibly override final result */ }; static const struct ares_addrinfo_hints default_hints = { 0, /* ai_flags */ AF_UNSPEC, /* ai_family */ 0, /* ai_socktype */ 0, /* ai_protocol */ }; static const struct ares_addrinfo_cname empty_addrinfo_cname = { INT_MAX, /* ttl */ NULL, /* alias */ NULL, /* name */ NULL, /* next */ }; static const struct ares_addrinfo_node empty_addrinfo_node = { 0, /* ai_ttl */ 0, /* ai_flags */ 0, /* ai_family */ 0, /* ai_socktype */ 0, /* ai_protocol */ 0, /* ai_addrlen */ NULL, /* ai_addr */ NULL /* ai_next */ }; static const struct ares_addrinfo empty_addrinfo = { NULL, /* cnames */ NULL, /* nodes */ NULL /* name */ }; /* forward declarations */ static void host_callback(void *arg, int status, int timeouts, unsigned char *abuf, int alen); static int as_is_first(const struct host_query *hquery); static int as_is_only(const struct host_query* hquery); static int next_dns_lookup(struct host_query *hquery); struct ares_addrinfo_cname *ares__malloc_addrinfo_cname() { struct ares_addrinfo_cname *cname = ares_malloc(sizeof(struct ares_addrinfo_cname)); if (!cname) return NULL; *cname = empty_addrinfo_cname; return cname; } struct ares_addrinfo_cname *ares__append_addrinfo_cname(struct ares_addrinfo_cname **head) { struct ares_addrinfo_cname *tail = ares__malloc_addrinfo_cname(); struct ares_addrinfo_cname *last = *head; if (!last) { *head = tail; return tail; } while (last->next) { last = last->next; } last->next = tail; return tail; } void ares__addrinfo_cat_cnames(struct ares_addrinfo_cname **head, struct ares_addrinfo_cname *tail) { struct ares_addrinfo_cname *last = *head; if (!last) { *head = tail; return; } while (last->next) { last = last->next; } last->next = tail; } struct ares_addrinfo *ares__malloc_addrinfo() { struct ares_addrinfo *ai = ares_malloc(sizeof(struct ares_addrinfo)); if (!ai) return NULL; *ai = empty_addrinfo; return ai; } struct ares_addrinfo_node *ares__malloc_addrinfo_node() { struct ares_addrinfo_node *node = ares_malloc(sizeof(struct ares_addrinfo_node)); if (!node) return NULL; *node = empty_addrinfo_node; return node; } /* Allocate new addrinfo and append to the tail. */ struct ares_addrinfo_node *ares__append_addrinfo_node(struct ares_addrinfo_node **head) { struct ares_addrinfo_node *tail = ares__malloc_addrinfo_node(); struct ares_addrinfo_node *last = *head; if (!last) { *head = tail; return tail; } while (last->ai_next) { last = last->ai_next; } last->ai_next = tail; return tail; } void ares__addrinfo_cat_nodes(struct ares_addrinfo_node **head, struct ares_addrinfo_node *tail) { struct ares_addrinfo_node *last = *head; if (!last) { *head = tail; return; } while (last->ai_next) { last = last->ai_next; } last->ai_next = tail; } /* Resolve service name into port number given in host byte order. * If not resolved, return 0. */ static unsigned short lookup_service(const char *service, int flags) { const char *proto; struct servent *sep; #ifdef HAVE_GETSERVBYNAME_R struct servent se; char tmpbuf[4096]; #endif if (service) { if (flags & ARES_NI_UDP) proto = "udp"; else if (flags & ARES_NI_SCTP) proto = "sctp"; else if (flags & ARES_NI_DCCP) proto = "dccp"; else proto = "tcp"; #ifdef HAVE_GETSERVBYNAME_R memset(&se, 0, sizeof(se)); sep = &se; memset(tmpbuf, 0, sizeof(tmpbuf)); #if GETSERVBYNAME_R_ARGS == 6 if (getservbyname_r(service, proto, &se, (void *)tmpbuf, sizeof(tmpbuf), &sep) != 0) sep = NULL; /* LCOV_EXCL_LINE: buffer large so this never fails */ #elif GETSERVBYNAME_R_ARGS == 5 sep = getservbyname_r(service, proto, &se, (void *)tmpbuf, sizeof(tmpbuf)); #elif GETSERVBYNAME_R_ARGS == 4 if (getservbyname_r(service, proto, &se, (void *)tmpbuf) != 0) sep = NULL; #else /* Lets just hope the OS uses TLS! */ sep = getservbyname(service, proto); #endif #else /* Lets just hope the OS uses TLS! */ #if (defined(NETWARE) && !defined(__NOVELL_LIBC__)) sep = getservbyname(service, (char *)proto); #else sep = getservbyname(service, proto); #endif #endif return (sep ? ntohs((unsigned short)sep->s_port) : 0); } return 0; } /* If the name looks like an IP address or an error occured, * fake up a host entry, end the query immediately, and return true. * Otherwise return false. */ static int fake_addrinfo(const char *name, unsigned short port, const struct ares_addrinfo_hints *hints, struct ares_addrinfo *ai, ares_addrinfo_callback callback, void *arg) { struct ares_addrinfo_cname *cname; int status = ARES_SUCCESS; int result = 0; int family = hints->ai_family; if (family == AF_INET || family == AF_INET6 || family == AF_UNSPEC) { /* It only looks like an IP address if it's all numbers and dots. */ int numdots = 0, valid = 1; const char *p; for (p = name; *p; p++) { if (!ISDIGIT(*p) && *p != '.') { valid = 0; break; } else if (*p == '.') { numdots++; } } /* if we don't have 3 dots, it is illegal * (although inet_pton doesn't think so). */ if (numdots != 3 || !valid) result = 0; else { struct in_addr addr4; result = ares_inet_pton(AF_INET, name, &addr4) < 1 ? 0 : 1; if (result) { status = ares_append_ai_node(AF_INET, port, 0, &addr4, &ai->nodes); if (status != ARES_SUCCESS) { callback(arg, status, 0, NULL); return 1; } } } } if (family == AF_INET6 || family == AF_UNSPEC) { struct ares_in6_addr addr6; result = ares_inet_pton(AF_INET6, name, &addr6) < 1 ? 0 : 1; if (result) { status = ares_append_ai_node(AF_INET6, port, 0, &addr6, &ai->nodes); if (status != ARES_SUCCESS) { callback(arg, status, 0, NULL); return 1; } } } if (!result) return 0; if (hints->ai_flags & ARES_AI_CANONNAME) { cname = ares__append_addrinfo_cname(&ai->cnames); if (!cname) { ares_freeaddrinfo(ai); callback(arg, ARES_ENOMEM, 0, NULL); return 1; } /* Duplicate the name, to avoid a constness violation. */ cname->name = ares_strdup(name); if (!cname->name) { ares_freeaddrinfo(ai); callback(arg, ARES_ENOMEM, 0, NULL); return 1; } } ai->nodes->ai_socktype = hints->ai_socktype; ai->nodes->ai_protocol = hints->ai_protocol; callback(arg, ARES_SUCCESS, 0, ai); return 1; } static void end_hquery(struct host_query *hquery, int status) { struct ares_addrinfo_node sentinel; struct ares_addrinfo_node *next; 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); hquery->ai->nodes = sentinel.ai_next; } next = hquery->ai->nodes; while (next) { next->ai_socktype = hquery->hints.ai_socktype; next->ai_protocol = hquery->hints.ai_protocol; next = next->ai_next; } } else { /* Clean up what we have collected by so far. */ ares_freeaddrinfo(hquery->ai); hquery->ai = NULL; } hquery->callback(hquery->arg, status, hquery->timeouts, hquery->ai); ares_free(hquery->name); ares_free(hquery); } static int file_lookup(struct host_query *hquery) { FILE *fp; int error; int status; const char *path_hosts = NULL; if (hquery->hints.ai_flags & ARES_AI_ENVHOSTS) { path_hosts = getenv("CARES_HOSTS"); } if (!path_hosts) { #ifdef WIN32 char PATH_HOSTS[MAX_PATH]; win_platform platform; PATH_HOSTS[0] = '\0'; platform = ares__getplatform(); if (platform == WIN_NT) { char tmp[MAX_PATH]; HKEY hkeyHosts; if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, WIN_NS_NT_KEY, 0, KEY_READ, &hkeyHosts) == ERROR_SUCCESS) { DWORD dwLength = MAX_PATH; RegQueryValueExA(hkeyHosts, DATABASEPATH, NULL, NULL, (LPBYTE)tmp, &dwLength); ExpandEnvironmentStringsA(tmp, PATH_HOSTS, MAX_PATH); RegCloseKey(hkeyHosts); } } else if (platform == WIN_9X) GetWindowsDirectoryA(PATH_HOSTS, MAX_PATH); else return ARES_ENOTFOUND; strcat(PATH_HOSTS, WIN_PATH_HOSTS); path_hosts = PATH_HOSTS; #elif defined(WATT32) const char *PATH_HOSTS = _w32_GetHostsFile(); if (!PATH_HOSTS) return ARES_ENOTFOUND; #endif path_hosts = PATH_HOSTS; } fp = fopen(path_hosts, "r"); if (!fp) { error = ERRNO; switch (error) { case ENOENT: case ESRCH: return ARES_ENOTFOUND; default: DEBUGF(fprintf(stderr, "fopen() failed with error: %d %s\n", error, strerror(error))); DEBUGF(fprintf(stderr, "Error opening file: %s\n", path_hosts)); return ARES_EFILE; } } status = ares__readaddrinfo(fp, hquery->name, hquery->port, &hquery->hints, hquery->ai); fclose(fp); /* RFC6761 section 6.3 #3 states that "Name resolution APIs and libraries * SHOULD recognize localhost names as special and SHOULD always return the * IP loopback address for address queries" */ if (status == ARES_ENOTFOUND && strcmp(hquery->name, "localhost") == 0) { return ares__addrinfo_localhost(hquery->name, hquery->port, &hquery->hints, hquery->ai); } return status; } static void next_lookup(struct host_query *hquery, int status) { switch (*hquery->remaining_lookups) { case 'b': /* RFC6761 section 6.3 #3 says "Name resolution APIs SHOULD NOT send * queries for localhost names to their configured caching DNS * server(s)." */ if (strcmp(hquery->name, "localhost") != 0) { /* DNS lookup */ if (next_dns_lookup(hquery)) break; } hquery->remaining_lookups++; next_lookup(hquery, status); break; case 'f': /* Host file lookup */ if (file_lookup(hquery) == ARES_SUCCESS) { end_hquery(hquery, ARES_SUCCESS); break; } hquery->remaining_lookups++; next_lookup(hquery, status); break; default: /* No lookup left */ end_hquery(hquery, status); break; } } static void host_callback(void *arg, int status, int timeouts, unsigned char *abuf, int alen) { struct host_query *hquery = (struct host_query*)arg; int addinfostatus = ARES_SUCCESS; hquery->timeouts += timeouts; hquery->remaining--; if (status == ARES_SUCCESS) { addinfostatus = ares__parse_into_addrinfo(abuf, alen, 1, hquery->port, hquery->ai); } if (!hquery->remaining) { if (addinfostatus != ARES_SUCCESS && addinfostatus != ARES_ENODATA) { /* error in parsing result e.g. no memory */ end_hquery(hquery, addinfostatus); } else if (hquery->ai->nodes) { /* at least one query ended with ARES_SUCCESS */ end_hquery(hquery, ARES_SUCCESS); } else if (status == ARES_ENOTFOUND || status == ARES_ENODATA || addinfostatus == ARES_ENODATA) { if (status == ARES_ENODATA || addinfostatus == ARES_ENODATA) hquery->nodata_cnt++; next_lookup(hquery, hquery->nodata_cnt?ARES_ENODATA:status); } else if (status == ARES_EDESTRUCTION) { /* NOTE: Could also be ARES_EDESTRUCTION. We need to only call this * once all queries (there can be multiple for getaddrinfo) are * terminated. */ end_hquery(hquery, status); } else { end_hquery(hquery, status); } } /* at this point we keep on waiting for the next query to finish */ } void ares_getaddrinfo(ares_channel channel, const char* name, const char* service, const struct ares_addrinfo_hints* hints, ares_addrinfo_callback callback, void* arg) { struct host_query *hquery; unsigned short port = 0; int family; struct ares_addrinfo *ai; char *alias_name = NULL; int status; if (!hints) { hints = &default_hints; } family = hints->ai_family; /* Right now we only know how to look up Internet addresses and unspec means try both basically. */ if (family != AF_INET && family != AF_INET6 && family != AF_UNSPEC) { callback(arg, ARES_ENOTIMP, 0, NULL); return; } if (ares__is_onion_domain(name)) { callback(arg, ARES_ENOTFOUND, 0, NULL); return; } /* perform HOSTALIAS resolution (technically this function does some other * things we are going to ignore) */ status = ares__single_domain(channel, name, &alias_name); if (status != ARES_SUCCESS) { callback(arg, status, 0, NULL); return; } if (alias_name) name = alias_name; if (service) { if (hints->ai_flags & ARES_AI_NUMERICSERV) { port = (unsigned short)strtoul(service, NULL, 0); if (!port) { ares_free(alias_name); callback(arg, ARES_ESERVICE, 0, NULL); return; } } else { port = lookup_service(service, 0); if (!port) { port = (unsigned short)strtoul(service, NULL, 0); if (!port) { ares_free(alias_name); callback(arg, ARES_ESERVICE, 0, NULL); return; } } } } ai = ares__malloc_addrinfo(); if (!ai) { ares_free(alias_name); callback(arg, ARES_ENOMEM, 0, NULL); return; } if (fake_addrinfo(name, port, hints, ai, callback, arg)) { ares_free(alias_name); return; } /* Allocate and fill in the host query structure. */ hquery = ares_malloc(sizeof(struct host_query)); if (!hquery) { ares_free(alias_name); ares_freeaddrinfo(ai); callback(arg, ARES_ENOMEM, 0, NULL); return; } hquery->name = ares_strdup(name); ares_free(alias_name); if (!hquery->name) { ares_free(hquery); ares_freeaddrinfo(ai); callback(arg, ARES_ENOMEM, 0, NULL); return; } hquery->port = port; hquery->channel = channel; hquery->hints = *hints; hquery->sent_family = -1; /* nothing is sent yet */ hquery->callback = callback; hquery->arg = arg; hquery->remaining_lookups = channel->lookups; hquery->timeouts = 0; hquery->ai = ai; hquery->next_domain = -1; hquery->remaining = 0; hquery->nodata_cnt = 0; /* Start performing lookups according to channel->lookups. */ next_lookup(hquery, ARES_ECONNREFUSED /* initial error code */); } static int next_dns_lookup(struct host_query *hquery) { char *s = NULL; int is_s_allocated = 0; int status; /* if next_domain == -1 and as_is_first is true, try hquery->name */ if (hquery->next_domain == -1) { if (as_is_first(hquery)) { s = hquery->name; } hquery->next_domain = 0; } /* if as_is_first is false, try hquery->name at last */ if (!s && hquery->next_domain == hquery->channel->ndomains) { if (!as_is_first(hquery)) { s = hquery->name; } hquery->next_domain++; } if (!s && hquery->next_domain < hquery->channel->ndomains && !as_is_only(hquery)) { status = ares__cat_domain( hquery->name, hquery->channel->domains[hquery->next_domain++], &s); if (status == ARES_SUCCESS) { is_s_allocated = 1; } } if (s) { switch (hquery->hints.ai_family) { case AF_INET: hquery->remaining += 1; ares_query(hquery->channel, s, C_IN, T_A, host_callback, hquery); break; case AF_INET6: hquery->remaining += 1; ares_query(hquery->channel, s, C_IN, T_AAAA, host_callback, hquery); break; case AF_UNSPEC: hquery->remaining += 2; ares_query(hquery->channel, s, C_IN, T_A, host_callback, hquery); ares_query(hquery->channel, s, C_IN, T_AAAA, host_callback, hquery); break; default: break; } if (is_s_allocated) { ares_free(s); } return 1; } else { assert(!hquery->ai->nodes); return 0; } } static int as_is_first(const struct host_query* hquery) { char* p; int ndots = 0; size_t nname = hquery->name?strlen(hquery->name):0; for (p = hquery->name; *p; p++) { if (*p == '.') { ndots++; } } if (nname && hquery->name[nname-1] == '.') { /* prevent ARES_EBADNAME for valid FQDN, where ndots < channel->ndots */ return 1; } return ndots >= hquery->channel->ndots; } static int as_is_only(const struct host_query* hquery) { size_t nname = hquery->name?strlen(hquery->name):0; if (nname && hquery->name[nname-1] == '.') return 1; return 0; } ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares_getenv.c0000644000175100001770000000151100000000000022101 0ustar00runnerdocker00000000000000 /* Copyright 1998 by the Massachusetts Institute of Technology. * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ #include "ares_setup.h" #include "ares_getenv.h" #ifndef HAVE_GETENV char *ares_getenv(const char *name) { return NULL; } #endif ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares_getenv.h0000644000175100001770000000160300000000000022110 0ustar00runnerdocker00000000000000#ifndef HEADER_CARES_GETENV_H #define HEADER_CARES_GETENV_H /* Copyright 1998 by the Massachusetts Institute of Technology. * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ #include "ares_setup.h" #ifndef HAVE_GETENV extern char *ares_getenv(const char *name); #endif #endif /* HEADER_CARES_GETENV_H */ ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares_gethostbyaddr.c0000644000175100001770000002045500000000000023464 0ustar00runnerdocker00000000000000 /* Copyright 1998 by the Massachusetts Institute of Technology. * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ #include "ares_setup.h" #ifdef HAVE_NETINET_IN_H # include #endif #ifdef HAVE_NETDB_H # include #endif #ifdef HAVE_ARPA_INET_H # include #endif #include "ares_nameser.h" #include "ares.h" #include "ares_inet_net_pton.h" #include "ares_platform.h" #include "ares_private.h" #ifdef WATT32 #undef WIN32 #endif struct addr_query { /* Arguments passed to ares_gethostbyaddr() */ ares_channel channel; struct ares_addr addr; ares_host_callback callback; void *arg; const char *remaining_lookups; int timeouts; }; static void next_lookup(struct addr_query *aquery); static void addr_callback(void *arg, int status, int timeouts, unsigned char *abuf, int alen); static void end_aquery(struct addr_query *aquery, int status, struct hostent *host); static int file_lookup(struct ares_addr *addr, struct hostent **host); static void ptr_rr_name(char *name, const struct ares_addr *addr); void ares_gethostbyaddr(ares_channel channel, const void *addr, int addrlen, int family, ares_host_callback callback, void *arg) { struct addr_query *aquery; if (family != AF_INET && family != AF_INET6) { callback(arg, ARES_ENOTIMP, 0, NULL); return; } if ((family == AF_INET && addrlen != sizeof(aquery->addr.addrV4)) || (family == AF_INET6 && addrlen != sizeof(aquery->addr.addrV6))) { callback(arg, ARES_ENOTIMP, 0, NULL); return; } aquery = ares_malloc(sizeof(struct addr_query)); if (!aquery) { callback(arg, ARES_ENOMEM, 0, NULL); return; } aquery->channel = channel; if (family == AF_INET) memcpy(&aquery->addr.addrV4, addr, sizeof(aquery->addr.addrV4)); else memcpy(&aquery->addr.addrV6, addr, sizeof(aquery->addr.addrV6)); aquery->addr.family = family; aquery->callback = callback; aquery->arg = arg; aquery->remaining_lookups = channel->lookups; aquery->timeouts = 0; next_lookup(aquery); } static void next_lookup(struct addr_query *aquery) { const char *p; char name[128]; int status; struct hostent *host; for (p = aquery->remaining_lookups; *p; p++) { switch (*p) { case 'b': ptr_rr_name(name, &aquery->addr); aquery->remaining_lookups = p + 1; ares_query(aquery->channel, name, C_IN, T_PTR, addr_callback, aquery); return; case 'f': status = file_lookup(&aquery->addr, &host); /* this status check below previously checked for !ARES_ENOTFOUND, but we should not assume that this single error code is the one that can occur, as that is in fact no longer the case */ if (status == ARES_SUCCESS) { end_aquery(aquery, status, host); return; } break; } } end_aquery(aquery, ARES_ENOTFOUND, NULL); } static void addr_callback(void *arg, int status, int timeouts, unsigned char *abuf, int alen) { struct addr_query *aquery = (struct addr_query *) arg; struct hostent *host; size_t addrlen; aquery->timeouts += timeouts; if (status == ARES_SUCCESS) { if (aquery->addr.family == AF_INET) { addrlen = sizeof(aquery->addr.addrV4); status = ares_parse_ptr_reply(abuf, alen, &aquery->addr.addrV4, (int)addrlen, AF_INET, &host); } else { addrlen = sizeof(aquery->addr.addrV6); status = ares_parse_ptr_reply(abuf, alen, &aquery->addr.addrV6, (int)addrlen, AF_INET6, &host); } end_aquery(aquery, status, host); } else if (status == ARES_EDESTRUCTION || status == ARES_ECANCELLED) end_aquery(aquery, status, NULL); else next_lookup(aquery); } static void end_aquery(struct addr_query *aquery, int status, struct hostent *host) { aquery->callback(aquery->arg, status, aquery->timeouts, host); if (host) ares_free_hostent(host); ares_free(aquery); } static int file_lookup(struct ares_addr *addr, struct hostent **host) { FILE *fp; int status; int error; #ifdef WIN32 char PATH_HOSTS[MAX_PATH]; win_platform platform; PATH_HOSTS[0] = '\0'; platform = ares__getplatform(); if (platform == WIN_NT) { char tmp[MAX_PATH]; HKEY hkeyHosts; if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, WIN_NS_NT_KEY, 0, KEY_READ, &hkeyHosts) == ERROR_SUCCESS) { DWORD dwLength = MAX_PATH; RegQueryValueExA(hkeyHosts, DATABASEPATH, NULL, NULL, (LPBYTE)tmp, &dwLength); ExpandEnvironmentStringsA(tmp, PATH_HOSTS, MAX_PATH); RegCloseKey(hkeyHosts); } } else if (platform == WIN_9X) GetWindowsDirectoryA(PATH_HOSTS, MAX_PATH); else return ARES_ENOTFOUND; strcat(PATH_HOSTS, WIN_PATH_HOSTS); #elif defined(WATT32) const char *PATH_HOSTS = _w32_GetHostsFile(); if (!PATH_HOSTS) return ARES_ENOTFOUND; #endif fp = fopen(PATH_HOSTS, "r"); if (!fp) { error = ERRNO; switch(error) { case ENOENT: case ESRCH: return ARES_ENOTFOUND; default: DEBUGF(fprintf(stderr, "fopen() failed with error: %d %s\n", error, strerror(error))); DEBUGF(fprintf(stderr, "Error opening file: %s\n", PATH_HOSTS)); *host = NULL; return ARES_EFILE; } } while ((status = ares__get_hostent(fp, addr->family, host)) == ARES_SUCCESS) { if (addr->family != (*host)->h_addrtype) { ares_free_hostent(*host); continue; } if (addr->family == AF_INET) { if (memcmp((*host)->h_addr, &addr->addrV4, sizeof(addr->addrV4)) == 0) break; } else if (addr->family == AF_INET6) { if (memcmp((*host)->h_addr, &addr->addrV6, sizeof(addr->addrV6)) == 0) break; } ares_free_hostent(*host); } fclose(fp); if (status == ARES_EOF) status = ARES_ENOTFOUND; if (status != ARES_SUCCESS) *host = NULL; return status; } static void ptr_rr_name(char *name, const struct ares_addr *addr) { if (addr->family == AF_INET) { unsigned long laddr = ntohl(addr->addrV4.s_addr); unsigned long a1 = (laddr >> 24UL) & 0xFFUL; unsigned long a2 = (laddr >> 16UL) & 0xFFUL; unsigned long a3 = (laddr >> 8UL) & 0xFFUL; unsigned long a4 = laddr & 0xFFUL; sprintf(name, "%lu.%lu.%lu.%lu.in-addr.arpa", a4, a3, a2, a1); } else { unsigned char *bytes = (unsigned char *)&addr->addrV6; /* There are too many arguments to do this in one line using * minimally C89-compliant compilers */ sprintf(name, "%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.", bytes[15]&0xf, bytes[15] >> 4, bytes[14]&0xf, bytes[14] >> 4, bytes[13]&0xf, bytes[13] >> 4, bytes[12]&0xf, bytes[12] >> 4, bytes[11]&0xf, bytes[11] >> 4, bytes[10]&0xf, bytes[10] >> 4, bytes[9]&0xf, bytes[9] >> 4, bytes[8]&0xf, bytes[8] >> 4); sprintf(name+strlen(name), "%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.ip6.arpa", bytes[7]&0xf, bytes[7] >> 4, bytes[6]&0xf, bytes[6] >> 4, bytes[5]&0xf, bytes[5] >> 4, bytes[4]&0xf, bytes[4] >> 4, bytes[3]&0xf, bytes[3] >> 4, bytes[2]&0xf, bytes[2] >> 4, bytes[1]&0xf, bytes[1] >> 4, bytes[0]&0xf, bytes[0] >> 4); } } ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares_gethostbyname.c0000644000175100001770000002320000000000000023461 0ustar00runnerdocker00000000000000/* Copyright 1998, 2011, 2013 by the Massachusetts Institute of Technology. * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ #include "ares_setup.h" #ifdef HAVE_NETINET_IN_H # include #endif #ifdef HAVE_NETDB_H # include #endif #ifdef HAVE_ARPA_INET_H # include #endif #include "ares_nameser.h" #ifdef HAVE_STRINGS_H #include #endif #include "ares.h" #include "ares_inet_net_pton.h" #include "bitncmp.h" #include "ares_platform.h" #include "ares_nowarn.h" #include "ares_private.h" static void sort_addresses(struct hostent *host, const struct apattern *sortlist, int nsort); static void sort6_addresses(struct hostent *host, const struct apattern *sortlist, int nsort); static int get_address_index(const struct in_addr *addr, const struct apattern *sortlist, int nsort); static int get6_address_index(const struct ares_in6_addr *addr, const struct apattern *sortlist, int nsort); struct host_query { ares_host_callback callback; void *arg; ares_channel channel; }; static void ares_gethostbyname_callback(void *arg, int status, int timeouts, struct ares_addrinfo *result) { struct hostent *hostent = NULL; struct host_query *ghbn_arg = arg; if (status == ARES_SUCCESS) { status = ares__addrinfo2hostent(result, AF_UNSPEC, &hostent); } /* addrinfo2hostent will only return ENODATA if there are no addresses _and_ * no cname/aliases. However, gethostbyname will return ENODATA even if there * is cname/alias data */ if (status == ARES_SUCCESS && hostent && (!hostent->h_addr_list || !hostent->h_addr_list[0])) { status = ARES_ENODATA; } if (status == ARES_SUCCESS && ghbn_arg->channel->nsort && hostent) { if (hostent->h_addrtype == AF_INET6) sort6_addresses(hostent, ghbn_arg->channel->sortlist, ghbn_arg->channel->nsort); if (hostent->h_addrtype == AF_INET) sort_addresses(hostent, ghbn_arg->channel->sortlist, ghbn_arg->channel->nsort); } ghbn_arg->callback(ghbn_arg->arg, status, timeouts, hostent); ares_freeaddrinfo(result); ares_free(ghbn_arg); ares_free_hostent(hostent); } void ares_gethostbyname(ares_channel channel, const char *name, int family, ares_host_callback callback, void *arg) { const struct ares_addrinfo_hints hints = { ARES_AI_CANONNAME, family, 0, 0 }; struct host_query *ghbn_arg; if (!callback) return; ghbn_arg = ares_malloc(sizeof(*ghbn_arg)); if (!ghbn_arg) { callback(arg, ARES_ENOMEM, 0, NULL); return; } ghbn_arg->callback=callback; ghbn_arg->arg=arg; ghbn_arg->channel=channel; ares_getaddrinfo(channel, name, NULL, &hints, ares_gethostbyname_callback, ghbn_arg); } static void sort_addresses(struct hostent *host, const struct apattern *sortlist, int nsort) { struct in_addr a1, a2; int i1, i2, ind1, ind2; /* This is a simple insertion sort, not optimized at all. i1 walks * through the address list, with the loop invariant that everything * to the left of i1 is sorted. In the loop body, the value at i1 is moved * back through the list (via i2) until it is in sorted order. */ for (i1 = 0; host->h_addr_list[i1]; i1++) { memcpy(&a1, host->h_addr_list[i1], sizeof(struct in_addr)); ind1 = get_address_index(&a1, sortlist, nsort); for (i2 = i1 - 1; i2 >= 0; i2--) { memcpy(&a2, host->h_addr_list[i2], sizeof(struct in_addr)); ind2 = get_address_index(&a2, sortlist, nsort); if (ind2 <= ind1) break; memcpy(host->h_addr_list[i2 + 1], &a2, sizeof(struct in_addr)); } memcpy(host->h_addr_list[i2 + 1], &a1, sizeof(struct in_addr)); } } /* Find the first entry in sortlist which matches addr. Return nsort * if none of them match. */ static int get_address_index(const struct in_addr *addr, const struct apattern *sortlist, int nsort) { int i; for (i = 0; i < nsort; i++) { if (sortlist[i].family != AF_INET) continue; if (sortlist[i].type == PATTERN_MASK) { if ((addr->s_addr & sortlist[i].mask.addr4.s_addr) == sortlist[i].addrV4.s_addr) break; } else { if (!ares__bitncmp(&addr->s_addr, &sortlist[i].addrV4.s_addr, sortlist[i].mask.bits)) break; } } return i; } static void sort6_addresses(struct hostent *host, const struct apattern *sortlist, int nsort) { struct ares_in6_addr a1, a2; int i1, i2, ind1, ind2; /* This is a simple insertion sort, not optimized at all. i1 walks * through the address list, with the loop invariant that everything * to the left of i1 is sorted. In the loop body, the value at i1 is moved * back through the list (via i2) until it is in sorted order. */ for (i1 = 0; host->h_addr_list[i1]; i1++) { memcpy(&a1, host->h_addr_list[i1], sizeof(struct ares_in6_addr)); ind1 = get6_address_index(&a1, sortlist, nsort); for (i2 = i1 - 1; i2 >= 0; i2--) { memcpy(&a2, host->h_addr_list[i2], sizeof(struct ares_in6_addr)); ind2 = get6_address_index(&a2, sortlist, nsort); if (ind2 <= ind1) break; memcpy(host->h_addr_list[i2 + 1], &a2, sizeof(struct ares_in6_addr)); } memcpy(host->h_addr_list[i2 + 1], &a1, sizeof(struct ares_in6_addr)); } } /* Find the first entry in sortlist which matches addr. Return nsort * if none of them match. */ static int get6_address_index(const struct ares_in6_addr *addr, const struct apattern *sortlist, int nsort) { int i; for (i = 0; i < nsort; i++) { if (sortlist[i].family != AF_INET6) continue; if (!ares__bitncmp(addr, &sortlist[i].addrV6, sortlist[i].mask.bits)) break; } return i; } static int file_lookup(const char *name, int family, struct hostent **host); /* I really have no idea why this is exposed as a public function, but since * it is, we can't kill this legacy function. */ int ares_gethostbyname_file(ares_channel channel, const char *name, int family, struct hostent **host) { int result; /* We only take the channel to ensure that ares_init() been called. */ if(channel == NULL) { /* Anything will do, really. This seems fine, and is consistent with other error cases. */ *host = NULL; return ARES_ENOTFOUND; } /* Just chain to the internal implementation we use here; it's exactly * what we want. */ result = file_lookup(name, family, host); if(result != ARES_SUCCESS) { /* We guarantee a NULL hostent on failure. */ *host = NULL; } return result; } static int file_lookup(const char *name, int family, struct hostent **host) { FILE *fp; char **alias; int status; int error; #ifdef WIN32 char PATH_HOSTS[MAX_PATH]; win_platform platform; PATH_HOSTS[0] = '\0'; platform = ares__getplatform(); if (platform == WIN_NT) { char tmp[MAX_PATH]; HKEY hkeyHosts; if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, WIN_NS_NT_KEY, 0, KEY_READ, &hkeyHosts) == ERROR_SUCCESS) { DWORD dwLength = MAX_PATH; RegQueryValueExA(hkeyHosts, DATABASEPATH, NULL, NULL, (LPBYTE)tmp, &dwLength); ExpandEnvironmentStringsA(tmp, PATH_HOSTS, MAX_PATH); RegCloseKey(hkeyHosts); } } else if (platform == WIN_9X) GetWindowsDirectoryA(PATH_HOSTS, MAX_PATH); else return ARES_ENOTFOUND; strcat(PATH_HOSTS, WIN_PATH_HOSTS); #elif defined(WATT32) const char *PATH_HOSTS = _w32_GetHostsFile(); if (!PATH_HOSTS) return ARES_ENOTFOUND; #endif /* Per RFC 7686, reject queries for ".onion" domain names with NXDOMAIN. */ if (ares__is_onion_domain(name)) return ARES_ENOTFOUND; fp = fopen(PATH_HOSTS, "r"); if (!fp) { error = ERRNO; switch(error) { case ENOENT: case ESRCH: return ARES_ENOTFOUND; default: DEBUGF(fprintf(stderr, "fopen() failed with error: %d %s\n", error, strerror(error))); DEBUGF(fprintf(stderr, "Error opening file: %s\n", PATH_HOSTS)); *host = NULL; return ARES_EFILE; } } while ((status = ares__get_hostent(fp, family, host)) == ARES_SUCCESS) { if (strcasecmp((*host)->h_name, name) == 0) break; for (alias = (*host)->h_aliases; *alias; alias++) { if (strcasecmp(*alias, name) == 0) break; } if (*alias) break; ares_free_hostent(*host); } fclose(fp); if (status == ARES_EOF) status = ARES_ENOTFOUND; if (status != ARES_SUCCESS) *host = NULL; return status; } ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares_getnameinfo.c0000644000175100001770000003215700000000000023117 0ustar00runnerdocker00000000000000 /* Copyright 2005 by Dominick Meglio * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ #include "ares_setup.h" #ifdef HAVE_GETSERVBYPORT_R # if !defined(GETSERVBYPORT_R_ARGS) || \ (GETSERVBYPORT_R_ARGS < 4) || (GETSERVBYPORT_R_ARGS > 6) # error "you MUST specifiy a valid number of arguments for getservbyport_r" # endif #endif #ifdef HAVE_NETINET_IN_H # include #endif #ifdef HAVE_NETDB_H # include #endif #ifdef HAVE_ARPA_INET_H # include #endif #include "ares_nameser.h" #ifdef HAVE_NET_IF_H #include #endif #include "ares.h" #include "ares_ipv6.h" #include "ares_nowarn.h" #include "ares_private.h" struct nameinfo_query { ares_nameinfo_callback callback; void *arg; union { struct sockaddr_in addr4; struct sockaddr_in6 addr6; } addr; int family; int flags; int timeouts; }; #ifdef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID #define IPBUFSIZ \ (sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255") + IF_NAMESIZE) #else #define IPBUFSIZ \ (sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")) #endif static void nameinfo_callback(void *arg, int status, int timeouts, struct hostent *host); static char *lookup_service(unsigned short port, int flags, char *buf, size_t buflen); #ifdef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID static void append_scopeid(struct sockaddr_in6 *addr6, unsigned int scopeid, char *buf, size_t buflen); #endif STATIC_TESTABLE char *ares_striendstr(const char *s1, const char *s2); void ares_getnameinfo(ares_channel channel, const struct sockaddr *sa, ares_socklen_t salen, int flags, ares_nameinfo_callback callback, void *arg) { struct sockaddr_in *addr = NULL; struct sockaddr_in6 *addr6 = NULL; struct nameinfo_query *niquery; unsigned int port = 0; /* Validate socket address family and length */ if ((sa->sa_family == AF_INET) && (salen == sizeof(struct sockaddr_in))) { addr = CARES_INADDR_CAST(struct sockaddr_in *, sa); port = addr->sin_port; } else if ((sa->sa_family == AF_INET6) && (salen == sizeof(struct sockaddr_in6))) { addr6 = CARES_INADDR_CAST(struct sockaddr_in6 *, sa); port = addr6->sin6_port; } else { callback(arg, ARES_ENOTIMP, 0, NULL, NULL); return; } /* If neither, assume they want a host */ if (!(flags & ARES_NI_LOOKUPSERVICE) && !(flags & ARES_NI_LOOKUPHOST)) flags |= ARES_NI_LOOKUPHOST; /* All they want is a service, no need for DNS */ if ((flags & ARES_NI_LOOKUPSERVICE) && !(flags & ARES_NI_LOOKUPHOST)) { char buf[33], *service; service = lookup_service((unsigned short)(port & 0xffff), flags, buf, sizeof(buf)); callback(arg, ARES_SUCCESS, 0, NULL, service); return; } /* They want a host lookup */ if ((flags & ARES_NI_LOOKUPHOST)) { /* A numeric host can be handled without DNS */ if ((flags & ARES_NI_NUMERICHOST)) { char ipbuf[IPBUFSIZ]; char srvbuf[33]; char *service = NULL; ipbuf[0] = 0; /* Specifying not to lookup a host, but then saying a host * is required has to be illegal. */ if (flags & ARES_NI_NAMEREQD) { callback(arg, ARES_EBADFLAGS, 0, NULL, NULL); return; } if (salen == sizeof(struct sockaddr_in6)) { ares_inet_ntop(AF_INET6, &addr6->sin6_addr, ipbuf, IPBUFSIZ); /* If the system supports scope IDs, use it */ #ifdef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID append_scopeid(addr6, flags, ipbuf, sizeof(ipbuf)); #endif } else { ares_inet_ntop(AF_INET, &addr->sin_addr, ipbuf, IPBUFSIZ); } /* They also want a service */ if (flags & ARES_NI_LOOKUPSERVICE) service = lookup_service((unsigned short)(port & 0xffff), flags, srvbuf, sizeof(srvbuf)); callback(arg, ARES_SUCCESS, 0, ipbuf, service); return; } /* This is where a DNS lookup becomes necessary */ else { niquery = ares_malloc(sizeof(struct nameinfo_query)); if (!niquery) { callback(arg, ARES_ENOMEM, 0, NULL, NULL); return; } niquery->callback = callback; niquery->arg = arg; niquery->flags = flags; niquery->timeouts = 0; if (sa->sa_family == AF_INET) { niquery->family = AF_INET; memcpy(&niquery->addr.addr4, addr, sizeof(niquery->addr.addr4)); ares_gethostbyaddr(channel, &addr->sin_addr, sizeof(struct in_addr), AF_INET, nameinfo_callback, niquery); } else { niquery->family = AF_INET6; memcpy(&niquery->addr.addr6, addr6, sizeof(niquery->addr.addr6)); ares_gethostbyaddr(channel, &addr6->sin6_addr, sizeof(struct ares_in6_addr), AF_INET6, nameinfo_callback, niquery); } } } } static void nameinfo_callback(void *arg, int status, int timeouts, struct hostent *host) { struct nameinfo_query *niquery = (struct nameinfo_query *) arg; char srvbuf[33]; char *service = NULL; niquery->timeouts += timeouts; if (status == ARES_SUCCESS) { /* They want a service too */ if (niquery->flags & ARES_NI_LOOKUPSERVICE) { if (niquery->family == AF_INET) service = lookup_service(niquery->addr.addr4.sin_port, niquery->flags, srvbuf, sizeof(srvbuf)); else service = lookup_service(niquery->addr.addr6.sin6_port, niquery->flags, srvbuf, sizeof(srvbuf)); } /* NOFQDN means we have to strip off the domain name portion. We do this by determining our own domain name, then searching the string for this domain name and removing it. */ #ifdef HAVE_GETHOSTNAME if (niquery->flags & ARES_NI_NOFQDN) { char buf[255]; char *domain; gethostname(buf, 255); if ((domain = strchr(buf, '.')) != NULL) { char *end = ares_striendstr(host->h_name, domain); if (end) *end = 0; } } #endif niquery->callback(niquery->arg, ARES_SUCCESS, niquery->timeouts, (char *)(host->h_name), service); ares_free(niquery); return; } /* We couldn't find the host, but it's OK, we can use the IP */ else if (status == ARES_ENOTFOUND && !(niquery->flags & ARES_NI_NAMEREQD)) { char ipbuf[IPBUFSIZ]; if (niquery->family == AF_INET) ares_inet_ntop(AF_INET, &niquery->addr.addr4.sin_addr, ipbuf, IPBUFSIZ); else { ares_inet_ntop(AF_INET6, &niquery->addr.addr6.sin6_addr, ipbuf, IPBUFSIZ); #ifdef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID append_scopeid(&niquery->addr.addr6, niquery->flags, ipbuf, sizeof(ipbuf)); #endif } /* They want a service too */ if (niquery->flags & ARES_NI_LOOKUPSERVICE) { if (niquery->family == AF_INET) service = lookup_service(niquery->addr.addr4.sin_port, niquery->flags, srvbuf, sizeof(srvbuf)); else service = lookup_service(niquery->addr.addr6.sin6_port, niquery->flags, srvbuf, sizeof(srvbuf)); } niquery->callback(niquery->arg, ARES_SUCCESS, niquery->timeouts, ipbuf, service); ares_free(niquery); return; } niquery->callback(niquery->arg, status, niquery->timeouts, NULL, NULL); ares_free(niquery); } static char *lookup_service(unsigned short port, int flags, char *buf, size_t buflen) { const char *proto; struct servent *sep; #ifdef HAVE_GETSERVBYPORT_R struct servent se; #endif char tmpbuf[4096]; char *name; size_t name_len; if (port) { if (flags & ARES_NI_NUMERICSERV) sep = NULL; else { if (flags & ARES_NI_UDP) proto = "udp"; else if (flags & ARES_NI_SCTP) proto = "sctp"; else if (flags & ARES_NI_DCCP) proto = "dccp"; else proto = "tcp"; #ifdef HAVE_GETSERVBYPORT_R memset(&se, 0, sizeof(se)); sep = &se; memset(tmpbuf, 0, sizeof(tmpbuf)); #if GETSERVBYPORT_R_ARGS == 6 if (getservbyport_r(port, proto, &se, (void *)tmpbuf, sizeof(tmpbuf), &sep) != 0) sep = NULL; /* LCOV_EXCL_LINE: buffer large so this never fails */ #elif GETSERVBYPORT_R_ARGS == 5 sep = getservbyport_r(port, proto, &se, (void *)tmpbuf, sizeof(tmpbuf)); #elif GETSERVBYPORT_R_ARGS == 4 if (getservbyport_r(port, proto, &se, (void *)tmpbuf) != 0) sep = NULL; #else /* Lets just hope the OS uses TLS! */ sep = getservbyport(port, proto); #endif #else /* Lets just hope the OS uses TLS! */ #if (defined(NETWARE) && !defined(__NOVELL_LIBC__)) sep = getservbyport(port, (char*)proto); #else sep = getservbyport(port, proto); #endif #endif } if (sep && sep->s_name) { /* get service name */ name = sep->s_name; } else { /* get port as a string */ sprintf(tmpbuf, "%u", (unsigned int)ntohs(port)); name = tmpbuf; } name_len = strlen(name); if (name_len < buflen) /* return it if buffer big enough */ memcpy(buf, name, name_len + 1); else /* avoid reusing previous one */ buf[0] = '\0'; /* LCOV_EXCL_LINE: no real service names are too big */ return buf; } buf[0] = '\0'; return NULL; } #ifdef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID static void append_scopeid(struct sockaddr_in6 *addr6, unsigned int flags, char *buf, size_t buflen) { #ifdef HAVE_IF_INDEXTONAME int is_ll, is_mcll; #endif char tmpbuf[IF_NAMESIZE + 2]; size_t bufl; int is_scope_long = sizeof(addr6->sin6_scope_id) > sizeof(unsigned int); tmpbuf[0] = '%'; #ifdef HAVE_IF_INDEXTONAME is_ll = IN6_IS_ADDR_LINKLOCAL(&addr6->sin6_addr); is_mcll = IN6_IS_ADDR_MC_LINKLOCAL(&addr6->sin6_addr); if ((flags & ARES_NI_NUMERICSCOPE) || (!is_ll && !is_mcll)) { if (is_scope_long) { sprintf(&tmpbuf[1], "%lu", (unsigned long)addr6->sin6_scope_id); } else { sprintf(&tmpbuf[1], "%u", (unsigned int)addr6->sin6_scope_id); } } else { if (if_indextoname(addr6->sin6_scope_id, &tmpbuf[1]) == NULL) { if (is_scope_long) { sprintf(&tmpbuf[1], "%lu", (unsigned long)addr6->sin6_scope_id); } else { sprintf(&tmpbuf[1], "%u", (unsigned int)addr6->sin6_scope_id); } } } #else if (is_scope_long) { sprintf(&tmpbuf[1], "%lu", (unsigned long)addr6->sin6_scope_id); } else { sprintf(&tmpbuf[1], "%u", (unsigned int)addr6->sin6_scope_id); } (void) flags; #endif tmpbuf[IF_NAMESIZE + 1] = '\0'; bufl = strlen(buf); if(bufl + strlen(tmpbuf) < buflen) /* only append the scopeid string if it fits in the target buffer */ strcpy(&buf[bufl], tmpbuf); } #endif /* Determines if s1 ends with the string in s2 (case-insensitive) */ STATIC_TESTABLE char *ares_striendstr(const char *s1, const char *s2) { const char *c1, *c2, *c1_begin; int lo1, lo2; size_t s1_len = strlen(s1), s2_len = strlen(s2); /* If the substr is longer than the full str, it can't match */ if (s2_len > s1_len) return NULL; /* Jump to the end of s1 minus the length of s2 */ c1_begin = s1+s1_len-s2_len; c1 = (const char *)c1_begin; c2 = s2; while (c2 < s2+s2_len) { lo1 = TOLOWER(*c1); lo2 = TOLOWER(*c2); if (lo1 != lo2) return NULL; else { c1++; c2++; } } return (char *)c1_begin; } int ares__is_onion_domain(const char *name) { if (ares_striendstr(name, ".onion")) return 1; if (ares_striendstr(name, ".onion.")) return 1; return 0; } ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares_getsock.c0000644000175100001770000000440000000000000022250 0ustar00runnerdocker00000000000000 /* Copyright (C) 2005 - 2010, Daniel Stenberg * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose and without fee is hereby granted, provided * that the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. M.I.T. makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. */ #include "ares_setup.h" #include "ares.h" #include "ares_private.h" int ares_getsock(ares_channel channel, ares_socket_t *socks, int numsocks) /* size of the 'socks' array */ { struct server_state *server; int i; int sockindex=0; int bitmap = 0; unsigned int setbits = 0xffffffff; /* Are there any active queries? */ int active_queries = !ares__is_list_empty(&(channel->all_queries)); for (i = 0; i < channel->nservers; i++) { server = &channel->servers[i]; /* We only need to register interest in UDP sockets if we have * outstanding queries. */ if (active_queries && server->udp_socket != ARES_SOCKET_BAD) { if(sockindex >= numsocks || sockindex >= ARES_GETSOCK_MAXNUM) break; socks[sockindex] = server->udp_socket; bitmap |= ARES_GETSOCK_READABLE(setbits, sockindex); sockindex++; } /* We always register for TCP events, because we want to know * when the other side closes the connection, so we don't waste * time trying to use a broken connection. */ if (server->tcp_socket != ARES_SOCKET_BAD) { if(sockindex >= numsocks || sockindex >= ARES_GETSOCK_MAXNUM) break; socks[sockindex] = server->tcp_socket; bitmap |= ARES_GETSOCK_READABLE(setbits, sockindex); if (server->qhead && active_queries) /* then the tcp socket is also writable! */ bitmap |= ARES_GETSOCK_WRITABLE(setbits, sockindex); sockindex++; } } return bitmap; } ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares_inet_net_pton.h0000644000175100001770000000172600000000000023473 0ustar00runnerdocker00000000000000#ifndef HEADER_CARES_INET_NET_PTON_H #define HEADER_CARES_INET_NET_PTON_H /* Copyright (C) 2005-2013 by Daniel Stenberg et al * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ #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 */ ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares_init.c0000644000175100001770000022646400000000000021574 0ustar00runnerdocker00000000000000 /* Copyright 1998 by the Massachusetts Institute of Technology. * Copyright (C) 2007-2013 by Daniel Stenberg * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ #include "ares_setup.h" #ifdef HAVE_SYS_PARAM_H #include #endif #ifdef HAVE_NETINET_IN_H #include #endif #ifdef HAVE_NETDB_H #include #endif #ifdef HAVE_ARPA_INET_H #include #endif #include "ares_nameser.h" #if defined(ANDROID) || defined(__ANDROID__) #include #include "ares_android.h" /* From the Bionic sources */ #define DNS_PROP_NAME_PREFIX "net.dns" #define MAX_DNS_PROPERTIES 8 #endif #if defined(CARES_USE_LIBRESOLV) #include #endif #include "ares.h" #include "ares_inet_net_pton.h" #include "ares_library_init.h" #include "ares_nowarn.h" #include "ares_platform.h" #include "ares_private.h" #ifdef WATT32 #undef WIN32 /* Redefined in MingW/MSVC headers */ #endif static int init_by_options(ares_channel channel, const struct ares_options *options, int optmask); static int init_by_environment(ares_channel channel); static int init_by_resolv_conf(ares_channel channel); static int init_by_defaults(ares_channel channel); #ifndef WATT32 static int config_nameserver(struct server_state **servers, int *nservers, char *str); #endif static int set_search(ares_channel channel, const char *str); static int set_options(ares_channel channel, const char *str); static const char *try_option(const char *p, const char *q, const char *opt); static int init_id_key(rc4_key* key,int key_data_len); static int config_sortlist(struct apattern **sortlist, int *nsort, const char *str); static int sortlist_alloc(struct apattern **sortlist, int *nsort, struct apattern *pat); static int ip_addr(const char *s, ares_ssize_t len, struct in_addr *addr); static void natural_mask(struct apattern *pat); #if !defined(WIN32) && !defined(WATT32) && \ !defined(ANDROID) && !defined(__ANDROID__) && !defined(CARES_USE_LIBRESOLV) static int config_domain(ares_channel channel, char *str); static int config_lookup(ares_channel channel, const char *str, const char *bindch, const char *altbindch, const char *filech); static char *try_config(char *s, const char *opt, char scc); #endif #define ARES_CONFIG_CHECK(x) (x->lookups && x->nsort > -1 && \ x->nservers > -1 && \ x->ndomains > -1 && \ x->ndots > -1 && x->timeout > -1 && \ x->tries > -1) int ares_init(ares_channel *channelptr) { return ares_init_options(channelptr, NULL, 0); } int ares_init_options(ares_channel *channelptr, struct ares_options *options, int optmask) { ares_channel channel; int i; int status = ARES_SUCCESS; struct timeval now; if (ares_library_initialized() != ARES_SUCCESS) return ARES_ENOTINITIALIZED; /* LCOV_EXCL_LINE: n/a on non-WinSock */ channel = ares_malloc(sizeof(struct ares_channeldata)); if (!channel) { *channelptr = NULL; return ARES_ENOMEM; } now = ares__tvnow(); /* Set everything to distinguished values so we know they haven't * been set yet. */ channel->flags = -1; channel->timeout = -1; channel->tries = -1; channel->ndots = -1; channel->rotate = -1; channel->udp_port = -1; channel->tcp_port = -1; channel->ednspsz = -1; channel->socket_send_buffer_size = -1; channel->socket_receive_buffer_size = -1; channel->nservers = -1; channel->ndomains = -1; channel->nsort = -1; channel->tcp_connection_generation = 0; channel->lookups = NULL; channel->domains = NULL; channel->sortlist = NULL; channel->servers = NULL; channel->sock_state_cb = NULL; channel->sock_state_cb_data = NULL; channel->sock_create_cb = NULL; channel->sock_create_cb_data = NULL; channel->sock_config_cb = NULL; channel->sock_config_cb_data = NULL; channel->sock_funcs = NULL; channel->sock_func_cb_data = NULL; channel->resolvconf_path = NULL; channel->last_server = 0; channel->last_timeout_processed = (time_t)now.tv_sec; memset(&channel->local_dev_name, 0, sizeof(channel->local_dev_name)); channel->local_ip4 = 0; memset(&channel->local_ip6, 0, sizeof(channel->local_ip6)); /* Initialize our lists of queries */ ares__init_list_head(&(channel->all_queries)); for (i = 0; i < ARES_QID_TABLE_SIZE; i++) { ares__init_list_head(&(channel->queries_by_qid[i])); } for (i = 0; i < ARES_TIMEOUT_TABLE_SIZE; i++) { ares__init_list_head(&(channel->queries_by_timeout[i])); } /* Initialize configuration by each of the four sources, from highest * precedence to lowest. */ status = init_by_options(channel, options, optmask); if (status != ARES_SUCCESS) { DEBUGF(fprintf(stderr, "Error: init_by_options failed: %s\n", ares_strerror(status))); /* If we fail to apply user-specified options, fail the whole init process */ goto done; } status = init_by_environment(channel); if (status != ARES_SUCCESS) DEBUGF(fprintf(stderr, "Error: init_by_environment failed: %s\n", ares_strerror(status))); if (status == ARES_SUCCESS) { status = init_by_resolv_conf(channel); if (status != ARES_SUCCESS) DEBUGF(fprintf(stderr, "Error: init_by_resolv_conf failed: %s\n", ares_strerror(status))); } /* * No matter what failed or succeeded, seed defaults to provide * useful behavior for things that we missed. */ status = init_by_defaults(channel); if (status != ARES_SUCCESS) DEBUGF(fprintf(stderr, "Error: init_by_defaults failed: %s\n", ares_strerror(status))); /* Generate random key */ if (status == ARES_SUCCESS) { status = init_id_key(&channel->id_key, ARES_ID_KEY_LEN); if (status == ARES_SUCCESS) channel->next_id = ares__generate_new_id(&channel->id_key); else DEBUGF(fprintf(stderr, "Error: init_id_key failed: %s\n", ares_strerror(status))); } done: if (status != ARES_SUCCESS) { /* Something failed; clean up memory we may have allocated. */ if (channel->servers) ares_free(channel->servers); if (channel->ndomains != -1) ares_strsplit_free(channel->domains, channel->ndomains); if (channel->sortlist) ares_free(channel->sortlist); if(channel->lookups) ares_free(channel->lookups); if(channel->resolvconf_path) ares_free(channel->resolvconf_path); ares_free(channel); return status; } /* Trim to one server if ARES_FLAG_PRIMARY is set. */ if ((channel->flags & ARES_FLAG_PRIMARY) && channel->nservers > 1) channel->nservers = 1; ares__init_servers_state(channel); *channelptr = channel; return ARES_SUCCESS; } /* ares_dup() duplicates a channel handle with all its options and returns a new channel handle */ int ares_dup(ares_channel *dest, ares_channel src) { struct ares_options opts; struct ares_addr_port_node *servers; int non_v4_default_port = 0; int i, rc; int optmask; *dest = NULL; /* in case of failure return NULL explicitly */ /* First get the options supported by the old ares_save_options() function, which is most of them */ rc = ares_save_options(src, &opts, &optmask); if(rc) { ares_destroy_options(&opts); return rc; } /* Then create the new channel with those options */ rc = ares_init_options(dest, &opts, optmask); /* destroy the options copy to not leak any memory */ ares_destroy_options(&opts); if(rc) return rc; /* Now clone the options that ares_save_options() doesn't support. */ (*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; strncpy((*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)); /* Full name server cloning required if there is a non-IPv4, or non-default port, nameserver */ for (i = 0; i < src->nservers; i++) { if ((src->servers[i].addr.family != AF_INET) || (src->servers[i].addr.udp_port != 0) || (src->servers[i].addr.tcp_port != 0)) { non_v4_default_port++; break; } } if (non_v4_default_port) { rc = ares_get_servers_ports(src, &servers); if (rc != ARES_SUCCESS) { ares_destroy(*dest); *dest = NULL; return rc; } rc = ares_set_servers_ports(*dest, servers); ares_free_data(servers); if (rc != ARES_SUCCESS) { ares_destroy(*dest); *dest = NULL; return rc; } } return ARES_SUCCESS; /* everything went fine */ } /* Save options from initialized channel */ int ares_save_options(ares_channel channel, struct ares_options *options, int *optmask) { int i, j; int ipv4_nservers = 0; /* Zero everything out */ memset(options, 0, sizeof(struct ares_options)); if (!ARES_CONFIG_CHECK(channel)) return ARES_ENODATA; /* Traditionally the optmask wasn't saved in the channel struct so it was recreated here. ROTATE is the first option that has no struct field of its own in the public config struct */ (*optmask) = (ARES_OPT_FLAGS|ARES_OPT_TRIES|ARES_OPT_NDOTS| ARES_OPT_UDP_PORT|ARES_OPT_TCP_PORT|ARES_OPT_SOCK_STATE_CB| ARES_OPT_SERVERS|ARES_OPT_DOMAINS|ARES_OPT_LOOKUPS| ARES_OPT_SORTLIST|ARES_OPT_TIMEOUTMS); (*optmask) |= (channel->rotate ? ARES_OPT_ROTATE : ARES_OPT_NOROTATE); if (channel->resolvconf_path) (*optmask) |= ARES_OPT_RESOLVCONF; /* Copy easy stuff */ options->flags = channel->flags; /* We return full millisecond resolution but that's only because we don't set the ARES_OPT_TIMEOUT anymore, only the new ARES_OPT_TIMEOUTMS */ options->timeout = channel->timeout; options->tries = channel->tries; options->ndots = channel->ndots; options->udp_port = ntohs(aresx_sitous(channel->udp_port)); options->tcp_port = ntohs(aresx_sitous(channel->tcp_port)); options->sock_state_cb = channel->sock_state_cb; options->sock_state_cb_data = channel->sock_state_cb_data; /* Copy IPv4 servers that use the default port */ if (channel->nservers) { for (i = 0; i < channel->nservers; i++) { if ((channel->servers[i].addr.family == AF_INET) && (channel->servers[i].addr.udp_port == 0) && (channel->servers[i].addr.tcp_port == 0)) ipv4_nservers++; } if (ipv4_nservers) { options->servers = ares_malloc(ipv4_nservers * sizeof(struct in_addr)); if (!options->servers) return ARES_ENOMEM; for (i = j = 0; i < channel->nservers; i++) { if ((channel->servers[i].addr.family == AF_INET) && (channel->servers[i].addr.udp_port == 0) && (channel->servers[i].addr.tcp_port == 0)) memcpy(&options->servers[j++], &channel->servers[i].addr.addrV4, sizeof(channel->servers[i].addr.addrV4)); } } } options->nservers = ipv4_nservers; /* copy domains */ if (channel->ndomains) { options->domains = ares_malloc(channel->ndomains * sizeof(char *)); if (!options->domains) return ARES_ENOMEM; for (i = 0; i < channel->ndomains; i++) { options->ndomains = i; options->domains[i] = ares_strdup(channel->domains[i]); if (!options->domains[i]) return ARES_ENOMEM; } } options->ndomains = channel->ndomains; /* copy lookups */ if (channel->lookups) { options->lookups = ares_strdup(channel->lookups); if (!options->lookups && channel->lookups) return ARES_ENOMEM; } /* copy sortlist */ if (channel->nsort) { options->sortlist = ares_malloc(channel->nsort * sizeof(struct apattern)); if (!options->sortlist) return ARES_ENOMEM; for (i = 0; i < channel->nsort; i++) options->sortlist[i] = channel->sortlist[i]; } options->nsort = channel->nsort; /* copy path for resolv.conf file */ if (channel->resolvconf_path) { options->resolvconf_path = ares_strdup(channel->resolvconf_path); if (!options->resolvconf_path) return ARES_ENOMEM; } return ARES_SUCCESS; } static int init_by_options(ares_channel channel, const struct ares_options *options, int optmask) { int i; /* Easy stuff. */ if ((optmask & ARES_OPT_FLAGS) && channel->flags == -1) channel->flags = options->flags; if ((optmask & ARES_OPT_TIMEOUTMS) && channel->timeout == -1) channel->timeout = options->timeout; else if ((optmask & ARES_OPT_TIMEOUT) && channel->timeout == -1) channel->timeout = options->timeout * 1000; if ((optmask & ARES_OPT_TRIES) && channel->tries == -1) channel->tries = options->tries; if ((optmask & ARES_OPT_NDOTS) && channel->ndots == -1) channel->ndots = options->ndots; if ((optmask & ARES_OPT_ROTATE) && channel->rotate == -1) channel->rotate = 1; if ((optmask & ARES_OPT_NOROTATE) && channel->rotate == -1) channel->rotate = 0; if ((optmask & ARES_OPT_UDP_PORT) && channel->udp_port == -1) channel->udp_port = htons(options->udp_port); if ((optmask & ARES_OPT_TCP_PORT) && channel->tcp_port == -1) channel->tcp_port = htons(options->tcp_port); if ((optmask & ARES_OPT_SOCK_STATE_CB) && channel->sock_state_cb == NULL) { channel->sock_state_cb = options->sock_state_cb; channel->sock_state_cb_data = options->sock_state_cb_data; } if ((optmask & ARES_OPT_SOCK_SNDBUF) && channel->socket_send_buffer_size == -1) channel->socket_send_buffer_size = options->socket_send_buffer_size; if ((optmask & ARES_OPT_SOCK_RCVBUF) && channel->socket_receive_buffer_size == -1) channel->socket_receive_buffer_size = options->socket_receive_buffer_size; if ((optmask & ARES_OPT_EDNSPSZ) && channel->ednspsz == -1) channel->ednspsz = options->ednspsz; /* Copy the IPv4 servers, if given. */ if ((optmask & ARES_OPT_SERVERS) && channel->nservers == -1) { /* Avoid zero size allocations at any cost */ if (options->nservers > 0) { channel->servers = ares_malloc(options->nservers * sizeof(struct server_state)); if (!channel->servers) return ARES_ENOMEM; for (i = 0; i < options->nservers; i++) { channel->servers[i].addr.family = AF_INET; channel->servers[i].addr.udp_port = 0; channel->servers[i].addr.tcp_port = 0; memcpy(&channel->servers[i].addr.addrV4, &options->servers[i], sizeof(channel->servers[i].addr.addrV4)); } } channel->nservers = options->nservers; } /* Copy the domains, if given. Keep channel->ndomains consistent so * we can clean up in case of error. */ if ((optmask & ARES_OPT_DOMAINS) && channel->ndomains == -1) { /* Avoid zero size allocations at any cost */ if (options->ndomains > 0) { channel->domains = ares_malloc(options->ndomains * sizeof(char *)); if (!channel->domains) return ARES_ENOMEM; for (i = 0; i < options->ndomains; i++) { channel->ndomains = i; channel->domains[i] = ares_strdup(options->domains[i]); if (!channel->domains[i]) return ARES_ENOMEM; } } channel->ndomains = options->ndomains; } /* Set lookups, if given. */ if ((optmask & ARES_OPT_LOOKUPS) && !channel->lookups) { channel->lookups = ares_strdup(options->lookups); if (!channel->lookups) return ARES_ENOMEM; } /* copy sortlist */ if ((optmask & ARES_OPT_SORTLIST) && (channel->nsort == -1)) { if (options->nsort > 0) { channel->sortlist = ares_malloc(options->nsort * sizeof(struct apattern)); if (!channel->sortlist) return ARES_ENOMEM; for (i = 0; i < options->nsort; i++) channel->sortlist[i] = options->sortlist[i]; } channel->nsort = options->nsort; } /* Set path for resolv.conf file, if given. */ if ((optmask & ARES_OPT_RESOLVCONF) && !channel->resolvconf_path) { channel->resolvconf_path = ares_strdup(options->resolvconf_path); if (!channel->resolvconf_path && options->resolvconf_path) return ARES_ENOMEM; } channel->optmask = optmask; return ARES_SUCCESS; } static int init_by_environment(ares_channel channel) { const char *localdomain, *res_options; int status; localdomain = getenv("LOCALDOMAIN"); if (localdomain && channel->ndomains == -1) { status = set_search(channel, localdomain); if (status != ARES_SUCCESS) return status; } res_options = getenv("RES_OPTIONS"); if (res_options) { status = set_options(channel, res_options); if (status != ARES_SUCCESS) return status; /* LCOV_EXCL_LINE: set_options() never fails */ } return ARES_SUCCESS; } #ifdef WIN32 /* * get_REG_SZ() * * Given a 'hKey' handle to an open registry key and a 'leafKeyName' pointer * to the name of the registry leaf key to be queried, fetch it's string * value and return a pointer in *outptr to a newly allocated memory area * holding it as a null-terminated string. * * Returns 0 and nullifies *outptr upon inability to return a string value. * * Returns 1 and sets *outptr when returning a dynamically allocated string. * * Supported on Windows NT 3.5 and newer. */ static int get_REG_SZ(HKEY hKey, const char *leafKeyName, char **outptr) { DWORD size = 0; int res; *outptr = NULL; /* Find out size of string stored in registry */ res = RegQueryValueExA(hKey, leafKeyName, 0, NULL, NULL, &size); if ((res != ERROR_SUCCESS && res != ERROR_MORE_DATA) || !size) return 0; /* Allocate buffer of indicated size plus one given that string might have been stored without null termination */ *outptr = ares_malloc(size+1); if (!*outptr) return 0; /* Get the value for real */ res = RegQueryValueExA(hKey, leafKeyName, 0, NULL, (unsigned char *)*outptr, &size); if ((res != ERROR_SUCCESS) || (size == 1)) { ares_free(*outptr); *outptr = NULL; return 0; } /* Null terminate buffer allways */ *(*outptr + size) = '\0'; return 1; } /* * get_REG_SZ_9X() * * Functionally identical to get_REG_SZ() * * Supported on Windows 95, 98 and ME. */ static int get_REG_SZ_9X(HKEY hKey, const char *leafKeyName, char **outptr) { DWORD dataType = 0; DWORD size = 0; int res; *outptr = NULL; /* Find out size of string stored in registry */ res = RegQueryValueExA(hKey, leafKeyName, 0, &dataType, NULL, &size); if ((res != ERROR_SUCCESS && res != ERROR_MORE_DATA) || !size) return 0; /* Allocate buffer of indicated size plus one given that string might have been stored without null termination */ *outptr = ares_malloc(size+1); if (!*outptr) return 0; /* Get the value for real */ res = RegQueryValueExA(hKey, leafKeyName, 0, &dataType, (unsigned char *)*outptr, &size); if ((res != ERROR_SUCCESS) || (size == 1)) { ares_free(*outptr); *outptr = NULL; return 0; } /* Null terminate buffer allways */ *(*outptr + size) = '\0'; return 1; } /* * get_enum_REG_SZ() * * Given a 'hKeyParent' handle to an open registry key and a 'leafKeyName' * pointer to the name of the registry leaf key to be queried, parent key * is enumerated searching in child keys for given leaf key name and its * associated string value. When located, this returns a pointer in *outptr * to a newly allocated memory area holding it as a null-terminated string. * * Returns 0 and nullifies *outptr upon inability to return a string value. * * Returns 1 and sets *outptr when returning a dynamically allocated string. * * Supported on Windows NT 3.5 and newer. */ static int get_enum_REG_SZ(HKEY hKeyParent, const char *leafKeyName, char **outptr) { char enumKeyName[256]; DWORD enumKeyNameBuffSize; DWORD enumKeyIdx = 0; HKEY hKeyEnum; int gotString; int res; *outptr = NULL; for(;;) { enumKeyNameBuffSize = sizeof(enumKeyName); res = RegEnumKeyExA(hKeyParent, enumKeyIdx++, enumKeyName, &enumKeyNameBuffSize, 0, NULL, NULL, NULL); if (res != ERROR_SUCCESS) break; res = RegOpenKeyExA(hKeyParent, enumKeyName, 0, KEY_QUERY_VALUE, &hKeyEnum); if (res != ERROR_SUCCESS) continue; gotString = get_REG_SZ(hKeyEnum, leafKeyName, outptr); RegCloseKey(hKeyEnum); if (gotString) break; } if (!*outptr) return 0; return 1; } /* * get_DNS_Registry_9X() * * Functionally identical to get_DNS_Registry() * * Implementation supports Windows 95, 98 and ME. */ static int get_DNS_Registry_9X(char **outptr) { HKEY hKey_VxD_MStcp; int gotString; int res; *outptr = NULL; res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, WIN_NS_9X, 0, KEY_READ, &hKey_VxD_MStcp); if (res != ERROR_SUCCESS) return 0; gotString = get_REG_SZ_9X(hKey_VxD_MStcp, NAMESERVER, outptr); RegCloseKey(hKey_VxD_MStcp); if (!gotString || !*outptr) return 0; return 1; } /* * get_DNS_Registry_NT() * * Functionally identical to get_DNS_Registry() * * Refs: Microsoft Knowledge Base articles KB120642 and KB314053. * * Implementation supports Windows NT 3.5 and newer. */ static int get_DNS_Registry_NT(char **outptr) { HKEY hKey_Interfaces = NULL; HKEY hKey_Tcpip_Parameters; int gotString; int res; *outptr = NULL; res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, WIN_NS_NT_KEY, 0, KEY_READ, &hKey_Tcpip_Parameters); if (res != ERROR_SUCCESS) return 0; /* ** Global DNS settings override adapter specific parameters when both ** are set. Additionally static DNS settings override DHCP-configured ** parameters when both are set. */ /* Global DNS static parameters */ gotString = get_REG_SZ(hKey_Tcpip_Parameters, NAMESERVER, outptr); if (gotString) goto done; /* Global DNS DHCP-configured parameters */ gotString = get_REG_SZ(hKey_Tcpip_Parameters, DHCPNAMESERVER, outptr); if (gotString) goto done; /* Try adapter specific parameters */ res = RegOpenKeyExA(hKey_Tcpip_Parameters, "Interfaces", 0, KEY_QUERY_VALUE | KEY_ENUMERATE_SUB_KEYS, &hKey_Interfaces); if (res != ERROR_SUCCESS) { hKey_Interfaces = NULL; goto done; } /* Adapter specific DNS static parameters */ gotString = get_enum_REG_SZ(hKey_Interfaces, NAMESERVER, outptr); if (gotString) goto done; /* Adapter specific DNS DHCP-configured parameters */ gotString = get_enum_REG_SZ(hKey_Interfaces, DHCPNAMESERVER, outptr); done: if (hKey_Interfaces) RegCloseKey(hKey_Interfaces); RegCloseKey(hKey_Tcpip_Parameters); if (!gotString || !*outptr) return 0; return 1; } /* * get_DNS_Registry() * * Locates DNS info in the registry. When located, this returns a pointer * in *outptr to a newly allocated memory area holding a null-terminated * string with a space or comma seperated list of DNS IP addresses. * * Returns 0 and nullifies *outptr upon inability to return DNSes string. * * Returns 1 and sets *outptr when returning a dynamically allocated string. */ static int get_DNS_Registry(char **outptr) { win_platform platform; int gotString = 0; *outptr = NULL; platform = ares__getplatform(); if (platform == WIN_NT) gotString = get_DNS_Registry_NT(outptr); else if (platform == WIN_9X) gotString = get_DNS_Registry_9X(outptr); if (!gotString) return 0; return 1; } static void commanjoin(char** dst, const char* const src, const size_t len) { char *newbuf; size_t newsize; /* 1 for terminating 0 and 2 for , and terminating 0 */ newsize = len + (*dst ? (strlen(*dst) + 2) : 1); newbuf = ares_realloc(*dst, newsize); if (!newbuf) return; if (*dst == NULL) *newbuf = '\0'; *dst = newbuf; if (strlen(*dst) != 0) strcat(*dst, ","); strncat(*dst, src, len); } /* * commajoin() * * RTF code. */ static void commajoin(char **dst, const char *src) { commanjoin(dst, src, strlen(src)); } /* * get_DNS_NetworkParams() * * Locates DNS info using GetNetworkParams() function from the Internet * Protocol Helper (IP Helper) API. When located, this returns a pointer * in *outptr to a newly allocated memory area holding a null-terminated * string with a space or comma seperated list of DNS IP addresses. * * Returns 0 and nullifies *outptr upon inability to return DNSes string. * * Returns 1 and sets *outptr when returning a dynamically allocated string. * * Implementation supports Windows 98 and newer. * * Note: Ancient PSDK required in order to build a W98 target. */ static int get_DNS_NetworkParams(char **outptr) { FIXED_INFO *fi, *newfi; struct ares_addr namesrvr; char *txtaddr; IP_ADDR_STRING *ipAddr; int res; DWORD size = sizeof (*fi); *outptr = NULL; /* Verify run-time availability of GetNetworkParams() */ if (ares_fpGetNetworkParams == ZERO_NULL) return 0; fi = ares_malloc(size); if (!fi) return 0; res = (*ares_fpGetNetworkParams) (fi, &size); if ((res != ERROR_BUFFER_OVERFLOW) && (res != ERROR_SUCCESS)) goto done; newfi = ares_realloc(fi, size); if (!newfi) goto done; fi = newfi; res = (*ares_fpGetNetworkParams) (fi, &size); if (res != ERROR_SUCCESS) goto done; for (ipAddr = &fi->DnsServerList; ipAddr; ipAddr = ipAddr->Next) { txtaddr = &ipAddr->IpAddress.String[0]; /* Validate converting textual address to binary format. */ if (ares_inet_pton(AF_INET, txtaddr, &namesrvr.addrV4) == 1) { if ((namesrvr.addrV4.S_un.S_addr == INADDR_ANY) || (namesrvr.addrV4.S_un.S_addr == INADDR_NONE)) continue; } else if (ares_inet_pton(AF_INET6, txtaddr, &namesrvr.addrV6) == 1) { if (memcmp(&namesrvr.addrV6, &ares_in6addr_any, sizeof(namesrvr.addrV6)) == 0) continue; } else continue; commajoin(outptr, txtaddr); if (!*outptr) break; } done: if (fi) ares_free(fi); if (!*outptr) return 0; return 1; } static BOOL ares_IsWindowsVistaOrGreater(void) { OSVERSIONINFO vinfo; memset(&vinfo, 0, sizeof(vinfo)); vinfo.dwOSVersionInfoSize = sizeof(vinfo); #ifdef _MSC_VER #pragma warning(push) #pragma warning(disable:4996) /* warning C4996: 'GetVersionExW': was declared deprecated */ #endif if (!GetVersionEx(&vinfo) || vinfo.dwMajorVersion < 6) return FALSE; return TRUE; #ifdef _MSC_VER #pragma warning(pop) #endif } /* A structure to hold the string form of IPv4 and IPv6 addresses so we can * sort them by a metric. */ typedef struct { /* The metric we sort them by. */ ULONG metric; /* Original index of the item, used as a secondary sort parameter to make * qsort() stable if the metrics are equal */ size_t orig_idx; /* Room enough for the string form of any IPv4 or IPv6 address that * ares_inet_ntop() will create. Based on the existing c-ares practice. */ char text[sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")]; } Address; /* Sort Address values \a left and \a right by metric, returning the usual * indicators for qsort(). */ static int compareAddresses(const void *arg1, const void *arg2) { const Address * const left = arg1; const Address * const right = arg2; /* Lower metric the more preferred */ if(left->metric < right->metric) return -1; if(left->metric > right->metric) return 1; /* If metrics are equal, lower original index more preferred */ if(left->orig_idx < right->orig_idx) return -1; if(left->orig_idx > right->orig_idx) return 1; return 0; } /* There can be multiple routes to "the Internet". And there can be different * DNS servers associated with each of the interfaces that offer those routes. * We have to assume that any DNS server can serve any request. But, some DNS * servers may only respond if requested over their associated interface. But * we also want to use "the preferred route to the Internet" whenever possible * (and not use DNS servers on a non-preferred route even by forcing request * to go out on the associated non-preferred interface). i.e. We want to use * the DNS servers associated with the same interface that we would use to * make a general request to anything else. * * But, Windows won't sort the DNS servers by the metrics associated with the * routes and interfaces _even_ though it obviously sends IP packets based on * those same routes and metrics. So, we must do it ourselves. * * So, we sort the DNS servers by the same metric values used to determine how * an outgoing IP packet will go, thus effectively using the DNS servers * associated with the interface that the DNS requests themselves will * travel. This gives us optimal routing and avoids issues where DNS servers * won't respond to requests that don't arrive via some specific subnetwork * (and thus some specific interface). * * This function computes the metric we use to sort. On the interface * identified by \a luid, it determines the best route to \a dest and combines * that route's metric with \a interfaceMetric to compute a metric for the * destination address on that interface. This metric can be used as a weight * to sort the DNS server addresses associated with each interface (lower is * better). * * Note that by restricting the route search to the specific interface with * which the DNS servers are associated, this function asks the question "What * is the metric for sending IP packets to this DNS server?" which allows us * to sort the DNS servers correctly. */ static ULONG getBestRouteMetric(IF_LUID * const luid, /* Can't be const :( */ const SOCKADDR_INET * const dest, const ULONG interfaceMetric) { /* On this interface, get the best route to that destination. */ MIB_IPFORWARD_ROW2 row; SOCKADDR_INET ignored; if(!ares_fpGetBestRoute2 || ares_fpGetBestRoute2(/* The interface to use. The index is ignored since we are * passing a LUID. */ luid, 0, /* No specific source address. */ NULL, /* Our destination address. */ dest, /* No options. */ 0, /* The route row. */ &row, /* The best source address, which we don't need. */ &ignored) != NO_ERROR /* If the metric is "unused" (-1) or too large for us to add the two * metrics, use the worst possible, thus sorting this last. */ || row.Metric == (ULONG)-1 || row.Metric > ((ULONG)-1) - interfaceMetric) { /* Return the worst possible metric. */ return (ULONG)-1; } /* Return the metric value from that row, plus the interface metric. * * See * http://msdn.microsoft.com/en-us/library/windows/desktop/aa814494(v=vs.85).aspx * which describes the combination as a "sum". */ return row.Metric + interfaceMetric; } /* * get_DNS_AdaptersAddresses() * * Locates DNS info using GetAdaptersAddresses() function from the Internet * Protocol Helper (IP Helper) API. When located, this returns a pointer * in *outptr to a newly allocated memory area holding a null-terminated * string with a space or comma seperated list of DNS IP addresses. * * Returns 0 and nullifies *outptr upon inability to return DNSes string. * * Returns 1 and sets *outptr when returning a dynamically allocated string. * * Implementation supports Windows XP and newer. */ #define IPAA_INITIAL_BUF_SZ 15 * 1024 #define IPAA_MAX_TRIES 3 static int get_DNS_AdaptersAddresses(char **outptr) { IP_ADAPTER_DNS_SERVER_ADDRESS *ipaDNSAddr; IP_ADAPTER_ADDRESSES *ipaa, *newipaa, *ipaaEntry; ULONG ReqBufsz = IPAA_INITIAL_BUF_SZ; ULONG Bufsz = IPAA_INITIAL_BUF_SZ; ULONG AddrFlags = 0; int trying = IPAA_MAX_TRIES; int res; /* The capacity of addresses, in elements. */ size_t addressesSize; /* The number of elements in addresses. */ size_t addressesIndex = 0; /* The addresses we will sort. */ Address *addresses; union { struct sockaddr *sa; struct sockaddr_in *sa4; struct sockaddr_in6 *sa6; } namesrvr; *outptr = NULL; /* Verify run-time availability of GetAdaptersAddresses() */ if (ares_fpGetAdaptersAddresses == ZERO_NULL) return 0; ipaa = ares_malloc(Bufsz); if (!ipaa) return 0; /* Start with enough room for a few DNS server addresses and we'll grow it * as we encounter more. */ addressesSize = 4; addresses = (Address*)ares_malloc(sizeof(Address) * addressesSize); if(addresses == NULL) { /* We need room for at least some addresses to function. */ ares_free(ipaa); return 0; } /* Usually this call suceeds with initial buffer size */ res = (*ares_fpGetAdaptersAddresses) (AF_UNSPEC, AddrFlags, NULL, ipaa, &ReqBufsz); if ((res != ERROR_BUFFER_OVERFLOW) && (res != ERROR_SUCCESS)) goto done; while ((res == ERROR_BUFFER_OVERFLOW) && (--trying)) { if (Bufsz < ReqBufsz) { newipaa = ares_realloc(ipaa, ReqBufsz); if (!newipaa) goto done; Bufsz = ReqBufsz; ipaa = newipaa; } res = (*ares_fpGetAdaptersAddresses) (AF_UNSPEC, AddrFlags, NULL, ipaa, &ReqBufsz); if (res == ERROR_SUCCESS) break; } if (res != ERROR_SUCCESS) goto done; for (ipaaEntry = ipaa; ipaaEntry; ipaaEntry = ipaaEntry->Next) { if(ipaaEntry->OperStatus != IfOperStatusUp) continue; /* For each interface, find any associated DNS servers as IPv4 or IPv6 * addresses. For each found address, find the best route to that DNS * server address _on_ _that_ _interface_ (at this moment in time) and * compute the resulting total metric, just as Windows routing will do. * Then, sort all the addresses found by the metric. */ for (ipaDNSAddr = ipaaEntry->FirstDnsServerAddress; ipaDNSAddr; ipaDNSAddr = ipaDNSAddr->Next) { namesrvr.sa = ipaDNSAddr->Address.lpSockaddr; if (namesrvr.sa->sa_family == AF_INET) { if ((namesrvr.sa4->sin_addr.S_un.S_addr == INADDR_ANY) || (namesrvr.sa4->sin_addr.S_un.S_addr == INADDR_NONE)) continue; /* Allocate room for another address, if necessary, else skip. */ if(addressesIndex == addressesSize) { const size_t newSize = addressesSize + 4; Address * const newMem = (Address*)ares_realloc(addresses, sizeof(Address) * newSize); if(newMem == NULL) { continue; } addresses = newMem; addressesSize = newSize; } /* Vista required for Luid or Ipv4Metric */ if (ares_IsWindowsVistaOrGreater()) { /* Save the address as the next element in addresses. */ addresses[addressesIndex].metric = getBestRouteMetric(&ipaaEntry->Luid, (SOCKADDR_INET*)(namesrvr.sa), ipaaEntry->Ipv4Metric); } else { addresses[addressesIndex].metric = (ULONG)-1; } /* Record insertion index to make qsort stable */ addresses[addressesIndex].orig_idx = addressesIndex; if (! ares_inet_ntop(AF_INET, &namesrvr.sa4->sin_addr, addresses[addressesIndex].text, sizeof(addresses[0].text))) { continue; } ++addressesIndex; } else if (namesrvr.sa->sa_family == AF_INET6) { if (memcmp(&namesrvr.sa6->sin6_addr, &ares_in6addr_any, sizeof(namesrvr.sa6->sin6_addr)) == 0) continue; /* Allocate room for another address, if necessary, else skip. */ if(addressesIndex == addressesSize) { const size_t newSize = addressesSize + 4; Address * const newMem = (Address*)ares_realloc(addresses, sizeof(Address) * newSize); if(newMem == NULL) { continue; } addresses = newMem; addressesSize = newSize; } /* Vista required for Luid or Ipv4Metric */ if (ares_IsWindowsVistaOrGreater()) { /* Save the address as the next element in addresses. */ addresses[addressesIndex].metric = getBestRouteMetric(&ipaaEntry->Luid, (SOCKADDR_INET*)(namesrvr.sa), ipaaEntry->Ipv6Metric); } else { addresses[addressesIndex].metric = (ULONG)-1; } /* Record insertion index to make qsort stable */ addresses[addressesIndex].orig_idx = addressesIndex; if (! ares_inet_ntop(AF_INET6, &namesrvr.sa6->sin6_addr, addresses[addressesIndex].text, sizeof(addresses[0].text))) { continue; } ++addressesIndex; } else { /* Skip non-IPv4/IPv6 addresses completely. */ continue; } } } /* Sort all of the textual addresses by their metric (and original index if * metrics are equal). */ qsort(addresses, addressesIndex, sizeof(*addresses), compareAddresses); /* Join them all into a single string, removing duplicates. */ { size_t i; for(i = 0; i < addressesIndex; ++i) { size_t j; /* Look for this address text appearing previously in the results. */ for(j = 0; j < i; ++j) { if(strcmp(addresses[j].text, addresses[i].text) == 0) { break; } } /* Iff we didn't emit this address already, emit it now. */ if(j == i) { /* Add that to outptr (if we can). */ commajoin(outptr, addresses[i].text); } } } done: ares_free(addresses); if (ipaa) ares_free(ipaa); if (!*outptr) { return 0; } return 1; } /* * get_DNS_Windows() * * Locates DNS info from Windows employing most suitable methods available at * run-time no matter which Windows version it is. When located, this returns * a pointer in *outptr to a newly allocated memory area holding a string with * a space or comma seperated list of DNS IP addresses, null-terminated. * * Returns 0 and nullifies *outptr upon inability to return DNSes string. * * Returns 1 and sets *outptr when returning a dynamically allocated string. * * Implementation supports Windows 95 and newer. */ static int get_DNS_Windows(char **outptr) { /* Try using IP helper API GetAdaptersAddresses(). IPv4 + IPv6, also sorts * DNS servers by interface route metrics to try to use the best DNS server. */ if (get_DNS_AdaptersAddresses(outptr)) return 1; /* Try using IP helper API GetNetworkParams(). IPv4 only. */ if (get_DNS_NetworkParams(outptr)) return 1; /* Fall-back to registry information */ return get_DNS_Registry(outptr); } /* * get_SuffixList_Windows() * * Reads the "DNS Suffix Search List" from registry and writes the list items * whitespace separated to outptr. If the Search List is empty, the * "Primary Dns Suffix" is written to outptr. * * Returns 0 and nullifies *outptr upon inability to return the suffix list. * * Returns 1 and sets *outptr when returning a dynamically allocated string. * * Implementation supports Windows Server 2003 and newer */ static int get_SuffixList_Windows(char **outptr) { HKEY hKey, hKeyEnum; char keyName[256]; DWORD keyNameBuffSize; DWORD keyIdx = 0; char *p = NULL; *outptr = NULL; if (ares__getplatform() != WIN_NT) return 0; /* 1. Global DNS Suffix Search List */ if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, WIN_NS_NT_KEY, 0, KEY_READ, &hKey) == ERROR_SUCCESS) { get_REG_SZ(hKey, SEARCHLIST_KEY, outptr); if (get_REG_SZ(hKey, DOMAIN_KEY, &p)) { commajoin(outptr, p); ares_free(p); p = NULL; } RegCloseKey(hKey); } if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, WIN_NT_DNSCLIENT, 0, KEY_READ, &hKey) == ERROR_SUCCESS) { if (get_REG_SZ(hKey, SEARCHLIST_KEY, &p)) { commajoin(outptr, p); ares_free(p); p = NULL; } RegCloseKey(hKey); } /* 2. Connection Specific Search List composed of: * a. Primary DNS Suffix */ if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, WIN_DNSCLIENT, 0, KEY_READ, &hKey) == ERROR_SUCCESS) { if (get_REG_SZ(hKey, PRIMARYDNSSUFFIX_KEY, &p)) { commajoin(outptr, p); ares_free(p); p = NULL; } RegCloseKey(hKey); } /* b. Interface SearchList, Domain, DhcpDomain */ if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, WIN_NS_NT_KEY "\\" INTERFACES_KEY, 0, KEY_READ, &hKey) == ERROR_SUCCESS) { for(;;) { keyNameBuffSize = sizeof(keyName); if (RegEnumKeyExA(hKey, keyIdx++, keyName, &keyNameBuffSize, 0, NULL, NULL, NULL) != ERROR_SUCCESS) break; if (RegOpenKeyExA(hKey, keyName, 0, KEY_QUERY_VALUE, &hKeyEnum) != ERROR_SUCCESS) continue; /* p can be comma separated (SearchList) */ if (get_REG_SZ(hKeyEnum, SEARCHLIST_KEY, &p)) { commajoin(outptr, p); ares_free(p); p = NULL; } if (get_REG_SZ(hKeyEnum, DOMAIN_KEY, &p)) { commajoin(outptr, p); ares_free(p); p = NULL; } if (get_REG_SZ(hKeyEnum, DHCPDOMAIN_KEY, &p)) { commajoin(outptr, p); ares_free(p); p = NULL; } RegCloseKey(hKeyEnum); } RegCloseKey(hKey); } return *outptr != NULL; } #endif static int init_by_resolv_conf(ares_channel channel) { #if !defined(ANDROID) && !defined(__ANDROID__) && !defined(WATT32) && \ !defined(CARES_USE_LIBRESOLV) char *line = NULL; #endif int status = -1, nservers = 0, nsort = 0; struct server_state *servers = NULL; struct apattern *sortlist = NULL; #ifdef WIN32 if (channel->nservers > -1) /* don't override ARES_OPT_SERVER */ return ARES_SUCCESS; if (get_DNS_Windows(&line)) { status = config_nameserver(&servers, &nservers, line); ares_free(line); } if (channel->ndomains == -1 && get_SuffixList_Windows(&line)) { status = set_search(channel, line); ares_free(line); } if (status == ARES_SUCCESS) status = ARES_EOF; else /* Catch the case when all the above checks fail (which happens when there is no network card or the cable is unplugged) */ status = ARES_EFILE; #elif defined(__MVS__) struct __res_state *res = 0; int count4, count6; __STATEEXTIPV6 *v6; struct server_state *pserver; if (0 == res) { int rc = res_init(); while (rc == -1 && h_errno == TRY_AGAIN) { rc = res_init(); } if (rc == -1) { return ARES_ENOMEM; } res = __res(); } v6 = res->__res_extIPv6; count4 = res->nscount; if (v6) { count6 = v6->__stat_nscount; } else { count6 = 0; } nservers = count4 + count6; servers = ares_malloc(nservers * sizeof(struct server_state)); if (!servers) return ARES_ENOMEM; memset(servers, 0, nservers * sizeof(struct server_state)); pserver = servers; for (int i = 0; i < count4; ++i, ++pserver) { struct sockaddr_in *addr_in = &(res->nsaddr_list[i]); pserver->addr.addrV4.s_addr = addr_in->sin_addr.s_addr; pserver->addr.family = AF_INET; pserver->addr.udp_port = addr_in->sin_port; pserver->addr.tcp_port = addr_in->sin_port; } for (int j = 0; j < count6; ++j, ++pserver) { struct sockaddr_in6 *addr_in = &(v6->__stat_nsaddr_list[j]); memcpy(&(pserver->addr.addr.addr6), &(addr_in->sin6_addr), sizeof(addr_in->sin6_addr)); pserver->addr.family = AF_INET6; pserver->addr.udp_port = addr_in->sin6_port; pserver->addr.tcp_port = addr_in->sin6_port; } status = ARES_EOF; #elif defined(__riscos__) /* Under RISC OS, name servers are listed in the system variable Inet$Resolvers, space separated. */ line = getenv("Inet$Resolvers"); status = ARES_EOF; if (line) { char *resolvers = ares_strdup(line), *pos, *space; if (!resolvers) return ARES_ENOMEM; pos = resolvers; do { space = strchr(pos, ' '); if (space) *space = '\0'; status = config_nameserver(&servers, &nservers, pos); if (status != ARES_SUCCESS) break; pos = space + 1; } while (space); if (status == ARES_SUCCESS) status = ARES_EOF; ares_free(resolvers); } #elif defined(WATT32) int i; sock_init(); for (i = 0; def_nameservers[i]; i++) ; if (i == 0) return ARES_SUCCESS; /* use localhost DNS server */ nservers = i; servers = ares_malloc(sizeof(struct server_state)); if (!servers) return ARES_ENOMEM; memset(servers, 0, sizeof(struct server_state)); for (i = 0; def_nameservers[i]; i++) { servers[i].addr.addrV4.s_addr = htonl(def_nameservers[i]); servers[i].addr.family = AF_INET; servers[i].addr.udp_port = 0; servers[i].addr.tcp_port = 0; } status = ARES_EOF; #elif defined(ANDROID) || defined(__ANDROID__) unsigned int i; char **dns_servers; char *domains; size_t num_servers; /* Use the Android connectivity manager to get a list * of DNS servers. As of Android 8 (Oreo) net.dns# * system properties are no longer available. Google claims this * improves privacy. Apps now need the ACCESS_NETWORK_STATE * permission and must use the ConnectivityManager which * is Java only. */ dns_servers = ares_get_android_server_list(MAX_DNS_PROPERTIES, &num_servers); if (dns_servers != NULL) { for (i = 0; i < num_servers; i++) { status = config_nameserver(&servers, &nservers, dns_servers[i]); if (status != ARES_SUCCESS) break; status = ARES_EOF; } for (i = 0; i < num_servers; i++) { ares_free(dns_servers[i]); } ares_free(dns_servers); } if (channel->ndomains == -1) { domains = ares_get_android_search_domains_list(); set_search(channel, domains); ares_free(domains); } # ifdef HAVE___SYSTEM_PROPERTY_GET /* Old way using the system property still in place as * a fallback. Older android versions can still use this. * it's possible for older apps not not have added the new * permission and we want to try to avoid breaking those. * * We'll only run this if we don't have any dns servers * because this will get the same ones (if it works). */ if (status != ARES_EOF) { char propname[PROP_NAME_MAX]; char propvalue[PROP_VALUE_MAX]=""; for (i = 1; i <= MAX_DNS_PROPERTIES; i++) { snprintf(propname, sizeof(propname), "%s%u", DNS_PROP_NAME_PREFIX, i); if (__system_property_get(propname, propvalue) < 1) { status = ARES_EOF; break; } status = config_nameserver(&servers, &nservers, propvalue); if (status != ARES_SUCCESS) break; status = ARES_EOF; } } # endif /* HAVE___SYSTEM_PROPERTY_GET */ #elif defined(CARES_USE_LIBRESOLV) struct __res_state res; memset(&res, 0, sizeof(res)); int result = res_ninit(&res); if (result == 0 && (res.options & RES_INIT)) { status = ARES_EOF; if (channel->nservers == -1) { union res_sockaddr_union addr[MAXNS]; int nscount = res_getservers(&res, addr, MAXNS); int i; for (i = 0; i < nscount; ++i) { char str[INET6_ADDRSTRLEN]; int config_status; sa_family_t family = addr[i].sin.sin_family; if (family == AF_INET) { ares_inet_ntop(family, &addr[i].sin.sin_addr, str, sizeof(str)); } else if (family == AF_INET6) { ares_inet_ntop(family, &addr[i].sin6.sin6_addr, str, sizeof(str)); } else { continue; } config_status = config_nameserver(&servers, &nservers, str); if (config_status != ARES_SUCCESS) { status = config_status; break; } } } if (channel->ndomains == -1) { int entries = 0; while ((entries < MAXDNSRCH) && res.dnsrch[entries]) entries++; if(entries) { channel->domains = ares_malloc(entries * sizeof(char *)); if (!channel->domains) { status = ARES_ENOMEM; } else { int i; channel->ndomains = entries; for (i = 0; i < channel->ndomains; ++i) { channel->domains[i] = ares_strdup(res.dnsrch[i]); if (!channel->domains[i]) status = ARES_ENOMEM; } } } } if (channel->ndots == -1) channel->ndots = res.ndots; if (channel->tries == -1) channel->tries = res.retry; if (channel->rotate == -1) channel->rotate = res.options & RES_ROTATE; if (channel->timeout == -1) channel->timeout = res.retrans * 1000; res_ndestroy(&res); } #else { char *p; FILE *fp; size_t linesize; int error; int update_domains; const char *resolvconf_path; /* Don't read resolv.conf and friends if we don't have to */ if (ARES_CONFIG_CHECK(channel)) return ARES_SUCCESS; /* Only update search domains if they're not already specified */ update_domains = (channel->ndomains == -1); /* Support path for resolvconf filename set by ares_init_options */ if(channel->resolvconf_path) { resolvconf_path = channel->resolvconf_path; } else { resolvconf_path = PATH_RESOLV_CONF; } fp = fopen(resolvconf_path, "r"); if (fp) { while ((status = ares__read_line(fp, &line, &linesize)) == ARES_SUCCESS) { if ((p = try_config(line, "domain", ';')) && update_domains) status = config_domain(channel, p); else if ((p = try_config(line, "lookup", ';')) && !channel->lookups) status = config_lookup(channel, p, "bind", NULL, "file"); else if ((p = try_config(line, "search", ';')) && update_domains) status = set_search(channel, p); else if ((p = try_config(line, "nameserver", ';')) && channel->nservers == -1) status = config_nameserver(&servers, &nservers, p); else if ((p = try_config(line, "sortlist", ';')) && channel->nsort == -1) status = config_sortlist(&sortlist, &nsort, p); else if ((p = try_config(line, "options", ';'))) status = set_options(channel, p); else status = ARES_SUCCESS; if (status != ARES_SUCCESS) break; } fclose(fp); } else { error = ERRNO; switch(error) { case ENOENT: case ESRCH: status = ARES_EOF; break; default: DEBUGF(fprintf(stderr, "fopen() failed with error: %d %s\n", error, strerror(error))); DEBUGF(fprintf(stderr, "Error opening file: %s\n", PATH_RESOLV_CONF)); status = ARES_EFILE; } } if ((status == ARES_EOF) && (!channel->lookups)) { /* Many systems (Solaris, Linux, BSD's) use nsswitch.conf */ fp = fopen("/etc/nsswitch.conf", "r"); if (fp) { while ((status = ares__read_line(fp, &line, &linesize)) == ARES_SUCCESS) { if ((p = try_config(line, "hosts:", '\0')) && !channel->lookups) (void)config_lookup(channel, p, "dns", "resolve", "files"); } fclose(fp); } else { error = ERRNO; switch(error) { case ENOENT: case ESRCH: break; default: DEBUGF(fprintf(stderr, "fopen() failed with error: %d %s\n", error, strerror(error))); DEBUGF(fprintf(stderr, "Error opening file: %s\n", "/etc/nsswitch.conf")); } /* ignore error, maybe we will get luck in next if clause */ status = ARES_EOF; } } if ((status == ARES_EOF) && (!channel->lookups)) { /* Linux / GNU libc 2.x and possibly others have host.conf */ fp = fopen("/etc/host.conf", "r"); if (fp) { while ((status = ares__read_line(fp, &line, &linesize)) == ARES_SUCCESS) { if ((p = try_config(line, "order", '\0')) && !channel->lookups) /* ignore errors */ (void)config_lookup(channel, p, "bind", NULL, "hosts"); } fclose(fp); } else { error = ERRNO; switch(error) { case ENOENT: case ESRCH: break; default: DEBUGF(fprintf(stderr, "fopen() failed with error: %d %s\n", error, strerror(error))); DEBUGF(fprintf(stderr, "Error opening file: %s\n", "/etc/host.conf")); } /* ignore error, maybe we will get luck in next if clause */ status = ARES_EOF; } } if ((status == ARES_EOF) && (!channel->lookups)) { /* Tru64 uses /etc/svc.conf */ fp = fopen("/etc/svc.conf", "r"); if (fp) { while ((status = ares__read_line(fp, &line, &linesize)) == ARES_SUCCESS) { if ((p = try_config(line, "hosts=", '\0')) && !channel->lookups) /* ignore errors */ (void)config_lookup(channel, p, "bind", NULL, "local"); } fclose(fp); } else { error = ERRNO; switch(error) { case ENOENT: case ESRCH: break; default: DEBUGF(fprintf(stderr, "fopen() failed with error: %d %s\n", error, strerror(error))); DEBUGF(fprintf(stderr, "Error opening file: %s\n", "/etc/svc.conf")); } /* ignore error, default value will be chosen for `channel->lookups` */ status = ARES_EOF; } } if(line) ares_free(line); } #endif /* Handle errors. */ if (status != ARES_EOF) { if (servers != NULL) ares_free(servers); if (sortlist != NULL) ares_free(sortlist); return status; } /* If we got any name server entries, fill them in. */ if (servers) { channel->servers = servers; channel->nservers = nservers; } /* If we got any sortlist entries, fill them in. */ if (sortlist) { channel->sortlist = sortlist; channel->nsort = nsort; } return ARES_SUCCESS; } static int init_by_defaults(ares_channel channel) { char *hostname = NULL; int rc = ARES_SUCCESS; #ifdef HAVE_GETHOSTNAME char *dot; #endif if (channel->flags == -1) channel->flags = 0; if (channel->timeout == -1) channel->timeout = DEFAULT_TIMEOUT; if (channel->tries == -1) channel->tries = DEFAULT_TRIES; if (channel->ndots == -1) channel->ndots = 1; if (channel->rotate == -1) channel->rotate = 0; if (channel->udp_port == -1) channel->udp_port = htons(NAMESERVER_PORT); if (channel->tcp_port == -1) channel->tcp_port = htons(NAMESERVER_PORT); if (channel->ednspsz == -1) channel->ednspsz = EDNSPACKETSZ; if (channel->nservers == -1) { /* If nobody specified servers, try a local named. */ channel->servers = ares_malloc(sizeof(struct server_state)); if (!channel->servers) { rc = ARES_ENOMEM; goto error; } channel->servers[0].addr.family = AF_INET; channel->servers[0].addr.addrV4.s_addr = htonl(INADDR_LOOPBACK); channel->servers[0].addr.udp_port = 0; channel->servers[0].addr.tcp_port = 0; channel->nservers = 1; } #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 == -1) { /* Derive a default domain search list from the kernel hostname, * or set it to empty if the hostname isn't helpful. */ #ifndef HAVE_GETHOSTNAME channel->ndomains = 0; /* default to none */ #else GETHOSTNAME_TYPE_ARG2 lenv = 64; size_t len = 64; int res; channel->ndomains = 0; /* default to none */ hostname = ares_malloc(len); if(!hostname) { rc = ARES_ENOMEM; goto error; } do { res = gethostname(hostname, lenv); if(toolong(res)) { char *p; len *= 2; lenv *= 2; p = ares_realloc(hostname, len); if(!p) { rc = ARES_ENOMEM; goto error; } 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); dot = strchr(hostname, '.'); if (dot) { /* a dot was found */ channel->domains = ares_malloc(sizeof(char *)); if (!channel->domains) { rc = ARES_ENOMEM; goto error; } channel->domains[0] = ares_strdup(dot + 1); if (!channel->domains[0]) { rc = ARES_ENOMEM; goto error; } channel->ndomains = 1; } #endif } if (channel->nsort == -1) { channel->sortlist = NULL; channel->nsort = 0; } if (!channel->lookups) { channel->lookups = ares_strdup("fb"); if (!channel->lookups) rc = ARES_ENOMEM; } error: if(rc) { if(channel->servers) { ares_free(channel->servers); channel->servers = NULL; } if(channel->domains && channel->domains[0]) ares_free(channel->domains[0]); if(channel->domains) { ares_free(channel->domains); channel->domains = NULL; } if(channel->lookups) { ares_free(channel->lookups); channel->lookups = NULL; } if(channel->resolvconf_path) { ares_free(channel->resolvconf_path); channel->resolvconf_path = NULL; } } if(hostname) ares_free(hostname); return rc; } #if !defined(WIN32) && !defined(WATT32) && \ !defined(ANDROID) && !defined(__ANDROID__) && !defined(CARES_USE_LIBRESOLV) static int config_domain(ares_channel channel, char *str) { char *q; /* Set a single search domain. */ q = str; while (*q && !ISSPACE(*q)) q++; *q = '\0'; return set_search(channel, str); } #if defined(__INTEL_COMPILER) && (__INTEL_COMPILER == 910) && \ defined(__OPTIMIZE__) && defined(__unix__) && defined(__i386__) /* workaround icc 9.1 optimizer issue */ # define vqualifier volatile #else # define vqualifier #endif static int config_lookup(ares_channel channel, const char *str, const char *bindch, const char *altbindch, const char *filech) { char lookups[3], *l; const char *vqualifier p; int found; if (altbindch == NULL) altbindch = bindch; /* Set the lookup order. Only the first letter of each work * is relevant, and it has to be "b" for DNS or "f" for the * host file. Ignore everything else. */ l = lookups; p = str; found = 0; while (*p) { if ((*p == *bindch || *p == *altbindch || *p == *filech) && l < lookups + 2) { if (*p == *bindch || *p == *altbindch) *l++ = 'b'; else *l++ = 'f'; found = 1; } while (*p && !ISSPACE(*p) && (*p != ',')) p++; while (*p && (ISSPACE(*p) || (*p == ','))) p++; } if (!found) return ARES_ENOTINITIALIZED; *l = '\0'; channel->lookups = ares_strdup(lookups); return (channel->lookups) ? ARES_SUCCESS : ARES_ENOMEM; } #endif /* !WIN32 & !WATT32 & !ANDROID & !__ANDROID__ & !CARES_USE_LIBRESOLV */ #ifndef WATT32 /* Validate that the ip address matches the subnet (network base and network * mask) specified. Addresses are specified in standard Network Byte Order as * 16 bytes, and the netmask is 0 to 128 (bits). */ static int ares_ipv6_subnet_matches(const unsigned char netbase[16], unsigned char netmask, const unsigned char ipaddr[16]) { unsigned char mask[16] = { 0 }; unsigned char i; /* Misuse */ if (netmask > 128) return 0; /* Quickly set whole bytes */ memset(mask, 0xFF, netmask / 8); /* Set remaining bits */ if(netmask % 8) { mask[netmask / 8] = (unsigned char)(0xff << (8 - (netmask % 8))); } for (i=0; i<16; i++) { if ((netbase[i] & mask[i]) != (ipaddr[i] & mask[i])) return 0; } return 1; } /* Return true iff the IPv6 ipaddr is blacklisted. */ static int ares_ipv6_server_blacklisted(const unsigned char ipaddr[16]) { /* A list of blacklisted IPv6 subnets. */ const struct { const unsigned char netbase[16]; unsigned char netmask; } blacklist[] = { /* fec0::/10 was deprecated by [RFC3879] in September 2004. Formerly a * Site-Local scoped address prefix. These are never valid DNS servers, * but are known to be returned at least sometimes on Windows and Android. */ { { 0xfe, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 10 } }; size_t i; /* See if ipaddr matches any of the entries in the blacklist. */ for (i = 0; i < sizeof(blacklist) / sizeof(blacklist[0]); ++i) { if (ares_ipv6_subnet_matches( blacklist[i].netbase, blacklist[i].netmask, ipaddr)) return 1; } return 0; } /* Add the IPv4 or IPv6 nameservers in str (separated by commas) to the * servers list, updating servers and nservers as required. * * This will silently ignore blacklisted IPv6 nameservers as detected by * ares_ipv6_server_blacklisted(). * * Returns an error code on failure, else ARES_SUCCESS. */ static int config_nameserver(struct server_state **servers, int *nservers, char *str) { struct ares_addr host; struct server_state *newserv; char *p, *txtaddr; /* On Windows, there may be more than one nameserver specified in the same * registry key, so we parse input as a space or comma seperated list. */ for (p = str; p;) { /* Skip whitespace and commas. */ while (*p && (ISSPACE(*p) || (*p == ','))) p++; if (!*p) /* No more input, done. */ break; /* Pointer to start of IPv4 or IPv6 address part. */ txtaddr = p; /* Advance past this address. */ while (*p && !ISSPACE(*p) && (*p != ',')) p++; if (*p) /* Null terminate this address. */ *p++ = '\0'; else /* Reached end of input, done when this address is processed. */ p = NULL; /* Convert textual address to binary format. */ if (ares_inet_pton(AF_INET, txtaddr, &host.addrV4) == 1) host.family = AF_INET; else if (ares_inet_pton(AF_INET6, txtaddr, &host.addrV6) == 1 /* Silently skip blacklisted IPv6 servers. */ && !ares_ipv6_server_blacklisted( (const unsigned char *)&host.addrV6)) host.family = AF_INET6; else continue; /* Resize servers state array. */ newserv = ares_realloc(*servers, (*nservers + 1) * sizeof(struct server_state)); if (!newserv) return ARES_ENOMEM; /* Store address data. */ newserv[*nservers].addr.family = host.family; newserv[*nservers].addr.udp_port = 0; newserv[*nservers].addr.tcp_port = 0; if (host.family == AF_INET) memcpy(&newserv[*nservers].addr.addrV4, &host.addrV4, sizeof(host.addrV4)); else memcpy(&newserv[*nservers].addr.addrV6, &host.addrV6, sizeof(host.addrV6)); /* Update arguments. */ *servers = newserv; *nservers += 1; } return ARES_SUCCESS; } #endif /* !WATT32 */ static int config_sortlist(struct apattern **sortlist, int *nsort, const char *str) { struct apattern pat; const char *q; /* Add sortlist entries. */ while (*str && *str != ';') { int bits; char ipbuf[16], ipbufpfx[32]; /* Find just the IP */ q = str; while (*q && *q != '/' && *q != ';' && !ISSPACE(*q)) q++; memcpy(ipbuf, str, q-str); ipbuf[q-str] = '\0'; /* Find the prefix */ if (*q == '/') { const char *str2 = q+1; while (*q && *q != ';' && !ISSPACE(*q)) q++; memcpy(ipbufpfx, str, q-str); ipbufpfx[q-str] = '\0'; str = str2; } else ipbufpfx[0] = '\0'; /* Lets see if it is CIDR */ /* First we'll try IPv6 */ if ((bits = ares_inet_net_pton(AF_INET6, ipbufpfx[0] ? ipbufpfx : ipbuf, &pat.addrV6, sizeof(pat.addrV6))) > 0) { pat.type = PATTERN_CIDR; pat.mask.bits = (unsigned short)bits; pat.family = AF_INET6; if (!sortlist_alloc(sortlist, nsort, &pat)) { ares_free(*sortlist); *sortlist = NULL; return ARES_ENOMEM; } } else if (ipbufpfx[0] && (bits = ares_inet_net_pton(AF_INET, ipbufpfx, &pat.addrV4, sizeof(pat.addrV4))) > 0) { pat.type = PATTERN_CIDR; pat.mask.bits = (unsigned short)bits; pat.family = AF_INET; if (!sortlist_alloc(sortlist, nsort, &pat)) { ares_free(*sortlist); *sortlist = NULL; return ARES_ENOMEM; } } /* See if it is just a regular IP */ else if (ip_addr(ipbuf, q-str, &pat.addrV4) == 0) { if (ipbufpfx[0]) { memcpy(ipbuf, str, q-str); ipbuf[q-str] = '\0'; if (ip_addr(ipbuf, q-str, &pat.mask.addr4) != 0) natural_mask(&pat); } else natural_mask(&pat); pat.family = AF_INET; pat.type = PATTERN_MASK; if (!sortlist_alloc(sortlist, nsort, &pat)) { ares_free(*sortlist); *sortlist = NULL; return ARES_ENOMEM; } } else { while (*q && *q != ';' && !ISSPACE(*q)) q++; } str = q; while (ISSPACE(*str)) str++; } return ARES_SUCCESS; } static int set_search(ares_channel channel, const char *str) { size_t cnt; if(channel->ndomains != -1) { /* LCOV_EXCL_START: all callers check ndomains == -1 */ /* if we already have some domains present, free them first */ ares_strsplit_free(channel->domains, channel->ndomains); channel->domains = NULL; channel->ndomains = -1; } /* LCOV_EXCL_STOP */ channel->domains = ares_strsplit(str, ", ", 1, &cnt); channel->ndomains = (int)cnt; if (channel->domains == NULL || channel->ndomains == 0) { channel->domains = NULL; channel->ndomains = -1; } return ARES_SUCCESS; } static int set_options(ares_channel channel, const char *str) { const char *p, *q, *val; p = str; while (*p) { q = p; while (*q && !ISSPACE(*q)) q++; val = try_option(p, q, "ndots:"); if (val && channel->ndots == -1) channel->ndots = aresx_sltosi(strtol(val, NULL, 10)); val = try_option(p, q, "retrans:"); if (val && channel->timeout == -1) channel->timeout = aresx_sltosi(strtol(val, NULL, 10)); val = try_option(p, q, "retry:"); if (val && channel->tries == -1) channel->tries = aresx_sltosi(strtol(val, NULL, 10)); val = try_option(p, q, "rotate"); if (val && channel->rotate == -1) channel->rotate = 1; p = q; while (ISSPACE(*p)) p++; } return ARES_SUCCESS; } static const char *try_option(const char *p, const char *q, const char *opt) { size_t len = strlen(opt); return ((size_t)(q - p) >= len && !strncmp(p, opt, len)) ? &p[len] : NULL; } #if !defined(WIN32) && !defined(WATT32) && \ !defined(ANDROID) && !defined(__ANDROID__) && !defined(CARES_USE_LIBRESOLV) static char *try_config(char *s, const char *opt, char scc) { size_t len; char *p; char *q; if (!s || !opt) /* no line or no option */ return NULL; /* LCOV_EXCL_LINE */ /* Hash '#' character is always used as primary comment char, additionally a not-NUL secondary comment char will be considered when specified. */ /* trim line comment */ p = s; if(scc) while (*p && (*p != '#') && (*p != scc)) p++; else while (*p && (*p != '#')) p++; *p = '\0'; /* trim trailing whitespace */ q = p - 1; while ((q >= s) && ISSPACE(*q)) q--; *++q = '\0'; /* skip leading whitespace */ p = s; while (*p && ISSPACE(*p)) p++; if (!*p) /* empty line */ return NULL; if ((len = strlen(opt)) == 0) /* empty option */ return NULL; /* LCOV_EXCL_LINE */ if (strncmp(p, opt, len) != 0) /* line and option do not match */ return NULL; /* skip over given option name */ p += len; if (!*p) /* no option value */ return NULL; /* LCOV_EXCL_LINE */ if ((opt[len-1] != ':') && (opt[len-1] != '=') && !ISSPACE(*p)) /* whitespace between option name and value is mandatory for given option names which do not end with ':' or '=' */ return NULL; /* skip over whitespace */ while (*p && ISSPACE(*p)) p++; if (!*p) /* no option value */ return NULL; /* return pointer to option value */ return p; } #endif /* !WIN32 & !WATT32 & !ANDROID & !__ANDROID__ */ static int ip_addr(const char *ipbuf, ares_ssize_t len, struct in_addr *addr) { /* Four octets and three periods yields at most 15 characters. */ if (len > 15) return -1; if (ares_inet_pton(AF_INET, ipbuf, addr) < 1) return -1; return 0; } static void natural_mask(struct apattern *pat) { struct in_addr addr; /* Store a host-byte-order copy of pat in a struct in_addr. Icky, * but portable. */ addr.s_addr = ntohl(pat->addrV4.s_addr); /* This is out of date in the CIDR world, but some people might * still rely on it. */ if (IN_CLASSA(addr.s_addr)) pat->mask.addr4.s_addr = htonl(IN_CLASSA_NET); else if (IN_CLASSB(addr.s_addr)) pat->mask.addr4.s_addr = htonl(IN_CLASSB_NET); else pat->mask.addr4.s_addr = htonl(IN_CLASSC_NET); } static int sortlist_alloc(struct apattern **sortlist, int *nsort, struct apattern *pat) { struct apattern *newsort; newsort = ares_realloc(*sortlist, (*nsort + 1) * sizeof(struct apattern)); if (!newsort) return 0; newsort[*nsort] = *pat; *sortlist = newsort; (*nsort)++; return 1; } /* initialize an rc4 key. If possible a cryptographically secure random key is generated using a suitable function (for example win32's RtlGenRandom as described in http://blogs.msdn.com/michael_howard/archive/2005/01/14/353379.aspx otherwise the code defaults to cross-platform albeit less secure mechanism using rand */ static void randomize_key(unsigned char* key,int key_data_len) { int randomized = 0; int counter=0; #ifdef WIN32 BOOLEAN res; if (ares_fpSystemFunction036) { res = (*ares_fpSystemFunction036) (key, key_data_len); if (res) randomized = 1; } #else /* !WIN32 */ #ifdef CARES_RANDOM_FILE FILE *f = fopen(CARES_RANDOM_FILE, "rb"); if(f) { setvbuf(f, NULL, _IONBF, 0); counter = aresx_uztosi(fread(key, 1, key_data_len, f)); fclose(f); } #endif #endif /* WIN32 */ if (!randomized) { for (;counterstate[0]; for(counter = 0; counter < 256; counter++) /* unnecessary AND but it keeps some compilers happier */ state[counter] = (unsigned char)(counter & 0xff); randomize_key(key->state,key_data_len); key->x = 0; key->y = 0; index1 = 0; index2 = 0; for(counter = 0; counter < 256; counter++) { index2 = (unsigned char)((key_data_ptr[index1] + state[counter] + index2) % 256); ARES_SWAP_BYTE(&state[counter], &state[index2]); index1 = (unsigned char)((index1 + 1) % key_data_len); } ares_free(key_data_ptr); return ARES_SUCCESS; } void ares_set_local_ip4(ares_channel channel, unsigned int local_ip) { channel->local_ip4 = local_ip; } /* local_ip6 should be 16 bytes in length */ void ares_set_local_ip6(ares_channel channel, const unsigned char* local_ip6) { memcpy(&channel->local_ip6, local_ip6, sizeof(channel->local_ip6)); } /* local_dev_name should be null terminated. */ void ares_set_local_dev(ares_channel channel, const char* local_dev_name) { strncpy(channel->local_dev_name, local_dev_name, sizeof(channel->local_dev_name)); channel->local_dev_name[sizeof(channel->local_dev_name) - 1] = 0; } void ares_set_socket_callback(ares_channel channel, ares_sock_create_callback cb, void *data) { channel->sock_create_cb = cb; channel->sock_create_cb_data = data; } void ares_set_socket_configure_callback(ares_channel channel, ares_sock_config_callback cb, void *data) { channel->sock_config_cb = cb; channel->sock_config_cb_data = data; } void ares_set_socket_functions(ares_channel channel, const struct ares_socket_functions * funcs, void *data) { channel->sock_funcs = funcs; channel->sock_func_cb_data = data; } int ares_set_sortlist(ares_channel channel, const char *sortstr) { int nsort = 0; struct apattern *sortlist = NULL; int status; if (!channel) return ARES_ENODATA; status = config_sortlist(&sortlist, &nsort, sortstr); if (status == ARES_SUCCESS && sortlist) { if (channel->sortlist) ares_free(channel->sortlist); channel->sortlist = sortlist; channel->nsort = nsort; } return status; } void ares__init_servers_state(ares_channel channel) { struct server_state *server; int i; for (i = 0; i < channel->nservers; i++) { server = &channel->servers[i]; server->udp_socket = ARES_SOCKET_BAD; server->tcp_socket = ARES_SOCKET_BAD; server->tcp_connection_generation = ++channel->tcp_connection_generation; server->tcp_lenbuf_pos = 0; server->tcp_buffer_pos = 0; server->tcp_buffer = NULL; server->tcp_length = 0; server->qhead = NULL; server->qtail = NULL; ares__init_list_head(&server->queries_to_server); server->channel = channel; server->is_broken = 0; } } ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares_iphlpapi.h0000644000175100001770000001346600000000000022440 0ustar00runnerdocker00000000000000#ifndef HEADER_CARES_IPHLPAPI_H #define HEADER_CARES_IPHLPAPI_H /* Copyright 1998 by the Massachusetts Institute of Technology. * Copyright (C) 2004 - 2011 by Daniel Stenberg et al * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ #if defined(USE_WINSOCK) #ifndef INET_ADDRSTRLEN #define INET_ADDRSTRLEN 22 #endif #ifndef INET6_ADDRSTRLEN #define INET6_ADDRSTRLEN 65 #endif /* ---------------------------------- */ #if !defined(_WS2DEF_) && \ !defined(__CSADDR_DEFINED__) && \ !defined(__CSADDR_T_DEFINED) /* ---------------------------------- */ typedef struct _SOCKET_ADDRESS { LPSOCKADDR lpSockaddr; INT iSockaddrLength; } SOCKET_ADDRESS, *PSOCKET_ADDRESS; typedef struct _CSADDR_INFO { SOCKET_ADDRESS LocalAddr; SOCKET_ADDRESS RemoteAddr; INT iSocketType; INT iProtocol; } CSADDR_INFO, *PCSADDR_INFO; /* --------------------------------- */ #endif /* ! _WS2DEF_ && \ */ /* ! __CSADDR_DEFINED__ && \ */ /* ! __CSADDR_T_DEFINED */ /* --------------------------------- */ /* ------------------------------- */ #if !defined(IP_ADAPTER_DDNS_ENABLED) /* ------------------------------- */ #define IP_ADAPTER_ADDRESS_DNS_ELIGIBLE 0x0001 #define IP_ADAPTER_ADDRESS_TRANSIENT 0x0002 #define IP_ADAPTER_DDNS_ENABLED 0x0001 #define IP_ADAPTER_REGISTER_ADAPTER_SUFFIX 0x0002 #define IP_ADAPTER_DHCP_ENABLED 0x0004 #define IP_ADAPTER_RECEIVE_ONLY 0x0008 #define IP_ADAPTER_NO_MULTICAST 0x0010 #define IP_ADAPTER_IPV6_OTHER_STATEFUL_CONFIG 0x0020 #define GAA_FLAG_SKIP_UNICAST 0x0001 #define GAA_FLAG_SKIP_ANYCAST 0x0002 #define GAA_FLAG_SKIP_MULTICAST 0x0004 #define GAA_FLAG_SKIP_DNS_SERVER 0x0008 #define GAA_FLAG_INCLUDE_PREFIX 0x0010 #define GAA_FLAG_SKIP_FRIENDLY_NAME 0x0020 typedef enum { IpPrefixOriginOther = 0, IpPrefixOriginManual, IpPrefixOriginWellKnown, IpPrefixOriginDhcp, IpPrefixOriginRouterAdvertisement } IP_PREFIX_ORIGIN; typedef enum { IpSuffixOriginOther = 0, IpSuffixOriginManual, IpSuffixOriginWellKnown, IpSuffixOriginDhcp, IpSuffixOriginLinkLayerAddress, IpSuffixOriginRandom } IP_SUFFIX_ORIGIN; typedef enum { IpDadStateInvalid = 0, IpDadStateTentative, IpDadStateDuplicate, IpDadStateDeprecated, IpDadStatePreferred } IP_DAD_STATE; typedef enum { IfOperStatusUp = 1, IfOperStatusDown, IfOperStatusTesting, IfOperStatusUnknown, IfOperStatusDormant, IfOperStatusNotPresent, IfOperStatusLowerLayerDown } IF_OPER_STATUS; typedef enum { ScopeLevelInterface = 0x0001, ScopeLevelLink = 0x0002, ScopeLevelSubnet = 0x0003, ScopeLevelAdmin = 0x0004, ScopeLevelSite = 0x0005, ScopeLevelOrganization = 0x0008, ScopeLevelGlobal = 0x000E } SCOPE_LEVEL; typedef struct _IP_ADAPTER_UNICAST_ADDRESS { union { ULONGLONG Alignment; struct { ULONG Length; DWORD Flags; } s; } u; struct _IP_ADAPTER_UNICAST_ADDRESS *Next; SOCKET_ADDRESS Address; IP_PREFIX_ORIGIN PrefixOrigin; IP_SUFFIX_ORIGIN SuffixOrigin; IP_DAD_STATE DadState; ULONG ValidLifetime; ULONG PreferredLifetime; ULONG LeaseLifetime; } IP_ADAPTER_UNICAST_ADDRESS, *PIP_ADAPTER_UNICAST_ADDRESS; typedef struct _IP_ADAPTER_ANYCAST_ADDRESS { union { ULONGLONG Alignment; struct { ULONG Length; DWORD Flags; } s; } u; struct _IP_ADAPTER_ANYCAST_ADDRESS *Next; SOCKET_ADDRESS Address; } IP_ADAPTER_ANYCAST_ADDRESS, *PIP_ADAPTER_ANYCAST_ADDRESS; typedef struct _IP_ADAPTER_MULTICAST_ADDRESS { union { ULONGLONG Alignment; struct { ULONG Length; DWORD Flags; } s; } u; struct _IP_ADAPTER_MULTICAST_ADDRESS *Next; SOCKET_ADDRESS Address; } IP_ADAPTER_MULTICAST_ADDRESS, *PIP_ADAPTER_MULTICAST_ADDRESS; typedef struct _IP_ADAPTER_DNS_SERVER_ADDRESS { union { ULONGLONG Alignment; struct { ULONG Length; DWORD Reserved; } s; } u; struct _IP_ADAPTER_DNS_SERVER_ADDRESS *Next; SOCKET_ADDRESS Address; } IP_ADAPTER_DNS_SERVER_ADDRESS, *PIP_ADAPTER_DNS_SERVER_ADDRESS; typedef struct _IP_ADAPTER_PREFIX { union { ULONGLONG Alignment; struct { ULONG Length; DWORD Flags; } s; } u; struct _IP_ADAPTER_PREFIX *Next; SOCKET_ADDRESS Address; ULONG PrefixLength; } IP_ADAPTER_PREFIX, *PIP_ADAPTER_PREFIX; typedef struct _IP_ADAPTER_ADDRESSES { union { ULONGLONG Alignment; struct { ULONG Length; DWORD IfIndex; } s; } u; struct _IP_ADAPTER_ADDRESSES *Next; PCHAR AdapterName; PIP_ADAPTER_UNICAST_ADDRESS FirstUnicastAddress; PIP_ADAPTER_ANYCAST_ADDRESS FirstAnycastAddress; PIP_ADAPTER_MULTICAST_ADDRESS FirstMulticastAddress; PIP_ADAPTER_DNS_SERVER_ADDRESS FirstDnsServerAddress; PWCHAR DnsSuffix; PWCHAR Description; PWCHAR FriendlyName; BYTE PhysicalAddress[MAX_ADAPTER_ADDRESS_LENGTH]; DWORD PhysicalAddressLength; DWORD Flags; DWORD Mtu; DWORD IfType; IF_OPER_STATUS OperStatus; DWORD Ipv6IfIndex; DWORD ZoneIndices[16]; PIP_ADAPTER_PREFIX FirstPrefix; } IP_ADAPTER_ADDRESSES, *PIP_ADAPTER_ADDRESSES; /* -------------------------------- */ #endif /* ! IP_ADAPTER_DDNS_ENABLED */ /* -------------------------------- */ #endif /* USE_WINSOCK */ #endif /* HEADER_CARES_IPHLPAPI_H */ ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares_ipv6.h0000644000175100001770000000401700000000000021506 0ustar00runnerdocker00000000000000 /* Copyright (C) 2005 by Dominick Meglio * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ #ifndef ARES_IPV6_H #define ARES_IPV6_H #ifndef HAVE_PF_INET6 #define PF_INET6 AF_INET6 #endif #ifndef HAVE_STRUCT_SOCKADDR_IN6 struct sockaddr_in6 { unsigned short sin6_family; unsigned short sin6_port; unsigned long sin6_flowinfo; struct ares_in6_addr sin6_addr; unsigned int sin6_scope_id; }; #endif typedef union { struct sockaddr sa; struct sockaddr_in sa4; struct sockaddr_in6 sa6; } ares_sockaddr; #ifndef HAVE_STRUCT_ADDRINFO struct addrinfo { int ai_flags; int ai_family; int ai_socktype; int ai_protocol; ares_socklen_t ai_addrlen; /* Follow rfc3493 struct addrinfo */ char *ai_canonname; struct sockaddr *ai_addr; struct addrinfo *ai_next; }; #endif #ifndef NS_IN6ADDRSZ #ifndef HAVE_STRUCT_IN6_ADDR /* We cannot have it set to zero, so we pick a fixed value here */ #define NS_IN6ADDRSZ 16 #else #define NS_IN6ADDRSZ sizeof(struct in6_addr) #endif #endif #ifndef NS_INADDRSZ #define NS_INADDRSZ sizeof(struct in_addr) #endif #ifndef NS_INT16SZ #define NS_INT16SZ 2 #endif #ifndef IF_NAMESIZE #ifdef IFNAMSIZ #define IF_NAMESIZE IFNAMSIZ #else #define IF_NAMESIZE 256 #endif #endif /* Defined in inet_net_pton.c for no particular reason. */ extern const struct ares_in6_addr ares_in6addr_any; /* :: */ #endif /* ARES_IPV6_H */ ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares_library_init.c0000644000175100001770000001231400000000000023303 0ustar00runnerdocker00000000000000 /* Copyright 1998 by the Massachusetts Institute of Technology. * Copyright (C) 2004-2009 by Daniel Stenberg * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ #include "ares_setup.h" #include "ares.h" #include "ares_library_init.h" #include "ares_private.h" /* library-private global and unique instance vars */ #ifdef USE_WINSOCK fpGetNetworkParams_t ares_fpGetNetworkParams = ZERO_NULL; fpSystemFunction036_t ares_fpSystemFunction036 = ZERO_NULL; fpGetAdaptersAddresses_t ares_fpGetAdaptersAddresses = ZERO_NULL; fpGetBestRoute2_t ares_fpGetBestRoute2 = ZERO_NULL; #endif #if defined(ANDROID) || defined(__ANDROID__) #include "ares_android.h" #endif /* library-private global vars with source visibility restricted to this file */ static unsigned int ares_initialized; static int ares_init_flags; /* library-private global vars with visibility across the whole library */ /* Some systems may return either NULL or a valid pointer on malloc(0). c-ares should * never call malloc(0) so lets return NULL so we're more likely to find an issue if it * were to occur. */ static void *default_malloc(size_t size) { if (size == 0) { return NULL; } 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); } 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; #ifdef USE_WINSOCK static HMODULE hnd_iphlpapi; static HMODULE hnd_advapi32; #endif static int ares_win32_init(void) { #ifdef USE_WINSOCK hnd_iphlpapi = 0; hnd_iphlpapi = LoadLibraryW(L"iphlpapi.dll"); if (!hnd_iphlpapi) return ARES_ELOADIPHLPAPI; ares_fpGetNetworkParams = (fpGetNetworkParams_t) GetProcAddress(hnd_iphlpapi, "GetNetworkParams"); if (!ares_fpGetNetworkParams) { FreeLibrary(hnd_iphlpapi); return ARES_EADDRGETNETWORKPARAMS; } ares_fpGetAdaptersAddresses = (fpGetAdaptersAddresses_t) GetProcAddress(hnd_iphlpapi, "GetAdaptersAddresses"); if (!ares_fpGetAdaptersAddresses) { /* This can happen on clients before WinXP, I don't think it should be an error, unless we don't want to support Windows 2000 anymore */ } ares_fpGetBestRoute2 = (fpGetBestRoute2_t) GetProcAddress(hnd_iphlpapi, "GetBestRoute2"); if (!ares_fpGetBestRoute2) { /* This can happen on clients before Vista, I don't think it should be an error, unless we don't want to support Windows XP anymore */ } /* * When advapi32.dll is unavailable or advapi32.dll has no SystemFunction036, * also known as RtlGenRandom, which is the case for Windows versions prior * to WinXP then c-ares uses portable rand() function. Then don't error here. */ hnd_advapi32 = 0; hnd_advapi32 = LoadLibraryW(L"advapi32.dll"); if (hnd_advapi32) { ares_fpSystemFunction036 = (fpSystemFunction036_t) GetProcAddress(hnd_advapi32, "SystemFunction036"); } #endif return ARES_SUCCESS; } static void ares_win32_cleanup(void) { #ifdef USE_WINSOCK if (hnd_advapi32) FreeLibrary(hnd_advapi32); if (hnd_iphlpapi) FreeLibrary(hnd_iphlpapi); #endif } int ares_library_init(int flags) { int res; if (ares_initialized) { ares_initialized++; return ARES_SUCCESS; } ares_initialized++; if (flags & ARES_LIB_INIT_WIN32) { res = ares_win32_init(); if (res != ARES_SUCCESS) return res; /* LCOV_EXCL_LINE: can't test Win32 init failure */ } ares_init_flags = flags; return ARES_SUCCESS; } int ares_library_init_mem(int flags, void *(*amalloc)(size_t size), void (*afree)(void *ptr), void *(*arealloc)(void *ptr, size_t size)) { if (amalloc) ares_malloc = amalloc; if (arealloc) ares_realloc = arealloc; if (afree) ares_free = afree; return ares_library_init(flags); } void ares_library_cleanup(void) { if (!ares_initialized) return; ares_initialized--; if (ares_initialized) return; if (ares_init_flags & ARES_LIB_INIT_WIN32) ares_win32_cleanup(); #if defined(ANDROID) || defined(__ANDROID__) ares_library_cleanup_android(); #endif ares_init_flags = ARES_LIB_INIT_NONE; ares_malloc = malloc; ares_realloc = realloc; ares_free = free; } int ares_library_initialized(void) { #ifdef USE_WINSOCK if (!ares_initialized) return ARES_ENOTINITIALIZED; #endif return ARES_SUCCESS; } ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares_library_init.h0000644000175100001770000000333200000000000023310 0ustar00runnerdocker00000000000000#ifndef HEADER_CARES_LIBRARY_INIT_H #define HEADER_CARES_LIBRARY_INIT_H /* Copyright 1998 by the Massachusetts Institute of Technology. * Copyright (C) 2004-2011 by Daniel Stenberg * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ #include "ares_setup.h" #ifdef USE_WINSOCK #include #include "ares_iphlpapi.h" typedef DWORD (WINAPI *fpGetNetworkParams_t) (FIXED_INFO*, DWORD*); typedef BOOLEAN (APIENTRY *fpSystemFunction036_t) (void*, ULONG); typedef ULONG (WINAPI *fpGetAdaptersAddresses_t) ( ULONG, ULONG, void*, IP_ADAPTER_ADDRESSES*, ULONG* ); typedef NETIO_STATUS (WINAPI *fpGetBestRoute2_t) ( NET_LUID *, NET_IFINDEX, const SOCKADDR_INET *, const SOCKADDR_INET *, ULONG, PMIB_IPFORWARD_ROW2, SOCKADDR_INET * ); /* Forward-declaration of variables defined in ares_library_init.c */ /* that are global and unique instances for whole c-ares library. */ extern fpGetNetworkParams_t ares_fpGetNetworkParams; extern fpSystemFunction036_t ares_fpSystemFunction036; extern fpGetAdaptersAddresses_t ares_fpGetAdaptersAddresses; extern fpGetBestRoute2_t ares_fpGetBestRoute2; #endif /* USE_WINSOCK */ #endif /* HEADER_CARES_LIBRARY_INIT_H */ ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares_llist.c0000644000175100001770000000350700000000000021747 0ustar00runnerdocker00000000000000 /* Copyright 1998 by the Massachusetts Institute of Technology. * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ #include "ares_setup.h" #include "ares.h" #include "ares_private.h" /* Routines for managing doubly-linked circular linked lists with a * dummy head. */ /* Initialize a new head node */ void ares__init_list_head(struct list_node* head) { head->prev = head; head->next = head; head->data = NULL; } /* Initialize a list node */ void ares__init_list_node(struct list_node* node, void* d) { node->prev = NULL; node->next = NULL; node->data = d; } /* Returns true iff the given list is empty */ int ares__is_list_empty(struct list_node* head) { return ((head->next == head) && (head->prev == head)); } /* Inserts new_node before old_node */ void ares__insert_in_list(struct list_node* new_node, struct list_node* old_node) { new_node->next = old_node; new_node->prev = old_node->prev; old_node->prev->next = new_node; old_node->prev = new_node; } /* Removes the node from the list it's in, if any */ void ares__remove_from_list(struct list_node* node) { if (node->next != NULL) { node->prev->next = node->next; node->next->prev = node->prev; node->prev = NULL; node->next = NULL; } } ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares_llist.h0000644000175100001770000000234500000000000021753 0ustar00runnerdocker00000000000000#ifndef __ARES_LLIST_H #define __ARES_LLIST_H /* Copyright 1998 by the Massachusetts Institute of Technology. * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ /* Node definition for circular, doubly-linked list */ struct list_node { struct list_node *prev; struct list_node *next; void* data; }; void ares__init_list_head(struct list_node* head); void ares__init_list_node(struct list_node* node, void* d); int ares__is_list_empty(struct list_node* head); void ares__insert_in_list(struct list_node* new_node, struct list_node* old_node); void ares__remove_from_list(struct list_node* node); #endif /* __ARES_LLIST_H */ ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares_mkquery.c0000644000175100001770000000170400000000000022312 0ustar00runnerdocker00000000000000 /* Copyright 1998 by the Massachusetts Institute of Technology. * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ #include "ares_setup.h" #include "ares.h" int ares_mkquery(const char *name, int dnsclass, int type, unsigned short id, int rd, unsigned char **buf, int *buflen) { return ares_create_query(name, dnsclass, type, id, rd, buf, buflen, 0); } ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares_nowarn.c0000644000175100001770000001303600000000000022122 0ustar00runnerdocker00000000000000 /* Copyright (C) 2010-2013 by Daniel Stenberg * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ #include "ares_setup.h" #ifdef HAVE_ASSERT_H # include #endif #ifdef HAVE_LIMITS_H #include #endif #if defined(__INTEL_COMPILER) && defined(__unix__) #ifdef HAVE_NETINET_IN_H # include #endif #ifdef HAVE_ARPA_INET_H # include #endif #endif /* __INTEL_COMPILER && __unix__ */ #define BUILDING_ARES_NOWARN_C 1 #include "ares_nowarn.h" #ifndef HAVE_LIMITS_H /* systems without we guess have 16 bit shorts, 32bit ints and 32bit longs */ # define CARES_MASK_SSHORT 0x7FFF # define CARES_MASK_USHORT 0xFFFF # define CARES_MASK_SINT 0x7FFFFFFF # define CARES_MASK_UINT 0xFFFFFFFF # define CARES_MASK_SLONG 0x7FFFFFFFL # define CARES_MASK_ULONG 0xFFFFFFFFUL #else # define CARES_MASK_SSHORT SHRT_MAX # define CARES_MASK_USHORT USHRT_MAX # define CARES_MASK_SINT INT_MAX # define CARES_MASK_UINT UINT_MAX # define CARES_MASK_SLONG LONG_MAX # define CARES_MASK_ULONG ULONG_MAX #endif /* ** unsigned size_t to signed long */ long aresx_uztosl(size_t uznum) { #ifdef __INTEL_COMPILER # pragma warning(push) # pragma warning(disable:810) /* conversion may lose significant bits */ #endif return (long)(uznum & (size_t) CARES_MASK_SLONG); #ifdef __INTEL_COMPILER # pragma warning(pop) #endif } /* ** unsigned size_t to signed int */ int aresx_uztosi(size_t uznum) { #ifdef __INTEL_COMPILER # pragma warning(push) # pragma warning(disable:810) /* conversion may lose significant bits */ #endif return (int)(uznum & (size_t) CARES_MASK_SINT); #ifdef __INTEL_COMPILER # pragma warning(pop) #endif } /* ** unsigned size_t to signed short */ short aresx_uztoss(size_t uznum) { #ifdef __INTEL_COMPILER # pragma warning(push) # pragma warning(disable:810) /* conversion may lose significant bits */ #endif return (short)(uznum & (size_t) CARES_MASK_SSHORT); #ifdef __INTEL_COMPILER # pragma warning(pop) #endif } /* ** signed int to signed short */ short aresx_sitoss(int sinum) { #ifdef __INTEL_COMPILER # pragma warning(push) # pragma warning(disable:810) /* conversion may lose significant bits */ #endif DEBUGASSERT(sinum >= 0); return (short)(sinum & (int) CARES_MASK_SSHORT); #ifdef __INTEL_COMPILER # pragma warning(pop) #endif } /* ** signed long to signed int */ int aresx_sltosi(long slnum) { #ifdef __INTEL_COMPILER # pragma warning(push) # pragma warning(disable:810) /* conversion may lose significant bits */ #endif DEBUGASSERT(slnum >= 0); return (int)(slnum & (long) CARES_MASK_SINT); #ifdef __INTEL_COMPILER # pragma warning(pop) #endif } /* ** signed ares_ssize_t to signed int */ int aresx_sztosi(ares_ssize_t sznum) { #ifdef __INTEL_COMPILER # pragma warning(push) # pragma warning(disable:810) /* conversion may lose significant bits */ #endif DEBUGASSERT(sznum >= 0); return (int)(sznum & (ares_ssize_t) CARES_MASK_SINT); #ifdef __INTEL_COMPILER # pragma warning(pop) #endif } /* ** signed ares_ssize_t to unsigned int */ unsigned int aresx_sztoui(ares_ssize_t sznum) { #ifdef __INTEL_COMPILER # pragma warning(push) # pragma warning(disable:810) /* conversion may lose significant bits */ #endif DEBUGASSERT(sznum >= 0); return (unsigned int)(sznum & (ares_ssize_t) CARES_MASK_UINT); #ifdef __INTEL_COMPILER # pragma warning(pop) #endif } /* ** signed int to unsigned short */ unsigned short aresx_sitous(int sinum) { #ifdef __INTEL_COMPILER # pragma warning(push) # pragma warning(disable:810) /* conversion may lose significant bits */ #endif DEBUGASSERT(sinum >= 0); return (unsigned short)(sinum & (int) CARES_MASK_USHORT); #ifdef __INTEL_COMPILER # pragma warning(pop) #endif } #if defined(__INTEL_COMPILER) && defined(__unix__) int aresx_FD_ISSET(int fd, fd_set *fdset) { #pragma warning(push) #pragma warning(disable:1469) /* clobber ignored */ return FD_ISSET(fd, fdset); #pragma warning(pop) } void aresx_FD_SET(int fd, fd_set *fdset) { #pragma warning(push) #pragma warning(disable:1469) /* clobber ignored */ FD_SET(fd, fdset); #pragma warning(pop) } void aresx_FD_ZERO(fd_set *fdset) { #pragma warning(push) #pragma warning(disable:593) /* variable was set but never used */ FD_ZERO(fdset); #pragma warning(pop) } unsigned short aresx_htons(unsigned short usnum) { #if (__INTEL_COMPILER == 910) && defined(__i386__) return (unsigned short)(((usnum << 8) & 0xFF00) | ((usnum >> 8) & 0x00FF)); #else #pragma warning(push) #pragma warning(disable:810) /* conversion may lose significant bits */ return htons(usnum); #pragma warning(pop) #endif } unsigned short aresx_ntohs(unsigned short usnum) { #if (__INTEL_COMPILER == 910) && defined(__i386__) return (unsigned short)(((usnum << 8) & 0xFF00) | ((usnum >> 8) & 0x00FF)); #else #pragma warning(push) #pragma warning(disable:810) /* conversion may lose significant bits */ return ntohs(usnum); #pragma warning(pop) #endif } #endif /* __INTEL_COMPILER && __unix__ */ ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares_nowarn.h0000644000175100001770000000331600000000000022127 0ustar00runnerdocker00000000000000#ifndef HEADER_CARES_NOWARN_H #define HEADER_CARES_NOWARN_H /* Copyright (C) 2010-2012 by Daniel Stenberg * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ long aresx_uztosl(size_t uznum); int aresx_uztosi(size_t uznum); short aresx_uztoss(size_t uznum); short aresx_sitoss(int sinum); int aresx_sltosi(long slnum); int aresx_sztosi(ares_ssize_t sznum); unsigned int aresx_sztoui(ares_ssize_t sznum); unsigned short aresx_sitous(int sinum); #if defined(__INTEL_COMPILER) && defined(__unix__) int aresx_FD_ISSET(int fd, fd_set *fdset); void aresx_FD_SET(int fd, fd_set *fdset); void aresx_FD_ZERO(fd_set *fdset); unsigned short aresx_htons(unsigned short usnum); unsigned short aresx_ntohs(unsigned short usnum); #ifndef BUILDING_ARES_NOWARN_C # undef FD_ISSET # define FD_ISSET(a,b) aresx_FD_ISSET((a),(b)) # undef FD_SET # define FD_SET(a,b) aresx_FD_SET((a),(b)) # undef FD_ZERO # define FD_ZERO(a) aresx_FD_ZERO((a)) # undef htons # define htons(a) aresx_htons((a)) # undef ntohs # define ntohs(a) aresx_ntohs((a)) #endif #endif /* __INTEL_COMPILER && __unix__ */ #endif /* HEADER_CARES_NOWARN_H */ ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares_options.c0000644000175100001770000002604500000000000022315 0ustar00runnerdocker00000000000000 /* Copyright 1998 by the Massachusetts Institute of Technology. * Copyright (C) 2008-2013 by Daniel Stenberg * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ #include "ares_setup.h" #ifdef HAVE_ARPA_INET_H # include #endif #include "ares.h" #include "ares_data.h" #include "ares_inet_net_pton.h" #include "ares_private.h" int ares_get_servers(ares_channel channel, struct ares_addr_node **servers) { struct ares_addr_node *srvr_head = NULL; struct ares_addr_node *srvr_last = NULL; struct ares_addr_node *srvr_curr; int status = ARES_SUCCESS; int i; if (!channel) return ARES_ENODATA; for (i = 0; i < channel->nservers; i++) { /* Allocate storage for this server node appending it to the list */ srvr_curr = ares_malloc_data(ARES_DATATYPE_ADDR_NODE); if (!srvr_curr) { status = ARES_ENOMEM; break; } if (srvr_last) { srvr_last->next = srvr_curr; } else { srvr_head = srvr_curr; } srvr_last = srvr_curr; /* Fill this server node data */ srvr_curr->family = channel->servers[i].addr.family; if (srvr_curr->family == AF_INET) memcpy(&srvr_curr->addrV4, &channel->servers[i].addr.addrV4, sizeof(srvr_curr->addrV4)); else memcpy(&srvr_curr->addrV6, &channel->servers[i].addr.addrV6, sizeof(srvr_curr->addrV6)); } if (status != ARES_SUCCESS) { if (srvr_head) { ares_free_data(srvr_head); srvr_head = NULL; } } *servers = srvr_head; return status; } int ares_get_servers_ports(ares_channel channel, struct ares_addr_port_node **servers) { struct ares_addr_port_node *srvr_head = NULL; struct ares_addr_port_node *srvr_last = NULL; struct ares_addr_port_node *srvr_curr; int status = ARES_SUCCESS; int i; if (!channel) return ARES_ENODATA; for (i = 0; i < channel->nservers; i++) { /* Allocate storage for this server node appending it to the list */ srvr_curr = ares_malloc_data(ARES_DATATYPE_ADDR_PORT_NODE); if (!srvr_curr) { status = ARES_ENOMEM; break; } if (srvr_last) { srvr_last->next = srvr_curr; } else { srvr_head = srvr_curr; } srvr_last = srvr_curr; /* Fill this server node data */ srvr_curr->family = channel->servers[i].addr.family; srvr_curr->udp_port = ntohs((unsigned short)channel->servers[i].addr.udp_port); srvr_curr->tcp_port = ntohs((unsigned short)channel->servers[i].addr.tcp_port); if (srvr_curr->family == AF_INET) memcpy(&srvr_curr->addrV4, &channel->servers[i].addr.addrV4, sizeof(srvr_curr->addrV4)); else memcpy(&srvr_curr->addrV6, &channel->servers[i].addr.addrV6, sizeof(srvr_curr->addrV6)); } if (status != ARES_SUCCESS) { if (srvr_head) { ares_free_data(srvr_head); srvr_head = NULL; } } *servers = srvr_head; return status; } int ares_set_servers(ares_channel channel, struct ares_addr_node *servers) { struct ares_addr_node *srvr; int num_srvrs = 0; int i; if (ares_library_initialized() != ARES_SUCCESS) return ARES_ENOTINITIALIZED; /* LCOV_EXCL_LINE: n/a on non-WinSock */ if (!channel) return ARES_ENODATA; if (!ares__is_list_empty(&channel->all_queries)) return ARES_ENOTIMP; ares__destroy_servers_state(channel); for (srvr = servers; srvr; srvr = srvr->next) { num_srvrs++; } if (num_srvrs > 0) { /* Allocate storage for servers state */ channel->servers = ares_malloc(num_srvrs * sizeof(struct server_state)); if (!channel->servers) { return ARES_ENOMEM; } channel->nservers = num_srvrs; /* Fill servers state address data */ for (i = 0, srvr = servers; srvr; i++, srvr = srvr->next) { channel->servers[i].addr.family = srvr->family; channel->servers[i].addr.udp_port = 0; channel->servers[i].addr.tcp_port = 0; if (srvr->family == AF_INET) memcpy(&channel->servers[i].addr.addrV4, &srvr->addrV4, sizeof(srvr->addrV4)); else memcpy(&channel->servers[i].addr.addrV6, &srvr->addrV6, sizeof(srvr->addrV6)); } /* Initialize servers state remaining data */ ares__init_servers_state(channel); } return ARES_SUCCESS; } int ares_set_servers_ports(ares_channel channel, struct ares_addr_port_node *servers) { struct ares_addr_port_node *srvr; int num_srvrs = 0; int i; if (ares_library_initialized() != ARES_SUCCESS) return ARES_ENOTINITIALIZED; /* LCOV_EXCL_LINE: n/a on non-WinSock */ if (!channel) return ARES_ENODATA; if (!ares__is_list_empty(&channel->all_queries)) return ARES_ENOTIMP; ares__destroy_servers_state(channel); for (srvr = servers; srvr; srvr = srvr->next) { num_srvrs++; } if (num_srvrs > 0) { /* Allocate storage for servers state */ channel->servers = ares_malloc(num_srvrs * sizeof(struct server_state)); if (!channel->servers) { return ARES_ENOMEM; } channel->nservers = num_srvrs; /* Fill servers state address data */ for (i = 0, srvr = servers; srvr; i++, srvr = srvr->next) { channel->servers[i].addr.family = srvr->family; channel->servers[i].addr.udp_port = htons((unsigned short)srvr->udp_port); channel->servers[i].addr.tcp_port = htons((unsigned short)srvr->tcp_port); if (srvr->family == AF_INET) memcpy(&channel->servers[i].addr.addrV4, &srvr->addrV4, sizeof(srvr->addrV4)); else memcpy(&channel->servers[i].addr.addrV6, &srvr->addrV6, sizeof(srvr->addrV6)); } /* Initialize servers state remaining data */ ares__init_servers_state(channel); } return ARES_SUCCESS; } /* Incomming string format: host[:port][,host[:port]]... */ /* IPv6 addresses with ports require square brackets [fe80::1%lo0]:53 */ static int set_servers_csv(ares_channel channel, const char* _csv, int use_port) { size_t i; char* csv = NULL; char* ptr; char* start_host; int cc = 0; int rv = ARES_SUCCESS; struct ares_addr_port_node *servers = NULL; struct ares_addr_port_node *last = NULL; if (ares_library_initialized() != ARES_SUCCESS) return ARES_ENOTINITIALIZED; /* LCOV_EXCL_LINE: n/a on non-WinSock */ if (!channel) return ARES_ENODATA; i = strlen(_csv); if (i == 0) return ARES_SUCCESS; /* blank all servers */ csv = ares_malloc(i + 2); if (!csv) return ARES_ENOMEM; strcpy(csv, _csv); if (csv[i-1] != ',') { /* make parsing easier by ensuring ending ',' */ csv[i] = ','; csv[i+1] = 0; } start_host = csv; for (ptr = csv; *ptr; ptr++) { if (*ptr == ':') { /* count colons to determine if we have an IPv6 number or IPv4 with port */ cc++; } else if (*ptr == '[') { /* move start_host if an open square bracket is found wrapping an IPv6 address */ start_host = ptr + 1; } else if (*ptr == ',') { char* pp = ptr - 1; char* p = ptr; int port = 0; struct in_addr in4; struct ares_in6_addr in6; struct ares_addr_port_node *s = NULL; *ptr = 0; /* null terminate host:port string */ /* Got an entry..see if the port was specified. */ if (cc > 0) { while (pp > start_host) { /* a single close square bracket followed by a colon, ']:' indicates an IPv6 address with port */ if ((*pp == ']') && (*p == ':')) break; /* found port */ /* a single colon, ':' indicates an IPv4 address with port */ if ((*pp == ':') && (cc == 1)) break; /* found port */ if (!(ISDIGIT(*pp) || (*pp == ':'))) { /* Found end of digits before we found :, so wasn't a port */ /* must allow ':' for IPv6 case of ']:' indicates we found a port */ pp = p = ptr; break; } pp--; p--; } if ((pp != start_host) && ((pp + 1) < ptr)) { /* Found it. Parse over the port number */ /* when an IPv6 address is wrapped with square brackets the port starts at pp + 2 */ if (*pp == ']') p++; /* move p before ':' */ /* p will point to the start of the port */ port = (int)strtol(p, NULL, 10); *pp = 0; /* null terminate host */ } } /* resolve host, try ipv4 first, rslt is in network byte order */ rv = ares_inet_pton(AF_INET, start_host, &in4); if (!rv) { /* Ok, try IPv6 then */ rv = ares_inet_pton(AF_INET6, start_host, &in6); if (!rv) { rv = ARES_EBADSTR; goto out; } /* was ipv6, add new server */ s = ares_malloc(sizeof(*s)); if (!s) { rv = ARES_ENOMEM; goto out; } s->family = AF_INET6; memcpy(&s->addr, &in6, sizeof(struct ares_in6_addr)); } else { /* was ipv4, add new server */ s = ares_malloc(sizeof(*s)); if (!s) { rv = ARES_ENOMEM; goto out; } s->family = AF_INET; memcpy(&s->addr, &in4, sizeof(struct in_addr)); } if (s) { s->udp_port = use_port ? port: 0; s->tcp_port = s->udp_port; s->next = NULL; if (last) { last->next = s; /* need to move last to maintain the linked list */ last = last->next; } else { servers = s; last = s; } } /* Set up for next one */ start_host = ptr + 1; cc = 0; } } rv = ares_set_servers_ports(channel, servers); out: if (csv) ares_free(csv); while (servers) { struct ares_addr_port_node *s = servers; servers = servers->next; ares_free(s); } return rv; } int ares_set_servers_csv(ares_channel channel, const char* _csv) { return set_servers_csv(channel, _csv, FALSE); } int ares_set_servers_ports_csv(ares_channel channel, const char* _csv) { return set_servers_csv(channel, _csv, TRUE); } ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares_parse_a_reply.c0000644000175100001770000000422200000000000023440 0ustar00runnerdocker00000000000000 /* Copyright 1998 by the Massachusetts Institute of Technology. * Copyright (C) 2019 by Andrew Selivanov * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ #include "ares_setup.h" #ifdef HAVE_NETINET_IN_H # include #endif #ifdef HAVE_NETDB_H # include #endif #ifdef HAVE_ARPA_INET_H # include #endif #include "ares_nameser.h" #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_LIMITS_H # include #endif #include "ares.h" #include "ares_dns.h" #include "ares_private.h" int ares_parse_a_reply(const unsigned char *abuf, int alen, struct hostent **host, struct ares_addrttl *addrttls, int *naddrttls) { struct ares_addrinfo ai; char *question_hostname = NULL; int status; int req_naddrttls = 0; if (naddrttls) { req_naddrttls = *naddrttls; *naddrttls = 0; } memset(&ai, 0, sizeof(ai)); status = ares__parse_into_addrinfo(abuf, alen, 0, 0, &ai); if (status != ARES_SUCCESS && status != ARES_ENODATA) { goto fail; } if (host != NULL) { status = ares__addrinfo2hostent(&ai, AF_INET, host); if (status != ARES_SUCCESS && status != ARES_ENODATA) { goto fail; } } if (addrttls != NULL && req_naddrttls) { ares__addrinfo2addrttl(&ai, AF_INET, req_naddrttls, addrttls, NULL, naddrttls); } fail: ares__freeaddrinfo_cnames(ai.cnames); ares__freeaddrinfo_nodes(ai.nodes); ares_free(ai.name); ares_free(question_hostname); return status; } ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares_parse_aaaa_reply.c0000644000175100001770000000434000000000000024104 0ustar00runnerdocker00000000000000 /* Copyright 1998 by the Massachusetts Institute of Technology. * Copyright 2005 Dominick Meglio * Copyright (C) 2019 by Andrew Selivanov * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ #include "ares_setup.h" #ifdef HAVE_NETINET_IN_H # include #endif #ifdef HAVE_NETDB_H # include #endif #ifdef HAVE_ARPA_INET_H # include #endif #include "ares_nameser.h" #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_LIMITS_H # include #endif #include "ares.h" #include "ares_dns.h" #include "ares_inet_net_pton.h" #include "ares_private.h" int ares_parse_aaaa_reply(const unsigned char *abuf, int alen, struct hostent **host, struct ares_addr6ttl *addrttls, int *naddrttls) { struct ares_addrinfo ai; char *question_hostname = NULL; int status; int req_naddrttls = 0; if (naddrttls) { req_naddrttls = *naddrttls; *naddrttls = 0; } memset(&ai, 0, sizeof(ai)); status = ares__parse_into_addrinfo(abuf, alen, 0, 0, &ai); if (status != ARES_SUCCESS && status != ARES_ENODATA) { goto fail; } if (host != NULL) { status = ares__addrinfo2hostent(&ai, AF_INET6, host); if (status != ARES_SUCCESS && status != ARES_ENODATA) { goto fail; } } if (addrttls != NULL && req_naddrttls) { ares__addrinfo2addrttl(&ai, AF_INET6, req_naddrttls, NULL, addrttls, naddrttls); } fail: ares__freeaddrinfo_cnames(ai.cnames); ares__freeaddrinfo_nodes(ai.nodes); ares_free(question_hostname); ares_free(ai.name); return status; } ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares_parse_caa_reply.c0000644000175100001770000001257600000000000023757 0ustar00runnerdocker00000000000000 /* Copyright 2020 by * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ #include "ares_setup.h" #ifdef HAVE_NETINET_IN_H # include #endif #ifdef HAVE_NETDB_H # include #endif #ifdef HAVE_ARPA_INET_H # include #endif #include "ares_nameser.h" #ifdef HAVE_STRINGS_H # include #endif #include "ares.h" #include "ares_dns.h" #include "ares_data.h" #include "ares_private.h" int ares_parse_caa_reply (const unsigned char *abuf, int alen, struct ares_caa_reply **caa_out) { unsigned int qdcount, ancount, i; const unsigned char *aptr; const unsigned char *strptr; int status, rr_type, rr_class, rr_len; long len; char *hostname = NULL, *rr_name = NULL; struct ares_caa_reply *caa_head = NULL; struct ares_caa_reply *caa_last = NULL; struct ares_caa_reply *caa_curr; /* Set *caa_out to NULL for all failure cases. */ *caa_out = NULL; /* Give up if abuf doesn't have room for a header. */ if (alen < HFIXEDSZ) return ARES_EBADRESP; /* Fetch the question and answer count from the header. */ qdcount = DNS_HEADER_QDCOUNT (abuf); ancount = DNS_HEADER_ANCOUNT (abuf); if (qdcount != 1) return ARES_EBADRESP; if (ancount == 0) return ARES_ENODATA; /* Expand the name from the question, and skip past the question. */ aptr = abuf + HFIXEDSZ; status = ares_expand_name (aptr, abuf, alen, &hostname, &len); if (status != ARES_SUCCESS) return status; if (aptr + len + QFIXEDSZ > abuf + alen) { ares_free (hostname); return ARES_EBADRESP; } aptr += len + QFIXEDSZ; /* Examine each answer resource record (RR) in turn. */ for (i = 0; i < ancount; i++) { /* Decode the RR up to the data field. */ status = ares_expand_name (aptr, abuf, alen, &rr_name, &len); if (status != ARES_SUCCESS) { break; } aptr += len; if (aptr + RRFIXEDSZ > abuf + alen) { status = ARES_EBADRESP; break; } rr_type = DNS_RR_TYPE (aptr); rr_class = DNS_RR_CLASS (aptr); rr_len = DNS_RR_LEN (aptr); aptr += RRFIXEDSZ; if (aptr + rr_len > abuf + alen) { status = ARES_EBADRESP; break; } /* Check if we are really looking at a CAA record */ if ((rr_class == C_IN || rr_class == C_CHAOS) && rr_type == T_CAA) { strptr = aptr; /* Allocate storage for this CAA answer appending it to the list */ caa_curr = ares_malloc_data(ARES_DATATYPE_CAA_REPLY); if (!caa_curr) { status = ARES_ENOMEM; break; } if (caa_last) { caa_last->next = caa_curr; } else { caa_head = caa_curr; } caa_last = caa_curr; if (rr_len < 2) { status = ARES_EBADRESP; break; } caa_curr->critical = (int)*strptr++; caa_curr->plength = (int)*strptr++; if (caa_curr->plength <= 0 || (int)caa_curr->plength >= rr_len - 2) { status = ARES_EBADRESP; break; } caa_curr->property = ares_malloc (caa_curr->plength + 1/* Including null byte */); if (caa_curr->property == NULL) { status = ARES_ENOMEM; break; } memcpy ((char *) caa_curr->property, strptr, caa_curr->plength); /* Make sure we NULL-terminate */ caa_curr->property[caa_curr->plength] = 0; strptr += caa_curr->plength; caa_curr->length = rr_len - caa_curr->plength - 2; if (caa_curr->length <= 0) { status = ARES_EBADRESP; break; } caa_curr->value = ares_malloc (caa_curr->length + 1/* Including null byte */); if (caa_curr->value == NULL) { status = ARES_ENOMEM; break; } memcpy ((char *) caa_curr->value, strptr, caa_curr->length); /* Make sure we NULL-terminate */ caa_curr->value[caa_curr->length] = 0; } /* Propagate any failures */ if (status != ARES_SUCCESS) { break; } /* Don't lose memory in the next iteration */ ares_free (rr_name); rr_name = NULL; /* Move on to the next record */ aptr += rr_len; } if (hostname) ares_free (hostname); if (rr_name) ares_free (rr_name); /* clean up on error */ if (status != ARES_SUCCESS) { if (caa_head) ares_free_data (caa_head); return status; } /* everything looks fine, return the data */ *caa_out = caa_head; return ARES_SUCCESS; } ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares_parse_mx_reply.c0000644000175100001770000001036700000000000023653 0ustar00runnerdocker00000000000000 /* Copyright 1998 by the Massachusetts Institute of Technology. * Copyright (C) 2010 Jeremy Lal * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ #include "ares_setup.h" #ifdef HAVE_NETINET_IN_H # include #endif #ifdef HAVE_NETDB_H # include #endif #ifdef HAVE_ARPA_INET_H # include #endif #include "ares_nameser.h" #include "ares.h" #include "ares_dns.h" #include "ares_data.h" #include "ares_private.h" int ares_parse_mx_reply (const unsigned char *abuf, int alen, struct ares_mx_reply **mx_out) { unsigned int qdcount, ancount, i; const unsigned char *aptr, *vptr; int status, rr_type, rr_class, rr_len; long len; char *hostname = NULL, *rr_name = NULL; struct ares_mx_reply *mx_head = NULL; struct ares_mx_reply *mx_last = NULL; struct ares_mx_reply *mx_curr; /* Set *mx_out to NULL for all failure cases. */ *mx_out = NULL; /* Give up if abuf doesn't have room for a header. */ if (alen < HFIXEDSZ) return ARES_EBADRESP; /* Fetch the question and answer count from the header. */ qdcount = DNS_HEADER_QDCOUNT (abuf); ancount = DNS_HEADER_ANCOUNT (abuf); if (qdcount != 1) return ARES_EBADRESP; if (ancount == 0) return ARES_ENODATA; /* Expand the name from the question, and skip past the question. */ aptr = abuf + HFIXEDSZ; status = ares_expand_name (aptr, abuf, alen, &hostname, &len); if (status != ARES_SUCCESS) return status; if (aptr + len + QFIXEDSZ > abuf + alen) { ares_free (hostname); return ARES_EBADRESP; } aptr += len + QFIXEDSZ; /* Examine each answer resource record (RR) in turn. */ for (i = 0; i < ancount; i++) { /* Decode the RR up to the data field. */ status = ares_expand_name (aptr, abuf, alen, &rr_name, &len); if (status != ARES_SUCCESS) { break; } aptr += len; if (aptr + RRFIXEDSZ > abuf + alen) { status = ARES_EBADRESP; break; } rr_type = DNS_RR_TYPE (aptr); rr_class = DNS_RR_CLASS (aptr); rr_len = DNS_RR_LEN (aptr); aptr += RRFIXEDSZ; if (aptr + rr_len > abuf + alen) { status = ARES_EBADRESP; break; } /* Check if we are really looking at a MX record */ if (rr_class == C_IN && rr_type == T_MX) { /* parse the MX record itself */ if (rr_len < 2) { status = ARES_EBADRESP; break; } /* Allocate storage for this MX answer appending it to the list */ mx_curr = ares_malloc_data(ARES_DATATYPE_MX_REPLY); if (!mx_curr) { status = ARES_ENOMEM; break; } if (mx_last) { mx_last->next = mx_curr; } else { mx_head = mx_curr; } mx_last = mx_curr; vptr = aptr; mx_curr->priority = DNS__16BIT(vptr); vptr += sizeof(unsigned short); status = ares_expand_name (vptr, abuf, alen, &mx_curr->host, &len); if (status != ARES_SUCCESS) break; } /* Don't lose memory in the next iteration */ ares_free (rr_name); rr_name = NULL; /* Move on to the next record */ aptr += rr_len; } if (hostname) ares_free (hostname); if (rr_name) ares_free (rr_name); /* clean up on error */ if (status != ARES_SUCCESS) { if (mx_head) ares_free_data (mx_head); return status; } /* everything looks fine, return the data */ *mx_out = mx_head; return ARES_SUCCESS; } ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares_parse_naptr_reply.c0000644000175100001770000001176700000000000024360 0ustar00runnerdocker00000000000000 /* Copyright 1998 by the Massachusetts Institute of Technology. * Copyright (C) 2009 by Jakub Hrozek * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ #include "ares_setup.h" #ifdef HAVE_NETINET_IN_H # include #endif #ifdef HAVE_NETDB_H # include #endif #ifdef HAVE_ARPA_INET_H # include #endif #include "ares_nameser.h" #include "ares.h" #include "ares_dns.h" #include "ares_data.h" #include "ares_private.h" int ares_parse_naptr_reply (const unsigned char *abuf, int alen, struct ares_naptr_reply **naptr_out) { unsigned int qdcount, ancount, i; const unsigned char *aptr, *vptr; int status, rr_type, rr_class, rr_len; long len; char *hostname = NULL, *rr_name = NULL; struct ares_naptr_reply *naptr_head = NULL; struct ares_naptr_reply *naptr_last = NULL; struct ares_naptr_reply *naptr_curr; /* Set *naptr_out to NULL for all failure cases. */ *naptr_out = NULL; /* Give up if abuf doesn't have room for a header. */ if (alen < HFIXEDSZ) return ARES_EBADRESP; /* Fetch the question and answer count from the header. */ qdcount = DNS_HEADER_QDCOUNT (abuf); ancount = DNS_HEADER_ANCOUNT (abuf); if (qdcount != 1) return ARES_EBADRESP; if (ancount == 0) return ARES_ENODATA; /* Expand the name from the question, and skip past the question. */ aptr = abuf + HFIXEDSZ; status = ares_expand_name (aptr, abuf, alen, &hostname, &len); if (status != ARES_SUCCESS) return status; if (aptr + len + QFIXEDSZ > abuf + alen) { ares_free (hostname); return ARES_EBADRESP; } aptr += len + QFIXEDSZ; /* Examine each answer resource record (RR) in turn. */ for (i = 0; i < ancount; i++) { /* Decode the RR up to the data field. */ status = ares_expand_name (aptr, abuf, alen, &rr_name, &len); if (status != ARES_SUCCESS) { break; } aptr += len; if (aptr + RRFIXEDSZ > abuf + alen) { status = ARES_EBADRESP; break; } rr_type = DNS_RR_TYPE (aptr); rr_class = DNS_RR_CLASS (aptr); rr_len = DNS_RR_LEN (aptr); aptr += RRFIXEDSZ; if (aptr + rr_len > abuf + alen) { status = ARES_EBADRESP; break; } /* Check if we are really looking at a NAPTR record */ if (rr_class == C_IN && rr_type == T_NAPTR) { /* parse the NAPTR record itself */ /* RR must contain at least 7 bytes = 2 x int16 + 3 x name */ if (rr_len < 7) { status = ARES_EBADRESP; break; } /* Allocate storage for this NAPTR answer appending it to the list */ naptr_curr = ares_malloc_data(ARES_DATATYPE_NAPTR_REPLY); if (!naptr_curr) { status = ARES_ENOMEM; break; } if (naptr_last) { naptr_last->next = naptr_curr; } else { naptr_head = naptr_curr; } naptr_last = naptr_curr; vptr = aptr; naptr_curr->order = DNS__16BIT(vptr); vptr += sizeof(unsigned short); naptr_curr->preference = DNS__16BIT(vptr); vptr += sizeof(unsigned short); status = ares_expand_string(vptr, abuf, alen, &naptr_curr->flags, &len); if (status != ARES_SUCCESS) break; vptr += len; status = ares_expand_string(vptr, abuf, alen, &naptr_curr->service, &len); if (status != ARES_SUCCESS) break; vptr += len; status = ares_expand_string(vptr, abuf, alen, &naptr_curr->regexp, &len); if (status != ARES_SUCCESS) break; vptr += len; status = ares_expand_name(vptr, abuf, alen, &naptr_curr->replacement, &len); if (status != ARES_SUCCESS) break; } /* Don't lose memory in the next iteration */ ares_free (rr_name); rr_name = NULL; /* Move on to the next record */ aptr += rr_len; } if (hostname) ares_free (hostname); if (rr_name) ares_free (rr_name); /* clean up on error */ if (status != ARES_SUCCESS) { if (naptr_head) ares_free_data (naptr_head); return status; } /* everything looks fine, return the data */ *naptr_out = naptr_head; return ARES_SUCCESS; } ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares_parse_ns_reply.c0000644000175100001770000001154600000000000023647 0ustar00runnerdocker00000000000000/* Copyright 1998 by the Massachusetts Institute of Technology. * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ /* * ares_parse_ns_reply created by Vlad Dinulescu * on behalf of AVIRA Gmbh - http://www.avira.com */ #include "ares_setup.h" #ifdef HAVE_NETINET_IN_H # include #endif #ifdef HAVE_NETDB_H # include #endif #ifdef HAVE_ARPA_INET_H # include #endif #include "ares_nameser.h" #include "ares.h" #include "ares_dns.h" #include "ares_private.h" int ares_parse_ns_reply( const unsigned char* abuf, int alen, struct hostent** host ) { unsigned int qdcount, ancount; int status, i, rr_type, rr_class, rr_len; int nameservers_num; long len; const unsigned char *aptr; char* hostname, *rr_name, *rr_data, **nameservers; struct hostent *hostent; /* Set *host to NULL for all failure cases. */ *host = NULL; /* Give up if abuf doesn't have room for a header. */ if ( alen < HFIXEDSZ ) return ARES_EBADRESP; /* Fetch the question and answer count from the header. */ qdcount = DNS_HEADER_QDCOUNT( abuf ); ancount = DNS_HEADER_ANCOUNT( abuf ); if ( qdcount != 1 ) return ARES_EBADRESP; /* Expand the name from the question, and skip past the question. */ aptr = abuf + HFIXEDSZ; status = ares__expand_name_for_response( aptr, abuf, alen, &hostname, &len, 0); if ( status != ARES_SUCCESS ) return status; if ( aptr + len + QFIXEDSZ > abuf + alen ) { ares_free( hostname ); return ARES_EBADRESP; } aptr += len + QFIXEDSZ; /* Allocate nameservers array; ancount gives an upper bound */ nameservers = ares_malloc( ( ancount + 1 ) * sizeof( char * ) ); if ( !nameservers ) { ares_free( hostname ); return ARES_ENOMEM; } nameservers_num = 0; /* Examine each answer resource record (RR) in turn. */ for ( i = 0; i < ( int ) ancount; i++ ) { /* Decode the RR up to the data field. */ status = ares__expand_name_for_response( aptr, abuf, alen, &rr_name, &len, 0); if ( status != ARES_SUCCESS ) break; aptr += len; if ( aptr + RRFIXEDSZ > abuf + alen ) { status = ARES_EBADRESP; ares_free(rr_name); break; } rr_type = DNS_RR_TYPE( aptr ); rr_class = DNS_RR_CLASS( aptr ); rr_len = DNS_RR_LEN( aptr ); aptr += RRFIXEDSZ; if (aptr + rr_len > abuf + alen) { ares_free(rr_name); status = ARES_EBADRESP; break; } if ( rr_class == C_IN && rr_type == T_NS ) { /* Decode the RR data and add it to the nameservers list */ status = ares__expand_name_for_response( aptr, abuf, alen, &rr_data, &len, 1); if ( status != ARES_SUCCESS ) { ares_free(rr_name); break; } nameservers[nameservers_num] = ares_malloc(strlen(rr_data)+1); if (nameservers[nameservers_num]==NULL) { ares_free(rr_name); ares_free(rr_data); status=ARES_ENOMEM; break; } strcpy(nameservers[nameservers_num],rr_data); ares_free(rr_data); nameservers_num++; } ares_free( rr_name ); aptr += rr_len; if ( aptr > abuf + alen ) { /* LCOV_EXCL_START: already checked above */ status = ARES_EBADRESP; break; } /* LCOV_EXCL_STOP */ } if ( status == ARES_SUCCESS && nameservers_num == 0 ) { status = ARES_ENODATA; } if ( status == ARES_SUCCESS ) { /* We got our answer. Allocate memory to build the host entry. */ nameservers[nameservers_num] = NULL; hostent = ares_malloc( sizeof( struct hostent ) ); if ( hostent ) { hostent->h_addr_list = ares_malloc( 1 * sizeof( char * ) ); if ( hostent->h_addr_list ) { /* Fill in the hostent and return successfully. */ hostent->h_name = hostname; hostent->h_aliases = nameservers; hostent->h_addrtype = AF_INET; hostent->h_length = sizeof( struct in_addr ); hostent->h_addr_list[0] = NULL; *host = hostent; return ARES_SUCCESS; } ares_free( hostent ); } status = ARES_ENOMEM; } for ( i = 0; i < nameservers_num; i++ ) ares_free( nameservers[i] ); ares_free( nameservers ); ares_free( hostname ); return status; } ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares_parse_ptr_reply.c0000644000175100001770000001471300000000000024033 0ustar00runnerdocker00000000000000 /* Copyright 1998 by the Massachusetts Institute of Technology. * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ #include "ares_setup.h" #ifdef HAVE_NETINET_IN_H # include #endif #ifdef HAVE_NETDB_H # include #endif #include "ares_nameser.h" #ifdef HAVE_STRINGS_H # include #endif #include "ares.h" #include "ares_dns.h" #include "ares_nowarn.h" #include "ares_private.h" int ares_parse_ptr_reply(const unsigned char *abuf, int alen, const void *addr, int addrlen, int family, struct hostent **host) { unsigned int qdcount, ancount; int status, i, rr_type, rr_class, rr_len; long len; const unsigned char *aptr; char *ptrname, *hostname, *rr_name, *rr_data; struct hostent *hostent = NULL; int aliascnt = 0; int alias_alloc = 8; char ** aliases; size_t rr_data_len; /* Set *host to NULL for all failure cases. */ *host = NULL; /* Give up if abuf doesn't have room for a header. */ if (alen < HFIXEDSZ) return ARES_EBADRESP; /* Fetch the question and answer count from the header. */ qdcount = DNS_HEADER_QDCOUNT(abuf); ancount = DNS_HEADER_ANCOUNT(abuf); if (qdcount != 1) return ARES_EBADRESP; /* Expand the name from the question, and skip past the question. */ aptr = abuf + HFIXEDSZ; status = ares__expand_name_for_response(aptr, abuf, alen, &ptrname, &len, 0); if (status != ARES_SUCCESS) return status; if (aptr + len + QFIXEDSZ > abuf + alen) { ares_free(ptrname); return ARES_EBADRESP; } aptr += len + QFIXEDSZ; /* Examine each answer resource record (RR) in turn. */ hostname = NULL; aliases = ares_malloc(alias_alloc * sizeof(char *)); if (!aliases) { ares_free(ptrname); return ARES_ENOMEM; } for (i = 0; i < (int)ancount; i++) { /* Decode the RR up to the data field. */ status = ares__expand_name_for_response(aptr, abuf, alen, &rr_name, &len, 0); if (status != ARES_SUCCESS) break; aptr += len; if (aptr + RRFIXEDSZ > abuf + alen) { ares_free(rr_name); status = ARES_EBADRESP; break; } rr_type = DNS_RR_TYPE(aptr); rr_class = DNS_RR_CLASS(aptr); rr_len = DNS_RR_LEN(aptr); aptr += RRFIXEDSZ; if (aptr + rr_len > abuf + alen) { ares_free(rr_name); status = ARES_EBADRESP; break; } if (rr_class == C_IN && rr_type == T_PTR && strcasecmp(rr_name, ptrname) == 0) { /* Decode the RR data and set hostname to it. */ status = ares__expand_name_for_response(aptr, abuf, alen, &rr_data, &len, 1); if (status != ARES_SUCCESS) { ares_free(rr_name); break; } if (hostname) ares_free(hostname); hostname = rr_data; rr_data_len = strlen(rr_data)+1; aliases[aliascnt] = ares_malloc(rr_data_len * sizeof(char)); if (!aliases[aliascnt]) { ares_free(rr_name); status = ARES_ENOMEM; break; } strncpy(aliases[aliascnt], rr_data, rr_data_len); aliascnt++; if (aliascnt >= alias_alloc) { char **ptr; alias_alloc *= 2; ptr = ares_realloc(aliases, alias_alloc * sizeof(char *)); if(!ptr) { ares_free(rr_name); status = ARES_ENOMEM; break; } aliases = ptr; } } if (rr_class == C_IN && rr_type == T_CNAME) { /* Decode the RR data and replace ptrname with it. */ status = ares__expand_name_for_response(aptr, abuf, alen, &rr_data, &len, 1); if (status != ARES_SUCCESS) { ares_free(rr_name); break; } ares_free(ptrname); ptrname = rr_data; } ares_free(rr_name); aptr += rr_len; if (aptr > abuf + alen) { /* LCOV_EXCL_START: already checked above */ status = ARES_EBADRESP; break; } /* LCOV_EXCL_STOP */ } if (status == ARES_SUCCESS && !hostname) status = ARES_ENODATA; if (status == ARES_SUCCESS) { /* If we don't reach the end, we must have failed due to out of memory */ status = ARES_ENOMEM; /* We got our answer. Allocate memory to build the host entry. */ hostent = ares_malloc(sizeof(*hostent)); if (!hostent) goto fail; /* If we don't memset here, cleanups may fail */ memset(hostent, 0, sizeof(*hostent)); hostent->h_addr_list = ares_malloc(2 * sizeof(char *)); if (!hostent->h_addr_list) goto fail; if (addr && addrlen) { hostent->h_addr_list[0] = ares_malloc(addrlen); if (!hostent->h_addr_list[0]) goto fail; } else { hostent->h_addr_list[0] = NULL; } hostent->h_aliases = ares_malloc((aliascnt+1) * sizeof (char *)); if (!hostent->h_aliases) goto fail; /* Fill in the hostent and return successfully. */ hostent->h_name = hostname; for (i=0 ; ih_aliases[i] = aliases[i]; hostent->h_aliases[aliascnt] = NULL; hostent->h_addrtype = aresx_sitoss(family); hostent->h_length = aresx_sitoss(addrlen); if (addr && addrlen) memcpy(hostent->h_addr_list[0], addr, addrlen); hostent->h_addr_list[1] = NULL; *host = hostent; ares_free(aliases); ares_free(ptrname); return ARES_SUCCESS; } fail: ares_free_hostent(hostent); for (i=0 ; i * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ #include "ares_setup.h" #ifdef HAVE_NETINET_IN_H # include #endif #ifdef HAVE_NETDB_H # include #endif #ifdef HAVE_ARPA_INET_H # include #endif #include "ares_nameser.h" #include "ares.h" #include "ares_dns.h" #include "ares_data.h" #include "ares_private.h" int ares_parse_soa_reply(const unsigned char *abuf, int alen, struct ares_soa_reply **soa_out) { const unsigned char *aptr; long len; char *qname = NULL, *rr_name = NULL; struct ares_soa_reply *soa = NULL; int qdcount, ancount, qclass; int status, i, rr_type, rr_class, rr_len; if (alen < HFIXEDSZ) return ARES_EBADRESP; /* parse message header */ qdcount = DNS_HEADER_QDCOUNT(abuf); ancount = DNS_HEADER_ANCOUNT(abuf); if (qdcount != 1) return ARES_EBADRESP; if (ancount == 0) return ARES_EBADRESP; aptr = abuf + HFIXEDSZ; /* query name */ status = ares__expand_name_for_response(aptr, abuf, alen, &qname, &len, 0); if (status != ARES_SUCCESS) goto failed_stat; if (alen <= len + HFIXEDSZ + 1) goto failed; aptr += len; qclass = DNS_QUESTION_TYPE(aptr); /* skip qtype & qclass */ if (aptr + QFIXEDSZ > abuf + alen) goto failed; aptr += QFIXEDSZ; /* qclass of SOA with multiple answers */ if (qclass == T_SOA && ancount > 1) goto failed; /* examine all the records, break and return if found soa */ for (i = 0; i < ancount; i++) { rr_name = NULL; status = ares__expand_name_for_response (aptr, abuf, alen, &rr_name, &len, 0); if (status != ARES_SUCCESS) { ares_free(rr_name); goto failed_stat; } aptr += len; if ( aptr + RRFIXEDSZ > abuf + alen ) { ares_free(rr_name); status = ARES_EBADRESP; goto failed_stat; } rr_type = DNS_RR_TYPE( aptr ); rr_class = DNS_RR_CLASS( aptr ); rr_len = DNS_RR_LEN( aptr ); aptr += RRFIXEDSZ; if (aptr + rr_len > abuf + alen) { ares_free(rr_name); status = ARES_EBADRESP; goto failed_stat; } if ( rr_class == C_IN && rr_type == T_SOA ) { /* allocate result struct */ soa = ares_malloc_data(ARES_DATATYPE_SOA_REPLY); if (!soa) { ares_free(rr_name); status = ARES_ENOMEM; goto failed_stat; } /* nsname */ status = ares__expand_name_for_response(aptr, abuf, alen, &soa->nsname, &len, 0); if (status != ARES_SUCCESS) { ares_free(rr_name); goto failed_stat; } aptr += len; /* hostmaster */ status = ares__expand_name_for_response(aptr, abuf, alen, &soa->hostmaster, &len, 0); if (status != ARES_SUCCESS) { ares_free(rr_name); goto failed_stat; } aptr += len; /* integer fields */ if (aptr + 5 * 4 > abuf + alen) { ares_free(rr_name); goto failed; } soa->serial = DNS__32BIT(aptr + 0 * 4); soa->refresh = DNS__32BIT(aptr + 1 * 4); soa->retry = DNS__32BIT(aptr + 2 * 4); soa->expire = DNS__32BIT(aptr + 3 * 4); soa->minttl = DNS__32BIT(aptr + 4 * 4); ares_free(qname); ares_free(rr_name); *soa_out = soa; return ARES_SUCCESS; } aptr += rr_len; ares_free(rr_name); if (aptr > abuf + alen) goto failed_stat; } /* no SOA record found */ status = ARES_EBADRESP; goto failed_stat; failed: status = ARES_EBADRESP; failed_stat: if (soa) ares_free_data(soa); if (qname) ares_free(qname); return status; } ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares_parse_srv_reply.c0000644000175100001770000001071500000000000024036 0ustar00runnerdocker00000000000000 /* Copyright 1998 by the Massachusetts Institute of Technology. * Copyright (C) 2009 by Jakub Hrozek * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ #include "ares_setup.h" #ifdef HAVE_NETINET_IN_H # include #endif #ifdef HAVE_NETDB_H # include #endif #ifdef HAVE_ARPA_INET_H # include #endif #include "ares_nameser.h" #include "ares.h" #include "ares_dns.h" #include "ares_data.h" #include "ares_private.h" int ares_parse_srv_reply (const unsigned char *abuf, int alen, struct ares_srv_reply **srv_out) { unsigned int qdcount, ancount, i; const unsigned char *aptr, *vptr; int status, rr_type, rr_class, rr_len; long len; char *hostname = NULL, *rr_name = NULL; struct ares_srv_reply *srv_head = NULL; struct ares_srv_reply *srv_last = NULL; struct ares_srv_reply *srv_curr; /* Set *srv_out to NULL for all failure cases. */ *srv_out = NULL; /* Give up if abuf doesn't have room for a header. */ if (alen < HFIXEDSZ) return ARES_EBADRESP; /* Fetch the question and answer count from the header. */ qdcount = DNS_HEADER_QDCOUNT (abuf); ancount = DNS_HEADER_ANCOUNT (abuf); if (qdcount != 1) return ARES_EBADRESP; if (ancount == 0) return ARES_ENODATA; /* Expand the name from the question, and skip past the question. */ aptr = abuf + HFIXEDSZ; status = ares_expand_name (aptr, abuf, alen, &hostname, &len); if (status != ARES_SUCCESS) return status; if (aptr + len + QFIXEDSZ > abuf + alen) { ares_free (hostname); return ARES_EBADRESP; } aptr += len + QFIXEDSZ; /* Examine each answer resource record (RR) in turn. */ for (i = 0; i < ancount; i++) { /* Decode the RR up to the data field. */ status = ares_expand_name (aptr, abuf, alen, &rr_name, &len); if (status != ARES_SUCCESS) { break; } aptr += len; if (aptr + RRFIXEDSZ > abuf + alen) { status = ARES_EBADRESP; break; } rr_type = DNS_RR_TYPE (aptr); rr_class = DNS_RR_CLASS (aptr); rr_len = DNS_RR_LEN (aptr); aptr += RRFIXEDSZ; if (aptr + rr_len > abuf + alen) { status = ARES_EBADRESP; break; } /* Check if we are really looking at a SRV record */ if (rr_class == C_IN && rr_type == T_SRV) { /* parse the SRV record itself */ if (rr_len < 6) { status = ARES_EBADRESP; break; } /* Allocate storage for this SRV answer appending it to the list */ srv_curr = ares_malloc_data(ARES_DATATYPE_SRV_REPLY); if (!srv_curr) { status = ARES_ENOMEM; break; } if (srv_last) { srv_last->next = srv_curr; } else { srv_head = srv_curr; } srv_last = srv_curr; vptr = aptr; srv_curr->priority = DNS__16BIT(vptr); vptr += sizeof(unsigned short); srv_curr->weight = DNS__16BIT(vptr); vptr += sizeof(unsigned short); srv_curr->port = DNS__16BIT(vptr); vptr += sizeof(unsigned short); status = ares_expand_name (vptr, abuf, alen, &srv_curr->host, &len); if (status != ARES_SUCCESS) break; } /* Don't lose memory in the next iteration */ ares_free (rr_name); rr_name = NULL; /* Move on to the next record */ aptr += rr_len; } if (hostname) ares_free (hostname); if (rr_name) ares_free (rr_name); /* clean up on error */ if (status != ARES_SUCCESS) { if (srv_head) ares_free_data (srv_head); return status; } /* everything looks fine, return the data */ *srv_out = srv_head; return ARES_SUCCESS; } ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares_parse_txt_reply.c0000644000175100001770000001351500000000000024044 0ustar00runnerdocker00000000000000 /* Copyright 1998 by the Massachusetts Institute of Technology. * Copyright (C) 2009 by Jakub Hrozek * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ #include "ares_setup.h" #ifdef HAVE_NETINET_IN_H # include #endif #ifdef HAVE_NETDB_H # include #endif #ifdef HAVE_ARPA_INET_H # include #endif #include "ares_nameser.h" #ifdef HAVE_STRINGS_H # include #endif #include "ares.h" #include "ares_dns.h" #include "ares_data.h" #include "ares_private.h" static int ares__parse_txt_reply (const unsigned char *abuf, int alen, int ex, void **txt_out) { size_t substr_len; unsigned int qdcount, ancount, i; const unsigned char *aptr; const unsigned char *strptr; int status, rr_type, rr_class, rr_len; long len; char *hostname = NULL, *rr_name = NULL; struct ares_txt_ext *txt_head = NULL; struct ares_txt_ext *txt_last = NULL; struct ares_txt_ext *txt_curr; /* Set *txt_out to NULL for all failure cases. */ *txt_out = NULL; /* Give up if abuf doesn't have room for a header. */ if (alen < HFIXEDSZ) return ARES_EBADRESP; /* Fetch the question and answer count from the header. */ qdcount = DNS_HEADER_QDCOUNT (abuf); ancount = DNS_HEADER_ANCOUNT (abuf); if (qdcount != 1) return ARES_EBADRESP; if (ancount == 0) return ARES_ENODATA; /* Expand the name from the question, and skip past the question. */ aptr = abuf + HFIXEDSZ; status = ares_expand_name (aptr, abuf, alen, &hostname, &len); if (status != ARES_SUCCESS) return status; if (aptr + len + QFIXEDSZ > abuf + alen) { ares_free (hostname); return ARES_EBADRESP; } aptr += len + QFIXEDSZ; /* Examine each answer resource record (RR) in turn. */ for (i = 0; i < ancount; i++) { /* Decode the RR up to the data field. */ status = ares_expand_name (aptr, abuf, alen, &rr_name, &len); if (status != ARES_SUCCESS) { break; } aptr += len; if (aptr + RRFIXEDSZ > abuf + alen) { status = ARES_EBADRESP; break; } rr_type = DNS_RR_TYPE (aptr); rr_class = DNS_RR_CLASS (aptr); rr_len = DNS_RR_LEN (aptr); aptr += RRFIXEDSZ; if (aptr + rr_len > abuf + alen) { status = ARES_EBADRESP; break; } /* Check if we are really looking at a TXT record */ if ((rr_class == C_IN || rr_class == C_CHAOS) && rr_type == T_TXT) { /* * There may be multiple substrings in a single TXT record. Each * substring may be up to 255 characters in length, with a * "length byte" indicating the size of the substring payload. * RDATA contains both the length-bytes and payloads of all * substrings contained therein. */ strptr = aptr; while (strptr < (aptr + rr_len)) { substr_len = (unsigned char)*strptr; if (strptr + substr_len + 1 > aptr + rr_len) { status = ARES_EBADRESP; break; } /* Allocate storage for this TXT answer appending it to the list */ txt_curr = ares_malloc_data(ex ? ARES_DATATYPE_TXT_EXT : ARES_DATATYPE_TXT_REPLY); if (!txt_curr) { status = ARES_ENOMEM; break; } if (txt_last) { txt_last->next = txt_curr; } else { txt_head = txt_curr; } txt_last = txt_curr; if (ex) txt_curr->record_start = (strptr == aptr); txt_curr->length = substr_len; txt_curr->txt = ares_malloc (substr_len + 1/* Including null byte */); if (txt_curr->txt == NULL) { status = ARES_ENOMEM; break; } ++strptr; memcpy ((char *) txt_curr->txt, strptr, substr_len); /* Make sure we NULL-terminate */ txt_curr->txt[substr_len] = 0; strptr += substr_len; } } /* Propagate any failures */ if (status != ARES_SUCCESS) { break; } /* Don't lose memory in the next iteration */ ares_free (rr_name); rr_name = NULL; /* Move on to the next record */ aptr += rr_len; } if (hostname) ares_free (hostname); if (rr_name) ares_free (rr_name); /* clean up on error */ if (status != ARES_SUCCESS) { if (txt_head) ares_free_data (txt_head); return status; } /* everything looks fine, return the data */ *txt_out = txt_head; return ARES_SUCCESS; } int ares_parse_txt_reply (const unsigned char *abuf, int alen, struct ares_txt_reply **txt_out) { return ares__parse_txt_reply(abuf, alen, 0, (void **) txt_out); } int ares_parse_txt_reply_ext (const unsigned char *abuf, int alen, struct ares_txt_ext **txt_out) { return ares__parse_txt_reply(abuf, alen, 1, (void **) txt_out); } ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares_parse_uri_reply.c0000644000175100001770000001135100000000000024020 0ustar00runnerdocker00000000000000 /* Copyright 1998 by the Massachusetts Institute of Technology. * Copyright (C) 2009 by Jakub Hrozek * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ #include "ares_setup.h" #ifdef HAVE_NETINET_IN_H # include #endif #ifdef HAVE_NETDB_H # include #endif #ifdef HAVE_ARPA_INET_H # include #endif #include "ares_nameser.h" #include "ares.h" #include "ares_dns.h" #include "ares_data.h" #include "ares_private.h" /* AIX portability check */ #ifndef T_URI # define T_URI 256 /* uri selection */ #endif int ares_parse_uri_reply (const unsigned char *abuf, int alen, struct ares_uri_reply **uri_out) { unsigned int qdcount, ancount, i; const unsigned char *aptr, *vptr; int status, rr_type, rr_class, rr_len, rr_ttl; long len; char *uri_str = NULL, *rr_name = NULL; struct ares_uri_reply *uri_head = NULL; struct ares_uri_reply *uri_last = NULL; struct ares_uri_reply *uri_curr; /* Set *uri_out to NULL for all failure cases. */ *uri_out = NULL; /* Give up if abuf doesn't have room for a header. */ if (alen < HFIXEDSZ){ return ARES_EBADRESP; } /* Fetch the question and answer count from the header. */ qdcount = DNS_HEADER_QDCOUNT (abuf); ancount = DNS_HEADER_ANCOUNT (abuf); if (qdcount != 1) { return ARES_EBADRESP; } if (ancount == 0) { return ARES_ENODATA; } /* Expand the name from the question, and skip past the question. */ aptr = abuf + HFIXEDSZ; status = ares_expand_name (aptr, abuf, alen, &uri_str, &len); if (status != ARES_SUCCESS){ return status; } if (aptr + len + QFIXEDSZ > abuf + alen) { ares_free (uri_str); return ARES_EBADRESP; } aptr += len + QFIXEDSZ; /* Examine each answer resource record (RR) in turn. */ for (i = 0; i < ancount; i++) { /* Decode the RR up to the data field. */ status = ares_expand_name (aptr, abuf, alen, &rr_name, &len); if (status != ARES_SUCCESS) { break; } aptr += len; if (aptr + RRFIXEDSZ > abuf + alen) { status = ARES_EBADRESP; break; } rr_type = DNS_RR_TYPE (aptr); rr_class = DNS_RR_CLASS (aptr); rr_ttl = DNS_RR_TTL(aptr); rr_len = DNS_RR_LEN (aptr); aptr += RRFIXEDSZ; if (aptr + rr_len > abuf + alen) { status = ARES_EBADRESP; break; } /* Check if we are really looking at a URI record */ if (rr_class == C_IN && rr_type == T_URI) { /* parse the URI record itself */ if (rr_len < 5) { status = ARES_EBADRESP; break; } /* Allocate storage for this URI answer appending it to the list */ uri_curr = ares_malloc_data(ARES_DATATYPE_URI_REPLY); if (!uri_curr) { status = ARES_ENOMEM; break; } if (uri_last) { uri_last->next = uri_curr; } else { uri_head = uri_curr; } uri_last = uri_curr; vptr = aptr; uri_curr->priority = DNS__16BIT(vptr); vptr += sizeof(unsigned short); uri_curr->weight = DNS__16BIT(vptr); vptr += sizeof(unsigned short); uri_curr->uri = (char *)ares_malloc(rr_len-3); if (!uri_curr->uri) { status = ARES_ENOMEM; break; } uri_curr->uri = strncpy(uri_curr->uri, (const char *)vptr, rr_len-4); uri_curr->uri[rr_len-4]='\0'; uri_curr->ttl = rr_ttl; if (status != ARES_SUCCESS) break; } /* Don't lose memory in the next iteration */ ares_free (rr_name); rr_name = NULL; /* Move on to the next record */ aptr += rr_len; } if (uri_str) ares_free (uri_str); if (rr_name) ares_free (rr_name); /* clean up on error */ if (status != ARES_SUCCESS) { if (uri_head) ares_free_data (uri_head); return status; } /* everything looks fine, return the data */ *uri_out = uri_head; return ARES_SUCCESS; } ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares_platform.c0000644000175100001770000170307500000000000022454 0ustar00runnerdocker00000000000000 /* Copyright 1998 by the Massachusetts Institute of Technology. * Copyright (C) 2004 - 2011 by Daniel Stenberg et al * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ #include "ares_setup.h" #include "ares.h" #include "ares_platform.h" #include "ares_nowarn.h" #include "ares_private.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 i, error = 0; u_port = ntohs((unsigned short)port); if (proto) { switch (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 */ ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares_platform.h0000644000175100001770000000220100000000000022437 0ustar00runnerdocker00000000000000#ifndef HEADER_CARES_PLATFORM_H #define HEADER_CARES_PLATFORM_H /* Copyright 1998 by the Massachusetts Institute of Technology. * Copyright (C) 2004 - 2011 by Daniel Stenberg et al * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ #include "ares_setup.h" #if defined(WIN32) && !defined(MSDOS) 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); #endif #endif /* HEADER_CARES_PLATFORM_H */ ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares_private.h0000644000175100001770000003346300000000000022303 0ustar00runnerdocker00000000000000#ifndef __ARES_PRIVATE_H #define __ARES_PRIVATE_H /* Copyright 1998 by the Massachusetts Institute of Technology. * Copyright (C) 2004-2010 by Daniel Stenberg * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ /* * Define WIN32 when build target is Win32 API */ #if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32) #define WIN32 #endif #ifdef HAVE_NETINET_IN_H #include #endif #ifdef WATT32 #include #include #define writev(s,v,c) writev_s(s,v,c) #define HAVE_WRITEV 1 #endif #define DEFAULT_TIMEOUT 5000 /* milliseconds */ #define DEFAULT_TRIES 4 #ifndef INADDR_NONE #define INADDR_NONE 0xffffffff #endif #ifdef CARES_EXPOSE_STATICS /* Make some internal functions visible for testing */ #define STATIC_TESTABLE #else #define STATIC_TESTABLE static #endif /* By using a double cast, we can get rid of the bogus warning of * warning: cast from 'const struct sockaddr *' to 'const struct sockaddr_in6 *' increases required alignment from 1 to 4 [-Wcast-align] */ #define CARES_INADDR_CAST(type, var) ((type)((void *)var)) #if defined(WIN32) && !defined(WATT32) #define WIN_NS_9X "System\\CurrentControlSet\\Services\\VxD\\MSTCP" #define WIN_NS_NT_KEY "System\\CurrentControlSet\\Services\\Tcpip\\Parameters" #define WIN_DNSCLIENT "Software\\Policies\\Microsoft\\System\\DNSClient" #define WIN_NT_DNSCLIENT "Software\\Policies\\Microsoft\\Windows NT\\DNSClient" #define NAMESERVER "NameServer" #define DHCPNAMESERVER "DhcpNameServer" #define DATABASEPATH "DatabasePath" #define WIN_PATH_HOSTS "\\hosts" #define SEARCHLIST_KEY "SearchList" #define PRIMARYDNSSUFFIX_KEY "PrimaryDNSSuffix" #define INTERFACES_KEY "Interfaces" #define DOMAIN_KEY "Domain" #define DHCPDOMAIN_KEY "DhcpDomain" #elif defined(WATT32) #define PATH_RESOLV_CONF "/dev/ENV/etc/resolv.conf" W32_FUNC const char *_w32_GetHostsFile (void); #elif defined(NETWARE) #define PATH_RESOLV_CONF "sys:/etc/resolv.cfg" #define PATH_HOSTS "sys:/etc/hosts" #elif defined(__riscos__) #define PATH_HOSTS "InetDBase:Hosts" #elif defined(__HAIKU__) #define PATH_RESOLV_CONF "/system/settings/network/resolv.conf" #define PATH_HOSTS "/system/settings/network/hosts" #else #define PATH_RESOLV_CONF "/etc/resolv.conf" #ifdef ETC_INET #define PATH_HOSTS "/etc/inet/hosts" #else #define PATH_HOSTS "/etc/hosts" #endif #endif #define ARES_ID_KEY_LEN 31 #include "ares_ipv6.h" #include "ares_llist.h" #ifndef HAVE_GETENV # include "ares_getenv.h" # define getenv(ptr) ares_getenv(ptr) #endif #include "ares_strdup.h" #include "ares_strsplit.h" #ifndef HAVE_STRCASECMP # include "ares_strcasecmp.h" # define strcasecmp(p1,p2) ares_strcasecmp(p1,p2) #endif #ifndef HAVE_STRNCASECMP # include "ares_strcasecmp.h" # define strncasecmp(p1,p2,n) ares_strncasecmp(p1,p2,n) #endif #ifndef HAVE_WRITEV # include "ares_writev.h" # define writev(s,ptr,cnt) ares_writev(s,ptr,cnt) #endif /********* EDNS defines section ******/ #define EDNSPACKETSZ 1280 /* Reasonable UDP payload size, as suggested in RFC2671 */ #define MAXENDSSZ 4096 /* Maximum (local) limit for edns packet size */ #define EDNSFIXEDSZ 11 /* Size of EDNS header */ /********* EDNS defines section ******/ struct ares_addr { int family; union { struct in_addr addr4; struct ares_in6_addr addr6; } addr; int udp_port; /* stored in network order */ int tcp_port; /* stored in network order */ }; #define addrV4 addr.addr4 #define addrV6 addr.addr6 struct query; struct send_request { /* Remaining data to send */ const unsigned char *data; size_t len; /* The query for which we're sending this data */ struct query* owner_query; /* The buffer we're using, if we have our own copy of the packet */ unsigned char *data_storage; /* Next request in queue */ struct send_request *next; }; struct server_state { struct ares_addr addr; ares_socket_t udp_socket; ares_socket_t tcp_socket; /* Mini-buffer for reading the length word */ unsigned char tcp_lenbuf[2]; int tcp_lenbuf_pos; int tcp_length; /* Buffer for reading actual TCP data */ unsigned char *tcp_buffer; int tcp_buffer_pos; /* TCP output queue */ struct send_request *qhead; struct send_request *qtail; /* Which incarnation of this connection is this? We don't want to * retransmit requests into the very same socket, but if the server * closes on us and we re-open the connection, then we do want to * re-send. */ int tcp_connection_generation; /* Circular, doubly-linked list of outstanding queries to this server */ struct list_node queries_to_server; /* Link back to owning channel */ ares_channel channel; /* Is this server broken? We mark connections as broken when a * request that is queued for sending times out. */ int is_broken; }; /* State to represent a DNS query */ struct query { /* Query ID from qbuf, for faster lookup, and current timeout */ unsigned short qid; struct timeval timeout; /* * Links for the doubly-linked lists in which we insert a query. * These circular, doubly-linked lists that are hash-bucketed based * the attributes we care about, help making most important * operations O(1). */ struct list_node queries_by_qid; /* hopefully in same cache line as qid */ struct list_node queries_by_timeout; struct list_node queries_to_server; struct list_node all_queries; /* Query buf with length at beginning, for TCP transmission */ unsigned char *tcpbuf; int tcplen; /* Arguments passed to ares_send() (qbuf points into tcpbuf) */ const unsigned char *qbuf; int qlen; ares_callback callback; void *arg; /* Query status */ int try_count; /* Number of times we tried this query already. */ int server; /* Server this query has last been sent to. */ struct query_server_info *server_info; /* per-server state */ int using_tcp; int error_status; int timeouts; /* number of timeouts we saw for this request */ }; /* Per-server state for a query */ struct query_server_info { int skip_server; /* should we skip server, due to errors, etc? */ int tcp_connection_generation; /* into which TCP connection did we send? */ }; /* An IP address pattern; matches an IP address X if X & mask == addr */ #define PATTERN_MASK 0x1 #define PATTERN_CIDR 0x2 struct apattern { union { struct in_addr addr4; struct ares_in6_addr addr6; } addr; union { struct in_addr addr4; struct ares_in6_addr addr6; unsigned short bits; } mask; int family; unsigned short type; }; typedef struct rc4_key { unsigned char state[256]; unsigned char x; unsigned char y; } rc4_key; struct ares_channeldata { /* Configuration data */ int flags; int timeout; /* in milliseconds */ int tries; int ndots; int rotate; /* if true, all servers specified are used */ int udp_port; /* stored in network order */ int tcp_port; /* stored in network order */ int socket_send_buffer_size; int socket_receive_buffer_size; char **domains; int ndomains; struct apattern *sortlist; int nsort; char *lookups; int ednspsz; /* 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]; int optmask; /* the option bitfield passed in at init time */ /* Server addresses and communications state */ struct server_state *servers; int nservers; /* ID to use for next query */ unsigned short next_id; /* key to use when generating new ids */ rc4_key id_key; /* Generation number to use for the next TCP socket open/close */ int tcp_connection_generation; /* The time at which we last called process_timeouts(). Uses integer seconds just to draw the line somewhere. */ time_t last_timeout_processed; /* Last server we sent a query to. */ int last_server; /* Circular, doubly-linked list of queries, bucketed various ways.... */ /* All active queries in a single list: */ struct list_node all_queries; /* Queries bucketed by qid, for quickly dispatching DNS responses: */ #define ARES_QID_TABLE_SIZE 2048 struct list_node queries_by_qid[ARES_QID_TABLE_SIZE]; /* Queries bucketed by timeout, for quickly handling timeouts: */ #define ARES_TIMEOUT_TABLE_SIZE 1024 struct list_node queries_by_timeout[ARES_TIMEOUT_TABLE_SIZE]; ares_sock_state_cb sock_state_cb; void *sock_state_cb_data; ares_sock_create_callback sock_create_cb; void *sock_create_cb_data; ares_sock_config_callback sock_config_cb; void *sock_config_cb_data; const struct ares_socket_functions * sock_funcs; void *sock_func_cb_data; /* Path for resolv.conf file, configurable via ares_options */ char *resolvconf_path; }; /* Does the domain end in ".onion" or ".onion."? Case-insensitive. */ int 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); /* return true if now is exactly check time or later */ int ares__timedout(struct timeval *now, struct timeval *check); void ares__send_query(ares_channel channel, struct query *query, struct timeval *now); void ares__close_sockets(ares_channel channel, struct server_state *server); int ares__get_hostent(FILE *fp, int family, struct hostent **host); int ares__read_line(FILE *fp, char **buf, size_t *bufsize); void ares__free_query(struct query *query); unsigned short ares__generate_new_id(rc4_key* key); struct timeval ares__tvnow(void); int ares__expand_name_validated(const unsigned char *encoded, const unsigned char *abuf, int alen, char **s, long *enclen, int is_hostname); int ares__expand_name_for_response(const unsigned char *encoded, const unsigned char *abuf, int alen, char **s, long *enclen, int is_hostname); void ares__init_servers_state(ares_channel channel); void ares__destroy_servers_state(ares_channel channel); int ares__parse_qtype_reply(const unsigned char* abuf, int alen, int* qtype); int ares__single_domain(ares_channel channel, const char *name, char **s); int ares__cat_domain(const char *name, const char *domain, char **s); int ares__sortaddrinfo(ares_channel channel, struct ares_addrinfo_node *ai_node); int ares__readaddrinfo(FILE *fp, const char *name, unsigned short port, const struct ares_addrinfo_hints *hints, struct ares_addrinfo *ai); struct ares_addrinfo *ares__malloc_addrinfo(void); struct ares_addrinfo_node *ares__malloc_addrinfo_node(void); void ares__freeaddrinfo_nodes(struct ares_addrinfo_node *ai_node); 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); struct ares_addrinfo_cname *ares__malloc_addrinfo_cname(void); void ares__freeaddrinfo_cnames(struct ares_addrinfo_cname *ai_cname); struct ares_addrinfo_cname *ares__append_addrinfo_cname(struct ares_addrinfo_cname **ai_cname); int ares_append_ai_node(int aftype, unsigned short port, 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); int ares__parse_into_addrinfo(const unsigned char *abuf, int alen, int cname_only_is_enodata, unsigned short port, struct ares_addrinfo *ai); int ares__addrinfo2hostent(const struct ares_addrinfo *ai, int family, struct hostent **host); int ares__addrinfo2addrttl(const struct ares_addrinfo *ai, int family, int req_naddrttls, struct ares_addrttl *addrttls, struct ares_addr6ttl *addr6ttls, int *naddrttls); int ares__addrinfo_localhost(const char *name, unsigned short port, const struct ares_addrinfo_hints *hints, struct ares_addrinfo *ai); #if 0 /* Not used */ long ares__tvdiff(struct timeval t1, struct timeval t2); #endif ares_socket_t ares__open_socket(ares_channel channel, int af, int type, int protocol); void ares__close_socket(ares_channel, ares_socket_t); int ares__connect_socket(ares_channel channel, ares_socket_t sockfd, const struct sockaddr *addr, ares_socklen_t addrlen); #define ARES_SWAP_BYTE(a,b) \ { unsigned char swapByte = *(a); *(a) = *(b); *(b) = swapByte; } #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_FALSE #endif /* __ARES_PRIVATE_H */ ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares_process.c0000644000175100001770000013714700000000000022306 0ustar00runnerdocker00000000000000 /* Copyright 1998 by the Massachusetts Institute of Technology. * Copyright (C) 2004-2017 by Daniel Stenberg * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ #include "ares_setup.h" #ifdef 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 #include "ares_nameser.h" #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_SYS_IOCTL_H # include #endif #ifdef NETWARE # include #endif #include #include #include #include "ares.h" #include "ares_dns.h" #include "ares_nowarn.h" #include "ares_private.h" static int try_again(int errnum); static void write_tcp_data(ares_channel channel, fd_set *write_fds, ares_socket_t write_fd, struct timeval *now); static void read_tcp_data(ares_channel channel, fd_set *read_fds, ares_socket_t read_fd, struct timeval *now); static void read_udp_packets(ares_channel channel, fd_set *read_fds, ares_socket_t read_fd, struct timeval *now); static void advance_tcp_send_queue(ares_channel channel, int whichserver, ares_ssize_t num_bytes); static void process_timeouts(ares_channel channel, struct timeval *now); static void process_broken_connections(ares_channel channel, struct timeval *now); static void process_answer(ares_channel channel, unsigned char *abuf, int alen, int whichserver, int tcp, struct timeval *now); static void handle_error(ares_channel channel, int whichserver, struct timeval *now); static void skip_server(ares_channel channel, struct query *query, int whichserver); static void next_server(ares_channel channel, struct query *query, struct timeval *now); static int open_tcp_socket(ares_channel channel, struct server_state *server); static int open_udp_socket(ares_channel channel, struct server_state *server); static int same_questions(const unsigned char *qbuf, int qlen, const unsigned char *abuf, int alen); static int same_address(struct sockaddr *sa, struct ares_addr *aa); static int has_opt_rr(const unsigned char *abuf, int alen); static void end_query(ares_channel channel, struct query *query, int status, unsigned char *abuf, int alen); /* return true if now is exactly check time or later */ int ares__timedout(struct timeval *now, struct timeval *check) { long secs = (now->tv_sec - check->tv_sec); if(secs > 0) return 1; /* yes, timed out */ if(secs < 0) return 0; /* nope, not timed out */ /* if the full seconds were identical, check the sub second parts */ return (now->tv_usec - check->tv_usec >= 0); } /* add the specific number of milliseconds to the time in the first argument */ static void timeadd(struct timeval *now, int millisecs) { now->tv_sec += millisecs/1000; now->tv_usec += (millisecs%1000)*1000; if(now->tv_usec >= 1000000) { ++(now->tv_sec); now->tv_usec -= 1000000; } } /* * generic process function */ static void processfds(ares_channel channel, fd_set *read_fds, ares_socket_t read_fd, fd_set *write_fds, ares_socket_t write_fd) { struct timeval now = ares__tvnow(); write_tcp_data(channel, write_fds, write_fd, &now); read_tcp_data(channel, read_fds, read_fd, &now); read_udp_packets(channel, read_fds, read_fd, &now); process_timeouts(channel, &now); process_broken_connections(channel, &now); } /* Something interesting happened on the wire, or there was a timeout. * See what's up and respond accordingly. */ void ares_process(ares_channel channel, fd_set *read_fds, fd_set *write_fds) { processfds(channel, read_fds, ARES_SOCKET_BAD, write_fds, ARES_SOCKET_BAD); } /* Something interesting happened on the wire, or there was a timeout. * See what's up and respond accordingly. */ void ares_process_fd(ares_channel channel, ares_socket_t read_fd, /* use ARES_SOCKET_BAD or valid file descriptors */ ares_socket_t write_fd) { processfds(channel, NULL, read_fd, NULL, write_fd); } /* 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 */ static int try_again(int errnum) { #if !defined EWOULDBLOCK && !defined EAGAIN #error "Neither EWOULDBLOCK nor EAGAIN defined" #endif switch (errnum) { #ifdef EWOULDBLOCK case EWOULDBLOCK: return 1; #endif #if defined EAGAIN && EAGAIN != EWOULDBLOCK case EAGAIN: return 1; #endif } return 0; } static ares_ssize_t socket_writev(ares_channel channel, ares_socket_t s, const struct iovec * vec, int len) { if (channel->sock_funcs) return channel->sock_funcs->asendv(s, vec, len, channel->sock_func_cb_data); return writev(s, vec, len); } static ares_ssize_t socket_write(ares_channel channel, ares_socket_t s, const void * data, size_t len) { if (channel->sock_funcs) { struct iovec vec; vec.iov_base = (void*)data; vec.iov_len = len; return channel->sock_funcs->asendv(s, &vec, 1, channel->sock_func_cb_data); } return swrite(s, data, len); } /* If any TCP sockets select true for writing, write out queued data * we have for them. */ static void write_tcp_data(ares_channel channel, fd_set *write_fds, ares_socket_t write_fd, struct timeval *now) { struct server_state *server; struct send_request *sendreq; struct iovec *vec; int i; ares_ssize_t scount; ares_ssize_t wcount; size_t n; if(!write_fds && (write_fd == ARES_SOCKET_BAD)) /* no possible action */ return; for (i = 0; i < channel->nservers; i++) { /* Make sure server has data to send and is selected in write_fds or write_fd. */ server = &channel->servers[i]; if (!server->qhead || server->tcp_socket == ARES_SOCKET_BAD || server->is_broken) continue; if(write_fds) { if(!FD_ISSET(server->tcp_socket, write_fds)) continue; } else { if(server->tcp_socket != write_fd) 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_socket, write_fds); /* Count the number of send queue items. */ n = 0; for (sendreq = server->qhead; sendreq; sendreq = sendreq->next) n++; /* Allocate iovecs so we can send all our data at once. */ vec = ares_malloc(n * sizeof(struct iovec)); if (vec) { /* Fill in the iovecs and send. */ n = 0; for (sendreq = server->qhead; sendreq; sendreq = sendreq->next) { vec[n].iov_base = (char *) sendreq->data; vec[n].iov_len = sendreq->len; n++; } wcount = socket_writev(channel, server->tcp_socket, vec, (int)n); ares_free(vec); if (wcount < 0) { if (!try_again(SOCKERRNO)) handle_error(channel, i, now); continue; } /* Advance the send queue by as many bytes as we sent. */ advance_tcp_send_queue(channel, i, wcount); } else { /* Can't allocate iovecs; just send the first request. */ sendreq = server->qhead; scount = socket_write(channel, server->tcp_socket, sendreq->data, sendreq->len); if (scount < 0) { if (!try_again(SOCKERRNO)) handle_error(channel, i, now); continue; } /* Advance the send queue by as many bytes as we sent. */ advance_tcp_send_queue(channel, i, scount); } } } /* Consume the given number of bytes from the head of the TCP send queue. */ static void advance_tcp_send_queue(ares_channel channel, int whichserver, ares_ssize_t num_bytes) { struct send_request *sendreq; struct server_state *server = &channel->servers[whichserver]; while (num_bytes > 0) { sendreq = server->qhead; if ((size_t)num_bytes >= sendreq->len) { num_bytes -= sendreq->len; server->qhead = sendreq->next; if (sendreq->data_storage) ares_free(sendreq->data_storage); ares_free(sendreq); if (server->qhead == NULL) { SOCK_STATE_CALLBACK(channel, server->tcp_socket, 1, 0); server->qtail = NULL; /* qhead is NULL so we cannot continue this loop */ break; } } else { sendreq->data += num_bytes; sendreq->len -= num_bytes; num_bytes = 0; } } } static ares_ssize_t socket_recvfrom(ares_channel 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) return channel->sock_funcs->arecvfrom(s, data, data_len, flags, from, from_len, channel->sock_func_cb_data); #ifdef HAVE_RECVFROM return recvfrom(s, data, data_len, flags, from, from_len); #else return sread(s, data, data_len); #endif } static ares_ssize_t socket_recv(ares_channel channel, ares_socket_t s, void * data, size_t data_len) { if (channel->sock_funcs) return channel->sock_funcs->arecvfrom(s, data, data_len, 0, 0, 0, channel->sock_func_cb_data); return sread(s, data, data_len); } /* 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. */ static void read_tcp_data(ares_channel channel, fd_set *read_fds, ares_socket_t read_fd, struct timeval *now) { struct server_state *server; int i; ares_ssize_t count; if(!read_fds && (read_fd == ARES_SOCKET_BAD)) /* no possible action */ return; for (i = 0; i < channel->nservers; i++) { /* Make sure the server has a socket and is selected in read_fds. */ server = &channel->servers[i]; if (server->tcp_socket == ARES_SOCKET_BAD || server->is_broken) continue; if(read_fds) { if(!FD_ISSET(server->tcp_socket, read_fds)) continue; } else { if(server->tcp_socket != read_fd) continue; } if(read_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_socket, read_fds); if (server->tcp_lenbuf_pos != 2) { /* We haven't yet read a length word, so read that (or * what's left to read of it). */ count = socket_recv(channel, server->tcp_socket, server->tcp_lenbuf + server->tcp_lenbuf_pos, 2 - server->tcp_lenbuf_pos); if (count <= 0) { if (!(count == -1 && try_again(SOCKERRNO))) handle_error(channel, i, now); continue; } server->tcp_lenbuf_pos += (int)count; if (server->tcp_lenbuf_pos == 2) { /* We finished reading the length word. Decode the * length and allocate a buffer for the data. */ server->tcp_length = server->tcp_lenbuf[0] << 8 | server->tcp_lenbuf[1]; server->tcp_buffer = ares_malloc(server->tcp_length); if (!server->tcp_buffer) { handle_error(channel, i, now); return; /* bail out on malloc failure. TODO: make this function return error codes */ } server->tcp_buffer_pos = 0; } } else { /* Read data into the allocated buffer. */ count = socket_recv(channel, server->tcp_socket, server->tcp_buffer + server->tcp_buffer_pos, server->tcp_length - server->tcp_buffer_pos); if (count <= 0) { if (!(count == -1 && try_again(SOCKERRNO))) handle_error(channel, i, now); continue; } server->tcp_buffer_pos += (int)count; if (server->tcp_buffer_pos == server->tcp_length) { /* We finished reading this answer; process it and * prepare to read another length word. */ process_answer(channel, server->tcp_buffer, server->tcp_length, i, 1, now); ares_free(server->tcp_buffer); server->tcp_buffer = NULL; server->tcp_lenbuf_pos = 0; server->tcp_buffer_pos = 0; } } } } /* If any UDP sockets select true for reading, process them. */ static void read_udp_packets(ares_channel channel, fd_set *read_fds, ares_socket_t read_fd, struct timeval *now) { struct server_state *server; int i; ares_ssize_t count; unsigned char buf[MAXENDSSZ + 1]; #ifdef HAVE_RECVFROM ares_socklen_t fromlen; union { struct sockaddr sa; struct sockaddr_in sa4; struct sockaddr_in6 sa6; } from; #endif if(!read_fds && (read_fd == ARES_SOCKET_BAD)) /* no possible action */ return; for (i = 0; i < channel->nservers; i++) { /* Make sure the server has a socket and is selected in read_fds. */ server = &channel->servers[i]; if (server->udp_socket == ARES_SOCKET_BAD || server->is_broken) continue; if(read_fds) { if(!FD_ISSET(server->udp_socket, read_fds)) continue; } else { if(server->udp_socket != read_fd) continue; } if(read_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->udp_socket, read_fds); /* To reduce event loop overhead, read and process as many * packets as we can. */ do { if (server->udp_socket == ARES_SOCKET_BAD) count = 0; else { if (server->addr.family == AF_INET) fromlen = sizeof(from.sa4); else fromlen = sizeof(from.sa6); count = socket_recvfrom(channel, server->udp_socket, (void *)buf, sizeof(buf), 0, &from.sa, &fromlen); } if (count == -1 && try_again(SOCKERRNO)) continue; else if (count <= 0) handle_error(channel, i, now); #ifdef HAVE_RECVFROM else if (!same_address(&from.sa, &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. */ break; #endif else process_answer(channel, buf, (int)count, i, 0, now); } while (count > 0); } } /* If any queries have timed out, note the timeout and move them on. */ static void process_timeouts(ares_channel channel, struct timeval *now) { time_t t; /* the time of the timeouts we're processing */ struct query *query; struct list_node* list_head; struct list_node* list_node; /* Process all the timeouts that have fired since the last time we processed * timeouts. If things are going well, then we'll have hundreds/thousands of * queries that fall into future buckets, and only a handful of requests * that fall into the "now" bucket, so this should be quite quick. */ for (t = channel->last_timeout_processed; t <= now->tv_sec; t++) { list_head = &(channel->queries_by_timeout[t % ARES_TIMEOUT_TABLE_SIZE]); for (list_node = list_head->next; list_node != list_head; ) { query = list_node->data; list_node = list_node->next; /* in case the query gets deleted */ if (query->timeout.tv_sec && ares__timedout(now, &query->timeout)) { query->error_status = ARES_ETIMEOUT; ++query->timeouts; next_server(channel, query, now); } } } channel->last_timeout_processed = now->tv_sec; } /* Handle an answer from a server. */ static void process_answer(ares_channel channel, unsigned char *abuf, int alen, int whichserver, int tcp, struct timeval *now) { int tc, rcode, packetsz; unsigned short id; struct query *query; struct list_node* list_head; struct list_node* list_node; /* If there's no room in the answer for a header, we can't do much * with it. */ if (alen < HFIXEDSZ) return; /* Grab the query ID, truncate bit, and response code from the packet. */ id = DNS_HEADER_QID(abuf); tc = DNS_HEADER_TC(abuf); rcode = DNS_HEADER_RCODE(abuf); /* Find the query corresponding to this packet. The queries are * hashed/bucketed by query id, so this lookup should be quick. Note that * both the query id and the questions must be the same; when the query id * wraps around we can have multiple outstanding queries with the same query * id, so we need to check both the id and question. */ query = NULL; list_head = &(channel->queries_by_qid[id % ARES_QID_TABLE_SIZE]); for (list_node = list_head->next; list_node != list_head; list_node = list_node->next) { struct query *q = list_node->data; if ((q->qid == id) && same_questions(q->qbuf, q->qlen, abuf, alen)) { query = q; break; } } if (!query) return; packetsz = PACKETSZ; /* If we use EDNS and server answers with FORMERR without an OPT RR, the protocol * extension is not understood by the responder. We must retry the query * without EDNS enabled. */ if (channel->flags & ARES_FLAG_EDNS) { packetsz = channel->ednspsz; if (rcode == FORMERR && has_opt_rr(abuf, alen) != 1) { int qlen = (query->tcplen - 2) - EDNSFIXEDSZ; channel->flags ^= ARES_FLAG_EDNS; query->tcplen -= EDNSFIXEDSZ; query->qlen -= EDNSFIXEDSZ; query->tcpbuf[0] = (unsigned char)((qlen >> 8) & 0xff); query->tcpbuf[1] = (unsigned char)(qlen & 0xff); DNS_HEADER_SET_ARCOUNT(query->tcpbuf + 2, 0); query->tcpbuf = ares_realloc(query->tcpbuf, query->tcplen); query->qbuf = query->tcpbuf + 2; ares__send_query(channel, query, now); return; } } /* If we got a truncated UDP packet and are not ignoring truncation, * don't accept the packet, and switch the query to TCP if we hadn't * done so already. */ if ((tc || alen > packetsz) && !tcp && !(channel->flags & ARES_FLAG_IGNTC)) { if (!query->using_tcp) { query->using_tcp = 1; ares__send_query(channel, query, now); } return; } /* Limit alen to PACKETSZ if we aren't using TCP (only relevant if we * are ignoring truncation. */ if (alen > packetsz && !tcp) alen = packetsz; /* If we aren't passing through all error packets, discard packets * with SERVFAIL, NOTIMP, or REFUSED response codes. */ if (!(channel->flags & ARES_FLAG_NOCHECKRESP)) { if (rcode == SERVFAIL || rcode == NOTIMP || rcode == REFUSED) { skip_server(channel, query, whichserver); if (query->server == whichserver) next_server(channel, query, now); return; } } end_query(channel, query, ARES_SUCCESS, abuf, alen); } /* Close all the connections that are no longer usable. */ static void process_broken_connections(ares_channel channel, struct timeval *now) { int i; for (i = 0; i < channel->nservers; i++) { struct server_state *server = &channel->servers[i]; if (server->is_broken) { handle_error(channel, i, now); } } } /* Swap the contents of two lists */ static void swap_lists(struct list_node* head_a, struct list_node* head_b) { int is_a_empty = ares__is_list_empty(head_a); int is_b_empty = ares__is_list_empty(head_b); struct list_node old_a = *head_a; struct list_node old_b = *head_b; if (is_a_empty) { ares__init_list_head(head_b); } else { *head_b = old_a; old_a.next->prev = head_b; old_a.prev->next = head_b; } if (is_b_empty) { ares__init_list_head(head_a); } else { *head_a = old_b; old_b.next->prev = head_a; old_b.prev->next = head_a; } } static void handle_error(ares_channel channel, int whichserver, struct timeval *now) { struct server_state *server; struct query *query; struct list_node list_head; struct list_node* list_node; server = &channel->servers[whichserver]; /* Reset communications with this server. */ ares__close_sockets(channel, server); /* Tell all queries talking to this server to move on and not try this * server again. We steal the current list of queries that were in-flight to * this server, since when we call next_server this can cause the queries to * be re-sent to this server, which will re-insert these queries in that * same server->queries_to_server list. */ ares__init_list_head(&list_head); swap_lists(&list_head, &(server->queries_to_server)); for (list_node = list_head.next; list_node != &list_head; ) { query = list_node->data; list_node = list_node->next; /* in case the query gets deleted */ assert(query->server == whichserver); skip_server(channel, query, whichserver); next_server(channel, query, now); } /* Each query should have removed itself from our temporary list as * it re-sent itself or finished up... */ assert(ares__is_list_empty(&list_head)); } static void skip_server(ares_channel channel, struct query *query, int whichserver) { /* The given server gave us problems with this query, so if we have the * luxury of using other servers, then let's skip the potentially broken * server and just use the others. If we only have one server and we need to * retry then we should just go ahead and re-use that server, since it's our * only hope; perhaps we just got unlucky, and retrying will work (eg, the * server timed out our TCP connection just as we were sending another * request). */ if (channel->nservers > 1) { query->server_info[whichserver].skip_server = 1; } } static void next_server(ares_channel channel, struct query *query, struct timeval *now) { /* We need to try each server channel->tries times. We have channel->nservers * servers to try. In total, we need to do channel->nservers * channel->tries * attempts. Use query->try to remember how many times we already attempted * this query. Use modular arithmetic to find the next server to try. */ while (++(query->try_count) < (channel->nservers * channel->tries)) { struct server_state *server; /* Move on to the next server. */ query->server = (query->server + 1) % channel->nservers; server = &channel->servers[query->server]; /* We don't want to use this server if (1) we decided this connection is * broken, and thus about to be closed, (2) we've decided to skip this * server because of earlier errors we encountered, or (3) we already * sent this query over this exact connection. */ if (!server->is_broken && !query->server_info[query->server].skip_server && !(query->using_tcp && (query->server_info[query->server].tcp_connection_generation == server->tcp_connection_generation))) { ares__send_query(channel, query, now); return; } /* You might think that with TCP we only need one try. However, even * when using TCP, servers can time-out our connection just as we're * sending a request, or close our connection because they die, or never * send us a reply because they get wedged or tickle a bug that drops * our request. */ } /* If we are here, all attempts to perform query failed. */ end_query(channel, query, query->error_status, NULL, 0); } void ares__send_query(ares_channel channel, struct query *query, struct timeval *now) { struct send_request *sendreq; struct server_state *server; int timeplus; server = &channel->servers[query->server]; if (query->using_tcp) { /* Make sure the TCP socket for this server is set up and queue * a send request. */ if (server->tcp_socket == ARES_SOCKET_BAD) { if (open_tcp_socket(channel, server) == -1) { skip_server(channel, query, query->server); next_server(channel, query, now); return; } } sendreq = ares_malloc(sizeof(struct send_request)); if (!sendreq) { end_query(channel, query, ARES_ENOMEM, NULL, 0); return; } memset(sendreq, 0, sizeof(struct send_request)); /* To make the common case fast, we avoid copies by using the query's * tcpbuf for as long as the query is alive. In the rare case where the * query ends while it's queued for transmission, then we give the * sendreq its own copy of the request packet and put it in * sendreq->data_storage. */ sendreq->data_storage = NULL; sendreq->data = query->tcpbuf; sendreq->len = query->tcplen; sendreq->owner_query = query; sendreq->next = NULL; if (server->qtail) server->qtail->next = sendreq; else { SOCK_STATE_CALLBACK(channel, server->tcp_socket, 1, 1); server->qhead = sendreq; } server->qtail = sendreq; query->server_info[query->server].tcp_connection_generation = server->tcp_connection_generation; } else { if (server->udp_socket == ARES_SOCKET_BAD) { if (open_udp_socket(channel, server) == -1) { skip_server(channel, query, query->server); next_server(channel, query, now); return; } } if (socket_write(channel, server->udp_socket, query->qbuf, query->qlen) == -1) { /* FIXME: Handle EAGAIN here since it likely can happen. */ skip_server(channel, query, query->server); next_server(channel, query, now); return; } } /* For each trip through the entire server list, double the channel's * assigned timeout, avoiding overflow. If channel->timeout is negative, * leave it as-is, even though that should be impossible here. */ timeplus = channel->timeout; { /* How many times do we want to double it? Presume sane values here. */ const int shift = query->try_count / channel->nservers; /* Is there enough room to shift timeplus left that many times? * * To find out, confirm that all of the bits we'll shift away are zero. * Stop considering a shift if we get to the point where we could shift * a 1 into the sign bit (i.e. when shift is within two of the bit * count). * * This has the side benefit of leaving negative numbers unchanged. */ if(shift <= (int)(sizeof(int) * CHAR_BIT - 1) && (timeplus >> (sizeof(int) * CHAR_BIT - 1 - shift)) == 0) { timeplus <<= shift; } } query->timeout = *now; timeadd(&query->timeout, timeplus); /* Keep track of queries bucketed by timeout, so we can process * timeout events quickly. */ ares__remove_from_list(&(query->queries_by_timeout)); ares__insert_in_list( &(query->queries_by_timeout), &(channel->queries_by_timeout[query->timeout.tv_sec % ARES_TIMEOUT_TABLE_SIZE])); /* Keep track of queries bucketed by server, so we can process server * errors quickly. */ ares__remove_from_list(&(query->queries_to_server)); ares__insert_in_list(&(query->queries_to_server), &(server->queries_to_server)); } /* * 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 (FALSE != 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, 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 configure_socket(ares_socket_t s, int family, ares_channel channel) { union { struct sockaddr sa; struct sockaddr_in sa4; struct sockaddr_in6 sa6; } local; /* do not set options for user-managed sockets */ if (channel->sock_funcs) return 0; (void)setsocknonblock(s, TRUE); #if defined(FD_CLOEXEC) && !defined(MSDOS) /* Configure the socket fd as close-on-exec. */ if (fcntl(s, F_SETFD, FD_CLOEXEC) == -1) return -1; /* LCOV_EXCL_LINE */ #endif /* Set the socket's send and receive buffer sizes. */ if ((channel->socket_send_buffer_size > 0) && setsockopt(s, SOL_SOCKET, SO_SNDBUF, (void *)&channel->socket_send_buffer_size, sizeof(channel->socket_send_buffer_size)) == -1) return -1; if ((channel->socket_receive_buffer_size > 0) && setsockopt(s, SOL_SOCKET, SO_RCVBUF, (void *)&channel->socket_receive_buffer_size, sizeof(channel->socket_receive_buffer_size)) == -1) return -1; #ifdef SO_BINDTODEVICE if (channel->local_dev_name[0]) { if (setsockopt(s, SOL_SOCKET, SO_BINDTODEVICE, channel->local_dev_name, sizeof(channel->local_dev_name))) { /* Only root can do this, and usually not fatal if it doesn't work, so */ /* just continue on. */ } } #endif if (family == AF_INET) { if (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); if (bind(s, &local.sa, sizeof(local.sa4)) < 0) return -1; } } else if (family == AF_INET6) { if (memcmp(channel->local_ip6, &ares_in6addr_any, sizeof(channel->local_ip6)) != 0) { 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)); if (bind(s, &local.sa, sizeof(local.sa6)) < 0) return -1; } } return 0; } static int open_tcp_socket(ares_channel channel, struct server_state *server) { ares_socket_t s; int opt; ares_socklen_t salen; union { struct sockaddr_in sa4; struct sockaddr_in6 sa6; } saddr; struct sockaddr *sa; switch (server->addr.family) { case AF_INET: sa = (void *)&saddr.sa4; salen = sizeof(saddr.sa4); memset(sa, 0, salen); saddr.sa4.sin_family = AF_INET; if (server->addr.tcp_port) { saddr.sa4.sin_port = aresx_sitous(server->addr.tcp_port); } else { saddr.sa4.sin_port = aresx_sitous(channel->tcp_port); } memcpy(&saddr.sa4.sin_addr, &server->addr.addrV4, sizeof(server->addr.addrV4)); break; case AF_INET6: sa = (void *)&saddr.sa6; salen = sizeof(saddr.sa6); memset(sa, 0, salen); saddr.sa6.sin6_family = AF_INET6; if (server->addr.tcp_port) { saddr.sa6.sin6_port = aresx_sitous(server->addr.tcp_port); } else { saddr.sa6.sin6_port = aresx_sitous(channel->tcp_port); } memcpy(&saddr.sa6.sin6_addr, &server->addr.addrV6, sizeof(server->addr.addrV6)); break; default: return -1; /* LCOV_EXCL_LINE */ } /* Acquire a socket. */ s = ares__open_socket(channel, server->addr.family, SOCK_STREAM, 0); if (s == ARES_SOCKET_BAD) return -1; /* Configure it. */ if (configure_socket(s, server->addr.family, channel) < 0) { ares__close_socket(channel, s); return -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. */ opt = 1; if (channel->sock_funcs == 0 && setsockopt(s, IPPROTO_TCP, TCP_NODELAY, (void *)&opt, sizeof(opt)) == -1) { ares__close_socket(channel, s); return -1; } #endif if (channel->sock_config_cb) { int err = channel->sock_config_cb(s, SOCK_STREAM, channel->sock_config_cb_data); if (err < 0) { ares__close_socket(channel, s); return err; } } /* Connect to the server. */ if (ares__connect_socket(channel, s, sa, salen) == -1) { int err = SOCKERRNO; if (err != EINPROGRESS && err != EWOULDBLOCK) { ares__close_socket(channel, s); return -1; } } if (channel->sock_create_cb) { int err = channel->sock_create_cb(s, SOCK_STREAM, channel->sock_create_cb_data); if (err < 0) { ares__close_socket(channel, s); return err; } } SOCK_STATE_CALLBACK(channel, s, 1, 0); server->tcp_buffer_pos = 0; server->tcp_socket = s; server->tcp_connection_generation = ++channel->tcp_connection_generation; return 0; } static int open_udp_socket(ares_channel channel, struct server_state *server) { ares_socket_t s; ares_socklen_t salen; union { struct sockaddr_in sa4; struct sockaddr_in6 sa6; } saddr; struct sockaddr *sa; switch (server->addr.family) { case AF_INET: sa = (void *)&saddr.sa4; salen = sizeof(saddr.sa4); memset(sa, 0, salen); saddr.sa4.sin_family = AF_INET; if (server->addr.udp_port) { saddr.sa4.sin_port = aresx_sitous(server->addr.udp_port); } else { saddr.sa4.sin_port = aresx_sitous(channel->udp_port); } memcpy(&saddr.sa4.sin_addr, &server->addr.addrV4, sizeof(server->addr.addrV4)); break; case AF_INET6: sa = (void *)&saddr.sa6; salen = sizeof(saddr.sa6); memset(sa, 0, salen); saddr.sa6.sin6_family = AF_INET6; if (server->addr.udp_port) { saddr.sa6.sin6_port = aresx_sitous(server->addr.udp_port); } else { saddr.sa6.sin6_port = aresx_sitous(channel->udp_port); } memcpy(&saddr.sa6.sin6_addr, &server->addr.addrV6, sizeof(server->addr.addrV6)); break; default: return -1; /* LCOV_EXCL_LINE */ } /* Acquire a socket. */ s = ares__open_socket(channel, server->addr.family, SOCK_DGRAM, 0); if (s == ARES_SOCKET_BAD) return -1; /* Set the socket non-blocking. */ if (configure_socket(s, server->addr.family, channel) < 0) { ares__close_socket(channel, s); return -1; } if (channel->sock_config_cb) { int err = channel->sock_config_cb(s, SOCK_DGRAM, channel->sock_config_cb_data); if (err < 0) { ares__close_socket(channel, s); return err; } } /* Connect to the server. */ if (ares__connect_socket(channel, s, sa, salen) == -1) { int err = SOCKERRNO; if (err != EINPROGRESS && err != EWOULDBLOCK) { ares__close_socket(channel, s); return -1; } } if (channel->sock_create_cb) { int err = channel->sock_create_cb(s, SOCK_DGRAM, channel->sock_create_cb_data); if (err < 0) { ares__close_socket(channel, s); return err; } } SOCK_STATE_CALLBACK(channel, s, 1, 0); server->udp_socket = s; return 0; } static int same_questions(const unsigned char *qbuf, int qlen, const unsigned char *abuf, int alen) { struct { const unsigned char *p; int qdcount; char *name; long namelen; int type; int dnsclass; } q, a; int i, j; if (qlen < HFIXEDSZ || alen < HFIXEDSZ) return 0; /* Extract qdcount from the request and reply buffers and compare them. */ q.qdcount = DNS_HEADER_QDCOUNT(qbuf); a.qdcount = DNS_HEADER_QDCOUNT(abuf); if (q.qdcount != a.qdcount) return 0; /* For each question in qbuf, find it in abuf. */ q.p = qbuf + HFIXEDSZ; for (i = 0; i < q.qdcount; i++) { /* Decode the question in the query. */ if (ares_expand_name(q.p, qbuf, qlen, &q.name, &q.namelen) != ARES_SUCCESS) return 0; q.p += q.namelen; if (q.p + QFIXEDSZ > qbuf + qlen) { ares_free(q.name); return 0; } q.type = DNS_QUESTION_TYPE(q.p); q.dnsclass = DNS_QUESTION_CLASS(q.p); q.p += QFIXEDSZ; /* Search for this question in the answer. */ a.p = abuf + HFIXEDSZ; for (j = 0; j < a.qdcount; j++) { /* Decode the question in the answer. */ if (ares_expand_name(a.p, abuf, alen, &a.name, &a.namelen) != ARES_SUCCESS) { ares_free(q.name); return 0; } a.p += a.namelen; if (a.p + QFIXEDSZ > abuf + alen) { ares_free(q.name); ares_free(a.name); return 0; } a.type = DNS_QUESTION_TYPE(a.p); a.dnsclass = DNS_QUESTION_CLASS(a.p); a.p += QFIXEDSZ; /* Compare the decoded questions. */ if (strcasecmp(q.name, a.name) == 0 && q.type == a.type && q.dnsclass == a.dnsclass) { ares_free(a.name); break; } ares_free(a.name); } ares_free(q.name); if (j == a.qdcount) return 0; } return 1; } static int same_address(struct sockaddr *sa, struct ares_addr *aa) { void *addr1; void *addr2; if (sa->sa_family == aa->family) { switch (aa->family) { case AF_INET: addr1 = &aa->addrV4; addr2 = &(CARES_INADDR_CAST(struct sockaddr_in *, sa))->sin_addr; if (memcmp(addr1, addr2, sizeof(aa->addrV4)) == 0) return 1; /* match */ break; case AF_INET6: addr1 = &aa->addrV6; addr2 = &(CARES_INADDR_CAST(struct sockaddr_in6 *, sa))->sin6_addr; if (memcmp(addr1, addr2, sizeof(aa->addrV6)) == 0) return 1; /* match */ break; default: break; /* LCOV_EXCL_LINE */ } } return 0; /* different */ } /* search for an OPT RR in the response */ static int has_opt_rr(const unsigned char *abuf, int alen) { unsigned int qdcount, ancount, nscount, arcount, i; const unsigned char *aptr; int status; if (alen < HFIXEDSZ) return -1; /* Parse the answer header. */ qdcount = DNS_HEADER_QDCOUNT(abuf); ancount = DNS_HEADER_ANCOUNT(abuf); nscount = DNS_HEADER_NSCOUNT(abuf); arcount = DNS_HEADER_ARCOUNT(abuf); aptr = abuf + HFIXEDSZ; /* skip the questions */ for (i = 0; i < qdcount; i++) { char* name; long len; status = ares_expand_name(aptr, abuf, alen, &name, &len); if (status != ARES_SUCCESS) return -1; ares_free_string(name); if (aptr + len + QFIXEDSZ > abuf + alen) return -1; aptr += len + QFIXEDSZ; } /* skip the ancount and nscount */ for (i = 0; i < ancount + nscount; i++) { char* name; long len; int dlen; status = ares_expand_name(aptr, abuf, alen, &name, &len); if (status != ARES_SUCCESS) return -1; ares_free_string(name); if (aptr + len + RRFIXEDSZ > abuf + alen) return -1; aptr += len; dlen = DNS_RR_LEN(aptr); aptr += RRFIXEDSZ; if (aptr + dlen > abuf + alen) return -1; aptr += dlen; } /* search for rr type (41) - opt */ for (i = 0; i < arcount; i++) { char* name; long len; int dlen; status = ares_expand_name(aptr, abuf, alen, &name, &len); if (status != ARES_SUCCESS) return -1; ares_free_string(name); if (aptr + len + RRFIXEDSZ > abuf + alen) return -1; aptr += len; if (DNS_RR_TYPE(aptr) == T_OPT) return 1; dlen = DNS_RR_LEN(aptr); aptr += RRFIXEDSZ; if (aptr + dlen > abuf + alen) return -1; aptr += dlen; } return 0; } static void end_query (ares_channel channel, struct query *query, int status, unsigned char *abuf, int alen) { int i; /* First we check to see if this query ended while one of our send * queues still has pointers to it. */ for (i = 0; i < channel->nservers; i++) { struct server_state *server = &channel->servers[i]; struct send_request *sendreq; for (sendreq = server->qhead; sendreq; sendreq = sendreq->next) if (sendreq->owner_query == query) { sendreq->owner_query = NULL; assert(sendreq->data_storage == NULL); if (status == ARES_SUCCESS) { /* We got a reply for this query, but this queued sendreq * points into this soon-to-be-gone query's tcpbuf. Probably * this means we timed out and queued the query for * retransmission, then received a response before actually * retransmitting. This is perfectly fine, so we want to keep * the connection running smoothly if we can. But in the worst * case we may have sent only some prefix of the query, with * some suffix of the query left to send. Also, the buffer may * be queued on multiple queues. To prevent dangling pointers * to the query's tcpbuf and handle these cases, we just give * such sendreqs their own copy of the query packet. */ sendreq->data_storage = ares_malloc(sendreq->len); if (sendreq->data_storage != NULL) { memcpy(sendreq->data_storage, sendreq->data, sendreq->len); sendreq->data = sendreq->data_storage; } } if ((status != ARES_SUCCESS) || (sendreq->data_storage == NULL)) { /* We encountered an error (probably a timeout, suggesting the * DNS server we're talking to is probably unreachable, * wedged, or severely overloaded) or we couldn't copy the * request, so mark the connection as broken. When we get to * process_broken_connections() we'll close the connection and * try to re-send requests to another server. */ server->is_broken = 1; /* Just to be paranoid, zero out this sendreq... */ sendreq->data = NULL; sendreq->len = 0; } } } /* Invoke the callback */ query->callback(query->arg, status, query->timeouts, abuf, alen); ares__free_query(query); /* Simple cleanup policy: if no queries are remaining, close all network * sockets unless STAYOPEN is set. */ if (!(channel->flags & ARES_FLAG_STAYOPEN) && ares__is_list_empty(&(channel->all_queries))) { for (i = 0; i < channel->nservers; i++) ares__close_sockets(channel, &channel->servers[i]); } } void ares__free_query(struct query *query) { /* Remove the query from all the lists in which it is linked */ ares__remove_from_list(&(query->queries_by_qid)); ares__remove_from_list(&(query->queries_by_timeout)); ares__remove_from_list(&(query->queries_to_server)); ares__remove_from_list(&(query->all_queries)); /* Zero out some important stuff, to help catch bugs */ query->callback = NULL; query->arg = NULL; /* Deallocate the memory associated with the query */ ares_free(query->tcpbuf); ares_free(query->server_info); ares_free(query); } ares_socket_t ares__open_socket(ares_channel channel, int af, int type, int protocol) { if (channel->sock_funcs) return channel->sock_funcs->asocket(af, type, protocol, channel->sock_func_cb_data); else return socket(af, type, protocol); } int ares__connect_socket(ares_channel channel, ares_socket_t sockfd, const struct sockaddr *addr, ares_socklen_t addrlen) { if (channel->sock_funcs) return channel->sock_funcs->aconnect(sockfd, addr, addrlen, channel->sock_func_cb_data); else return connect(sockfd, addr, addrlen); } void ares__close_socket(ares_channel channel, ares_socket_t s) { if (channel->sock_funcs) channel->sock_funcs->aclose(s, channel->sock_func_cb_data); else sclose(s); } ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares_query.c0000644000175100001770000001146100000000000021763 0ustar00runnerdocker00000000000000 /* Copyright 1998 by the Massachusetts Institute of Technology. * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ #include "ares_setup.h" #ifdef HAVE_NETINET_IN_H # include #endif #include "ares_nameser.h" #include "ares.h" #include "ares_dns.h" #include "ares_private.h" struct qquery { ares_callback callback; void *arg; }; static void qcallback(void *arg, int status, int timeouts, unsigned char *abuf, int alen); static void rc4(rc4_key* key, unsigned char *buffer_ptr, int buffer_len) { unsigned char x; unsigned char y; unsigned char* state; unsigned char xorIndex; int counter; x = key->x; y = key->y; state = &key->state[0]; for(counter = 0; counter < buffer_len; counter ++) { x = (unsigned char)((x + 1) % 256); y = (unsigned char)((state[x] + y) % 256); ARES_SWAP_BYTE(&state[x], &state[y]); xorIndex = (unsigned char)((state[x] + state[y]) % 256); buffer_ptr[counter] = (unsigned char)(buffer_ptr[counter]^state[xorIndex]); } key->x = x; key->y = y; } static struct query* find_query_by_id(ares_channel channel, unsigned short id) { unsigned short qid; struct list_node* list_head; struct list_node* list_node; DNS_HEADER_SET_QID(((unsigned char*)&qid), id); /* Find the query corresponding to this packet. */ list_head = &(channel->queries_by_qid[qid % ARES_QID_TABLE_SIZE]); for (list_node = list_head->next; list_node != list_head; list_node = list_node->next) { struct query *q = list_node->data; if (q->qid == qid) return q; } return NULL; } /* a unique query id is generated using an rc4 key. Since the id may already be used by a running query (as infrequent as it may be), a lookup is performed per id generation. In practice this search should happen only once per newly generated id */ static unsigned short generate_unique_id(ares_channel channel) { unsigned short id; do { id = ares__generate_new_id(&channel->id_key); } while (find_query_by_id(channel, id)); return (unsigned short)id; } unsigned short ares__generate_new_id(rc4_key* key) { unsigned short r=0; rc4(key, (unsigned char *)&r, sizeof(r)); return r; } void ares_query(ares_channel channel, const char *name, int dnsclass, int type, ares_callback callback, void *arg) { struct qquery *qquery; unsigned char *qbuf; int qlen, rd, status; /* Compose the query. */ rd = !(channel->flags & ARES_FLAG_NORECURSE); status = ares_create_query(name, dnsclass, type, channel->next_id, rd, &qbuf, &qlen, (channel->flags & ARES_FLAG_EDNS) ? channel->ednspsz : 0); if (status != ARES_SUCCESS) { if (qbuf != NULL) ares_free(qbuf); callback(arg, status, 0, NULL, 0); return; } channel->next_id = generate_unique_id(channel); /* Allocate and fill in the query structure. */ qquery = ares_malloc(sizeof(struct qquery)); if (!qquery) { ares_free_string(qbuf); callback(arg, ARES_ENOMEM, 0, NULL, 0); return; } qquery->callback = callback; qquery->arg = arg; /* Send it off. qcallback will be called when we get an answer. */ ares_send(channel, qbuf, qlen, qcallback, qquery); ares_free_string(qbuf); } static void qcallback(void *arg, int status, int timeouts, unsigned char *abuf, int alen) { struct qquery *qquery = (struct qquery *) arg; unsigned int ancount; int rcode; if (status != ARES_SUCCESS) qquery->callback(qquery->arg, status, timeouts, abuf, alen); else { /* Pull the response code and answer count from the packet. */ rcode = DNS_HEADER_RCODE(abuf); ancount = DNS_HEADER_ANCOUNT(abuf); /* Convert errors. */ switch (rcode) { case NOERROR: status = (ancount > 0) ? ARES_SUCCESS : ARES_ENODATA; break; case FORMERR: status = ARES_EFORMERR; break; case SERVFAIL: status = ARES_ESERVFAIL; break; case NXDOMAIN: status = ARES_ENOTFOUND; break; case NOTIMP: status = ARES_ENOTIMP; break; case REFUSED: status = ARES_EREFUSED; break; } qquery->callback(qquery->arg, status, timeouts, abuf, alen); } ares_free(qquery); } ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares_search.c0000644000175100001770000002277700000000000022077 0ustar00runnerdocker00000000000000 /* Copyright 1998 by the Massachusetts Institute of Technology. * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ #include "ares_setup.h" #ifdef HAVE_STRINGS_H # include #endif #include "ares.h" #include "ares_private.h" struct search_query { /* Arguments passed to ares_search */ ares_channel channel; char *name; /* copied into an allocated buffer */ int dnsclass; int type; ares_callback callback; void *arg; int status_as_is; /* error status from trying as-is */ int next_domain; /* next search domain to try */ int trying_as_is; /* current query is for name as-is */ int timeouts; /* number of timeouts we saw for this request */ int ever_got_nodata; /* did we ever get ARES_ENODATA along the way? */ }; static void search_callback(void *arg, int status, int timeouts, unsigned char *abuf, int alen); static void end_squery(struct search_query *squery, int status, unsigned char *abuf, int alen); void ares_search(ares_channel channel, const char *name, int dnsclass, int type, ares_callback callback, void *arg) { struct search_query *squery; char *s; const char *p; int status, ndots; /* Per RFC 7686, reject queries for ".onion" domain names with NXDOMAIN. */ if (ares__is_onion_domain(name)) { callback(arg, ARES_ENOTFOUND, 0, NULL, 0); return; } /* If name only yields one domain to search, then we don't have * to keep extra state, so just do an ares_query(). */ status = ares__single_domain(channel, name, &s); if (status != ARES_SUCCESS) { callback(arg, status, 0, NULL, 0); return; } if (s) { ares_query(channel, s, dnsclass, type, callback, arg); ares_free(s); return; } /* Allocate a search_query structure to hold the state necessary for * doing multiple lookups. */ squery = ares_malloc(sizeof(struct search_query)); if (!squery) { callback(arg, ARES_ENOMEM, 0, NULL, 0); return; } squery->channel = channel; squery->name = ares_strdup(name); if (!squery->name) { ares_free(squery); callback(arg, ARES_ENOMEM, 0, NULL, 0); return; } squery->dnsclass = dnsclass; squery->type = type; squery->status_as_is = -1; squery->callback = callback; squery->arg = arg; squery->timeouts = 0; squery->ever_got_nodata = 0; /* Count the number of dots in name. */ ndots = 0; for (p = name; *p; p++) { if (*p == '.') ndots++; } /* If ndots is at least the channel ndots threshold (usually 1), * then we try the name as-is first. Otherwise, we try the name * as-is last. */ if (ndots >= channel->ndots) { /* Try the name as-is first. */ squery->next_domain = 0; squery->trying_as_is = 1; ares_query(channel, name, dnsclass, type, search_callback, squery); } else { /* Try the name as-is last; start with the first search domain. */ squery->next_domain = 1; squery->trying_as_is = 0; status = ares__cat_domain(name, channel->domains[0], &s); if (status == ARES_SUCCESS) { ares_query(channel, s, dnsclass, type, search_callback, squery); ares_free(s); } else { /* failed, free the malloc()ed memory */ ares_free(squery->name); ares_free(squery); callback(arg, status, 0, NULL, 0); } } } static void search_callback(void *arg, int status, int timeouts, unsigned char *abuf, int alen) { struct search_query *squery = (struct search_query *) arg; ares_channel channel = squery->channel; char *s; squery->timeouts += timeouts; /* Stop searching unless we got a non-fatal error. */ if (status != ARES_ENODATA && status != ARES_ESERVFAIL && status != ARES_ENOTFOUND) end_squery(squery, status, abuf, alen); else { /* Save the status if we were trying as-is. */ if (squery->trying_as_is) squery->status_as_is = status; /* * If we ever get ARES_ENODATA along the way, record that; if the search * should run to the very end and we got at least one ARES_ENODATA, * then callers like ares_gethostbyname() may want to try a T_A search * even if the last domain we queried for T_AAAA resource records * returned ARES_ENOTFOUND. */ if (status == ARES_ENODATA) squery->ever_got_nodata = 1; if (squery->next_domain < channel->ndomains) { /* Try the next domain. */ status = ares__cat_domain(squery->name, channel->domains[squery->next_domain], &s); if (status != ARES_SUCCESS) end_squery(squery, status, NULL, 0); else { squery->trying_as_is = 0; squery->next_domain++; ares_query(channel, s, squery->dnsclass, squery->type, search_callback, squery); ares_free(s); } } else if (squery->status_as_is == -1) { /* Try the name as-is at the end. */ squery->trying_as_is = 1; ares_query(channel, squery->name, squery->dnsclass, squery->type, search_callback, squery); } else { if (squery->status_as_is == ARES_ENOTFOUND && squery->ever_got_nodata) { end_squery(squery, ARES_ENODATA, NULL, 0); } else end_squery(squery, squery->status_as_is, NULL, 0); } } } static void end_squery(struct search_query *squery, int status, unsigned char *abuf, int alen) { squery->callback(squery->arg, status, squery->timeouts, abuf, alen); ares_free(squery->name); ares_free(squery); } /* Concatenate two domains. */ int ares__cat_domain(const char *name, const char *domain, char **s) { size_t nlen = strlen(name); size_t dlen = strlen(domain); *s = ares_malloc(nlen + 1 + dlen + 1); if (!*s) return ARES_ENOMEM; memcpy(*s, name, nlen); (*s)[nlen] = '.'; memcpy(*s + nlen + 1, domain, dlen); (*s)[nlen + 1 + dlen] = 0; return ARES_SUCCESS; } /* Determine if this name only yields one query. If it does, set *s to * the string we should query, in an allocated buffer. If not, set *s * to NULL. */ int ares__single_domain(ares_channel channel, const char *name, char **s) { size_t len = strlen(name); const char *hostaliases; FILE *fp; char *line = NULL; int status; size_t linesize; const char *p, *q; int error; /* If the name contains a trailing dot, then the single query is the name * sans the trailing dot. */ if ((len > 0) && (name[len - 1] == '.')) { *s = ares_strdup(name); return (*s) ? ARES_SUCCESS : ARES_ENOMEM; } if (!(channel->flags & ARES_FLAG_NOALIASES) && !strchr(name, '.')) { /* The name might be a host alias. */ hostaliases = getenv("HOSTALIASES"); if (hostaliases) { fp = fopen(hostaliases, "r"); if (fp) { while ((status = ares__read_line(fp, &line, &linesize)) == ARES_SUCCESS) { if (strncasecmp(line, name, len) != 0 || !ISSPACE(line[len])) continue; p = line + len; while (ISSPACE(*p)) p++; if (*p) { q = p + 1; while (*q && !ISSPACE(*q)) q++; *s = ares_malloc(q - p + 1); if (*s) { memcpy(*s, p, q - p); (*s)[q - p] = 0; } ares_free(line); fclose(fp); return (*s) ? ARES_SUCCESS : ARES_ENOMEM; } } ares_free(line); fclose(fp); if (status != ARES_SUCCESS && status != ARES_EOF) return status; } else { error = ERRNO; switch(error) { case ENOENT: case ESRCH: break; default: DEBUGF(fprintf(stderr, "fopen() failed with error: %d %s\n", error, strerror(error))); DEBUGF(fprintf(stderr, "Error opening file: %s\n", hostaliases)); *s = NULL; return ARES_EFILE; } } } } if (channel->flags & ARES_FLAG_NOSEARCH || channel->ndomains == 0) { /* No domain search to do; just try the name as-is. */ *s = ares_strdup(name); return (*s) ? ARES_SUCCESS : ARES_ENOMEM; } *s = NULL; return ARES_SUCCESS; } ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares_send.c0000644000175100001770000000767300000000000021561 0ustar00runnerdocker00000000000000 /* Copyright 1998 by the Massachusetts Institute of Technology. * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ #include "ares_setup.h" #ifdef HAVE_NETINET_IN_H # include #endif #include "ares_nameser.h" #include "ares.h" #include "ares_dns.h" #include "ares_private.h" void ares_send(ares_channel channel, const unsigned char *qbuf, int qlen, ares_callback callback, void *arg) { struct query *query; int i, packetsz; struct timeval now; /* Verify that the query is at least long enough to hold the header. */ if (qlen < HFIXEDSZ || qlen >= (1 << 16)) { callback(arg, ARES_EBADQUERY, 0, NULL, 0); return; } /* Allocate space for query and allocated fields. */ query = ares_malloc(sizeof(struct query)); if (!query) { callback(arg, ARES_ENOMEM, 0, NULL, 0); return; } query->tcpbuf = ares_malloc(qlen + 2); if (!query->tcpbuf) { ares_free(query); callback(arg, ARES_ENOMEM, 0, NULL, 0); return; } if (channel->nservers < 1) { ares_free(query); callback(arg, ARES_ESERVFAIL, 0, NULL, 0); return; } query->server_info = ares_malloc(channel->nservers * sizeof(query->server_info[0])); if (!query->server_info) { ares_free(query->tcpbuf); ares_free(query); callback(arg, ARES_ENOMEM, 0, NULL, 0); return; } /* Compute the query ID. Start with no timeout. */ query->qid = DNS_HEADER_QID(qbuf); query->timeout.tv_sec = 0; query->timeout.tv_usec = 0; /* Form the TCP query buffer by prepending qlen (as two * network-order bytes) to qbuf. */ query->tcpbuf[0] = (unsigned char)((qlen >> 8) & 0xff); query->tcpbuf[1] = (unsigned char)(qlen & 0xff); memcpy(query->tcpbuf + 2, qbuf, qlen); query->tcplen = qlen + 2; /* Fill in query arguments. */ query->qbuf = query->tcpbuf + 2; query->qlen = qlen; query->callback = callback; query->arg = arg; /* Initialize query status. */ query->try_count = 0; /* Choose the server to send the query to. If rotation is enabled, keep track * of the next server we want to use. */ query->server = channel->last_server; if (channel->rotate == 1) channel->last_server = (channel->last_server + 1) % channel->nservers; for (i = 0; i < channel->nservers; i++) { query->server_info[i].skip_server = 0; query->server_info[i].tcp_connection_generation = 0; } packetsz = (channel->flags & ARES_FLAG_EDNS) ? channel->ednspsz : PACKETSZ; query->using_tcp = (channel->flags & ARES_FLAG_USEVC) || qlen > packetsz; query->error_status = ARES_ECONNREFUSED; query->timeouts = 0; /* Initialize our list nodes. */ ares__init_list_node(&(query->queries_by_qid), query); ares__init_list_node(&(query->queries_by_timeout), query); ares__init_list_node(&(query->queries_to_server), query); ares__init_list_node(&(query->all_queries), query); /* Chain the query into the list of all queries. */ ares__insert_in_list(&(query->all_queries), &(channel->all_queries)); /* Keep track of queries bucketed by qid, so we can process DNS * responses quickly. */ ares__insert_in_list( &(query->queries_by_qid), &(channel->queries_by_qid[query->qid % ARES_QID_TABLE_SIZE])); /* Perform the first query action. */ now = ares__tvnow(); ares__send_query(channel, query, &now); } ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares_setup.h0000644000175100001770000001372500000000000021770 0ustar00runnerdocker00000000000000#ifndef HEADER_CARES_SETUP_H #define HEADER_CARES_SETUP_H /* Copyright (C) 2004 - 2012 by Daniel Stenberg et al * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose and without fee is hereby granted, provided * that the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. M.I.T. makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. */ /* * Define WIN32 when build target is Win32 API */ #if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32) #define WIN32 #endif /* * Include configuration script results or hand-crafted * configuration file for platforms which lack config tool. */ #ifdef HAVE_CONFIG_H #include "ares_config.h" #else #ifdef WIN32 #include "config-win32.h" #endif #endif /* HAVE_CONFIG_H */ /* ================================================================ */ /* Definition of preprocessor macros/symbols which modify compiler */ /* behaviour or generated code characteristics must be done here, */ /* as appropriate, before any system header file is included. It is */ /* also possible to have them defined in the config file included */ /* before this point. As a result of all this we frown inclusion of */ /* system header files in our config files, avoid this at any cost. */ /* ================================================================ */ /* * AIX 4.3 and newer needs _THREAD_SAFE defined to build * proper reentrant code. Others may also need it. */ #ifdef NEED_THREAD_SAFE # ifndef _THREAD_SAFE # define _THREAD_SAFE # endif #endif /* * Tru64 needs _REENTRANT set for a few function prototypes and * things to appear in the system header files. Unixware needs it * to build proper reentrant code. Others may also need it. */ #ifdef NEED_REENTRANT # ifndef _REENTRANT # define _REENTRANT # endif #endif /* ================================================================ */ /* If you need to include a system header file for your platform, */ /* please, do it beyond the point further indicated in this file. */ /* ================================================================ */ /* * c-ares external interface definitions are also used internally, * and might also include required system header files to define them. */ #include /* * Compile time sanity checks must also be done when building the library. */ #include /* ================================================================= */ /* No system header file shall be included in this file before this */ /* point. The only allowed ones are those included from ares_build.h */ /* ================================================================= */ /* * Include header files for windows builds before redefining anything. * Use this preproessor block only to include or exclude windows.h, * winsock2.h, ws2tcpip.h or winsock.h. Any other windows thing belongs * to any other further and independent block. Under Cygwin things work * just as under linux (e.g. ) and the winsock headers should * never be included when __CYGWIN__ is defined. configure script takes * care of this, not defining HAVE_WINDOWS_H, HAVE_WINSOCK_H, HAVE_WINSOCK2_H, * neither HAVE_WS2TCPIP_H when __CYGWIN__ is defined. */ #ifdef HAVE_WINDOWS_H # ifndef WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN # endif # include # ifdef HAVE_WINSOCK2_H # include # ifdef HAVE_WS2TCPIP_H # include # endif # else # ifdef HAVE_WINSOCK_H # include # endif # endif #endif /* * Define USE_WINSOCK to 2 if we have and use WINSOCK2 API, else * define USE_WINSOCK to 1 if we have and use WINSOCK API, else * undefine USE_WINSOCK. */ #undef USE_WINSOCK #ifdef HAVE_WINSOCK2_H # define USE_WINSOCK 2 #else # ifdef HAVE_WINSOCK_H # define USE_WINSOCK 1 # endif #endif /* * Work-arounds for systems without configure support */ #ifndef HAVE_CONFIG_H #if !defined(HAVE_SYS_TIME_H) && !defined(_MSC_VER) && !defined(__WATCOMC__) #define HAVE_SYS_TIME_H #endif #if !defined(HAVE_UNISTD_H) && !defined(_MSC_VER) #define HAVE_UNISTD_H 1 #endif #if !defined(HAVE_SYS_UIO_H) && !defined(WIN32) && !defined(MSDOS) #define HAVE_SYS_UIO_H #endif #endif /* HAVE_CONFIG_H */ /* * Arg 2 type for gethostname in case it hasn't been defined in config file. */ #ifndef GETHOSTNAME_TYPE_ARG2 # ifdef USE_WINSOCK # define GETHOSTNAME_TYPE_ARG2 int # else # define GETHOSTNAME_TYPE_ARG2 size_t # endif #endif #ifdef __POCC__ # include # include # define ESRCH 3 #endif /* * Android does have the arpa/nameser.h header which is detected by configure * but it appears to be empty with recent NDK r7b / r7c, so we undefine here. * z/OS does have the arpa/nameser.h header which is detected by configure * but it is not fully implemented and missing identifiers, so udefine here. */ #if (defined(ANDROID) || defined(__ANDROID__) || defined(__MVS__)) && \ defined(HAVE_ARPA_NAMESER_H) # undef HAVE_ARPA_NAMESER_H #endif /* * Recent autoconf versions define these symbols in ares_config.h. We don't * want them (since they collide with the libcurl ones when we build * --enable-debug) so we undef them again here. */ #undef PACKAGE_STRING #undef PACKAGE_TARNAME #undef PACKAGE_VERSION #undef PACKAGE_BUGREPORT #undef PACKAGE_NAME #undef VERSION #undef PACKAGE /* IPv6 compatibility */ #if !defined(HAVE_AF_INET6) #if defined(HAVE_PF_INET6) #define AF_INET6 PF_INET6 #else #define AF_INET6 AF_MAX+1 #endif #endif /* * Include macros and defines that should only be processed once. */ #ifndef __SETUP_ONCE_H #include "setup_once.h" #endif #endif /* HEADER_CARES_SETUP_H */ ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares_strcasecmp.c0000644000175100001770000000315000000000000022756 0ustar00runnerdocker00000000000000 /* Copyright 1998 by the Massachusetts Institute of Technology. * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ #include "ares_setup.h" #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 = ISUPPER(a[i]) ? tolower(a[i]) : a[i]; int c2 = ISUPPER(b[i]) ? tolower(b[i]) : b[i]; if (c1 != c2) return c1-c2; if (!c1) break; } return 0; #endif } #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; for (i = 0; i < n; i++) { int c1 = ISUPPER(a[i]) ? tolower(a[i]) : a[i]; int c2 = ISUPPER(b[i]) ? tolower(b[i]) : b[i]; if (c1 != c2) return c1-c2; if (!c1) break; } return 0; #endif } #endif ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares_strcasecmp.h0000644000175100001770000000200700000000000022763 0ustar00runnerdocker00000000000000#ifndef HEADER_CARES_STRCASECMP_H #define HEADER_CARES_STRCASECMP_H /* Copyright 1998 by the Massachusetts Institute of Technology. * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ #include "ares_setup.h" #ifndef HAVE_STRCASECMP extern int ares_strcasecmp(const char *a, const char *b); #endif #ifndef HAVE_STRNCASECMP extern int ares_strncasecmp(const char *a, const char *b, size_t n); #endif #endif /* HEADER_CARES_STRCASECMP_H */ ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares_strdup.c0000644000175100001770000000213300000000000022133 0ustar00runnerdocker00000000000000 /* Copyright 1998 by the Massachusetts Institute of Technology. * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ #include "ares_setup.h" #include "ares_strdup.h" #include "ares.h" #include "ares_private.h" char *ares_strdup(const char *s1) { size_t sz; char * s2; if(s1) { sz = strlen(s1); if(sz < (size_t)-1) { sz++; if(sz < ((size_t)-1)) { s2 = ares_malloc(sz); if(s2) { memcpy(s2, s1, sz); return s2; } } } } return (char *)NULL; } ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares_strdup.h0000644000175100001770000000154600000000000022147 0ustar00runnerdocker00000000000000#ifndef HEADER_CARES_STRDUP_H #define HEADER_CARES_STRDUP_H /* Copyright 1998 by the Massachusetts Institute of Technology. * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ #include "ares_setup.h" extern char *ares_strdup(const char *s1); #endif /* HEADER_CARES_STRDUP_H */ ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares_strerror.c0000644000175100001770000000355300000000000022503 0ustar00runnerdocker00000000000000 /* Copyright 1998 by the Massachusetts Institute of Technology. * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ #include "ares_setup.h" #include #include "ares.h" const char *ares_strerror(int code) { /* Return a string literal from a table. */ const char *errtext[] = { "Successful completion", "DNS server returned answer with no data", "DNS server claims query was misformatted", "DNS server returned general failure", "Domain name not found", "DNS server does not implement requested operation", "DNS server refused query", "Misformatted DNS query", "Misformatted domain name", "Unsupported address family", "Misformatted DNS reply", "Could not contact DNS servers", "Timeout while contacting DNS servers", "End of file", "Error reading file", "Out of memory", "Channel is being destroyed", "Misformatted string", "Illegal flags specified", "Given hostname is not numeric", "Illegal hints flags specified", "c-ares library initialization not yet performed", "Error loading iphlpapi.dll", "Could not find GetNetworkParams function", "DNS query cancelled" }; if(code >= 0 && code < (int)(sizeof(errtext) / sizeof(*errtext))) return errtext[code]; else return "unknown"; } ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares_strsplit.c0000644000175100001770000000707600000000000022511 0ustar00runnerdocker00000000000000/* Copyright (C) 2018 by John Schember * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ #if defined(__MVS__) #include #endif #include "ares_setup.h" #include "ares_strsplit.h" #include "ares.h" #include "ares_private.h" static int list_contains(char * const *list, size_t num_elem, const char *str, int insensitive) { size_t len; size_t i; len = strlen(str); for (i=0; i * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ #include "ares_setup.h" /* Split a string on delem skipping empty elements. * * param in String to split. * param delims String of characters to treat as a delimitor. * Each character in the string is a delimitor so * there can be multiple delimitors to split on. * E.g. ", " will split on all comma's and spaces. * param make_set Have the list be a Set where there are no * duplicate entries. 1 for true, 0 or false. * param num_elm Return parameter of the number of elements * in the result array. * * returns an allocated array of allocated string elements. * */ char **ares_strsplit(const char *in, const char *delms, int make_set, size_t *num_elm); /* Frees the result returned from ares_strsplit(). */ void ares_strsplit_free(char **elms, size_t num_elm); #endif /* HEADER_CARES_STRSPLIT_H */ ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares_timeout.c0000644000175100001770000000527000000000000022305 0ustar00runnerdocker00000000000000 /* Copyright 1998 by the Massachusetts Institute of Technology. * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ #include "ares_setup.h" #ifdef HAVE_LIMITS_H #include #endif #include "ares.h" #include "ares_private.h" /* return time offset between now and (future) check, in milliseconds */ static long timeoffset(struct timeval *now, struct timeval *check) { return (check->tv_sec - now->tv_sec)*1000 + (check->tv_usec - now->tv_usec)/1000; } /* WARNING: Beware that this is linear in the number of outstanding * requests! You are probably far better off just calling ares_process() * once per second, rather than calling ares_timeout() to figure out * when to next call ares_process(). */ struct timeval *ares_timeout(ares_channel channel, struct timeval *maxtv, struct timeval *tvbuf) { struct query *query; struct list_node* list_head; struct list_node* list_node; struct timeval now; struct timeval nextstop; long offset, min_offset; /* No queries, no timeout (and no fetch of the current time). */ if (ares__is_list_empty(&(channel->all_queries))) return maxtv; /* Find the minimum timeout for the current set of queries. */ now = ares__tvnow(); min_offset = -1; list_head = &(channel->all_queries); for (list_node = list_head->next; list_node != list_head; list_node = list_node->next) { query = list_node->data; if (query->timeout.tv_sec == 0) continue; offset = timeoffset(&now, &query->timeout); if (offset < 0) offset = 0; if (min_offset == -1 || offset < min_offset) min_offset = offset; } /* If we found a minimum timeout and it's sooner than the one specified in * maxtv (if any), return it. Otherwise go with maxtv. */ if (min_offset != -1) { int ioffset = (min_offset > (long)INT_MAX) ? INT_MAX : (int)min_offset; nextstop.tv_sec = ioffset/1000; nextstop.tv_usec = (ioffset%1000)*1000; if (!maxtv || ares__timedout(maxtv, &nextstop)) { *tvbuf = nextstop; return tvbuf; } } return maxtv; } ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares_version.c0000644000175100001770000000023600000000000022301 0ustar00runnerdocker00000000000000 #include "ares_setup.h" #include "ares.h" const char *ares_version(int *version) { if(version) *version = ARES_VERSION; return ARES_VERSION_STR; } ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares_writev.c0000644000175100001770000000340700000000000022137 0ustar00runnerdocker00000000000000 /* Copyright 1998 by the Massachusetts Institute of Technology. * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ #include "ares_setup.h" #ifdef HAVE_LIMITS_H # include #endif #include "ares.h" #include "ares_private.h" #ifndef HAVE_WRITEV ares_ssize_t ares_writev(ares_socket_t s, const struct iovec *iov, int iovcnt) { char *buffer, *bp; int i; size_t bytes = 0; ares_ssize_t result; /* Validate iovcnt */ if (iovcnt <= 0) { SET_ERRNO(EINVAL); return (-1); } /* Validate and find the sum of the iov_len values in the iov array */ for (i = 0; i < iovcnt; i++) { if (iov[i].iov_len > INT_MAX - bytes) { SET_ERRNO(EINVAL); return (-1); } bytes += iov[i].iov_len; } if (bytes == 0) return (0); /* Allocate a temporary buffer to hold the data */ buffer = ares_malloc(bytes); if (!buffer) { SET_ERRNO(ENOMEM); return (-1); } /* Copy the data into buffer */ for (bp = buffer, i = 0; i < iovcnt; ++i) { memcpy (bp, iov[i].iov_base, iov[i].iov_len); bp += iov[i].iov_len; } /* Send buffer contents */ result = swrite(s, buffer, bytes); ares_free(buffer); return (result); } #endif ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/ares_writev.h0000644000175100001770000000212100000000000022134 0ustar00runnerdocker00000000000000#ifndef HEADER_CARES_WRITEV_H #define HEADER_CARES_WRITEV_H /* Copyright 1998 by the Massachusetts Institute of Technology. * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ #include "ares_setup.h" #include "ares.h" #ifndef HAVE_WRITEV /* Structure for scatter/gather I/O. */ struct iovec { void *iov_base; /* Pointer to data. */ size_t iov_len; /* Length of data. */ }; extern ares_ssize_t ares_writev(ares_socket_t s, const struct iovec *iov, int iovcnt); #endif #endif /* HEADER_CARES_WRITEV_H */ ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/bitncmp.c0000644000175100001770000000314000000000000021233 0ustar00runnerdocker00000000000000 /* * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") * Copyright (c) 1996,1999 by Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #ifndef HAVE_BITNCMP #include "ares_setup.h" #include "bitncmp.h" /* * int * bitncmp(l, r, n) * compare bit masks l and r, for n bits. * return: * <0, >0, or 0 in the libc tradition. * note: * network byte order assumed. this means 192.5.5.240/28 has * 0x11110000 in its fourth octet. * author: * Paul Vixie (ISC), June 1996 */ int ares__bitncmp(const void *l, const void *r, int n) { unsigned int lb, rb; int x, b; b = n / 8; x = memcmp(l, r, b); if (x || (n % 8) == 0) return (x); lb = ((const unsigned char *)l)[b]; rb = ((const unsigned char *)r)[b]; for (b = n % 8; b > 0; b--) { if ((lb & 0x80) != (rb & 0x80)) { if (lb & 0x80) return (1); return (-1); } lb <<= 1; rb <<= 1; } return (0); } #endif ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/bitncmp.h0000644000175100001770000000161100000000000021241 0ustar00runnerdocker00000000000000#ifndef __ARES_BITNCMP_H #define __ARES_BITNCMP_H /* Copyright (C) 2005, 2013 by Dominick Meglio * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ #ifndef HAVE_BITNCMP int ares__bitncmp(const void *l, const void *r, int n); #else #define ares__bitncmp(x,y,z) bitncmp(x,y,z) #endif #endif /* __ARES_BITNCMP_H */ ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/cares.rc0000644000175100001770000000400700000000000021061 0ustar00runnerdocker00000000000000 /* Copyright (C) 2009-2021 by Daniel Stenberg * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ #include #include "../../include/ares_version.h" LANGUAGE 0x09,0x01 #define RC_VERSION ARES_VERSION_MAJOR, ARES_VERSION_MINOR, ARES_VERSION_PATCH, 0 VS_VERSION_INFO VERSIONINFO FILEVERSION RC_VERSION PRODUCTVERSION RC_VERSION FILEFLAGSMASK 0x3fL #if defined(DEBUGBUILD) || defined(_DEBUG) FILEFLAGS 1 #else FILEFLAGS 0 #endif FILEOS VOS__WINDOWS32 FILETYPE VFT_DLL FILESUBTYPE 0x0L BEGIN BLOCK "StringFileInfo" BEGIN BLOCK "040904b0" BEGIN VALUE "CompanyName", "The c-ares library, https://c-ares.org/\0" #if defined(DEBUGBUILD) || defined(_DEBUG) VALUE "FileDescription", "c-ares Debug Shared Library\0" VALUE "FileVersion", ARES_VERSION_STR "\0" VALUE "InternalName", "c-ares\0" VALUE "OriginalFilename", "caresd.dll\0" #else VALUE "FileDescription", "c-ares Shared Library\0" VALUE "FileVersion", ARES_VERSION_STR "\0" VALUE "InternalName", "c-ares\0" VALUE "OriginalFilename", "cares.dll\0" #endif VALUE "ProductName", "The c-ares library\0" VALUE "ProductVersion", ARES_VERSION_STR "\0" VALUE "LegalCopyright", " " ARES_COPYRIGHT "\0" VALUE "License", "https://c-ares.org/license.html\0" END END BLOCK "VarFileInfo" BEGIN VALUE "Translation", 0x409, 1200 END END ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/config-dos.h0000644000175100001770000000644700000000000021651 0ustar00runnerdocker00000000000000#ifndef HEADER_CONFIG_DOS_H #define HEADER_CONFIG_DOS_H /* ================================================================ */ /* ares/config-dos.h - Hand crafted config file for DOS */ /* ================================================================ */ #define PACKAGE "c-ares" #define HAVE_ERRNO_H 1 #define HAVE_GETENV 1 #define HAVE_GETTIMEOFDAY 1 #define HAVE_IOCTLSOCKET 1 #define HAVE_IOCTLSOCKET_FIONBIO 1 #define HAVE_LIMITS_H 1 #define HAVE_NET_IF_H 1 #define HAVE_RECV 1 #define HAVE_RECVFROM 1 #define HAVE_SEND 1 #define HAVE_STRDUP 1 #define HAVE_STRICMP 1 #define HAVE_STRUCT_IN6_ADDR 1 #define HAVE_STRUCT_TIMEVAL 1 #define HAVE_SYS_IOCTL_H 1 #define HAVE_SYS_SOCKET_H 1 #define HAVE_SYS_STAT_H 1 #define HAVE_SYS_TYPES_H 1 #define HAVE_TIME_H 1 #define HAVE_UNISTD_H 1 #define HAVE_WRITEV 1 #define NEED_MALLOC_H 1 #define RETSIGTYPE void #define TIME_WITH_SYS_TIME 1 /* Qualifiers for send(), recv(), recvfrom() and getnameinfo(). */ #define SEND_TYPE_ARG1 int #define SEND_QUAL_ARG2 const #define SEND_TYPE_ARG2 void * #define SEND_TYPE_ARG3 int #define SEND_TYPE_ARG4 int #define SEND_TYPE_RETV int #define RECV_TYPE_ARG1 int #define RECV_TYPE_ARG2 void * #define RECV_TYPE_ARG3 int #define RECV_TYPE_ARG4 int #define RECV_TYPE_RETV int #define RECVFROM_TYPE_ARG1 int #define RECVFROM_TYPE_ARG2 void #define RECVFROM_TYPE_ARG3 int #define RECVFROM_TYPE_ARG4 int #define RECVFROM_TYPE_ARG5 struct sockaddr #define RECVFROM_TYPE_ARG6 int #define RECVFROM_TYPE_RETV int #define RECVFROM_TYPE_ARG2_IS_VOID 1 #define BSD /* Target HAVE_x section */ #if defined(DJGPP) #undef _SSIZE_T #include /* For 'ssize_t' */ #define HAVE_STRCASECMP 1 #define HAVE_STRNCASECMP 1 #define HAVE_SYS_TIME_H 1 #define HAVE_VARIADIC_MACROS_GCC 1 /* Because djgpp <= 2.03 doesn't have snprintf() etc. */ #if (DJGPP_MINOR < 4) #define _MPRINTF_REPLACE #endif #elif defined(__WATCOMC__) #define HAVE_STRCASECMP 1 #elif defined(__HIGHC__) #define HAVE_SYS_TIME_H 1 #define strerror(e) strerror_s_((e)) #endif #ifdef WATT32 #define HAVE_AF_INET6 1 #define HAVE_ARPA_INET_H 1 #define HAVE_ARPA_NAMESER_H 1 #define HAVE_CLOSE_S 1 #define HAVE_GETHOSTNAME 1 #define HAVE_NETDB_H 1 #define HAVE_NETINET_IN_H 1 #define HAVE_NETINET_TCP_H 1 #define HAVE_PF_INET6 1 #define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1 #define HAVE_STRUCT_ADDRINFO 1 #define HAVE_STRUCT_IN6_ADDR 1 #define HAVE_STRUCT_SOCKADDR_IN6 1 #define HAVE_SYS_SOCKET_H 1 #define HAVE_SYS_UIO_H 1 #define NS_INADDRSZ 4 #define HAVE_STRUCT_SOCKADDR_IN6 1 #define HAVE_GETSERVBYPORT_R 1 #define GETSERVBYPORT_R_ARGS 5 #endif #undef word #undef byte #endif /* HEADER_CONFIG_DOS_H */ ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/config-win32.h0000644000175100001770000002515200000000000022020 0ustar00runnerdocker00000000000000#ifndef HEADER_CARES_CONFIG_WIN32_H #define HEADER_CARES_CONFIG_WIN32_H /* Copyright (C) 2004 - 2011 by Daniel Stenberg et al * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose and without fee is hereby granted, provided * that the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. M.I.T. makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. */ /* ================================================================ */ /* c-ares/config-win32.h - Hand crafted config file for Windows */ /* ================================================================ */ /* ---------------------------------------------------------------- */ /* HEADER FILES */ /* ---------------------------------------------------------------- */ /* Define if you have the header file. */ #define HAVE_ASSERT_H 1 /* Define if you have the header file. */ #define HAVE_ERRNO_H 1 /* Define if you have the header file. */ #if defined(__MINGW32__) || defined(__POCC__) #define HAVE_GETOPT_H 1 #endif /* Define if you have the header file. */ #define HAVE_LIMITS_H 1 /* Define if you have the header file. */ #ifndef __SALFORDC__ #define HAVE_PROCESS_H 1 #endif /* Define if you have the header file. */ #define HAVE_SIGNAL_H 1 /* Define if you have the header file */ /* #define HAVE_SYS_TIME_H 1 */ /* Define if you have the header file. */ #define HAVE_TIME_H 1 /* Define if you have the header file. */ #if defined(__MINGW32__) || defined(__WATCOMC__) || defined(__LCC__) || \ defined(__POCC__) #define HAVE_UNISTD_H 1 #endif /* Define if you have the header file. */ #define HAVE_WINDOWS_H 1 /* Define if you have the header file. */ #define HAVE_WINSOCK_H 1 /* Define if you have the header file. */ #ifndef __SALFORDC__ #define HAVE_WINSOCK2_H 1 #endif /* Define if you have the header file. */ #ifndef __SALFORDC__ #define HAVE_WS2TCPIP_H 1 #endif /* ---------------------------------------------------------------- */ /* OTHER HEADER INFO */ /* ---------------------------------------------------------------- */ /* Define if sig_atomic_t is an available typedef. */ #define HAVE_SIG_ATOMIC_T 1 /* Define if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* Define if you can safely include both and . */ /* #define TIME_WITH_SYS_TIME 1 */ /* ---------------------------------------------------------------- */ /* FUNCTIONS */ /* ---------------------------------------------------------------- */ /* Define if you have the closesocket function. */ #define HAVE_CLOSESOCKET 1 /* Define if you have the getenv function. */ #define HAVE_GETENV 1 /* Define if you have the gethostname function. */ #define HAVE_GETHOSTNAME 1 /* Define if you have the ioctlsocket function. */ #define HAVE_IOCTLSOCKET 1 /* Define if you have a working ioctlsocket FIONBIO function. */ #define HAVE_IOCTLSOCKET_FIONBIO 1 /* Define if you have the strcasecmp function. */ /* #define HAVE_STRCASECMP 1 */ /* Define if you have the strdup function. */ #define HAVE_STRDUP 1 /* Define if you have the stricmp function. */ #define HAVE_STRICMP 1 /* Define if you have the strncasecmp function. */ /* #define HAVE_STRNCASECMP 1 */ /* Define if you have the strnicmp function. */ #define HAVE_STRNICMP 1 /* Define if you have the recv function. */ #define HAVE_RECV 1 /* Define to the type of arg 1 for recv. */ #define RECV_TYPE_ARG1 SOCKET /* Define to the type of arg 2 for recv. */ #define RECV_TYPE_ARG2 char * /* Define to the type of arg 3 for recv. */ #define RECV_TYPE_ARG3 int /* Define to the type of arg 4 for recv. */ #define RECV_TYPE_ARG4 int /* Define to the function return type for recv. */ #define RECV_TYPE_RETV int /* Define if you have the recvfrom function. */ #define HAVE_RECVFROM 1 /* Define to the type of arg 1 for recvfrom. */ #define RECVFROM_TYPE_ARG1 SOCKET /* Define to the type pointed by arg 2 for recvfrom. */ #define RECVFROM_TYPE_ARG2 char /* Define to the type of arg 3 for recvfrom. */ #define RECVFROM_TYPE_ARG3 int /* Define to the type of arg 4 for recvfrom. */ #define RECVFROM_TYPE_ARG4 int /* Define to the type pointed by arg 5 for recvfrom. */ #define RECVFROM_TYPE_ARG5 struct sockaddr /* Define to the type pointed by arg 6 for recvfrom. */ #define RECVFROM_TYPE_ARG6 int /* Define to the function return type for recvfrom. */ #define RECVFROM_TYPE_RETV int /* Define if you have the send function. */ #define HAVE_SEND 1 /* Define to the type of arg 1 for send. */ #define SEND_TYPE_ARG1 SOCKET /* Define to the type qualifier of arg 2 for send. */ #define SEND_QUAL_ARG2 const /* Define to the type of arg 2 for send. */ #define SEND_TYPE_ARG2 char * /* Define to the type of arg 3 for send. */ #define SEND_TYPE_ARG3 int /* Define to the type of arg 4 for send. */ #define SEND_TYPE_ARG4 int /* Define to the function return type for send. */ #define SEND_TYPE_RETV int /* Specifics for the Watt-32 tcp/ip stack. */ #ifdef WATT32 #define SOCKET int #define NS_INADDRSZ 4 #define HAVE_ARPA_NAMESER_H 1 #define HAVE_ARPA_INET_H 1 #define HAVE_NETDB_H 1 #define HAVE_NETINET_IN_H 1 #define HAVE_SYS_SOCKET_H 1 #define HAVE_NETINET_TCP_H 1 #define HAVE_AF_INET6 1 #define HAVE_PF_INET6 1 #define HAVE_STRUCT_IN6_ADDR 1 #define HAVE_STRUCT_SOCKADDR_IN6 1 #undef HAVE_WINSOCK_H #undef HAVE_WINSOCK2_H #undef HAVE_WS2TCPIP_H #endif /* ---------------------------------------------------------------- */ /* TYPEDEF REPLACEMENTS */ /* ---------------------------------------------------------------- */ /* Define if in_addr_t is not an available 'typedefed' type. */ #define in_addr_t unsigned long /* Define to the return type of signal handlers (int or void). */ #define RETSIGTYPE void #ifdef __cplusplus /* Compiling headers in C++ mode means bool is available */ #define HAVE_BOOL_T #endif /* ---------------------------------------------------------------- */ /* TYPE SIZES */ /* ---------------------------------------------------------------- */ /* ---------------------------------------------------------------- */ /* STRUCT RELATED */ /* ---------------------------------------------------------------- */ /* Define if you have struct addrinfo. */ #define HAVE_STRUCT_ADDRINFO 1 /* Define if you have struct sockaddr_storage. */ #if !defined(__SALFORDC__) && !defined(__BORLANDC__) #define HAVE_STRUCT_SOCKADDR_STORAGE 1 #endif /* Define if you have struct timeval. */ #define HAVE_STRUCT_TIMEVAL 1 /* ---------------------------------------------------------------- */ /* COMPILER SPECIFIC */ /* ---------------------------------------------------------------- */ /* Define to avoid VS2005 complaining about portable C functions. */ #if defined(_MSC_VER) && (_MSC_VER >= 1400) # define _CRT_SECURE_NO_DEPRECATE 1 # define _CRT_NONSTDC_NO_DEPRECATE 1 #endif /* Set the Target to Vista. However, any symbols required above Win2000 * should be loaded via LoadLibrary() */ #if defined(_MSC_VER) && (_MSC_VER >= 1500) # define VS2008_MIN_TARGET 0x0600 #endif /* VS2008 default target settings and minimum build target check. */ #if defined(_MSC_VER) && (_MSC_VER >= 1500) # ifndef _WIN32_WINNT # define _WIN32_WINNT VS2008_MIN_TARGET # endif # ifndef WINVER # define WINVER VS2008_MIN_TARGET # endif # if (_WIN32_WINNT < VS2008_MIN_TARGET) || (WINVER < VS2008_MIN_TARGET) # error VS2008 does not support Windows build targets prior to Windows 2000 # endif #endif /* When no build target is specified Pelles C 5.00 and later default build target is Windows Vista. */ #if defined(__POCC__) && (__POCC__ >= 500) # ifndef _WIN32_WINNT # define _WIN32_WINNT 0x0600 # endif # ifndef WINVER # define WINVER 0x0600 # endif #endif /* Availability of freeaddrinfo, getaddrinfo and getnameinfo functions is quite convoluted, compiler dependent and even build target dependent. */ #if defined(HAVE_WS2TCPIP_H) # if defined(__POCC__) # define HAVE_FREEADDRINFO 1 # define HAVE_GETADDRINFO 1 # define HAVE_GETNAMEINFO 1 # elif defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0501) # define HAVE_FREEADDRINFO 1 # define HAVE_GETADDRINFO 1 # define HAVE_GETNAMEINFO 1 # elif defined(_MSC_VER) && (_MSC_VER >= 1200) # define HAVE_FREEADDRINFO 1 # define HAVE_GETADDRINFO 1 # define HAVE_GETNAMEINFO 1 # endif #endif #if defined(__POCC__) # ifndef _MSC_VER # error Microsoft extensions /Ze compiler option is required # endif # ifndef __POCC__OLDNAMES # error Compatibility names /Go compiler option is required # endif #endif /* ---------------------------------------------------------------- */ /* IPV6 COMPATIBILITY */ /* ---------------------------------------------------------------- */ /* Define if you have address family AF_INET6. */ #ifdef HAVE_WINSOCK2_H #define HAVE_AF_INET6 1 #endif /* Define if you have protocol family PF_INET6. */ #ifdef HAVE_WINSOCK2_H #define HAVE_PF_INET6 1 #endif /* Define if you have struct in6_addr. */ #ifdef HAVE_WS2TCPIP_H #define HAVE_STRUCT_IN6_ADDR 1 #endif /* Define if you have struct sockaddr_in6. */ #ifdef HAVE_WS2TCPIP_H #define HAVE_STRUCT_SOCKADDR_IN6 1 #endif /* Define if you have sockaddr_in6 with scopeid. */ #ifdef HAVE_WS2TCPIP_H #define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1 #endif /* ---------------------------------------------------------------- */ /* Win CE */ /* ---------------------------------------------------------------- */ /* FIXME: A proper config-win32ce.h should be created to hold these */ /* * System error codes for Windows CE */ #if defined(_WIN32_WCE) && !defined(HAVE_ERRNO_H) # define ENOENT ERROR_FILE_NOT_FOUND # define ESRCH ERROR_PATH_NOT_FOUND # define ENOMEM ERROR_NOT_ENOUGH_MEMORY # define ENOSPC ERROR_INVALID_PARAMETER #endif #endif /* HEADER_CARES_CONFIG_WIN32_H */ ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/inet_net_pton.c0000644000175100001770000002607200000000000022455 0ustar00runnerdocker00000000000000 /* * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") * Copyright (c) 1996,1999 by Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "ares_setup.h" #ifdef HAVE_NETINET_IN_H # include #endif #ifdef HAVE_ARPA_INET_H # include #endif #include "ares_nameser.h" #include "ares.h" #include "ares_ipv6.h" #include "ares_nowarn.h" #include "ares_inet_net_pton.h" const struct ares_in6_addr ares_in6addr_any = { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } }; #ifndef HAVE_INET_NET_PTON /* * static int * inet_net_pton_ipv4(src, dst, size) * convert IPv4 network number from presentation to network format. * accepts hex octets, hex strings, decimal octets, and /CIDR. * "size" is in bytes and describes "dst". * return: * number of bits, either imputed classfully or specified with /CIDR, * or -1 if some failure occurred (check errno). ENOENT means it was * not an IPv4 network specification. * note: * network byte order assumed. this means 192.5.5.240/28 has * 0b11110000 in its fourth octet. * note: * On Windows we store the error in the thread errno, not * in the winsock error code. This is to avoid loosing the * actual last winsock error. So use macro ERRNO to fetch the * errno this funtion sets when returning (-1), not SOCKERRNO. * author: * Paul Vixie (ISC), June 1996 */ static int inet_net_pton_ipv4(const char *src, unsigned char *dst, size_t size) { static const char xdigits[] = "0123456789abcdef"; static const char digits[] = "0123456789"; int n, ch, tmp = 0, dirty, bits; const unsigned char *odst = dst; ch = *src++; if (ch == '0' && (src[0] == 'x' || src[0] == 'X') && ISASCII(src[1]) && ISXDIGIT(src[1])) { /* Hexadecimal: Eat nybble string. */ if (!size) goto emsgsize; dirty = 0; src++; /* skip x or X. */ while ((ch = *src++) != '\0' && ISASCII(ch) && ISXDIGIT(ch)) { if (ISUPPER(ch)) ch = tolower(ch); n = aresx_sztosi(strchr(xdigits, ch) - xdigits); if (dirty == 0) tmp = n; else tmp = (tmp << 4) | n; if (++dirty == 2) { if (!size--) goto emsgsize; *dst++ = (unsigned char) tmp; dirty = 0; } } if (dirty) { /* Odd trailing nybble? */ if (!size--) goto emsgsize; *dst++ = (unsigned char) (tmp << 4); } } else if (ISASCII(ch) && ISDIGIT(ch)) { /* Decimal: eat dotted digit string. */ for (;;) { tmp = 0; do { n = aresx_sztosi(strchr(digits, ch) - digits); tmp *= 10; tmp += n; if (tmp > 255) goto enoent; } while ((ch = *src++) != '\0' && ISASCII(ch) && ISDIGIT(ch)); if (!size--) goto emsgsize; *dst++ = (unsigned char) tmp; if (ch == '\0' || ch == '/') break; if (ch != '.') goto enoent; ch = *src++; if (!ISASCII(ch) || !ISDIGIT(ch)) goto enoent; } } else goto enoent; bits = -1; if (ch == '/' && ISASCII(src[0]) && ISDIGIT(src[0]) && dst > odst) { /* CIDR width specifier. Nothing can follow it. */ ch = *src++; /* Skip over the /. */ bits = 0; do { n = aresx_sztosi(strchr(digits, ch) - digits); bits *= 10; bits += n; if (bits > 32) goto enoent; } while ((ch = *src++) != '\0' && ISASCII(ch) && ISDIGIT(ch)); if (ch != '\0') goto enoent; } /* Firey death and destruction unless we prefetched EOS. */ if (ch != '\0') goto enoent; /* If nothing was written to the destination, we found no address. */ if (dst == odst) goto enoent; /* LCOV_EXCL_LINE: all valid paths above increment dst */ /* If no CIDR spec was given, infer width from net class. */ if (bits == -1) { if (*odst >= 240) /* Class E */ bits = 32; else if (*odst >= 224) /* Class D */ bits = 8; else if (*odst >= 192) /* Class C */ bits = 24; else if (*odst >= 128) /* Class B */ bits = 16; else /* Class A */ bits = 8; /* If imputed mask is narrower than specified octets, widen. */ if (bits < ((dst - odst) * 8)) bits = aresx_sztosi(dst - odst) * 8; /* * If there are no additional bits specified for a class D * address adjust bits to 4. */ if (bits == 8 && *odst == 224) bits = 4; } /* Extend network to cover the actual mask. */ while (bits > ((dst - odst) * 8)) { if (!size--) goto emsgsize; *dst++ = '\0'; } return (bits); enoent: SET_ERRNO(ENOENT); return (-1); emsgsize: SET_ERRNO(EMSGSIZE); return (-1); } static int getbits(const char *src, int *bitsp) { static const char digits[] = "0123456789"; int n; int val; char ch; val = 0; n = 0; while ((ch = *src++) != '\0') { const char *pch; pch = strchr(digits, ch); if (pch != NULL) { if (n++ != 0 && val == 0) /* no leading zeros */ return (0); val *= 10; val += aresx_sztosi(pch - digits); if (val > 128) /* range */ return (0); continue; } return (0); } if (n == 0) return (0); *bitsp = val; return (1); } static int getv4(const char *src, unsigned char *dst, int *bitsp) { static const char digits[] = "0123456789"; unsigned char *odst = dst; int n; unsigned int val; char ch; val = 0; n = 0; while ((ch = *src++) != '\0') { const char *pch; pch = strchr(digits, ch); if (pch != NULL) { if (n++ != 0 && val == 0) /* no leading zeros */ return (0); val *= 10; val += aresx_sztoui(pch - digits); if (val > 255) /* range */ return (0); continue; } if (ch == '.' || ch == '/') { if (dst - odst > 3) /* too many octets? */ return (0); *dst++ = (unsigned char)val; if (ch == '/') return (getbits(src, bitsp)); val = 0; n = 0; continue; } return (0); } if (n == 0) return (0); if (dst - odst > 3) /* too many octets? */ return (0); *dst = (unsigned char)val; return 1; } static int inet_net_pton_ipv6(const char *src, unsigned char *dst, size_t size) { static const char xdigits_l[] = "0123456789abcdef", xdigits_u[] = "0123456789ABCDEF"; unsigned char tmp[NS_IN6ADDRSZ], *tp, *endp, *colonp; const char *xdigits, *curtok; int ch, saw_xdigit; unsigned int val; int digits; int bits; size_t bytes; int words; int ipv4; memset((tp = tmp), '\0', NS_IN6ADDRSZ); endp = tp + NS_IN6ADDRSZ; colonp = NULL; /* Leading :: requires some special handling. */ if (*src == ':') if (*++src != ':') goto enoent; curtok = src; saw_xdigit = 0; val = 0; digits = 0; bits = -1; ipv4 = 0; while ((ch = *src++) != '\0') { const char *pch; if ((pch = strchr((xdigits = xdigits_l), ch)) == NULL) pch = strchr((xdigits = xdigits_u), ch); if (pch != NULL) { val <<= 4; val |= aresx_sztoui(pch - xdigits); if (++digits > 4) goto enoent; saw_xdigit = 1; continue; } if (ch == ':') { curtok = src; if (!saw_xdigit) { if (colonp) goto enoent; colonp = tp; continue; } else if (*src == '\0') goto enoent; if (tp + NS_INT16SZ > endp) return (0); *tp++ = (unsigned char)((val >> 8) & 0xff); *tp++ = (unsigned char)(val & 0xff); saw_xdigit = 0; digits = 0; val = 0; continue; } if (ch == '.' && ((tp + NS_INADDRSZ) <= endp) && getv4(curtok, tp, &bits) > 0) { tp += NS_INADDRSZ; saw_xdigit = 0; ipv4 = 1; break; /* '\0' was seen by inet_pton4(). */ } if (ch == '/' && getbits(src, &bits) > 0) break; goto enoent; } if (saw_xdigit) { if (tp + NS_INT16SZ > endp) goto enoent; *tp++ = (unsigned char)((val >> 8) & 0xff); *tp++ = (unsigned char)(val & 0xff); } if (bits == -1) bits = 128; words = (bits + 15) / 16; if (words < 2) words = 2; if (ipv4) words = 8; endp = tmp + 2 * words; if (colonp != NULL) { /* * Since some memmove()'s erroneously fail to handle * overlapping regions, we'll do the shift by hand. */ const ares_ssize_t n = tp - colonp; ares_ssize_t i; if (tp == endp) goto enoent; for (i = 1; i <= n; i++) { *(endp - i) = *(colonp + n - i); *(colonp + n - i) = 0; } tp = endp; } if (tp != endp) goto enoent; bytes = (bits + 7) / 8; if (bytes > size) goto emsgsize; memcpy(dst, tmp, bytes); return (bits); enoent: SET_ERRNO(ENOENT); return (-1); emsgsize: SET_ERRNO(EMSGSIZE); return (-1); } /* * int * inet_net_pton(af, src, dst, size) * convert network number from presentation to network format. * accepts hex octets, hex strings, decimal octets, and /CIDR. * "size" is in bytes and describes "dst". * return: * 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 loosing the * actual last winsock error. So use macro ERRNO to fetch the * errno this funtion 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) { switch (af) { case AF_INET: return (inet_net_pton_ipv4(src, dst, size)); case AF_INET6: return (inet_net_pton_ipv6(src, dst, size)); default: SET_ERRNO(EAFNOSUPPORT); return (-1); } } #endif /* HAVE_INET_NET_PTON */ #ifndef HAVE_INET_PTON int ares_inet_pton(int af, const char *src, void *dst) { int result; size_t size; if (af == AF_INET) size = sizeof(struct in_addr); else if (af == AF_INET6) size = sizeof(struct ares_in6_addr); else { SET_ERRNO(EAFNOSUPPORT); return -1; } result = ares_inet_net_pton(af, src, dst, size); if (result == -1 && ERRNO == ENOENT) return 0; return (result > -1 ? 1 : -1); } #else /* HAVE_INET_PTON */ int ares_inet_pton(int af, const char *src, void *dst) { /* just relay this to the underlying function */ return inet_pton(af, src, dst); } #endif ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/inet_ntop.c0000644000175100001770000001316200000000000021603 0ustar00runnerdocker00000000000000/* * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") * Copyright (c) 1996-1999 by Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "ares_setup.h" #ifdef HAVE_NETINET_IN_H # include #endif #ifdef HAVE_ARPA_INET_H # include #endif #include "ares_nameser.h" #include "ares.h" #include "ares_ipv6.h" #ifndef HAVE_INET_NTOP /* * 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. */ static const char *inet_ntop4(const unsigned char *src, char *dst, size_t size); static const char *inet_ntop6(const unsigned char *src, char *dst, size_t size); /* char * * inet_ntop(af, src, dst, 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 loosing 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. */ const char * ares_inet_ntop(int af, const void *src, char *dst, ares_socklen_t size) { switch (af) { case AF_INET: return (inet_ntop4(src, dst, (size_t)size)); case AF_INET6: return (inet_ntop6(src, dst, (size_t)size)); default: SET_ERRNO(EAFNOSUPPORT); return (NULL); } /* NOTREACHED */ } /* const char * * inet_ntop4(src, dst, size) * format an IPv4 address * return: * `dst' (as a const) * notes: * (1) uses no statics * (2) takes a unsigned char* not an in_addr as input * author: * Paul Vixie, 1996. */ static const char * inet_ntop4(const unsigned char *src, char *dst, size_t size) { static const char fmt[] = "%u.%u.%u.%u"; char tmp[sizeof("255.255.255.255")]; if ((size_t)sprintf(tmp, fmt, src[0], src[1], src[2], src[3]) >= size) { SET_ERRNO(ENOSPC); return (NULL); } strcpy(dst, tmp); return (dst); } /* const char * * inet_ntop6(src, dst, size) * convert IPv6 binary address into presentation (printable) format * author: * Paul Vixie, 1996. */ static const char * inet_ntop6(const unsigned char *src, char *dst, size_t size) { /* * Note that int32_t and int16_t need only be "at least" large enough * to contain a value of the specified size. On some systems, like * Crays, there is no such thing as an integer variable with 16 bits. * Keep this in mind if you think this function should have been coded * to use pointer overlays. All the world's not a VAX. */ char tmp[sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")]; char *tp; struct { int base, len; } best, cur; unsigned int words[NS_IN6ADDRSZ / NS_INT16SZ]; int i; /* * Preprocess: * Copy the input (bytewise) array into a wordwise array. * Find the longest run of 0x00's in src[] for :: shorthanding. */ memset(words, '\0', sizeof(words)); for (i = 0; i < NS_IN6ADDRSZ; i++) words[i / 2] |= (src[i] << ((1 - (i % 2)) << 3)); best.base = -1; best.len = 0; cur.base = -1; cur.len = 0; for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) { if (words[i] == 0) { if (cur.base == -1) cur.base = i, cur.len = 1; else cur.len++; } else { if (cur.base != -1) { if (best.base == -1 || cur.len > best.len) best = cur; cur.base = -1; } } } if (cur.base != -1) { if (best.base == -1 || cur.len > best.len) best = cur; } if (best.base != -1 && best.len < 2) best.base = -1; /* * Format the result. */ tp = tmp; for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) { /* Are we inside the best run of 0x00's? */ if (best.base != -1 && i >= best.base && i < (best.base + best.len)) { if (i == best.base) *tp++ = ':'; continue; } /* Are we following an initial run of 0x00s or any real hex? */ if (i != 0) *tp++ = ':'; /* Is this address an encapsulated IPv4? */ if (i == 6 && best.base == 0 && (best.len == 6 || (best.len == 7 && words[7] != 0x0001) || (best.len == 5 && words[5] == 0xffff))) { if (!inet_ntop4(src+12, tp, sizeof(tmp) - (tp - tmp))) return (NULL); tp += strlen(tp); break; } tp += sprintf(tp, "%x", words[i]); } /* Was it a trailing run of 0x00's? */ if (best.base != -1 && (best.base + best.len) == (NS_IN6ADDRSZ / NS_INT16SZ)) *tp++ = ':'; *tp++ = '\0'; /* * Check for overflow, copy, and we're done. */ if ((size_t)(tp - tmp) > size) { SET_ERRNO(ENOSPC); return (NULL); } strcpy(dst, tmp); return (dst); } #else /* HAVE_INET_NTOP */ const char * ares_inet_ntop(int af, const void *src, char *dst, ares_socklen_t size) { /* just relay this to the underlying function */ return inet_ntop(af, src, dst, size); } #endif /* HAVE_INET_NTOP */ ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/setup_once.h0000644000175100001770000003604000000000000021755 0ustar00runnerdocker00000000000000#ifndef __SETUP_ONCE_H #define __SETUP_ONCE_H /* Copyright (C) 2004 - 2013 by Daniel Stenberg et al * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose and without fee is hereby granted, provided * that the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. M.I.T. makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. */ /******************************************************************** * NOTICE * * ======== * * * * Content of header files lib/setup_once.h and ares/setup_once.h * * must be kept in sync. Modify the other one if you change this. * * * ********************************************************************/ /* * Inclusion of common header files. */ #include #include #include #include #include #ifdef HAVE_ERRNO_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef NEED_MALLOC_H #include #endif #ifdef NEED_MEMORY_H #include #endif #ifdef HAVE_SYS_STAT_H #include #endif #ifdef HAVE_SYS_TIME_H #include #ifdef TIME_WITH_SYS_TIME #include #endif #else #ifdef HAVE_TIME_H #include #endif #endif #ifdef WIN32 #include #include #endif #if defined(HAVE_STDBOOL_H) && defined(HAVE_BOOL_T) #include #endif #ifdef HAVE_UNISTD_H #include #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 HAVE_SYS_SOCKET_H #include #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. */ #ifndef HAVE_STRUCT_TIMEVAL struct timeval { long tv_sec; long tv_usec; }; #endif /* * If we have the MSG_NOSIGNAL define, make sure we use * it as the fourth argument of function send() */ #ifdef HAVE_MSG_NOSIGNAL #define SEND_4TH_ARG MSG_NOSIGNAL #else #define SEND_4TH_ARG 0 #endif #if defined(__minix) /* Minix doesn't support recv on TCP sockets */ #define sread(x,y,z) (ares_ssize_t)read((RECV_TYPE_ARG1)(x), \ (RECV_TYPE_ARG2)(y), \ (RECV_TYPE_ARG3)(z)) #elif defined(HAVE_RECV) /* * The definitions for the return type and arguments types * of functions recv() and send() belong and come from the * configuration file. Do not define them in any other place. * * HAVE_RECV is defined if you have a function named recv() * which is used to read incoming data from sockets. If your * function has another name then don't define HAVE_RECV. * * If HAVE_RECV is defined then RECV_TYPE_ARG1, RECV_TYPE_ARG2, * RECV_TYPE_ARG3, RECV_TYPE_ARG4 and RECV_TYPE_RETV must also * be defined. * * HAVE_SEND is defined if you have a function named send() * which is used to write outgoing data on a connected socket. * If yours has another name then don't define HAVE_SEND. * * If HAVE_SEND is defined then SEND_TYPE_ARG1, SEND_QUAL_ARG2, * SEND_TYPE_ARG2, SEND_TYPE_ARG3, SEND_TYPE_ARG4 and * SEND_TYPE_RETV must also be defined. */ #if !defined(RECV_TYPE_ARG1) || \ !defined(RECV_TYPE_ARG2) || \ !defined(RECV_TYPE_ARG3) || \ !defined(RECV_TYPE_ARG4) || \ !defined(RECV_TYPE_RETV) /* */ Error Missing_definition_of_return_and_arguments_types_of_recv /* */ #else #define sread(x,y,z) (ares_ssize_t)recv((RECV_TYPE_ARG1)(x), \ (RECV_TYPE_ARG2)(y), \ (RECV_TYPE_ARG3)(z), \ (RECV_TYPE_ARG4)(0)) #endif #else /* HAVE_RECV */ #ifndef sread /* */ Error Missing_definition_of_macro_sread /* */ #endif #endif /* HAVE_RECV */ #if defined(__minix) /* Minix doesn't support send on TCP sockets */ #define swrite(x,y,z) (ares_ssize_t)write((SEND_TYPE_ARG1)(x), \ (SEND_TYPE_ARG2)(y), \ (SEND_TYPE_ARG3)(z)) #elif defined(HAVE_SEND) #if !defined(SEND_TYPE_ARG1) || \ !defined(SEND_QUAL_ARG2) || \ !defined(SEND_TYPE_ARG2) || \ !defined(SEND_TYPE_ARG3) || \ !defined(SEND_TYPE_ARG4) || \ !defined(SEND_TYPE_RETV) /* */ Error Missing_definition_of_return_and_arguments_types_of_send /* */ #else #define swrite(x,y,z) (ares_ssize_t)send((SEND_TYPE_ARG1)(x), \ (SEND_TYPE_ARG2)(y), \ (SEND_TYPE_ARG3)(z), \ (SEND_TYPE_ARG4)(SEND_4TH_ARG)) #endif #else /* HAVE_SEND */ #ifndef swrite /* */ Error Missing_definition_of_macro_swrite /* */ #endif #endif /* HAVE_SEND */ #if 0 #if defined(HAVE_RECVFROM) /* * Currently recvfrom is only used on udp sockets. */ #if !defined(RECVFROM_TYPE_ARG1) || \ !defined(RECVFROM_TYPE_ARG2) || \ !defined(RECVFROM_TYPE_ARG3) || \ !defined(RECVFROM_TYPE_ARG4) || \ !defined(RECVFROM_TYPE_ARG5) || \ !defined(RECVFROM_TYPE_ARG6) || \ !defined(RECVFROM_TYPE_RETV) /* */ Error Missing_definition_of_return_and_arguments_types_of_recvfrom /* */ #else #define sreadfrom(s,b,bl,f,fl) (ares_ssize_t)recvfrom((RECVFROM_TYPE_ARG1) (s), \ (RECVFROM_TYPE_ARG2 *)(b), \ (RECVFROM_TYPE_ARG3) (bl), \ (RECVFROM_TYPE_ARG4) (0), \ (RECVFROM_TYPE_ARG5 *)(f), \ (RECVFROM_TYPE_ARG6 *)(fl)) #endif #else /* HAVE_RECVFROM */ #ifndef sreadfrom /* */ Error Missing_definition_of_macro_sreadfrom /* */ #endif #endif /* HAVE_RECVFROM */ #ifdef RECVFROM_TYPE_ARG6_IS_VOID # define RECVFROM_ARG6_T int #else # define RECVFROM_ARG6_T RECVFROM_TYPE_ARG6 #endif #endif /* if 0 */ /* * 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 /* * Uppercase macro versions of ANSI/ISO is*() functions/macros which * avoid negative number inputs with argument byte codes > 127. */ #define ISSPACE(x) (isspace((int) ((unsigned char)x))) #define ISDIGIT(x) (isdigit((int) ((unsigned char)x))) #define ISALNUM(x) (isalnum((int) ((unsigned char)x))) #define ISXDIGIT(x) (isxdigit((int) ((unsigned char)x))) #define ISGRAPH(x) (isgraph((int) ((unsigned char)x))) #define ISALPHA(x) (isalpha((int) ((unsigned char)x))) #define ISPRINT(x) (isprint((int) ((unsigned char)x))) #define ISUPPER(x) (isupper((int) ((unsigned char)x))) #define ISLOWER(x) (islower((int) ((unsigned char)x))) #define ISASCII(x) (isascii((int) ((unsigned char)x))) #define ISBLANK(x) (int)((((unsigned char)x) == ' ') || \ (((unsigned char)x) == '\t')) #define TOLOWER(x) (tolower((int) ((unsigned char)x))) /* * 'bool' stuff compatible with HP-UX headers. */ #if defined(__hpux) && !defined(HAVE_BOOL_T) typedef int bool; # define false 0 # define true 1 # define HAVE_BOOL_T #endif /* * 'bool' exists on platforms with , i.e. C99 platforms. * On non-C99 platforms there's no bool, so define an enum for that. * On C99 platforms 'false' and 'true' also exist. Enum uses a * global namespace though, so use bool_false and bool_true. */ #ifndef HAVE_BOOL_T typedef enum { bool_false = 0, bool_true = 1 } bool; /* * Use a define to let 'true' and 'false' use those enums. There * are currently no use of true and false in libcurl proper, but * there are some in the examples. This will cater for any later * code happening to use true and false. */ # define false bool_false # define true bool_true # define HAVE_BOOL_T #endif /* * Redefine TRUE and FALSE too, to catch current use. With this * change, 'bool found = 1' will give a warning on MIPSPro, but * 'bool found = TRUE' will not. Change tested on IRIX/MIPSPro, * AIX 5.1/Xlc, Tru64 5.1/cc, w/make test too. */ #ifndef TRUE #define TRUE true #endif #ifndef FALSE #define FALSE false #endif /* * Macro WHILE_FALSE may be used to build single-iteration do-while loops, * avoiding compiler warnings. Mostly intended for other macro definitions. */ #define WHILE_FALSE while(0) #if defined(_MSC_VER) && !defined(__POCC__) # undef WHILE_FALSE # if (_MSC_VER < 1500) # define WHILE_FALSE while(1, 0) # else # define WHILE_FALSE \ __pragma(warning(push)) \ __pragma(warning(disable:4127)) \ while(0) \ __pragma(warning(pop)) # endif #endif /* * Typedef to 'int' if sig_atomic_t is not an available 'typedefed' type. */ #ifndef HAVE_SIG_ATOMIC_T typedef int sig_atomic_t; #define HAVE_SIG_ATOMIC_T #endif /* * Convenience SIG_ATOMIC_T definition */ #ifdef HAVE_SIG_ATOMIC_T_VOLATILE #define SIG_ATOMIC_T static sig_atomic_t #else #define SIG_ATOMIC_T static volatile sig_atomic_t #endif /* * Default return type for signal handlers. */ #ifndef RETSIGTYPE #define RETSIGTYPE void #endif /* * Macro used to include code only in debug builds. */ #ifdef DEBUGBUILD #define DEBUGF(x) x #else #define DEBUGF(x) do { } WHILE_FALSE #endif /* * Macro used to include assertion code only in debug builds. */ #if defined(DEBUGBUILD) && defined(HAVE_ASSERT_H) #define DEBUGASSERT(x) assert(x) #else #define DEBUGASSERT(x) do { } WHILE_FALSE #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 /* * Actually use __32_getpwuid() on 64-bit VMS builds for getpwuid() */ #if defined(__VMS) && \ defined(__INITIAL_POINTER_SIZE) && (__INITIAL_POINTER_SIZE == 64) #define getpwuid __32_getpwuid #endif /* * Macro argv_item_t hides platform details to code using it. */ #ifdef __VMS #define argv_item_t __char_ptr32 #else #define argv_item_t char * #endif /* * We use this ZERO_NULL to avoid picky compiler warnings, * when assigning a NULL pointer to a function pointer var. */ #define ZERO_NULL 0 #endif /* __SETUP_ONCE_H */ ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/lib/windows_port.c0000644000175100001770000000062300000000000022340 0ustar00runnerdocker00000000000000#include "ares_setup.h" /* only do the following on windows */ #if (defined(WIN32) || defined(WATT32)) && !defined(MSDOS) #ifdef __WATCOMC__ /* * Watcom needs a DllMain() in order to initialise the clib startup code. */ BOOL WINAPI DllMain (HINSTANCE hnd, DWORD reason, LPVOID reserved) { (void) hnd; (void) reason; (void) reserved; return (TRUE); } #endif #endif /* WIN32 builds only */ ././@PaxHeader0000000000000000000000000000003400000000000011452 xustar000000000000000028 mtime=1696604226.9994152 pycares-4.4.0/deps/c-ares/src/tools/0000755000175100001770000000000000000000000020027 5ustar00runnerdocker00000000000000././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/tools/CMakeLists.txt0000644000175100001770000000412500000000000022571 0ustar00runnerdocker00000000000000IF (CARES_BUILD_TOOLS) # Transform Makefile.inc transform_makefile_inc("Makefile.inc" "${PROJECT_BINARY_DIR}/src/tools/Makefile.inc.cmake") include(${PROJECT_BINARY_DIR}/src/tools/Makefile.inc.cmake) # Build ahost ADD_EXECUTABLE (ahost ahost.c ${SAMPLESOURCES}) TARGET_INCLUDE_DIRECTORIES (ahost PUBLIC "$" "$" "$" "$" "$" PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}" ) TARGET_COMPILE_DEFINITIONS (ahost PRIVATE HAVE_CONFIG_H=1) TARGET_LINK_LIBRARIES (ahost PRIVATE ${PROJECT_NAME}) IF (CARES_INSTALL) INSTALL (TARGETS ahost COMPONENT Tools ${TARGETS_INST_DEST}) ENDIF () # Build adig ADD_EXECUTABLE (adig adig.c ${SAMPLESOURCES}) TARGET_INCLUDE_DIRECTORIES (adig PUBLIC "$" "$" "$" "$" "$" PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}" ) TARGET_COMPILE_DEFINITIONS (adig PRIVATE HAVE_CONFIG_H=1) TARGET_LINK_LIBRARIES (adig PRIVATE ${PROJECT_NAME}) IF (CARES_INSTALL) INSTALL (TARGETS adig COMPONENT Tools ${TARGETS_INST_DEST}) ENDIF () # Build acountry ADD_EXECUTABLE (acountry acountry.c ${SAMPLESOURCES}) TARGET_INCLUDE_DIRECTORIES (acountry PUBLIC "$" "$" "$" "$" "$" PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}" ) TARGET_COMPILE_DEFINITIONS (acountry PRIVATE HAVE_CONFIG_H=1) TARGET_LINK_LIBRARIES (acountry PRIVATE ${PROJECT_NAME}) IF (CARES_INSTALL) INSTALL (TARGETS acountry COMPONENT Tools ${TARGETS_INST_DEST}) ENDIF () ENDIF () ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/tools/Makefile.am0000644000175100001770000000212000000000000022056 0ustar00runnerdocker00000000000000AUTOMAKE_OPTIONS = foreign subdir-objects nostdinc 1.9.6 PROGS = ahost adig acountry EXTRA_DIST = CMakeLists.txt Makefile.inc noinst_PROGRAMS =$(PROGS) # Specify our include paths here, and do it relative to $(top_srcdir) and # $(top_builddir), to ensure that these paths which belong to the library # being currently built and tested are searched before the library which # might possibly already be installed in the system. AM_CPPFLAGS = -I$(top_builddir)/include \ -I$(top_builddir)/src/lib \ -I$(top_srcdir)/include \ -I$(top_srcdir)/src/lib if USE_CPPFLAG_CARES_STATICLIB AM_CPPFLAGS += $(CPPFLAG_CARES_STATICLIB) endif include Makefile.inc LDADD = $(top_builddir)/src/lib/libcares.la ahost_SOURCES = ahost.c $(SAMPLESOURCES) $(SAMPLEHEADERS) ahost_CFLAGS = $(AM_CFLAGS) ahost_CPPFLAGS = $(AM_CPPFLAGS) adig_SOURCES = adig.c $(SAMPLESOURCES) $(SAMPLEHEADERS) adig_CFLAGS = $(AM_CFLAGS) adig_CPPFLAGS = $(AM_CPPFLAGS) acountry_SOURCES = acountry.c $(SAMPLESOURCES) $(SAMPLEHEADERS) acountry_CFLAGS = $(AM_CFLAGS) acountry_CPPFLAGS = $(AM_CPPFLAGS) ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/tools/Makefile.inc0000644000175100001770000000026100000000000022236 0ustar00runnerdocker00000000000000SAMPLESOURCES = ares_getopt.c \ ../lib/ares_nowarn.c \ ../lib/ares_strcasecmp.c SAMPLEHEADERS = ares_getopt.h \ ../lib/ares_nowarn.h \ ../lib/ares_strcasecmp.h ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/tools/acountry.c0000644000175100001770000006414700000000000022053 0ustar00runnerdocker00000000000000/* * * IP-address/hostname to country converter. * * Problem; you want to know where IP a.b.c.d is located. * * Use ares_gethostbyname ("d.c.b.a.zz.countries.nerd.dk") * and get the CNAME (host->h_name). Result will be: * CNAME = zz.countries.nerd.dk with address 127.0.x.y (ver 1) or * CNAME = .zz.countries.nerd.dk with address 127.0.x.y (ver 2) * * The 2 letter country code is in and the ISO-3166 country * number is in x.y (number = x*256 + y). Version 2 of the protocol is missing * the number. * * Ref: http://countries.nerd.dk/more.html * * Written by G. Vanem 2006, 2007 * * NB! This program may not be big-endian aware. * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ #include "ares_setup.h" #ifdef HAVE_STRINGS_H #include #endif #if defined(WIN32) && !defined(WATT32) #include #else #include #include #include #endif #include "ares.h" #include "ares_getopt.h" #include "ares_nowarn.h" #ifndef HAVE_STRDUP # include "ares_strdup.h" # define strdup(ptr) ares_strdup(ptr) #endif #ifndef HAVE_STRCASECMP # include "ares_strcasecmp.h" # define strcasecmp(p1,p2) ares_strcasecmp(p1,p2) #endif #ifndef HAVE_STRNCASECMP # include "ares_strcasecmp.h" # define strncasecmp(p1,p2,n) ares_strncasecmp(p1,p2,n) #endif #ifndef INADDR_NONE #define INADDR_NONE 0xffffffff #endif /* By using a double cast, we can get rid of the bogus warning of * warning: cast from 'const struct sockaddr *' to 'const struct sockaddr_in6 *' increases required alignment from 1 to 4 [-Wcast-align] */ #define CARES_INADDR_CAST(type, var) ((type)((void *)var)) static const char *usage = "acountry [-?hdv] {host|addr} ...\n"; static const char nerd_fmt[] = "%u.%u.%u.%u.zz.countries.nerd.dk"; static const char *nerd_ver1 = nerd_fmt + 14; /* .countries.nerd.dk */ static const char *nerd_ver2 = nerd_fmt + 11; /* .zz.countries.nerd.dk */ static int verbose = 0; #define TRACE(fmt) do { \ if (verbose > 0) \ printf fmt ; \ } WHILE_FALSE static void wait_ares(ares_channel channel); static void callback(void *arg, int status, int timeouts, struct hostent *host); static void callback2(void *arg, int status, int timeouts, struct hostent *host); static void find_country_from_cname(const char *cname, struct in_addr addr); static void print_help_info_acountry(void); static void Abort(const char *fmt, ...) { va_list args; va_start(args, fmt); vfprintf(stderr, fmt, args); va_end(args); exit(1); } int main(int argc, char **argv) { ares_channel channel; int ch, status; #if defined(WIN32) && !defined(WATT32) WORD wVersionRequested = MAKEWORD(USE_WINSOCK,USE_WINSOCK); WSADATA wsaData; WSAStartup(wVersionRequested, &wsaData); #endif status = ares_library_init(ARES_LIB_INIT_ALL); if (status != ARES_SUCCESS) { fprintf(stderr, "ares_library_init: %s\n", ares_strerror(status)); return 1; } while ((ch = ares_getopt(argc, argv, "dvh?")) != -1) switch (ch) { case 'd': #ifdef WATT32 dbug_init(); #endif break; case 'v': verbose++; break; case 'h': print_help_info_acountry(); break; case '?': print_help_info_acountry(); break; default: Abort(usage); } argc -= optind; argv += optind; if (argc < 1) Abort(usage); status = ares_init(&channel); if (status != ARES_SUCCESS) { fprintf(stderr, "ares_init: %s\n", ares_strerror(status)); return 1; } /* Initiate the queries, one per command-line argument. */ for ( ; *argv; argv++) { struct in_addr addr; char buf[100]; /* If this fails, assume '*argv' is a host-name that * must be resolved first */ if (ares_inet_pton(AF_INET, *argv, &addr) != 1) { ares_gethostbyname(channel, *argv, AF_INET, callback2, &addr); wait_ares(channel); if (addr.s_addr == INADDR_NONE) { printf("Failed to lookup %s\n", *argv); continue; } } sprintf(buf, nerd_fmt, (unsigned int)(addr.s_addr >> 24), (unsigned int)((addr.s_addr >> 16) & 255), (unsigned int)((addr.s_addr >> 8) & 255), (unsigned int)(addr.s_addr & 255)); TRACE(("Looking up %s...", buf)); fflush(stdout); ares_gethostbyname(channel, buf, AF_INET, callback, buf); } wait_ares(channel); ares_destroy(channel); ares_library_cleanup(); #if defined(WIN32) && !defined(WATT32) WSACleanup(); #endif return 0; } /* * Wait for the queries to complete. */ static void wait_ares(ares_channel channel) { for (;;) { struct timeval *tvp, tv; fd_set read_fds, write_fds; int nfds; FD_ZERO(&read_fds); FD_ZERO(&write_fds); nfds = ares_fds(channel, &read_fds, &write_fds); if (nfds == 0) break; tvp = ares_timeout(channel, NULL, &tv); nfds = select(nfds, &read_fds, &write_fds, NULL, tvp); if (nfds < 0) continue; ares_process(channel, &read_fds, &write_fds); } } /* * This is the callback used when we have the IP-address of interest. * Extract the CNAME and figure out the country-code from it. */ static void callback(void *arg, int status, int timeouts, struct hostent *host) { const char *name = (const char*)arg; const char *cname; char buf[20]; (void)timeouts; if (!host || status != ARES_SUCCESS) { printf("Failed to lookup %s: %s\n", name, ares_strerror(status)); return; } TRACE(("\nFound address %s, name %s\n", ares_inet_ntop(AF_INET,(const char*)host->h_addr,buf,sizeof(buf)), host->h_name)); cname = host->h_name; /* CNAME gets put here */ if (!cname) printf("Failed to get CNAME for %s\n", name); else find_country_from_cname(cname, *(CARES_INADDR_CAST(struct in_addr *, host->h_addr))); } /* * This is the callback used to obtain the IP-address of the host of interest. */ static void callback2(void *arg, int status, int timeouts, struct hostent *host) { struct in_addr *addr = (struct in_addr*) arg; (void)timeouts; if (!host || status != ARES_SUCCESS) memset(addr, INADDR_NONE, sizeof(*addr)); else memcpy(addr, host->h_addr, sizeof(*addr)); } struct search_list { int country_number; /* ISO-3166 country number */ char short_name[3]; /* A2 short country code */ const char *long_name; /* normal country name */ }; static const struct search_list *list_lookup(int number, const struct search_list *list, int num) { while (num > 0 && list->long_name) { if (list->country_number == number) return (list); num--; list++; } return (NULL); } /* * Ref: https://en.wikipedia.org/wiki/ISO_3166-1 */ static const struct search_list country_list[] = { { 4, "af", "Afghanistan" }, { 248, "ax", "Åland Island" }, { 8, "al", "Albania" }, { 12, "dz", "Algeria" }, { 16, "as", "American Samoa" }, { 20, "ad", "Andorra" }, { 24, "ao", "Angola" }, { 660, "ai", "Anguilla" }, { 10, "aq", "Antarctica" }, { 28, "ag", "Antigua & Barbuda" }, { 32, "ar", "Argentina" }, { 51, "am", "Armenia" }, { 533, "aw", "Aruba" }, { 36, "au", "Australia" }, { 40, "at", "Austria" }, { 31, "az", "Azerbaijan" }, { 44, "bs", "Bahamas" }, { 48, "bh", "Bahrain" }, { 50, "bd", "Bangladesh" }, { 52, "bb", "Barbados" }, { 112, "by", "Belarus" }, { 56, "be", "Belgium" }, { 84, "bz", "Belize" }, { 204, "bj", "Benin" }, { 60, "bm", "Bermuda" }, { 64, "bt", "Bhutan" }, { 68, "bo", "Bolivia" }, { 535, "bq", "Bonaire, Sint Eustatius and Saba" }, /* Formerly 'Bonaire' / 'Netherlands Antilles' */ { 70, "ba", "Bosnia & Herzegovina" }, { 72, "bw", "Botswana" }, { 74, "bv", "Bouvet Island" }, { 76, "br", "Brazil" }, { 86, "io", "British Indian Ocean Territory" }, { 96, "bn", "Brunei Darussalam" }, { 100, "bg", "Bulgaria" }, { 854, "bf", "Burkina Faso" }, { 108, "bi", "Burundi" }, { 116, "kh", "Cambodia" }, { 120, "cm", "Cameroon" }, { 124, "ca", "Canada" }, { 132, "cv", "Cape Verde" }, { 136, "ky", "Cayman Islands" }, { 140, "cf", "Central African Republic" }, { 148, "td", "Chad" }, { 152, "cl", "Chile" }, { 156, "cn", "China" }, { 162, "cx", "Christmas Island" }, { 166, "cc", "Cocos Islands" }, { 170, "co", "Colombia" }, { 174, "km", "Comoros" }, { 178, "cg", "Congo" }, { 180, "cd", "Congo" }, { 184, "ck", "Cook Islands" }, { 188, "cr", "Costa Rica" }, { 384, "ci", "Cote d'Ivoire" }, { 191, "hr", "Croatia" }, { 192, "cu", "Cuba" }, { 531, "cw", "Curaçao" }, { 196, "cy", "Cyprus" }, { 203, "cz", "Czech Republic" }, { 208, "dk", "Denmark" }, { 262, "dj", "Djibouti" }, { 212, "dm", "Dominica" }, { 214, "do", "Dominican Republic" }, { 218, "ec", "Ecuador" }, { 818, "eg", "Egypt" }, { 222, "sv", "El Salvador" }, { 226, "gq", "Equatorial Guinea" }, { 232, "er", "Eritrea" }, { 233, "ee", "Estonia" }, { 748, "sz", "Eswatini" }, /* Formerly Swaziland */ { 231, "et", "Ethiopia" }, { 65281, "eu", "European Union" }, /* 127.0.255.1 */ { 238, "fk", "Falkland Islands" }, { 234, "fo", "Faroe Islands" }, { 242, "fj", "Fiji" }, { 246, "fi", "Finland" }, { 250, "fr", "France" }, { 249, "fx", "France, Metropolitan" }, { 254, "gf", "French Guiana" }, { 258, "pf", "French Polynesia" }, { 260, "tf", "French Southern Territories" }, { 266, "ga", "Gabon" }, { 270, "gm", "Gambia" }, { 268, "ge", "Georgia" }, { 276, "de", "Germany" }, { 288, "gh", "Ghana" }, { 292, "gi", "Gibraltar" }, { 300, "gr", "Greece" }, { 304, "gl", "Greenland" }, { 308, "gd", "Grenada" }, { 312, "gp", "Guadeloupe" }, { 316, "gu", "Guam" }, { 320, "gt", "Guatemala" }, { 831, "gg", "Guernsey" }, { 324, "gn", "Guinea" }, { 624, "gw", "Guinea-Bissau" }, { 328, "gy", "Guyana" }, { 332, "ht", "Haiti" }, { 334, "hm", "Heard & Mc Donald Islands" }, { 336, "va", "Holy See" }, /* Vatican City */ { 340, "hn", "Honduras" }, { 344, "hk", "Hong kong" }, { 348, "hu", "Hungary" }, { 352, "is", "Iceland" }, { 356, "in", "India" }, { 360, "id", "Indonesia" }, { 364, "ir", "Iran" }, { 368, "iq", "Iraq" }, { 372, "ie", "Ireland" }, { 833, "im", "Isle of Man" }, { 376, "il", "Israel" }, { 380, "it", "Italy" }, { 388, "jm", "Jamaica" }, { 392, "jp", "Japan" }, { 832, "je", "Jersey" }, { 400, "jo", "Jordan" }, { 398, "kz", "Kazakhstan" }, { 404, "ke", "Kenya" }, { 296, "ki", "Kiribati" }, { 408, "kp", "Korea (north)" }, { 410, "kr", "Korea (south)" }, { 0, "xk", "Kosovo" }, /* https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 */ { 414, "kw", "Kuwait" }, { 417, "kg", "Kyrgyzstan" }, { 418, "la", "Laos" }, { 428, "lv", "Latvia" }, { 422, "lb", "Lebanon" }, { 426, "ls", "Lesotho" }, { 430, "lr", "Liberia" }, { 434, "ly", "Libya" }, { 438, "li", "Liechtenstein" }, { 440, "lt", "Lithuania" }, { 442, "lu", "Luxembourg" }, { 446, "mo", "Macao" }, { 450, "mg", "Madagascar" }, { 454, "mw", "Malawi" }, { 458, "my", "Malaysia" }, { 462, "mv", "Maldives" }, { 466, "ml", "Mali" }, { 470, "mt", "Malta" }, { 584, "mh", "Marshall Islands" }, { 474, "mq", "Martinique" }, { 478, "mr", "Mauritania" }, { 480, "mu", "Mauritius" }, { 175, "yt", "Mayotte" }, { 484, "mx", "Mexico" }, { 583, "fm", "Micronesia" }, { 498, "md", "Moldova" }, { 492, "mc", "Monaco" }, { 496, "mn", "Mongolia" }, { 499, "me", "Montenegro" }, { 500, "ms", "Montserrat" }, { 504, "ma", "Morocco" }, { 508, "mz", "Mozambique" }, { 104, "mm", "Myanmar" }, { 516, "na", "Namibia" }, { 520, "nr", "Nauru" }, { 524, "np", "Nepal" }, { 528, "nl", "Netherlands" }, { 540, "nc", "New Caledonia" }, { 554, "nz", "New Zealand" }, { 558, "ni", "Nicaragua" }, { 562, "ne", "Niger" }, { 566, "ng", "Nigeria" }, { 570, "nu", "Niue" }, { 574, "nf", "Norfolk Island" }, { 807, "mk", "North Macedonia" }, /* 'Macedonia' until February 2019 */ { 580, "mp", "Northern Mariana Islands" }, { 578, "no", "Norway" }, { 512, "om", "Oman" }, { 586, "pk", "Pakistan" }, { 585, "pw", "Palau" }, { 275, "ps", "Palestinian Territory" }, { 591, "pa", "Panama" }, { 598, "pg", "Papua New Guinea" }, { 600, "py", "Paraguay" }, { 604, "pe", "Peru" }, { 608, "ph", "Philippines" }, { 612, "pn", "Pitcairn" }, { 616, "pl", "Poland" }, { 620, "pt", "Portugal" }, { 630, "pr", "Puerto Rico" }, { 634, "qa", "Qatar" }, { 638, "re", "Reunion" }, { 642, "ro", "Romania" }, { 643, "ru", "Russian Federation" }, { 646, "rw", "Rwanda" }, { 0, "bl", "Saint Barthélemy" }, /* https://en.wikipedia.org/wiki/ISO_3166-2:BL */ { 659, "kn", "Saint Kitts & Nevis" }, { 662, "lc", "Saint Lucia" }, { 663, "mf", "Saint Martin" }, { 670, "vc", "Saint Vincent" }, { 882, "ws", "Samoa" }, { 674, "sm", "San Marino" }, { 678, "st", "Sao Tome & Principe" }, { 682, "sa", "Saudi Arabia" }, { 686, "sn", "Senegal" }, { 688, "rs", "Serbia" }, { 690, "sc", "Seychelles" }, { 694, "sl", "Sierra Leone" }, { 702, "sg", "Singapore" }, { 534, "sx", "Sint Maarten" }, { 703, "sk", "Slovakia" }, { 705, "si", "Slovenia" }, { 90, "sb", "Solomon Islands" }, { 706, "so", "Somalia" }, { 710, "za", "South Africa" }, { 239, "gs", "South Georgia & South Sandwich Is." }, { 728, "ss", "South Sudan" }, { 724, "es", "Spain" }, { 144, "lk", "Sri Lanka" }, { 654, "sh", "St. Helena" }, { 666, "pm", "St. Pierre & Miquelon" }, { 736, "sd", "Sudan" }, { 740, "sr", "Suriname" }, { 744, "sj", "Svalbard & Jan Mayen Islands" }, { 752, "se", "Sweden" }, { 756, "ch", "Switzerland" }, { 760, "sy", "Syrian Arab Republic" }, { 158, "tw", "Taiwan" }, { 762, "tj", "Tajikistan" }, { 834, "tz", "Tanzania" }, { 764, "th", "Thailand" }, { 626, "tl", "Timor-Leste" }, { 768, "tg", "Togo" }, { 772, "tk", "Tokelau" }, { 776, "to", "Tonga" }, { 780, "tt", "Trinidad & Tobago" }, { 788, "tn", "Tunisia" }, { 792, "tr", "Turkey" }, { 795, "tm", "Turkmenistan" }, { 796, "tc", "Turks & Caicos Islands" }, { 798, "tv", "Tuvalu" }, { 800, "ug", "Uganda" }, { 804, "ua", "Ukraine" }, { 784, "ae", "United Arab Emirates" }, { 826, "gb", "United Kingdom" }, { 840, "us", "United States" }, { 581, "um", "United States Minor Outlying Islands" }, { 858, "uy", "Uruguay" }, { 860, "uz", "Uzbekistan" }, { 548, "vu", "Vanuatu" }, { 862, "ve", "Venezuela" }, { 704, "vn", "Vietnam" }, { 92, "vg", "Virgin Islands (British)" }, { 850, "vi", "Virgin Islands (US)" }, { 876, "wf", "Wallis & Futuna Islands" }, { 732, "eh", "Western Sahara" }, { 887, "ye", "Yemen" }, { 894, "zm", "Zambia" }, { 716, "zw", "Zimbabwe" } }; /* * Check if start of 'str' is simply an IPv4 address. */ #define BYTE_OK(x) ((x) >= 0 && (x) <= 255) static int is_addr(char *str, char **end) { int a0, a1, a2, a3, num, rc = 0, length = 0; num = sscanf(str,"%3d.%3d.%3d.%3d%n",&a0,&a1,&a2,&a3,&length); if( (num == 4) && BYTE_OK(a0) && BYTE_OK(a1) && BYTE_OK(a2) && BYTE_OK(a3) && length >= (3+4)) { rc = 1; *end = str + length; } return rc; } /* * Find the country-code and name from the CNAME. E.g.: * version 1: CNAME = zzno.countries.nerd.dk with address 127.0.2.66 * yields ccode_A" = "no" and cnumber 578 (2.66). * version 2: CNAME = .zz.countries.nerd.dk with address 127.0.2.66 * yields cnumber 578 (2.66). ccode_A is ""; */ static void find_country_from_cname(const char *cname, struct in_addr addr) { const struct search_list *country; char ccode_A2[3], *ccopy, *dot_4; int cnumber, z0, z1, ver_1, ver_2; unsigned long ip; ip = ntohl(addr.s_addr); z0 = TOLOWER(cname[0]); z1 = TOLOWER(cname[1]); ccopy = strdup(cname); dot_4 = NULL; ver_1 = (z0 == 'z' && z1 == 'z' && !strcasecmp(cname+4,nerd_ver1)); ver_2 = (is_addr(ccopy,&dot_4) && !strcasecmp(dot_4,nerd_ver2)); if (ver_1) { const char *dot = strchr(cname, '.'); if (dot != cname+4) { printf("Unexpected CNAME %s (ver_1)\n", cname); free(ccopy); return; } } else if (ver_2) { z0 = TOLOWER(dot_4[1]); z1 = TOLOWER(dot_4[2]); if (z0 != 'z' && z1 != 'z') { printf("Unexpected CNAME %s (ver_2)\n", cname); free(ccopy); return; } } else { printf("Unexpected CNAME %s (ver?)\n", cname); free(ccopy); return; } if (ver_1) { ccode_A2[0] = (char)TOLOWER(cname[2]); ccode_A2[1] = (char)TOLOWER(cname[3]); ccode_A2[2] = '\0'; } else ccode_A2[0] = '\0'; cnumber = ip & 0xFFFF; TRACE(("Found country-code `%s', number %d\n", ver_1 ? ccode_A2 : "", cnumber)); country = list_lookup(cnumber, country_list, sizeof(country_list) / sizeof(country_list[0])); if (!country) printf("Name for country-number %d not found.\n", cnumber); else { if (ver_1) { if ((country->short_name[0] != ccode_A2[0]) || (country->short_name[1] != ccode_A2[1]) || (country->short_name[2] != ccode_A2[2])) printf("short-name mismatch; %s vs %s\n", country->short_name, ccode_A2); } printf("%s (%s), number %d.\n", country->long_name, country->short_name, cnumber); } free(ccopy); } /* Information from the man page. Formatting taken from man -h */ static void print_help_info_acountry(void) { printf("acountry, version %s \n\n", ARES_VERSION_STR); printf("usage: acountry [-hdv] {host|addr} ...\n\n" " d : Print some extra debugging output.\n" " h : Display this help and exit.\n" " v : Be more verbose. Print extra information.\n\n"); exit(0); } ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/tools/adig.c0000644000175100001770000006650000000000000021106 0ustar00runnerdocker00000000000000/* Copyright 1998 by the Massachusetts Institute of Technology. * * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ #include "ares_setup.h" #ifdef HAVE_NETINET_IN_H # include #endif #ifdef HAVE_ARPA_INET_H # include #endif #ifdef HAVE_NETDB_H # include #endif #include "ares_nameser.h" #ifdef HAVE_STRINGS_H # include #endif #include "ares.h" #include "ares_dns.h" #include "ares_getopt.h" #include "ares_nowarn.h" #ifndef HAVE_STRDUP # include "ares_strdup.h" # define strdup(ptr) ares_strdup(ptr) #endif #ifndef HAVE_STRCASECMP # include "ares_strcasecmp.h" # define strcasecmp(p1,p2) ares_strcasecmp(p1,p2) #endif #ifndef HAVE_STRNCASECMP # include "ares_strcasecmp.h" # define strncasecmp(p1,p2,n) ares_strncasecmp(p1,p2,n) #endif #ifdef WATT32 #undef WIN32 /* Redefined in MingW headers */ #endif struct nv { const char *name; int value; }; static const struct nv flags[] = { { "usevc", ARES_FLAG_USEVC }, { "primary", ARES_FLAG_PRIMARY }, { "igntc", ARES_FLAG_IGNTC }, { "norecurse", ARES_FLAG_NORECURSE }, { "stayopen", ARES_FLAG_STAYOPEN }, { "noaliases", ARES_FLAG_NOALIASES } }; static const int nflags = sizeof(flags) / sizeof(flags[0]); static const struct nv classes[] = { { "IN", C_IN }, { "CHAOS", C_CHAOS }, { "HS", C_HS }, { "ANY", C_ANY } }; static const int nclasses = sizeof(classes) / sizeof(classes[0]); static const struct nv types[] = { { "A", T_A }, { "NS", T_NS }, { "MD", T_MD }, { "MF", T_MF }, { "CNAME", T_CNAME }, { "SOA", T_SOA }, { "MB", T_MB }, { "MG", T_MG }, { "MR", T_MR }, { "NULL", T_NULL }, { "WKS", T_WKS }, { "PTR", T_PTR }, { "HINFO", T_HINFO }, { "MINFO", T_MINFO }, { "MX", T_MX }, { "TXT", T_TXT }, { "RP", T_RP }, { "AFSDB", T_AFSDB }, { "X25", T_X25 }, { "ISDN", T_ISDN }, { "RT", T_RT }, { "NSAP", T_NSAP }, { "NSAP_PTR", T_NSAP_PTR }, { "SIG", T_SIG }, { "KEY", T_KEY }, { "PX", T_PX }, { "GPOS", T_GPOS }, { "AAAA", T_AAAA }, { "LOC", T_LOC }, { "SRV", T_SRV }, { "AXFR", T_AXFR }, { "MAILB", T_MAILB }, { "MAILA", T_MAILA }, { "NAPTR", T_NAPTR }, { "DS", T_DS }, { "SSHFP", T_SSHFP }, { "RRSIG", T_RRSIG }, { "NSEC", T_NSEC }, { "DNSKEY", T_DNSKEY }, { "CAA", T_CAA }, { "URI", T_URI }, { "ANY", T_ANY } }; static const int ntypes = sizeof(types) / sizeof(types[0]); static const char *opcodes[] = { "QUERY", "IQUERY", "STATUS", "(reserved)", "NOTIFY", "(unknown)", "(unknown)", "(unknown)", "(unknown)", "UPDATEA", "UPDATED", "UPDATEDA", "UPDATEM", "UPDATEMA", "ZONEINIT", "ZONEREF" }; static const char *rcodes[] = { "NOERROR", "FORMERR", "SERVFAIL", "NXDOMAIN", "NOTIMP", "REFUSED", "(unknown)", "(unknown)", "(unknown)", "(unknown)", "(unknown)", "(unknown)", "(unknown)", "(unknown)", "(unknown)", "NOCHANGE" }; static void callback(void *arg, int status, int timeouts, unsigned char *abuf, int alen); static const unsigned char *display_question(const unsigned char *aptr, const unsigned char *abuf, int alen); static const unsigned char *display_rr(const unsigned char *aptr, const unsigned char *abuf, int alen); static int convert_query (char **name, int use_bitstring); static const char *type_name(int type); static const char *class_name(int dnsclass); static void usage(void); static void destroy_addr_list(struct ares_addr_node *head); static void append_addr_list(struct ares_addr_node **head, struct ares_addr_node *node); static void print_help_info_adig(void); int main(int argc, char **argv) { ares_channel channel; int c, i, optmask = ARES_OPT_FLAGS, dnsclass = C_IN, type = T_A; int status, nfds, count; int use_ptr_helper = 0; struct ares_options options; struct hostent *hostent; fd_set read_fds, write_fds; struct timeval *tvp, tv; struct ares_addr_node *srvr, *servers = NULL; #ifdef USE_WINSOCK WORD wVersionRequested = MAKEWORD(USE_WINSOCK,USE_WINSOCK); WSADATA wsaData; WSAStartup(wVersionRequested, &wsaData); #endif status = ares_library_init(ARES_LIB_INIT_ALL); if (status != ARES_SUCCESS) { fprintf(stderr, "ares_library_init: %s\n", ares_strerror(status)); return 1; } options.flags = ARES_FLAG_NOCHECKRESP; options.servers = NULL; options.nservers = 0; while ((c = ares_getopt(argc, argv, "dh?f:s:c:t:T:U:x")) != -1) { switch (c) { case 'd': #ifdef WATT32 dbug_init(); #endif break; case 'h': print_help_info_adig(); break; case '?': print_help_info_adig(); break; case 'f': /* Add a flag. */ for (i = 0; i < nflags; i++) { if (strcmp(flags[i].name, optarg) == 0) break; } if (i < nflags) options.flags |= flags[i].value; else usage(); break; case 's': /* User-specified name servers override default ones. */ srvr = malloc(sizeof(struct ares_addr_node)); if (!srvr) { fprintf(stderr, "Out of memory!\n"); destroy_addr_list(servers); return 1; } append_addr_list(&servers, srvr); if (ares_inet_pton(AF_INET, optarg, &srvr->addr.addr4) > 0) srvr->family = AF_INET; else if (ares_inet_pton(AF_INET6, optarg, &srvr->addr.addr6) > 0) srvr->family = AF_INET6; else { hostent = gethostbyname(optarg); if (!hostent) { fprintf(stderr, "adig: server %s not found.\n", optarg); destroy_addr_list(servers); return 1; } switch (hostent->h_addrtype) { case AF_INET: srvr->family = AF_INET; memcpy(&srvr->addr.addr4, hostent->h_addr, sizeof(srvr->addr.addr4)); break; case AF_INET6: srvr->family = AF_INET6; memcpy(&srvr->addr.addr6, hostent->h_addr, sizeof(srvr->addr.addr6)); break; default: fprintf(stderr, "adig: server %s unsupported address family.\n", optarg); destroy_addr_list(servers); return 1; } } /* Notice that calling ares_init_options() without servers in the * options struct and with ARES_OPT_SERVERS set simultaneously in * the options mask, results in an initialization with no servers. * When alternative name servers have been specified these are set * later calling ares_set_servers() overriding any existing server * configuration. To prevent initial configuration with default * servers that will be discarded later, ARES_OPT_SERVERS is set. * If this flag is not set here the result shall be the same but * ares_init_options() will do needless work. */ optmask |= ARES_OPT_SERVERS; break; case 'c': /* Set the query class. */ for (i = 0; i < nclasses; i++) { if (strcasecmp(classes[i].name, optarg) == 0) break; } if (i < nclasses) dnsclass = classes[i].value; else usage(); break; case 't': /* Set the query type. */ for (i = 0; i < ntypes; i++) { if (strcasecmp(types[i].name, optarg) == 0) break; } if (i < ntypes) type = types[i].value; else usage(); break; case 'T': /* Set the TCP port number. */ if (!ISDIGIT(*optarg)) usage(); options.tcp_port = (unsigned short)strtol(optarg, NULL, 0); optmask |= ARES_OPT_TCP_PORT; break; case 'U': /* Set the UDP port number. */ if (!ISDIGIT(*optarg)) usage(); options.udp_port = (unsigned short)strtol(optarg, NULL, 0); optmask |= ARES_OPT_UDP_PORT; break; case 'x': use_ptr_helper++; break; } } argc -= optind; argv += optind; if (argc == 0) usage(); status = ares_init_options(&channel, &options, optmask); if (status != ARES_SUCCESS) { fprintf(stderr, "ares_init_options: %s\n", ares_strerror(status)); return 1; } if(servers) { status = ares_set_servers(channel, servers); destroy_addr_list(servers); if (status != ARES_SUCCESS) { fprintf(stderr, "ares_init_options: %s\n", ares_strerror(status)); return 1; } } /* Initiate the queries, one per command-line argument. If there is * only one query to do, supply NULL as the callback argument; * otherwise, supply the query name as an argument so we can * distinguish responses for the user when printing them out. */ for (i = 1; *argv; i++, argv++) { char *query = *argv; if (type == T_PTR && dnsclass == C_IN && use_ptr_helper) if (!convert_query (&query, use_ptr_helper >= 2)) continue; ares_query(channel, query, dnsclass, type, callback, i < argc-1 ? (void*)query : NULL); } /* Wait for all queries to complete. */ for (;;) { FD_ZERO(&read_fds); FD_ZERO(&write_fds); nfds = ares_fds(channel, &read_fds, &write_fds); if (nfds == 0) break; tvp = ares_timeout(channel, NULL, &tv); count = select(nfds, &read_fds, &write_fds, NULL, tvp); if (count < 0 && (status = SOCKERRNO) != EINVAL) { printf("select fail: %d", status); return 1; } ares_process(channel, &read_fds, &write_fds); } ares_destroy(channel); ares_library_cleanup(); #ifdef USE_WINSOCK WSACleanup(); #endif return 0; } static void callback(void *arg, int status, int timeouts, unsigned char *abuf, int alen) { char *name = (char *) arg; int id, qr, opcode, aa, tc, rd, ra, rcode; unsigned int qdcount, ancount, nscount, arcount, i; const unsigned char *aptr; (void) timeouts; /* Display the query name if given. */ if (name) printf("Answer for query %s:\n", name); /* Display an error message if there was an error, but only stop if * we actually didn't get an answer buffer. */ if (status != ARES_SUCCESS) { printf("%s\n", ares_strerror(status)); if (!abuf) return; } /* Won't happen, but check anyway, for safety. */ if (alen < HFIXEDSZ) return; /* Parse the answer header. */ id = DNS_HEADER_QID(abuf); qr = DNS_HEADER_QR(abuf); opcode = DNS_HEADER_OPCODE(abuf); aa = DNS_HEADER_AA(abuf); tc = DNS_HEADER_TC(abuf); rd = DNS_HEADER_RD(abuf); ra = DNS_HEADER_RA(abuf); rcode = DNS_HEADER_RCODE(abuf); qdcount = DNS_HEADER_QDCOUNT(abuf); ancount = DNS_HEADER_ANCOUNT(abuf); nscount = DNS_HEADER_NSCOUNT(abuf); arcount = DNS_HEADER_ARCOUNT(abuf); /* Display the answer header. */ printf("id: %d\n", id); printf("flags: %s%s%s%s%s\n", qr ? "qr " : "", aa ? "aa " : "", tc ? "tc " : "", rd ? "rd " : "", ra ? "ra " : ""); printf("opcode: %s\n", opcodes[opcode]); printf("rcode: %s\n", rcodes[rcode]); /* Display the questions. */ printf("Questions:\n"); aptr = abuf + HFIXEDSZ; for (i = 0; i < qdcount; i++) { aptr = display_question(aptr, abuf, alen); if (aptr == NULL) return; } /* Display the answers. */ printf("Answers:\n"); for (i = 0; i < ancount; i++) { aptr = display_rr(aptr, abuf, alen); if (aptr == NULL) return; } /* Display the NS records. */ printf("NS records:\n"); for (i = 0; i < nscount; i++) { aptr = display_rr(aptr, abuf, alen); if (aptr == NULL) return; } /* Display the additional records. */ printf("Additional records:\n"); for (i = 0; i < arcount; i++) { aptr = display_rr(aptr, abuf, alen); if (aptr == NULL) return; } } static const unsigned char *display_question(const unsigned char *aptr, const unsigned char *abuf, int alen) { char *name; int type, dnsclass, status; long len; /* Parse the question name. */ status = ares_expand_name(aptr, abuf, alen, &name, &len); if (status != ARES_SUCCESS) return NULL; aptr += len; /* Make sure there's enough data after the name for the fixed part * of the question. */ if (aptr + QFIXEDSZ > abuf + alen) { ares_free_string(name); return NULL; } /* Parse the question type and class. */ type = DNS_QUESTION_TYPE(aptr); dnsclass = DNS_QUESTION_CLASS(aptr); aptr += QFIXEDSZ; /* Display the question, in a format sort of similar to how we will * display RRs. */ printf("\t%-15s.\t", name); if (dnsclass != C_IN) printf("\t%s", class_name(dnsclass)); printf("\t%s\n", type_name(type)); ares_free_string(name); return aptr; } static const unsigned char *display_rr(const unsigned char *aptr, const unsigned char *abuf, int alen) { const unsigned char *p; int type, dnsclass, ttl, dlen, status, i; long len; int vlen; char addr[46]; union { unsigned char * as_uchar; char * as_char; } name; /* Parse the RR name. */ status = ares_expand_name(aptr, abuf, alen, &name.as_char, &len); if (status != ARES_SUCCESS) return NULL; aptr += len; /* Make sure there is enough data after the RR name for the fixed * part of the RR. */ if (aptr + RRFIXEDSZ > abuf + alen) { ares_free_string(name.as_char); return NULL; } /* Parse the fixed part of the RR, and advance to the RR data * field. */ type = DNS_RR_TYPE(aptr); dnsclass = DNS_RR_CLASS(aptr); ttl = DNS_RR_TTL(aptr); dlen = DNS_RR_LEN(aptr); aptr += RRFIXEDSZ; if (aptr + dlen > abuf + alen) { ares_free_string(name.as_char); return NULL; } /* Display the RR name, class, and type. */ printf("\t%-15s.\t%d", name.as_char, ttl); if (dnsclass != C_IN) printf("\t%s", class_name(dnsclass)); printf("\t%s", type_name(type)); ares_free_string(name.as_char); /* Display the RR data. Don't touch aptr. */ switch (type) { case T_CNAME: case T_MB: case T_MD: case T_MF: case T_MG: case T_MR: case T_NS: case T_PTR: /* For these types, the RR data is just a domain name. */ status = ares_expand_name(aptr, abuf, alen, &name.as_char, &len); if (status != ARES_SUCCESS) return NULL; printf("\t%s.", name.as_char); ares_free_string(name.as_char); break; case T_HINFO: /* The RR data is two length-counted character strings. */ p = aptr; len = *p; if (p + len + 1 > aptr + dlen) return NULL; status = ares_expand_string(p, abuf, alen, &name.as_uchar, &len); if (status != ARES_SUCCESS) return NULL; printf("\t%s", name.as_char); ares_free_string(name.as_char); p += len; len = *p; if (p + len + 1 > aptr + dlen) return NULL; status = ares_expand_string(p, abuf, alen, &name.as_uchar, &len); if (status != ARES_SUCCESS) return NULL; printf("\t%s", name.as_char); ares_free_string(name.as_char); break; case T_MINFO: /* The RR data is two domain names. */ p = aptr; status = ares_expand_name(p, abuf, alen, &name.as_char, &len); if (status != ARES_SUCCESS) return NULL; printf("\t%s.", name.as_char); ares_free_string(name.as_char); p += len; status = ares_expand_name(p, abuf, alen, &name.as_char, &len); if (status != ARES_SUCCESS) return NULL; printf("\t%s.", name.as_char); ares_free_string(name.as_char); break; case T_MX: /* The RR data is two bytes giving a preference ordering, and * then a domain name. */ if (dlen < 2) return NULL; printf("\t%d", (int)DNS__16BIT(aptr)); status = ares_expand_name(aptr + 2, abuf, alen, &name.as_char, &len); if (status != ARES_SUCCESS) return NULL; printf("\t%s.", name.as_char); ares_free_string(name.as_char); break; case T_SOA: /* The RR data is two domain names and then five four-byte * numbers giving the serial number and some timeouts. */ p = aptr; status = ares_expand_name(p, abuf, alen, &name.as_char, &len); if (status != ARES_SUCCESS) return NULL; printf("\t%s.\n", name.as_char); ares_free_string(name.as_char); p += len; status = ares_expand_name(p, abuf, alen, &name.as_char, &len); if (status != ARES_SUCCESS) return NULL; printf("\t\t\t\t\t\t%s.\n", name.as_char); ares_free_string(name.as_char); p += len; if (p + 20 > aptr + dlen) return NULL; printf("\t\t\t\t\t\t( %u %u %u %u %u )", DNS__32BIT(p), DNS__32BIT(p+4), DNS__32BIT(p+8), DNS__32BIT(p+12), DNS__32BIT(p+16)); break; case T_TXT: /* The RR data is one or more length-counted character * strings. */ p = aptr; while (p < aptr + dlen) { len = *p; if (p + len + 1 > aptr + dlen) return NULL; status = ares_expand_string(p, abuf, alen, &name.as_uchar, &len); if (status != ARES_SUCCESS) return NULL; printf("\t%s", name.as_char); ares_free_string(name.as_char); p += len; } break; case T_CAA: p = aptr; /* Flags */ printf(" %u", (int)*p); p += 1; /* Remainder of record */ vlen = (int)dlen - ((char)*p) - 2; /* The Property identifier, one of: - "issue", - "iodef", or - "issuewild" */ status = ares_expand_string(p, abuf, alen, &name.as_uchar, &len); if (status != ARES_SUCCESS) return NULL; printf(" %s", name.as_char); ares_free_string(name.as_char); p += len; if (p + vlen > abuf + alen) return NULL; /* A sequence of octets representing the Property Value */ printf(" %.*s", vlen, p); break; case T_A: /* The RR data is a four-byte Internet address. */ if (dlen != 4) return NULL; printf("\t%s", ares_inet_ntop(AF_INET,aptr,addr,sizeof(addr))); break; case T_AAAA: /* The RR data is a 16-byte IPv6 address. */ if (dlen != 16) return NULL; printf("\t%s", ares_inet_ntop(AF_INET6,aptr,addr,sizeof(addr))); break; case T_WKS: /* Not implemented yet */ break; case T_SRV: /* The RR data is three two-byte numbers representing the * priority, weight, and port, followed by a domain name. */ printf("\t%d", (int)DNS__16BIT(aptr)); printf(" %d", (int)DNS__16BIT(aptr + 2)); printf(" %d", (int)DNS__16BIT(aptr + 4)); status = ares_expand_name(aptr + 6, abuf, alen, &name.as_char, &len); if (status != ARES_SUCCESS) return NULL; printf("\t%s.", name.as_char); ares_free_string(name.as_char); break; case T_URI: /* The RR data is two two-byte numbers representing the * priority and weight, followed by a target. */ printf("\t%d ", (int)DNS__16BIT(aptr)); printf("%d \t\t", (int)DNS__16BIT(aptr+2)); p = aptr +4; for (i=0; i "d.c.b.a".in-addr.arpa" for an IPv4 address. * "a.b.c....x.y.z" -> "z.y.x....c.d.e.IP6.ARPA" for an IPv6 address. * * An example from 'dig -x PTR 2001:470:1:1b9::31': * * QUESTION SECTION: * 1.3.0.0.0.0.0.0.0.0.0.0.0.0.0.0.9.b.1.0.1.0.0.0.0.7.4.0.1.0.0.2.IP6.ARPA. IN PTR * * ANSWER SECTION: * 1.3.0.0.0.0.0.0.0.0.0.0.0.0.0.0.9.b.1.0.1.0.0.0.0.7.4.0.1.0.0.2.IP6.ARPA. 254148 IN PTR ipv6.cybernode.com. * * If 'use_bitstring == 1', try to use the more compact RFC-2673 bitstring format. * Thus the above 'dig' query should become: * [x13000000000000009b10100007401002].IP6.ARPA. IN PTR */ static int convert_query (char **name_p, int use_bitstring) { #ifndef MAX_IP6_RR #define MAX_IP6_RR (16*sizeof(".x.x") + sizeof(".IP6.ARPA") + 1) #endif #ifdef HAVE_INET_PTON #define ACCEPTED_RETVAL4 1 #define ACCEPTED_RETVAL6 1 #else #define ACCEPTED_RETVAL4 32 #define ACCEPTED_RETVAL6 128 #endif static char new_name [MAX_IP6_RR]; static const char hex_chars[] = "0123456789ABCDEF"; union { struct in_addr addr4; struct ares_in6_addr addr6; } addr; if (ares_inet_pton (AF_INET, *name_p, &addr.addr4) == 1) { unsigned long laddr = ntohl(addr.addr4.s_addr); unsigned long a1 = (laddr >> 24UL) & 0xFFUL; unsigned long a2 = (laddr >> 16UL) & 0xFFUL; unsigned long a3 = (laddr >> 8UL) & 0xFFUL; unsigned long a4 = laddr & 0xFFUL; snprintf(new_name, sizeof(new_name), "%lu.%lu.%lu.%lu.in-addr.arpa", a4, a3, a2, a1); *name_p = new_name; return (1); } if (ares_inet_pton(AF_INET6, *name_p, &addr.addr6) == 1) { char *c = new_name; const unsigned char *ip = (const unsigned char*) &addr.addr6; int max_i = (int)sizeof(addr.addr6) - 1; int i, hi, lo; /* Use the more compact RFC-2673 notation? * Currently doesn't work or unsupported by the DNS-servers I've tested against. */ if (use_bitstring) { *c++ = '\\'; *c++ = '['; *c++ = 'x'; for (i = max_i; i >= 0; i--) { hi = ip[i] >> 4; lo = ip[i] & 15; *c++ = hex_chars [lo]; *c++ = hex_chars [hi]; } strcpy (c, "].IP6.ARPA"); } else { for (i = max_i; i >= 0; i--) { hi = ip[i] >> 4; lo = ip[i] & 15; *c++ = hex_chars [lo]; *c++ = '.'; *c++ = hex_chars [hi]; *c++ = '.'; } strcpy (c, "IP6.ARPA"); } *name_p = new_name; return (1); } printf("Address %s was not legal for this query.\n", *name_p); return (0); } static const char *type_name(int type) { int i; for (i = 0; i < ntypes; i++) { if (types[i].value == type) return types[i].name; } return "(unknown)"; } static const char *class_name(int dnsclass) { int i; for (i = 0; i < nclasses; i++) { if (classes[i].value == dnsclass) return classes[i].name; } return "(unknown)"; } static void usage(void) { fprintf(stderr, "usage: adig [-h] [-d] [-f flag] [-s server] [-c class] " "[-t type] [-T|U port] [-x|-xx] name ...\n"); exit(1); } static void destroy_addr_list(struct ares_addr_node *head) { while(head) { struct ares_addr_node *detached = head; head = head->next; free(detached); } } static void append_addr_list(struct ares_addr_node **head, struct ares_addr_node *node) { struct ares_addr_node *last; node->next = NULL; if(*head) { last = *head; while(last->next) last = last->next; last->next = node; } else *head = node; } /* Information from the man page. Formatting taken from man -h */ static void print_help_info_adig(void) { printf("adig, version %s \n\n", ARES_VERSION_STR); printf("usage: adig [-h] [-d] [-f flag] [-s server] [-c class] [-t type] [-T|U port] [-x | -xx] name ...\n\n" " d : Print some extra debugging output.\n" " f : Add a flag. Possible values for flag are igntc, noaliases, norecurse, primary, stayopen, usevc.\n" " h : Display this help and exit.\n\n" " T port : Use specified TCP port to connect to DNS server.\n" " U port : Use specified UDP port to connect to DNS server.\n" " c class : Set the query class. Possible values for class are NY, CHAOS, HS, IN (default).\n" " s server : Connect to specified DNS server, instead of the system's default one(s).\n" " t type : Query records of specified type. \n" " Possible values for type are A \n" " (default), AAAA, AFSDB, ANY,\n" " AXFR, CNAME, GPOS, HINFO, ISDN,\n" " KEY, LOC, MAILA, MAILB, MB, MD,\n" " MF, MG, MINFO, MR, MX, NAPTR, NS,\n" " NSAP, NSAP_PTR, NULL, PTR, PX, RP,\n" " RT, SIG, SOA, SRV, TXT, URI, WKS, X25\n\n" " -x : For a '-t PTR a.b.c.d' lookup, query for 'd.c.b.a.in-addr.arpa.'\n" " -xx : As above, but for IPv6, compact the format into a bitstring like\n" " '[xabcdef00000000000000000000000000].IP6.ARPA.'\n"); exit(0); } ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/tools/ahost.c0000644000175100001770000001425500000000000021320 0ustar00runnerdocker00000000000000/* Copyright 1998 by the Massachusetts Institute of Technology. * * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ #include "ares_setup.h" #if !defined(WIN32) || defined(WATT32) #include #include #include #endif #ifdef HAVE_STRINGS_H #include #endif #include "ares.h" #include "ares_dns.h" #include "ares_getopt.h" #include "ares_ipv6.h" #include "ares_nowarn.h" #ifndef HAVE_STRDUP # include "ares_strdup.h" # define strdup(ptr) ares_strdup(ptr) #endif #ifndef HAVE_STRCASECMP # include "ares_strcasecmp.h" # define strcasecmp(p1,p2) ares_strcasecmp(p1,p2) #endif #ifndef HAVE_STRNCASECMP # include "ares_strcasecmp.h" # define strncasecmp(p1,p2,n) ares_strncasecmp(p1,p2,n) #endif static void callback(void *arg, int status, int timeouts, struct hostent *host); static void usage(void); static void print_help_info_ahost(void); int main(int argc, char **argv) { struct ares_options options; int optmask = 0; ares_channel channel; int status, nfds, c, addr_family = AF_INET; fd_set read_fds, write_fds; struct timeval *tvp, tv; struct in_addr addr4; struct ares_in6_addr addr6; #ifdef USE_WINSOCK WORD wVersionRequested = MAKEWORD(USE_WINSOCK,USE_WINSOCK); WSADATA wsaData; WSAStartup(wVersionRequested, &wsaData); #endif memset(&options, 0, sizeof(options)); status = ares_library_init(ARES_LIB_INIT_ALL); if (status != ARES_SUCCESS) { fprintf(stderr, "ares_library_init: %s\n", ares_strerror(status)); return 1; } while ((c = ares_getopt(argc,argv,"dt:h?s:")) != -1) { switch (c) { case 'd': #ifdef WATT32 dbug_init(); #endif break; case 's': optmask |= ARES_OPT_DOMAINS; options.ndomains++; options.domains = (char **)realloc(options.domains, options.ndomains * sizeof(char *)); options.domains[options.ndomains - 1] = strdup(optarg); break; case 't': if (!strcasecmp(optarg,"a")) addr_family = AF_INET; else if (!strcasecmp(optarg,"aaaa")) addr_family = AF_INET6; else if (!strcasecmp(optarg,"u")) addr_family = AF_UNSPEC; else usage(); break; case 'h': print_help_info_ahost(); break; case '?': print_help_info_ahost(); break; default: usage(); break; } } argc -= optind; argv += optind; if (argc < 1) usage(); status = ares_init_options(&channel, &options, optmask); if (status != ARES_SUCCESS) { fprintf(stderr, "ares_init: %s\n", ares_strerror(status)); return 1; } /* Initiate the queries, one per command-line argument. */ for ( ; *argv; argv++) { if (ares_inet_pton(AF_INET, *argv, &addr4) == 1) { ares_gethostbyaddr(channel, &addr4, sizeof(addr4), AF_INET, callback, *argv); } else if (ares_inet_pton(AF_INET6, *argv, &addr6) == 1) { ares_gethostbyaddr(channel, &addr6, sizeof(addr6), AF_INET6, callback, *argv); } else { ares_gethostbyname(channel, *argv, addr_family, callback, *argv); } } /* Wait for all queries to complete. */ for (;;) { int res; FD_ZERO(&read_fds); FD_ZERO(&write_fds); nfds = ares_fds(channel, &read_fds, &write_fds); if (nfds == 0) break; tvp = ares_timeout(channel, NULL, &tv); res = select(nfds, &read_fds, &write_fds, NULL, tvp); if (-1 == res) break; ares_process(channel, &read_fds, &write_fds); } ares_destroy(channel); ares_library_cleanup(); #ifdef USE_WINSOCK WSACleanup(); #endif return 0; } static void callback(void *arg, int status, int timeouts, struct hostent *host) { char **p; (void)timeouts; if (status != ARES_SUCCESS) { fprintf(stderr, "%s: %s\n", (char *) arg, ares_strerror(status)); return; } for (p = host->h_addr_list; *p; p++) { char addr_buf[46] = "??"; ares_inet_ntop(host->h_addrtype, *p, addr_buf, sizeof(addr_buf)); printf("%-32s\t%s", host->h_name, addr_buf); #if 0 if (host->h_aliases[0]) { int i; printf (", Aliases: "); for (i = 0; host->h_aliases[i]; i++) printf("%s ", host->h_aliases[i]); } #endif puts(""); } } static void usage(void) { fprintf(stderr, "usage: ahost [-h] [-d] [-s {domain}] [-t {a|aaaa|u}] {host|addr} ...\n"); exit(1); } /* Information from the man page. Formatting taken from man -h */ static void print_help_info_ahost(void) { printf("ahost, version %s \n\n", ARES_VERSION_STR); printf("usage: ahost [-h] [-d] [-s {domain}] [-t {a|aaaa|u}] {host|addr} ...\n\n" " d : Print some extra debugging output.\n" " h : Display this help and exit.\n\n" " s domain : Specify the domain to search instead of \n" " using the default values from \n" " /etc/resolv.conf. This option only has an \n" " effect on platforms that use /etc/resolv.conf\n" " for DNS configuration; it has no effect on other\n" " platforms (such as Win32 or Android).\n" " t type : If type is \"a\", print the A record (default).\n" " If type is \"aaaa\", print the AAAA record. If\n" " type is \"u\", look for either AAAA or A record\n" " (in that order).\n\n"); exit(0); } ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/tools/ares_getopt.c0000644000175100001770000001072100000000000022510 0ustar00runnerdocker00000000000000/* * Original file name getopt.c Initial import into the c-ares source tree * on 2007-04-11. Lifted from version 5.2 of the 'Open Mash' project with * the modified BSD license, BSD license without the advertising clause. * */ /* * getopt.c -- * * Standard UNIX getopt function. Code is from BSD. * * Copyright (c) 1987-2001 The Regents of the University of California. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * A. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * B. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * C. Neither the names of the copyright holders nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS * IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ /* #if !defined(lint) * static char sccsid[] = "@(#)getopt.c 8.2 (Berkeley) 4/2/94"; * #endif */ #include #include #include #include "ares_getopt.h" int opterr = 1, /* if error message should be printed */ optind = 1; /* index into parent argv vector */ int optopt = 0; /* character checked for validity */ static int optreset; /* reset getopt */ char *optarg; /* argument associated with option */ #define BADCH (int)'?' #define BADARG (int)':' #define EMSG (char *)"" /* * ares_getopt -- * Parse argc/argv argument vector. */ int ares_getopt(int nargc, char * const nargv[], const char *ostr) { static char *place = EMSG; /* option letter processing */ char *oli; /* option letter list index */ if (optreset || !*place) { /* update scanning pointer */ optreset = 0; if (optind >= nargc || *(place = nargv[optind]) != '-') { place = EMSG; return (EOF); } if (place[1] && *++place == '-') { /* found "--" */ ++optind; place = EMSG; return (EOF); } } /* option letter okay? */ if ((optopt = (int)*place++) == (int)':' || (oli = strchr(ostr, optopt)) == NULL) { /* * if the user didn't specify '-' as an option, * assume it means EOF. */ if (optopt == (int)'-') return (EOF); if (!*place) ++optind; if (opterr && *ostr != ':') (void)fprintf(stderr, "%s: illegal option -- %c\n", __FILE__, optopt); return (BADCH); } if (*++oli != ':') { /* don't need argument */ optarg = NULL; if (!*place) ++optind; } else { /* need an argument */ if (*place) /* no white space */ optarg = place; else if (nargc <= ++optind) { /* no arg */ place = EMSG; if (*ostr == ':') return (BADARG); if (opterr) (void)fprintf(stderr, "%s: option requires an argument -- %c\n", __FILE__, optopt); return (BADCH); } else /* white space */ optarg = nargv[optind]; place = EMSG; ++optind; } return (optopt); /* dump back option letter */ } ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/src/tools/ares_getopt.h0000644000175100001770000000400500000000000022513 0ustar00runnerdocker00000000000000#ifndef ARES_GETOPT_H #define ARES_GETOPT_H /* * Copyright (c) 1987-2001 The Regents of the University of California. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * A. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * B. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * C. Neither the names of the copyright holders nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS * IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ int ares_getopt(int nargc, char * const nargv[], const char *ostr); #undef optarg #undef optind #undef opterr #undef optopt #undef optreset #define optarg ares_optarg #define optind ares_optind #define opterr ares_opterr #define optopt ares_optopt #define optreset ares_optreset extern char *optarg; extern int optind; extern int opterr; extern int optopt; #endif /* ARES_GETOPT_H */ ././@PaxHeader0000000000000000000000000000003400000000000011452 xustar000000000000000028 mtime=1696604227.0034153 pycares-4.4.0/deps/c-ares/test/0000755000175100001770000000000000000000000017057 5ustar00runnerdocker00000000000000././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/.gitignore0000644000175100001770000000034100000000000021045 0ustar00runnerdocker00000000000000*.o libgtest.a libgmock.a arestest aresfuzz aresfuzzname arestest.log arestest.trs fuzzcheck.sh.log fuzzcheck.sh.trs test-suite.log fuzzoutput config.h.in config.h dnsdump ares-libfuzzer ares-libfuzzer-name libFuzzer.a Fuzzer././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/CMakeLists.txt0000644000175100001770000000462300000000000021624 0ustar00runnerdocker00000000000000set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED TRUE) set(CMAKE_CXX_EXTENSIONS FALSE) enable_language(CXX) find_package(Threads) # create target to access and use internal cares library add_library(caresinternal INTERFACE) target_compile_definitions(caresinternal INTERFACE HAVE_CONFIG_H=1) target_include_directories(caresinternal INTERFACE "${PROJECT_BINARY_DIR}" "${PROJECT_SOURCE_DIR}" "${PROJECT_SOURCE_DIR}/src/lib" "${CARES_TOPLEVEL_DIR}/include" "${CMAKE_INSTALL_INCLUDEDIR}" ) IF (CARES_STATIC) target_link_libraries(caresinternal INTERFACE ${PROJECT_NAME}::cares_static) ELSE () target_link_libraries(caresinternal INTERFACE ${PROJECT_NAME}::cares) ENDIF () # Google Test and Mock set(GMOCK_DIR gmock-1.11.0) add_library(gmock STATIC ${GMOCK_DIR}/gmock-gtest-all.cc ${GMOCK_DIR}/gmock/gmock.h ${GMOCK_DIR}/gtest/gtest.h ) target_include_directories(gmock PUBLIC SYSTEM ${GMOCK_DIR}) target_link_libraries(gmock PRIVATE ${CMAKE_THREAD_LIBS_INIT}) # test targets transform_makefile_inc("Makefile.inc" "${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake") include(${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake) configure_file(${CARES_TOPLEVEL_DIR}/src/lib/ares_config.h.cmake config.h) add_executable(arestest ${TESTSOURCES} ${TESTHEADERS}) target_include_directories(arestest PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) target_link_libraries(arestest PRIVATE caresinternal gmock) IF (CARES_BUILD_CONTAINER_TESTS) target_compile_definitions(arestest PRIVATE HAVE_USER_NAMESPACE HAVE_UTS_NAMESPACE) ENDIF () add_executable(aresfuzz ${FUZZSOURCES}) target_link_libraries(aresfuzz PRIVATE caresinternal) add_executable(aresfuzzname ${FUZZNAMESOURCES}) target_link_libraries(aresfuzzname PRIVATE caresinternal) add_executable(dnsdump ${DUMPSOURCES}) target_link_libraries(dnsdump PRIVATE caresinternal) # register tests add_test(NAME arestest COMMAND $) file(GLOB_RECURSE FUZZINPUT_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/fuzzinput" "fuzzinput/*") add_test( NAME aresfuzz WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/fuzzinput" COMMAND $ ${FUZZINPUT_FILES} ) file(GLOB_RECURSE FUZZNAMES_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/fuzznames" "fuzznames/*") add_test( NAME aresfuzzname WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/fuzznames" COMMAND $ ${FUZZNAMES_FILES} ) ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/Makefile.am0000644000175100001770000000317000000000000021114 0ustar00runnerdocker00000000000000ARES_BLD_DIR = $(top_builddir)/.. ARES_SRC_DIR = $(top_srcdir)/.. AUTOMAKE_OPTIONS = foreign subdir-objects nostdinc 1.9.6 ACLOCAL_AMFLAGS = -I ../m4 --install # Note use of -isystem to force use of local gMock/gTest even if there's an installed version. CPPFLAGS += -I$(ARES_BLD_DIR)/include \ -I$(ARES_BLD_DIR)/src/lib \ -I$(ARES_SRC_DIR)/include \ -I$(ARES_SRC_DIR)/src/lib \ -I$(top_builddir) \ -isystem $(srcdir)/gmock-1.11.0 CXXFLAGS += -Wall $(PTHREAD_CFLAGS) # Makefile.inc provides the various *SOURCES and *HEADERS defines include Makefile.inc TESTS = arestest fuzzcheck.sh noinst_LTLIBRARIES = libgmock.la libgmock_la_SOURCES = \ gmock-1.11.0/gmock-gtest-all.cc \ gmock-1.11.0/gmock/gmock.h \ gmock-1.11.0/gtest/gtest.h libgmock_la_CPPFLAGS = -isystem $(srcdir)/gmock-1.11.0 noinst_PROGRAMS = arestest aresfuzz aresfuzzname dnsdump EXTRA_DIST = fuzzcheck.sh CMakeLists.txt Makefile.m32 Makefile.msvc README.md buildconf $(srcdir)/fuzzinput/* $(srcdir)/fuzznames/* arestest_SOURCES = $(TESTSOURCES) $(TESTHEADERS) arestest_LDADD = libgmock.la $(ARES_BLD_DIR)/src/lib/libcares.la $(PTHREAD_LIBS) # Not interested in coverage of test code, but linking the test binary needs the coverage option include $(top_srcdir)/aminclude_static.am arestest_LIBS = $(CODE_COVERAGE_LIBS) aresfuzz_SOURCES = $(FUZZSOURCES) aresfuzz_LDADD = $(ARES_BLD_DIR)/src/lib/libcares.la aresfuzzname_SOURCES = $(FUZZNAMESOURCES) aresfuzzname_LDADD = $(ARES_BLD_DIR)/src/lib/libcares.la dnsdump_SOURCES = $(DUMPSOURCES) dnsdump_LDADD = $(ARES_BLD_DIR)/src/lib/libcares.la test: check ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/Makefile.inc0000644000175100001770000000154700000000000021276 0ustar00runnerdocker00000000000000TESTSOURCES = ares-test-main.cc \ ares-test-init.cc \ ares-test.cc \ ares-test-ns.cc \ ares-test-parse.cc \ ares-test-parse-a.cc \ ares-test-parse-aaaa.cc \ ares-test-parse-caa.cc \ ares-test-parse-mx.cc \ ares-test-parse-naptr.cc \ ares-test-parse-ns.cc \ ares-test-parse-ptr.cc \ ares-test-parse-soa.cc \ ares-test-parse-soa-any.cc \ ares-test-parse-srv.cc \ ares-test-parse-txt.cc \ ares-test-parse-uri.cc \ ares-test-misc.cc \ ares-test-live.cc \ ares-test-mock.cc \ ares-test-mock-ai.cc \ ares-test-internal.cc \ dns-proto.cc \ dns-proto-test.cc TESTHEADERS = ares-test.h \ dns-proto.h \ ares-test-ai.h FUZZSOURCES = ares-test-fuzz.c \ ares-fuzz.c FUZZNAMESOURCES = ares-test-fuzz-name.c \ ares-fuzz.c DUMPSOURCES = dns-proto.cc \ dns-dump.cc ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/Makefile.m320000644000175100001770000000350700000000000021124 0ustar00runnerdocker00000000000000############################################################# # ## Makefile for building arestest.exe with MingW32 (GCC-3.2) ## Use: make -f Makefile.m32 # ######################################################## CXX = g++ CC = gcc LD = g++ # Where to find the c-ares source code; needed because the tests use library-internal headers ARES_SRC_DIR = .. # Where to find the built c-ares static library ARES_BLD_DIR = .. ARESLIB = $(ARES_BLD_DIR)/src/lib/libcares.a GMOCK_DIR = gmock-1.11.0 CPPFLAGS = -I$(ARES_SRC_DIR)/include -I$(ARES_SRC_DIR)/src/lib -I$(GMOCK_DIR) -DCARES_STATICLIB CXXFLAGS = -Wall $(PTHREAD_CFLAGS) -std=gnu++11 LDFLAGS = LDLIBS = -lws2_32 -liphlpapi # Makefile.inc provides the TESTSOURCES and TESTHEADERS defines include Makefile.inc OBJS := $(patsubst %.cc,%.o,$(strip $(TESTSOURCES))) FUZZOBJS := $(patsubst %.c,%.o,$(strip $(FUZZSOURCES))) FUZZNAMEOBJS := $(patsubst %.c,%.o,$(strip $(FUZZNAMESOURCES))) DNSDUMPOBJS := $(patsubst %.cc,%.o,$(strip $(DUMPSOURCES))) all: arestest.exe aresfuzz.exe aresfuzzname.exe dnsdump.exe arestest.exe: $(OBJS) gmock-gtest-all.o $(LD) $(LDFLAGS) -o $@ $^ -L$(ARES_BLD_DIR)/src/lib -lcares $(LDLIBS) aresfuzz.exe: $(FUZZOBJS) $(LD) $(LDFLAGS) -o $@ $^ -L$(ARES_BLD_DIR)/src/lib -lcares $(LDLIBS) aresfuzzname.exe: $(FUZZNAMEOBJS) $(LD) $(LDFLAGS) -o $@ $^ -L$(ARES_BLD_DIR)/src/lib -lcares $(LDLIBS) dnsdump.exe: $(DNSDUMPOBJS) $(LD) $(LDFLAGS) -o $@ $^ -L$(ARES_BLD_DIR)/src/lib -lcares $(LDLIBS) $(OBJS): $(TESTHEADERS) .cc.o: $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< .c.o: $(CC) $(CPPFLAGS) $(CFLAGS) -c $< gmock-gtest-all.o: $(GMOCK_DIR)/gmock-gtest-all.cc $(CXX) -I$(GMOCK_DIR) $(CPPFLAGS) $(CXXFLAGS) -c $< test: arestest.exe ./arestest.exe vtest: arestest.exe ./arestest.exe -v clean: $(RM) $(OBJS) gmock-gtest-all.o arestest.exe aresfuzz.exe aresfuzzname.exe dnsdump.exe ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/Makefile.msvc0000644000175100001770000002637100000000000021477 0ustar00runnerdocker00000000000000# Permission to use, copy, modify, and distribute this # software and its documentation for any purpose and without # fee is hereby granted, provided that the above copyright # notice appear in all copies and that both that copyright # notice and this permission notice appear in supporting # documentation, and that the name of M.I.T. not be used in # advertising or publicity pertaining to distribution of the # software without specific, written prior permission. # M.I.T. makes no representations about the suitability of # this software for any purpose. It is provided "as is" # without express or implied warranty. # ------------------------------------------------------------------------------ # # Makefile for building c-ares test suite with MSVC. # # Usage: nmake /f makefile.msvc CFG= # # can be one of: [ lib-release | lib-debug | dll-release | dll-debug } # can be one of: [ all | arestest | clean } # # If is not specified then all targets are built. # If is not specified then lib-debug will be assumed. # # This makefile must be processed from the subdir where it is located. # # All results are generated below a subdirectory named msvcXXX. # # ------------------------------------------------------------------------------ # ------------------------------------------------ # c-ares static and dynamic libraries common base # file names for release and debug configurations # ------------------------------------------------ LIBNAME = cares STA_LIB_REL = lib$(LIBNAME) DYN_LIB_REL = $(LIBNAME) STA_LIB_DBG = $(STA_LIB_REL)d DYN_LIB_DBG = $(DYN_LIB_REL)d # ------------------------------------------- # Base names for c-ares DLL import libraries # ------------------------------------------- IMP_LIB_REL = $(DYN_LIB_REL) IMP_LIB_DBG = $(DYN_LIB_DBG) # -------------------------- # Runtime library selection # -------------------------- RTLIB = /MD RTLIBD = /MDd !IF "$(RTLIBCFG)" == "static" RTLIB = /MT RTLIBD = /MTd !ENDIF # -------------------------------------------------------- # Detect compiler version. # -------------------------------------------------------- !INCLUDE ..\msvc_ver.inc # --------------------------------------------------------- # Verify that current subdir is below the c-ares source one # --------------------------------------------------------- !IF ! EXIST(..\src\lib\ares_init.c) ! MESSAGE Can not process Makefile.msvc from outside of c-ares test subdirectory. ! MESSAGE Change to the subdirectory where Makefile.msvc is found, and try again. ! ERROR See previous message. !ENDIF # ------------------------------------------------------------------ # Base subdir is the common root from which other subdirs will hang, # the name depends on MSVC version being used when building c-ares. # ------------------------------------------------------------------ BASE_DIR = .\msvc # Look for a built library of the same configuration in the directory above. LIB_BASE_DIR = ..\msvc # ---------------------------------------- # Subdir holding sources for all projects # ---------------------------------------- SRCDIR = . # ------------------------- # Configuration validation # ------------------------- !IF "$(CFG)" == "" CFG = lib-debug !ENDIF VALID_CFGSET = FALSE !IF "$(CFG)" == "lib-release" || "$(CFG)" == "lib-debug" || \ "$(CFG)" == "dll-release" || "$(CFG)" == "dll-debug" VALID_CFGSET = TRUE !ENDIF !IF "$(VALID_CFGSET)" == "FALSE" ! MESSAGE MSVC c-ares makefile ! MESSAGE ! MESSAGE Usage: nmake /f makefile.msvc CFG= ! MESSAGE ! MESSAGE can be one of: [ lib-release | lib-debug | dll-release | dll-debug } ! MESSAGE can be one of: [ all | arestest | aresfuzz | aresfuzzname | dnsdump | clean } ! MESSAGE ! MESSAGE If is not specified then all targets are built. ! MESSAGE If is not specified then lib-debug will be assumed. ! MESSAGE ! ERROR Choose a valid configuration. !ENDIF # -------------------------------------------------------- # Project subdirs independent of configuration being used # -------------------------------------------------------- PROG_DIR = $(BASE_DIR)\arestest LIB_DIR = $(LIB_BASE_DIR)\cares GMOCK_DIR = gmock-1.11.0 # --------------------------------------------------- # Subdirs which are configuration dependent are only # defined when a valid configuration has been given. # --------------------------------------------------- PROG_OUTDIR = $(PROG_DIR)\$(CFG) PROG_OBJDIR = $(PROG_OUTDIR)\obj LIB_OUTDIR = $(LIB_DIR)\$(CFG) # ------------------------------------- # TCP/IP stack settings # ------------------------------------- CFLAGS = /DWIN32 EX_LIBS_REL = ws2_32.lib advapi32.lib kernel32.lib iphlpapi.lib EX_LIBS_DBG = ws2_32.lib advapi32.lib kernel32.lib iphlpapi.lib # ------------------------------------------------- # Switches that depend on ancient compiler versions # ------------------------------------------------- !IF $(CC_VERS_NUM) == 60 PDB_NONE = /pdb:none PDBTYPE_CONSOLIDATE = /pdbtype:consolidate !ELSE !UNDEF PDB_NONE !UNDEF PDBTYPE_CONSOLIDATE !ENDIF !IF $(CC_VERS_NUM) <= 70 RT_ERROR_CHECKING = /GZ !ELSE RT_ERROR_CHECKING = /RTCsu !ENDIF # ---------------------------- # Assorted commands and flags # ---------------------------- CC_CMD_REL = cl.exe /nologo $(RTLIB) /DNDEBUG /O2 /D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_WARNINGS CC_CMD_DBG = cl.exe /nologo $(RTLIBD) /D_DEBUG /Od /Zi /D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_WARNINGS $(RT_ERROR_CHECKING) CC_CFLAGS = $(CFLAGS) /I. /I../src/lib /I../include /I $(GMOCK_DIR) /W3 /EHsc /FD RC_CMD_REL = rc.exe /l 0x409 /d "NDEBUG" RC_CMD_DBG = rc.exe /l 0x409 /d "_DEBUG" LINK_CMD_LIB = link.exe /lib /nologo LINK_CMD_DLL = link.exe /dll /nologo /incremental:no /fixed:no LINK_CMD_EXE = link.exe /nologo /incremental:no /fixed:no /subsystem:console LINK_CMD_EXE_REL = $(LINK_CMD_EXE) /release $(PDB_NONE) LINK_CMD_EXE_DBG = $(LINK_CMD_EXE) /debug $(PDBTYPE_CONSOLIDATE) # --------------------------------- # Configuration dependent settings # --------------------------------- !IF "$(CFG)" == "lib-release" CARES_TARGET = $(STA_LIB_REL).lib CARES_CFLAGS = /DCARES_BUILDING_LIBRARY /DCARES_STATICLIB CARES_LFLAGS = SPROG_CFLAGS = /DCARES_STATICLIB SPROG_LFLAGS = /libpath:$(LIB_OUTDIR) $(EX_LIBS_REL) $(STA_LIB_REL).lib CARES_LINK = $(LINK_CMD_LIB) SPROG_LINK = $(LINK_CMD_EXE_REL) CC_CMD = $(CC_CMD_REL) !ENDIF !IF "$(CFG)" == "lib-debug" CARES_TARGET = $(STA_LIB_DBG).lib CARES_CFLAGS = /DCARES_BUILDING_LIBRARY /DCARES_STATICLIB /DDEBUGBUILD CARES_LFLAGS = SPROG_CFLAGS = /DCARES_STATICLIB SPROG_LFLAGS = /libpath:$(LIB_OUTDIR) $(EX_LIBS_DBG) $(STA_LIB_DBG).lib CARES_LINK = $(LINK_CMD_LIB) SPROG_LINK = $(LINK_CMD_EXE_DBG) CC_CMD = $(CC_CMD_DBG) !ENDIF !IF "$(CFG)" == "dll-release" CARES_TARGET = $(DYN_LIB_REL).dll CARES_CFLAGS = /DCARES_BUILDING_LIBRARY CARES_LFLAGS = /release $(EX_LIBS_REL) /implib:$(PROG_OUTDIR)\$(IMP_LIB_REL).lib $(PDB_NONE) SPROG_CFLAGS = SPROG_LFLAGS = /libpath:$(LIB_OUTDIR) $(EX_LIBS_REL) $(IMP_LIB_REL).lib CARES_LINK = $(LINK_CMD_DLL) SPROG_LINK = $(LINK_CMD_EXE_REL) CC_CMD = $(CC_CMD_REL) USE_RES_FILE = TRUE RC_CMD = $(RC_CMD_REL) !ENDIF !IF "$(CFG)" == "dll-debug" CARES_TARGET = $(DYN_LIB_DBG).dll CARES_CFLAGS = /DCARES_BUILDING_LIBRARY /DDEBUGBUILD CARES_LFLAGS = /debug $(EX_LIBS_DBG) /implib:$(PROG_OUTDIR)\$(IMP_LIB_DBG).lib /pdb:$(PROG_OUTDIR)\$(DYN_LIB_DBG).pdb $(PDBTYPE_CONSOLIDATE) SPROG_CFLAGS = SPROG_LFLAGS = /libpath:$(LIB_OUTDIR) $(EX_LIBS_DBG) $(IMP_LIB_DBG).lib CARES_LINK = $(LINK_CMD_DLL) SPROG_LINK = $(LINK_CMD_EXE_DBG) CC_CMD = $(CC_CMD_DBG) USE_RES_FILE = TRUE RC_CMD = $(RC_CMD_DBG) !ENDIF # -------------------------------------------- # Makefile.inc provides lists of source files # -------------------------------------------- !INCLUDE .\Makefile.inc # ---------------------------- # Build lists of object files # ---------------------------- !IF [ECHO PROG_OBJS=^$(PROG_OBJDIR)\$(TESTSOURCES: = $(PROG_OBJDIR^)\) > .\prog_objs.inc] == 0 !INCLUDE .\prog_objs.inc !IF [DEL .\prog_objs.inc] !ENDIF !ELSE !ERROR Problem generating PROG_OBJS list. !ENDIF PROG_OBJS = $(PROG_OBJS:.cc=.obj) !IF [ECHO FUZZ_OBJS=^$(PROG_OBJDIR)\$(FUZZSOURCES: = $(PROG_OBJDIR^)\) > .\fuzz_objs.inc] == 0 !INCLUDE .\fuzz_objs.inc !IF [DEL .\fuzz_objs.inc] !ENDIF !ELSE !ERROR Problem generating FUZZ_OBJS list. !ENDIF FUZZ_OBJS = $(FUZZ_OBJS:.c=.obj) !IF [ECHO FUZZNAME_OBJS=^$(PROG_OBJDIR)\$(FUZZNAMESOURCES: = $(PROG_OBJDIR^)\) > .\fuzzname_objs.inc] == 0 !INCLUDE .\fuzzname_objs.inc !IF [DEL .\fuzzname_objs.inc] !ENDIF !ELSE !ERROR Problem generating FUZZNAME_OBJS list. !ENDIF FUZZNAME_OBJS = $(FUZZNAME_OBJS:.c=.obj) !IF [ECHO DNSDUMP_OBJS=^$(PROG_OBJDIR)\$(DUMPSOURCES: = $(PROG_OBJDIR^)\) > .\dnsdump_objs.inc] == 0 !INCLUDE .\dnsdump_objs.inc !IF [DEL .\dnsdump_objs.inc] !ENDIF !ELSE !ERROR Problem generating DNSDUMP_OBJS list. !ENDIF DNSDUMP_OBJS = $(DNSDUMP_OBJS:.cc=.obj) GMOCK_GTEST_OBJ = $(PROG_OBJDIR)\gmock-gtest-all.obj # -------------------------------- # Only our custom inference rules # -------------------------------- .SUFFIXES: .SUFFIXES: .cc .c {$(SRCDIR)}.cc{$(PROG_OBJDIR)}.obj: $(CC_CMD) $(CC_CFLAGS) $(SPROG_CFLAGS) /Fo$@ /Fd$(@D)\ /c $< {$(SRCDIR)}.c{$(PROG_OBJDIR)}.obj: $(CC_CMD) $(CC_CFLAGS) $(SPROG_CFLAGS) /Fo$@ /Fd$(@D)\ /c $< {$(GMOCK_DIR)}.cc{$(PROG_OBJDIR)}.obj: $(CC_CMD) $(CC_CFLAGS) $(SPROG_CFLAGS) /I $(GMOCK_DIR) /Fo$@ /Fd$(@D)\ /c $< # --------------------------------------------------------------------- # Main targets # --------------------------------------------------------------------- ALL: arestest aresfuzz aresfuzzname dnsdump @ test: arestest $(PROG_OUTDIR)\arestest vtest: arestest $(PROG_OUTDIR)\arestest -v arestest: $(TESTSOURCES) $(PROG_OUTDIR) $(PROG_OBJDIR) $(PROG_OBJS) $(GMOCK_GTEST_OBJ) $(SPROG_LINK) $(SPROG_LFLAGS) /out:$(PROG_OUTDIR)\arestest.exe $(PROG_OBJS) $(GMOCK_GTEST_OBJ) @if exist $(PROG_OUTDIR)\arestest.exe.manifest mt -nologo -manifest $(PROG_OUTDIR)\arestest.exe.manifest -outputresource:$(PROG_OUTDIR)\arestest.exe;1 aresfuzz: $(FUZZSOURCES) $(PROG_OUTDIR) $(PROG_OBJDIR) $(FUZZ_OBJS) $(SPROG_LINK) $(SPROG_LFLAGS) /out:$(PROG_OUTDIR)\aresfuzz.exe $(FUZZ_OBJS) @if exist $(PROG_OUTDIR)\aresfuzz.exe.manifest mt -nologo -manifest $(PROG_OUTDIR)\aresfuzz.exe.manifest -outputresource:$(PROG_OUTDIR)\aresfuzz.exe;1 aresfuzzname: $(FUZZNAMESOURCES) $(PROG_OUTDIR) $(PROG_OBJDIR) $(FUZZNAME_OBJS) $(SPROG_LINK) $(SPROG_LFLAGS) /out:$(PROG_OUTDIR)\aresfuzzname.exe $(FUZZNAME_OBJS) @if exist $(PROG_OUTDIR)\aresfuzzname.exe.manifest mt -nologo -manifest $(PROG_OUTDIR)\aresfuzzname.exe.manifest -outputresource:$(PROG_OUTDIR)\aresfuzzname.exe;1 dnsdump: $(DUMPSOURCES) $(PROG_OUTDIR) $(PROG_OBJDIR) $(DNSDUMP_OBJS) $(SPROG_LINK) $(SPROG_LFLAGS) /out:$(PROG_OUTDIR)\dnsdump.exe $(DNSDUMP_OBJS) @if exist $(PROG_OUTDIR)\dnsdump.exe.manifest mt -nologo -manifest $(PROG_OUTDIR)\dnsdump.exe.manifest -outputresource:$(PROG_OUTDIR)\dnsdump.exe;1 $(PROG_OUTDIR): $(PROG_DIR) @if not exist $(PROG_OUTDIR) mkdir $(PROG_OUTDIR) $(PROG_OBJDIR): $(PROG_OUTDIR) @if not exist $(PROG_OBJDIR) mkdir $(PROG_OBJDIR) clean: @-RMDIR /S /Q $(PROG_OUTDIR) >NUL 2>&1 $(BASE_DIR): @if not exist $(BASE_DIR) mkdir $(BASE_DIR) $(PROG_DIR): $(BASE_DIR) @if not exist $(PROG_DIR) mkdir $(PROG_DIR) # End of Makefile.msvc ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/README.md0000644000175100001770000001324500000000000020343 0ustar00runnerdocker00000000000000c-ares Unit Test Suite ====================== This directory holds unit tests for the c-ares library. To build the tests: - Build the main c-ares library first, in the directory above this. To enable tests of internal functions, configure the library build to expose hidden symbols with `./configure --disable-symbol-hiding`. - Generate a `configure` file by running `autoreconf -iv` (which requires a local installation of [autotools](https://www.gnu.org/software/automake/manual/html_node/Autotools-Introduction.html)). - `./configure` - `make` - Run the tests with `./arestest`, or `./arestest -v` for extra debug info. Points to note: - The tests are written in C++11, and so need a C++ compiler that supports this. To avoid adding this as a requirement for the library, the configuration and build of the tests is independent from the library. - The tests include some live queries, which will fail when run on a machine without internet connectivity. To skip live tests, run with `./arestest --gtest_filter=-*.Live*`. - The tests include queries of a mock DNS server. This server listens on port 5300 by default, but the port can be changed with the `-p 5300` option to `arestest`. Test Types ---------- The test suite includes various different types of test. - There are live tests (`ares-test-live.cc`), which assume that the current machine has a valid DNS setup and connection to the internet; these tests issue queries for real domains but don't particularly check what gets returned. The tests will fail on an offline machine. - There are some mock tests (`ares-test-mock.cc`) that set up a fake DNS server and inject its port into the c-ares library configuration. These tests allow specific response messages to be crafted and injected, and so are likely to be used for many more tests in future. - To make this generation/injection easier, the `dns-proto.h` file includes C++ helper classes for building DNS packets. - Other library entrypoints that don't require network activity (e.g. `ares_parse_*_reply`) are tested directly. - A couple of the tests use a helper method of the test fixture to inject memory allocation failures, using a recent change to the c-ares library that allows override of `malloc`/`free`. - There are some tests of the internal entrypoints of the library (`ares-test-internal.c`), but these are only enabled if the library was configured with `--disable-symbol-hiding` and/or `--enable-expose-statics`. - There is also an entrypoint to allow Clang's [libfuzzer](http://llvm.org/docs/LibFuzzer.html) to drive the packet parsing code in `ares_parse_*_reply`, together with a standalone wrapper for it (`./aresfuzz`) to allow use of command line fuzzers (such as [afl-fuzz](http://lcamtuf.coredump.cx/afl/)) for further [fuzz testing](#fuzzing). Code Coverage Information ------------------------- To generate code coverage information: - Configure both the library and the tests with `./configure --enable-code-coverage` before building. This requires the relevant code coverage tools ([gcov](https://gcc.gnu.org/onlinedocs/gcc/Gcov.html), [lcov](http://ltp.sourceforge.net/coverage/lcov.php)) to be installed locally. - Run the tests with `test/arestest`. - Generate code coverage output with `make code-coverage-capture` in the library directory (i.e. not in `test/`). Fuzzing ------- ### libFuzzer To fuzz the packet parsing code with libFuzzer, follow the main [libFuzzer instructions](http://llvm.org/docs/LibFuzzer.html): - Configure the c-ares library and test suite with a recent Clang and a sanitizer, for example: ```console % export CFLAGS="-fsanitize=fuzzer-no-link,address" % export CC=clang % ./configure --disable-shared && make ``` - Link each of the fuzzer entrypoints in with `ares-fuzz.cc`: ``` % clang -I.. -c ares-test-fuzz.c % clang -I.. -c ares-test-fuzz-name.c % clang++ -fsanitize=fuzzer,address ares-test-fuzz.o ../.libs/libcares.a -o ares-libfuzzer % clang++ -fsanitize=fuzzer,address ares-test-fuzz-name.o ../.libs/libcares.a -o ares-libfuzzer-name ``` - Run the fuzzer using the starting corpus with: ```console % ./ares-libfuzzer fuzzinput/ # OR % ./ares-libfuzzer-name fuzznames/ ``` ### AFL To fuzz using AFL, follow the [AFL quick start guide](http://lcamtuf.coredump.cx/afl/QuickStartGuide.txt): - Download and build AFL. - Configure the c-ares library and test tool to use AFL's compiler wrappers: ```console % export CC=$AFLDIR/afl-gcc % ./configure --disable-shared && make % cd test && ./configure && make aresfuzz aresfuzzname ``` - Run the AFL fuzzer against the starting corpus: ```console % mkdir fuzzoutput % $AFLDIR/afl-fuzz -i fuzzinput -o fuzzoutput -- ./aresfuzz # OR % $AFLDIR/afl-fuzz -i fuzznames -o fuzzoutput -- ./aresfuzzname ``` ### AFL Persistent Mode If a recent version of Clang is available, AFL can use its built-in compiler instrumentation; this configuration also allows the use of a (much) faster persistent mode, where multiple fuzz inputs are run for each process invocation. - Download and build a recent AFL, and run `make` in the `llvm_mode` subdirectory to ensure that `afl-clang-fast` gets built. - Configure the c-ares library and test tool to use AFL's clang wrappers that use compiler instrumentation: ```console % export CC=$AFLDIR/afl-clang-fast % ./configure --disable-shared && make % cd test && ./configure && make aresfuzz ``` - Run the AFL fuzzer (in persistent mode) against the starting corpus: ```console % mkdir fuzzoutput % $AFLDIR/afl-fuzz -i fuzzinput -o fuzzoutput -- ./aresfuzz ``` ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/ares-fuzz.c0000644000175100001770000000302600000000000021152 0ustar00runnerdocker00000000000000/* * General driver to allow command-line fuzzer (i.e. afl) to * exercise the libFuzzer entrypoint. */ #include #include #include #include #include #ifdef WIN32 #include #else #include #endif #define kMaxAflInputSize (1 << 20) static unsigned char afl_buffer[kMaxAflInputSize]; #ifdef __AFL_LOOP /* If we are built with afl-clang-fast, use persistent mode */ #define KEEP_FUZZING(count) __AFL_LOOP(1000) #else /* If we are built with afl-clang, execute each input once */ #define KEEP_FUZZING(count) ((count) < 1) #endif /* In ares-test-fuzz.c and ares-test-fuzz-name.c: */ int LLVMFuzzerTestOneInput(const unsigned char *data, unsigned long size); static void ProcessFile(int fd) { int count = read(fd, afl_buffer, kMaxAflInputSize); /* * Make a copy of the data so that it's not part of a larger * buffer (where buffer overflows would go unnoticed). */ unsigned char *copied_data = (unsigned char *)malloc(count); memcpy(copied_data, afl_buffer, count); LLVMFuzzerTestOneInput(copied_data, count); free(copied_data); } int main(int argc, char *argv[]) { if (argc == 1) { int count = 0; while (KEEP_FUZZING(count)) { ProcessFile(fileno(stdin)); count++; } } else { int ii; for (ii = 1; ii < argc; ++ii) { int fd = open(argv[ii], O_RDONLY); if (fd < 0) { fprintf(stderr, "Failed to open '%s'\n", argv[ii]); continue; } ProcessFile(fd); close(fd); } } return 0; } ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/ares-test-ai.h0000644000175100001770000000241200000000000021525 0ustar00runnerdocker00000000000000#ifndef ARES_TEST_AI_H #define ARES_TEST_AI_H #include #include "gtest/gtest.h" #include "gmock/gmock.h" #include "ares-test.h" namespace ares { namespace test { class MockChannelTestAI : public MockChannelOptsTest, public ::testing::WithParamInterface< std::pair > { public: MockChannelTestAI() : MockChannelOptsTest(1, GetParam().first, GetParam().second, nullptr, 0) {} }; class MockUDPChannelTestAI : public MockChannelOptsTest, public ::testing::WithParamInterface { public: MockUDPChannelTestAI() : MockChannelOptsTest(1, GetParam(), false, nullptr, 0) {} }; class MockTCPChannelTestAI : public MockChannelOptsTest, public ::testing::WithParamInterface { public: MockTCPChannelTestAI() : MockChannelOptsTest(1, GetParam(), true, nullptr, 0) {} }; // Test fixture that uses a default channel. class DefaultChannelTestAI : public LibraryTest { public: DefaultChannelTestAI() : channel_(nullptr) { EXPECT_EQ(ARES_SUCCESS, ares_init(&channel_)); EXPECT_NE(nullptr, channel_); } ~DefaultChannelTestAI() { ares_destroy(channel_); channel_ = nullptr; } // Process all pending work on ares-owned file descriptors. void Process(); protected: ares_channel channel_; }; } } #endif ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/ares-test-fuzz-name.c0000644000175100001770000000113200000000000023041 0ustar00runnerdocker00000000000000#include #include #include #include "ares.h" // Include ares internal file for DNS protocol constants #include "ares_nameser.h" // Entrypoint for Clang's libfuzzer, exercising query creation. int LLVMFuzzerTestOneInput(const unsigned char *data, unsigned long size) { // Null terminate the data. char *name = malloc(size + 1); name[size] = '\0'; memcpy(name, data, size); unsigned char *buf = NULL; int buflen = 0; ares_create_query(name, C_IN, T_AAAA, 1234, 0, &buf, &buflen, 1024); free(buf); free(name); return 0; } ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/ares-test-fuzz.c0000644000175100001770000000317100000000000022130 0ustar00runnerdocker00000000000000#include #include "ares.h" // Entrypoint for Clang's libfuzzer int LLVMFuzzerTestOneInput(const unsigned char *data, unsigned long size) { // Feed the data into each of the ares_parse_*_reply functions. struct hostent *host = NULL; struct ares_addrttl info[5]; int count = 5; ares_parse_a_reply(data, size, &host, info, &count); if (host) ares_free_hostent(host); host = NULL; struct ares_addr6ttl info6[5]; count = 5; ares_parse_aaaa_reply(data, size, &host, info6, &count); if (host) ares_free_hostent(host); host = NULL; unsigned char addrv4[4] = {0x10, 0x20, 0x30, 0x40}; ares_parse_ptr_reply(data, size, addrv4, sizeof(addrv4), AF_INET, &host); if (host) ares_free_hostent(host); host = NULL; ares_parse_ns_reply(data, size, &host); if (host) ares_free_hostent(host); struct ares_srv_reply* srv = NULL; ares_parse_srv_reply(data, size, &srv); if (srv) ares_free_data(srv); struct ares_mx_reply* mx = NULL; ares_parse_mx_reply(data, size, &mx); if (mx) ares_free_data(mx); struct ares_txt_reply* txt = NULL; ares_parse_txt_reply(data, size, &txt); if (txt) ares_free_data(txt); struct ares_soa_reply* soa = NULL; ares_parse_soa_reply(data, size, &soa); if (soa) ares_free_data(soa); struct ares_naptr_reply* naptr = NULL; ares_parse_naptr_reply(data, size, &naptr); if (naptr) ares_free_data(naptr); struct ares_caa_reply* caa = NULL; ares_parse_caa_reply(data, size, &caa); if (caa) ares_free_data(caa); struct ares_uri_reply* uri = NULL; ares_parse_uri_reply(data, size, &uri); if (uri) ares_free_data(uri); return 0; } ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/ares-test-init.cc0000644000175100001770000005501200000000000022241 0ustar00runnerdocker00000000000000#include "ares-test.h" // library initialization is only needed for windows builds #ifdef WIN32 #define EXPECTED_NONINIT ARES_ENOTINITIALIZED #else #define EXPECTED_NONINIT ARES_SUCCESS #endif namespace ares { namespace test { TEST(LibraryInit, Basic) { EXPECT_EQ(EXPECTED_NONINIT, ares_library_initialized()); EXPECT_EQ(ARES_SUCCESS, ares_library_init(ARES_LIB_INIT_ALL)); EXPECT_EQ(ARES_SUCCESS, ares_library_initialized()); ares_library_cleanup(); EXPECT_EQ(EXPECTED_NONINIT, ares_library_initialized()); } TEST(LibraryInit, UnexpectedCleanup) { EXPECT_EQ(EXPECTED_NONINIT, ares_library_initialized()); ares_library_cleanup(); EXPECT_EQ(EXPECTED_NONINIT, ares_library_initialized()); } TEST(LibraryInit, DISABLED_InvalidParam) { // TODO: police flags argument to ares_library_init() EXPECT_EQ(ARES_EBADQUERY, ares_library_init(ARES_LIB_INIT_ALL << 2)); EXPECT_EQ(EXPECTED_NONINIT, ares_library_initialized()); ares_library_cleanup(); } TEST(LibraryInit, Nested) { EXPECT_EQ(EXPECTED_NONINIT, ares_library_initialized()); EXPECT_EQ(ARES_SUCCESS, ares_library_init(ARES_LIB_INIT_ALL)); EXPECT_EQ(ARES_SUCCESS, ares_library_initialized()); EXPECT_EQ(ARES_SUCCESS, ares_library_init(ARES_LIB_INIT_ALL)); EXPECT_EQ(ARES_SUCCESS, ares_library_initialized()); ares_library_cleanup(); EXPECT_EQ(ARES_SUCCESS, ares_library_initialized()); ares_library_cleanup(); EXPECT_EQ(EXPECTED_NONINIT, ares_library_initialized()); } TEST(LibraryInit, BasicChannelInit) { EXPECT_EQ(ARES_SUCCESS, ares_library_init(ARES_LIB_INIT_ALL)); ares_channel channel = nullptr; EXPECT_EQ(ARES_SUCCESS, ares_init(&channel)); EXPECT_NE(nullptr, channel); ares_destroy(channel); ares_library_cleanup(); } TEST_F(LibraryTest, OptionsChannelInit) { struct ares_options opts = {0}; int optmask = 0; opts.flags = ARES_FLAG_USEVC | ARES_FLAG_PRIMARY; optmask |= ARES_OPT_FLAGS; opts.timeout = 2000; optmask |= ARES_OPT_TIMEOUTMS; opts.tries = 2; optmask |= ARES_OPT_TRIES; opts.ndots = 4; optmask |= ARES_OPT_NDOTS; opts.udp_port = 54; optmask |= ARES_OPT_UDP_PORT; opts.tcp_port = 54; optmask |= ARES_OPT_TCP_PORT; opts.socket_send_buffer_size = 514; optmask |= ARES_OPT_SOCK_SNDBUF; opts.socket_receive_buffer_size = 514; optmask |= ARES_OPT_SOCK_RCVBUF; opts.ednspsz = 1280; optmask |= ARES_OPT_EDNSPSZ; opts.nservers = 2; opts.servers = (struct in_addr *)malloc(opts.nservers * sizeof(struct in_addr)); opts.servers[0].s_addr = htonl(0x01020304); opts.servers[1].s_addr = htonl(0x02030405); optmask |= ARES_OPT_SERVERS; opts.ndomains = 2; opts.domains = (char **)malloc(opts.ndomains * sizeof(char *)); opts.domains[0] = strdup("example.com"); opts.domains[1] = strdup("example2.com"); optmask |= ARES_OPT_DOMAINS; opts.lookups = strdup("b"); optmask |= ARES_OPT_LOOKUPS; optmask |= ARES_OPT_ROTATE; opts.resolvconf_path = strdup("/etc/resolv.conf"); optmask |= ARES_OPT_RESOLVCONF; ares_channel channel = nullptr; EXPECT_EQ(ARES_SUCCESS, ares_init_options(&channel, &opts, optmask)); EXPECT_NE(nullptr, channel); ares_channel channel2 = nullptr; EXPECT_EQ(ARES_SUCCESS, ares_dup(&channel2, channel)); struct ares_options opts2 = {0}; int optmask2 = 0; EXPECT_EQ(ARES_SUCCESS, ares_save_options(channel2, &opts2, &optmask2)); // Note that not all opts-settable fields are saved (e.g. // ednspsz, socket_{send,receive}_buffer_size). EXPECT_EQ(opts.flags, opts2.flags); EXPECT_EQ(opts.timeout, opts2.timeout); EXPECT_EQ(opts.tries, opts2.tries); EXPECT_EQ(opts.ndots, opts2.ndots); EXPECT_EQ(opts.udp_port, opts2.udp_port); EXPECT_EQ(opts.tcp_port, opts2.tcp_port); EXPECT_EQ(1, opts2.nservers); // Truncated by ARES_FLAG_PRIMARY EXPECT_EQ(opts.servers[0].s_addr, opts2.servers[0].s_addr); EXPECT_EQ(opts.ndomains, opts2.ndomains); EXPECT_EQ(std::string(opts.domains[0]), std::string(opts2.domains[0])); EXPECT_EQ(std::string(opts.domains[1]), std::string(opts2.domains[1])); EXPECT_EQ(std::string(opts.lookups), std::string(opts2.lookups)); EXPECT_EQ(std::string(opts.resolvconf_path), std::string(opts2.resolvconf_path)); ares_destroy_options(&opts); ares_destroy_options(&opts2); ares_destroy(channel); ares_destroy(channel2); } TEST_F(LibraryTest, ChannelAllocFail) { ares_channel channel; for (int ii = 1; ii <= 25; ii++) { ClearFails(); SetAllocFail(ii); channel = nullptr; int rc = ares_init(&channel); // The number of allocations depends on local environment, so don't expect ENOMEM. if (rc == ARES_ENOMEM) { EXPECT_EQ(nullptr, channel); } else { ares_destroy(channel); } } } TEST_F(LibraryTest, OptionsChannelAllocFail) { struct ares_options opts = {0}; int optmask = 0; opts.flags = ARES_FLAG_USEVC; optmask |= ARES_OPT_FLAGS; opts.timeout = 2; optmask |= ARES_OPT_TIMEOUT; opts.tries = 2; optmask |= ARES_OPT_TRIES; opts.ndots = 4; optmask |= ARES_OPT_NDOTS; opts.udp_port = 54; optmask |= ARES_OPT_UDP_PORT; opts.tcp_port = 54; optmask |= ARES_OPT_TCP_PORT; opts.socket_send_buffer_size = 514; optmask |= ARES_OPT_SOCK_SNDBUF; opts.socket_receive_buffer_size = 514; optmask |= ARES_OPT_SOCK_RCVBUF; opts.ednspsz = 1280; optmask |= ARES_OPT_EDNSPSZ; opts.nservers = 2; opts.servers = (struct in_addr *)malloc(opts.nservers * sizeof(struct in_addr)); opts.servers[0].s_addr = htonl(0x01020304); opts.servers[1].s_addr = htonl(0x02030405); optmask |= ARES_OPT_SERVERS; opts.ndomains = 2; opts.domains = (char **)malloc(opts.ndomains * sizeof(char *)); opts.domains[0] = strdup("example.com"); opts.domains[1] = strdup("example2.com"); optmask |= ARES_OPT_DOMAINS; opts.lookups = strdup("b"); optmask |= ARES_OPT_LOOKUPS; optmask |= ARES_OPT_ROTATE; opts.resolvconf_path = strdup("/etc/resolv.conf"); optmask |= ARES_OPT_RESOLVCONF; ares_channel channel = nullptr; for (int ii = 1; ii <= 8; ii++) { ClearFails(); SetAllocFail(ii); int rc = ares_init_options(&channel, &opts, optmask); if (rc == ARES_ENOMEM) { EXPECT_EQ(nullptr, channel); } else { EXPECT_EQ(ARES_SUCCESS, rc); ares_destroy(channel); channel = nullptr; } } ClearFails(); EXPECT_EQ(ARES_SUCCESS, ares_init_options(&channel, &opts, optmask)); EXPECT_NE(nullptr, channel); // Add some servers and a sortlist for flavour. EXPECT_EQ(ARES_SUCCESS, ares_set_servers_csv(channel, "1.2.3.4,0102:0304:0506:0708:0910:1112:1314:1516,2.3.4.5")); EXPECT_EQ(ARES_SUCCESS, ares_set_sortlist(channel, "1.2.3.4 2.3.4.5")); ares_channel channel2 = nullptr; for (int ii = 1; ii <= 18; ii++) { ClearFails(); SetAllocFail(ii); EXPECT_EQ(ARES_ENOMEM, ares_dup(&channel2, channel)) << ii; EXPECT_EQ(nullptr, channel2) << ii; } struct ares_options opts2; int optmask2 = 0; for (int ii = 1; ii <= 6; ii++) { memset(&opts2, 0, sizeof(opts2)); ClearFails(); SetAllocFail(ii); EXPECT_EQ(ARES_ENOMEM, ares_save_options(channel, &opts2, &optmask2)) << ii; // May still have allocations even after ARES_ENOMEM return code. ares_destroy_options(&opts2); } ares_destroy_options(&opts); ares_destroy(channel); } TEST_F(LibraryTest, FailChannelInit) { EXPECT_EQ(ARES_SUCCESS, ares_library_init_mem(ARES_LIB_INIT_ALL, &LibraryTest::amalloc, &LibraryTest::afree, &LibraryTest::arealloc)); SetAllocFail(1); ares_channel channel = nullptr; EXPECT_EQ(ARES_ENOMEM, ares_init(&channel)); EXPECT_EQ(nullptr, channel); ares_library_cleanup(); } #ifndef WIN32 TEST_F(LibraryTest, EnvInit) { ares_channel channel = nullptr; EnvValue v1("LOCALDOMAIN", "this.is.local"); EnvValue v2("RES_OPTIONS", "options debug ndots:3 retry:3 rotate retrans:2"); EXPECT_EQ(ARES_SUCCESS, ares_init(&channel)); ares_destroy(channel); } TEST_F(LibraryTest, EnvInitAllocFail) { ares_channel channel; EnvValue v1("LOCALDOMAIN", "this.is.local"); EnvValue v2("RES_OPTIONS", "options debug ndots:3 retry:3 rotate retrans:2"); for (int ii = 1; ii <= 10; ii++) { ClearFails(); SetAllocFail(ii); channel = nullptr; int rc = ares_init(&channel); if (rc == ARES_SUCCESS) { ares_destroy(channel); } else { EXPECT_EQ(ARES_ENOMEM, rc); } } } #endif TEST_F(DefaultChannelTest, SetAddresses) { ares_set_local_ip4(channel_, 0x01020304); byte addr6[16] = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10}; ares_set_local_ip6(channel_, addr6); ares_set_local_dev(channel_, "dummy"); } TEST_F(DefaultChannelTest, SetSortlistFailures) { EXPECT_EQ(ARES_ENODATA, ares_set_sortlist(nullptr, "1.2.3.4")); EXPECT_EQ(ARES_SUCCESS, ares_set_sortlist(channel_, "xyzzy ; lwk")); EXPECT_EQ(ARES_SUCCESS, ares_set_sortlist(channel_, "xyzzy ; 0x123")); } TEST_F(DefaultChannelTest, SetSortlistVariants) { EXPECT_EQ(ARES_SUCCESS, ares_set_sortlist(channel_, "1.2.3.4")); EXPECT_EQ(ARES_SUCCESS, ares_set_sortlist(channel_, "1.2.3.4 ; 2.3.4.5")); EXPECT_EQ(ARES_SUCCESS, ares_set_sortlist(channel_, "129.1.1.1")); EXPECT_EQ(ARES_SUCCESS, ares_set_sortlist(channel_, "192.1.1.1")); EXPECT_EQ(ARES_SUCCESS, ares_set_sortlist(channel_, "224.1.1.1")); EXPECT_EQ(ARES_SUCCESS, ares_set_sortlist(channel_, "225.1.1.1")); } TEST_F(DefaultChannelTest, SetSortlistAllocFail) { for (int ii = 1; ii <= 3; ii++) { ClearFails(); SetAllocFail(ii); EXPECT_EQ(ARES_ENOMEM, ares_set_sortlist(channel_, "12.13.0.0/16 1234::5678/40 1.2.3.4")) << ii; } } #ifdef USE_WINSOCK TEST(Init, NoLibraryInit) { ares_channel channel = nullptr; EXPECT_EQ(ARES_ENOTINITIALIZED, ares_init(&channel)); } #endif #ifdef HAVE_CONTAINER // These tests rely on the ability of non-root users to create a chroot // using Linux namespaces. // The library uses a variety of information sources to initialize a channel, // in particular to determine: // - search: the search domains to use // - servers: the name servers to use // - lookup: whether to check files or DNS or both (e.g. "fb") // - options: various resolver options // - sortlist: the order of preference for IP addresses // // The first source from the following list is used: // - init_by_options(): explicitly specified values in struct ares_options // - init_by_environment(): values from the environment: // - LOCALDOMAIN -> search (single value) // - RES_OPTIONS -> options // - init_by_resolv_conf(): values from various config files: // - /etc/resolv.conf -> search, lookup, servers, sortlist, options // - /etc/nsswitch.conf -> lookup // - /etc/host.conf -> lookup // - /etc/svc.conf -> lookup // - init_by_defaults(): fallback values: // - gethostname(3) -> domain // - "fb" -> lookup NameContentList filelist = { {"/etc/resolv.conf", "nameserver 1.2.3.4\n" "sortlist 1.2.3.4/16 2.3.4.5\n" "search first.com second.com\n"}, {"/etc/hosts", "3.4.5.6 ahostname.com\n"}, {"/etc/nsswitch.conf", "hosts: files\n"}}; CONTAINED_TEST_F(LibraryTest, ContainerChannelInit, "myhostname", "mydomainname.org", filelist) { ares_channel channel = nullptr; EXPECT_EQ(ARES_SUCCESS, ares_init(&channel)); std::vector actual = GetNameServers(channel); std::vector expected = {"1.2.3.4"}; EXPECT_EQ(expected, actual); struct ares_options opts; int optmask = 0; ares_save_options(channel, &opts, &optmask); EXPECT_EQ(2, opts.ndomains); EXPECT_EQ(std::string("first.com"), std::string(opts.domains[0])); EXPECT_EQ(std::string("second.com"), std::string(opts.domains[1])); ares_destroy_options(&opts); HostResult result; ares_gethostbyname(channel, "ahostname.com", AF_INET, HostCallback, &result); ProcessWork(channel, NoExtraFDs, nullptr); EXPECT_TRUE(result.done_); std::stringstream ss; ss << result.host_; EXPECT_EQ("{'ahostname.com' aliases=[] addrs=[3.4.5.6]}", ss.str()); ares_destroy(channel); return HasFailure(); } CONTAINED_TEST_F(LibraryTest, ContainerSortlistOptionInit, "myhostname", "mydomainname.org", filelist) { ares_channel channel = nullptr; struct ares_options opts = {0}; int optmask = 0; optmask |= ARES_OPT_SORTLIST; opts.nsort = 0; // Explicitly specifying an empty sortlist in the options should override the // environment. EXPECT_EQ(ARES_SUCCESS, ares_init_options(&channel, &opts, optmask)); ares_save_options(channel, &opts, &optmask); EXPECT_EQ(0, opts.nsort); EXPECT_EQ(nullptr, opts.sortlist); EXPECT_EQ(ARES_OPT_SORTLIST, (optmask & ARES_OPT_SORTLIST)); ares_destroy_options(&opts); ares_destroy(channel); return HasFailure(); } NameContentList fullresolv = { {"/etc/resolv.conf", " nameserver 1.2.3.4 \n" "search first.com second.com\n" "lookup bind\n" "options debug ndots:5\n" "sortlist 1.2.3.4/16 2.3.4.5\n"}}; CONTAINED_TEST_F(LibraryTest, ContainerFullResolvInit, "myhostname", "mydomainname.org", fullresolv) { ares_channel channel = nullptr; EXPECT_EQ(ARES_SUCCESS, ares_init(&channel)); struct ares_options opts; int optmask = 0; ares_save_options(channel, &opts, &optmask); EXPECT_EQ(std::string("b"), std::string(opts.lookups)); EXPECT_EQ(5, opts.ndots); ares_destroy_options(&opts); ares_destroy(channel); return HasFailure(); } // Allow path for resolv.conf to be configurable NameContentList myresolvconf = { {"/tmp/myresolv.cnf", " nameserver 1.2.3.4 \n" "search first.com second.com\n" "lookup bind\n" "options debug ndots:5\n" "sortlist 1.2.3.4/16 2.3.4.5\n"}}; CONTAINED_TEST_F(LibraryTest, ContainerMyResolvConfInit, "myhostname", "mydomain.org", myresolvconf) { char filename[] = "/tmp/myresolv.cnf"; ares_channel channel = nullptr; struct ares_options options = {0}; options.resolvconf_path = strdup(filename); int optmask = ARES_OPT_RESOLVCONF; EXPECT_EQ(ARES_SUCCESS, ares_init_options(&channel, &options, optmask)); optmask = 0; free(options.resolvconf_path); options.resolvconf_path = NULL; EXPECT_EQ(ARES_SUCCESS, ares_save_options(channel, &options, &optmask)); EXPECT_EQ(ARES_OPT_RESOLVCONF, (optmask & ARES_OPT_RESOLVCONF)); EXPECT_EQ(std::string(filename), std::string(options.resolvconf_path)); ares_destroy_options(&options); ares_destroy(channel); return HasFailure(); } NameContentList hostconf = { {"/etc/resolv.conf", "nameserver 1.2.3.4\n" "sortlist1.2.3.4\n" // malformed line "search first.com second.com\n"}, {"/etc/host.conf", "order bind hosts\n"}}; CONTAINED_TEST_F(LibraryTest, ContainerHostConfInit, "myhostname", "mydomainname.org", hostconf) { ares_channel channel = nullptr; EXPECT_EQ(ARES_SUCCESS, ares_init(&channel)); struct ares_options opts; int optmask = 0; ares_save_options(channel, &opts, &optmask); EXPECT_EQ(std::string("bf"), std::string(opts.lookups)); ares_destroy_options(&opts); ares_destroy(channel); return HasFailure(); } NameContentList svcconf = { {"/etc/resolv.conf", "nameserver 1.2.3.4\n" "search first.com second.com\n"}, {"/etc/svc.conf", "hosts= bind\n"}}; CONTAINED_TEST_F(LibraryTest, ContainerSvcConfInit, "myhostname", "mydomainname.org", svcconf) { ares_channel channel = nullptr; EXPECT_EQ(ARES_SUCCESS, ares_init(&channel)); struct ares_options opts; int optmask = 0; ares_save_options(channel, &opts, &optmask); EXPECT_EQ(std::string("b"), std::string(opts.lookups)); ares_destroy_options(&opts); ares_destroy(channel); return HasFailure(); } NameContentList malformedresolvconflookup = { {"/etc/resolv.conf", "nameserver 1.2.3.4\n" "lookup garbage\n"}}; // malformed line CONTAINED_TEST_F(LibraryTest, ContainerMalformedResolvConfLookup, "myhostname", "mydomainname.org", malformedresolvconflookup) { ares_channel channel = nullptr; EXPECT_EQ(ARES_SUCCESS, ares_init(&channel)); struct ares_options opts; int optmask = 0; ares_save_options(channel, &opts, &optmask); EXPECT_EQ(std::string("fb"), std::string(opts.lookups)); ares_destroy_options(&opts); ares_destroy(channel); return HasFailure(); } // Failures when expected config filenames are inaccessible. class MakeUnreadable { public: explicit MakeUnreadable(const std::string& filename) : filename_(filename) { chmod(filename_.c_str(), 0000); } ~MakeUnreadable() { chmod(filename_.c_str(), 0644); } private: std::string filename_; }; CONTAINED_TEST_F(LibraryTest, ContainerResolvConfNotReadable, "myhostname", "mydomainname.org", filelist) { ares_channel channel = nullptr; MakeUnreadable hide("/etc/resolv.conf"); // Unavailable /etc/resolv.conf falls back to defaults EXPECT_EQ(ARES_SUCCESS, ares_init(&channel)); return HasFailure(); } CONTAINED_TEST_F(LibraryTest, ContainerNsswitchConfNotReadable, "myhostname", "mydomainname.org", filelist) { ares_channel channel = nullptr; // Unavailable /etc/nsswitch.conf falls back to defaults. MakeUnreadable hide("/etc/nsswitch.conf"); EXPECT_EQ(ARES_SUCCESS, ares_init(&channel)); struct ares_options opts; int optmask = 0; ares_save_options(channel, &opts, &optmask); EXPECT_EQ(std::string("fb"), std::string(opts.lookups)); ares_destroy_options(&opts); ares_destroy(channel); return HasFailure(); } CONTAINED_TEST_F(LibraryTest, ContainerHostConfNotReadable, "myhostname", "mydomainname.org", hostconf) { ares_channel channel = nullptr; // Unavailable /etc/host.conf falls back to defaults. MakeUnreadable hide("/etc/host.conf"); EXPECT_EQ(ARES_SUCCESS, ares_init(&channel)); ares_destroy(channel); return HasFailure(); } CONTAINED_TEST_F(LibraryTest, ContainerSvcConfNotReadable, "myhostname", "mydomainname.org", svcconf) { ares_channel channel = nullptr; // Unavailable /etc/svc.conf falls back to defaults. MakeUnreadable hide("/etc/svc.conf"); EXPECT_EQ(ARES_SUCCESS, ares_init(&channel)); ares_destroy(channel); return HasFailure(); } NameContentList rotateenv = { {"/etc/resolv.conf", "nameserver 1.2.3.4\n" "search first.com second.com\n" "options rotate\n"}}; CONTAINED_TEST_F(LibraryTest, ContainerRotateInit, "myhostname", "mydomainname.org", rotateenv) { ares_channel channel = nullptr; EXPECT_EQ(ARES_SUCCESS, ares_init(&channel)); struct ares_options opts; int optmask = 0; ares_save_options(channel, &opts, &optmask); EXPECT_EQ(ARES_OPT_ROTATE, (optmask & ARES_OPT_ROTATE)); ares_destroy_options(&opts); ares_destroy(channel); return HasFailure(); } CONTAINED_TEST_F(LibraryTest, ContainerRotateOverride, "myhostname", "mydomainname.org", rotateenv) { ares_channel channel = nullptr; struct ares_options opts = {0}; int optmask = ARES_OPT_NOROTATE; EXPECT_EQ(ARES_SUCCESS, ares_init_options(&channel, &opts, optmask)); optmask = 0; ares_save_options(channel, &opts, &optmask); EXPECT_EQ(ARES_OPT_NOROTATE, (optmask & ARES_OPT_NOROTATE)); ares_destroy_options(&opts); ares_destroy(channel); return HasFailure(); } // Test that blacklisted IPv6 resolves are ignored. They're filtered from any // source, so resolv.conf is as good as any. NameContentList blacklistedIpv6 = { {"/etc/resolv.conf", " nameserver 254.192.1.1\n" // 0xfe.0xc0.0x01.0x01 " nameserver fec0::dead\n" // Blacklisted " nameserver ffc0::c001\n" // Not blacklisted " domain first.com\n"}, {"/etc/nsswitch.conf", "hosts: files\n"}}; CONTAINED_TEST_F(LibraryTest, ContainerBlacklistedIpv6, "myhostname", "mydomainname.org", blacklistedIpv6) { ares_channel channel = nullptr; EXPECT_EQ(ARES_SUCCESS, ares_init(&channel)); std::vector actual = GetNameServers(channel); std::vector expected = { "254.192.1.1", "ffc0:0000:0000:0000:0000:0000:0000:c001" }; EXPECT_EQ(expected, actual); struct ares_options opts; int optmask = 0; ares_save_options(channel, &opts, &optmask); EXPECT_EQ(1, opts.ndomains); EXPECT_EQ(std::string("first.com"), std::string(opts.domains[0])); ares_destroy_options(&opts); ares_destroy(channel); return HasFailure(); } NameContentList multiresolv = { {"/etc/resolv.conf", " nameserver 1::2 ; ;;\n" " domain first.com\n"}, {"/etc/nsswitch.conf", "hosts: files\n"}}; CONTAINED_TEST_F(LibraryTest, ContainerMultiResolvInit, "myhostname", "mydomainname.org", multiresolv) { ares_channel channel = nullptr; EXPECT_EQ(ARES_SUCCESS, ares_init(&channel)); std::vector actual = GetNameServers(channel); std::vector expected = {"0001:0000:0000:0000:0000:0000:0000:0002"}; EXPECT_EQ(expected, actual); struct ares_options opts; int optmask = 0; ares_save_options(channel, &opts, &optmask); EXPECT_EQ(1, opts.ndomains); EXPECT_EQ(std::string("first.com"), std::string(opts.domains[0])); ares_destroy_options(&opts); ares_destroy(channel); return HasFailure(); } NameContentList systemdresolv = { {"/etc/resolv.conf", "nameserver 1.2.3.4\n" "domain first.com\n"}, {"/etc/nsswitch.conf", "hosts: junk resolve files\n"}}; CONTAINED_TEST_F(LibraryTest, ContainerSystemdResolvInit, "myhostname", "mydomainname.org", systemdresolv) { ares_channel channel = nullptr; EXPECT_EQ(ARES_SUCCESS, ares_init(&channel)); struct ares_options opts; int optmask = 0; ares_save_options(channel, &opts, &optmask); EXPECT_EQ(std::string("bf"), std::string(opts.lookups)); ares_destroy_options(&opts); ares_destroy(channel); return HasFailure(); } NameContentList empty = {}; // no files CONTAINED_TEST_F(LibraryTest, ContainerEmptyInit, "host.domain.org", "domain.org", empty) { ares_channel channel = nullptr; EXPECT_EQ(ARES_SUCCESS, ares_init(&channel)); std::vector actual = GetNameServers(channel); std::vector expected = {"127.0.0.1"}; EXPECT_EQ(expected, actual); struct ares_options opts; int optmask = 0; ares_save_options(channel, &opts, &optmask); EXPECT_EQ(1, opts.ndomains); EXPECT_EQ(std::string("domain.org"), std::string(opts.domains[0])); EXPECT_EQ(std::string("fb"), std::string(opts.lookups)); ares_destroy_options(&opts); ares_destroy(channel); return HasFailure(); } #endif } // namespace test } // namespace ares ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/ares-test-internal.cc0000644000175100001770000005331600000000000023117 0ustar00runnerdocker00000000000000#include "ares-test.h" #include "dns-proto.h" #include #ifdef HAVE_UNISTD_H #include #endif #include extern "C" { // Remove command-line defines of package variables for the test project... #undef PACKAGE_NAME #undef PACKAGE_BUGREPORT #undef PACKAGE_STRING #undef PACKAGE_TARNAME // ... so we can include the library's config without symbol redefinitions. #include "ares_setup.h" #include "ares_nowarn.h" #include "ares_inet_net_pton.h" #include "ares_data.h" #include "ares_private.h" #include "bitncmp.h" #ifdef HAVE_ARPA_INET_H #include #endif #ifdef HAVE_SYS_UIO_H # include #endif } #include #include namespace ares { namespace test { #ifndef CARES_SYMBOL_HIDING void CheckPtoN4(int size, unsigned int value, const char *input) { struct in_addr a4; a4.s_addr = 0; uint32_t expected = htonl(value); EXPECT_EQ(size, ares_inet_net_pton(AF_INET, input, &a4, sizeof(a4))) << " for input " << input; EXPECT_EQ(expected, a4.s_addr) << " for input " << input; } #endif TEST_F(LibraryTest, InetPtoN) { struct in_addr a4; struct in6_addr a6; #ifndef CARES_SYMBOL_HIDING uint32_t expected; CheckPtoN4(4 * 8, 0x01020304, "1.2.3.4"); CheckPtoN4(4 * 8, 0x81010101, "129.1.1.1"); CheckPtoN4(4 * 8, 0xC0010101, "192.1.1.1"); CheckPtoN4(4 * 8, 0xE0010101, "224.1.1.1"); CheckPtoN4(4 * 8, 0xE1010101, "225.1.1.1"); CheckPtoN4(4, 0xE0000000, "224"); CheckPtoN4(4 * 8, 0xFD000000, "253"); CheckPtoN4(4 * 8, 0xF0010101, "240.1.1.1"); CheckPtoN4(4 * 8, 0x02030405, "02.3.4.5"); CheckPtoN4(3 * 8, 0x01020304, "1.2.3.4/24"); CheckPtoN4(3 * 8, 0x01020300, "1.2.3/24"); CheckPtoN4(2 * 8, 0xa0000000, "0xa"); CheckPtoN4(0, 0x02030405, "2.3.4.5/000"); CheckPtoN4(1 * 8, 0x01020000, "1.2/8"); CheckPtoN4(2 * 8, 0x01020000, "0x0102/16"); CheckPtoN4(4 * 8, 0x02030405, "02.3.4.5"); EXPECT_EQ(16 * 8, ares_inet_net_pton(AF_INET6, "::", &a6, sizeof(a6))); EXPECT_EQ(16 * 8, ares_inet_net_pton(AF_INET6, "::1", &a6, sizeof(a6))); EXPECT_EQ(16 * 8, ares_inet_net_pton(AF_INET6, "1234:5678::", &a6, sizeof(a6))); EXPECT_EQ(16 * 8, ares_inet_net_pton(AF_INET6, "12:34::ff", &a6, sizeof(a6))); EXPECT_EQ(16 * 8, ares_inet_net_pton(AF_INET6, "12:34::ffff:1.2.3.4", &a6, sizeof(a6))); EXPECT_EQ(23, ares_inet_net_pton(AF_INET6, "12:34::ffff:1.2.3.4/23", &a6, sizeof(a6))); EXPECT_EQ(3 * 8, ares_inet_net_pton(AF_INET6, "12:34::ff/24", &a6, sizeof(a6))); EXPECT_EQ(0, ares_inet_net_pton(AF_INET6, "12:34::ff/0", &a6, sizeof(a6))); EXPECT_EQ(16 * 8, ares_inet_net_pton(AF_INET6, "12:34::ffff:0.2", &a6, sizeof(a6))); EXPECT_EQ(16 * 8, ares_inet_net_pton(AF_INET6, "1234:1234:1234:1234:1234:1234:1234:1234", &a6, sizeof(a6))); // Various malformed versions EXPECT_EQ(-1, ares_inet_net_pton(AF_INET, "", &a4, sizeof(a4))); EXPECT_EQ(-1, ares_inet_net_pton(AF_INET, " ", &a4, sizeof(a4))); EXPECT_EQ(-1, ares_inet_net_pton(AF_INET, "0x", &a4, sizeof(a4))); EXPECT_EQ(-1, ares_inet_net_pton(AF_INET, "0x ", &a4, sizeof(a4))); EXPECT_EQ(-1, ares_inet_net_pton(AF_INET, "x0", &a4, sizeof(a4))); EXPECT_EQ(-1, ares_inet_net_pton(AF_INET, "0xXYZZY", &a4, sizeof(a4))); EXPECT_EQ(-1, ares_inet_net_pton(AF_INET, "xyzzy", &a4, sizeof(a4))); EXPECT_EQ(-1, ares_inet_net_pton(AF_INET+AF_INET6, "1.2.3.4", &a4, sizeof(a4))); EXPECT_EQ(-1, ares_inet_net_pton(AF_INET, "257.2.3.4", &a4, sizeof(a4))); EXPECT_EQ(-1, ares_inet_net_pton(AF_INET, "002.3.4.x", &a4, sizeof(a4))); EXPECT_EQ(-1, ares_inet_net_pton(AF_INET, "00.3.4.x", &a4, sizeof(a4))); EXPECT_EQ(-1, ares_inet_net_pton(AF_INET, "2.3.4.x", &a4, sizeof(a4))); EXPECT_EQ(-1, ares_inet_net_pton(AF_INET, "2.3.4.5.6", &a4, sizeof(a4))); EXPECT_EQ(-1, ares_inet_net_pton(AF_INET, "2.3.4.5.6/12", &a4, sizeof(a4))); EXPECT_EQ(-1, ares_inet_net_pton(AF_INET, "2.3.4:5", &a4, sizeof(a4))); EXPECT_EQ(-1, ares_inet_net_pton(AF_INET, "2.3.4.5/120", &a4, sizeof(a4))); EXPECT_EQ(-1, ares_inet_net_pton(AF_INET, "2.3.4.5/1x", &a4, sizeof(a4))); EXPECT_EQ(-1, ares_inet_net_pton(AF_INET, "2.3.4.5/x", &a4, sizeof(a4))); EXPECT_EQ(-1, ares_inet_net_pton(AF_INET6, "12:34::ff/240", &a6, sizeof(a6))); EXPECT_EQ(-1, ares_inet_net_pton(AF_INET6, "12:34::ff/02", &a6, sizeof(a6))); EXPECT_EQ(-1, ares_inet_net_pton(AF_INET6, "12:34::ff/2y", &a6, sizeof(a6))); EXPECT_EQ(-1, ares_inet_net_pton(AF_INET6, "12:34::ff/y", &a6, sizeof(a6))); EXPECT_EQ(-1, ares_inet_net_pton(AF_INET6, "12:34::ff/", &a6, sizeof(a6))); EXPECT_EQ(-1, ares_inet_net_pton(AF_INET6, "", &a6, sizeof(a6))); EXPECT_EQ(-1, ares_inet_net_pton(AF_INET6, ":x", &a6, sizeof(a6))); EXPECT_EQ(-1, ares_inet_net_pton(AF_INET6, ":", &a6, sizeof(a6))); EXPECT_EQ(-1, ares_inet_net_pton(AF_INET6, ": :1234", &a6, sizeof(a6))); EXPECT_EQ(-1, ares_inet_net_pton(AF_INET6, "::12345", &a6, sizeof(a6))); EXPECT_EQ(-1, ares_inet_net_pton(AF_INET6, "1234::2345:3456::0011", &a6, sizeof(a6))); EXPECT_EQ(-1, ares_inet_net_pton(AF_INET6, "1234:1234:1234:1234:1234:1234:1234:1234:", &a6, sizeof(a6))); EXPECT_EQ(-1, ares_inet_net_pton(AF_INET6, "1234:1234:1234:1234:1234:1234:1234:1234::", &a6, sizeof(a6))); EXPECT_EQ(-1, ares_inet_net_pton(AF_INET6, "1234:1234:1234:1234:1234:1234:1234:1.2.3.4", &a6, sizeof(a6))); EXPECT_EQ(-1, ares_inet_net_pton(AF_INET6, ":1234:1234:1234:1234:1234:1234:1234:1234", &a6, sizeof(a6))); EXPECT_EQ(-1, ares_inet_net_pton(AF_INET6, ":1234:1234:1234:1234:1234:1234:1234:1234:", &a6, sizeof(a6))); EXPECT_EQ(-1, ares_inet_net_pton(AF_INET6, "1234:1234:1234:1234:1234:1234:1234:1234:5678", &a6, sizeof(a6))); // TODO(drysdale): check whether the next two tests should give -1. EXPECT_EQ(0, ares_inet_net_pton(AF_INET6, "1234:1234:1234:1234:1234:1234:1234:1234:5678:5678", &a6, sizeof(a6))); EXPECT_EQ(0, ares_inet_net_pton(AF_INET6, "1234:1234:1234:1234:1234:1234:1234:1234:5678:5678:5678", &a6, sizeof(a6))); EXPECT_EQ(-1, ares_inet_net_pton(AF_INET6, "12:34::ffff:257.2.3.4", &a6, sizeof(a6))); EXPECT_EQ(-1, ares_inet_net_pton(AF_INET6, "12:34::ffff:002.2.3.4", &a6, sizeof(a6))); EXPECT_EQ(-1, ares_inet_net_pton(AF_INET6, "12:34::ffff:1.2.3.4.5.6", &a6, sizeof(a6))); EXPECT_EQ(-1, ares_inet_net_pton(AF_INET6, "12:34::ffff:1.2.3.4.5", &a6, sizeof(a6))); EXPECT_EQ(-1, ares_inet_net_pton(AF_INET6, "12:34::ffff:1.2.3.z", &a6, sizeof(a6))); EXPECT_EQ(-1, ares_inet_net_pton(AF_INET6, "12:34::ffff:1.2.3001.4", &a6, sizeof(a6))); EXPECT_EQ(-1, ares_inet_net_pton(AF_INET6, "12:34::ffff:1.2.3..4", &a6, sizeof(a6))); EXPECT_EQ(-1, ares_inet_net_pton(AF_INET6, "12:34::ffff:1.2.3.", &a6, sizeof(a6))); // Hex constants are allowed. EXPECT_EQ(4 * 8, ares_inet_net_pton(AF_INET, "0x01020304", &a4, sizeof(a4))); expected = htonl(0x01020304); EXPECT_EQ(expected, a4.s_addr); EXPECT_EQ(4 * 8, ares_inet_net_pton(AF_INET, "0x0a0b0c0d", &a4, sizeof(a4))); expected = htonl(0x0a0b0c0d); EXPECT_EQ(expected, a4.s_addr); EXPECT_EQ(4 * 8, ares_inet_net_pton(AF_INET, "0x0A0B0C0D", &a4, sizeof(a4))); expected = htonl(0x0a0b0c0d); EXPECT_EQ(expected, a4.s_addr); EXPECT_EQ(-1, ares_inet_net_pton(AF_INET, "0x0xyz", &a4, sizeof(a4))); EXPECT_EQ(4 * 8, ares_inet_net_pton(AF_INET, "0x1122334", &a4, sizeof(a4))); expected = htonl(0x11223340); EXPECT_EQ(expected, a4.s_addr); // huh? // No room, no room. EXPECT_EQ(-1, ares_inet_net_pton(AF_INET, "1.2.3.4", &a4, sizeof(a4) - 1)); EXPECT_EQ(-1, ares_inet_net_pton(AF_INET6, "12:34::ff", &a6, sizeof(a6) - 1)); EXPECT_EQ(-1, ares_inet_net_pton(AF_INET, "0x01020304", &a4, 2)); EXPECT_EQ(-1, ares_inet_net_pton(AF_INET, "0x01020304", &a4, 0)); EXPECT_EQ(-1, ares_inet_net_pton(AF_INET, "0x0a0b0c0d", &a4, 0)); EXPECT_EQ(-1, ares_inet_net_pton(AF_INET, "0x0xyz", &a4, 0)); EXPECT_EQ(-1, ares_inet_net_pton(AF_INET, "0x1122334", &a4, sizeof(a4) - 1)); EXPECT_EQ(-1, ares_inet_net_pton(AF_INET, "253", &a4, sizeof(a4) - 1)); #endif EXPECT_EQ(1, ares_inet_pton(AF_INET, "1.2.3.4", &a4)); EXPECT_EQ(1, ares_inet_pton(AF_INET6, "12:34::ff", &a6)); EXPECT_EQ(1, ares_inet_pton(AF_INET6, "12:34::ffff:1.2.3.4", &a6)); EXPECT_EQ(0, ares_inet_pton(AF_INET, "xyzzy", &a4)); EXPECT_EQ(-1, ares_inet_pton(AF_INET+AF_INET6, "1.2.3.4", &a4)); } TEST_F(LibraryTest, FreeCorruptData) { // ares_free_data(p) expects that there is a type field and a marker // field in the memory before p. Feed it incorrect versions of each. struct ares_data *data = (struct ares_data *)malloc(sizeof(struct ares_data)); void* p = &(data->data); // Invalid type data->type = (ares_datatype)99; data->mark = ARES_DATATYPE_MARK; ares_free_data(p); // Invalid marker data->type = (ares_datatype)ARES_DATATYPE_MX_REPLY; data->mark = ARES_DATATYPE_MARK + 1; ares_free_data(p); // Null pointer ares_free_data(nullptr); free(data); } #ifndef CARES_SYMBOL_HIDING TEST_F(LibraryTest, FreeLongChain) { struct ares_addr_node *data = nullptr; for (int ii = 0; ii < 100000; ii++) { struct ares_addr_node *prev = (struct ares_addr_node*)ares_malloc_data(ARES_DATATYPE_ADDR_NODE); prev->next = data; data = prev; } ares_free_data(data); } TEST(LibraryInit, StrdupFailures) { EXPECT_EQ(ARES_SUCCESS, ares_library_init(ARES_LIB_INIT_ALL)); char* copy = ares_strdup("string"); EXPECT_NE(nullptr, copy); ares_free(copy); ares_library_cleanup(); } TEST_F(LibraryTest, StrdupFailures) { SetAllocFail(1); char* copy = ares_strdup("string"); EXPECT_EQ(nullptr, copy); } TEST_F(LibraryTest, MallocDataFail) { EXPECT_EQ(nullptr, ares_malloc_data((ares_datatype)99)); SetAllocSizeFail(sizeof(struct ares_data)); EXPECT_EQ(nullptr, ares_malloc_data(ARES_DATATYPE_MX_REPLY)); } TEST(Misc, Bitncmp) { byte a[4] = {0x80, 0x01, 0x02, 0x03}; byte b[4] = {0x80, 0x01, 0x02, 0x04}; byte c[4] = {0x01, 0xFF, 0x80, 0x02}; EXPECT_GT(0, ares__bitncmp(a, b, sizeof(a)*8)); EXPECT_LT(0, ares__bitncmp(b, a, sizeof(a)*8)); EXPECT_EQ(0, ares__bitncmp(a, a, sizeof(a)*8)); for (int ii = 1; ii < (3*8+5); ii++) { EXPECT_EQ(0, ares__bitncmp(a, b, ii)); EXPECT_EQ(0, ares__bitncmp(b, a, ii)); EXPECT_LT(0, ares__bitncmp(a, c, ii)); EXPECT_GT(0, ares__bitncmp(c, a, ii)); } // Last byte differs at 5th bit EXPECT_EQ(0, ares__bitncmp(a, b, 3*8 + 3)); EXPECT_EQ(0, ares__bitncmp(a, b, 3*8 + 4)); EXPECT_EQ(0, ares__bitncmp(a, b, 3*8 + 5)); EXPECT_GT(0, ares__bitncmp(a, b, 3*8 + 6)); EXPECT_GT(0, ares__bitncmp(a, b, 3*8 + 7)); } TEST_F(LibraryTest, Casts) { ares_ssize_t ssz = 100; unsigned int u = 100; int i = 100; long l = 100; unsigned int ru = aresx_sztoui(ssz); EXPECT_EQ(u, ru); int ri = aresx_sztosi(ssz); EXPECT_EQ(i, ri); ri = aresx_sltosi(l); EXPECT_EQ(l, (long)ri); } TEST_F(LibraryTest, ReadLine) { TempFile temp("abcde\n0123456789\nXYZ\n012345678901234567890\n\n"); FILE *fp = fopen(temp.filename(), "r"); size_t bufsize = 4; char *buf = (char *)ares_malloc(bufsize); EXPECT_EQ(ARES_SUCCESS, ares__read_line(fp, &buf, &bufsize)); EXPECT_EQ("abcde", std::string(buf)); EXPECT_EQ(ARES_SUCCESS, ares__read_line(fp, &buf, &bufsize)); EXPECT_EQ("0123456789", std::string(buf)); EXPECT_EQ(ARES_SUCCESS, ares__read_line(fp, &buf, &bufsize)); EXPECT_EQ("XYZ", std::string(buf)); SetAllocFail(1); EXPECT_EQ(ARES_ENOMEM, ares__read_line(fp, &buf, &bufsize)); EXPECT_EQ(nullptr, buf); fclose(fp); ares_free(buf); } TEST_F(LibraryTest, ReadLineNoBuf) { TempFile temp("abcde\n0123456789\nXYZ\n012345678901234567890"); FILE *fp = fopen(temp.filename(), "r"); size_t bufsize = 0; char *buf = nullptr; SetAllocFail(1); EXPECT_EQ(ARES_ENOMEM, ares__read_line(fp, &buf, &bufsize)); EXPECT_EQ(ARES_SUCCESS, ares__read_line(fp, &buf, &bufsize)); EXPECT_EQ("abcde", std::string(buf)); EXPECT_EQ(ARES_SUCCESS, ares__read_line(fp, &buf, &bufsize)); EXPECT_EQ("0123456789", std::string(buf)); EXPECT_EQ(ARES_SUCCESS, ares__read_line(fp, &buf, &bufsize)); EXPECT_EQ("XYZ", std::string(buf)); EXPECT_EQ(ARES_SUCCESS, ares__read_line(fp, &buf, &bufsize)); EXPECT_EQ("012345678901234567890", std::string(buf)); fclose(fp); ares_free(buf); } TEST(Misc, GetHostent) { TempFile hostsfile("1.2.3.4 example.com \n" " 2.3.4.5\tgoogle.com www.google.com\twww2.google.com\n" "#comment\n" "4.5.6.7\n" "1.3.5.7 \n" "::1 ipv6.com"); struct hostent *host = nullptr; FILE *fp = fopen(hostsfile.filename(), "r"); ASSERT_NE(nullptr, fp); EXPECT_EQ(ARES_EBADFAMILY, ares__get_hostent(fp, AF_INET+AF_INET6, &host)); rewind(fp); EXPECT_EQ(ARES_SUCCESS, ares__get_hostent(fp, AF_INET, &host)); ASSERT_NE(nullptr, host); std::stringstream ss1; ss1 << HostEnt(host); EXPECT_EQ("{'example.com' aliases=[] addrs=[1.2.3.4]}", ss1.str()); ares_free_hostent(host); host = nullptr; EXPECT_EQ(ARES_SUCCESS, ares__get_hostent(fp, AF_INET, &host)); ASSERT_NE(nullptr, host); std::stringstream ss2; ss2 << HostEnt(host); EXPECT_EQ("{'google.com' aliases=[www.google.com, www2.google.com] addrs=[2.3.4.5]}", ss2.str()); ares_free_hostent(host); host = nullptr; EXPECT_EQ(ARES_EOF, ares__get_hostent(fp, AF_INET, &host)); rewind(fp); EXPECT_EQ(ARES_SUCCESS, ares__get_hostent(fp, AF_INET6, &host)); ASSERT_NE(nullptr, host); std::stringstream ss3; ss3 << HostEnt(host); EXPECT_EQ("{'ipv6.com' aliases=[] addrs=[0000:0000:0000:0000:0000:0000:0000:0001]}", ss3.str()); ares_free_hostent(host); host = nullptr; EXPECT_EQ(ARES_EOF, ares__get_hostent(fp, AF_INET6, &host)); fclose(fp); } TEST_F(LibraryTest, GetHostentAllocFail) { TempFile hostsfile("1.2.3.4 example.com alias1 alias2\n"); struct hostent *host = nullptr; FILE *fp = fopen(hostsfile.filename(), "r"); ASSERT_NE(nullptr, fp); for (int ii = 1; ii <= 8; ii++) { rewind(fp); ClearFails(); SetAllocFail(ii); host = nullptr; EXPECT_EQ(ARES_ENOMEM, ares__get_hostent(fp, AF_INET, &host)) << ii; } fclose(fp); } TEST_F(DefaultChannelTest, GetAddrInfoHostsPositive) { TempFile hostsfile("1.2.3.4 example.com \n" " 2.3.4.5\tgoogle.com www.google.com\twww2.google.com\n" "#comment\n" "4.5.6.7\n" "1.3.5.7 \n" "::1 ipv6.com"); EnvValue with_env("CARES_HOSTS", hostsfile.filename()); struct ares_addrinfo_hints hints = {}; AddrInfoResult result = {}; hints.ai_family = AF_INET; hints.ai_flags = ARES_AI_CANONNAME | ARES_AI_ENVHOSTS | ARES_AI_NOSORT; ares_getaddrinfo(channel_, "example.com", NULL, &hints, AddrInfoCallback, &result); Process(); EXPECT_TRUE(result.done_); std::stringstream ss; ss << result.ai_; EXPECT_EQ("{example.com addr=[1.2.3.4]}", ss.str()); } TEST_F(DefaultChannelTest, GetAddrInfoHostsSpaces) { TempFile hostsfile("1.2.3.4 example.com \n" " 2.3.4.5\tgoogle.com www.google.com\twww2.google.com\n" "#comment\n" "4.5.6.7\n" "1.3.5.7 \n" "::1 ipv6.com"); EnvValue with_env("CARES_HOSTS", hostsfile.filename()); struct ares_addrinfo_hints hints = {}; AddrInfoResult result = {}; hints.ai_family = AF_INET; hints.ai_flags = ARES_AI_CANONNAME | ARES_AI_ENVHOSTS | ARES_AI_NOSORT; ares_getaddrinfo(channel_, "google.com", NULL, &hints, AddrInfoCallback, &result); Process(); EXPECT_TRUE(result.done_); std::stringstream ss; ss << result.ai_; EXPECT_EQ("{www.google.com->google.com, www2.google.com->google.com addr=[2.3.4.5]}", ss.str()); } TEST_F(DefaultChannelTest, GetAddrInfoHostsByALias) { TempFile hostsfile("1.2.3.4 example.com \n" " 2.3.4.5\tgoogle.com www.google.com\twww2.google.com\n" "#comment\n" "4.5.6.7\n" "1.3.5.7 \n" "::1 ipv6.com"); EnvValue with_env("CARES_HOSTS", hostsfile.filename()); struct ares_addrinfo_hints hints = {}; AddrInfoResult result = {}; hints.ai_family = AF_INET; hints.ai_flags = ARES_AI_CANONNAME | ARES_AI_ENVHOSTS | ARES_AI_NOSORT; ares_getaddrinfo(channel_, "www2.google.com", NULL, &hints, AddrInfoCallback, &result); Process(); EXPECT_TRUE(result.done_); std::stringstream ss; ss << result.ai_; EXPECT_EQ("{www.google.com->google.com, www2.google.com->google.com addr=[2.3.4.5]}", ss.str()); } TEST_F(DefaultChannelTest, GetAddrInfoHostsIPV6) { TempFile hostsfile("1.2.3.4 example.com \n" " 2.3.4.5\tgoogle.com www.google.com\twww2.google.com\n" "#comment\n" "4.5.6.7\n" "1.3.5.7 \n" "::1 ipv6.com"); EnvValue with_env("CARES_HOSTS", hostsfile.filename()); struct ares_addrinfo_hints hints = {}; AddrInfoResult result = {}; hints.ai_family = AF_INET6; hints.ai_flags = ARES_AI_CANONNAME | ARES_AI_ENVHOSTS | ARES_AI_NOSORT; ares_getaddrinfo(channel_, "ipv6.com", NULL, &hints, AddrInfoCallback, &result); Process(); EXPECT_TRUE(result.done_); std::stringstream ss; ss << result.ai_; EXPECT_EQ("{ipv6.com addr=[[0000:0000:0000:0000:0000:0000:0000:0001]]}", ss.str()); } TEST_F(LibraryTest, GetAddrInfoAllocFail) { TempFile hostsfile("1.2.3.4 example.com alias1 alias2\n"); struct ares_addrinfo_hints hints; unsigned short port = 80; memset(&hints, 0, sizeof(hints)); hints.ai_family = AF_INET; FILE *fp = fopen(hostsfile.filename(), "r"); ASSERT_NE(nullptr, fp); for (int ii = 1; ii <= 3; ii++) { rewind(fp); ClearFails(); SetAllocFail(ii); struct ares_addrinfo ai; EXPECT_EQ(ARES_ENOMEM, ares__readaddrinfo(fp, "example.com", port, &hints, &ai)) << ii; } fclose(fp); } TEST(Misc, OnionDomain) { EXPECT_EQ(0, ares__is_onion_domain("onion.no")); EXPECT_EQ(0, ares__is_onion_domain(".onion.no")); EXPECT_EQ(1, ares__is_onion_domain(".onion")); EXPECT_EQ(1, ares__is_onion_domain(".onion.")); EXPECT_EQ(1, ares__is_onion_domain("yes.onion")); EXPECT_EQ(1, ares__is_onion_domain("yes.onion.")); EXPECT_EQ(1, ares__is_onion_domain("YES.ONION")); EXPECT_EQ(1, ares__is_onion_domain("YES.ONION.")); } #endif #ifdef CARES_EXPOSE_STATICS // These tests access internal static functions from the library, which // are only exposed when CARES_EXPOSE_STATICS has been configured. As such // they are tightly couple to the internal library implementation details. extern "C" char *ares_striendstr(const char*, const char*); TEST_F(LibraryTest, Striendstr) { EXPECT_EQ(nullptr, ares_striendstr("abc", "12345")); EXPECT_NE(nullptr, ares_striendstr("abc12345", "12345")); EXPECT_NE(nullptr, ares_striendstr("abcxyzzy", "XYZZY")); EXPECT_NE(nullptr, ares_striendstr("xyzzy", "XYZZY")); EXPECT_EQ(nullptr, ares_striendstr("xyxzy", "XYZZY")); EXPECT_NE(nullptr, ares_striendstr("", "")); const char *str = "plugh"; EXPECT_NE(nullptr, ares_striendstr(str, str)); } extern "C" int ares__single_domain(ares_channel, const char*, char**); TEST_F(DefaultChannelTest, SingleDomain) { TempFile aliases("www www.google.com\n"); EnvValue with_env("HOSTALIASES", aliases.filename()); SetAllocSizeFail(128); char *ptr = nullptr; EXPECT_EQ(ARES_ENOMEM, ares__single_domain(channel_, "www", &ptr)); channel_->flags |= ARES_FLAG_NOSEARCH|ARES_FLAG_NOALIASES; EXPECT_EQ(ARES_SUCCESS, ares__single_domain(channel_, "www", &ptr)); EXPECT_EQ("www", std::string(ptr)); ares_free(ptr); ptr = nullptr; SetAllocFail(1); EXPECT_EQ(ARES_ENOMEM, ares__single_domain(channel_, "www", &ptr)); EXPECT_EQ(nullptr, ptr); } #endif TEST_F(DefaultChannelTest, SaveInvalidChannel) { int saved = channel_->nservers; channel_->nservers = -1; struct ares_options opts; int optmask = 0; EXPECT_EQ(ARES_ENODATA, ares_save_options(channel_, &opts, &optmask)); channel_->nservers = saved; } // Need to put this in own function due to nested lambda bug // in VS2013. (C2888) static int configure_socket(ares_socket_t s) { // transposed from ares-process, simplified non-block setter. #if defined(USE_BLOCKING_SOCKETS) return 0; /* returns success */ #elif defined(HAVE_FCNTL_O_NONBLOCK) /* most recent unix versions */ int flags; flags = fcntl(s, F_GETFL, 0); return fcntl(s, F_SETFL, flags | O_NONBLOCK); #elif defined(HAVE_IOCTL_FIONBIO) /* older unix versions */ int flags = 1; return ioctl(s, FIONBIO, &flags); #elif defined(HAVE_IOCTLSOCKET_FIONBIO) #ifdef WATT32 char flags = 1; #else /* Windows */ unsigned long flags = 1UL; #endif return ioctlsocket(s, FIONBIO, &flags); #elif defined(HAVE_IOCTLSOCKET_CAMEL_FIONBIO) /* Amiga */ long flags = 1L; return IoctlSocket(s, FIONBIO, flags); #elif defined(HAVE_SETSOCKOPT_SO_NONBLOCK) /* BeOS */ long b = 1L; return setsockopt(s, SOL_SOCKET, SO_NONBLOCK, &b, sizeof(b)); #else # error "no non-blocking method was found/used/set" #endif } // TODO: This should not really be in this file, but we need ares config // flags, and here they are available. const struct ares_socket_functions VirtualizeIO::default_functions = { [](int af, int type, int protocol, void *) -> ares_socket_t { auto s = ::socket(af, type, protocol); if (s == ARES_SOCKET_BAD) { return s; } if (configure_socket(s) != 0) { sclose(s); return ares_socket_t(-1); } return s; }, [](ares_socket_t s, void * p) { return :: sclose(s); }, [](ares_socket_t s, const struct sockaddr * addr, socklen_t len, void *) { return ::connect(s, addr, len); }, [](ares_socket_t s, void * dst, size_t len, int flags, struct sockaddr * addr, socklen_t * alen, void *) -> ares_ssize_t { #ifdef HAVE_RECVFROM return ::recvfrom(s, reinterpret_cast(dst), len, flags, addr, alen); #else return sread(s, dst, len); #endif }, [](ares_socket_t s, const struct iovec * vec, int len, void *) { #ifndef HAVE_WRITEV return ares_writev(s, vec, len); #else return :: writev(s, vec, len); #endif } }; } // namespace test } // namespace ares ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/ares-test-live.cc0000644000175100001770000006506300000000000022244 0ustar00runnerdocker00000000000000// This file includes tests that attempt to do real lookups // of DNS names using the local machine's live infrastructure. // As a result, we don't check the results very closely, to allow // for varying local configurations. #include "ares-test.h" #ifdef HAVE_NETDB_H #include #endif namespace ares { namespace test { // Use the address of Google's public DNS servers as example addresses that are // likely to be accessible everywhere/everywhen. unsigned char gdns_addr4[4] = {0x08, 0x08, 0x08, 0x08}; unsigned char gdns_addr6[16] = {0x20, 0x01, 0x48, 0x60, 0x48, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0x88}; MATCHER_P(IncludesAtLeastNumAddresses, n, "") { if(!arg) return false; int cnt = 0; for (const ares_addrinfo_node* ai = arg->nodes; ai != NULL; ai = ai->ai_next) cnt++; return cnt >= n; } MATCHER_P(OnlyIncludesAddrType, addrtype, "") { if(!arg) return false; for (const ares_addrinfo_node* ai = arg->nodes; ai != NULL; ai = ai->ai_next) if (ai->ai_family != addrtype) return false; return true; } MATCHER_P(IncludesAddrType, addrtype, "") { if(!arg) return false; for (const ares_addrinfo_node* ai = arg->nodes; ai != NULL; ai = ai->ai_next) if (ai->ai_family == addrtype) return true; return false; } //VIRT_NONVIRT_TEST_F(DefaultChannelTest, LiveGetAddrInfoV4) { //struct ares_addrinfo_hints hints = {}; //hints.ai_family = AF_INET; //AddrInfoResult result; //ares_getaddrinfo(channel_, "www.google.com.", NULL, &hints, AddrInfoCallback, &result); //Process(); //EXPECT_TRUE(result.done_); //EXPECT_EQ(ARES_SUCCESS, result.status_); //EXPECT_THAT(result.ai_, IncludesAtLeastNumAddresses(1)); //EXPECT_THAT(result.ai_, OnlyIncludesAddrType(AF_INET)); //} //VIRT_NONVIRT_TEST_F(DefaultChannelTest, LiveGetAddrInfoV6) { //struct ares_addrinfo_hints hints = {}; //hints.ai_family = AF_INET6; //AddrInfoResult result; //ares_getaddrinfo(channel_, "www.google.com.", NULL, &hints, AddrInfoCallback, &result); //Process(); //EXPECT_TRUE(result.done_); //EXPECT_EQ(ARES_SUCCESS, result.status_); //EXPECT_THAT(result.ai_, IncludesAtLeastNumAddresses(1)); //EXPECT_THAT(result.ai_, OnlyIncludesAddrType(AF_INET6)); //} //VIRT_NONVIRT_TEST_F(DefaultChannelTest, LiveGetAddrInfoUnspec) { //struct ares_addrinfo_hints hints = {}; //hints.ai_family = AF_UNSPEC; //AddrInfoResult result; //ares_getaddrinfo(channel_, "www.google.com.", NULL, &hints, AddrInfoCallback, &result); //Process(); //EXPECT_TRUE(result.done_); //EXPECT_EQ(ARES_SUCCESS, result.status_); //EXPECT_THAT(result.ai_, IncludesAtLeastNumAddresses(2)); //EXPECT_THAT(result.ai_, IncludesAddrType(AF_INET6)); //EXPECT_THAT(result.ai_, IncludesAddrType(AF_INET)); //} VIRT_NONVIRT_TEST_F(DefaultChannelTest, LiveGetHostByNameV4) { HostResult result; ares_gethostbyname(channel_, "www.google.com.", AF_INET, HostCallback, &result); Process(); EXPECT_TRUE(result.done_); EXPECT_EQ(ARES_SUCCESS, result.status_); EXPECT_LT(0, (int)result.host_.addrs_.size()); EXPECT_EQ(AF_INET, result.host_.addrtype_); } VIRT_NONVIRT_TEST_F(DefaultChannelTest, LiveGetHostByNameV6) { HostResult result; ares_gethostbyname(channel_, "www.google.com.", AF_INET6, HostCallback, &result); Process(); EXPECT_TRUE(result.done_); EXPECT_EQ(ARES_SUCCESS, result.status_); EXPECT_LT(0, (int)result.host_.addrs_.size()); EXPECT_EQ(AF_INET6, result.host_.addrtype_); } VIRT_NONVIRT_TEST_F(DefaultChannelTest, LiveGetHostByAddrV4) { HostResult result; ares_gethostbyaddr(channel_, gdns_addr4, sizeof(gdns_addr4), AF_INET, HostCallback, &result); Process(); EXPECT_TRUE(result.done_); EXPECT_EQ(ARES_SUCCESS, result.status_); EXPECT_LT(0, (int)result.host_.addrs_.size()); EXPECT_EQ(AF_INET, result.host_.addrtype_); } VIRT_NONVIRT_TEST_F(DefaultChannelTest, LiveGetHostByAddrV6) { HostResult result; ares_gethostbyaddr(channel_, gdns_addr6, sizeof(gdns_addr6), AF_INET6, HostCallback, &result); Process(); EXPECT_TRUE(result.done_); EXPECT_EQ(ARES_SUCCESS, result.status_); EXPECT_LT(0, (int)result.host_.addrs_.size()); EXPECT_EQ(AF_INET6, result.host_.addrtype_); } VIRT_NONVIRT_TEST_F(DefaultChannelTest, LiveGetHostByNameFile) { struct hostent *host = nullptr; // Still need a channel even to query /etc/hosts. EXPECT_EQ(ARES_ENOTFOUND, ares_gethostbyname_file(nullptr, "localhost", AF_INET, &host)); int rc = ares_gethostbyname_file(channel_, "bogus.mcname", AF_INET, &host); EXPECT_EQ(nullptr, host); EXPECT_EQ(ARES_ENOTFOUND, rc); rc = ares_gethostbyname_file(channel_, "localhost", AF_INET, &host); if (rc == ARES_SUCCESS) { EXPECT_NE(nullptr, host); ares_free_hostent(host); } } TEST_P(DefaultChannelModeTest, LiveGetLocalhostByNameV4) { HostResult result; ares_gethostbyname(channel_, "localhost", AF_INET, HostCallback, &result); Process(); EXPECT_TRUE(result.done_); if (result.status_ != ARES_ECONNREFUSED) { EXPECT_EQ(ARES_SUCCESS, result.status_); EXPECT_EQ(1, (int)result.host_.addrs_.size()); EXPECT_EQ(AF_INET, result.host_.addrtype_); EXPECT_NE(std::string::npos, result.host_.name_.find("localhost")); } } TEST_P(DefaultChannelModeTest, LiveGetLocalhostByNameV6) { HostResult result; ares_gethostbyname(channel_, "localhost", AF_INET6, HostCallback, &result); Process(); EXPECT_TRUE(result.done_); if (result.status_ != ARES_ECONNREFUSED) { EXPECT_EQ(1, (int)result.host_.addrs_.size()); EXPECT_EQ(AF_INET6, result.host_.addrtype_); std::stringstream ss; ss << HostEnt(result.host_); EXPECT_NE(std::string::npos, result.host_.name_.find("localhost")); } } TEST_P(DefaultChannelModeTest, LiveGetLocalhostByNameIPV4) { HostResult result; ares_gethostbyname(channel_, "127.0.0.1", AF_INET, HostCallback, &result); Process(); EXPECT_TRUE(result.done_); EXPECT_EQ(ARES_SUCCESS, result.status_); EXPECT_EQ(1, (int)result.host_.addrs_.size()); EXPECT_EQ(AF_INET, result.host_.addrtype_); std::stringstream ss; ss << HostEnt(result.host_); EXPECT_EQ("{'127.0.0.1' aliases=[] addrs=[127.0.0.1]}", ss.str()); } TEST_P(DefaultChannelModeTest, LiveGetLocalhostByNameIPV6) { HostResult result; ares_gethostbyname(channel_, "::1", AF_INET6, HostCallback, &result); Process(); EXPECT_TRUE(result.done_); if (result.status_ != ARES_ENOTFOUND) { EXPECT_EQ(ARES_SUCCESS, result.status_); EXPECT_EQ(1, (int)result.host_.addrs_.size()); EXPECT_EQ(AF_INET6, result.host_.addrtype_); std::stringstream ss; ss << HostEnt(result.host_); EXPECT_EQ("{'::1' aliases=[] addrs=[0000:0000:0000:0000:0000:0000:0000:0001]}", ss.str()); } } TEST_P(DefaultChannelModeTest, LiveGetLocalhostFailFamily) { HostResult result; ares_gethostbyname(channel_, "127.0.0.1", AF_INET+AF_INET6, HostCallback, &result); Process(); EXPECT_TRUE(result.done_); EXPECT_EQ(ARES_ENOTIMP, result.status_); } TEST_P(DefaultChannelModeTest, LiveGetLocalhostByAddrV4) { HostResult result; struct in_addr addr; addr.s_addr = htonl(INADDR_LOOPBACK); ares_gethostbyaddr(channel_, &addr, sizeof(addr), AF_INET, HostCallback, &result); Process(); EXPECT_TRUE(result.done_); if (result.status_ != ARES_ENOTFOUND) { EXPECT_EQ(ARES_SUCCESS, result.status_); EXPECT_LT(0, (int)result.host_.addrs_.size()); EXPECT_EQ(AF_INET, result.host_.addrtype_); // oddly, travis does not resolve to localhost, but a random hostname starting with travis-job if (result.host_.name_.find("travis-job") == std::string::npos) { EXPECT_NE(std::string::npos, result.host_.name_.find("localhost")); } } } TEST_P(DefaultChannelModeTest, LiveGetLocalhostByAddrV6) { HostResult result; struct in6_addr addr; memset(&addr, 0, sizeof(addr)); addr.s6_addr[15] = 1; // in6addr_loopback ares_gethostbyaddr(channel_, &addr, sizeof(addr), AF_INET6, HostCallback, &result); Process(); EXPECT_TRUE(result.done_); if (result.status_ != ARES_ENOTFOUND) { EXPECT_EQ(ARES_SUCCESS, result.status_); EXPECT_LT(0, (int)result.host_.addrs_.size()); EXPECT_EQ(AF_INET6, result.host_.addrtype_); const std::string& name = result.host_.name_; EXPECT_TRUE(std::string::npos != name.find("localhost") || std::string::npos != name.find("ip6-loopback")); } } TEST_P(DefaultChannelModeTest, LiveGetHostByAddrFailFamily) { HostResult result; unsigned char addr[4] = {8, 8, 8, 8}; ares_gethostbyaddr(channel_, addr, sizeof(addr), AF_INET6+AF_INET, HostCallback, &result); EXPECT_TRUE(result.done_); EXPECT_EQ(ARES_ENOTIMP, result.status_); } TEST_P(DefaultChannelModeTest, LiveGetHostByAddrFailAddrSize) { HostResult result; unsigned char addr[4] = {8, 8, 8, 8}; ares_gethostbyaddr(channel_, addr, sizeof(addr) - 1, AF_INET, HostCallback, &result); EXPECT_TRUE(result.done_); EXPECT_EQ(ARES_ENOTIMP, result.status_); } TEST_P(DefaultChannelModeTest, LiveGetHostByAddrFailAlloc) { HostResult result; unsigned char addr[4] = {8, 8, 8, 8}; SetAllocFail(1); ares_gethostbyaddr(channel_, addr, sizeof(addr), AF_INET, HostCallback, &result); EXPECT_TRUE(result.done_); EXPECT_EQ(ARES_ENOMEM, result.status_); } INSTANTIATE_TEST_SUITE_P(Modes, DefaultChannelModeTest, ::testing::Values("f", "b", "fb", "bf")); VIRT_NONVIRT_TEST_F(DefaultChannelTest, LiveSearchA) { SearchResult result; ares_search(channel_, "www.youtube.com.", C_IN, T_A, SearchCallback, &result); Process(); EXPECT_TRUE(result.done_); EXPECT_EQ(ARES_SUCCESS, result.status_); } VIRT_NONVIRT_TEST_F(DefaultChannelTest, LiveSearchEmptyA) { SearchResult result; ares_search(channel_, "", C_IN, T_A, SearchCallback, &result); Process(); EXPECT_TRUE(result.done_); EXPECT_NE(ARES_SUCCESS, result.status_); } VIRT_NONVIRT_TEST_F(DefaultChannelTest, LiveSearchNS) { SearchResult result; ares_search(channel_, "google.com.", C_IN, T_NS, SearchCallback, &result); Process(); EXPECT_TRUE(result.done_); EXPECT_EQ(ARES_SUCCESS, result.status_); } VIRT_NONVIRT_TEST_F(DefaultChannelTest, LiveSearchMX) { SearchResult result; ares_search(channel_, "google.com.", C_IN, T_MX, SearchCallback, &result); Process(); EXPECT_TRUE(result.done_); EXPECT_EQ(ARES_SUCCESS, result.status_); } VIRT_NONVIRT_TEST_F(DefaultChannelTest, LiveSearchTXT) { SearchResult result; ares_search(channel_, "google.com.", C_IN, T_TXT, SearchCallback, &result); Process(); EXPECT_TRUE(result.done_); EXPECT_EQ(ARES_SUCCESS, result.status_); } VIRT_NONVIRT_TEST_F(DefaultChannelTest, LiveSearchSOA) { SearchResult result; ares_search(channel_, "google.com.", C_IN, T_SOA, SearchCallback, &result); Process(); EXPECT_TRUE(result.done_); EXPECT_EQ(ARES_SUCCESS, result.status_); } VIRT_NONVIRT_TEST_F(DefaultChannelTest, LiveSearchSRV) { SearchResult result; ares_search(channel_, "_imap._tcp.gmail.com.", C_IN, T_SRV, SearchCallback, &result); Process(); EXPECT_TRUE(result.done_); EXPECT_EQ(ARES_SUCCESS, result.status_); } VIRT_NONVIRT_TEST_F(DefaultChannelTest, LiveSearchANY) { SearchResult result; ares_search(channel_, "google.com.", C_IN, T_ANY, SearchCallback, &result); Process(); EXPECT_TRUE(result.done_); EXPECT_EQ(ARES_SUCCESS, result.status_); } VIRT_NONVIRT_TEST_F(DefaultChannelTest, LiveGetNameInfoV4) { NameInfoResult result; struct sockaddr_in sockaddr; memset(&sockaddr, 0, sizeof(sockaddr)); sockaddr.sin_family = AF_INET; sockaddr.sin_port = htons(53); sockaddr.sin_addr.s_addr = htonl(0x08080808); ares_getnameinfo(channel_, (const struct sockaddr*)&sockaddr, sizeof(sockaddr), ARES_NI_LOOKUPHOST|ARES_NI_LOOKUPSERVICE|ARES_NI_UDP, NameInfoCallback, &result); Process(); EXPECT_TRUE(result.done_); EXPECT_EQ(ARES_SUCCESS, result.status_); if (verbose) std::cerr << "8.8.8.8:53 => " << result.node_ << "/" << result.service_ << std::endl; } VIRT_NONVIRT_TEST_F(DefaultChannelTest, LiveGetNameInfoV4NoPort) { NameInfoResult result; struct sockaddr_in sockaddr; memset(&sockaddr, 0, sizeof(sockaddr)); sockaddr.sin_family = AF_INET; sockaddr.sin_port = htons(0); sockaddr.sin_addr.s_addr = htonl(0x08080808); ares_getnameinfo(channel_, (const struct sockaddr*)&sockaddr, sizeof(sockaddr), ARES_NI_LOOKUPHOST|ARES_NI_LOOKUPSERVICE|ARES_NI_UDP, NameInfoCallback, &result); Process(); EXPECT_TRUE(result.done_); EXPECT_EQ(ARES_SUCCESS, result.status_); if (verbose) std::cerr << "8.8.8.8:0 => " << result.node_ << "/" << result.service_ << std::endl; } VIRT_NONVIRT_TEST_F(DefaultChannelTest, LiveGetNameInfoV4UnassignedPort) { NameInfoResult result; struct sockaddr_in sockaddr; memset(&sockaddr, 0, sizeof(sockaddr)); sockaddr.sin_family = AF_INET; sockaddr.sin_port = htons(4); // Unassigned at IANA sockaddr.sin_addr.s_addr = htonl(0x08080808); ares_getnameinfo(channel_, (const struct sockaddr*)&sockaddr, sizeof(sockaddr), ARES_NI_LOOKUPHOST|ARES_NI_LOOKUPSERVICE|ARES_NI_UDP, NameInfoCallback, &result); Process(); EXPECT_TRUE(result.done_); EXPECT_EQ(ARES_SUCCESS, result.status_); if (verbose) std::cerr << "8.8.8.8:4 => " << result.node_ << "/" << result.service_ << std::endl; } VIRT_NONVIRT_TEST_F(DefaultChannelTest, LiveGetNameInfoV6Both) { NameInfoResult result; struct sockaddr_in6 sockaddr; memset(&sockaddr, 0, sizeof(sockaddr)); sockaddr.sin6_family = AF_INET6; sockaddr.sin6_port = htons(53); memcpy(sockaddr.sin6_addr.s6_addr, gdns_addr6, 16); ares_getnameinfo(channel_, (const struct sockaddr*)&sockaddr, sizeof(sockaddr), ARES_NI_TCP|ARES_NI_LOOKUPHOST|ARES_NI_LOOKUPSERVICE|ARES_NI_NOFQDN, NameInfoCallback, &result); Process(); EXPECT_TRUE(result.done_); EXPECT_EQ(ARES_SUCCESS, result.status_); if (verbose) std::cerr << "[2001:4860:4860::8888]:53 => " << result.node_ << "/" << result.service_ << std::endl; } VIRT_NONVIRT_TEST_F(DefaultChannelTest, LiveGetNameInfoV6Neither) { NameInfoResult result; struct sockaddr_in6 sockaddr; memset(&sockaddr, 0, sizeof(sockaddr)); sockaddr.sin6_family = AF_INET6; sockaddr.sin6_port = htons(53); memcpy(sockaddr.sin6_addr.s6_addr, gdns_addr6, 16); ares_getnameinfo(channel_, (const struct sockaddr*)&sockaddr, sizeof(sockaddr), ARES_NI_TCP|ARES_NI_NOFQDN, // Neither specified => assume lookup host. NameInfoCallback, &result); Process(); EXPECT_TRUE(result.done_); EXPECT_EQ(ARES_SUCCESS, result.status_); if (verbose) std::cerr << "[2001:4860:4860::8888]:53 => " << result.node_ << "/" << result.service_ << std::endl; } VIRT_NONVIRT_TEST_F(DefaultChannelTest, LiveGetNameInfoV4Numeric) { NameInfoResult result; struct sockaddr_in sockaddr; memset(&sockaddr, 0, sizeof(sockaddr)); sockaddr.sin_family = AF_INET; sockaddr.sin_port = htons(53); sockaddr.sin_addr.s_addr = htonl(0x08080808); ares_getnameinfo(channel_, (const struct sockaddr*)&sockaddr, sizeof(sockaddr), ARES_NI_LOOKUPHOST|ARES_NI_LOOKUPSERVICE|ARES_NI_TCP|ARES_NI_NUMERICHOST, NameInfoCallback, &result); Process(); EXPECT_TRUE(result.done_); EXPECT_EQ(ARES_SUCCESS, result.status_); EXPECT_EQ("8.8.8.8", result.node_); if (verbose) std::cerr << "8.8.8.8:53 => " << result.node_ << "/" << result.service_ << std::endl; } VIRT_NONVIRT_TEST_F(DefaultChannelTest, LiveGetNameInfoV6Numeric) { NameInfoResult result; struct sockaddr_in6 sockaddr; memset(&sockaddr, 0, sizeof(sockaddr)); sockaddr.sin6_family = AF_INET6; sockaddr.sin6_port = htons(53); memcpy(sockaddr.sin6_addr.s6_addr, gdns_addr6, 16); ares_getnameinfo(channel_, (const struct sockaddr*)&sockaddr, sizeof(sockaddr), ARES_NI_LOOKUPHOST|ARES_NI_LOOKUPSERVICE|ARES_NI_DCCP|ARES_NI_NUMERICHOST, NameInfoCallback, &result); Process(); EXPECT_TRUE(result.done_); EXPECT_EQ(ARES_SUCCESS, result.status_); EXPECT_EQ("2001:4860:4860::8888%0", result.node_); if (verbose) std::cerr << "[2001:4860:4860::8888]:53 => " << result.node_ << "/" << result.service_ << std::endl; } VIRT_NONVIRT_TEST_F(DefaultChannelTest, LiveGetNameInfoV6LinkLocal) { NameInfoResult result; struct sockaddr_in6 sockaddr; memset(&sockaddr, 0, sizeof(sockaddr)); sockaddr.sin6_family = AF_INET6; sockaddr.sin6_port = htons(53); unsigned char addr6[16] = {0xfe, 0x80, 0x01, 0x02, 0x01, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04}; memcpy(sockaddr.sin6_addr.s6_addr, addr6, 16); ares_getnameinfo(channel_, (const struct sockaddr*)&sockaddr, sizeof(sockaddr), ARES_NI_LOOKUPHOST|ARES_NI_LOOKUPSERVICE|ARES_NI_DCCP|ARES_NI_NUMERICHOST, NameInfoCallback, &result); Process(); EXPECT_TRUE(result.done_); EXPECT_EQ(ARES_SUCCESS, result.status_); EXPECT_EQ("fe80:102:102::304%0", result.node_); if (verbose) std::cerr << "[fe80:102:102::304]:53 => " << result.node_ << "/" << result.service_ << std::endl; } VIRT_NONVIRT_TEST_F(DefaultChannelTest, LiveGetNameInfoV4NotFound) { NameInfoResult result; struct sockaddr_in sockaddr; memset(&sockaddr, 0, sizeof(sockaddr)); sockaddr.sin_family = AF_INET; sockaddr.sin_port = htons(4); // Port 4 unassigned at IANA // RFC5737 says 192.0.2.0 should not be used publically. sockaddr.sin_addr.s_addr = htonl(0xC0000200); ares_getnameinfo(channel_, (const struct sockaddr*)&sockaddr, sizeof(sockaddr), ARES_NI_LOOKUPHOST|ARES_NI_LOOKUPSERVICE|ARES_NI_UDP, NameInfoCallback, &result); Process(); EXPECT_TRUE(result.done_); EXPECT_EQ(ARES_SUCCESS, result.status_); EXPECT_EQ("192.0.2.0", result.node_); if (verbose) std::cerr << "192.0.2.0:53 => " << result.node_ << "/" << result.service_ << std::endl; } VIRT_NONVIRT_TEST_F(DefaultChannelTest, LiveGetNameInfoV4NotFoundFail) { NameInfoResult result; struct sockaddr_in sockaddr; memset(&sockaddr, 0, sizeof(sockaddr)); sockaddr.sin_family = AF_INET; sockaddr.sin_port = htons(53); // RFC5737 says 192.0.2.0 should not be used publically. sockaddr.sin_addr.s_addr = htonl(0xC0000200); ares_getnameinfo(channel_, (const struct sockaddr*)&sockaddr, sizeof(sockaddr), ARES_NI_LOOKUPHOST|ARES_NI_LOOKUPSERVICE|ARES_NI_UDP|ARES_NI_NAMEREQD, NameInfoCallback, &result); Process(); EXPECT_TRUE(result.done_); EXPECT_EQ(ARES_ENOTFOUND, result.status_); } VIRT_NONVIRT_TEST_F(DefaultChannelTest, LiveGetNameInfoV6NotFound) { NameInfoResult result; struct sockaddr_in6 sockaddr; memset(&sockaddr, 0, sizeof(sockaddr)); sockaddr.sin6_family = AF_INET6; sockaddr.sin6_port = htons(53); // 2001:db8::/32 is only supposed to be used in documentation. unsigned char addr6[16] = {0x20, 0x01, 0x0d, 0xb8, 0x01, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04}; memcpy(sockaddr.sin6_addr.s6_addr, addr6, 16); ares_getnameinfo(channel_, (const struct sockaddr*)&sockaddr, sizeof(sockaddr), ARES_NI_LOOKUPHOST|ARES_NI_LOOKUPSERVICE|ARES_NI_UDP, NameInfoCallback, &result); Process(); EXPECT_TRUE(result.done_); EXPECT_EQ(ARES_SUCCESS, result.status_); EXPECT_EQ("2001:db8:102::304%0", result.node_); if (verbose) std::cerr << "[2001:db8:102::304]:53 => " << result.node_ << "/" << result.service_ << std::endl; } VIRT_NONVIRT_TEST_F(DefaultChannelTest, LiveGetNameInvalidFamily) { NameInfoResult result; struct sockaddr_in6 sockaddr; memset(&sockaddr, 0, sizeof(sockaddr)); sockaddr.sin6_family = AF_INET6 + AF_INET; sockaddr.sin6_port = htons(53); memcpy(sockaddr.sin6_addr.s6_addr, gdns_addr6, 16); ares_getnameinfo(channel_, (const struct sockaddr*)&sockaddr, sizeof(sockaddr), ARES_NI_LOOKUPHOST|ARES_NI_LOOKUPSERVICE|ARES_NI_UDP, NameInfoCallback, &result); Process(); EXPECT_TRUE(result.done_); EXPECT_EQ(ARES_ENOTIMP, result.status_); } VIRT_NONVIRT_TEST_F(DefaultChannelTest, LiveGetNameInvalidFlags) { NameInfoResult result; struct sockaddr_in6 sockaddr; memset(&sockaddr, 0, sizeof(sockaddr)); sockaddr.sin6_family = AF_INET6; sockaddr.sin6_port = htons(53); memcpy(sockaddr.sin6_addr.s6_addr, gdns_addr6, 16); // Ask for both a name-required, and a numeric host. ares_getnameinfo(channel_, (const struct sockaddr*)&sockaddr, sizeof(sockaddr), ARES_NI_LOOKUPHOST|ARES_NI_LOOKUPSERVICE|ARES_NI_UDP|ARES_NI_NUMERICHOST|ARES_NI_NAMEREQD, NameInfoCallback, &result); Process(); EXPECT_TRUE(result.done_); EXPECT_EQ(ARES_EBADFLAGS, result.status_); } VIRT_NONVIRT_TEST_F(DefaultChannelTest, LiveGetServiceInfo) { NameInfoResult result; struct sockaddr_in sockaddr; memset(&sockaddr, 0, sizeof(sockaddr)); sockaddr.sin_family = AF_INET; sockaddr.sin_port = htons(53); sockaddr.sin_addr.s_addr = htonl(0x08080808); // Just look up service info ares_getnameinfo(channel_, (const struct sockaddr*)&sockaddr, sizeof(sockaddr), ARES_NI_LOOKUPSERVICE|ARES_NI_SCTP, NameInfoCallback, &result); Process(); EXPECT_TRUE(result.done_); EXPECT_EQ(ARES_SUCCESS, result.status_); EXPECT_EQ("", result.node_); } VIRT_NONVIRT_TEST_F(DefaultChannelTest, LiveGetServiceInfoNumeric) { NameInfoResult result; struct sockaddr_in sockaddr; memset(&sockaddr, 0, sizeof(sockaddr)); sockaddr.sin_family = AF_INET; sockaddr.sin_port = htons(53); sockaddr.sin_addr.s_addr = htonl(0x08080808); // Just look up service info ares_getnameinfo(channel_, (const struct sockaddr*)&sockaddr, sizeof(sockaddr), ARES_NI_LOOKUPSERVICE|ARES_NI_SCTP|ARES_NI_NUMERICSERV, NameInfoCallback, &result); Process(); EXPECT_TRUE(result.done_); EXPECT_EQ(ARES_SUCCESS, result.status_); EXPECT_EQ("", result.node_); EXPECT_EQ("53", result.service_); } VIRT_NONVIRT_TEST_F(DefaultChannelTest, LiveGetNameInfoAllocFail) { NameInfoResult result; struct sockaddr_in sockaddr; memset(&sockaddr, 0, sizeof(sockaddr)); sockaddr.sin_family = AF_INET; sockaddr.sin_port = htons(53); sockaddr.sin_addr.s_addr = htonl(0x08080808); SetAllocFail(1); ares_getnameinfo(channel_, (const struct sockaddr*)&sockaddr, sizeof(sockaddr), ARES_NI_LOOKUPHOST|ARES_NI_LOOKUPSERVICE|ARES_NI_UDP, NameInfoCallback, &result); Process(); EXPECT_TRUE(result.done_); EXPECT_EQ(ARES_ENOMEM, result.status_); } VIRT_NONVIRT_TEST_F(DefaultChannelTest, GetSock) { ares_socket_t socks[3] = {ARES_SOCKET_BAD, ARES_SOCKET_BAD, ARES_SOCKET_BAD}; int bitmask = ares_getsock(channel_, socks, 3); EXPECT_EQ(0, bitmask); bitmask = ares_getsock(channel_, nullptr, 0); EXPECT_EQ(0, bitmask); // Ask again with a pending query. HostResult result; ares_gethostbyname(channel_, "www.google.com.", AF_INET, HostCallback, &result); bitmask = ares_getsock(channel_, socks, 3); EXPECT_NE(0, bitmask); bitmask = ares_getsock(channel_, nullptr, 0); EXPECT_EQ(0, bitmask); Process(); } TEST_F(LibraryTest, GetTCPSock) { ares_channel channel; struct ares_options opts = {0}; opts.tcp_port = 53; opts.flags = ARES_FLAG_USEVC; int optmask = ARES_OPT_TCP_PORT | ARES_OPT_FLAGS; EXPECT_EQ(ARES_SUCCESS, ares_init_options(&channel, &opts, optmask)); EXPECT_NE(nullptr, channel); ares_socket_t socks[3] = {ARES_SOCKET_BAD, ARES_SOCKET_BAD, ARES_SOCKET_BAD}; int bitmask = ares_getsock(channel, socks, 3); EXPECT_EQ(0, bitmask); bitmask = ares_getsock(channel, nullptr, 0); EXPECT_EQ(0, bitmask); // Ask again with a pending query. HostResult result; ares_gethostbyname(channel, "www.google.com.", AF_INET, HostCallback, &result); bitmask = ares_getsock(channel, socks, 3); EXPECT_NE(0, bitmask); bitmask = ares_getsock(channel, nullptr, 0); EXPECT_EQ(0, bitmask); ProcessWork(channel, NoExtraFDs, nullptr); ares_destroy(channel); } TEST_F(DefaultChannelTest, VerifySocketFunctionCallback) { VirtualizeIO vio(channel_); auto my_functions = VirtualizeIO::default_functions; size_t count = 0; my_functions.asocket = [](int af, int type, int protocol, void * p) { EXPECT_NE(nullptr, p); (*reinterpret_cast(p))++; return ::socket(af, type, protocol); }; ares_set_socket_functions(channel_, &my_functions, &count); { count = 0; HostResult result; ares_gethostbyname(channel_, "www.google.com.", AF_INET, HostCallback, &result); Process(); EXPECT_TRUE(result.done_); EXPECT_NE(0, count); } { count = 0; ares_channel copy; EXPECT_EQ(ARES_SUCCESS, ares_dup(©, channel_)); HostResult result; ares_gethostbyname(copy, "www.google.com.", AF_INET, HostCallback, &result); ProcessWork(copy, NoExtraFDs, nullptr); EXPECT_TRUE(result.done_); ares_destroy(copy); EXPECT_NE(0, count); } } TEST_F(DefaultChannelTest, LiveSetServers) { struct ares_addr_node server1; struct ares_addr_node server2; server1.next = &server2; server1.family = AF_INET; server1.addr.addr4.s_addr = htonl(0x01020304); server2.next = nullptr; server2.family = AF_INET; server2.addr.addr4.s_addr = htonl(0x02030405); // Change not allowed while request is pending HostResult result; ares_gethostbyname(channel_, "www.google.com.", AF_INET, HostCallback, &result); EXPECT_EQ(ARES_ENOTIMP, ares_set_servers(channel_, &server1)); ares_cancel(channel_); } TEST_F(DefaultChannelTest, LiveSetServersPorts) { struct ares_addr_port_node server1; struct ares_addr_port_node server2; server1.next = &server2; server1.family = AF_INET; server1.addr.addr4.s_addr = htonl(0x01020304); server1.udp_port = 111; server1.tcp_port = 111; server2.next = nullptr; server2.family = AF_INET; server2.addr.addr4.s_addr = htonl(0x02030405); server2.udp_port = 0; server2.tcp_port = 0;; EXPECT_EQ(ARES_ENODATA, ares_set_servers_ports(nullptr, &server1)); // Change not allowed while request is pending HostResult result; ares_gethostbyname(channel_, "www.google.com.", AF_INET, HostCallback, &result); EXPECT_EQ(ARES_ENOTIMP, ares_set_servers_ports(channel_, &server1)); ares_cancel(channel_); } TEST_F(DefaultChannelTest, LiveSetServersCSV) { // Change not allowed while request is pending HostResult result; ares_gethostbyname(channel_, "www.google.com.", AF_INET, HostCallback, &result); EXPECT_EQ(ARES_ENOTIMP, ares_set_servers_csv(channel_, "1.2.3.4,2.3.4.5")); EXPECT_EQ(ARES_ENOTIMP, ares_set_servers_ports_csv(channel_, "1.2.3.4:56,2.3.4.5:67")); ares_cancel(channel_); } } // namespace test } // namespace ares ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/ares-test-main.cc0000644000175100001770000000220600000000000022217 0ustar00runnerdocker00000000000000#include #include #include "ares-test.h" int main(int argc, char* argv[]) { std::vector gtest_argv = {argv[0]}; for (int ii = 1; ii < argc; ii++) { if (strcmp(argv[ii], "-v") == 0) { ares::test::verbose = true; } else if ((strcmp(argv[ii], "-p") == 0) && (ii + 1 < argc)) { ii++; ares::test::mock_port = atoi(argv[ii]); } else if (strcmp(argv[ii], "-4") == 0) { ares::test::families = ares::test::ipv4_family; ares::test::families_modes = ares::test::ipv4_family_both_modes; } else if (strcmp(argv[ii], "-6") == 0) { ares::test::families = ares::test::ipv6_family; ares::test::families_modes = ares::test::ipv6_family_both_modes; } else { gtest_argv.push_back(argv[ii]); } } int gtest_argc = gtest_argv.size(); gtest_argv.push_back(nullptr); ::testing::InitGoogleTest(>est_argc, gtest_argv.data()); #ifdef WIN32 WORD wVersionRequested = MAKEWORD(2, 2); WSADATA wsaData; WSAStartup(wVersionRequested, &wsaData); #else signal(SIGPIPE, SIG_IGN); #endif int rc = RUN_ALL_TESTS(); #ifdef WIN32 WSACleanup(); #endif return rc; } ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/ares-test-misc.cc0000644000175100001770000004353500000000000022240 0ustar00runnerdocker00000000000000#include "ares-test.h" #include "dns-proto.h" #include #include namespace ares { namespace test { TEST_F(DefaultChannelTest, GetServers) { std::vector servers = GetNameServers(channel_); if (verbose) { for (const std::string& server : servers) { std::cerr << "Nameserver: " << server << std::endl; } } } TEST_F(DefaultChannelTest, GetServersFailures) { EXPECT_EQ(ARES_SUCCESS, ares_set_servers_csv(channel_, "1.2.3.4,2.3.4.5")); struct ares_addr_node* servers = nullptr; SetAllocFail(1); EXPECT_EQ(ARES_ENOMEM, ares_get_servers(channel_, &servers)); SetAllocFail(2); EXPECT_EQ(ARES_ENOMEM, ares_get_servers(channel_, &servers)); EXPECT_EQ(ARES_ENODATA, ares_get_servers(nullptr, &servers)); } TEST_F(DefaultChannelTest, SetServers) { EXPECT_EQ(ARES_SUCCESS, ares_set_servers(channel_, nullptr)); std::vector empty; EXPECT_EQ(empty, GetNameServers(channel_)); struct ares_addr_node server1; struct ares_addr_node server2; server1.next = &server2; server1.family = AF_INET; server1.addr.addr4.s_addr = htonl(0x01020304); server2.next = nullptr; server2.family = AF_INET; server2.addr.addr4.s_addr = htonl(0x02030405); EXPECT_EQ(ARES_ENODATA, ares_set_servers(nullptr, &server1)); EXPECT_EQ(ARES_SUCCESS, ares_set_servers(channel_, &server1)); std::vector expected = {"1.2.3.4", "2.3.4.5"}; EXPECT_EQ(expected, GetNameServers(channel_)); } TEST_F(DefaultChannelTest, SetServersPorts) { EXPECT_EQ(ARES_SUCCESS, ares_set_servers_ports(channel_, nullptr)); std::vector empty; EXPECT_EQ(empty, GetNameServers(channel_)); struct ares_addr_port_node server1; struct ares_addr_port_node server2; server1.next = &server2; server1.family = AF_INET; server1.addr.addr4.s_addr = htonl(0x01020304); server1.udp_port = 111; server1.tcp_port = 111; server2.next = nullptr; server2.family = AF_INET; server2.addr.addr4.s_addr = htonl(0x02030405); server2.udp_port = 0; server2.tcp_port = 0;; EXPECT_EQ(ARES_ENODATA, ares_set_servers_ports(nullptr, &server1)); EXPECT_EQ(ARES_SUCCESS, ares_set_servers_ports(channel_, &server1)); std::vector expected = {"1.2.3.4:111", "2.3.4.5"}; EXPECT_EQ(expected, GetNameServers(channel_)); } TEST_F(DefaultChannelTest, SetServersCSV) { EXPECT_EQ(ARES_ENODATA, ares_set_servers_csv(nullptr, "1.2.3.4")); EXPECT_EQ(ARES_ENODATA, ares_set_servers_csv(nullptr, "xyzzy,plugh")); EXPECT_EQ(ARES_ENODATA, ares_set_servers_csv(nullptr, "256.1.2.3")); EXPECT_EQ(ARES_ENODATA, ares_set_servers_csv(nullptr, "1.2.3.4.5")); EXPECT_EQ(ARES_ENODATA, ares_set_servers_csv(nullptr, "1:2:3:4:5")); EXPECT_EQ(ARES_SUCCESS, ares_set_servers_csv(channel_, "1.2.3.4,0102:0304:0506:0708:0910:1112:1314:1516,2.3.4.5")); std::vector expected = {"1.2.3.4", "0102:0304:0506:0708:0910:1112:1314:1516", "2.3.4.5"}; EXPECT_EQ(expected, GetNameServers(channel_)); // Same, with spaces EXPECT_EQ(ARES_EBADSTR, ares_set_servers_csv(channel_, "1.2.3.4 , 0102:0304:0506:0708:0910:1112:1314:1516, 2.3.4.5")); // Same, with ports EXPECT_EQ(ARES_SUCCESS, ares_set_servers_csv(channel_, "1.2.3.4:54,[0102:0304:0506:0708:0910:1112:1314:1516]:80,2.3.4.5:55")); EXPECT_EQ(expected, GetNameServers(channel_)); EXPECT_EQ(ARES_SUCCESS, ares_set_servers_ports_csv(channel_, "1.2.3.4:54,[0102:0304:0506:0708:0910:1112:1314:1516]:80,2.3.4.5:55")); std::vector expected2 = {"1.2.3.4:54", "[0102:0304:0506:0708:0910:1112:1314:1516]:80", "2.3.4.5:55"}; EXPECT_EQ(expected2, GetNameServers(channel_)); // Should survive duplication ares_channel channel2; EXPECT_EQ(ARES_SUCCESS, ares_dup(&channel2, channel_)); EXPECT_EQ(expected2, GetNameServers(channel2)); ares_destroy(channel2); // Allocation failure cases for (int fail = 1; fail <= 5; fail++) { SetAllocFail(fail); EXPECT_EQ(ARES_ENOMEM, ares_set_servers_csv(channel_, "1.2.3.4,0102:0304:0506:0708:0910:1112:1314:1516,2.3.4.5")); } // Blank servers EXPECT_EQ(ARES_SUCCESS, ares_set_servers_csv(channel_, "")); std::vector none; EXPECT_EQ(none, GetNameServers(channel_)); EXPECT_EQ(ARES_EBADSTR, ares_set_servers_csv(channel_, "2.3.4.5,1.2.3.4:,3.4.5.6")); EXPECT_EQ(ARES_EBADSTR, ares_set_servers_csv(channel_, "2.3.4.5,1.2.3.4:Z,3.4.5.6")); } TEST_F(DefaultChannelTest, TimeoutValue) { struct timeval tinfo; tinfo.tv_sec = 0; tinfo.tv_usec = 0; struct timeval tmax; tmax.tv_sec = 0; tmax.tv_usec = 10; struct timeval* pt; // No timers => get max back. pt = ares_timeout(channel_, &tmax, &tinfo); EXPECT_EQ(&tmax, pt); EXPECT_EQ(0, pt->tv_sec); EXPECT_EQ(10, pt->tv_usec); pt = ares_timeout(channel_, nullptr, &tinfo); EXPECT_EQ(nullptr, pt); HostResult result; ares_gethostbyname(channel_, "www.google.com.", AF_INET, HostCallback, &result); // Now there's a timer running. pt = ares_timeout(channel_, &tmax, &tinfo); EXPECT_EQ(&tmax, pt); EXPECT_EQ(0, pt->tv_sec); EXPECT_EQ(10, pt->tv_usec); tmax.tv_sec = 100; pt = ares_timeout(channel_, &tmax, &tinfo); EXPECT_EQ(&tinfo, pt); pt = ares_timeout(channel_, nullptr, &tinfo); EXPECT_EQ(&tinfo, pt); Process(); } TEST_F(LibraryTest, InetNtoP) { struct in_addr addr; addr.s_addr = htonl(0x01020304); char buffer[256]; EXPECT_EQ(buffer, ares_inet_ntop(AF_INET, &addr, buffer, sizeof(buffer))); EXPECT_EQ("1.2.3.4", std::string(buffer)); } TEST_F(LibraryTest, Mkquery) { byte* p; int len; ares_mkquery("example.com", C_IN, T_A, 0x1234, 0, &p, &len); std::vector data(p, p + len); ares_free_string(p); std::string actual = PacketToString(data); DNSPacket pkt; pkt.set_qid(0x1234).add_question(new DNSQuestion("example.com", T_A)); std::string expected = PacketToString(pkt.data()); EXPECT_EQ(expected, actual); } TEST_F(LibraryTest, CreateQuery) { byte* p; int len; EXPECT_EQ(ARES_SUCCESS, ares_create_query("exam\\@le.com", C_IN, T_A, 0x1234, 0, &p, &len, 0)); std::vector data(p, p + len); ares_free_string(p); std::string actual = PacketToString(data); DNSPacket pkt; pkt.set_qid(0x1234).add_question(new DNSQuestion("exam@le.com", T_A)); std::string expected = PacketToString(pkt.data()); EXPECT_EQ(expected, actual); } TEST_F(LibraryTest, CreateQueryTrailingEscapedDot) { byte* p; int len; EXPECT_EQ(ARES_SUCCESS, ares_create_query("example.com\\.", C_IN, T_A, 0x1234, 0, &p, &len, 0)); std::vector data(p, p + len); ares_free_string(p); std::string actual = PacketToString(data); EXPECT_EQ("REQ QRY Q:{'example.com\\.' IN A}", actual); } TEST_F(LibraryTest, CreateQueryNameTooLong) { byte* p; int len; EXPECT_EQ(ARES_EBADNAME, ares_create_query( "a1234567890123456789.b1234567890123456789.c1234567890123456789.d1234567890123456789." "a1234567890123456789.b1234567890123456789.c1234567890123456789.d1234567890123456789." "a1234567890123456789.b1234567890123456789.c1234567890123456789.d1234567890123456789." "x1234567890123456789.y1234567890123456789.", C_IN, T_A, 0x1234, 0, &p, &len, 0)); } TEST_F(LibraryTest, CreateQueryFailures) { byte* p; int len; // RC1035 has a 255 byte limit on names. std::string longname; for (int ii = 0; ii < 17; ii++) { longname += "fedcba9876543210"; } p = nullptr; EXPECT_EQ(ARES_EBADNAME, ares_create_query(longname.c_str(), C_IN, T_A, 0x1234, 0, &p, &len, 0)); if (p) ares_free_string(p); SetAllocFail(1); p = nullptr; EXPECT_EQ(ARES_ENOMEM, ares_create_query("example.com", C_IN, T_A, 0x1234, 0, &p, &len, 0)); if (p) ares_free_string(p); // 63-char limit on a single label std::string longlabel = "a.a123456789b123456789c123456789d123456789e123456789f123456789g123456789.org"; p = nullptr; EXPECT_EQ(ARES_EBADNAME, ares_create_query(longlabel.c_str(), C_IN, T_A, 0x1234, 0, &p, &len, 0)); if (p) ares_free_string(p); // Empty non-terminal label p = nullptr; EXPECT_EQ(ARES_EBADNAME, ares_create_query("example..com", C_IN, T_A, 0x1234, 0, &p, &len, 0)); if (p) ares_free_string(p); } TEST_F(LibraryTest, CreateQueryOnionDomain) { byte* p; int len; EXPECT_EQ(ARES_ENOTFOUND, ares_create_query("dontleak.onion", C_IN, T_A, 0x1234, 0, &p, &len, 0)); } TEST_F(DefaultChannelTest, HostByNameOnionDomain) { HostResult result; ares_gethostbyname(channel_, "dontleak.onion", AF_INET, HostCallback, &result); EXPECT_TRUE(result.done_); EXPECT_EQ(ARES_ENOTFOUND, result.status_); } TEST_F(DefaultChannelTest, HostByNameFileOnionDomain) { struct hostent *h; EXPECT_EQ(ARES_ENOTFOUND, ares_gethostbyname_file(channel_, "dontleak.onion", AF_INET, &h)); } TEST_F(DefaultChannelTest, GetAddrinfoOnionDomain) { AddrInfoResult result; struct ares_addrinfo_hints hints = {}; hints.ai_family = AF_UNSPEC; ares_getaddrinfo(channel_, "dontleak.onion", NULL, &hints, AddrInfoCallback, &result); EXPECT_TRUE(result.done_); EXPECT_EQ(ARES_ENOTFOUND, result.status_); } // Interesting question: should tacking on a search domain let the query // through? It seems safer to reject it because "supersecret.onion.search" // still leaks information about the query to malicious resolvers. TEST_F(DefaultChannelTest, SearchOnionDomain) { SearchResult result; ares_search(channel_, "dontleak.onion", C_IN, T_A, SearchCallback, &result); EXPECT_TRUE(result.done_); EXPECT_EQ(ARES_ENOTFOUND, result.status_); } TEST_F(DefaultChannelTest, SendFailure) { unsigned char buf[2]; SearchResult result; ares_send(channel_, buf, sizeof(buf), SearchCallback, &result); EXPECT_TRUE(result.done_); EXPECT_EQ(ARES_EBADQUERY, result.status_); } std::string ExpandName(const std::vector& data, int offset, long *enclen) { char *name = nullptr; int rc = ares_expand_name(data.data() + offset, data.data(), data.size(), &name, enclen); EXPECT_EQ(ARES_SUCCESS, rc); std::string result; if (rc == ARES_SUCCESS) { result = name; } else { result = ""; } ares_free_string(name); return result; } TEST_F(LibraryTest, ExpandName) { long enclen; std::vector data1 = {1, 'a', 2, 'b', 'c', 3, 'd', 'e', 'f', 0}; EXPECT_EQ("a.bc.def", ExpandName(data1, 0, &enclen)); EXPECT_EQ(data1.size(), enclen); std::vector data2 = {0}; EXPECT_EQ("", ExpandName(data2, 0, &enclen)); EXPECT_EQ(1, enclen); // Complete name indirection std::vector data3 = {0x12, 0x23, 3, 'd', 'e', 'f', 0, 0xC0, 2}; EXPECT_EQ("def", ExpandName(data3, 2, &enclen)); EXPECT_EQ(5, enclen); EXPECT_EQ("def", ExpandName(data3, 7, &enclen)); EXPECT_EQ(2, enclen); // One label then indirection std::vector data4 = {0x12, 0x23, 3, 'd', 'e', 'f', 0, 1, 'a', 0xC0, 2}; EXPECT_EQ("def", ExpandName(data4, 2, &enclen)); EXPECT_EQ(5, enclen); EXPECT_EQ("a.def", ExpandName(data4, 7, &enclen)); EXPECT_EQ(4, enclen); // Two labels then indirection std::vector data5 = {0x12, 0x23, 3, 'd', 'e', 'f', 0, 1, 'a', 1, 'b', 0xC0, 2}; EXPECT_EQ("def", ExpandName(data5, 2, &enclen)); EXPECT_EQ(5, enclen); EXPECT_EQ("a.b.def", ExpandName(data5, 7, &enclen)); EXPECT_EQ(6, enclen); // Empty name, indirection to empty name std::vector data6 = {0x12, 0x23, 0, 0xC0, 2}; EXPECT_EQ("", ExpandName(data6, 2, &enclen)); EXPECT_EQ(1, enclen); EXPECT_EQ("", ExpandName(data6, 3, &enclen)); EXPECT_EQ(2, enclen); } TEST_F(LibraryTest, ExpandNameFailure) { std::vector data1 = {0x03, 'c', 'o', 'm', 0x00}; char *name = nullptr; long enclen; SetAllocFail(1); EXPECT_EQ(ARES_ENOMEM, ares_expand_name(data1.data(), data1.data(), data1.size(), &name, &enclen)); // Empty packet EXPECT_EQ(ARES_EBADNAME, ares_expand_name(data1.data(), data1.data(), 0, &name, &enclen)); // Start beyond enclosing data EXPECT_EQ(ARES_EBADNAME, ares_expand_name(data1.data() + data1.size(), data1.data(), data1.size(), &name, &enclen)); // Length beyond size of enclosing data std::vector data2a = {0x13, 'c', 'o', 'm', 0x00}; EXPECT_EQ(ARES_EBADNAME, ares_expand_name(data2a.data(), data2a.data(), data2a.size(), &name, &enclen)); std::vector data2b = {0x1}; EXPECT_EQ(ARES_EBADNAME, ares_expand_name(data2b.data(), data2b.data(), data2b.size(), &name, &enclen)); std::vector data2c = {0xC0}; EXPECT_EQ(ARES_EBADNAME, ares_expand_name(data2c.data(), data2c.data(), data2c.size(), &name, &enclen)); // Indirection beyond enclosing data std::vector data3a = {0xC0, 0x02}; EXPECT_EQ(ARES_EBADNAME, ares_expand_name(data3a.data(), data3a.data(), data3a.size(), &name, &enclen)); std::vector data3b = {0xC0, 0x0A, 'c', 'o', 'm', 0x00}; EXPECT_EQ(ARES_EBADNAME, ares_expand_name(data3b.data(), data3b.data(), data3b.size(), &name, &enclen)); // Invalid top bits in label length std::vector data4 = {0x03, 'c', 'o', 'm', 0x00, 0x80, 0x00}; EXPECT_EQ(ARES_EBADNAME, ares_expand_name(data4.data() + 5, data4.data(), data4.size(), &name, &enclen)); // Label too long: 64-byte label, with invalid top 2 bits of length (01). std::vector data5 = {0x40, '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', 0x00}; EXPECT_EQ(ARES_EBADNAME, ares_expand_name(data5.data(), data5.data(), data5.size(), &name, &enclen)) << name; // Incomplete indirect length std::vector data6 = {0x03, 'c', 'o', 'm', 0x00, 0xC0}; EXPECT_EQ(ARES_EBADNAME, ares_expand_name(data6.data() + 5, data6.data(), data6.size(), &name, &enclen)); // Indirection loops std::vector data7 = {0xC0, 0x02, 0xC0, 0x00}; EXPECT_EQ(ARES_EBADNAME, ares_expand_name(data7.data(), data7.data(), data7.size(), &name, &enclen)); std::vector data8 = {3, 'd', 'e', 'f', 0xC0, 0x08, 0x00, 0x00, 3, 'a', 'b', 'c', 0xC0, 0x00}; EXPECT_EQ(ARES_EBADNAME, ares_expand_name(data8.data(), data8.data(), data8.size(), &name, &enclen)); std::vector data9 = {0x12, 0x23, // start 2 bytes in 3, 'd', 'e', 'f', 0xC0, 0x02}; EXPECT_EQ(ARES_EBADNAME, ares_expand_name(data9.data() + 2, data9.data(), data9.size(), &name, &enclen)); } TEST_F(LibraryTest, CreateEDNSQuery) { byte* p; int len; EXPECT_EQ(ARES_SUCCESS, ares_create_query("example.com", C_IN, T_A, 0x1234, 0, &p, &len, 1280)); std::vector data(p, p + len); ares_free_string(p); std::string actual = PacketToString(data); DNSPacket pkt; pkt.set_qid(0x1234).add_question(new DNSQuestion("example.com", T_A)) .add_additional(new DNSOptRR(0, 1280)); std::string expected = PacketToString(pkt.data()); EXPECT_EQ(expected, actual); } TEST_F(LibraryTest, CreateRootQuery) { byte* p; int len; ares_create_query(".", C_IN, T_A, 0x1234, 0, &p, &len, 0); std::vector data(p, p + len); ares_free_string(p); std::string actual = PacketToString(data); DNSPacket pkt; pkt.set_qid(0x1234).add_question(new DNSQuestion("", T_A)); std::string expected = PacketToString(pkt.data()); EXPECT_EQ(expected, actual); } TEST_F(LibraryTest, Version) { // Assume linked to same version EXPECT_EQ(std::string(ARES_VERSION_STR), std::string(ares_version(nullptr))); int version; ares_version(&version); EXPECT_EQ(ARES_VERSION, version); } TEST_F(LibraryTest, Strerror) { EXPECT_EQ("Successful completion", std::string(ares_strerror(ARES_SUCCESS))); EXPECT_EQ("DNS query cancelled", std::string(ares_strerror(ARES_ECANCELLED))); EXPECT_EQ("unknown", std::string(ares_strerror(99))); } TEST_F(LibraryTest, ExpandString) { std::vector s1 = { 3, 'a', 'b', 'c'}; char* result = nullptr; long len; EXPECT_EQ(ARES_SUCCESS, ares_expand_string(s1.data(), s1.data(), s1.size(), (unsigned char**)&result, &len)); EXPECT_EQ("abc", std::string(result)); EXPECT_EQ(1 + 3, len); // amount of data consumed includes 1 byte len ares_free_string(result); result = nullptr; EXPECT_EQ(ARES_EBADSTR, ares_expand_string(s1.data() + 1, s1.data(), s1.size(), (unsigned char**)&result, &len)); EXPECT_EQ(ARES_EBADSTR, ares_expand_string(s1.data() + 4, s1.data(), s1.size(), (unsigned char**)&result, &len)); SetAllocSizeFail(3 + 1); EXPECT_EQ(ARES_ENOMEM, ares_expand_string(s1.data(), s1.data(), s1.size(), (unsigned char**)&result, &len)); } } // namespace test } // namespace ares ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/ares-test-mock-ai.cc0000644000175100001770000006773700000000000022637 0ustar00runnerdocker00000000000000#include "ares-test-ai.h" #include "dns-proto.h" #ifdef HAVE_NETINET_IN_H #include #endif #include #include using testing::InvokeWithoutArgs; using testing::DoAll; namespace ares { namespace test { MATCHER_P(IncludesNumAddresses, n, "") { if(!arg) return false; int cnt = 0; for (const ares_addrinfo_node* ai = arg->nodes; ai != NULL; ai = ai->ai_next) cnt++; return n == cnt; } MATCHER_P(IncludesV4Address, address, "") { if(!arg) return false; in_addr addressnum = {}; if (!ares_inet_pton(AF_INET, address, &addressnum)) return false; // wrong number format? for (const ares_addrinfo_node* ai = arg->nodes; ai != NULL; ai = ai->ai_next) { if (ai->ai_family != AF_INET) continue; if (ai->ai_addrlen != sizeof(struct sockaddr_in)) continue; if (reinterpret_cast(ai->ai_addr)->sin_addr.s_addr == addressnum.s_addr) return true; // found } return false; } MATCHER_P(IncludesV6Address, address, "") { if(!arg) return false; in6_addr addressnum = {}; if (!ares_inet_pton(AF_INET6, address, &addressnum)) { return false; // wrong number format? } for (const ares_addrinfo_node* ai = arg->nodes; ai != NULL; ai = ai->ai_next) { if (ai->ai_family != AF_INET6) continue; if (ai->ai_addrlen != sizeof(struct sockaddr_in6)) continue; if (!memcmp( reinterpret_cast(ai->ai_addr)->sin6_addr.s6_addr, addressnum.s6_addr, sizeof(addressnum.s6_addr))) return true; // found } return false; } // UDP only so mock server doesn't get confused by concatenated requests TEST_P(MockUDPChannelTestAI, GetAddrInfoParallelLookups) { DNSPacket rsp1; rsp1.set_response().set_aa() .add_question(new DNSQuestion("www.google.com", T_A)) .add_answer(new DNSARR("www.google.com", 100, {2, 3, 4, 5})); ON_CALL(server_, OnRequest("www.google.com", T_A)) .WillByDefault(SetReply(&server_, &rsp1)); DNSPacket rsp2; rsp2.set_response().set_aa() .add_question(new DNSQuestion("www.example.com", T_A)) .add_answer(new DNSARR("www.example.com", 100, {1, 2, 3, 4})); ON_CALL(server_, OnRequest("www.example.com", T_A)) .WillByDefault(SetReply(&server_, &rsp2)); struct ares_addrinfo_hints hints = {}; hints.ai_family = AF_INET; hints.ai_flags = ARES_AI_NOSORT; AddrInfoResult result1; ares_getaddrinfo(channel_, "www.google.com.", NULL, &hints, AddrInfoCallback, &result1); AddrInfoResult result2; ares_getaddrinfo(channel_, "www.example.com.", NULL, &hints, AddrInfoCallback, &result2); AddrInfoResult result3; ares_getaddrinfo(channel_, "www.google.com.", NULL, &hints, AddrInfoCallback, &result3); Process(); EXPECT_TRUE(result1.done_); EXPECT_EQ(result1.status_, ARES_SUCCESS); EXPECT_THAT(result1.ai_, IncludesNumAddresses(1)); EXPECT_THAT(result1.ai_, IncludesV4Address("2.3.4.5")); EXPECT_TRUE(result2.done_); EXPECT_EQ(result2.status_, ARES_SUCCESS); EXPECT_THAT(result2.ai_, IncludesNumAddresses(1)); EXPECT_THAT(result2.ai_, IncludesV4Address("1.2.3.4")); EXPECT_TRUE(result3.done_); EXPECT_EQ(result3.status_, ARES_SUCCESS); EXPECT_THAT(result3.ai_, IncludesNumAddresses(1)); EXPECT_THAT(result3.ai_, IncludesV4Address("2.3.4.5")); } // UDP to TCP specific test TEST_P(MockUDPChannelTestAI, TruncationRetry) { DNSPacket rsptruncated; rsptruncated.set_response().set_aa().set_tc() .add_question(new DNSQuestion("www.google.com", T_A)); DNSPacket rspok; rspok.set_response() .add_question(new DNSQuestion("www.google.com", T_A)) .add_answer(new DNSARR("www.google.com", 100, {1, 2, 3, 4})); EXPECT_CALL(server_, OnRequest("www.google.com", T_A)) .WillOnce(SetReply(&server_, &rsptruncated)) .WillOnce(SetReply(&server_, &rspok)); AddrInfoResult result; struct ares_addrinfo_hints hints = {}; hints.ai_family = AF_INET; hints.ai_flags = ARES_AI_NOSORT; ares_getaddrinfo(channel_, "www.google.com.", NULL, &hints, AddrInfoCallback, &result); Process(); EXPECT_TRUE(result.done_); EXPECT_EQ(result.status_, ARES_SUCCESS); EXPECT_THAT(result.ai_, IncludesNumAddresses(1)); EXPECT_THAT(result.ai_, IncludesV4Address("1.2.3.4")); } // TCP only to prevent retries TEST_P(MockTCPChannelTestAI, MalformedResponse) { std::vector one = {0x01}; EXPECT_CALL(server_, OnRequest("www.google.com", T_A)) .WillOnce(SetReplyData(&server_, one)); AddrInfoResult result; struct ares_addrinfo_hints hints = {}; hints.ai_family = AF_INET; hints.ai_flags = ARES_AI_NOSORT; ares_getaddrinfo(channel_, "www.google.com.", NULL, &hints, AddrInfoCallback, &result); Process(); EXPECT_TRUE(result.done_); EXPECT_EQ(ARES_ETIMEOUT, result.status_); } TEST_P(MockTCPChannelTestAI, FormErrResponse) { DNSPacket rsp; rsp.set_response().set_aa() .add_question(new DNSQuestion("www.google.com", T_A)); rsp.set_rcode(FORMERR); EXPECT_CALL(server_, OnRequest("www.google.com", T_A)) .WillOnce(SetReply(&server_, &rsp)); AddrInfoResult result; struct ares_addrinfo_hints hints = {}; hints.ai_family = AF_INET; hints.ai_flags = ARES_AI_NOSORT; ares_getaddrinfo(channel_, "www.google.com.", NULL, &hints, AddrInfoCallback, &result); Process(); EXPECT_TRUE(result.done_); EXPECT_EQ(ARES_EFORMERR, result.status_); } TEST_P(MockTCPChannelTestAI, ServFailResponse) { DNSPacket rsp; rsp.set_response().set_aa() .add_question(new DNSQuestion("www.google.com", T_A)); rsp.set_rcode(SERVFAIL); EXPECT_CALL(server_, OnRequest("www.google.com", T_A)) .WillOnce(SetReply(&server_, &rsp)); AddrInfoResult result; struct ares_addrinfo_hints hints = {}; hints.ai_family = AF_INET; hints.ai_flags = ARES_AI_NOSORT; ares_getaddrinfo(channel_, "www.google.com.", NULL, &hints, AddrInfoCallback, &result); Process(); EXPECT_TRUE(result.done_); // ARES_FLAG_NOCHECKRESP not set, so SERVFAIL consumed EXPECT_EQ(ARES_ECONNREFUSED, result.status_); } TEST_P(MockTCPChannelTestAI, NotImplResponse) { DNSPacket rsp; rsp.set_response().set_aa() .add_question(new DNSQuestion("www.google.com", T_A)); rsp.set_rcode(NOTIMP); EXPECT_CALL(server_, OnRequest("www.google.com", T_A)) .WillOnce(SetReply(&server_, &rsp)); AddrInfoResult result; struct ares_addrinfo_hints hints = {}; hints.ai_family = AF_INET; hints.ai_flags = ARES_AI_NOSORT; ares_getaddrinfo(channel_, "www.google.com.", NULL, &hints, AddrInfoCallback, &result); Process(); EXPECT_TRUE(result.done_); // ARES_FLAG_NOCHECKRESP not set, so NOTIMP consumed EXPECT_EQ(ARES_ECONNREFUSED, result.status_); } TEST_P(MockTCPChannelTestAI, RefusedResponse) { DNSPacket rsp; rsp.set_response().set_aa() .add_question(new DNSQuestion("www.google.com", T_A)); rsp.set_rcode(REFUSED); EXPECT_CALL(server_, OnRequest("www.google.com", T_A)) .WillOnce(SetReply(&server_, &rsp)); AddrInfoResult result; struct ares_addrinfo_hints hints = {}; hints.ai_family = AF_INET; hints.ai_flags = ARES_AI_NOSORT; ares_getaddrinfo(channel_, "www.google.com.", NULL, &hints, AddrInfoCallback, &result); Process(); EXPECT_TRUE(result.done_); // ARES_FLAG_NOCHECKRESP not set, so REFUSED consumed EXPECT_EQ(ARES_ECONNREFUSED, result.status_); } TEST_P(MockTCPChannelTestAI, YXDomainResponse) { DNSPacket rsp; rsp.set_response().set_aa() .add_question(new DNSQuestion("www.google.com", T_A)); rsp.set_rcode(YXDOMAIN); EXPECT_CALL(server_, OnRequest("www.google.com", T_A)) .WillOnce(SetReply(&server_, &rsp)); AddrInfoResult result; struct ares_addrinfo_hints hints = {}; hints.ai_family = AF_INET; hints.ai_flags = ARES_AI_NOSORT; ares_getaddrinfo(channel_, "www.google.com.", NULL, &hints, AddrInfoCallback, &result); Process(); EXPECT_TRUE(result.done_); EXPECT_EQ(ARES_ENODATA, result.status_); } class MockExtraOptsTestAI : public MockChannelOptsTest, public ::testing::WithParamInterface< std::pair > { public: MockExtraOptsTestAI() : MockChannelOptsTest(1, GetParam().first, GetParam().second, FillOptions(&opts_), ARES_OPT_SOCK_SNDBUF|ARES_OPT_SOCK_RCVBUF) {} static struct ares_options* FillOptions(struct ares_options * opts) { memset(opts, 0, sizeof(struct ares_options)); // Set a few options that affect socket communications opts->socket_send_buffer_size = 514; opts->socket_receive_buffer_size = 514; return opts; } private: struct ares_options opts_; }; TEST_P(MockExtraOptsTestAI, SimpleQuery) { ares_set_local_ip4(channel_, 0x7F000001); byte addr6[16] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}; ares_set_local_ip6(channel_, addr6); ares_set_local_dev(channel_, "dummy"); DNSPacket rsp; rsp.set_response().set_aa() .add_question(new DNSQuestion("www.google.com", T_A)) .add_answer(new DNSARR("www.google.com", 100, {2, 3, 4, 5})); ON_CALL(server_, OnRequest("www.google.com", T_A)) .WillByDefault(SetReply(&server_, &rsp)); AddrInfoResult result; struct ares_addrinfo_hints hints = {}; hints.ai_family = AF_INET; hints.ai_flags = ARES_AI_NOSORT; ares_getaddrinfo(channel_, "www.google.com.", NULL, &hints, AddrInfoCallback, &result); Process(); EXPECT_TRUE(result.done_); EXPECT_EQ(ARES_SUCCESS, result.status_); EXPECT_THAT(result.ai_, IncludesNumAddresses(1)); EXPECT_THAT(result.ai_, IncludesV4Address("2.3.4.5")); } class MockExtraOptsNDotsTestAI : public MockChannelOptsTest, public ::testing::WithParamInterface< std::pair > { public: MockExtraOptsNDotsTestAI(int ndots) : MockChannelOptsTest(1, GetParam().first, GetParam().second, FillOptions(&opts_, ndots), ARES_OPT_SOCK_SNDBUF|ARES_OPT_SOCK_RCVBUF|ARES_OPT_NDOTS) {} static struct ares_options* FillOptions(struct ares_options * opts, int ndots) { memset(opts, 0, sizeof(struct ares_options)); // Set a few options that affect socket communications opts->socket_send_buffer_size = 514; opts->socket_receive_buffer_size = 514; opts->ndots = ndots; return opts; } private: struct ares_options opts_; }; class MockExtraOptsNDots5TestAI : public MockExtraOptsNDotsTestAI { public: MockExtraOptsNDots5TestAI() : MockExtraOptsNDotsTestAI(5) {} }; TEST_P(MockExtraOptsNDots5TestAI, SimpleQuery) { ares_set_local_ip4(channel_, 0x7F000001); byte addr6[16] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}; ares_set_local_ip6(channel_, addr6); ares_set_local_dev(channel_, "dummy"); DNSPacket rsp; rsp.set_response().set_aa() .add_question(new DNSQuestion("dynamodb.us-east-1.amazonaws.com", T_A)) .add_answer(new DNSARR("dynamodb.us-east-1.amazonaws.com", 100, {123, 45, 67, 8})); ON_CALL(server_, OnRequest("dynamodb.us-east-1.amazonaws.com", T_A)) .WillByDefault(SetReply(&server_, &rsp)); AddrInfoResult result; struct ares_addrinfo_hints hints = {}; hints.ai_family = AF_INET; hints.ai_flags = ARES_AI_NOSORT; ares_getaddrinfo(channel_, "dynamodb.us-east-1.amazonaws.com.", NULL, &hints, AddrInfoCallback, &result); Process(); EXPECT_TRUE(result.done_); EXPECT_EQ(ARES_SUCCESS, result.status_); EXPECT_THAT(result.ai_, IncludesNumAddresses(1)); EXPECT_THAT(result.ai_, IncludesV4Address("123.45.67.8")); } class MockFlagsChannelOptsTestAI : public MockChannelOptsTest, public ::testing::WithParamInterface< std::pair > { public: MockFlagsChannelOptsTestAI(int flags) : MockChannelOptsTest(1, GetParam().first, GetParam().second, FillOptions(&opts_, flags), ARES_OPT_FLAGS) {} static struct ares_options* FillOptions(struct ares_options * opts, int flags) { memset(opts, 0, sizeof(struct ares_options)); opts->flags = flags; return opts; } private: struct ares_options opts_; }; class MockNoCheckRespChannelTestAI : public MockFlagsChannelOptsTestAI { public: MockNoCheckRespChannelTestAI() : MockFlagsChannelOptsTestAI(ARES_FLAG_NOCHECKRESP) {} }; TEST_P(MockNoCheckRespChannelTestAI, ServFailResponse) { DNSPacket rsp; rsp.set_response().set_aa() .add_question(new DNSQuestion("www.google.com", T_A)); rsp.set_rcode(SERVFAIL); ON_CALL(server_, OnRequest("www.google.com", T_A)) .WillByDefault(SetReply(&server_, &rsp)); AddrInfoResult result; struct ares_addrinfo_hints hints = {}; hints.ai_family = AF_INET; hints.ai_flags = ARES_AI_NOSORT; ares_getaddrinfo(channel_, "www.google.com.", NULL, &hints, AddrInfoCallback, &result); Process(); EXPECT_TRUE(result.done_); EXPECT_EQ(ARES_ESERVFAIL, result.status_); } TEST_P(MockNoCheckRespChannelTestAI, NotImplResponse) { DNSPacket rsp; rsp.set_response().set_aa() .add_question(new DNSQuestion("www.google.com", T_A)); rsp.set_rcode(NOTIMP); ON_CALL(server_, OnRequest("www.google.com", T_A)) .WillByDefault(SetReply(&server_, &rsp)); AddrInfoResult result; struct ares_addrinfo_hints hints = {}; hints.ai_family = AF_INET; hints.ai_flags = ARES_AI_NOSORT; ares_getaddrinfo(channel_, "www.google.com.", NULL, &hints, AddrInfoCallback, &result); Process(); EXPECT_TRUE(result.done_); EXPECT_EQ(ARES_ENOTIMP, result.status_); } TEST_P(MockNoCheckRespChannelTestAI, RefusedResponse) { DNSPacket rsp; rsp.set_response().set_aa() .add_question(new DNSQuestion("www.google.com", T_A)); rsp.set_rcode(REFUSED); ON_CALL(server_, OnRequest("www.google.com", T_A)) .WillByDefault(SetReply(&server_, &rsp)); AddrInfoResult result; struct ares_addrinfo_hints hints = {}; hints.ai_family = AF_INET; hints.ai_flags = ARES_AI_NOSORT; ares_getaddrinfo(channel_, "www.google.com.", NULL, &hints, AddrInfoCallback, &result); Process(); EXPECT_TRUE(result.done_); EXPECT_EQ(ARES_EREFUSED, result.status_); } TEST_P(MockChannelTestAI, FamilyV6) { DNSPacket rsp6; rsp6.set_response().set_aa() .add_question(new DNSQuestion("example.com", T_AAAA)) .add_answer(new DNSAaaaRR("example.com", 100, {0x21, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03})); ON_CALL(server_, OnRequest("example.com", T_AAAA)) .WillByDefault(SetReply(&server_, &rsp6)); AddrInfoResult result; struct ares_addrinfo_hints hints = {}; hints.ai_family = AF_INET6; hints.ai_flags = ARES_AI_NOSORT; ares_getaddrinfo(channel_, "example.com.", NULL, &hints, AddrInfoCallback, &result); Process(); EXPECT_TRUE(result.done_); EXPECT_THAT(result.ai_, IncludesNumAddresses(1)); EXPECT_THAT(result.ai_, IncludesV6Address("2121:0000:0000:0000:0000:0000:0000:0303")); } TEST_P(MockChannelTestAI, FamilyV4) { DNSPacket rsp4; rsp4.set_response().set_aa() .add_question(new DNSQuestion("example.com", T_A)) .add_answer(new DNSARR("example.com", 100, {2, 3, 4, 5})); ON_CALL(server_, OnRequest("example.com", T_A)) .WillByDefault(SetReply(&server_, &rsp4)); AddrInfoResult result = {}; struct ares_addrinfo_hints hints = {}; hints.ai_family = AF_INET; hints.ai_flags = ARES_AI_NOSORT; ares_getaddrinfo(channel_, "example.com.", NULL, &hints, AddrInfoCallback, &result); Process(); EXPECT_TRUE(result.done_); EXPECT_THAT(result.ai_, IncludesNumAddresses(1)); EXPECT_THAT(result.ai_, IncludesV4Address("2.3.4.5")); } TEST_P(MockChannelTestAI, FamilyV4_MultipleAddresses) { DNSPacket rsp4; rsp4.set_response().set_aa() .add_question(new DNSQuestion("example.com", T_A)) .add_answer(new DNSARR("example.com", 100, {2, 3, 4, 5})) .add_answer(new DNSARR("example.com", 100, {7, 8, 9, 0})); ON_CALL(server_, OnRequest("example.com", T_A)) .WillByDefault(SetReply(&server_, &rsp4)); AddrInfoResult result = {}; struct ares_addrinfo_hints hints = {}; hints.ai_family = AF_INET; hints.ai_flags = ARES_AI_NOSORT; ares_getaddrinfo(channel_, "example.com.", NULL, &hints, AddrInfoCallback, &result); Process(); EXPECT_TRUE(result.done_); std::stringstream ss; ss << result.ai_; EXPECT_EQ("{addr=[2.3.4.5], addr=[7.8.9.0]}", ss.str()); } TEST_P(MockChannelTestAI, FamilyUnspecified) { DNSPacket rsp6; rsp6.set_response().set_aa() .add_question(new DNSQuestion("example.com", T_AAAA)) .add_answer(new DNSAaaaRR("example.com", 100, {0x21, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03})); ON_CALL(server_, OnRequest("example.com", T_AAAA)) .WillByDefault(SetReply(&server_, &rsp6)); DNSPacket rsp4; rsp4.set_response().set_aa() .add_question(new DNSQuestion("example.com", T_A)) .add_answer(new DNSARR("example.com", 100, {2, 3, 4, 5})); ON_CALL(server_, OnRequest("example.com", T_A)) .WillByDefault(SetReply(&server_, &rsp4)); AddrInfoResult result; struct ares_addrinfo_hints hints = {}; hints.ai_family = AF_UNSPEC; hints.ai_flags = ARES_AI_NOSORT; ares_getaddrinfo(channel_, "example.com.", NULL, &hints, AddrInfoCallback, &result); Process(); EXPECT_TRUE(result.done_); EXPECT_THAT(result.ai_, IncludesNumAddresses(2)); EXPECT_THAT(result.ai_, IncludesV4Address("2.3.4.5")); EXPECT_THAT(result.ai_, IncludesV6Address("2121:0000:0000:0000:0000:0000:0000:0303")); } class MockEDNSChannelTestAI : public MockFlagsChannelOptsTestAI { public: MockEDNSChannelTestAI() : MockFlagsChannelOptsTestAI(ARES_FLAG_EDNS) {} }; TEST_P(MockEDNSChannelTestAI, RetryWithoutEDNS) { DNSPacket rspfail; rspfail.set_response().set_aa().set_rcode(FORMERR) .add_question(new DNSQuestion("www.google.com", T_A)); DNSPacket rspok; rspok.set_response() .add_question(new DNSQuestion("www.google.com", T_A)) .add_answer(new DNSARR("www.google.com", 100, {1, 2, 3, 4})); EXPECT_CALL(server_, OnRequest("www.google.com", T_A)) .WillOnce(SetReply(&server_, &rspfail)) .WillOnce(SetReply(&server_, &rspok)); AddrInfoResult result; struct ares_addrinfo_hints hints = {}; hints.ai_family = AF_INET; hints.ai_flags = ARES_AI_NOSORT; ares_getaddrinfo(channel_, "www.google.com.", NULL, &hints, AddrInfoCallback, &result); Process(); EXPECT_TRUE(result.done_); EXPECT_THAT(result.ai_, IncludesNumAddresses(1)); EXPECT_THAT(result.ai_, IncludesV4Address("1.2.3.4")); } TEST_P(MockChannelTestAI, SearchDomains) { DNSPacket nofirst; nofirst.set_response().set_aa().set_rcode(NXDOMAIN) .add_question(new DNSQuestion("www.first.com", T_A)); ON_CALL(server_, OnRequest("www.first.com", T_A)) .WillByDefault(SetReply(&server_, &nofirst)); DNSPacket nosecond; nosecond.set_response().set_aa().set_rcode(NXDOMAIN) .add_question(new DNSQuestion("www.second.org", T_A)); ON_CALL(server_, OnRequest("www.second.org", T_A)) .WillByDefault(SetReply(&server_, &nosecond)); DNSPacket yesthird; yesthird.set_response().set_aa() .add_question(new DNSQuestion("www.third.gov", T_A)) .add_answer(new DNSARR("www.third.gov", 0x0200, {2, 3, 4, 5})); ON_CALL(server_, OnRequest("www.third.gov", T_A)) .WillByDefault(SetReply(&server_, &yesthird)); AddrInfoResult result; struct ares_addrinfo_hints hints = {}; hints.ai_family = AF_INET; hints.ai_flags = ARES_AI_NOSORT; ares_getaddrinfo(channel_, "www", NULL, &hints, AddrInfoCallback, &result); Process(); EXPECT_TRUE(result.done_); EXPECT_THAT(result.ai_, IncludesNumAddresses(1)); EXPECT_THAT(result.ai_, IncludesV4Address("2.3.4.5")); } TEST_P(MockChannelTestAI, SearchDomainsServFailOnAAAA) { DNSPacket nofirst; nofirst.set_response().set_aa().set_rcode(NXDOMAIN) .add_question(new DNSQuestion("www.first.com", T_AAAA)); ON_CALL(server_, OnRequest("www.first.com", T_AAAA)) .WillByDefault(SetReply(&server_, &nofirst)); DNSPacket nofirst4; nofirst4.set_response().set_aa().set_rcode(NXDOMAIN) .add_question(new DNSQuestion("www.first.com", T_A)); ON_CALL(server_, OnRequest("www.first.com", T_A)) .WillByDefault(SetReply(&server_, &nofirst4)); DNSPacket nosecond; nosecond.set_response().set_aa().set_rcode(NXDOMAIN) .add_question(new DNSQuestion("www.second.org", T_AAAA)); ON_CALL(server_, OnRequest("www.second.org", T_AAAA)) .WillByDefault(SetReply(&server_, &nosecond)); DNSPacket yessecond4; yessecond4.set_response().set_aa() .add_question(new DNSQuestion("www.second.org", T_A)) .add_answer(new DNSARR("www.second.org", 0x0200, {2, 3, 4, 5})); ON_CALL(server_, OnRequest("www.second.org", T_A)) .WillByDefault(SetReply(&server_, &yessecond4)); DNSPacket failthird; failthird.set_response().set_aa().set_rcode(SERVFAIL) .add_question(new DNSQuestion("www.third.gov", T_AAAA)); ON_CALL(server_, OnRequest("www.third.gov", T_AAAA)) .WillByDefault(SetReply(&server_, &failthird)); DNSPacket failthird4; failthird4.set_response().set_aa().set_rcode(SERVFAIL) .add_question(new DNSQuestion("www.third.gov", T_A)); ON_CALL(server_, OnRequest("www.third.gov", T_A)) .WillByDefault(SetReply(&server_, &failthird4)); AddrInfoResult result; struct ares_addrinfo_hints hints = {}; hints.ai_family = AF_UNSPEC; hints.ai_flags = ARES_AI_NOSORT; ares_getaddrinfo(channel_, "www", NULL, &hints, AddrInfoCallback, &result); Process(); EXPECT_TRUE(result.done_); EXPECT_THAT(result.ai_, IncludesNumAddresses(1)); EXPECT_THAT(result.ai_, IncludesV4Address("2.3.4.5")); } class MockMultiServerChannelTestAI : public MockChannelOptsTest, public ::testing::WithParamInterface< std::pair > { public: MockMultiServerChannelTestAI(bool rotate) : MockChannelOptsTest(3, GetParam().first, GetParam().second, nullptr, rotate ? ARES_OPT_ROTATE : ARES_OPT_NOROTATE) {} void CheckExample() { AddrInfoResult result; struct ares_addrinfo_hints hints = {}; hints.ai_family = AF_INET; hints.ai_flags = ARES_AI_NOSORT; ares_getaddrinfo(channel_, "www.example.com.", NULL, &hints, AddrInfoCallback, &result); Process(); EXPECT_TRUE(result.done_); EXPECT_EQ(result.status_, ARES_SUCCESS); EXPECT_THAT(result.ai_, IncludesNumAddresses(1)); EXPECT_THAT(result.ai_, IncludesV4Address("2.3.4.5")); } }; class RotateMultiMockTestAI : public MockMultiServerChannelTestAI { public: RotateMultiMockTestAI() : MockMultiServerChannelTestAI(true) {} }; class NoRotateMultiMockTestAI : public MockMultiServerChannelTestAI { public: NoRotateMultiMockTestAI() : MockMultiServerChannelTestAI(false) {} }; TEST_P(RotateMultiMockTestAI, ThirdServer) { struct ares_options opts = {0}; int optmask = 0; EXPECT_EQ(ARES_SUCCESS, ares_save_options(channel_, &opts, &optmask)); EXPECT_EQ(0, (optmask & ARES_OPT_NOROTATE)); ares_destroy_options(&opts); DNSPacket servfailrsp; servfailrsp.set_response().set_aa().set_rcode(SERVFAIL) .add_question(new DNSQuestion("www.example.com", T_A)); DNSPacket notimplrsp; notimplrsp.set_response().set_aa().set_rcode(NOTIMP) .add_question(new DNSQuestion("www.example.com", T_A)); DNSPacket okrsp; okrsp.set_response().set_aa() .add_question(new DNSQuestion("www.example.com", T_A)) .add_answer(new DNSARR("www.example.com", 100, {2,3,4,5})); EXPECT_CALL(*servers_[0], OnRequest("www.example.com", T_A)) .WillOnce(SetReply(servers_[0].get(), &servfailrsp)); EXPECT_CALL(*servers_[1], OnRequest("www.example.com", T_A)) .WillOnce(SetReply(servers_[1].get(), ¬implrsp)); EXPECT_CALL(*servers_[2], OnRequest("www.example.com", T_A)) .WillOnce(SetReply(servers_[2].get(), &okrsp)); CheckExample(); // Second time around, starts from server [1]. EXPECT_CALL(*servers_[1], OnRequest("www.example.com", T_A)) .WillOnce(SetReply(servers_[1].get(), &servfailrsp)); EXPECT_CALL(*servers_[2], OnRequest("www.example.com", T_A)) .WillOnce(SetReply(servers_[2].get(), ¬implrsp)); EXPECT_CALL(*servers_[0], OnRequest("www.example.com", T_A)) .WillOnce(SetReply(servers_[0].get(), &okrsp)); CheckExample(); // Third time around, starts from server [2]. EXPECT_CALL(*servers_[2], OnRequest("www.example.com", T_A)) .WillOnce(SetReply(servers_[2].get(), &servfailrsp)); EXPECT_CALL(*servers_[0], OnRequest("www.example.com", T_A)) .WillOnce(SetReply(servers_[0].get(), ¬implrsp)); EXPECT_CALL(*servers_[1], OnRequest("www.example.com", T_A)) .WillOnce(SetReply(servers_[1].get(), &okrsp)); CheckExample(); } TEST_P(NoRotateMultiMockTestAI, ThirdServer) { struct ares_options opts = {0}; int optmask = 0; EXPECT_EQ(ARES_SUCCESS, ares_save_options(channel_, &opts, &optmask)); EXPECT_EQ(ARES_OPT_NOROTATE, (optmask & ARES_OPT_NOROTATE)); ares_destroy_options(&opts); DNSPacket servfailrsp; servfailrsp.set_response().set_aa().set_rcode(SERVFAIL) .add_question(new DNSQuestion("www.example.com", T_A)); DNSPacket notimplrsp; notimplrsp.set_response().set_aa().set_rcode(NOTIMP) .add_question(new DNSQuestion("www.example.com", T_A)); DNSPacket okrsp; okrsp.set_response().set_aa() .add_question(new DNSQuestion("www.example.com", T_A)) .add_answer(new DNSARR("www.example.com", 100, {2,3,4,5})); EXPECT_CALL(*servers_[0], OnRequest("www.example.com", T_A)) .WillOnce(SetReply(servers_[0].get(), &servfailrsp)); EXPECT_CALL(*servers_[1], OnRequest("www.example.com", T_A)) .WillOnce(SetReply(servers_[1].get(), ¬implrsp)); EXPECT_CALL(*servers_[2], OnRequest("www.example.com", T_A)) .WillOnce(SetReply(servers_[2].get(), &okrsp)); CheckExample(); // Second time around, still starts from server [0]. EXPECT_CALL(*servers_[0], OnRequest("www.example.com", T_A)) .WillOnce(SetReply(servers_[0].get(), &servfailrsp)); EXPECT_CALL(*servers_[1], OnRequest("www.example.com", T_A)) .WillOnce(SetReply(servers_[1].get(), ¬implrsp)); EXPECT_CALL(*servers_[2], OnRequest("www.example.com", T_A)) .WillOnce(SetReply(servers_[2].get(), &okrsp)); CheckExample(); // Third time around, still starts from server [0]. EXPECT_CALL(*servers_[0], OnRequest("www.example.com", T_A)) .WillOnce(SetReply(servers_[0].get(), &servfailrsp)); EXPECT_CALL(*servers_[1], OnRequest("www.example.com", T_A)) .WillOnce(SetReply(servers_[1].get(), ¬implrsp)); EXPECT_CALL(*servers_[2], OnRequest("www.example.com", T_A)) .WillOnce(SetReply(servers_[2].get(), &okrsp)); CheckExample(); } TEST_P(MockChannelTestAI, FamilyV4ServiceName) { DNSPacket rsp4; rsp4.set_response().set_aa() .add_question(new DNSQuestion("example.com", T_A)) .add_answer(new DNSARR("example.com", 100, {1, 1, 1, 1})) .add_answer(new DNSARR("example.com", 100, {2, 2, 2, 2})); ON_CALL(server_, OnRequest("example.com", T_A)) .WillByDefault(SetReply(&server_, &rsp4)); AddrInfoResult result = {}; struct ares_addrinfo_hints hints = {}; hints.ai_family = AF_INET; hints.ai_flags = ARES_AI_NOSORT; ares_getaddrinfo(channel_, "example.com", "http", &hints, AddrInfoCallback, &result); Process(); EXPECT_TRUE(result.done_); std::stringstream ss; ss << result.ai_; EXPECT_EQ("{addr=[1.1.1.1:80], addr=[2.2.2.2:80]}", ss.str()); } INSTANTIATE_TEST_SUITE_P(AddressFamiliesAI, MockChannelTestAI, ::testing::ValuesIn(ares::test::families_modes)); INSTANTIATE_TEST_SUITE_P(AddressFamiliesAI, MockUDPChannelTestAI, ::testing::ValuesIn(ares::test::families)); INSTANTIATE_TEST_SUITE_P(AddressFamiliesAI, MockTCPChannelTestAI, ::testing::ValuesIn(ares::test::families)); INSTANTIATE_TEST_SUITE_P(AddressFamiliesAI, MockExtraOptsTestAI, ::testing::ValuesIn(ares::test::families_modes)); INSTANTIATE_TEST_SUITE_P(AddressFamiliesAI, MockExtraOptsNDots5TestAI, ::testing::ValuesIn(ares::test::families_modes)); INSTANTIATE_TEST_SUITE_P(AddressFamiliesAI, MockNoCheckRespChannelTestAI, ::testing::ValuesIn(ares::test::families_modes)); INSTANTIATE_TEST_SUITE_P(AddressFamiliesAI, MockEDNSChannelTestAI, ::testing::ValuesIn(ares::test::families_modes)); INSTANTIATE_TEST_SUITE_P(TransportModesAI, RotateMultiMockTestAI, ::testing::ValuesIn(ares::test::families_modes)); INSTANTIATE_TEST_SUITE_P(TransportModesAI, NoRotateMultiMockTestAI, ::testing::ValuesIn(ares::test::families_modes)); } // namespace test } // namespace ares ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/ares-test-mock.cc0000644000175100001770000012507000000000000022231 0ustar00runnerdocker00000000000000#include "ares-test.h" #include "dns-proto.h" #ifndef WIN32 #include #include #endif #include #include using testing::InvokeWithoutArgs; using testing::DoAll; namespace ares { namespace test { TEST_P(MockChannelTest, Basic) { std::vector reply = { 0x00, 0x00, // qid 0x84, // response + query + AA + not-TC + not-RD 0x00, // not-RA + not-Z + not-AD + not-CD + rc=NoError 0x00, 0x01, // 1 question 0x00, 0x01, // 1 answer RRs 0x00, 0x00, // 0 authority RRs 0x00, 0x00, // 0 additional RRs // Question 0x03, 'w', 'w', 'w', 0x06, 'g', 'o', 'o', 'g', 'l', 'e', 0x03, 'c', 'o', 'm', 0x00, 0x00, 0x01, // type A 0x00, 0x01, // class IN // Answer 0x03, 'w', 'w', 'w', 0x06, 'g', 'o', 'o', 'g', 'l', 'e', 0x03, 'c', 'o', 'm', 0x00, 0x00, 0x01, // type A 0x00, 0x01, // class IN 0x00, 0x00, 0x01, 0x00, // TTL 0x00, 0x04, // rdata length 0x01, 0x02, 0x03, 0x04 }; ON_CALL(server_, OnRequest("www.google.com", T_A)) .WillByDefault(SetReplyData(&server_, reply)); HostResult result; ares_gethostbyname(channel_, "www.google.com.", AF_INET, HostCallback, &result); Process(); EXPECT_TRUE(result.done_); std::stringstream ss; ss << result.host_; EXPECT_EQ("{'www.google.com' aliases=[] addrs=[1.2.3.4]}", ss.str()); } // UDP only so mock server doesn't get confused by concatenated requests TEST_P(MockUDPChannelTest, GetHostByNameParallelLookups) { DNSPacket rsp1; rsp1.set_response().set_aa() .add_question(new DNSQuestion("www.google.com", T_A)) .add_answer(new DNSARR("www.google.com", 100, {2, 3, 4, 5})); ON_CALL(server_, OnRequest("www.google.com", T_A)) .WillByDefault(SetReply(&server_, &rsp1)); DNSPacket rsp2; rsp2.set_response().set_aa() .add_question(new DNSQuestion("www.example.com", T_A)) .add_answer(new DNSARR("www.example.com", 100, {1, 2, 3, 4})); ON_CALL(server_, OnRequest("www.example.com", T_A)) .WillByDefault(SetReply(&server_, &rsp2)); HostResult result1; ares_gethostbyname(channel_, "www.google.com.", AF_INET, HostCallback, &result1); HostResult result2; ares_gethostbyname(channel_, "www.example.com.", AF_INET, HostCallback, &result2); HostResult result3; ares_gethostbyname(channel_, "www.google.com.", AF_INET, HostCallback, &result3); Process(); EXPECT_TRUE(result1.done_); EXPECT_TRUE(result2.done_); EXPECT_TRUE(result3.done_); std::stringstream ss1; ss1 << result1.host_; EXPECT_EQ("{'www.google.com' aliases=[] addrs=[2.3.4.5]}", ss1.str()); std::stringstream ss2; ss2 << result2.host_; EXPECT_EQ("{'www.example.com' aliases=[] addrs=[1.2.3.4]}", ss2.str()); std::stringstream ss3; ss3 << result3.host_; EXPECT_EQ("{'www.google.com' aliases=[] addrs=[2.3.4.5]}", ss3.str()); } // UDP to TCP specific test TEST_P(MockUDPChannelTest, TruncationRetry) { DNSPacket rsptruncated; rsptruncated.set_response().set_aa().set_tc() .add_question(new DNSQuestion("www.google.com", T_A)); DNSPacket rspok; rspok.set_response() .add_question(new DNSQuestion("www.google.com", T_A)) .add_answer(new DNSARR("www.google.com", 100, {1, 2, 3, 4})); EXPECT_CALL(server_, OnRequest("www.google.com", T_A)) .WillOnce(SetReply(&server_, &rsptruncated)) .WillOnce(SetReply(&server_, &rspok)); HostResult result; ares_gethostbyname(channel_, "www.google.com.", AF_INET, HostCallback, &result); Process(); EXPECT_TRUE(result.done_); std::stringstream ss; ss << result.host_; EXPECT_EQ("{'www.google.com' aliases=[] addrs=[1.2.3.4]}", ss.str()); } static int sock_cb_count = 0; static int SocketConnectCallback(ares_socket_t fd, int type, void *data) { int rc = *(int*)data; if (verbose) std::cerr << "SocketConnectCallback(" << fd << ") invoked" << std::endl; sock_cb_count++; return rc; } TEST_P(MockChannelTest, SockCallback) { DNSPacket rsp; rsp.set_response().set_aa() .add_question(new DNSQuestion("www.google.com", T_A)) .add_answer(new DNSARR("www.google.com", 100, {2, 3, 4, 5})); EXPECT_CALL(server_, OnRequest("www.google.com", T_A)) .WillOnce(SetReply(&server_, &rsp)); // Get notified of new sockets int rc = ARES_SUCCESS; ares_set_socket_callback(channel_, SocketConnectCallback, &rc); HostResult result; sock_cb_count = 0; ares_gethostbyname(channel_, "www.google.com.", AF_INET, HostCallback, &result); Process(); EXPECT_EQ(1, sock_cb_count); EXPECT_TRUE(result.done_); std::stringstream ss; ss << result.host_; EXPECT_EQ("{'www.google.com' aliases=[] addrs=[2.3.4.5]}", ss.str()); } TEST_P(MockChannelTest, SockFailCallback) { // Notification of new sockets gives an error. int rc = -1; ares_set_socket_callback(channel_, SocketConnectCallback, &rc); HostResult result; sock_cb_count = 0; ares_gethostbyname(channel_, "www.google.com.", AF_INET, HostCallback, &result); Process(); EXPECT_LT(1, sock_cb_count); EXPECT_TRUE(result.done_); EXPECT_EQ(ARES_ECONNREFUSED, result.status_); } static int sock_config_cb_count = 0; static int SocketConfigureCallback(ares_socket_t fd, int type, void *data) { int rc = *(int*)data; if (verbose) std::cerr << "SocketConfigureCallback(" << fd << ") invoked" << std::endl; sock_config_cb_count++; return rc; } TEST_P(MockChannelTest, SockConfigureCallback) { DNSPacket rsp; rsp.set_response().set_aa() .add_question(new DNSQuestion("www.google.com", T_A)) .add_answer(new DNSARR("www.google.com", 100, {2, 3, 4, 5})); EXPECT_CALL(server_, OnRequest("www.google.com", T_A)) .WillOnce(SetReply(&server_, &rsp)); // Get notified of new sockets int rc = ARES_SUCCESS; ares_set_socket_configure_callback(channel_, SocketConfigureCallback, &rc); HostResult result; sock_config_cb_count = 0; ares_gethostbyname(channel_, "www.google.com.", AF_INET, HostCallback, &result); Process(); EXPECT_EQ(1, sock_config_cb_count); EXPECT_TRUE(result.done_); std::stringstream ss; ss << result.host_; EXPECT_EQ("{'www.google.com' aliases=[] addrs=[2.3.4.5]}", ss.str()); } TEST_P(MockChannelTest, SockConfigureFailCallback) { // Notification of new sockets gives an error. int rc = -1; ares_set_socket_configure_callback(channel_, SocketConfigureCallback, &rc); HostResult result; sock_config_cb_count = 0; ares_gethostbyname(channel_, "www.google.com.", AF_INET, HostCallback, &result); Process(); EXPECT_LT(1, sock_config_cb_count); EXPECT_TRUE(result.done_); EXPECT_EQ(ARES_ECONNREFUSED, result.status_); } // TCP only to prevent retries TEST_P(MockTCPChannelTest, MalformedResponse) { std::vector one = {0x01}; EXPECT_CALL(server_, OnRequest("www.google.com", T_A)) .WillOnce(SetReplyData(&server_, one)); HostResult result; ares_gethostbyname(channel_, "www.google.com.", AF_INET, HostCallback, &result); Process(); EXPECT_TRUE(result.done_); EXPECT_EQ(ARES_ETIMEOUT, result.status_); } TEST_P(MockTCPChannelTest, FormErrResponse) { DNSPacket rsp; rsp.set_response().set_aa() .add_question(new DNSQuestion("www.google.com", T_A)); rsp.set_rcode(FORMERR); EXPECT_CALL(server_, OnRequest("www.google.com", T_A)) .WillOnce(SetReply(&server_, &rsp)); HostResult result; ares_gethostbyname(channel_, "www.google.com.", AF_INET, HostCallback, &result); Process(); EXPECT_TRUE(result.done_); EXPECT_EQ(ARES_EFORMERR, result.status_); } TEST_P(MockTCPChannelTest, ServFailResponse) { DNSPacket rsp; rsp.set_response().set_aa() .add_question(new DNSQuestion("www.google.com", T_A)); rsp.set_rcode(SERVFAIL); EXPECT_CALL(server_, OnRequest("www.google.com", T_A)) .WillOnce(SetReply(&server_, &rsp)); HostResult result; ares_gethostbyname(channel_, "www.google.com.", AF_INET, HostCallback, &result); Process(); EXPECT_TRUE(result.done_); // ARES_FLAG_NOCHECKRESP not set, so SERVFAIL consumed EXPECT_EQ(ARES_ECONNREFUSED, result.status_); } TEST_P(MockTCPChannelTest, NotImplResponse) { DNSPacket rsp; rsp.set_response().set_aa() .add_question(new DNSQuestion("www.google.com", T_A)); rsp.set_rcode(NOTIMP); EXPECT_CALL(server_, OnRequest("www.google.com", T_A)) .WillOnce(SetReply(&server_, &rsp)); HostResult result; ares_gethostbyname(channel_, "www.google.com.", AF_INET, HostCallback, &result); Process(); EXPECT_TRUE(result.done_); // ARES_FLAG_NOCHECKRESP not set, so NOTIMP consumed EXPECT_EQ(ARES_ECONNREFUSED, result.status_); } TEST_P(MockTCPChannelTest, RefusedResponse) { DNSPacket rsp; rsp.set_response().set_aa() .add_question(new DNSQuestion("www.google.com", T_A)); rsp.set_rcode(REFUSED); EXPECT_CALL(server_, OnRequest("www.google.com", T_A)) .WillOnce(SetReply(&server_, &rsp)); HostResult result; ares_gethostbyname(channel_, "www.google.com.", AF_INET, HostCallback, &result); Process(); EXPECT_TRUE(result.done_); // ARES_FLAG_NOCHECKRESP not set, so REFUSED consumed EXPECT_EQ(ARES_ECONNREFUSED, result.status_); } TEST_P(MockTCPChannelTest, YXDomainResponse) { DNSPacket rsp; rsp.set_response().set_aa() .add_question(new DNSQuestion("www.google.com", T_A)); rsp.set_rcode(YXDOMAIN); EXPECT_CALL(server_, OnRequest("www.google.com", T_A)) .WillOnce(SetReply(&server_, &rsp)); HostResult result; ares_gethostbyname(channel_, "www.google.com.", AF_INET, HostCallback, &result); Process(); EXPECT_TRUE(result.done_); EXPECT_EQ(ARES_ENODATA, result.status_); } class MockExtraOptsTest : public MockChannelOptsTest, public ::testing::WithParamInterface< std::pair > { public: MockExtraOptsTest() : MockChannelOptsTest(1, GetParam().first, GetParam().second, FillOptions(&opts_), ARES_OPT_SOCK_SNDBUF|ARES_OPT_SOCK_RCVBUF) {} static struct ares_options* FillOptions(struct ares_options * opts) { memset(opts, 0, sizeof(struct ares_options)); // Set a few options that affect socket communications opts->socket_send_buffer_size = 514; opts->socket_receive_buffer_size = 514; return opts; } private: struct ares_options opts_; }; TEST_P(MockExtraOptsTest, SimpleQuery) { ares_set_local_ip4(channel_, 0x7F000001); byte addr6[16] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}; ares_set_local_ip6(channel_, addr6); ares_set_local_dev(channel_, "dummy"); DNSPacket rsp; rsp.set_response().set_aa() .add_question(new DNSQuestion("www.google.com", T_A)) .add_answer(new DNSARR("www.google.com", 100, {2, 3, 4, 5})); ON_CALL(server_, OnRequest("www.google.com", T_A)) .WillByDefault(SetReply(&server_, &rsp)); HostResult result; ares_gethostbyname(channel_, "www.google.com.", AF_INET, HostCallback, &result); Process(); EXPECT_TRUE(result.done_); std::stringstream ss; ss << result.host_; EXPECT_EQ("{'www.google.com' aliases=[] addrs=[2.3.4.5]}", ss.str()); } class MockFlagsChannelOptsTest : public MockChannelOptsTest, public ::testing::WithParamInterface< std::pair > { public: MockFlagsChannelOptsTest(int flags) : MockChannelOptsTest(1, GetParam().first, GetParam().second, FillOptions(&opts_, flags), ARES_OPT_FLAGS) {} static struct ares_options* FillOptions(struct ares_options * opts, int flags) { memset(opts, 0, sizeof(struct ares_options)); opts->flags = flags; return opts; } private: struct ares_options opts_; }; class MockNoCheckRespChannelTest : public MockFlagsChannelOptsTest { public: MockNoCheckRespChannelTest() : MockFlagsChannelOptsTest(ARES_FLAG_NOCHECKRESP) {} }; TEST_P(MockNoCheckRespChannelTest, ServFailResponse) { DNSPacket rsp; rsp.set_response().set_aa() .add_question(new DNSQuestion("www.google.com", T_A)); rsp.set_rcode(SERVFAIL); ON_CALL(server_, OnRequest("www.google.com", T_A)) .WillByDefault(SetReply(&server_, &rsp)); HostResult result; ares_gethostbyname(channel_, "www.google.com.", AF_INET, HostCallback, &result); Process(); EXPECT_TRUE(result.done_); EXPECT_EQ(ARES_ESERVFAIL, result.status_); } TEST_P(MockNoCheckRespChannelTest, NotImplResponse) { DNSPacket rsp; rsp.set_response().set_aa() .add_question(new DNSQuestion("www.google.com", T_A)); rsp.set_rcode(NOTIMP); ON_CALL(server_, OnRequest("www.google.com", T_A)) .WillByDefault(SetReply(&server_, &rsp)); HostResult result; ares_gethostbyname(channel_, "www.google.com.", AF_INET, HostCallback, &result); Process(); EXPECT_TRUE(result.done_); EXPECT_EQ(ARES_ENOTIMP, result.status_); } TEST_P(MockNoCheckRespChannelTest, RefusedResponse) { DNSPacket rsp; rsp.set_response().set_aa() .add_question(new DNSQuestion("www.google.com", T_A)); rsp.set_rcode(REFUSED); ON_CALL(server_, OnRequest("www.google.com", T_A)) .WillByDefault(SetReply(&server_, &rsp)); HostResult result; ares_gethostbyname(channel_, "www.google.com.", AF_INET, HostCallback, &result); Process(); EXPECT_TRUE(result.done_); EXPECT_EQ(ARES_EREFUSED, result.status_); } class MockEDNSChannelTest : public MockFlagsChannelOptsTest { public: MockEDNSChannelTest() : MockFlagsChannelOptsTest(ARES_FLAG_EDNS) {} }; TEST_P(MockEDNSChannelTest, RetryWithoutEDNS) { DNSPacket rspfail; rspfail.set_response().set_aa().set_rcode(FORMERR) .add_question(new DNSQuestion("www.google.com", T_A)); DNSPacket rspok; rspok.set_response() .add_question(new DNSQuestion("www.google.com", T_A)) .add_answer(new DNSARR("www.google.com", 100, {1, 2, 3, 4})); EXPECT_CALL(server_, OnRequest("www.google.com", T_A)) .WillOnce(SetReply(&server_, &rspfail)) .WillOnce(SetReply(&server_, &rspok)); HostResult result; ares_gethostbyname(channel_, "www.google.com.", AF_INET, HostCallback, &result); Process(); EXPECT_TRUE(result.done_); std::stringstream ss; ss << result.host_; EXPECT_EQ("{'www.google.com' aliases=[] addrs=[1.2.3.4]}", ss.str()); } TEST_P(MockChannelTest, SearchDomains) { DNSPacket nofirst; nofirst.set_response().set_aa().set_rcode(NXDOMAIN) .add_question(new DNSQuestion("www.first.com", T_A)); ON_CALL(server_, OnRequest("www.first.com", T_A)) .WillByDefault(SetReply(&server_, &nofirst)); DNSPacket nosecond; nosecond.set_response().set_aa().set_rcode(NXDOMAIN) .add_question(new DNSQuestion("www.second.org", T_A)); ON_CALL(server_, OnRequest("www.second.org", T_A)) .WillByDefault(SetReply(&server_, &nosecond)); DNSPacket yesthird; yesthird.set_response().set_aa() .add_question(new DNSQuestion("www.third.gov", T_A)) .add_answer(new DNSARR("www.third.gov", 0x0200, {2, 3, 4, 5})); ON_CALL(server_, OnRequest("www.third.gov", T_A)) .WillByDefault(SetReply(&server_, &yesthird)); HostResult result; ares_gethostbyname(channel_, "www", AF_INET, HostCallback, &result); Process(); EXPECT_TRUE(result.done_); std::stringstream ss; ss << result.host_; EXPECT_EQ("{'www.third.gov' aliases=[] addrs=[2.3.4.5]}", ss.str()); } // Relies on retries so is UDP-only TEST_P(MockUDPChannelTest, SearchDomainsWithResentReply) { DNSPacket nofirst; nofirst.set_response().set_aa().set_rcode(NXDOMAIN) .add_question(new DNSQuestion("www.first.com", T_A)); EXPECT_CALL(server_, OnRequest("www.first.com", T_A)) .WillOnce(SetReply(&server_, &nofirst)); DNSPacket nosecond; nosecond.set_response().set_aa().set_rcode(NXDOMAIN) .add_question(new DNSQuestion("www.second.org", T_A)); EXPECT_CALL(server_, OnRequest("www.second.org", T_A)) .WillOnce(SetReply(&server_, &nosecond)); DNSPacket yesthird; yesthird.set_response().set_aa() .add_question(new DNSQuestion("www.third.gov", T_A)) .add_answer(new DNSARR("www.third.gov", 0x0200, {2, 3, 4, 5})); // Before sending the real answer, resend an earlier reply EXPECT_CALL(server_, OnRequest("www.third.gov", T_A)) .WillOnce(DoAll(SetReply(&server_, &nofirst), SetReplyQID(&server_, 123))) .WillOnce(DoAll(SetReply(&server_, &yesthird), SetReplyQID(&server_, -1))); HostResult result; ares_gethostbyname(channel_, "www", AF_INET, HostCallback, &result); Process(); EXPECT_TRUE(result.done_); std::stringstream ss; ss << result.host_; EXPECT_EQ("{'www.third.gov' aliases=[] addrs=[2.3.4.5]}", ss.str()); } TEST_P(MockChannelTest, SearchDomainsBare) { DNSPacket nofirst; nofirst.set_response().set_aa().set_rcode(NXDOMAIN) .add_question(new DNSQuestion("www.first.com", T_A)); ON_CALL(server_, OnRequest("www.first.com", T_A)) .WillByDefault(SetReply(&server_, &nofirst)); DNSPacket nosecond; nosecond.set_response().set_aa().set_rcode(NXDOMAIN) .add_question(new DNSQuestion("www.second.org", T_A)); ON_CALL(server_, OnRequest("www.second.org", T_A)) .WillByDefault(SetReply(&server_, &nosecond)); DNSPacket nothird; nothird.set_response().set_aa().set_rcode(NXDOMAIN) .add_question(new DNSQuestion("www.third.gov", T_A)); ON_CALL(server_, OnRequest("www.third.gov", T_A)) .WillByDefault(SetReply(&server_, ¬hird)); DNSPacket yesbare; yesbare.set_response().set_aa() .add_question(new DNSQuestion("www", T_A)) .add_answer(new DNSARR("www", 0x0200, {2, 3, 4, 5})); ON_CALL(server_, OnRequest("www", T_A)) .WillByDefault(SetReply(&server_, &yesbare)); HostResult result; ares_gethostbyname(channel_, "www", AF_INET, HostCallback, &result); Process(); EXPECT_TRUE(result.done_); std::stringstream ss; ss << result.host_; EXPECT_EQ("{'www' aliases=[] addrs=[2.3.4.5]}", ss.str()); } TEST_P(MockChannelTest, SearchNoDataThenSuccess) { // First two search domains recognize the name but have no A records. DNSPacket nofirst; nofirst.set_response().set_aa() .add_question(new DNSQuestion("www.first.com", T_A)); ON_CALL(server_, OnRequest("www.first.com", T_A)) .WillByDefault(SetReply(&server_, &nofirst)); DNSPacket nosecond; nosecond.set_response().set_aa() .add_question(new DNSQuestion("www.second.org", T_A)); ON_CALL(server_, OnRequest("www.second.org", T_A)) .WillByDefault(SetReply(&server_, &nosecond)); DNSPacket yesthird; yesthird.set_response().set_aa() .add_question(new DNSQuestion("www.third.gov", T_A)) .add_answer(new DNSARR("www.third.gov", 0x0200, {2, 3, 4, 5})); ON_CALL(server_, OnRequest("www.third.gov", T_A)) .WillByDefault(SetReply(&server_, &yesthird)); HostResult result; ares_gethostbyname(channel_, "www", AF_INET, HostCallback, &result); Process(); EXPECT_TRUE(result.done_); std::stringstream ss; ss << result.host_; EXPECT_EQ("{'www.third.gov' aliases=[] addrs=[2.3.4.5]}", ss.str()); } TEST_P(MockChannelTest, SearchNoDataThenNoDataBare) { // First two search domains recognize the name but have no A records. DNSPacket nofirst; nofirst.set_response().set_aa() .add_question(new DNSQuestion("www.first.com", T_A)); ON_CALL(server_, OnRequest("www.first.com", T_A)) .WillByDefault(SetReply(&server_, &nofirst)); DNSPacket nosecond; nosecond.set_response().set_aa() .add_question(new DNSQuestion("www.second.org", T_A)); ON_CALL(server_, OnRequest("www.second.org", T_A)) .WillByDefault(SetReply(&server_, &nosecond)); DNSPacket nothird; nothird.set_response().set_aa() .add_question(new DNSQuestion("www.third.gov", T_A)); ON_CALL(server_, OnRequest("www.third.gov", T_A)) .WillByDefault(SetReply(&server_, ¬hird)); DNSPacket nobare; nobare.set_response().set_aa() .add_question(new DNSQuestion("www", T_A)); ON_CALL(server_, OnRequest("www", T_A)) .WillByDefault(SetReply(&server_, &nobare)); HostResult result; ares_gethostbyname(channel_, "www", AF_INET, HostCallback, &result); Process(); EXPECT_TRUE(result.done_); EXPECT_EQ(ARES_ENODATA, result.status_); } TEST_P(MockChannelTest, SearchNoDataThenFail) { // First two search domains recognize the name but have no A records. DNSPacket nofirst; nofirst.set_response().set_aa() .add_question(new DNSQuestion("www.first.com", T_A)); ON_CALL(server_, OnRequest("www.first.com", T_A)) .WillByDefault(SetReply(&server_, &nofirst)); DNSPacket nosecond; nosecond.set_response().set_aa() .add_question(new DNSQuestion("www.second.org", T_A)); ON_CALL(server_, OnRequest("www.second.org", T_A)) .WillByDefault(SetReply(&server_, &nosecond)); DNSPacket nothird; nothird.set_response().set_aa() .add_question(new DNSQuestion("www.third.gov", T_A)); ON_CALL(server_, OnRequest("www.third.gov", T_A)) .WillByDefault(SetReply(&server_, ¬hird)); DNSPacket nobare; nobare.set_response().set_aa().set_rcode(NXDOMAIN) .add_question(new DNSQuestion("www", T_A)); ON_CALL(server_, OnRequest("www", T_A)) .WillByDefault(SetReply(&server_, &nobare)); HostResult result; ares_gethostbyname(channel_, "www", AF_INET, HostCallback, &result); Process(); EXPECT_TRUE(result.done_); EXPECT_EQ(ARES_ENODATA, result.status_); } TEST_P(MockChannelTest, SearchAllocFailure) { SearchResult result; SetAllocFail(1); ares_search(channel_, "fully.qualified.", C_IN, T_A, SearchCallback, &result); /* Already done */ EXPECT_TRUE(result.done_); EXPECT_EQ(ARES_ENOMEM, result.status_); } TEST_P(MockChannelTest, SearchHighNdots) { DNSPacket nobare; nobare.set_response().set_aa().set_rcode(NXDOMAIN) .add_question(new DNSQuestion("a.b.c.w.w.w", T_A)); ON_CALL(server_, OnRequest("a.b.c.w.w.w", T_A)) .WillByDefault(SetReply(&server_, &nobare)); DNSPacket yesfirst; yesfirst.set_response().set_aa() .add_question(new DNSQuestion("a.b.c.w.w.w.first.com", T_A)) .add_answer(new DNSARR("a.b.c.w.w.w.first.com", 0x0200, {2, 3, 4, 5})); ON_CALL(server_, OnRequest("a.b.c.w.w.w.first.com", T_A)) .WillByDefault(SetReply(&server_, &yesfirst)); SearchResult result; ares_search(channel_, "a.b.c.w.w.w", C_IN, T_A, SearchCallback, &result); Process(); EXPECT_TRUE(result.done_); EXPECT_EQ(ARES_SUCCESS, result.status_); std::stringstream ss; ss << PacketToString(result.data_); EXPECT_EQ("RSP QRY AA NOERROR Q:{'a.b.c.w.w.w.first.com' IN A} " "A:{'a.b.c.w.w.w.first.com' IN A TTL=512 2.3.4.5}", ss.str()); } TEST_P(MockChannelTest, UnspecifiedFamilyV6) { DNSPacket rsp6; rsp6.set_response().set_aa() .add_question(new DNSQuestion("example.com", T_AAAA)) .add_answer(new DNSAaaaRR("example.com", 100, {0x21, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03})); ON_CALL(server_, OnRequest("example.com", T_AAAA)) .WillByDefault(SetReply(&server_, &rsp6)); DNSPacket rsp4; rsp4.set_response().set_aa() .add_question(new DNSQuestion("example.com", T_A)); ON_CALL(server_, OnRequest("example.com", T_A)) .WillByDefault(SetReply(&server_, &rsp4)); HostResult result; ares_gethostbyname(channel_, "example.com.", AF_UNSPEC, HostCallback, &result); Process(); EXPECT_TRUE(result.done_); std::stringstream ss; ss << result.host_; // Default to IPv6 when both are available. EXPECT_EQ("{'example.com' aliases=[] addrs=[2121:0000:0000:0000:0000:0000:0000:0303]}", ss.str()); } TEST_P(MockChannelTest, UnspecifiedFamilyV4) { DNSPacket rsp6; rsp6.set_response().set_aa() .add_question(new DNSQuestion("example.com", T_AAAA)); ON_CALL(server_, OnRequest("example.com", T_AAAA)) .WillByDefault(SetReply(&server_, &rsp6)); DNSPacket rsp4; rsp4.set_response().set_aa() .add_question(new DNSQuestion("example.com", T_A)) .add_answer(new DNSARR("example.com", 100, {2, 3, 4, 5})); ON_CALL(server_, OnRequest("example.com", T_A)) .WillByDefault(SetReply(&server_, &rsp4)); HostResult result; ares_gethostbyname(channel_, "example.com.", AF_UNSPEC, HostCallback, &result); Process(); EXPECT_TRUE(result.done_); std::stringstream ss; ss << result.host_; EXPECT_EQ("{'example.com' aliases=[] addrs=[2.3.4.5]}", ss.str()); } TEST_P(MockChannelTest, UnspecifiedFamilyNoData) { DNSPacket rsp6; rsp6.set_response().set_aa() .add_question(new DNSQuestion("example.com", T_AAAA)) .add_answer(new DNSCnameRR("example.com", 100, "elsewhere.com")); ON_CALL(server_, OnRequest("example.com", T_AAAA)) .WillByDefault(SetReply(&server_, &rsp6)); DNSPacket rsp4; rsp4.set_response().set_aa() .add_question(new DNSQuestion("example.com", T_A)); ON_CALL(server_, OnRequest("example.com", T_A)) .WillByDefault(SetReply(&server_, &rsp4)); HostResult result; ares_gethostbyname(channel_, "example.com.", AF_UNSPEC, HostCallback, &result); Process(); EXPECT_TRUE(result.done_); std::stringstream ss; ss << result.host_; EXPECT_EQ("{'' aliases=[] addrs=[]}", ss.str()); } TEST_P(MockChannelTest, UnspecifiedFamilyCname6A4) { DNSPacket rsp6; rsp6.set_response().set_aa() .add_question(new DNSQuestion("example.com", T_AAAA)) .add_answer(new DNSCnameRR("example.com", 100, "elsewhere.com")); ON_CALL(server_, OnRequest("example.com", T_AAAA)) .WillByDefault(SetReply(&server_, &rsp6)); DNSPacket rsp4; rsp4.set_response().set_aa() .add_question(new DNSQuestion("example.com", T_A)) .add_answer(new DNSARR("example.com", 100, {1, 2, 3, 4})); ON_CALL(server_, OnRequest("example.com", T_A)) .WillByDefault(SetReply(&server_, &rsp4)); HostResult result; ares_gethostbyname(channel_, "example.com.", AF_UNSPEC, HostCallback, &result); Process(); EXPECT_TRUE(result.done_); std::stringstream ss; ss << result.host_; EXPECT_EQ("{'example.com' aliases=[] addrs=[1.2.3.4]}", ss.str()); } TEST_P(MockChannelTest, ExplicitIP) { HostResult result; ares_gethostbyname(channel_, "1.2.3.4", AF_INET, HostCallback, &result); EXPECT_TRUE(result.done_); // Immediate return EXPECT_EQ(ARES_SUCCESS, result.status_); std::stringstream ss; ss << result.host_; EXPECT_EQ("{'1.2.3.4' aliases=[] addrs=[1.2.3.4]}", ss.str()); } TEST_P(MockChannelTest, ExplicitIPAllocFail) { HostResult result; SetAllocSizeFail(strlen("1.2.3.4") + 1); ares_gethostbyname(channel_, "1.2.3.4", AF_INET, HostCallback, &result); EXPECT_TRUE(result.done_); // Immediate return EXPECT_EQ(ARES_ENOMEM, result.status_); } TEST_P(MockChannelTest, SortListV4) { DNSPacket rsp; rsp.set_response().set_aa() .add_question(new DNSQuestion("example.com", T_A)) .add_answer(new DNSARR("example.com", 100, {22, 23, 24, 25})) .add_answer(new DNSARR("example.com", 100, {12, 13, 14, 15})) .add_answer(new DNSARR("example.com", 100, {2, 3, 4, 5})); ON_CALL(server_, OnRequest("example.com", T_A)) .WillByDefault(SetReply(&server_, &rsp)); { EXPECT_EQ(ARES_SUCCESS, ares_set_sortlist(channel_, "12.13.0.0/255.255.0.0 1234::5678")); HostResult result; ares_gethostbyname(channel_, "example.com.", AF_INET, HostCallback, &result); Process(); EXPECT_TRUE(result.done_); std::stringstream ss; ss << result.host_; EXPECT_EQ("{'example.com' aliases=[] addrs=[12.13.14.15, 22.23.24.25, 2.3.4.5]}", ss.str()); } { EXPECT_EQ(ARES_SUCCESS, ares_set_sortlist(channel_, "2.3.0.0/16 130.140.150.160/26")); HostResult result; ares_gethostbyname(channel_, "example.com.", AF_INET, HostCallback, &result); Process(); EXPECT_TRUE(result.done_); std::stringstream ss; ss << result.host_; EXPECT_EQ("{'example.com' aliases=[] addrs=[2.3.4.5, 22.23.24.25, 12.13.14.15]}", ss.str()); } struct ares_options options; memset(&options, 0, sizeof(options)); int optmask = 0; EXPECT_EQ(ARES_SUCCESS, ares_save_options(channel_, &options, &optmask)); EXPECT_TRUE((optmask & ARES_OPT_SORTLIST) == ARES_OPT_SORTLIST); ares_destroy_options(&options); } TEST_P(MockChannelTest, SortListV6) { DNSPacket rsp; rsp.set_response().set_aa() .add_question(new DNSQuestion("example.com", T_AAAA)) .add_answer(new DNSAaaaRR("example.com", 100, {0x11, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02})) .add_answer(new DNSAaaaRR("example.com", 100, {0x21, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03})); ON_CALL(server_, OnRequest("example.com", T_AAAA)) .WillByDefault(SetReply(&server_, &rsp)); { ares_set_sortlist(channel_, "1111::/16 2.3.0.0/255.255.0.0"); HostResult result; ares_gethostbyname(channel_, "example.com.", AF_INET6, HostCallback, &result); Process(); EXPECT_TRUE(result.done_); std::stringstream ss; ss << result.host_; EXPECT_EQ("{'example.com' aliases=[] addrs=[1111:0000:0000:0000:0000:0000:0000:0202, " "2121:0000:0000:0000:0000:0000:0000:0303]}", ss.str()); } { ares_set_sortlist(channel_, "2121::/8"); HostResult result; ares_gethostbyname(channel_, "example.com.", AF_INET6, HostCallback, &result); Process(); EXPECT_TRUE(result.done_); std::stringstream ss; ss << result.host_; EXPECT_EQ("{'example.com' aliases=[] addrs=[2121:0000:0000:0000:0000:0000:0000:0303, " "1111:0000:0000:0000:0000:0000:0000:0202]}", ss.str()); } } // Relies on retries so is UDP-only TEST_P(MockUDPChannelTest, SearchDomainsAllocFail) { DNSPacket nofirst; nofirst.set_response().set_aa().set_rcode(NXDOMAIN) .add_question(new DNSQuestion("www.first.com", T_A)); ON_CALL(server_, OnRequest("www.first.com", T_A)) .WillByDefault(SetReply(&server_, &nofirst)); DNSPacket nosecond; nosecond.set_response().set_aa().set_rcode(NXDOMAIN) .add_question(new DNSQuestion("www.second.org", T_A)); ON_CALL(server_, OnRequest("www.second.org", T_A)) .WillByDefault(SetReply(&server_, &nosecond)); DNSPacket yesthird; yesthird.set_response().set_aa() .add_question(new DNSQuestion("www.third.gov", T_A)) .add_answer(new DNSARR("www.third.gov", 0x0200, {2, 3, 4, 5})); ON_CALL(server_, OnRequest("www.third.gov", T_A)) .WillByDefault(SetReply(&server_, &yesthird)); // Fail a variety of different memory allocations, and confirm // that the operation either fails with ENOMEM or succeeds // with the expected result. const int kCount = 34; HostResult results[kCount]; for (int ii = 1; ii <= kCount; ii++) { HostResult* result = &(results[ii - 1]); ClearFails(); SetAllocFail(ii); ares_gethostbyname(channel_, "www", AF_INET, HostCallback, result); Process(); EXPECT_TRUE(result->done_); if (result->status_ == ARES_SUCCESS) { std::stringstream ss; ss << result->host_; EXPECT_EQ("{'www.third.gov' aliases=[] addrs=[2.3.4.5]}", ss.str()) << " failed alloc #" << ii; if (verbose) std::cerr << "Succeeded despite failure of alloc #" << ii << std::endl; } } // Explicitly destroy the channel now, so that the HostResult objects // are still valid (in case any pending work refers to them). ares_destroy(channel_); channel_ = nullptr; } // Relies on retries so is UDP-only TEST_P(MockUDPChannelTest, Resend) { std::vector nothing; DNSPacket reply; reply.set_response().set_aa() .add_question(new DNSQuestion("www.google.com", T_A)) .add_answer(new DNSARR("www.google.com", 0x0100, {0x01, 0x02, 0x03, 0x04})); EXPECT_CALL(server_, OnRequest("www.google.com", T_A)) .WillOnce(SetReplyData(&server_, nothing)) .WillOnce(SetReplyData(&server_, nothing)) .WillOnce(SetReply(&server_, &reply)); HostResult result; ares_gethostbyname(channel_, "www.google.com.", AF_INET, HostCallback, &result); Process(); EXPECT_TRUE(result.done_); EXPECT_EQ(2, result.timeouts_); std::stringstream ss; ss << result.host_; EXPECT_EQ("{'www.google.com' aliases=[] addrs=[1.2.3.4]}", ss.str()); } TEST_P(MockChannelTest, CancelImmediate) { HostResult result; ares_gethostbyname(channel_, "www.google.com.", AF_INET, HostCallback, &result); ares_cancel(channel_); EXPECT_TRUE(result.done_); EXPECT_EQ(ARES_ECANCELLED, result.status_); EXPECT_EQ(0, result.timeouts_); } TEST_P(MockChannelTest, CancelImmediateGetHostByAddr) { HostResult result; struct in_addr addr; addr.s_addr = htonl(0x08080808); ares_gethostbyaddr(channel_, &addr, sizeof(addr), AF_INET, HostCallback, &result); ares_cancel(channel_); EXPECT_TRUE(result.done_); EXPECT_EQ(ARES_ECANCELLED, result.status_); EXPECT_EQ(0, result.timeouts_); } // Relies on retries so is UDP-only TEST_P(MockUDPChannelTest, CancelLater) { std::vector nothing; // On second request, cancel the channel. EXPECT_CALL(server_, OnRequest("www.google.com", T_A)) .WillOnce(SetReplyData(&server_, nothing)) .WillOnce(CancelChannel(&server_, channel_)); HostResult result; ares_gethostbyname(channel_, "www.google.com.", AF_INET, HostCallback, &result); Process(); EXPECT_TRUE(result.done_); EXPECT_EQ(ARES_ECANCELLED, result.status_); EXPECT_EQ(0, result.timeouts_); } TEST_P(MockChannelTest, GetHostByNameDestroyAbsolute) { HostResult result; ares_gethostbyname(channel_, "www.google.com.", AF_INET, HostCallback, &result); ares_destroy(channel_); channel_ = nullptr; EXPECT_TRUE(result.done_); // Synchronous EXPECT_EQ(ARES_EDESTRUCTION, result.status_); EXPECT_EQ(0, result.timeouts_); } TEST_P(MockChannelTest, GetHostByNameDestroyRelative) { HostResult result; ares_gethostbyname(channel_, "www", AF_INET, HostCallback, &result); ares_destroy(channel_); channel_ = nullptr; EXPECT_TRUE(result.done_); // Synchronous EXPECT_EQ(ARES_EDESTRUCTION, result.status_); EXPECT_EQ(0, result.timeouts_); } TEST_P(MockChannelTest, GetHostByNameCNAMENoData) { DNSPacket response; response.set_response().set_aa() .add_question(new DNSQuestion("cname.first.com", T_A)) .add_answer(new DNSCnameRR("cname.first.com", 100, "a.first.com")); ON_CALL(server_, OnRequest("cname.first.com", T_A)) .WillByDefault(SetReply(&server_, &response)); HostResult result; ares_gethostbyname(channel_, "cname.first.com.", AF_INET, HostCallback, &result); Process(); EXPECT_TRUE(result.done_); EXPECT_EQ(ARES_ENODATA, result.status_); } TEST_P(MockChannelTest, GetHostByAddrDestroy) { unsigned char gdns_addr4[4] = {0x08, 0x08, 0x08, 0x08}; HostResult result; ares_gethostbyaddr(channel_, gdns_addr4, sizeof(gdns_addr4), AF_INET, HostCallback, &result); ares_destroy(channel_); channel_ = nullptr; EXPECT_TRUE(result.done_); // Synchronous EXPECT_EQ(ARES_EDESTRUCTION, result.status_); EXPECT_EQ(0, result.timeouts_); } #ifndef WIN32 TEST_P(MockChannelTest, HostAlias) { DNSPacket reply; reply.set_response().set_aa() .add_question(new DNSQuestion("www.google.com", T_A)) .add_answer(new DNSARR("www.google.com", 0x0100, {0x01, 0x02, 0x03, 0x04})); ON_CALL(server_, OnRequest("www.google.com", T_A)) .WillByDefault(SetReply(&server_, &reply)); TempFile aliases("\n\n# www commentedout\nwww www.google.com\n"); EnvValue with_env("HOSTALIASES", aliases.filename()); HostResult result; ares_gethostbyname(channel_, "www", AF_INET, HostCallback, &result); Process(); EXPECT_TRUE(result.done_); std::stringstream ss; ss << result.host_; EXPECT_EQ("{'www.google.com' aliases=[] addrs=[1.2.3.4]}", ss.str()); } TEST_P(MockChannelTest, HostAliasMissing) { DNSPacket yesfirst; yesfirst.set_response().set_aa() .add_question(new DNSQuestion("www.first.com", T_A)) .add_answer(new DNSARR("www.first.com", 0x0200, {2, 3, 4, 5})); ON_CALL(server_, OnRequest("www.first.com", T_A)) .WillByDefault(SetReply(&server_, &yesfirst)); TempFile aliases("\n\n# www commentedout\nww www.google.com\n"); EnvValue with_env("HOSTALIASES", aliases.filename()); HostResult result; ares_gethostbyname(channel_, "www", AF_INET, HostCallback, &result); Process(); EXPECT_TRUE(result.done_); std::stringstream ss; ss << result.host_; EXPECT_EQ("{'www.first.com' aliases=[] addrs=[2.3.4.5]}", ss.str()); } TEST_P(MockChannelTest, HostAliasMissingFile) { DNSPacket yesfirst; yesfirst.set_response().set_aa() .add_question(new DNSQuestion("www.first.com", T_A)) .add_answer(new DNSARR("www.first.com", 0x0200, {2, 3, 4, 5})); ON_CALL(server_, OnRequest("www.first.com", T_A)) .WillByDefault(SetReply(&server_, &yesfirst)); EnvValue with_env("HOSTALIASES", "bogus.mcfile"); HostResult result; ares_gethostbyname(channel_, "www", AF_INET, HostCallback, &result); Process(); EXPECT_TRUE(result.done_); std::stringstream ss; ss << result.host_; EXPECT_EQ("{'www.first.com' aliases=[] addrs=[2.3.4.5]}", ss.str()); } TEST_P(MockChannelTest, HostAliasUnreadable) { TempFile aliases("www www.google.com\n"); EXPECT_EQ(chmod(aliases.filename(), 0), 0); /* Perform OS sanity checks. We are observing on Debian after the chmod(fn, 0) * that we are still able to fopen() the file which is unexpected. Skip the * test if we observe this behavior */ struct stat st; EXPECT_EQ(stat(aliases.filename(), &st), 0); EXPECT_EQ(st.st_mode & (S_IRWXU|S_IRWXG|S_IRWXO), 0); FILE *fp = fopen(aliases.filename(), "r"); if (fp != NULL) { if (verbose) std::cerr << "Skipping Test due to OS incompatibility (open file caching)" << std::endl; fclose(fp); return; } EnvValue with_env("HOSTALIASES", aliases.filename()); HostResult result; ares_gethostbyname(channel_, "www", AF_INET, HostCallback, &result); Process(); EXPECT_TRUE(result.done_); EXPECT_EQ(ARES_EFILE, result.status_); chmod(aliases.filename(), 0777); } #endif class MockMultiServerChannelTest : public MockChannelOptsTest, public ::testing::WithParamInterface< std::pair > { public: MockMultiServerChannelTest(bool rotate) : MockChannelOptsTest(3, GetParam().first, GetParam().second, nullptr, rotate ? ARES_OPT_ROTATE : ARES_OPT_NOROTATE) {} void CheckExample() { HostResult result; ares_gethostbyname(channel_, "www.example.com.", AF_INET, HostCallback, &result); Process(); EXPECT_TRUE(result.done_); std::stringstream ss; ss << result.host_; EXPECT_EQ("{'www.example.com' aliases=[] addrs=[2.3.4.5]}", ss.str()); } }; class RotateMultiMockTest : public MockMultiServerChannelTest { public: RotateMultiMockTest() : MockMultiServerChannelTest(true) {} }; class NoRotateMultiMockTest : public MockMultiServerChannelTest { public: NoRotateMultiMockTest() : MockMultiServerChannelTest(false) {} }; TEST_P(RotateMultiMockTest, ThirdServer) { struct ares_options opts = {0}; int optmask = 0; EXPECT_EQ(ARES_SUCCESS, ares_save_options(channel_, &opts, &optmask)); EXPECT_EQ(0, (optmask & ARES_OPT_NOROTATE)); ares_destroy_options(&opts); DNSPacket servfailrsp; servfailrsp.set_response().set_aa().set_rcode(SERVFAIL) .add_question(new DNSQuestion("www.example.com", T_A)); DNSPacket notimplrsp; notimplrsp.set_response().set_aa().set_rcode(NOTIMP) .add_question(new DNSQuestion("www.example.com", T_A)); DNSPacket okrsp; okrsp.set_response().set_aa() .add_question(new DNSQuestion("www.example.com", T_A)) .add_answer(new DNSARR("www.example.com", 100, {2,3,4,5})); EXPECT_CALL(*servers_[0], OnRequest("www.example.com", T_A)) .WillOnce(SetReply(servers_[0].get(), &servfailrsp)); EXPECT_CALL(*servers_[1], OnRequest("www.example.com", T_A)) .WillOnce(SetReply(servers_[1].get(), ¬implrsp)); EXPECT_CALL(*servers_[2], OnRequest("www.example.com", T_A)) .WillOnce(SetReply(servers_[2].get(), &okrsp)); CheckExample(); // Second time around, starts from server [1]. EXPECT_CALL(*servers_[1], OnRequest("www.example.com", T_A)) .WillOnce(SetReply(servers_[1].get(), &servfailrsp)); EXPECT_CALL(*servers_[2], OnRequest("www.example.com", T_A)) .WillOnce(SetReply(servers_[2].get(), ¬implrsp)); EXPECT_CALL(*servers_[0], OnRequest("www.example.com", T_A)) .WillOnce(SetReply(servers_[0].get(), &okrsp)); CheckExample(); // Third time around, starts from server [2]. EXPECT_CALL(*servers_[2], OnRequest("www.example.com", T_A)) .WillOnce(SetReply(servers_[2].get(), &servfailrsp)); EXPECT_CALL(*servers_[0], OnRequest("www.example.com", T_A)) .WillOnce(SetReply(servers_[0].get(), ¬implrsp)); EXPECT_CALL(*servers_[1], OnRequest("www.example.com", T_A)) .WillOnce(SetReply(servers_[1].get(), &okrsp)); CheckExample(); } TEST_P(NoRotateMultiMockTest, ThirdServer) { struct ares_options opts = {0}; int optmask = 0; EXPECT_EQ(ARES_SUCCESS, ares_save_options(channel_, &opts, &optmask)); EXPECT_EQ(ARES_OPT_NOROTATE, (optmask & ARES_OPT_NOROTATE)); ares_destroy_options(&opts); DNSPacket servfailrsp; servfailrsp.set_response().set_aa().set_rcode(SERVFAIL) .add_question(new DNSQuestion("www.example.com", T_A)); DNSPacket notimplrsp; notimplrsp.set_response().set_aa().set_rcode(NOTIMP) .add_question(new DNSQuestion("www.example.com", T_A)); DNSPacket okrsp; okrsp.set_response().set_aa() .add_question(new DNSQuestion("www.example.com", T_A)) .add_answer(new DNSARR("www.example.com", 100, {2,3,4,5})); EXPECT_CALL(*servers_[0], OnRequest("www.example.com", T_A)) .WillOnce(SetReply(servers_[0].get(), &servfailrsp)); EXPECT_CALL(*servers_[1], OnRequest("www.example.com", T_A)) .WillOnce(SetReply(servers_[1].get(), ¬implrsp)); EXPECT_CALL(*servers_[2], OnRequest("www.example.com", T_A)) .WillOnce(SetReply(servers_[2].get(), &okrsp)); CheckExample(); // Second time around, still starts from server [0]. EXPECT_CALL(*servers_[0], OnRequest("www.example.com", T_A)) .WillOnce(SetReply(servers_[0].get(), &servfailrsp)); EXPECT_CALL(*servers_[1], OnRequest("www.example.com", T_A)) .WillOnce(SetReply(servers_[1].get(), ¬implrsp)); EXPECT_CALL(*servers_[2], OnRequest("www.example.com", T_A)) .WillOnce(SetReply(servers_[2].get(), &okrsp)); CheckExample(); // Third time around, still starts from server [0]. EXPECT_CALL(*servers_[0], OnRequest("www.example.com", T_A)) .WillOnce(SetReply(servers_[0].get(), &servfailrsp)); EXPECT_CALL(*servers_[1], OnRequest("www.example.com", T_A)) .WillOnce(SetReply(servers_[1].get(), ¬implrsp)); EXPECT_CALL(*servers_[2], OnRequest("www.example.com", T_A)) .WillOnce(SetReply(servers_[2].get(), &okrsp)); CheckExample(); } INSTANTIATE_TEST_SUITE_P(AddressFamilies, MockChannelTest, ::testing::ValuesIn(ares::test::families_modes)); INSTANTIATE_TEST_SUITE_P(AddressFamilies, MockUDPChannelTest, ::testing::ValuesIn(ares::test::families)); INSTANTIATE_TEST_SUITE_P(AddressFamilies, MockTCPChannelTest, ::testing::ValuesIn(ares::test::families)); INSTANTIATE_TEST_SUITE_P(AddressFamilies, MockExtraOptsTest, ::testing::ValuesIn(ares::test::families_modes)); INSTANTIATE_TEST_SUITE_P(AddressFamilies, MockNoCheckRespChannelTest, ::testing::ValuesIn(ares::test::families_modes)); INSTANTIATE_TEST_SUITE_P(AddressFamilies, MockEDNSChannelTest, ::testing::ValuesIn(ares::test::families_modes)); INSTANTIATE_TEST_SUITE_P(TransportModes, RotateMultiMockTest, ::testing::ValuesIn(ares::test::families_modes)); INSTANTIATE_TEST_SUITE_P(TransportModes, NoRotateMultiMockTest, ::testing::ValuesIn(ares::test::families_modes)); } // namespace test } // namespace ares ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/ares-test-ns.cc0000644000175100001770000001362100000000000021716 0ustar00runnerdocker00000000000000#include "ares-test.h" #ifdef HAVE_CONTAINER #include #include #include #include #include #include #include #include #include namespace ares { namespace test { namespace { struct ContainerInfo { ContainerFilesystem* fs_; std::string hostname_; std::string domainname_; VoidToIntFn fn_; }; int EnterContainer(void *data) { ContainerInfo *container = (ContainerInfo*)data; if (verbose) { std::cerr << "Running function in container {chroot='" << container->fs_->root() << "', hostname='" << container->hostname_ << "', domainname='" << container->domainname_ << "'}" << std::endl; } // Ensure we are apparently root before continuing. int count = 10; while (getuid() != 0 && count > 0) { usleep(100000); count--; } if (getuid() != 0) { std::cerr << "Child in user namespace has uid " << getuid() << std::endl; return -1; } if (!container->fs_->mountpt().empty()) { // We want to bind mount this inside the specified directory. std::string innerdir = container->fs_->root() + container->fs_->mountpt(); if (verbose) std::cerr << " mount --bind " << container->fs_->mountpt() << " " << innerdir << std::endl; int rc = mount(container->fs_->mountpt().c_str(), innerdir.c_str(), "none", MS_BIND, 0); if (rc != 0) { std::cerr << "Warning: failed to bind mount " << container->fs_->mountpt() << " at " << innerdir << ", errno=" << errno << std::endl; } } // Move into the specified directory. if (chdir(container->fs_->root().c_str()) != 0) { std::cerr << "Failed to chdir('" << container->fs_->root() << "'), errno=" << errno << std::endl; return -1; } // And make it the new root directory; char buffer[PATH_MAX + 1]; if (getcwd(buffer, PATH_MAX) == NULL) { std::cerr << "failed to retrieve cwd, errno=" << errno << std::endl; return -1; } buffer[PATH_MAX] = '\0'; if (chroot(buffer) != 0) { std::cerr << "chroot('" << buffer << "') failed, errno=" << errno << std::endl; return -1; } // Set host/domainnames if specified if (!container->hostname_.empty()) { if (sethostname(container->hostname_.c_str(), container->hostname_.size()) != 0) { std::cerr << "Failed to sethostname('" << container->hostname_ << "'), errno=" << errno << std::endl; return -1; } } if (!container->domainname_.empty()) { if (setdomainname(container->domainname_.c_str(), container->domainname_.size()) != 0) { std::cerr << "Failed to setdomainname('" << container->domainname_ << "'), errno=" << errno << std::endl; return -1; } } return container->fn_(); } } // namespace // Run a function while: // - chroot()ed into a particular directory // - having a specified hostname/domainname int RunInContainer(ContainerFilesystem* fs, const std::string& hostname, const std::string& domainname, VoidToIntFn fn) { const int stack_size = 1024 * 1024; std::vector stack(stack_size, 0); ContainerInfo container = {fs, hostname, domainname, fn}; // Start a child process in a new user and UTS namespace pid_t child = clone(EnterContainer, stack.data() + stack_size, CLONE_VM|CLONE_NEWNS|CLONE_NEWUSER|CLONE_NEWUTS|SIGCHLD, (void *)&container); if (child < 0) { std::cerr << "Failed to clone(), errno=" << errno << std::endl; return -1; } // Build the UID map that makes us look like root inside the namespace. std::stringstream mapfiless; mapfiless << "/proc/" << child << "/uid_map"; std::string mapfile = mapfiless.str(); int fd = open(mapfile.c_str(), O_CREAT|O_WRONLY|O_TRUNC, 0644); if (fd < 0) { std::cerr << "Failed to create '" << mapfile << "'" << std::endl; return -1; } std::stringstream contentss; contentss << "0 " << getuid() << " 1" << std::endl; std::string content = contentss.str(); int rc = write(fd, content.c_str(), content.size()); if (rc != (int)content.size()) { std::cerr << "Failed to write uid map to '" << mapfile << "'" << std::endl; } close(fd); // Wait for the child process and retrieve its status. int status; waitpid(child, &status, 0); if (rc <= 0) { std::cerr << "Failed to waitpid(" << child << ")" << std::endl; return -1; } if (!WIFEXITED(status)) { std::cerr << "Child " << child << " did not exit normally" << std::endl; return -1; } return status; } ContainerFilesystem::ContainerFilesystem(NameContentList files, const std::string& mountpt) { rootdir_ = TempNam(nullptr, "ares-chroot"); mkdir(rootdir_.c_str(), 0755); dirs_.push_front(rootdir_); for (const auto& nc : files) { std::string fullpath = rootdir_ + nc.first; int idx = fullpath.rfind('/'); std::string dir = fullpath.substr(0, idx); EnsureDirExists(dir); files_.push_back(std::unique_ptr( new TransientFile(fullpath, nc.second))); } if (!mountpt.empty()) { char buffer[PATH_MAX + 1]; if (realpath(mountpt.c_str(), buffer)) { mountpt_ = buffer; std::string fullpath = rootdir_ + mountpt_; EnsureDirExists(fullpath); } } } ContainerFilesystem::~ContainerFilesystem() { files_.clear(); for (const std::string& dir : dirs_) { rmdir(dir.c_str()); } } void ContainerFilesystem::EnsureDirExists(const std::string& dir) { if (std::find(dirs_.begin(), dirs_.end(), dir) != dirs_.end()) { return; } size_t idx = dir.rfind('/'); if (idx != std::string::npos) { std::string prevdir = dir.substr(0, idx); EnsureDirExists(prevdir); } // Ensure this directory is in the list before its ancestors. mkdir(dir.c_str(), 0755); dirs_.push_front(dir); } } // namespace test } // namespace ares #endif ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/ares-test-parse-a.cc0000644000175100001770000003431600000000000022632 0ustar00runnerdocker00000000000000#include "ares-test.h" #include "dns-proto.h" #include #include namespace ares { namespace test { TEST_F(LibraryTest, ParseAReplyOK) { DNSPacket pkt; pkt.set_qid(0x1234).set_response().set_aa() .add_question(new DNSQuestion("example.com", T_A)) .add_answer(new DNSARR("example.com", 0x01020304, {2,3,4,5})) .add_answer(new DNSAaaaRR("example.com", 0x01020304, {0,0,0,0,0,0,0,0,0,0,0,0,2,3,4,5})); std::vector data = { 0x12, 0x34, // qid 0x84, // response + query + AA + not-TC + not-RD 0x00, // not-RA + not-Z + not-AD + not-CD + rc=NoError 0x00, 0x01, // num questions 0x00, 0x02, // num answer RRs 0x00, 0x00, // num authority RRs 0x00, 0x00, // num additional RRs // Question 0x07, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 0x03, 'c', 'o', 'm', 0x00, 0x00, 0x01, // type A 0x00, 0x01, // class IN // Answer 1 0x07, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 0x03, 'c', 'o', 'm', 0x00, 0x00, 0x01, // RR type 0x00, 0x01, // class IN 0x01, 0x02, 0x03, 0x04, // TTL 0x00, 0x04, // rdata length 0x02, 0x03, 0x04, 0x05, // Answer 2 0x07, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 0x03, 'c', 'o', 'm', 0x00, 0x00, 0x1c, // RR type 0x00, 0x01, // class IN 0x01, 0x02, 0x03, 0x04, // TTL 0x00, 0x10, // rdata length 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x03, 0x04, 0x05, }; EXPECT_EQ(data, pkt.data()); struct hostent *host = nullptr; struct ares_addrttl info[5]; int count = 5; EXPECT_EQ(ARES_SUCCESS, ares_parse_a_reply(data.data(), data.size(), &host, info, &count)); EXPECT_EQ(1, count); EXPECT_EQ(0x01020304, info[0].ttl); unsigned long expected_addr = htonl(0x02030405); EXPECT_EQ(expected_addr, info[0].ipaddr.s_addr); EXPECT_EQ("2.3.4.5", AddressToString(&(info[0].ipaddr), 4)); ASSERT_NE(nullptr, host); std::stringstream ss; ss << HostEnt(host); EXPECT_EQ("{'example.com' aliases=[] addrs=[2.3.4.5]}", ss.str()); ares_free_hostent(host); // Repeat without providing a hostent EXPECT_EQ(ARES_SUCCESS, ares_parse_a_reply(data.data(), data.size(), nullptr, info, &count)); EXPECT_EQ(1, count); EXPECT_EQ(0x01020304, info[0].ttl); EXPECT_EQ(expected_addr, info[0].ipaddr.s_addr); EXPECT_EQ("2.3.4.5", AddressToString(&(info[0].ipaddr), 4)); } TEST_F(LibraryTest, ParseMalformedAReply) { std::vector data = { 0x12, 0x34, // [0:2) qid 0x84, // [2] response + query + AA + not-TC + not-RD 0x00, // [3] not-RA + not-Z + not-AD + not-CD + rc=NoError 0x00, 0x01, // [4:6) num questions 0x00, 0x02, // [6:8) num answer RRs 0x00, 0x00, // [8:10) num authority RRs 0x00, 0x00, // [10:12) num additional RRs // Question 0x07, 'e', 'x', 'a', 'm', 'p', 'l', 'e', // [12:20) 0x03, 'c', 'o', 'm', // [20,24) 0x00, // [24] 0x00, 0x01, // [25:26) type A 0x00, 0x01, // [27:29) class IN // Answer 1 0x07, 'e', 'x', 'a', 'm', 'p', 'l', 'e', // [29:37) 0x03, 'c', 'o', 'm', // [37:41) 0x00, // [41] 0x00, 0x01, // [42:44) RR type 0x00, 0x01, // [44:46) class IN 0x01, 0x02, 0x03, 0x04, // [46:50) TTL 0x00, 0x04, // [50:52) rdata length 0x02, 0x03, 0x04, 0x05, // [52,56) }; struct hostent *host = nullptr; struct ares_addrttl info[2]; int count = 2; // Invalid RR-len. std::vector invalid_rrlen(data); invalid_rrlen[51] = 180; EXPECT_EQ(ARES_EBADRESP, ares_parse_a_reply(invalid_rrlen.data(), invalid_rrlen.size(), &host, info, &count)); // Truncate mid-question. EXPECT_EQ(ARES_EBADRESP, ares_parse_a_reply(data.data(), 26, &host, info, &count)); // Truncate mid-answer. EXPECT_EQ(ARES_EBADRESP, ares_parse_a_reply(data.data(), 42, &host, info, &count)); } TEST_F(LibraryTest, ParseAReplyNoData) { DNSPacket pkt; pkt.set_qid(0x1234).set_response().set_aa() .add_question(new DNSQuestion("example.com", T_A)); std::vector data = pkt.data(); struct hostent *host = nullptr; struct ares_addrttl info[2]; int count = 2; EXPECT_EQ(ARES_ENODATA, ares_parse_a_reply(data.data(), data.size(), &host, info, &count)); EXPECT_EQ(0, count); EXPECT_EQ(nullptr, host); // Again but with a CNAME. pkt.add_answer(new DNSCnameRR("example.com", 200, "c.example.com")); data = pkt.data(); // Expect success as per https://github.com/c-ares/c-ares/commit/2c63440127feed70ccefb148b8f938a2df6c15f8 EXPECT_EQ(ARES_SUCCESS, ares_parse_a_reply(data.data(), data.size(), &host, info, &count)); EXPECT_EQ(0, count); EXPECT_NE(nullptr, host); std::stringstream ss; ss << HostEnt(host); EXPECT_EQ("{'c.example.com' aliases=[example.com] addrs=[]}", ss.str()); ares_free_hostent(host); } TEST_F(LibraryTest, ParseAReplyVariantA) { DNSPacket pkt; pkt.set_qid(6366).set_rd().set_ra() .add_question(new DNSQuestion("mit.edu", T_A)) .add_answer(new DNSARR("mit.edu", 52, {18,7,22,69})) .add_auth(new DNSNsRR("mit.edu", 292, "W20NS.mit.edu")) .add_auth(new DNSNsRR("mit.edu", 292, "BITSY.mit.edu")) .add_auth(new DNSNsRR("mit.edu", 292, "STRAWB.mit.edu")) .add_additional(new DNSARR("STRAWB.mit.edu", 292, {18,71,0,151})); struct hostent *host = nullptr; struct ares_addrttl info[2]; int count = 2; std::vector data = pkt.data(); EXPECT_EQ(ARES_SUCCESS, ares_parse_a_reply(data.data(), data.size(), &host, info, &count)); EXPECT_EQ(1, count); EXPECT_EQ("18.7.22.69", AddressToString(&(info[0].ipaddr), 4)); EXPECT_EQ(52, info[0].ttl); ares_free_hostent(host); } TEST_F(LibraryTest, ParseAReplyJustCname) { DNSPacket pkt; pkt.set_qid(6366).set_rd().set_ra() .add_question(new DNSQuestion("mit.edu", T_A)) .add_answer(new DNSCnameRR("mit.edu", 52, "other.mit.edu")); struct hostent *host = nullptr; struct ares_addrttl info[2]; int count = 2; std::vector data = pkt.data(); EXPECT_EQ(ARES_SUCCESS, ares_parse_a_reply(data.data(), data.size(), &host, info, &count)); EXPECT_EQ(0, count); ASSERT_NE(nullptr, host); std::stringstream ss; ss << HostEnt(host); EXPECT_EQ("{'other.mit.edu' aliases=[mit.edu] addrs=[]}", ss.str()); ares_free_hostent(host); } TEST_F(LibraryTest, ParseAReplyVariantCname) { DNSPacket pkt; pkt.set_qid(6366).set_rd().set_ra() .add_question(new DNSQuestion("query.example.com", T_A)) .add_answer(new DNSCnameRR("query.example.com", 200, "redirect.query.example.com")) .add_answer(new DNSARR("redirect.query.example.com", 300, {129,97,123,22})) .add_auth(new DNSNsRR("example.com", 218, "aa.ns1.example.com")) .add_auth(new DNSNsRR("example.com", 218, "ns2.example.com")) .add_auth(new DNSNsRR("example.com", 218, "ns3.example.com")) .add_auth(new DNSNsRR("example.com", 218, "ns4.example.com")) .add_additional(new DNSARR("aa.ns1.example.com", 218, {129,97,1,1})) .add_additional(new DNSARR("ns2.example.com", 218, {129,97,1,2})) .add_additional(new DNSARR("ns3.example.com", 218, {129,97,1,3})) .add_additional(new DNSARR("ns4.example.com", 218, {129,97,1,4})); struct hostent *host = nullptr; struct ares_addrttl info[2]; int count = 2; std::vector data = pkt.data(); EXPECT_EQ(ARES_SUCCESS, ares_parse_a_reply(data.data(), data.size(), &host, info, &count)); EXPECT_EQ(1, count); EXPECT_EQ("129.97.123.22", AddressToString(&(info[0].ipaddr), 4)); // TTL is reduced to match CNAME's. EXPECT_EQ(200, info[0].ttl); ares_free_hostent(host); // Repeat parsing without places to put the results. count = 0; EXPECT_EQ(ARES_SUCCESS, ares_parse_a_reply(data.data(), data.size(), nullptr, info, &count)); } TEST_F(LibraryTest, ParseAReplyVariantCnameChain) { DNSPacket pkt; pkt.set_qid(6366).set_rd().set_ra() .add_question(new DNSQuestion("c1.localhost", T_A)) .add_answer(new DNSCnameRR("c1.localhost", 604800, "c2.localhost")) .add_answer(new DNSCnameRR("c2.localhost", 604800, "c3.localhost")) .add_answer(new DNSCnameRR("c3.localhost", 604800, "c4.localhost")) .add_answer(new DNSARR("c4.localhost", 604800, {8,8,8,8})) .add_auth(new DNSNsRR("localhost", 604800, "localhost")) .add_additional(new DNSARR("localhost", 604800, {127,0,0,1})) .add_additional(new DNSAaaaRR("localhost", 604800, {0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01})); struct hostent *host = nullptr; struct ares_addrttl info[2]; int count = 2; std::vector data = pkt.data(); EXPECT_EQ(ARES_SUCCESS, ares_parse_a_reply(data.data(), data.size(), &host, info, &count)); EXPECT_EQ(1, count); EXPECT_EQ("8.8.8.8", AddressToString(&(info[0].ipaddr), 4)); EXPECT_EQ(604800, info[0].ttl); ares_free_hostent(host); } TEST_F(LibraryTest, DISABLED_ParseAReplyVariantCnameLast) { DNSPacket pkt; pkt.set_qid(6366).set_rd().set_ra() .add_question(new DNSQuestion("query.example.com", T_A)) .add_answer(new DNSARR("redirect.query.example.com", 300, {129,97,123,221})) .add_answer(new DNSARR("redirect.query.example.com", 300, {129,97,123,222})) .add_answer(new DNSARR("redirect.query.example.com", 300, {129,97,123,223})) .add_answer(new DNSARR("redirect.query.example.com", 300, {129,97,123,224})) .add_answer(new DNSCnameRR("query.example.com", 60, "redirect.query.example.com")) .add_additional(new DNSTxtRR("query.example.com", 60, {"text record"})); struct hostent *host = nullptr; struct ares_addrttl info[8]; int count = 8; std::vector data = pkt.data(); EXPECT_EQ(ARES_SUCCESS, ares_parse_a_reply(data.data(), data.size(), &host, info, &count)); EXPECT_EQ(4, count); EXPECT_EQ("129.97.123.221", AddressToString(&(info[0].ipaddr), 4)); EXPECT_EQ("129.97.123.222", AddressToString(&(info[1].ipaddr), 4)); EXPECT_EQ("129.97.123.223", AddressToString(&(info[2].ipaddr), 4)); EXPECT_EQ("129.97.123.224", AddressToString(&(info[3].ipaddr), 4)); EXPECT_EQ(300, info[0].ttl); EXPECT_EQ(300, info[1].ttl); EXPECT_EQ(300, info[2].ttl); EXPECT_EQ(300, info[3].ttl); ares_free_hostent(host); } TEST_F(LibraryTest, ParseAReplyErrors) { DNSPacket pkt; pkt.set_qid(0x1234).set_response().set_aa() .add_question(new DNSQuestion("example.com", T_A)) .add_answer(new DNSARR("example.com", 100, {0x02, 0x03, 0x04, 0x05})); std::vector data; struct hostent *host = nullptr; struct ares_addrttl info[2]; int count = 2; // No question. pkt.questions_.clear(); data = pkt.data(); EXPECT_EQ(ARES_EBADRESP, ares_parse_a_reply(data.data(), data.size(), &host, info, &count)); EXPECT_EQ(nullptr, host); pkt.add_question(new DNSQuestion("example.com", T_A)); // Question != answer pkt.questions_.clear(); pkt.add_question(new DNSQuestion("Axample.com", T_A)); data = pkt.data(); EXPECT_EQ(ARES_ENODATA, ares_parse_a_reply(data.data(), data.size(), &host, info, &count)); EXPECT_EQ(nullptr, host); pkt.questions_.clear(); pkt.add_question(new DNSQuestion("example.com", T_A)); #ifdef DISABLED // Not a response. pkt.set_response(false); data = pkt.data(); EXPECT_EQ(ARES_EBADRESP, ares_parse_a_reply(data.data(), data.size(), &host, info, &count)); EXPECT_EQ(nullptr, host); pkt.set_response(true); // Bad return code. pkt.set_rcode(FORMERR); data = pkt.data(); EXPECT_EQ(ARES_ENODATA, ares_parse_a_reply(data.data(), data.size(), &host, info, &count)); EXPECT_EQ(nullptr, host); pkt.set_rcode(NOERROR); #endif // Two questions pkt.add_question(new DNSQuestion("example.com", T_A)); data = pkt.data(); EXPECT_EQ(ARES_EBADRESP, ares_parse_a_reply(data.data(), data.size(), &host, info, &count)); EXPECT_EQ(nullptr, host); pkt.questions_.clear(); pkt.add_question(new DNSQuestion("example.com", T_A)); // Wrong sort of answer. pkt.answers_.clear(); pkt.add_answer(new DNSMxRR("example.com", 100, 100, "mx1.example.com")); data = pkt.data(); EXPECT_EQ(ARES_ENODATA, ares_parse_a_reply(data.data(), data.size(), &host, info, &count)); EXPECT_EQ(nullptr, host); pkt.answers_.clear(); pkt.add_answer(new DNSARR("example.com", 100, {0x02, 0x03, 0x04, 0x05})); // No answer. pkt.answers_.clear(); data = pkt.data(); EXPECT_EQ(ARES_ENODATA, ares_parse_a_reply(data.data(), data.size(), &host, info, &count)); EXPECT_EQ(nullptr, host); pkt.add_answer(new DNSARR("example.com", 100, {0x02, 0x03, 0x04, 0x05})); // Truncated packets. data = pkt.data(); for (size_t len = 1; len < data.size(); len++) { EXPECT_EQ(ARES_EBADRESP, ares_parse_a_reply(data.data(), len, &host, info, &count)); EXPECT_EQ(nullptr, host); EXPECT_EQ(ARES_EBADRESP, ares_parse_a_reply(data.data(), len, nullptr, info, &count)); } } TEST_F(LibraryTest, ParseAReplyAllocFail) { DNSPacket pkt; pkt.set_qid(0x1234).set_response().set_aa() .add_question(new DNSQuestion("example.com", T_A)) .add_answer(new DNSCnameRR("example.com", 300, "c.example.com")) .add_answer(new DNSARR("c.example.com", 500, {0x02, 0x03, 0x04, 0x05})); std::vector data = pkt.data(); struct hostent *host = nullptr; struct ares_addrttl info[2]; int count = 2; for (int ii = 1; ii <= 8; ii++) { ClearFails(); SetAllocFail(ii); EXPECT_EQ(ARES_ENOMEM, ares_parse_a_reply(data.data(), data.size(), &host, info, &count)) << ii; EXPECT_EQ(nullptr, host); } } } // namespace test } // namespace ares ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/ares-test-parse-aaaa.cc0000644000175100001770000001654500000000000023301 0ustar00runnerdocker00000000000000#include "ares-test.h" #include "dns-proto.h" #include #include namespace ares { namespace test { TEST_F(LibraryTest, ParseAaaaReplyOK) { DNSPacket pkt; pkt.set_qid(0x1234).set_response().set_aa() .add_question(new DNSQuestion("example.com", T_AAAA)) .add_answer(new DNSAaaaRR("example.com", 100, {0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04})) .add_answer(new DNSARR("example.com", 0x01020304, {2,3,4,5})); std::vector data = pkt.data(); struct hostent *host = nullptr; struct ares_addr6ttl info[5]; int count = 5; EXPECT_EQ(ARES_SUCCESS, ares_parse_aaaa_reply(data.data(), data.size(), &host, info, &count)); EXPECT_EQ(1, count); EXPECT_EQ(100, info[0].ttl); EXPECT_EQ(0x01, info[0].ip6addr._S6_un._S6_u8[0]); EXPECT_EQ(0x02, info[0].ip6addr._S6_un._S6_u8[4]); ASSERT_NE(nullptr, host); std::stringstream ss; ss << HostEnt(host); EXPECT_EQ("{'example.com' aliases=[] addrs=[0101:0101:0202:0202:0303:0303:0404:0404]}", ss.str()); ares_free_hostent(host); // Repeat without providing places to put the results count = 0; EXPECT_EQ(ARES_SUCCESS, ares_parse_aaaa_reply(data.data(), data.size(), nullptr, info, &count)); } TEST_F(LibraryTest, ParseAaaaReplyCname) { DNSPacket pkt; pkt.set_qid(0x1234).set_response().set_aa() .add_question(new DNSQuestion("example.com", T_AAAA)) .add_answer(new DNSCnameRR("example.com", 50, "c.example.com")) .add_answer(new DNSAaaaRR("c.example.com", 100, {0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04})); std::vector data = pkt.data(); struct hostent *host = nullptr; struct ares_addr6ttl info[5]; int count = 5; EXPECT_EQ(ARES_SUCCESS, ares_parse_aaaa_reply(data.data(), data.size(), &host, info, &count)); EXPECT_EQ(1, count); // CNAME TTL overrides AAAA TTL. EXPECT_EQ(50, info[0].ttl); EXPECT_EQ(0x01, info[0].ip6addr._S6_un._S6_u8[0]); EXPECT_EQ(0x02, info[0].ip6addr._S6_un._S6_u8[4]); ASSERT_NE(nullptr, host); std::stringstream ss; ss << HostEnt(host); EXPECT_EQ("{'c.example.com' aliases=[example.com] addrs=[0101:0101:0202:0202:0303:0303:0404:0404]}", ss.str()); ares_free_hostent(host); // Repeat without providing a hostent count = 5; EXPECT_EQ(ARES_SUCCESS, ares_parse_aaaa_reply(data.data(), data.size(), nullptr, info, &count)); EXPECT_EQ(1, count); EXPECT_EQ(50, info[0].ttl); EXPECT_EQ(0x01, info[0].ip6addr._S6_un._S6_u8[0]); EXPECT_EQ(0x02, info[0].ip6addr._S6_un._S6_u8[4]); } TEST_F(LibraryTest, ParseAaaaReplyNoData) { DNSPacket pkt; pkt.set_qid(0x1234).set_response().set_aa() .add_question(new DNSQuestion("example.com", T_AAAA)); std::vector data = pkt.data(); struct hostent *host = nullptr; struct ares_addr6ttl info[2]; int count = 2; EXPECT_EQ(ARES_ENODATA, ares_parse_aaaa_reply(data.data(), data.size(), &host, info, &count)); EXPECT_EQ(0, count); EXPECT_EQ(nullptr, host); // Again but with a CNAME. pkt.add_answer(new DNSCnameRR("example.com", 200, "c.example.com")); EXPECT_EQ(ARES_ENODATA, ares_parse_aaaa_reply(data.data(), data.size(), &host, info, &count)); EXPECT_EQ(0, count); EXPECT_EQ(nullptr, host); } TEST_F(LibraryTest, ParseAaaaReplyErrors) { DNSPacket pkt; pkt.set_qid(0x1234).set_response().set_aa() .add_question(new DNSQuestion("example.com", T_AAAA)) .add_answer(new DNSAaaaRR("example.com", 100, {0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04})); std::vector data; struct hostent *host = nullptr; struct ares_addr6ttl info[2]; int count = 2; // No question. pkt.questions_.clear(); data = pkt.data(); EXPECT_EQ(ARES_EBADRESP, ares_parse_aaaa_reply(data.data(), data.size(), &host, info, &count)); EXPECT_EQ(nullptr, host); pkt.add_question(new DNSQuestion("example.com", T_AAAA)); // Question != answer pkt.questions_.clear(); pkt.add_question(new DNSQuestion("Axample.com", T_AAAA)); data = pkt.data(); EXPECT_EQ(ARES_ENODATA, ares_parse_aaaa_reply(data.data(), data.size(), &host, info, &count)); EXPECT_EQ(nullptr, host); pkt.questions_.clear(); pkt.add_question(new DNSQuestion("example.com", T_AAAA)); // Two questions. pkt.add_question(new DNSQuestion("example.com", T_AAAA)); data = pkt.data(); EXPECT_EQ(ARES_EBADRESP, ares_parse_aaaa_reply(data.data(), data.size(), &host, info, &count)); EXPECT_EQ(nullptr, host); pkt.questions_.clear(); pkt.add_question(new DNSQuestion("example.com", T_AAAA)); // Wrong sort of answer. pkt.answers_.clear(); pkt.add_answer(new DNSMxRR("example.com", 100, 100, "mx1.example.com")); data = pkt.data(); EXPECT_EQ(ARES_ENODATA, ares_parse_aaaa_reply(data.data(), data.size(), &host, info, &count)); EXPECT_EQ(nullptr, host); pkt.answers_.clear(); pkt.add_answer(new DNSAaaaRR("example.com", 100, {0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04})); // No answer. pkt.answers_.clear(); data = pkt.data(); EXPECT_EQ(ARES_ENODATA, ares_parse_aaaa_reply(data.data(), data.size(), &host, info, &count)); EXPECT_EQ(nullptr, host); pkt.add_answer(new DNSAaaaRR("example.com", 100, {0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04})); // Truncated packets. data = pkt.data(); for (size_t len = 1; len < data.size(); len++) { EXPECT_EQ(ARES_EBADRESP, ares_parse_aaaa_reply(data.data(), len, &host, info, &count)); EXPECT_EQ(nullptr, host); EXPECT_EQ(ARES_EBADRESP, ares_parse_aaaa_reply(data.data(), len, nullptr, info, &count)); } } TEST_F(LibraryTest, ParseAaaaReplyAllocFail) { DNSPacket pkt; pkt.set_qid(0x1234).set_response().set_aa() .add_question(new DNSQuestion("example.com", T_AAAA)) .add_answer(new DNSCnameRR("example.com", 300, "c.example.com")) .add_answer(new DNSAaaaRR("c.example.com", 100, {0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04})); std::vector data = pkt.data(); struct hostent *host = nullptr; struct ares_addr6ttl info[2]; int count = 2; for (int ii = 1; ii <= 8; ii++) { ClearFails(); SetAllocFail(ii); EXPECT_EQ(ARES_ENOMEM, ares_parse_aaaa_reply(data.data(), data.size(), &host, info, &count)) << ii; EXPECT_EQ(nullptr, host); } } } // namespace test } // namespace ares ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/ares-test-parse-caa.cc0000644000175100001770000001377300000000000023142 0ustar00runnerdocker00000000000000#include "ares-test.h" #include "dns-proto.h" #include #include namespace ares { namespace test { TEST_F(LibraryTest, ParseCaaReplyMultipleOK) { std::vector data = { 0x27, 0x86, 0x81, 0x80, 0x00, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x09, 0x77, 0x69, 0x6B, // '............wik 0x69, 0x70, 0x65, 0x64, 0x69, 0x61, 0x03, 0x6F, 0x72, 0x67, 0x00, 0x01, 0x01, 0x00, 0x01, 0xC0, // ipedia.org...... 0x0C, 0x01, 0x01, 0x00, 0x01, 0x00, 0x00, 0x02, 0x23, 0x00, 0x15, 0x00, 0x05, 0x69, 0x73, 0x73, // ........#....iss 0x75, 0x65, 0x67, 0x6C, 0x6F, 0x62, 0x61, 0x6C, 0x73, 0x69, 0x67, 0x6E, 0x2E, 0x63, 0x6F, 0x6D, // ueglobalsign.com 0xC0, 0x0C, 0x01, 0x01, 0x00, 0x01, 0x00, 0x00, 0x02, 0x23, 0x00, 0x13, 0x00, 0x05, 0x69, 0x73, // .........#....is 0x73, 0x75, 0x65, 0x64, 0x69, 0x67, 0x69, 0x63, 0x65, 0x72, 0x74, 0x2E, 0x63, 0x6F, 0x6D, 0xC0, // suedigicert.com. 0x0C, 0x01, 0x01, 0x00, 0x01, 0x00, 0x00, 0x02, 0x23, 0x00, 0x16, 0x00, 0x05, 0x69, 0x73, 0x73, // ........#....iss 0x75, 0x65, 0x6C, 0x65, 0x74, 0x73, 0x65, 0x6E, 0x63, 0x72, 0x79, 0x70, 0x74, 0x2E, 0x6F, 0x72, // ueletsencrypt.or 0x67, 0xC0, 0x0C, 0x01, 0x01, 0x00, 0x01, 0x00, 0x00, 0x02, 0x23, 0x00, 0x25, 0x00, 0x05, 0x69, // g.........#.%..i 0x6F, 0x64, 0x65, 0x66, 0x6D, 0x61, 0x69, 0x6C, 0x74, 0x6F, 0x3A, 0x64, 0x6E, 0x73, 0x2D, 0x61, // odefmailto:dns-a 0x64, 0x6D, 0x69, 0x6E, 0x40, 0x77, 0x69, 0x6B, 0x69, 0x6D, 0x65, 0x64, 0x69, 0x61, 0x2E, 0x6F, // dmin@wikimedia.o 0x72, 0x67 // rg }; struct ares_caa_reply* caa = nullptr; EXPECT_EQ(ARES_SUCCESS, ares_parse_caa_reply(data.data(), data.size(), &caa)); ASSERT_NE(nullptr, caa); ASSERT_NE(nullptr, caa->next); ASSERT_NE(nullptr, caa->next->next); ASSERT_NE(nullptr, caa->next->next->next); ares_free_data(caa); } TEST_F(LibraryTest, ParseCaaReplySingleOK) { std::vector data = { 0x27, 0x86, 0x81, 0x80, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x06, 0x67, 0x6F, 0x6F, // '............goo 0x67, 0x6C, 0x65, 0x03, 0x63, 0x6F, 0x6D, 0x00, 0x01, 0x01, 0x00, 0x01, 0xC0, 0x0C, 0x01, 0x01, // gle.com......... 0x00, 0x01, 0x00, 0x01, 0x43, 0xBE, 0x00, 0x0F, 0x00, 0x05, 0x69, 0x73, 0x73, 0x75, 0x65, 0x70, // ....C.....issuep 0x6B, 0x69, 0x2E, 0x67, 0x6F, 0x6F, 0x67 // ki.goog }; struct ares_caa_reply* caa = nullptr; EXPECT_EQ(ARES_SUCCESS, ares_parse_caa_reply(data.data(), data.size(), &caa)); ASSERT_NE(nullptr, caa); EXPECT_EQ(caa->critical, 0); EXPECT_EQ(caa->plength, 5); EXPECT_STREQ((char *)caa->property, "issue"); EXPECT_EQ(caa->length, 8); EXPECT_STREQ((char *)caa->value, "pki.goog"); ares_free_data(caa); } TEST_F(LibraryTest, ParseCaaBogusReply1) { std::vector data = { 0x27, 0x86, 0x81, 0x80, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x06, 0x67, 0x6F, 0x6F, // '............goo 0x67, 0x6C, 0x65, 0x03, 0x63, 0x6F, 0x6D, 0x00, 0x01, 0x01, 0x00, 0x01, 0xC0, 0x0C, 0x01, 0x01, // gle.com......... 0x00, 0x01, 0x00, 0x01, 0x43, 0xBE, 0x00, 0x0F, 0x00, 0x00, 0x69, 0x73, 0x73, 0x75, 0x65, 0x70, // ....C.....issuep 0x6B, 0x69, 0x2E, 0x67, 0x6F, 0x6F, 0x67 // ki.goog }; struct ares_caa_reply* caa = nullptr; EXPECT_EQ(ARES_EBADRESP, ares_parse_caa_reply(data.data(), data.size(), &caa)); ASSERT_EQ(nullptr, caa); } TEST_F(LibraryTest, ParseCaaBogusReply2) { std::vector data = { 0x27, 0x86, 0x81, 0x80, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x06, 0x67, 0x6F, 0x6F, // '............goo 0x67, 0x6C, 0x65, 0x03, 0x63, 0x6F, 0x6D, 0x00, 0x01, 0x01, 0x00, 0x01, 0xC0, 0x0C, 0x01, 0x01, // gle.com......... 0x00, 0x01, 0x00, 0x01, 0x43, 0xBE, 0x00, 0x0F, 0x00, 0x0e, 0x69, 0x73, 0x73, 0x75, 0x65, 0x70, // ....C.....issuep 0x6B, 0x69, 0x2E, 0x67, 0x6F, 0x6F, 0x67 // ki.goog }; struct ares_caa_reply* caa = nullptr; EXPECT_EQ(ARES_EBADRESP, ares_parse_caa_reply(data.data(), data.size(), &caa)); ASSERT_EQ(nullptr, caa); } TEST_F(LibraryTest, ParseCaaBogusReply3) { std::vector data = { 0x27, 0x86, 0x81, 0x80, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x06, 0x67, 0x6F, 0x6F, // '............goo 0x67, 0x6C, 0x65, 0x03, 0x63, 0x6F, 0x6D, 0x00, 0x01, 0x01, 0x00, 0x01, 0xC0, 0x0C, 0x01, 0x01, // gle.com......... 0x00, 0x01, 0x00, 0x01, 0x43, 0xBE, 0x00, 0x10, 0x00, 0x05, 0x69, 0x73, 0x73, 0x75, 0x65, 0x70, // ....C.....issuep 0x6B, 0x69, 0x2E, 0x67, 0x6F, 0x6F, 0x67 // ki.goog }; struct ares_caa_reply* caa = nullptr; EXPECT_EQ(ARES_EBADRESP, ares_parse_caa_reply(data.data(), data.size(), &caa)); ASSERT_EQ(nullptr, caa); } TEST_F(LibraryTest, ParseCaaEmptyReply) { std::vector data = { 0x27, 0x86, 0x81, 0x80, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x09, 0x77, 0x69, 0x6B, // '............wik 0x69, 0x70, 0x65, 0x64, 0x69, 0x61, 0x02, 0x64, 0x65, 0x00, 0x01, 0x01, 0x00, 0x01, 0xC0, 0x0C, // ipedia.de....... 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x02, 0x58, 0x00, 0x3B, 0x04, 0x6E, 0x73, 0x38, 0x31, 0x0D, // .......X.;.ns81. 0x64, 0x6F, 0x6D, 0x61, 0x69, 0x6E, 0x63, 0x6F, 0x6E, 0x74, 0x72, 0x6F, 0x6C, 0x03, 0x63, 0x6F, // domaincontrol.co 0x6D, 0x00, 0x03, 0x64, 0x6E, 0x73, 0x05, 0x6A, 0x6F, 0x6D, 0x61, 0x78, 0x03, 0x6E, 0x65, 0x74, // m..dns.jomax.net 0x00, 0x78, 0x67, 0xFE, 0x34, 0x00, 0x00, 0x70, 0x80, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x3A, // .xg.4..p.... ..: 0x80, 0x00, 0x00, 0x02, 0x58 // ....X }; struct ares_caa_reply* caa = nullptr; EXPECT_EQ(ARES_ENODATA, ares_parse_caa_reply(data.data(), data.size(), &caa)); ASSERT_EQ(nullptr, caa); } } // namespace test } // namespace ares ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/ares-test-parse-mx.cc0000644000175100001770000001057300000000000023035 0ustar00runnerdocker00000000000000#include "ares-test.h" #include "dns-proto.h" #include #include namespace ares { namespace test { TEST_F(LibraryTest, ParseMxReplyOK) { DNSPacket pkt; pkt.set_qid(0x1234).set_response().set_aa() .add_question(new DNSQuestion("example.com", T_MX)) .add_answer(new DNSMxRR("example.com", 100, 100, "mx1.example.com")) .add_answer(new DNSMxRR("example.com", 100, 200, "mx2.example.com")); std::vector data = pkt.data(); struct ares_mx_reply* mx = nullptr; EXPECT_EQ(ARES_SUCCESS, ares_parse_mx_reply(data.data(), data.size(), &mx)); ASSERT_NE(nullptr, mx); EXPECT_EQ("mx1.example.com", std::string(mx->host)); EXPECT_EQ(100, mx->priority); struct ares_mx_reply* mx2 = mx->next; ASSERT_NE(nullptr, mx2); EXPECT_EQ("mx2.example.com", std::string(mx2->host)); EXPECT_EQ(200, mx2->priority); EXPECT_EQ(nullptr, mx2->next); ares_free_data(mx); } TEST_F(LibraryTest, ParseMxReplyMalformed) { std::vector data = { 0x12, 0x34, // qid 0x84, // response + query + AA + not-TC + not-RD 0x00, // not-RA + not-Z + not-AD + not-CD + rc=NoError 0x00, 0x01, // num questions 0x00, 0x01, // num answer RRs 0x00, 0x00, // num authority RRs 0x00, 0x00, // num additional RRs // Question 0x07, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 0x03, 'c', 'o', 'm', 0x00, 0x00, 0x0F, // type MX 0x00, 0x01, // class IN // Answer 1 0x07, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 0x03, 'c', 'o', 'm', 0x00, 0x00, 0x0F, // RR type 0x00, 0x01, // class IN 0x01, 0x02, 0x03, 0x04, // TTL 0x00, 0x01, // rdata length -- too short 0x02, }; struct ares_mx_reply* mx = nullptr; EXPECT_EQ(ARES_EBADRESP, ares_parse_mx_reply(data.data(), data.size(), &mx)); ASSERT_EQ(nullptr, mx); } TEST_F(LibraryTest, ParseMxReplyErrors) { DNSPacket pkt; pkt.set_qid(0x1234).set_response().set_aa() .add_question(new DNSQuestion("example.com", T_MX)) .add_answer(new DNSMxRR("example.com", 100, 100, "mx1.example.com")); std::vector data; struct ares_mx_reply* mx = nullptr; // No question. pkt.questions_.clear(); data = pkt.data(); EXPECT_EQ(ARES_EBADRESP, ares_parse_mx_reply(data.data(), data.size(), &mx)); EXPECT_EQ(nullptr, mx); pkt.add_question(new DNSQuestion("example.com", T_MX)); #ifdef DISABLED // Question != answer pkt.questions_.clear(); pkt.add_question(new DNSQuestion("Axample.com", T_MX)); data = pkt.data(); EXPECT_EQ(ARES_EBADRESP, ares_parse_mx_reply(data.data(), data.size(), &mx)); pkt.questions_.clear(); pkt.add_question(new DNSQuestion("example.com", T_MX)); #endif // Two questions. pkt.add_question(new DNSQuestion("example.com", T_MX)); data = pkt.data(); EXPECT_EQ(ARES_EBADRESP, ares_parse_mx_reply(data.data(), data.size(), &mx)); EXPECT_EQ(nullptr, mx); pkt.questions_.clear(); pkt.add_question(new DNSQuestion("example.com", T_MX)); // Wrong sort of answer. // TODO(drysdale): check if this should be ARES_ENODATA? pkt.answers_.clear(); pkt.add_answer(new DNSSrvRR("example.abc.def.com", 180, 0, 10, 8160, "example.abc.def.com")); data = pkt.data(); EXPECT_EQ(ARES_SUCCESS, ares_parse_mx_reply(data.data(), data.size(), &mx)); EXPECT_EQ(nullptr, mx); pkt.answers_.clear(); pkt.add_answer(new DNSMxRR("example.com", 100, 100, "mx1.example.com")); // No answer. pkt.answers_.clear(); data = pkt.data(); EXPECT_EQ(ARES_ENODATA, ares_parse_mx_reply(data.data(), data.size(), &mx)); EXPECT_EQ(nullptr, mx); pkt.add_answer(new DNSMxRR("example.com", 100, 100, "mx1.example.com")); // Truncated packets. data = pkt.data(); for (size_t len = 1; len < data.size(); len++) { int rc = ares_parse_mx_reply(data.data(), len, &mx); EXPECT_EQ(nullptr, mx); EXPECT_TRUE(rc == ARES_EBADRESP || rc == ARES_EBADNAME); } } TEST_F(LibraryTest, ParseMxReplyAllocFail) { DNSPacket pkt; pkt.set_qid(0x1234).set_response().set_aa() .add_question(new DNSQuestion("example.com", T_MX)) .add_answer(new DNSCnameRR("example.com", 300, "c.example.com")) .add_answer(new DNSMxRR("c.example.com", 100, 100, "mx1.example.com")); std::vector data = pkt.data(); struct ares_mx_reply* mx = nullptr; for (int ii = 1; ii <= 5; ii++) { ClearFails(); SetAllocFail(ii); EXPECT_EQ(ARES_ENOMEM, ares_parse_mx_reply(data.data(), data.size(), &mx)) << ii; } } } // namespace test } // namespace ares ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/ares-test-parse-naptr.cc0000644000175100001770000001224700000000000023535 0ustar00runnerdocker00000000000000#include "ares-test.h" #include "dns-proto.h" #include #include namespace ares { namespace test { TEST_F(LibraryTest, ParseNaptrReplyOK) { DNSPacket pkt; pkt.set_qid(0x1234).set_response().set_aa() .add_question(new DNSQuestion("example.com", T_NAPTR)) .add_answer(new DNSNaptrRR("example.com", 100, 10, 20, "SP", "service", "regexp", "replace")) .add_answer(new DNSNaptrRR("example.com", 0x0010, 11, 21, "SP", "service2", "regexp2", "replace2")); std::vector data = pkt.data(); struct ares_naptr_reply* naptr = nullptr; EXPECT_EQ(ARES_SUCCESS, ares_parse_naptr_reply(data.data(), data.size(), &naptr)); ASSERT_NE(nullptr, naptr); EXPECT_EQ("SP", std::string((char*)naptr->flags)); EXPECT_EQ("service", std::string((char*)naptr->service)); EXPECT_EQ("regexp", std::string((char*)naptr->regexp)); EXPECT_EQ("replace", std::string((char*)naptr->replacement)); EXPECT_EQ(10, naptr->order); EXPECT_EQ(20, naptr->preference); struct ares_naptr_reply* naptr2 = naptr->next; ASSERT_NE(nullptr, naptr2); EXPECT_EQ("SP", std::string((char*)naptr2->flags)); EXPECT_EQ("service2", std::string((char*)naptr2->service)); EXPECT_EQ("regexp2", std::string((char*)naptr2->regexp)); EXPECT_EQ("replace2", std::string((char*)naptr2->replacement)); EXPECT_EQ(11, naptr2->order); EXPECT_EQ(21, naptr2->preference); EXPECT_EQ(nullptr, naptr2->next); ares_free_data(naptr); } TEST_F(LibraryTest, ParseNaptrReplyErrors) { DNSPacket pkt; pkt.set_qid(0x1234).set_response().set_aa() .add_question(new DNSQuestion("example.com", T_NAPTR)) .add_answer(new DNSNaptrRR("example.com", 100, 10, 20, "SP", "service", "regexp", "replace")); std::vector data; struct ares_naptr_reply* naptr = nullptr; // No question. pkt.questions_.clear(); data = pkt.data(); EXPECT_EQ(ARES_EBADRESP, ares_parse_naptr_reply(data.data(), data.size(), &naptr)); pkt.add_question(new DNSQuestion("example.com", T_NAPTR)); #ifdef DISABLED // Question != answer pkt.questions_.clear(); pkt.add_question(new DNSQuestion("Axample.com", T_NAPTR)); data = pkt.data(); EXPECT_EQ(ARES_ENODATA, ares_parse_naptr_reply(data.data(), data.size(), &naptr)); pkt.questions_.clear(); pkt.add_question(new DNSQuestion("example.com", T_NAPTR)); #endif // Two questions pkt.add_question(new DNSQuestion("example.com", T_NAPTR)); data = pkt.data(); EXPECT_EQ(ARES_EBADRESP, ares_parse_naptr_reply(data.data(), data.size(), &naptr)); pkt.questions_.clear(); pkt.add_question(new DNSQuestion("example.com", T_NAPTR)); // Wrong sort of answer. pkt.answers_.clear(); pkt.add_answer(new DNSMxRR("example.com", 100, 100, "mx1.example.com")); data = pkt.data(); EXPECT_EQ(ARES_SUCCESS, ares_parse_naptr_reply(data.data(), data.size(), &naptr)); EXPECT_EQ(nullptr, naptr); pkt.answers_.clear(); pkt.add_answer(new DNSNaptrRR("example.com", 100, 10, 20, "SP", "service", "regexp", "replace")); // No answer. pkt.answers_.clear(); data = pkt.data(); EXPECT_EQ(ARES_ENODATA, ares_parse_naptr_reply(data.data(), data.size(), &naptr)); pkt.add_answer(new DNSNaptrRR("example.com", 100, 10, 20, "SP", "service", "regexp", "replace")); // Truncated packets. data = pkt.data(); for (size_t len = 1; len < data.size(); len++) { int rc = ares_parse_naptr_reply(data.data(), len, &naptr); EXPECT_TRUE(rc == ARES_EBADRESP || rc == ARES_EBADNAME); } } TEST_F(LibraryTest, ParseNaptrReplyTooShort) { std::vector data = { 0x12, 0x34, // qid 0x84, // response + query + AA + not-TC + not-RD 0x00, // not-RA + not-Z + not-AD + not-CD + rc=NoError 0x00, 0x01, // num questions 0x00, 0x01, // num answer RRs 0x00, 0x00, // num authority RRs 0x00, 0x00, // num additional RRs // Question 0x07, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 0x03, 'c', 'o', 'm', 0x00, 0x00, 0x23, // type NAPTR 0x00, 0x01, // class IN // Answer 1 0x07, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 0x03, 'c', 'o', 'm', 0x00, 0x00, 0x23, // RR type 0x00, 0x01, // class IN 0x01, 0x02, 0x03, 0x04, // TTL 0x00, 0x01, // rdata length 0x00, // Too short: expect 2 x int16 and 3 x name (min 1 byte each) }; struct ares_naptr_reply* naptr = nullptr; EXPECT_EQ(ARES_EBADRESP, ares_parse_naptr_reply(data.data(), data.size(), &naptr)); } TEST_F(LibraryTest, ParseNaptrReplyAllocFail) { DNSPacket pkt; pkt.set_qid(0x1234).set_response().set_aa() .add_question(new DNSQuestion("example.com", T_NAPTR)) .add_answer(new DNSNaptrRR("example.com", 100, 10, 20, "SP", "service", "regexp", "replace")) .add_answer(new DNSNaptrRR("example.com", 0x0010, 11, 21, "SP", "service2", "regexp2", "replace2")); std::vector data = pkt.data(); struct ares_naptr_reply* naptr = nullptr; for (int ii = 1; ii <= 13; ii++) { ClearFails(); SetAllocFail(ii); EXPECT_EQ(ARES_ENOMEM, ares_parse_naptr_reply(data.data(), data.size(), &naptr)); } } } // namespace test } // namespace ares ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/ares-test-parse-ns.cc0000644000175100001770000001010700000000000023022 0ustar00runnerdocker00000000000000#include "ares-test.h" #include "dns-proto.h" #include #include namespace ares { namespace test { TEST_F(LibraryTest, ParseNsReplyOK) { DNSPacket pkt; pkt.set_qid(0x1234).set_response().set_aa() .add_question(new DNSQuestion("example.com", T_NS)) .add_answer(new DNSNsRR("example.com", 100, "ns.example.com")); std::vector data = pkt.data(); struct hostent *host = nullptr; EXPECT_EQ(ARES_SUCCESS, ares_parse_ns_reply(data.data(), data.size(), &host)); ASSERT_NE(nullptr, host); std::stringstream ss; ss << HostEnt(host); EXPECT_EQ("{'example.com' aliases=[ns.example.com] addrs=[]}", ss.str()); ares_free_hostent(host); } TEST_F(LibraryTest, ParseNsReplyMultiple) { DNSPacket pkt; pkt.set_qid(10501).set_response().set_rd().set_ra() .add_question(new DNSQuestion("google.com", T_NS)) .add_answer(new DNSNsRR("google.com", 59, "ns1.google.com")) .add_answer(new DNSNsRR("google.com", 59, "ns2.google.com")) .add_answer(new DNSNsRR("google.com", 59, "ns3.google.com")) .add_answer(new DNSNsRR("google.com", 59, "ns4.google.com")) .add_additional(new DNSARR("ns4.google.com", 247, {216,239,38,10})) .add_additional(new DNSARR("ns2.google.com", 247, {216,239,34,10})) .add_additional(new DNSARR("ns1.google.com", 247, {216,239,32,10})) .add_additional(new DNSARR("ns3.google.com", 247, {216,239,36,10})); std::vector data = pkt.data(); struct hostent *host = nullptr; EXPECT_EQ(ARES_SUCCESS, ares_parse_ns_reply(data.data(), data.size(), &host)); ASSERT_NE(nullptr, host); std::stringstream ss; ss << HostEnt(host); EXPECT_EQ("{'google.com' aliases=[ns1.google.com, ns2.google.com, ns3.google.com, ns4.google.com] addrs=[]}", ss.str()); ares_free_hostent(host); } TEST_F(LibraryTest, ParseNsReplyErrors) { DNSPacket pkt; pkt.set_qid(0x1234).set_response().set_aa() .add_question(new DNSQuestion("example.com", T_NS)) .add_answer(new DNSNsRR("example.com", 100, "ns.example.com")); std::vector data; struct hostent *host = nullptr; // No question. pkt.questions_.clear(); data = pkt.data(); EXPECT_EQ(ARES_EBADRESP, ares_parse_ns_reply(data.data(), data.size(), &host)); pkt.add_question(new DNSQuestion("example.com", T_NS)); #ifdef DISABLED // Question != answer pkt.questions_.clear(); pkt.add_question(new DNSQuestion("Axample.com", T_NS)); data = pkt.data(); EXPECT_EQ(ARES_ENODATA, ares_parse_ns_reply(data.data(), data.size(), &host)); pkt.questions_.clear(); pkt.add_question(new DNSQuestion("example.com", T_NS)); #endif // Two questions. pkt.add_question(new DNSQuestion("example.com", T_NS)); data = pkt.data(); EXPECT_EQ(ARES_EBADRESP, ares_parse_ns_reply(data.data(), data.size(), &host)); pkt.questions_.clear(); pkt.add_question(new DNSQuestion("example.com", T_NS)); // Wrong sort of answer. pkt.answers_.clear(); pkt.add_answer(new DNSMxRR("example.com", 100, 100, "mx1.example.com")); data = pkt.data(); EXPECT_EQ(ARES_ENODATA, ares_parse_ns_reply(data.data(), data.size(), &host)); pkt.answers_.clear(); pkt.add_answer(new DNSNsRR("example.com", 100, "ns.example.com")); // No answer. pkt.answers_.clear(); data = pkt.data(); EXPECT_EQ(ARES_ENODATA, ares_parse_ns_reply(data.data(), data.size(), &host)); pkt.add_answer(new DNSNsRR("example.com", 100, "ns.example.com")); // Truncated packets. data = pkt.data(); for (size_t len = 1; len < data.size(); len++) { EXPECT_EQ(ARES_EBADRESP, ares_parse_ns_reply(data.data(), len, &host)); } } TEST_F(LibraryTest, ParseNsReplyAllocFail) { DNSPacket pkt; pkt.set_qid(0x1234).set_response().set_aa() .add_question(new DNSQuestion("example.com", T_NS)) .add_answer(new DNSCnameRR("example.com", 300, "c.example.com")) .add_answer(new DNSNsRR("c.example.com", 100, "ns.example.com")); std::vector data = pkt.data(); struct hostent *host = nullptr; for (int ii = 1; ii <= 8; ii++) { ClearFails(); SetAllocFail(ii); EXPECT_EQ(ARES_ENOMEM, ares_parse_ns_reply(data.data(), data.size(), &host)) << ii; } } } // namespace test } // namespace ares ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/ares-test-parse-ptr.cc0000644000175100001770000002442500000000000023217 0ustar00runnerdocker00000000000000#include "ares-test.h" #include "dns-proto.h" #include #include namespace ares { namespace test { TEST_F(LibraryTest, ParsePtrReplyOK) { byte addrv4[4] = {0x10, 0x20, 0x30, 0x40}; DNSPacket pkt; pkt.set_qid(0x1234).set_response().set_aa() .add_question(new DNSQuestion("64.48.32.16.in-addr.arpa", T_PTR)) .add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "other.com")); std::vector data = pkt.data(); struct hostent *host = nullptr; EXPECT_EQ(ARES_SUCCESS, ares_parse_ptr_reply(data.data(), data.size(), addrv4, sizeof(addrv4), AF_INET, &host)); ASSERT_NE(nullptr, host); std::stringstream ss; ss << HostEnt(host); EXPECT_EQ("{'other.com' aliases=[other.com] addrs=[16.32.48.64]}", ss.str()); ares_free_hostent(host); } TEST_F(LibraryTest, ParsePtrReplyCname) { byte addrv4[4] = {0x10, 0x20, 0x30, 0x40}; DNSPacket pkt; pkt.set_qid(0x1234).set_response().set_aa() .add_question(new DNSQuestion("64.48.32.16.in-addr.arpa", T_PTR)) .add_answer(new DNSCnameRR("64.48.32.16.in-addr.arpa", 50, "64.48.32.8.in-addr.arpa")) .add_answer(new DNSPtrRR("64.48.32.8.in-addr.arpa", 100, "other.com")); std::vector data = pkt.data(); struct hostent *host = nullptr; EXPECT_EQ(ARES_SUCCESS, ares_parse_ptr_reply(data.data(), data.size(), addrv4, sizeof(addrv4), AF_INET, &host)); ASSERT_NE(nullptr, host); std::stringstream ss; ss << HostEnt(host); EXPECT_EQ("{'other.com' aliases=[other.com] addrs=[16.32.48.64]}", ss.str()); ares_free_hostent(host); } struct DNSMalformedCnameRR : public DNSCnameRR { DNSMalformedCnameRR(const std::string& name, int ttl, const std::string& other) : DNSCnameRR(name, ttl, other) {} std::vector data() const { std::vector data = DNSRR::data(); std::vector encname = EncodeString(other_); encname[0] = encname[0] + 63; // invalid label length int len = encname.size(); PushInt16(&data, len); data.insert(data.end(), encname.begin(), encname.end()); return data; } }; TEST_F(LibraryTest, ParsePtrReplyMalformedCname) { byte addrv4[4] = {0x10, 0x20, 0x30, 0x40}; DNSPacket pkt; pkt.set_qid(0x1234).set_response().set_aa() .add_question(new DNSQuestion("64.48.32.16.in-addr.arpa", T_PTR)) .add_answer(new DNSMalformedCnameRR("64.48.32.16.in-addr.arpa", 50, "64.48.32.8.in-addr.arpa")) .add_answer(new DNSPtrRR("64.48.32.8.in-addr.arpa", 100, "other.com")); std::vector data = pkt.data(); struct hostent *host = nullptr; EXPECT_EQ(ARES_EBADRESP, ares_parse_ptr_reply(data.data(), data.size(), addrv4, sizeof(addrv4), AF_INET, &host)); ASSERT_EQ(nullptr, host); } TEST_F(LibraryTest, ParseManyPtrReply) { byte addrv4[4] = {0x10, 0x20, 0x30, 0x40}; DNSPacket pkt; pkt.set_qid(0x1234).set_response().set_aa() .add_question(new DNSQuestion("64.48.32.16.in-addr.arpa", T_PTR)) .add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "main.com")) .add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "other1.com")) .add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "other2.com")) .add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "other3.com")) .add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "other4.com")) .add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "other5.com")) .add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "other6.com")) .add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "other7.com")) .add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "other8.com")) .add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "other9.com")); std::vector data = pkt.data(); struct hostent *host = nullptr; EXPECT_EQ(ARES_SUCCESS, ares_parse_ptr_reply(data.data(), data.size(), addrv4, sizeof(addrv4), AF_INET, &host)); ASSERT_NE(nullptr, host); ares_free_hostent(host); } TEST_F(LibraryTest, ParsePtrReplyAdditional) { byte addrv4[4] = {0x10, 0x20, 0x30, 0x40}; DNSPacket pkt; pkt.set_qid(0x1234).set_response().set_aa() .add_question(new DNSQuestion("64.48.32.16.in-addr.arpa", T_PTR)) .add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 55, "other.com")) .add_auth(new DNSNsRR("16.in-addr.arpa", 234, "ns1.other.com")) .add_auth(new DNSNsRR("16.in-addr.arpa", 234, "bb.ns2.other.com")) .add_auth(new DNSNsRR("16.in-addr.arpa", 234, "ns3.other.com")) .add_additional(new DNSARR("ns1.other.com", 229, {10,20,30,41})) .add_additional(new DNSARR("bb.ns2.other.com", 229, {10,20,30,42})) .add_additional(new DNSARR("ns3.other.com", 229, {10,20,30,43})); std::vector data = pkt.data(); struct hostent *host = nullptr; EXPECT_EQ(ARES_SUCCESS, ares_parse_ptr_reply(data.data(), data.size(), addrv4, sizeof(addrv4), AF_INET, &host)); ASSERT_NE(nullptr, host); std::stringstream ss; ss << HostEnt(host); EXPECT_EQ("{'other.com' aliases=[other.com] addrs=[16.32.48.64]}", ss.str()); ares_free_hostent(host); } TEST_F(LibraryTest, ParsePtrReplyErrors) { byte addrv4[4] = {0x10, 0x20, 0x30, 0x40}; DNSPacket pkt; pkt.set_qid(0x1234).set_response().set_aa() .add_question(new DNSQuestion("64.48.32.16.in-addr.arpa", T_PTR)) .add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "other.com")); std::vector data; struct hostent *host = nullptr; // No question. pkt.questions_.clear(); data = pkt.data(); EXPECT_EQ(ARES_EBADRESP, ares_parse_ptr_reply(data.data(), data.size(), addrv4, sizeof(addrv4), AF_INET, &host)); pkt.add_question(new DNSQuestion("64.48.32.16.in-addr.arpa", T_PTR)); // Question != answer pkt.questions_.clear(); pkt.add_question(new DNSQuestion("99.48.32.16.in-addr.arpa", T_PTR)); data = pkt.data(); EXPECT_EQ(ARES_ENODATA, ares_parse_ptr_reply(data.data(), data.size(), addrv4, sizeof(addrv4), AF_INET, &host)); EXPECT_EQ(nullptr, host); pkt.questions_.clear(); pkt.add_question(new DNSQuestion("64.48.32.16.in-addr.arpa", T_PTR)); // Two questions. pkt.add_question(new DNSQuestion("64.48.32.16.in-addr.arpa", T_PTR)); data = pkt.data(); EXPECT_EQ(ARES_EBADRESP, ares_parse_ptr_reply(data.data(), data.size(), addrv4, sizeof(addrv4), AF_INET, &host)); EXPECT_EQ(nullptr, host); pkt.questions_.clear(); pkt.add_question(new DNSQuestion("64.48.32.16.in-addr.arpa", T_PTR)); // Wrong sort of answer. pkt.answers_.clear(); pkt.add_answer(new DNSMxRR("example.com", 100, 100, "mx1.example.com")); data = pkt.data(); EXPECT_EQ(ARES_ENODATA, ares_parse_ptr_reply(data.data(), data.size(), addrv4, sizeof(addrv4), AF_INET, &host)); EXPECT_EQ(nullptr, host); pkt.answers_.clear(); pkt.add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "other.com")); // No answer. pkt.answers_.clear(); data = pkt.data(); EXPECT_EQ(ARES_ENODATA, ares_parse_ptr_reply(data.data(), data.size(), addrv4, sizeof(addrv4), AF_INET, &host)); EXPECT_EQ(nullptr, host); pkt.add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "other.com")); // Truncated packets. data = pkt.data(); for (size_t len = 1; len < data.size(); len++) { EXPECT_EQ(ARES_EBADRESP, ares_parse_ptr_reply(data.data(), len, addrv4, sizeof(addrv4), AF_INET, &host)); EXPECT_EQ(nullptr, host); } // Truncated packets with CNAME. pkt.add_answer(new DNSCnameRR("64.48.32.16.in-addr.arpa", 50, "64.48.32.8.in-addr.arpa")); data = pkt.data(); for (size_t len = 1; len < data.size(); len++) { EXPECT_EQ(ARES_EBADRESP, ares_parse_ptr_reply(data.data(), len, addrv4, sizeof(addrv4), AF_INET, &host)); EXPECT_EQ(nullptr, host); } } TEST_F(LibraryTest, ParsePtrReplyAllocFailSome) { byte addrv4[4] = {0x10, 0x20, 0x30, 0x40}; DNSPacket pkt; pkt.set_qid(0x1234).set_response().set_aa() .add_question(new DNSQuestion("64.48.32.16.in-addr.arpa", T_PTR)) .add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "main.com")) .add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "other1.com")) .add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "other2.com")) .add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "other3.com")); std::vector data = pkt.data(); struct hostent *host = nullptr; for (int ii = 1; ii <= 18; ii++) { ClearFails(); SetAllocFail(ii); EXPECT_EQ(ARES_ENOMEM, ares_parse_ptr_reply(data.data(), data.size(), addrv4, sizeof(addrv4), AF_INET, &host)) << ii; } } TEST_F(LibraryTest, ParsePtrReplyAllocFailMany) { byte addrv4[4] = {0x10, 0x20, 0x30, 0x40}; DNSPacket pkt; pkt.set_qid(0x1234).set_response().set_aa() .add_question(new DNSQuestion("64.48.32.16.in-addr.arpa", T_PTR)) .add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "main.com")) .add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "other1.com")) .add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "other2.com")) .add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "other3.com")) .add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "other4.com")) .add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "other5.com")) .add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "other6.com")) .add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "other7.com")) .add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "other8.com")) .add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "other9.com")); std::vector data = pkt.data(); struct hostent *host = nullptr; for (int ii = 1; ii <= 63; ii++) { ClearFails(); SetAllocFail(ii); int rc = ares_parse_ptr_reply(data.data(), data.size(), addrv4, sizeof(addrv4), AF_INET, &host); if (rc != ARES_ENOMEM) { EXPECT_EQ(ARES_SUCCESS, rc); ares_free_hostent(host); host = nullptr; } } } } // namespace test } // namespace ares ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/ares-test-parse-soa-any.cc0000644000175100001770000000743100000000000023757 0ustar00runnerdocker00000000000000#include "ares-test.h" #include "dns-proto.h" #include #include namespace ares { namespace test { TEST_F(LibraryTest, ParseSoaAnyReplyOK) { DNSPacket pkt; pkt.set_qid(0x1234).set_response().set_aa() .add_question(new DNSQuestion("example.com", T_ANY))\ .add_answer(new DNSARR("example.com", 0x01020304, {2,3,4,5})) .add_answer(new DNSMxRR("example.com", 100, 100, "mx1.example.com")) .add_answer(new DNSMxRR("example.com", 100, 200, "mx2.example.com")) .add_answer(new DNSSoaRR("example.com", 100, "soa1.example.com", "fred.example.com", 1, 2, 3, 4, 5)); std::vector data = pkt.data(); struct ares_soa_reply* soa = nullptr; EXPECT_EQ(ARES_SUCCESS, ares_parse_soa_reply(data.data(), data.size(), &soa)); ASSERT_NE(nullptr, soa); EXPECT_EQ("soa1.example.com", std::string(soa->nsname)); EXPECT_EQ("fred.example.com", std::string(soa->hostmaster)); EXPECT_EQ(1, soa->serial); EXPECT_EQ(2, soa->refresh); EXPECT_EQ(3, soa->retry); EXPECT_EQ(4, soa->expire); EXPECT_EQ(5, soa->minttl); ares_free_data(soa); } TEST_F(LibraryTest, ParseSoaAnyReplyErrors) { DNSPacket pkt; pkt.set_qid(0x1234).set_response().set_aa() .add_question(new DNSQuestion("example.com", T_ANY)) .add_answer(new DNSSoaRR("example.com", 100, "soa1.example.com", "fred.example.com", 1, 2, 3, 4, 5)); std::vector data; struct ares_soa_reply* soa = nullptr; // No question. pkt.questions_.clear(); data = pkt.data(); EXPECT_EQ(ARES_EBADRESP, ares_parse_soa_reply(data.data(), data.size(), &soa)); pkt.add_question(new DNSQuestion("example.com", T_ANY)); #ifdef DISABLED // Question != answer pkt.questions_.clear(); pkt.add_question(new DNSQuestion("Axample.com", T_ANY)); data = pkt.data(); EXPECT_EQ(ARES_EBADRESP, ares_parse_soa_reply(data.data(), data.size(), &soa)); pkt.questions_.clear(); pkt.add_question(new DNSQuestion("example.com", T_ANY)); #endif // Two questions pkt.add_question(new DNSQuestion("example.com", T_ANY)); data = pkt.data(); EXPECT_EQ(ARES_EBADRESP, ares_parse_soa_reply(data.data(), data.size(), &soa)); pkt.questions_.clear(); pkt.add_question(new DNSQuestion("example.com", T_ANY)); // Wrong sort of answer. pkt.answers_.clear(); pkt.add_answer(new DNSMxRR("example.com", 100, 100, "mx1.example.com")); data = pkt.data(); EXPECT_EQ(ARES_EBADRESP, ares_parse_soa_reply(data.data(), data.size(), &soa)); pkt.answers_.clear(); pkt.add_answer(new DNSSoaRR("example.com", 100, "soa1.example.com", "fred.example.com", 1, 2, 3, 4, 5)); // No answer. pkt.answers_.clear(); data = pkt.data(); EXPECT_EQ(ARES_EBADRESP, ares_parse_soa_reply(data.data(), data.size(), &soa)); pkt.add_answer(new DNSSoaRR("example.com", 100, "soa1.example.com", "fred.example.com", 1, 2, 3, 4, 5)); // Truncated packets. data = pkt.data(); for (size_t len = 1; len < data.size(); len++) { EXPECT_EQ(ARES_EBADRESP, ares_parse_soa_reply(data.data(), len, &soa)); } } TEST_F(LibraryTest, ParseSoaAnyReplyAllocFail) { DNSPacket pkt; pkt.set_qid(0x1234).set_response().set_aa() .add_question(new DNSQuestion("example.com", T_ANY)) .add_answer(new DNSSoaRR("example.com", 100, "soa1.example.com", "fred.example.com", 1, 2, 3, 4, 5)); std::vector data = pkt.data(); struct ares_soa_reply* soa = nullptr; for (int ii = 1; ii <= 5; ii++) { ClearFails(); SetAllocFail(ii); EXPECT_EQ(ARES_ENOMEM, ares_parse_soa_reply(data.data(), data.size(), &soa)) << ii; } } } // namespace test } // namespace ares ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/ares-test-parse-soa.cc0000644000175100001770000000707300000000000023174 0ustar00runnerdocker00000000000000#include "ares-test.h" #include "dns-proto.h" #include #include namespace ares { namespace test { TEST_F(LibraryTest, ParseSoaReplyOK) { DNSPacket pkt; pkt.set_qid(0x1234).set_response().set_aa() .add_question(new DNSQuestion("example.com", T_SOA)) .add_answer(new DNSSoaRR("example.com", 100, "soa1.example.com", "fred.example.com", 1, 2, 3, 4, 5)); std::vector data = pkt.data(); struct ares_soa_reply* soa = nullptr; EXPECT_EQ(ARES_SUCCESS, ares_parse_soa_reply(data.data(), data.size(), &soa)); ASSERT_NE(nullptr, soa); EXPECT_EQ("soa1.example.com", std::string(soa->nsname)); EXPECT_EQ("fred.example.com", std::string(soa->hostmaster)); EXPECT_EQ(1, soa->serial); EXPECT_EQ(2, soa->refresh); EXPECT_EQ(3, soa->retry); EXPECT_EQ(4, soa->expire); EXPECT_EQ(5, soa->minttl); ares_free_data(soa); } TEST_F(LibraryTest, ParseSoaReplyErrors) { DNSPacket pkt; pkt.set_qid(0x1234).set_response().set_aa() .add_question(new DNSQuestion("example.com", T_SOA)) .add_answer(new DNSSoaRR("example.com", 100, "soa1.example.com", "fred.example.com", 1, 2, 3, 4, 5)); std::vector data; struct ares_soa_reply* soa = nullptr; // No question. pkt.questions_.clear(); data = pkt.data(); EXPECT_EQ(ARES_EBADRESP, ares_parse_soa_reply(data.data(), data.size(), &soa)); pkt.add_question(new DNSQuestion("example.com", T_SOA)); #ifdef DISABLED // Question != answer pkt.questions_.clear(); pkt.add_question(new DNSQuestion("Axample.com", T_SOA)); data = pkt.data(); EXPECT_EQ(ARES_EBADRESP, ares_parse_soa_reply(data.data(), data.size(), &soa)); pkt.questions_.clear(); pkt.add_question(new DNSQuestion("example.com", T_SOA)); #endif // Two questions pkt.add_question(new DNSQuestion("example.com", T_SOA)); data = pkt.data(); EXPECT_EQ(ARES_EBADRESP, ares_parse_soa_reply(data.data(), data.size(), &soa)); pkt.questions_.clear(); pkt.add_question(new DNSQuestion("example.com", T_SOA)); // Wrong sort of answer. pkt.answers_.clear(); pkt.add_answer(new DNSMxRR("example.com", 100, 100, "mx1.example.com")); data = pkt.data(); EXPECT_EQ(ARES_EBADRESP, ares_parse_soa_reply(data.data(), data.size(), &soa)); pkt.answers_.clear(); pkt.add_answer(new DNSSoaRR("example.com", 100, "soa1.example.com", "fred.example.com", 1, 2, 3, 4, 5)); // No answer. pkt.answers_.clear(); data = pkt.data(); EXPECT_EQ(ARES_EBADRESP, ares_parse_soa_reply(data.data(), data.size(), &soa)); pkt.add_answer(new DNSSoaRR("example.com", 100, "soa1.example.com", "fred.example.com", 1, 2, 3, 4, 5)); // Truncated packets. data = pkt.data(); for (size_t len = 1; len < data.size(); len++) { EXPECT_EQ(ARES_EBADRESP, ares_parse_soa_reply(data.data(), len, &soa)); } } TEST_F(LibraryTest, ParseSoaReplyAllocFail) { DNSPacket pkt; pkt.set_qid(0x1234).set_response().set_aa() .add_question(new DNSQuestion("example.com", T_SOA)) .add_answer(new DNSSoaRR("example.com", 100, "soa1.example.com", "fred.example.com", 1, 2, 3, 4, 5)); std::vector data = pkt.data(); struct ares_soa_reply* soa = nullptr; for (int ii = 1; ii <= 5; ii++) { ClearFails(); SetAllocFail(ii); EXPECT_EQ(ARES_ENOMEM, ares_parse_soa_reply(data.data(), data.size(), &soa)) << ii; } } } // namespace test } // namespace ares ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/ares-test-parse-srv.cc0000644000175100001770000002516000000000000023221 0ustar00runnerdocker00000000000000#include "ares-test.h" #include "dns-proto.h" #include #include namespace ares { namespace test { TEST_F(LibraryTest, ParseSrvReplyOK) { DNSPacket pkt; pkt.set_qid(0x1234).set_response().set_aa() .add_question(new DNSQuestion("example.com", T_SRV)) .add_answer(new DNSSrvRR("example.com", 100, 10, 20, 30, "srv.example.com")) .add_answer(new DNSSrvRR("example.com", 100, 11, 21, 31, "srv2.example.com")); std::vector data = pkt.data(); struct ares_srv_reply* srv = nullptr; EXPECT_EQ(ARES_SUCCESS, ares_parse_srv_reply(data.data(), data.size(), &srv)); ASSERT_NE(nullptr, srv); EXPECT_EQ("srv.example.com", std::string(srv->host)); EXPECT_EQ(10, srv->priority); EXPECT_EQ(20, srv->weight); EXPECT_EQ(30, srv->port); struct ares_srv_reply* srv2 = srv->next; ASSERT_NE(nullptr, srv2); EXPECT_EQ("srv2.example.com", std::string(srv2->host)); EXPECT_EQ(11, srv2->priority); EXPECT_EQ(21, srv2->weight); EXPECT_EQ(31, srv2->port); EXPECT_EQ(nullptr, srv2->next); ares_free_data(srv); } TEST_F(LibraryTest, ParseSrvReplySingle) { DNSPacket pkt; pkt.set_qid(0x1234).set_response().set_aa() .add_question(new DNSQuestion("example.abc.def.com", T_SRV)) .add_answer(new DNSSrvRR("example.abc.def.com", 180, 0, 10, 8160, "example.abc.def.com")) .add_auth(new DNSNsRR("abc.def.com", 44, "else1.where.com")) .add_auth(new DNSNsRR("abc.def.com", 44, "else2.where.com")) .add_auth(new DNSNsRR("abc.def.com", 44, "else3.where.com")) .add_auth(new DNSNsRR("abc.def.com", 44, "else4.where.com")) .add_auth(new DNSNsRR("abc.def.com", 44, "else5.where.com")) .add_additional(new DNSARR("else2.where.com", 42, {172,19,0,1})) .add_additional(new DNSARR("else5.where.com", 42, {172,19,0,2})); std::vector data = pkt.data(); struct ares_srv_reply* srv = nullptr; EXPECT_EQ(ARES_SUCCESS, ares_parse_srv_reply(data.data(), data.size(), &srv)); ASSERT_NE(nullptr, srv); EXPECT_EQ("example.abc.def.com", std::string(srv->host)); EXPECT_EQ(0, srv->priority); EXPECT_EQ(10, srv->weight); EXPECT_EQ(8160, srv->port); EXPECT_EQ(nullptr, srv->next); ares_free_data(srv); } TEST_F(LibraryTest, ParseSrvReplyMalformed) { std::vector data = { 0x12, 0x34, // qid 0x84, // response + query + AA + not-TC + not-RD 0x00, // not-RA + not-Z + not-AD + not-CD + rc=NoError 0x00, 0x01, // num questions 0x00, 0x01, // num answer RRs 0x00, 0x00, // num authority RRs 0x00, 0x00, // num additional RRs // Question 0x07, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 0x03, 'c', 'o', 'm', 0x00, 0x00, 0x21, // type SRV 0x00, 0x01, // class IN // Answer 1 0x07, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 0x03, 'c', 'o', 'm', 0x00, 0x00, 0x21, // RR type 0x00, 0x01, // class IN 0x01, 0x02, 0x03, 0x04, // TTL 0x00, 0x04, // rdata length -- too short 0x02, 0x03, 0x04, 0x05, }; struct ares_srv_reply* srv = nullptr; EXPECT_EQ(ARES_EBADRESP, ares_parse_srv_reply(data.data(), data.size(), &srv)); ASSERT_EQ(nullptr, srv); } TEST_F(LibraryTest, ParseSrvReplyMultiple) { DNSPacket pkt; pkt.set_qid(0x1234).set_response().set_ra().set_rd() .add_question(new DNSQuestion("srv.example.com", T_SRV)) .add_answer(new DNSSrvRR("srv.example.com", 300, 0, 5, 6789, "a1.srv.example.com")) .add_answer(new DNSSrvRR("srv.example.com", 300, 0, 5, 4567, "a2.srv.example.com")) .add_answer(new DNSSrvRR("srv.example.com", 300, 0, 5, 5678, "a3.srv.example.com")) .add_auth(new DNSNsRR("example.com", 300, "ns1.example.com")) .add_auth(new DNSNsRR("example.com", 300, "ns2.example.com")) .add_auth(new DNSNsRR("example.com", 300, "ns3.example.com")) .add_additional(new DNSARR("a1.srv.example.com", 300, {172,19,1,1})) .add_additional(new DNSARR("a2.srv.example.com", 300, {172,19,1,2})) .add_additional(new DNSARR("a3.srv.example.com", 300, {172,19,1,3})) .add_additional(new DNSARR("n1.example.com", 300, {172,19,0,1})) .add_additional(new DNSARR("n2.example.com", 300, {172,19,0,2})) .add_additional(new DNSARR("n3.example.com", 300, {172,19,0,3})); std::vector data = pkt.data(); struct ares_srv_reply* srv0 = nullptr; EXPECT_EQ(ARES_SUCCESS, ares_parse_srv_reply(data.data(), data.size(), &srv0)); ASSERT_NE(nullptr, srv0); struct ares_srv_reply* srv = srv0; EXPECT_EQ("a1.srv.example.com", std::string(srv->host)); EXPECT_EQ(0, srv->priority); EXPECT_EQ(5, srv->weight); EXPECT_EQ(6789, srv->port); EXPECT_NE(nullptr, srv->next); srv = srv->next; EXPECT_EQ("a2.srv.example.com", std::string(srv->host)); EXPECT_EQ(0, srv->priority); EXPECT_EQ(5, srv->weight); EXPECT_EQ(4567, srv->port); EXPECT_NE(nullptr, srv->next); srv = srv->next; EXPECT_EQ("a3.srv.example.com", std::string(srv->host)); EXPECT_EQ(0, srv->priority); EXPECT_EQ(5, srv->weight); EXPECT_EQ(5678, srv->port); EXPECT_EQ(nullptr, srv->next); ares_free_data(srv0); } TEST_F(LibraryTest, ParseSrvReplyCname) { DNSPacket pkt; pkt.set_qid(0x1234).set_response().set_aa() .add_question(new DNSQuestion("example.abc.def.com", T_SRV)) .add_answer(new DNSCnameRR("example.abc.def.com", 300, "cname.abc.def.com")) .add_answer(new DNSSrvRR("cname.abc.def.com", 300, 0, 10, 1234, "srv.abc.def.com")) .add_auth(new DNSNsRR("abc.def.com", 44, "else1.where.com")) .add_auth(new DNSNsRR("abc.def.com", 44, "else2.where.com")) .add_auth(new DNSNsRR("abc.def.com", 44, "else3.where.com")) .add_additional(new DNSARR("example.abc.def.com", 300, {172,19,0,1})) .add_additional(new DNSARR("else1.where.com", 42, {172,19,0,1})) .add_additional(new DNSARR("else2.where.com", 42, {172,19,0,2})) .add_additional(new DNSARR("else3.where.com", 42, {172,19,0,3})); std::vector data = pkt.data(); struct ares_srv_reply* srv = nullptr; EXPECT_EQ(ARES_SUCCESS, ares_parse_srv_reply(data.data(), data.size(), &srv)); ASSERT_NE(nullptr, srv); EXPECT_EQ("srv.abc.def.com", std::string(srv->host)); EXPECT_EQ(0, srv->priority); EXPECT_EQ(10, srv->weight); EXPECT_EQ(1234, srv->port); EXPECT_EQ(nullptr, srv->next); ares_free_data(srv); } TEST_F(LibraryTest, ParseSrvReplyCnameMultiple) { DNSPacket pkt; pkt.set_qid(0x1234).set_response().set_ra().set_rd() .add_question(new DNSQuestion("query.example.com", T_SRV)) .add_answer(new DNSCnameRR("query.example.com", 300, "srv.example.com")) .add_answer(new DNSSrvRR("srv.example.com", 300, 0, 5, 6789, "a1.srv.example.com")) .add_answer(new DNSSrvRR("srv.example.com", 300, 0, 5, 4567, "a2.srv.example.com")) .add_answer(new DNSSrvRR("srv.example.com", 300, 0, 5, 5678, "a3.srv.example.com")) .add_auth(new DNSNsRR("example.com", 300, "ns1.example.com")) .add_auth(new DNSNsRR("example.com", 300, "ns2.example.com")) .add_auth(new DNSNsRR("example.com", 300, "ns3.example.com")) .add_additional(new DNSARR("a1.srv.example.com", 300, {172,19,1,1})) .add_additional(new DNSARR("a2.srv.example.com", 300, {172,19,1,2})) .add_additional(new DNSARR("a3.srv.example.com", 300, {172,19,1,3})) .add_additional(new DNSARR("n1.example.com", 300, {172,19,0,1})) .add_additional(new DNSARR("n2.example.com", 300, {172,19,0,2})) .add_additional(new DNSARR("n3.example.com", 300, {172,19,0,3})); std::vector data = pkt.data(); struct ares_srv_reply* srv0 = nullptr; EXPECT_EQ(ARES_SUCCESS, ares_parse_srv_reply(data.data(), data.size(), &srv0)); ASSERT_NE(nullptr, srv0); struct ares_srv_reply* srv = srv0; EXPECT_EQ("a1.srv.example.com", std::string(srv->host)); EXPECT_EQ(0, srv->priority); EXPECT_EQ(5, srv->weight); EXPECT_EQ(6789, srv->port); EXPECT_NE(nullptr, srv->next); srv = srv->next; EXPECT_EQ("a2.srv.example.com", std::string(srv->host)); EXPECT_EQ(0, srv->priority); EXPECT_EQ(5, srv->weight); EXPECT_EQ(4567, srv->port); EXPECT_NE(nullptr, srv->next); srv = srv->next; EXPECT_EQ("a3.srv.example.com", std::string(srv->host)); EXPECT_EQ(0, srv->priority); EXPECT_EQ(5, srv->weight); EXPECT_EQ(5678, srv->port); EXPECT_EQ(nullptr, srv->next); ares_free_data(srv0); } TEST_F(LibraryTest, ParseSrvReplyErrors) { DNSPacket pkt; pkt.set_qid(0x1234).set_response().set_aa() .add_question(new DNSQuestion("example.abc.def.com", T_SRV)) .add_answer(new DNSSrvRR("example.abc.def.com", 180, 0, 10, 8160, "example.abc.def.com")); std::vector data; struct ares_srv_reply* srv = nullptr; // No question. pkt.questions_.clear(); data = pkt.data(); EXPECT_EQ(ARES_EBADRESP, ares_parse_srv_reply(data.data(), data.size(), &srv)); pkt.add_question(new DNSQuestion("example.abc.def.com", T_SRV)); #ifdef DISABLED // Question != answer pkt.questions_.clear(); pkt.add_question(new DNSQuestion("Axample.com", T_SRV)); data = pkt.data(); EXPECT_EQ(ARES_ENODATA, ares_parse_srv_reply(data.data(), data.size(), &srv)); pkt.questions_.clear(); pkt.add_question(new DNSQuestion("example.com", T_SRV)); #endif // Two questions. pkt.add_question(new DNSQuestion("example.abc.def.com", T_SRV)); data = pkt.data(); EXPECT_EQ(ARES_EBADRESP, ares_parse_srv_reply(data.data(), data.size(), &srv)); pkt.questions_.clear(); pkt.add_question(new DNSQuestion("64.48.32.16.in-addr.arpa", T_PTR)); // Wrong sort of answer. pkt.answers_.clear(); pkt.add_answer(new DNSMxRR("example.com", 100, 100, "mx1.example.com")); data = pkt.data(); EXPECT_EQ(ARES_SUCCESS, ares_parse_srv_reply(data.data(), data.size(), &srv)); EXPECT_EQ(nullptr, srv); pkt.answers_.clear(); pkt.add_answer(new DNSSrvRR("example.abc.def.com", 180, 0, 10, 8160, "example.abc.def.com")); // No answer. pkt.answers_.clear(); data = pkt.data(); EXPECT_EQ(ARES_ENODATA, ares_parse_srv_reply(data.data(), data.size(), &srv)); pkt.add_answer(new DNSSrvRR("example.abc.def.com", 180, 0, 10, 8160, "example.abc.def.com")); // Truncated packets. data = pkt.data(); for (size_t len = 1; len < data.size(); len++) { int rc = ares_parse_srv_reply(data.data(), len, &srv); EXPECT_TRUE(rc == ARES_EBADRESP || rc == ARES_EBADNAME); } } TEST_F(LibraryTest, ParseSrvReplyAllocFail) { DNSPacket pkt; pkt.set_qid(0x1234).set_response().set_aa() .add_question(new DNSQuestion("example.abc.def.com", T_SRV)) .add_answer(new DNSCnameRR("example.com", 300, "c.example.com")) .add_answer(new DNSSrvRR("example.abc.def.com", 180, 0, 10, 8160, "example.abc.def.com")); std::vector data = pkt.data(); struct ares_srv_reply* srv = nullptr; for (int ii = 1; ii <= 5; ii++) { ClearFails(); SetAllocFail(ii); EXPECT_EQ(ARES_ENOMEM, ares_parse_srv_reply(data.data(), data.size(), &srv)) << ii; } } } // namespace test } // namespace ares ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/ares-test-parse-txt.cc0000644000175100001770000002125200000000000023224 0ustar00runnerdocker00000000000000#include "ares-test.h" #include "dns-proto.h" #include #include namespace ares { namespace test { TEST_F(LibraryTest, ParseTxtReplyOK) { DNSPacket pkt; std::string expected1 = "txt1.example.com"; std::string expected2a = "txt2a"; std::string expected2b("ABC\0ABC", 7); pkt.set_qid(0x1234).set_response().set_aa() .add_question(new DNSQuestion("example.com", T_MX)) .add_answer(new DNSTxtRR("example.com", 100, {expected1})) .add_answer(new DNSTxtRR("example.com", 100, {expected2a, expected2b})); std::vector data = pkt.data(); struct ares_txt_reply* txt = nullptr; EXPECT_EQ(ARES_SUCCESS, ares_parse_txt_reply(data.data(), data.size(), &txt)); ASSERT_NE(nullptr, txt); EXPECT_EQ(std::vector(expected1.data(), expected1.data() + expected1.size()), std::vector(txt->txt, txt->txt + txt->length)); struct ares_txt_reply* txt2 = txt->next; ASSERT_NE(nullptr, txt2); EXPECT_EQ(std::vector(expected2a.data(), expected2a.data() + expected2a.size()), std::vector(txt2->txt, txt2->txt + txt2->length)); struct ares_txt_reply* txt3 = txt2->next; ASSERT_NE(nullptr, txt3); EXPECT_EQ(std::vector(expected2b.data(), expected2b.data() + expected2b.size()), std::vector(txt3->txt, txt3->txt + txt3->length)); EXPECT_EQ(nullptr, txt3->next); ares_free_data(txt); } TEST_F(LibraryTest, ParseTxtExtReplyOK) { DNSPacket pkt; std::string expected1 = "txt1.example.com"; std::string expected2a = "txt2a"; std::string expected2b("ABC\0ABC", 7); pkt.set_qid(0x1234).set_response().set_aa() .add_question(new DNSQuestion("example.com", T_MX)) .add_answer(new DNSTxtRR("example.com", 100, {expected1})) .add_answer(new DNSTxtRR("example.com", 100, {expected2a, expected2b})); std::vector data = pkt.data(); struct ares_txt_ext* txt = nullptr; EXPECT_EQ(ARES_SUCCESS, ares_parse_txt_reply_ext(data.data(), data.size(), &txt)); ASSERT_NE(nullptr, txt); EXPECT_EQ(std::vector(expected1.data(), expected1.data() + expected1.size()), std::vector(txt->txt, txt->txt + txt->length)); EXPECT_EQ(1, txt->record_start); struct ares_txt_ext* txt2 = txt->next; ASSERT_NE(nullptr, txt2); EXPECT_EQ(std::vector(expected2a.data(), expected2a.data() + expected2a.size()), std::vector(txt2->txt, txt2->txt + txt2->length)); EXPECT_EQ(1, txt2->record_start); struct ares_txt_ext* txt3 = txt2->next; ASSERT_NE(nullptr, txt3); EXPECT_EQ(std::vector(expected2b.data(), expected2b.data() + expected2b.size()), std::vector(txt3->txt, txt3->txt + txt3->length)); EXPECT_EQ(nullptr, txt3->next); EXPECT_EQ(0, txt3->record_start); ares_free_data(txt); } TEST_F(LibraryTest, ParseTxtMalformedReply1) { std::vector data = { 0x12, 0x34, // qid 0x84, // response + query + AA + not-TC + not-RD 0x00, // not-RA + not-Z + not-AD + not-CD + rc=NoError 0x00, 0x01, // num questions 0x00, 0x01, // num answer RRs 0x00, 0x00, // num authority RRs 0x00, 0x00, // num additional RRs // Question 0x07, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 0x03, 'c', 'o', 'm', 0x00, 0x00, 0x10, // type TXT 0x00, 0x01, // class IN // Answer 1 0x07, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 0x03, 'c', 'o', 'm', 0x00, 0x00, 0x10, // RR type 0x00, 0x01, // class IN 0x01, 0x02, 0x03, 0x04, // TTL 0x00, 0x03, // rdata length 0x12, 'a', 'b', // invalid length }; struct ares_txt_reply* txt = nullptr; EXPECT_EQ(ARES_EBADRESP, ares_parse_txt_reply(data.data(), data.size(), &txt)); ASSERT_EQ(nullptr, txt); } TEST_F(LibraryTest, ParseTxtMalformedReply2) { std::vector data = { 0x12, 0x34, // qid 0x84, // response + query + AA + not-TC + not-RD 0x00, // not-RA + not-Z + not-AD + not-CD + rc=NoError 0x00, 0x01, // num questions 0x00, 0x01, // num answer RRs 0x00, 0x00, // num authority RRs 0x00, 0x00, // num additional RRs // Question 0x07, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 0x03, 'c', 'o', 'm', 0x00, 0x00, 0x10, // type TXT 0x00, 0x01, // class IN // Answer 1 0x07, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 0x03, 'c', 'o', 'm', 0x00, 0x00, 0x10, // RR type // truncated }; struct ares_txt_reply* txt = nullptr; EXPECT_EQ(ARES_EBADRESP, ares_parse_txt_reply(data.data(), data.size(), &txt)); ASSERT_EQ(nullptr, txt); } TEST_F(LibraryTest, ParseTxtMalformedReply3) { std::vector data = { 0x12, 0x34, // qid 0x84, // response + query + AA + not-TC + not-RD 0x00, // not-RA + not-Z + not-AD + not-CD + rc=NoError 0x00, 0x01, // num questions 0x00, 0x01, // num answer RRs 0x00, 0x00, // num authority RRs 0x00, 0x00, // num additional RRs // Question 0x07, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 0x03, 'c', 'o', 'm', 0x00, 0x00, 0x10, // type TXT 0x00, 0x01, // class IN // Answer 1 0x07, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 0x03, 'c', 'o', 'm', 0x00, 0x00, 0x10, // RR type 0x00, 0x01, // class IN 0x01, 0x02, 0x03, 0x04, // TTL 0x00, 0x13, // rdata length INVALID 0x02, 'a', 'b', }; struct ares_txt_reply* txt = nullptr; EXPECT_EQ(ARES_EBADRESP, ares_parse_txt_reply(data.data(), data.size(), &txt)); ASSERT_EQ(nullptr, txt); } TEST_F(LibraryTest, ParseTxtMalformedReply4) { std::vector data = { 0x12, 0x34, // qid 0x84, // response + query + AA + not-TC + not-RD 0x00, // not-RA + not-Z + not-AD + not-CD + rc=NoError 0x00, 0x01, // num questions 0x00, 0x01, // num answer RRs 0x00, 0x00, // num authority RRs 0x00, 0x00, // num additional RRs // Question 0x07, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 0x03, 'c', 'o', 'm', 0x00, 0x00, 0x10, // type TXT 0x00, // TRUNCATED }; struct ares_txt_reply* txt = nullptr; EXPECT_EQ(ARES_EBADRESP, ares_parse_txt_reply(data.data(), data.size(), &txt)); ASSERT_EQ(nullptr, txt); } TEST_F(LibraryTest, ParseTxtReplyErrors) { DNSPacket pkt; std::string expected1 = "txt1.example.com"; std::string expected2a = "txt2a"; std::string expected2b = "txt2b"; pkt.set_qid(0x1234).set_response().set_aa() .add_question(new DNSQuestion("example.com", T_MX)) .add_answer(new DNSTxtRR("example.com", 100, {expected1})) .add_answer(new DNSTxtRR("example.com", 100, {expected1})) .add_answer(new DNSTxtRR("example.com", 100, {expected2a, expected2b})); std::vector data = pkt.data(); struct ares_txt_reply* txt = nullptr; // No question. pkt.questions_.clear(); data = pkt.data(); txt = nullptr; EXPECT_EQ(ARES_EBADRESP, ares_parse_txt_reply(data.data(), data.size(), &txt)); EXPECT_EQ(nullptr, txt); pkt.add_question(new DNSQuestion("example.com", T_MX)); #ifdef DISABLED // Question != answer pkt.questions_.clear(); pkt.add_question(new DNSQuestion("Axample.com", T_TXT)); data = pkt.data(); EXPECT_EQ(ARES_ENODATA, ares_parse_txt_reply(data.data(), data.size(), &txt)); pkt.questions_.clear(); pkt.add_question(new DNSQuestion("example.com", T_TXT)); #endif // Two questions. pkt.add_question(new DNSQuestion("example.com", T_MX)); data = pkt.data(); txt = nullptr; EXPECT_EQ(ARES_EBADRESP, ares_parse_txt_reply(data.data(), data.size(), &txt)); EXPECT_EQ(nullptr, txt); pkt.questions_.clear(); pkt.add_question(new DNSQuestion("example.com", T_MX)); // No answer. pkt.answers_.clear(); data = pkt.data(); txt = nullptr; EXPECT_EQ(ARES_ENODATA, ares_parse_txt_reply(data.data(), data.size(), &txt)); EXPECT_EQ(nullptr, txt); pkt.add_answer(new DNSTxtRR("example.com", 100, {expected1})); // Truncated packets. for (size_t len = 1; len < data.size(); len++) { txt = nullptr; EXPECT_NE(ARES_SUCCESS, ares_parse_txt_reply(data.data(), len, &txt)); EXPECT_EQ(nullptr, txt); } } TEST_F(LibraryTest, ParseTxtReplyAllocFail) { DNSPacket pkt; std::string expected1 = "txt1.example.com"; std::string expected2a = "txt2a"; std::string expected2b = "txt2b"; pkt.set_qid(0x1234).set_response().set_aa() .add_question(new DNSQuestion("example.com", T_MX)) .add_answer(new DNSCnameRR("example.com", 300, "c.example.com")) .add_answer(new DNSTxtRR("c.example.com", 100, {expected1})) .add_answer(new DNSTxtRR("c.example.com", 100, {expected1})) .add_answer(new DNSTxtRR("c.example.com", 100, {expected2a, expected2b})); std::vector data = pkt.data(); struct ares_txt_reply* txt = nullptr; for (int ii = 1; ii <= 13; ii++) { ClearFails(); SetAllocFail(ii); EXPECT_EQ(ARES_ENOMEM, ares_parse_txt_reply(data.data(), data.size(), &txt)) << ii; } } } // namespace test } // namespace ares ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/ares-test-parse-uri.cc0000644000175100001770000002500600000000000023205 0ustar00runnerdocker00000000000000#include "ares-test.h" #include "dns-proto.h" #include #include namespace ares { namespace test { TEST_F(LibraryTest, ParseUriReplyOK) { DNSPacket pkt; pkt.set_qid(0x1234).set_response().set_aa() .add_question(new DNSQuestion("example.com", T_URI)) .add_answer(new DNSUriRR("example.com", 100, 10, 20, "uri.example.com")) .add_answer(new DNSUriRR("example.com", 200, 11, 21, "uri2.example.com")); std::vector data = pkt.data(); struct ares_uri_reply* uri = nullptr; EXPECT_EQ(ARES_SUCCESS, ares_parse_uri_reply(data.data(), data.size(), &uri)); ASSERT_NE(nullptr, uri); EXPECT_EQ("uri.example.com", std::string(uri->uri)); EXPECT_EQ(10, uri->priority); EXPECT_EQ(20, uri->weight); EXPECT_EQ(100, uri->ttl); struct ares_uri_reply* uri2 = uri->next; ASSERT_NE(nullptr, uri2); EXPECT_EQ("uri2.example.com", std::string(uri2->uri)); EXPECT_EQ(11, uri2->priority); EXPECT_EQ(21, uri2->weight); EXPECT_EQ(200, uri2->ttl); EXPECT_EQ(nullptr, uri2->next); ares_free_data(uri); } TEST_F(LibraryTest, ParseUriReplySingle) { DNSPacket pkt; pkt.set_qid(0x1234).set_response().set_aa() .add_question(new DNSQuestion("example.abc.def.com", T_URI)) .add_answer(new DNSUriRR("example.abc.def.com", 180, 0, 10, "example.abc.def.com")) .add_auth(new DNSNsRR("abc.def.com", 44, "else1.where.com")) .add_auth(new DNSNsRR("abc.def.com", 44, "else2.where.com")) .add_auth(new DNSNsRR("abc.def.com", 44, "else3.where.com")) .add_auth(new DNSNsRR("abc.def.com", 44, "else4.where.com")) .add_auth(new DNSNsRR("abc.def.com", 44, "else5.where.com")) .add_additional(new DNSARR("else2.where.com", 42, {172,19,0,1})) .add_additional(new DNSARR("else5.where.com", 42, {172,19,0,2})); std::vector data = pkt.data(); struct ares_uri_reply* uri = nullptr; EXPECT_EQ(ARES_SUCCESS, ares_parse_uri_reply(data.data(), data.size(), &uri)); ASSERT_NE(nullptr, uri); EXPECT_EQ("example.abc.def.com", std::string(uri->uri)); EXPECT_EQ(0, uri->priority); EXPECT_EQ(10, uri->weight); EXPECT_EQ(180, uri->ttl); EXPECT_EQ(nullptr, uri->next); ares_free_data(uri); } TEST_F(LibraryTest, ParseUriReplyMalformed) { std::vector data = { 0x12, 0x34, // qid 0x84, // response + query + AA + not-TC + not-RD 0x00, // not-RA + not-Z + not-AD + not-CD + rc=NoError 0x00, 0x01, // num questions 0x00, 0x01, // num answer RRs 0x00, 0x00, // num authority RRs 0x00, 0x00, // num additional RRs // Question 0x07, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 0x03, 'c', 'o', 'm', 0x00, 0x01, 0x00, // type URI 0x00, 0x01, // class IN // Answer 1 0x07, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 0x03, 'c', 'o', 'm', 0x00, 0x01, 0x00, // RR type 0x00, 0x01, // class IN 0x01, 0x02, 0x03, 0x04, // TTL 0x00, 0x04, // rdata length -- too short 0x02, 0x03, 0x04, 0x05, }; struct ares_uri_reply* uri = nullptr; EXPECT_EQ(ARES_EBADRESP, ares_parse_uri_reply(data.data(), data.size(), &uri)); ASSERT_EQ(nullptr, uri); } TEST_F(LibraryTest, ParseUriReplyMultiple) { DNSPacket pkt; pkt.set_qid(0x1234).set_response().set_ra().set_rd() .add_question(new DNSQuestion("uri.example.com", T_URI)) .add_answer(new DNSUriRR("uri.example.com", 600, 0, 5, "a1.uri.example.com")) .add_answer(new DNSUriRR("uri.example.com", 660, 0, 5, "a2.uri.example.com")) .add_answer(new DNSUriRR("uri.example.com", 720, 0, 5, "a3.uri.example.com")) .add_auth(new DNSNsRR("example.com", 300, "ns1.example.com")) .add_auth(new DNSNsRR("example.com", 300, "ns2.example.com")) .add_auth(new DNSNsRR("example.com", 300, "ns3.example.com")) .add_additional(new DNSARR("a1.uri.example.com", 300, {172,19,1,1})) .add_additional(new DNSARR("a2.uri.example.com", 300, {172,19,1,2})) .add_additional(new DNSARR("a3.uri.example.com", 300, {172,19,1,3})) .add_additional(new DNSARR("n1.example.com", 300, {172,19,0,1})) .add_additional(new DNSARR("n2.example.com", 300, {172,19,0,2})) .add_additional(new DNSARR("n3.example.com", 300, {172,19,0,3})); std::vector data = pkt.data(); struct ares_uri_reply* uri0 = nullptr; EXPECT_EQ(ARES_SUCCESS, ares_parse_uri_reply(data.data(), data.size(), &uri0)); ASSERT_NE(nullptr, uri0); struct ares_uri_reply* uri = uri0; EXPECT_EQ("a1.uri.example.com", std::string(uri->uri)); EXPECT_EQ(0, uri->priority); EXPECT_EQ(5, uri->weight); EXPECT_EQ(600, uri->ttl); EXPECT_NE(nullptr, uri->next); uri = uri->next; EXPECT_EQ("a2.uri.example.com", std::string(uri->uri)); EXPECT_EQ(0, uri->priority); EXPECT_EQ(5, uri->weight); EXPECT_EQ(660, uri->ttl); EXPECT_NE(nullptr, uri->next); uri = uri->next; EXPECT_EQ("a3.uri.example.com", std::string(uri->uri)); EXPECT_EQ(0, uri->priority); EXPECT_EQ(5, uri->weight); EXPECT_EQ(720, uri->ttl); EXPECT_EQ(nullptr, uri->next); ares_free_data(uri0); } TEST_F(LibraryTest, ParseUriReplyCname) { DNSPacket pkt; pkt.set_qid(0x1234).set_response().set_aa() .add_question(new DNSQuestion("example.abc.def.com", T_URI)) .add_answer(new DNSCnameRR("example.abc.def.com", 300, "cname.abc.def.com")) .add_answer(new DNSUriRR("cname.abc.def.com", 600, 0, 10, "uri.abc.def.com")) .add_auth(new DNSNsRR("abc.def.com", 44, "else1.where.com")) .add_auth(new DNSNsRR("abc.def.com", 44, "else2.where.com")) .add_auth(new DNSNsRR("abc.def.com", 44, "else3.where.com")) .add_additional(new DNSARR("example.abc.def.com", 300, {172,19,0,1})) .add_additional(new DNSARR("else1.where.com", 42, {172,19,0,1})) .add_additional(new DNSARR("else2.where.com", 42, {172,19,0,2})) .add_additional(new DNSARR("else3.where.com", 42, {172,19,0,3})); std::vector data = pkt.data(); struct ares_uri_reply* uri = nullptr; EXPECT_EQ(ARES_SUCCESS, ares_parse_uri_reply(data.data(), data.size(), &uri)); ASSERT_NE(nullptr, uri); EXPECT_EQ("uri.abc.def.com", std::string(uri->uri)); EXPECT_EQ(0, uri->priority); EXPECT_EQ(10, uri->weight); EXPECT_EQ(600, uri->ttl); EXPECT_EQ(nullptr, uri->next); ares_free_data(uri); } TEST_F(LibraryTest, ParseUriReplyCnameMultiple) { DNSPacket pkt; pkt.set_qid(0x1234).set_response().set_ra().set_rd() .add_question(new DNSQuestion("query.example.com", T_URI)) .add_answer(new DNSCnameRR("query.example.com", 300, "uri.example.com")) .add_answer(new DNSUriRR("uri.example.com", 600, 0, 5, "a1.uri.example.com")) .add_answer(new DNSUriRR("uri.example.com", 660, 0, 5, "a2.uri.example.com")) .add_answer(new DNSUriRR("uri.example.com", 720, 0, 5, "a3.uri.example.com")) .add_auth(new DNSNsRR("example.com", 300, "ns1.example.com")) .add_auth(new DNSNsRR("example.com", 300, "ns2.example.com")) .add_auth(new DNSNsRR("example.com", 300, "ns3.example.com")) .add_additional(new DNSARR("a1.uri.example.com", 300, {172,19,1,1})) .add_additional(new DNSARR("a2.uri.example.com", 300, {172,19,1,2})) .add_additional(new DNSARR("a3.uri.example.com", 300, {172,19,1,3})) .add_additional(new DNSARR("n1.example.com", 300, {172,19,0,1})) .add_additional(new DNSARR("n2.example.com", 300, {172,19,0,2})) .add_additional(new DNSARR("n3.example.com", 300, {172,19,0,3})); std::vector data = pkt.data(); struct ares_uri_reply* uri0 = nullptr; EXPECT_EQ(ARES_SUCCESS, ares_parse_uri_reply(data.data(), data.size(), &uri0)); ASSERT_NE(nullptr, uri0); struct ares_uri_reply* uri = uri0; EXPECT_EQ("a1.uri.example.com", std::string(uri->uri)); EXPECT_EQ(0, uri->priority); EXPECT_EQ(5, uri->weight); EXPECT_EQ(600, uri->ttl); EXPECT_NE(nullptr, uri->next); uri = uri->next; EXPECT_EQ("a2.uri.example.com", std::string(uri->uri)); EXPECT_EQ(0, uri->priority); EXPECT_EQ(5, uri->weight); EXPECT_EQ(660, uri->ttl); EXPECT_NE(nullptr, uri->next); uri = uri->next; EXPECT_EQ("a3.uri.example.com", std::string(uri->uri)); EXPECT_EQ(0, uri->priority); EXPECT_EQ(5, uri->weight); EXPECT_EQ(720, uri->ttl); EXPECT_EQ(nullptr, uri->next); ares_free_data(uri0); } TEST_F(LibraryTest, ParseUriReplyErrors) { DNSPacket pkt; pkt.set_qid(0x1234).set_response().set_aa() .add_question(new DNSQuestion("example.abc.def.com", T_URI)) .add_answer(new DNSUriRR("example.abc.def.com", 180, 0, 10, "example.abc.def.com")); std::vector data; struct ares_uri_reply* uri = nullptr; // No question. pkt.questions_.clear(); data = pkt.data(); EXPECT_EQ(ARES_EBADRESP, ares_parse_uri_reply(data.data(), data.size(), &uri)); pkt.add_question(new DNSQuestion("example.abc.def.com", T_URI)); #ifdef DISABLED // Question != answer pkt.questions_.clear(); pkt.add_question(new DNSQuestion("Axample.com", T_URI)); data = pkt.data(); EXPECT_EQ(ARES_ENODATA, ares_parse_uri_reply(data.data(), data.size(), &uri)); pkt.questions_.clear(); pkt.add_question(new DNSQuestion("example.com", T_URI)); #endif // Two questions. pkt.add_question(new DNSQuestion("example.abc.def.com", T_URI)); data = pkt.data(); EXPECT_EQ(ARES_EBADRESP, ares_parse_uri_reply(data.data(), data.size(), &uri)); pkt.questions_.clear(); pkt.add_question(new DNSQuestion("64.48.32.16.in-addr.arpa", T_PTR)); // Wrong sort of answer. pkt.answers_.clear(); pkt.add_answer(new DNSMxRR("example.com", 100, 100, "mx1.example.com")); data = pkt.data(); EXPECT_EQ(ARES_SUCCESS, ares_parse_uri_reply(data.data(), data.size(), &uri)); EXPECT_EQ(nullptr, uri); pkt.answers_.clear(); pkt.add_answer(new DNSUriRR("example.abc.def.com", 180, 0, 10, "example.abc.def.com")); // No answer. pkt.answers_.clear(); data = pkt.data(); EXPECT_EQ(ARES_ENODATA, ares_parse_uri_reply(data.data(), data.size(), &uri)); pkt.add_answer(new DNSUriRR("example.abc.def.com", 180, 0, 10, "example.abc.def.com")); // Truncated packets. data = pkt.data(); for (size_t len = 1; len < data.size(); len++) { int rc = ares_parse_uri_reply(data.data(), len, &uri); EXPECT_TRUE(rc == ARES_EBADRESP || rc == ARES_EBADNAME); } } TEST_F(LibraryTest, ParseUriReplyAllocFail) { DNSPacket pkt; pkt.set_qid(0x1234).set_response().set_aa() .add_question(new DNSQuestion("example.abc.def.com", T_URI)) .add_answer(new DNSCnameRR("example.com", 300, "c.example.com")) .add_answer(new DNSUriRR("example.abc.def.com", 180, 0, 10, "example.abc.def.com")); std::vector data = pkt.data(); struct ares_uri_reply* uri = nullptr; for (int ii = 1; ii <= 5; ii++) { ClearFails(); SetAllocFail(ii); EXPECT_EQ(ARES_ENOMEM, ares_parse_uri_reply(data.data(), data.size(), &uri)) << ii; } } } // namespace test } // namespace ares ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/ares-test-parse.cc0000644000175100001770000001524000000000000022407 0ustar00runnerdocker00000000000000#include "ares-test.h" #include "dns-proto.h" #include #include namespace ares { namespace test { TEST_F(LibraryTest, ParseRootName) { DNSPacket pkt; pkt.set_qid(0x1234).set_response().set_aa() .add_question(new DNSQuestion(".", T_A)) .add_answer(new DNSARR(".", 100, {0x02, 0x03, 0x04, 0x05})); std::vector data = pkt.data(); struct hostent *host = nullptr; struct ares_addrttl info[2]; int count = 2; EXPECT_EQ(ARES_SUCCESS, ares_parse_a_reply(data.data(), data.size(), &host, info, &count)); EXPECT_EQ(1, count); std::stringstream ss; ss << HostEnt(host); EXPECT_EQ("{'' aliases=[] addrs=[2.3.4.5]}", ss.str()); ares_free_hostent(host); } TEST_F(LibraryTest, ParseIndirectRootName) { std::vector data = { 0x12, 0x34, // qid 0x84, // response + query + AA + not-TC + not-RD 0x00, // not-RA + not-Z + not-AD + not-CD + rc=NoError 0x00, 0x01, // num questions 0x00, 0x01, // num answer RRs 0x00, 0x00, // num authority RRs 0x00, 0x00, // num additional RRs // Question 0xC0, 0x04, // weird: pointer to a random zero earlier in the message 0x00, 0x01, // type A 0x00, 0x01, // class IN // Answer 1 0xC0, 0x04, 0x00, 0x01, // RR type 0x00, 0x01, // class IN 0x01, 0x02, 0x03, 0x04, // TTL 0x00, 0x04, // rdata length 0x02, 0x03, 0x04, 0x05, }; struct hostent *host = nullptr; struct ares_addrttl info[2]; int count = 2; EXPECT_EQ(ARES_SUCCESS, ares_parse_a_reply(data.data(), data.size(), &host, info, &count)); EXPECT_EQ(1, count); std::stringstream ss; ss << HostEnt(host); EXPECT_EQ("{'' aliases=[] addrs=[2.3.4.5]}", ss.str()); ares_free_hostent(host); } #if 0 /* We are validating hostnames now, its not clear how this would ever be valid */ TEST_F(LibraryTest, ParseEscapedName) { std::vector data = { 0x12, 0x34, // qid 0x84, // response + query + AA + not-TC + not-RD 0x00, // not-RA + not-Z + not-AD + not-CD + rc=NoError 0x00, 0x01, // num questions 0x00, 0x01, // num answer RRs 0x00, 0x00, // num authority RRs 0x00, 0x00, // num additional RRs // Question 0x05, 'a', '\\', 'b', '.', 'c', 0x03, 'c', 'o', 'm', 0x00, 0x00, 0x01, // type A 0x00, 0x01, // class IN // Answer 1 0x05, 'a', '\\', 'b', '.', 'c', 0x03, 'c', 'o', 'm', 0x00, 0x00, 0x01, // RR type 0x00, 0x01, // class IN 0x01, 0x02, 0x03, 0x04, // TTL 0x00, 0x04, // rdata length 0x02, 0x03, 0x04, 0x05, }; struct hostent *host = nullptr; struct ares_addrttl info[2]; int count = 2; EXPECT_EQ(ARES_SUCCESS, ares_parse_a_reply(data.data(), data.size(), &host, info, &count)); EXPECT_EQ(1, count); HostEnt hent(host); std::stringstream ss; ss << hent; // The printable name is expanded with escapes. EXPECT_EQ(11, hent.name_.size()); EXPECT_EQ('a', hent.name_[0]); EXPECT_EQ('\\', hent.name_[1]); EXPECT_EQ('\\', hent.name_[2]); EXPECT_EQ('b', hent.name_[3]); EXPECT_EQ('\\', hent.name_[4]); EXPECT_EQ('.', hent.name_[5]); EXPECT_EQ('c', hent.name_[6]); ares_free_hostent(host); } #endif TEST_F(LibraryTest, ParsePartialCompressedName) { std::vector data = { 0x12, 0x34, // qid 0x84, // response + query + AA + not-TC + not-RD 0x00, // not-RA + not-Z + not-AD + not-CD + rc=NoError 0x00, 0x01, // num questions 0x00, 0x01, // num answer RRs 0x00, 0x00, // num authority RRs 0x00, 0x00, // num additional RRs // Question 0x03, 'w', 'w', 'w', 0x07, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 0x03, 'c', 'o', 'm', 0x00, 0x00, 0x01, // type A 0x00, 0x01, // class IN // Answer 1 0x03, 'w', 'w', 'w', 0xc0, 0x10, // offset 16 0x00, 0x01, // RR type 0x00, 0x01, // class IN 0x01, 0x02, 0x03, 0x04, // TTL 0x00, 0x04, // rdata length 0x02, 0x03, 0x04, 0x05, }; struct hostent *host = nullptr; struct ares_addrttl info[2]; int count = 2; EXPECT_EQ(ARES_SUCCESS, ares_parse_a_reply(data.data(), data.size(), &host, info, &count)); ASSERT_NE(nullptr, host); std::stringstream ss; ss << HostEnt(host); EXPECT_EQ("{'www.example.com' aliases=[] addrs=[2.3.4.5]}", ss.str()); ares_free_hostent(host); } TEST_F(LibraryTest, ParseFullyCompressedName) { std::vector data = { 0x12, 0x34, // qid 0x84, // response + query + AA + not-TC + not-RD 0x00, // not-RA + not-Z + not-AD + not-CD + rc=NoError 0x00, 0x01, // num questions 0x00, 0x01, // num answer RRs 0x00, 0x00, // num authority RRs 0x00, 0x00, // num additional RRs // Question 0x03, 'w', 'w', 'w', 0x07, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 0x03, 'c', 'o', 'm', 0x00, 0x00, 0x01, // type A 0x00, 0x01, // class IN // Answer 1 0xc0, 0x0c, // offset 12 0x00, 0x01, // RR type 0x00, 0x01, // class IN 0x01, 0x02, 0x03, 0x04, // TTL 0x00, 0x04, // rdata length 0x02, 0x03, 0x04, 0x05, }; struct hostent *host = nullptr; struct ares_addrttl info[2]; int count = 2; EXPECT_EQ(ARES_SUCCESS, ares_parse_a_reply(data.data(), data.size(), &host, info, &count)); ASSERT_NE(nullptr, host); std::stringstream ss; ss << HostEnt(host); EXPECT_EQ("{'www.example.com' aliases=[] addrs=[2.3.4.5]}", ss.str()); ares_free_hostent(host); } TEST_F(LibraryTest, ParseFullyCompressedName2) { std::vector data = { 0x12, 0x34, // qid 0x84, // response + query + AA + not-TC + not-RD 0x00, // not-RA + not-Z + not-AD + not-CD + rc=NoError 0x00, 0x01, // num questions 0x00, 0x01, // num answer RRs 0x00, 0x00, // num authority RRs 0x00, 0x00, // num additional RRs // Question 0xC0, 0x12, // pointer to later in message 0x00, 0x01, // type A 0x00, 0x01, // class IN // Answer 1 0x03, 'w', 'w', 'w', 0x07, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 0x03, 'c', 'o', 'm', 0x00, 0x00, 0x01, // RR type 0x00, 0x01, // class IN 0x01, 0x02, 0x03, 0x04, // TTL 0x00, 0x04, // rdata length 0x02, 0x03, 0x04, 0x05, }; struct hostent *host = nullptr; struct ares_addrttl info[2]; int count = 2; EXPECT_EQ(ARES_SUCCESS, ares_parse_a_reply(data.data(), data.size(), &host, info, &count)); ASSERT_NE(nullptr, host); std::stringstream ss; ss << HostEnt(host); EXPECT_EQ("{'www.example.com' aliases=[] addrs=[2.3.4.5]}", ss.str()); ares_free_hostent(host); } } // namespace test } // namespace ares ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/ares-test.cc0000644000175100001770000005657200000000000021314 0ustar00runnerdocker00000000000000#include "ares_setup.h" #include "ares.h" #include "ares_nameser.h" #include "ares-test.h" #include "ares-test-ai.h" #include "dns-proto.h" // Include ares internal files for DNS protocol details #include "ares_dns.h" #ifdef HAVE_NETDB_H #include #endif #ifdef HAVE_NETINET_TCP_H #include #endif #include #include #include #include #ifdef WIN32 #define BYTE_CAST (char *) #define mkdir_(d, p) mkdir(d) #else #define BYTE_CAST #define mkdir_(d, p) mkdir(d, p) #endif namespace ares { namespace test { bool verbose = false; static constexpr int dynamic_port = 0; int mock_port = dynamic_port; const std::vector both_families = {AF_INET, AF_INET6}; const std::vector ipv4_family = {AF_INET}; const std::vector ipv6_family = {AF_INET6}; const std::vector> both_families_both_modes = { std::make_pair(AF_INET, false), std::make_pair(AF_INET, true), std::make_pair(AF_INET6, false), std::make_pair(AF_INET6, true) }; const std::vector> ipv4_family_both_modes = { std::make_pair(AF_INET, false), std::make_pair(AF_INET, true) }; const std::vector> ipv6_family_both_modes = { std::make_pair(AF_INET6, false), std::make_pair(AF_INET6, true) }; // Which parameters to use in tests std::vector families = both_families; std::vector> families_modes = both_families_both_modes; unsigned long long LibraryTest::fails_ = 0; std::map LibraryTest::size_fails_; void ProcessWork(ares_channel channel, std::function()> get_extrafds, std::function process_extra) { int nfds, count; fd_set readers, writers; struct timeval tv; while (true) { // Retrieve the set of file descriptors that the library wants us to monitor. FD_ZERO(&readers); FD_ZERO(&writers); nfds = ares_fds(channel, &readers, &writers); if (nfds == 0) // no work left to do in the library return; // Add in the extra FDs if present. std::set extrafds = get_extrafds(); for (int extrafd : extrafds) { FD_SET(extrafd, &readers); if (extrafd >= nfds) { nfds = extrafd + 1; } } // Wait for activity or timeout. tv.tv_sec = 0; tv.tv_usec = 100000; // 100ms count = select(nfds, &readers, &writers, nullptr, &tv); if (count < 0) { fprintf(stderr, "select() failed, errno %d\n", errno); return; } // Let the library process any activity. ares_process(channel, &readers, &writers); // Let the provided callback process any activity on the extra FD. for (int extrafd : extrafds) { if (FD_ISSET(extrafd, &readers)) { process_extra(extrafd); } } } } // static void LibraryTest::SetAllocFail(int nth) { assert(nth > 0); assert(nth <= (int)(8 * sizeof(fails_))); fails_ |= (1LL << (nth - 1)); } // static void LibraryTest::SetAllocSizeFail(size_t size) { size_fails_[size]++; } // static void LibraryTest::ClearFails() { fails_ = 0; size_fails_.clear(); } // static bool LibraryTest::ShouldAllocFail(size_t size) { bool fail = (fails_ & 0x01); fails_ >>= 1; if (size_fails_[size] > 0) { size_fails_[size]--; fail = true; } return fail; } // static void* LibraryTest::amalloc(size_t size) { if (ShouldAllocFail(size) || size == 0) { if (verbose) std::cerr << "Failing malloc(" << size << ") request" << std::endl; return nullptr; } else { return malloc(size); } } // static void* LibraryTest::arealloc(void *ptr, size_t size) { if (ShouldAllocFail(size)) { if (verbose) std::cerr << "Failing realloc(" << ptr << ", " << size << ") request" << std::endl; return nullptr; } else { return realloc(ptr, size); } } // static void LibraryTest::afree(void *ptr) { free(ptr); } std::set NoExtraFDs() { return std::set(); } void DefaultChannelTest::Process() { ProcessWork(channel_, NoExtraFDs, nullptr); } void DefaultChannelModeTest::Process() { ProcessWork(channel_, NoExtraFDs, nullptr); } MockServer::MockServer(int family, int port) : udpport_(port), tcpport_(port), qid_(-1) { // Create a TCP socket to receive data on. tcpfd_ = socket(family, SOCK_STREAM, 0); EXPECT_NE(-1, tcpfd_); int optval = 1; setsockopt(tcpfd_, SOL_SOCKET, SO_REUSEADDR, BYTE_CAST &optval , sizeof(int)); // Send TCP data right away. setsockopt(tcpfd_, IPPROTO_TCP, TCP_NODELAY, BYTE_CAST &optval , sizeof(int)); // Create a UDP socket to receive data on. udpfd_ = socket(family, SOCK_DGRAM, 0); EXPECT_NE(-1, udpfd_); // Bind the sockets to the given port. if (family == AF_INET) { struct sockaddr_in addr; memset(&addr, 0, sizeof(addr)); addr.sin_family = AF_INET; addr.sin_addr.s_addr = htonl(INADDR_ANY); addr.sin_port = htons(tcpport_); int tcprc = bind(tcpfd_, (struct sockaddr*)&addr, sizeof(addr)); EXPECT_EQ(0, tcprc) << "Failed to bind AF_INET to TCP port " << tcpport_; addr.sin_port = htons(udpport_); int udprc = bind(udpfd_, (struct sockaddr*)&addr, sizeof(addr)); EXPECT_EQ(0, udprc) << "Failed to bind AF_INET to UDP port " << udpport_; // retrieve system-assigned port if (udpport_ == dynamic_port) { ares_socklen_t len = sizeof(addr); auto result = getsockname(udpfd_, (struct sockaddr*)&addr, &len); EXPECT_EQ(0, result); udpport_ = ntohs(addr.sin_port); EXPECT_NE(dynamic_port, udpport_); } if (tcpport_ == dynamic_port) { ares_socklen_t len = sizeof(addr); auto result = getsockname(tcpfd_, (struct sockaddr*)&addr, &len); EXPECT_EQ(0, result); tcpport_ = ntohs(addr.sin_port); EXPECT_NE(dynamic_port, tcpport_); } } else { EXPECT_EQ(AF_INET6, family); struct sockaddr_in6 addr; memset(&addr, 0, sizeof(addr)); addr.sin6_family = AF_INET6; memset(&addr.sin6_addr, 0, sizeof(addr.sin6_addr)); // in6addr_any addr.sin6_port = htons(tcpport_); int tcprc = bind(tcpfd_, (struct sockaddr*)&addr, sizeof(addr)); EXPECT_EQ(0, tcprc) << "Failed to bind AF_INET6 to TCP port " << tcpport_; addr.sin6_port = htons(udpport_); int udprc = bind(udpfd_, (struct sockaddr*)&addr, sizeof(addr)); EXPECT_EQ(0, udprc) << "Failed to bind AF_INET6 to UDP port " << udpport_; // retrieve system-assigned port if (udpport_ == dynamic_port) { ares_socklen_t len = sizeof(addr); auto result = getsockname(udpfd_, (struct sockaddr*)&addr, &len); EXPECT_EQ(0, result); udpport_ = ntohs(addr.sin6_port); EXPECT_NE(dynamic_port, udpport_); } if (tcpport_ == dynamic_port) { ares_socklen_t len = sizeof(addr); auto result = getsockname(tcpfd_, (struct sockaddr*)&addr, &len); EXPECT_EQ(0, result); tcpport_ = ntohs(addr.sin6_port); EXPECT_NE(dynamic_port, tcpport_); } } if (verbose) std::cerr << "Configured " << (family == AF_INET ? "IPv4" : "IPv6") << " mock server with TCP socket " << tcpfd_ << " on port " << tcpport_ << " and UDP socket " << udpfd_ << " on port " << udpport_ << std::endl; // For TCP, also need to listen for connections. EXPECT_EQ(0, listen(tcpfd_, 5)) << "Failed to listen for TCP connections"; } MockServer::~MockServer() { for (int fd : connfds_) { sclose(fd); } sclose(tcpfd_); sclose(udpfd_); } void MockServer::ProcessPacket(int fd, struct sockaddr_storage *addr, socklen_t addrlen, byte *data, int len) { // Assume the packet is a well-formed DNS request and extract the request // details. if (len < NS_HFIXEDSZ) { std::cerr << "Packet too short (" << len << ")" << std::endl; return; } int qid = DNS_HEADER_QID(data); if (DNS_HEADER_QR(data) != 0) { std::cerr << "Not a request" << std::endl; return; } if (DNS_HEADER_OPCODE(data) != O_QUERY) { std::cerr << "Not a query (opcode " << DNS_HEADER_OPCODE(data) << ")" << std::endl; return; } if (DNS_HEADER_QDCOUNT(data) != 1) { std::cerr << "Unexpected question count (" << DNS_HEADER_QDCOUNT(data) << ")" << std::endl; return; } byte* question = data + 12; int qlen = len - 12; char *name = nullptr; long enclen; ares_expand_name(question, data, len, &name, &enclen); if (!name) { std::cerr << "Failed to retrieve name" << std::endl; return; } qlen -= enclen; question += enclen; std::string namestr(name); ares_free_string(name); if (qlen < 4) { std::cerr << "Unexpected question size (" << qlen << " bytes after name)" << std::endl; return; } if (DNS_QUESTION_CLASS(question) != C_IN) { std::cerr << "Unexpected question class (" << DNS_QUESTION_CLASS(question) << ")" << std::endl; return; } int rrtype = DNS_QUESTION_TYPE(question); if (verbose) { std::vector req(data, data + len); std::cerr << "received " << (fd == udpfd_ ? "UDP" : "TCP") << " request " << PacketToString(req) << " on port " << (fd == udpfd_ ? udpport_ : tcpport_) << std::endl; std::cerr << "ProcessRequest(" << qid << ", '" << namestr << "', " << RRTypeToString(rrtype) << ")" << std::endl; } ProcessRequest(fd, addr, addrlen, qid, namestr, rrtype); } void MockServer::ProcessFD(int fd) { if (fd != tcpfd_ && fd != udpfd_ && connfds_.find(fd) == connfds_.end()) { // Not one of our FDs. return; } if (fd == tcpfd_) { int connfd = accept(tcpfd_, NULL, NULL); if (connfd < 0) { std::cerr << "Error accepting connection on fd " << fd << std::endl; } else { connfds_.insert(connfd); } return; } // Activity on a data-bearing file descriptor. struct sockaddr_storage addr; socklen_t addrlen = sizeof(addr); byte buffer[2048]; int len = recvfrom(fd, BYTE_CAST buffer, sizeof(buffer), 0, (struct sockaddr *)&addr, &addrlen); byte* data = buffer; if (fd != udpfd_) { if (len == 0) { connfds_.erase(std::find(connfds_.begin(), connfds_.end(), fd)); sclose(fd); return; } if (len < 2) { std::cerr << "Packet too short (" << len << ")" << std::endl; return; } /* TCP might aggregate the various requests into a single packet, so we * need to split */ while (len) { int tcplen = (data[0] << 8) + data[1]; data += 2; len -= 2; if (tcplen > len) { std::cerr << "Warning: TCP length " << tcplen << " doesn't match remaining data length " << len << std::endl; } int process_len = (tcplen > len)?len:tcplen; ProcessPacket(fd, &addr, addrlen, data, process_len); len -= process_len; data += process_len; } } else { /* UDP is always a single packet */ ProcessPacket(fd, &addr, addrlen, data, len); } } std::set MockServer::fds() const { std::set result = connfds_; result.insert(tcpfd_); result.insert(udpfd_); return result; } void MockServer::ProcessRequest(int fd, struct sockaddr_storage* addr, int addrlen, int qid, const std::string& name, int rrtype) { // Before processing, let gMock know the request is happening. OnRequest(name, rrtype); if (reply_.size() == 0) { return; } // Make a local copy of the current pending reply. std::vector reply = reply_; if (qid_ >= 0) { // Use the explicitly specified query ID. qid = qid_; } if (reply.size() >= 2) { // Overwrite the query ID if space to do so. reply[0] = (byte)((qid >> 8) & 0xff); reply[1] = (byte)(qid & 0xff); } if (verbose) std::cerr << "sending reply " << PacketToString(reply) << " on port " << ((fd == udpfd_) ? udpport_ : tcpport_) << std::endl; // Prefix with 2-byte length if TCP. if (fd != udpfd_) { int len = reply.size(); std::vector vlen = {(byte)((len & 0xFF00) >> 8), (byte)(len & 0xFF)}; reply.insert(reply.begin(), vlen.begin(), vlen.end()); // Also, don't bother with the destination address. addr = nullptr; addrlen = 0; } int rc = sendto(fd, BYTE_CAST reply.data(), reply.size(), 0, (struct sockaddr *)addr, addrlen); if (rc < static_cast(reply.size())) { std::cerr << "Failed to send full reply, rc=" << rc << std::endl; } } // static MockChannelOptsTest::NiceMockServers MockChannelOptsTest::BuildServers(int count, int family, int base_port) { NiceMockServers servers; assert(count > 0); for (int ii = 0; ii < count; ii++) { int port = base_port == dynamic_port ? dynamic_port : base_port + ii; std::unique_ptr server(new NiceMockServer(family, port)); servers.push_back(std::move(server)); } return servers; } MockChannelOptsTest::MockChannelOptsTest(int count, int family, bool force_tcp, struct ares_options* givenopts, int optmask) : servers_(BuildServers(count, family, mock_port)), server_(*servers_[0].get()), channel_(nullptr) { // Set up channel options. struct ares_options opts; if (givenopts) { memcpy(&opts, givenopts, sizeof(opts)); } else { memset(&opts, 0, sizeof(opts)); } // Point the library at the first mock server by default (overridden below). opts.udp_port = server_.udpport(); optmask |= ARES_OPT_UDP_PORT; opts.tcp_port = server_.tcpport(); optmask |= ARES_OPT_TCP_PORT; // If not already overridden, set short-ish timeouts. if (!(optmask & (ARES_OPT_TIMEOUTMS|ARES_OPT_TIMEOUT))) { opts.timeout = 1500; optmask |= ARES_OPT_TIMEOUTMS; } // If not already overridden, set 3 retries. if (!(optmask & ARES_OPT_TRIES)) { opts.tries = 3; optmask |= ARES_OPT_TRIES; } // If not already overridden, set search domains. const char *domains[3] = {"first.com", "second.org", "third.gov"}; if (!(optmask & ARES_OPT_DOMAINS)) { opts.ndomains = 3; opts.domains = (char**)domains; optmask |= ARES_OPT_DOMAINS; } if (force_tcp) { opts.flags |= ARES_FLAG_USEVC; optmask |= ARES_OPT_FLAGS; } EXPECT_EQ(ARES_SUCCESS, ares_init_options(&channel_, &opts, optmask)); EXPECT_NE(nullptr, channel_); // Set up servers after construction so we can set individual ports struct ares_addr_port_node* prev = nullptr; struct ares_addr_port_node* first = nullptr; for (const auto& server : servers_) { struct ares_addr_port_node* node = (struct ares_addr_port_node*)malloc(sizeof(*node)); if (prev) { prev->next = node; } else { first = node; } node->next = nullptr; node->family = family; node->udp_port = server->udpport(); node->tcp_port = server->tcpport(); if (family == AF_INET) { node->addr.addr4.s_addr = htonl(0x7F000001); } else { memset(&node->addr.addr6, 0, sizeof(node->addr.addr6)); node->addr.addr6._S6_un._S6_u8[15] = 1; } prev = node; } EXPECT_EQ(ARES_SUCCESS, ares_set_servers_ports(channel_, first)); while (first) { prev = first; first = first->next; free(prev); } if (verbose) { std::cerr << "Configured library with servers:"; std::vector servers = GetNameServers(channel_); for (const auto& server : servers) { std::cerr << " " << server; } std::cerr << std::endl; } } MockChannelOptsTest::~MockChannelOptsTest() { if (channel_) { ares_destroy(channel_); } channel_ = nullptr; } std::set MockChannelOptsTest::fds() const { std::set fds; for (const auto& server : servers_) { std::set serverfds = server->fds(); fds.insert(serverfds.begin(), serverfds.end()); } return fds; } void MockChannelOptsTest::ProcessFD(int fd) { for (auto& server : servers_) { server->ProcessFD(fd); } } void MockChannelOptsTest::Process() { using namespace std::placeholders; ProcessWork(channel_, std::bind(&MockChannelOptsTest::fds, this), std::bind(&MockChannelOptsTest::ProcessFD, this, _1)); } std::ostream& operator<<(std::ostream& os, const HostResult& result) { os << '{'; if (result.done_) { os << StatusToString(result.status_); if (result.host_.addrtype_ != -1) { os << " " << result.host_; } else { os << ", (no hostent)"; } } else { os << "(incomplete)"; } os << '}'; return os; } HostEnt::HostEnt(const struct hostent *hostent) : addrtype_(-1) { if (!hostent) return; if (hostent->h_name) name_ = hostent->h_name; if (hostent->h_aliases) { char** palias = hostent->h_aliases; while (*palias != nullptr) { aliases_.push_back(*palias); palias++; } } addrtype_ = hostent->h_addrtype; if (hostent->h_addr_list) { char** paddr = hostent->h_addr_list; while (*paddr != nullptr) { std::string addr = AddressToString(*paddr, hostent->h_length); addrs_.push_back(addr); paddr++; } } } std::ostream& operator<<(std::ostream& os, const HostEnt& host) { os << "{'"; if (host.name_.length() > 0) { os << host.name_; } os << "' aliases=["; for (size_t ii = 0; ii < host.aliases_.size(); ii++) { if (ii > 0) os << ", "; os << host.aliases_[ii]; } os << "] "; os << "addrs=["; for (size_t ii = 0; ii < host.addrs_.size(); ii++) { if (ii > 0) os << ", "; os << host.addrs_[ii]; } os << "]"; os << '}'; return os; } void HostCallback(void *data, int status, int timeouts, struct hostent *hostent) { EXPECT_NE(nullptr, data); if (data == nullptr) return; HostResult* result = reinterpret_cast(data); result->done_ = true; result->status_ = status; result->timeouts_ = timeouts; if (hostent) result->host_ = HostEnt(hostent); if (verbose) std::cerr << "HostCallback(" << *result << ")" << std::endl; } std::ostream& operator<<(std::ostream& os, const AddrInfoResult& result) { os << '{'; if (result.done_ && result.ai_) { os << StatusToString(result.status_) << " " << result.ai_; } else { os << "(incomplete)"; } os << '}'; return os; } std::ostream& operator<<(std::ostream& os, const AddrInfo& ai) { os << '{'; if (ai == nullptr) { os << "nullptr}"; return os; } struct ares_addrinfo_cname *next_cname = ai->cnames; while(next_cname) { if(next_cname->alias) { os << next_cname->alias << "->"; } if(next_cname->name) { os << next_cname->name; } if((next_cname = next_cname->next)) os << ", "; else os << " "; } struct ares_addrinfo_node *next = ai->nodes; while(next) { //if(next->ai_canonname) { //os << "'" << next->ai_canonname << "' "; //} unsigned short port = 0; os << "addr=["; if(next->ai_family == AF_INET) { sockaddr_in* sin = (sockaddr_in*)next->ai_addr; port = ntohs(sin->sin_port); os << AddressToString(&sin->sin_addr, 4); } else if (next->ai_family == AF_INET6) { sockaddr_in6* sin = (sockaddr_in6*)next->ai_addr; port = ntohs(sin->sin6_port); os << "[" << AddressToString(&sin->sin6_addr, 16) << "]"; } else os << "unknown family"; if(port) { os << ":" << port; } os << "]"; if((next = next->ai_next)) os << ", "; } os << '}'; return os; } void AddrInfoCallback(void *data, int status, int timeouts, struct ares_addrinfo *ai) { EXPECT_NE(nullptr, data); AddrInfoResult* result = reinterpret_cast(data); result->done_ = true; result->status_ = status; result->timeouts_= timeouts; result->ai_ = AddrInfo(ai); if (verbose) std::cerr << "AddrInfoCallback(" << *result << ")" << std::endl; } std::ostream& operator<<(std::ostream& os, const SearchResult& result) { os << '{'; if (result.done_) { os << StatusToString(result.status_) << " " << PacketToString(result.data_); } else { os << "(incomplete)"; } os << '}'; return os; } void SearchCallback(void *data, int status, int timeouts, unsigned char *abuf, int alen) { EXPECT_NE(nullptr, data); SearchResult* result = reinterpret_cast(data); result->done_ = true; result->status_ = status; result->timeouts_ = timeouts; result->data_.assign(abuf, abuf + alen); if (verbose) std::cerr << "SearchCallback(" << *result << ")" << std::endl; } std::ostream& operator<<(std::ostream& os, const NameInfoResult& result) { os << '{'; if (result.done_) { os << StatusToString(result.status_) << " " << result.node_ << " " << result.service_; } else { os << "(incomplete)"; } os << '}'; return os; } void NameInfoCallback(void *data, int status, int timeouts, char *node, char *service) { EXPECT_NE(nullptr, data); NameInfoResult* result = reinterpret_cast(data); result->done_ = true; result->status_ = status; result->timeouts_ = timeouts; result->node_ = std::string(node ? node : ""); result->service_ = std::string(service ? service : ""); if (verbose) std::cerr << "NameInfoCallback(" << *result << ")" << std::endl; } std::vector GetNameServers(ares_channel channel) { struct ares_addr_port_node* servers = nullptr; EXPECT_EQ(ARES_SUCCESS, ares_get_servers_ports(channel, &servers)); struct ares_addr_port_node* server = servers; std::vector results; while (server) { std::stringstream ss; switch (server->family) { case AF_INET: ss << AddressToString((char*)&server->addr.addr4, 4); break; case AF_INET6: if (server->udp_port != 0) { ss << '['; } ss << AddressToString((char*)&server->addr.addr6, 16); if (server->udp_port != 0) { ss << ']'; } break; default: results.push_back(""); break; } if (server->udp_port != 0) { ss << ":" << server->udp_port; } results.push_back(ss.str()); server = server->next; } if (servers) ares_free_data(servers); return results; } TransientDir::TransientDir(const std::string& dirname) : dirname_(dirname) { if (mkdir_(dirname_.c_str(), 0755) != 0) { std::cerr << "Failed to create subdirectory '" << dirname_ << "'" << std::endl; } } TransientDir::~TransientDir() { rmdir(dirname_.c_str()); } TransientFile::TransientFile(const std::string& filename, const std::string& contents) : filename_(filename) { FILE *f = fopen(filename.c_str(), "w"); if (f == nullptr) { std::cerr << "Error: failed to create '" << filename << "'" << std::endl; return; } int rc = fwrite(contents.data(), 1, contents.size(), f); if (rc != (int)contents.size()) { std::cerr << "Error: failed to write contents of '" << filename << "'" << std::endl; } fclose(f); } TransientFile::~TransientFile() { unlink(filename_.c_str()); } std::string TempNam(const char *dir, const char *prefix) { char *p = tempnam(dir, prefix); std::string result(p); free(p); return result; } TempFile::TempFile(const std::string& contents) : TransientFile(TempNam(nullptr, "ares"), contents) { } VirtualizeIO::VirtualizeIO(ares_channel c) : channel_(c) { ares_set_socket_functions(channel_, &default_functions, 0); } VirtualizeIO::~VirtualizeIO() { ares_set_socket_functions(channel_, 0, 0); } } // namespace test } // namespace ares ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/ares-test.h0000644000175100001770000003620300000000000021143 0ustar00runnerdocker00000000000000// -*- mode: c++ -*- #ifndef ARES_TEST_H #define ARES_TEST_H #include "ares_setup.h" #include "ares.h" #include "dns-proto.h" // Include ares internal file for DNS protocol constants #include "ares_nameser.h" #include "gtest/gtest.h" #include "gmock/gmock.h" #ifdef HAVE_CONFIG_H #include "config.h" #endif #if defined(HAVE_USER_NAMESPACE) && defined(HAVE_UTS_NAMESPACE) #define HAVE_CONTAINER #endif #include #include #include #include #include #include #include #include namespace ares { typedef unsigned char byte; namespace test { extern bool verbose; extern int mock_port; extern const std::vector both_families; extern const std::vector ipv4_family; extern const std::vector ipv6_family; extern const std::vector> both_families_both_modes; extern const std::vector> ipv4_family_both_modes; extern const std::vector> ipv6_family_both_modes; // Which parameters to use in tests extern std::vector families; extern std::vector> families_modes; // Process all pending work on ares-owned file descriptors, plus // optionally the given set-of-FDs + work function. void ProcessWork(ares_channel channel, std::function()> get_extrafds, std::function process_extra); std::set NoExtraFDs(); // Test fixture that ensures library initialization, and allows // memory allocations to be failed. class LibraryTest : public ::testing::Test { public: LibraryTest() { EXPECT_EQ(ARES_SUCCESS, ares_library_init_mem(ARES_LIB_INIT_ALL, &LibraryTest::amalloc, &LibraryTest::afree, &LibraryTest::arealloc)); } ~LibraryTest() { ares_library_cleanup(); ClearFails(); } // Set the n-th malloc call (of any size) from the library to fail. // (nth == 1 means the next call) static void SetAllocFail(int nth); // Set the next malloc call for the given size to fail. static void SetAllocSizeFail(size_t size); // Remove any pending alloc failures. static void ClearFails(); static void *amalloc(size_t size); static void* arealloc(void *ptr, size_t size); static void afree(void *ptr); private: static bool ShouldAllocFail(size_t size); static unsigned long long fails_; static std::map size_fails_; }; // Test fixture that uses a default channel. class DefaultChannelTest : public LibraryTest { public: DefaultChannelTest() : channel_(nullptr) { EXPECT_EQ(ARES_SUCCESS, ares_init(&channel_)); EXPECT_NE(nullptr, channel_); } ~DefaultChannelTest() { ares_destroy(channel_); channel_ = nullptr; } // Process all pending work on ares-owned file descriptors. void Process(); protected: ares_channel channel_; }; // Test fixture that uses a default channel with the specified lookup mode. class DefaultChannelModeTest : public LibraryTest, public ::testing::WithParamInterface { public: DefaultChannelModeTest() : channel_(nullptr) { struct ares_options opts = {0}; opts.lookups = strdup(GetParam().c_str()); int optmask = ARES_OPT_LOOKUPS; EXPECT_EQ(ARES_SUCCESS, ares_init_options(&channel_, &opts, optmask)); EXPECT_NE(nullptr, channel_); free(opts.lookups); } ~DefaultChannelModeTest() { ares_destroy(channel_); channel_ = nullptr; } // Process all pending work on ares-owned file descriptors. void Process(); protected: ares_channel channel_; }; // Mock DNS server to allow responses to be scripted by tests. class MockServer { public: MockServer(int family, int port); ~MockServer(); // Mock method indicating the processing of a particular // request. MOCK_METHOD2(OnRequest, void(const std::string& name, int rrtype)); // Set the reply to be sent next; the query ID field will be overwritten // with the value from the request. void SetReplyData(const std::vector& reply) { reply_ = reply; } void SetReply(const DNSPacket* reply) { SetReplyData(reply->data()); } void SetReplyQID(int qid) { qid_ = qid; } // The set of file descriptors that the server handles. std::set fds() const; // Process activity on a file descriptor. void ProcessFD(int fd); // Ports the server is responding to int udpport() const { return udpport_; } int tcpport() const { return tcpport_; } private: void ProcessRequest(int fd, struct sockaddr_storage* addr, int addrlen, int qid, const std::string& name, int rrtype); void ProcessPacket(int fd, struct sockaddr_storage *addr, socklen_t addrlen, byte *data, int len); int udpport_; int tcpport_; int udpfd_; int tcpfd_; std::set connfds_; std::vector reply_; int qid_; }; // Test fixture that uses a mock DNS server. class MockChannelOptsTest : public LibraryTest { public: MockChannelOptsTest(int count, int family, bool force_tcp, struct ares_options* givenopts, int optmask); ~MockChannelOptsTest(); // Process all pending work on ares-owned and mock-server-owned file descriptors. void Process(); protected: // NiceMockServer doesn't complain about uninteresting calls. typedef testing::NiceMock NiceMockServer; typedef std::vector< std::unique_ptr > NiceMockServers; std::set fds() const; void ProcessFD(int fd); static NiceMockServers BuildServers(int count, int family, int base_port); NiceMockServers servers_; // Convenience reference to first server. NiceMockServer& server_; ares_channel channel_; }; class MockChannelTest : public MockChannelOptsTest, public ::testing::WithParamInterface< std::pair > { public: MockChannelTest() : MockChannelOptsTest(1, GetParam().first, GetParam().second, nullptr, 0) {} }; class MockUDPChannelTest : public MockChannelOptsTest, public ::testing::WithParamInterface { public: MockUDPChannelTest() : MockChannelOptsTest(1, GetParam(), false, nullptr, 0) {} }; class MockTCPChannelTest : public MockChannelOptsTest, public ::testing::WithParamInterface { public: MockTCPChannelTest() : MockChannelOptsTest(1, GetParam(), true, nullptr, 0) {} }; // gMock action to set the reply for a mock server. ACTION_P2(SetReplyData, mockserver, data) { mockserver->SetReplyData(data); } ACTION_P2(SetReply, mockserver, reply) { mockserver->SetReply(reply); } ACTION_P2(SetReplyQID, mockserver, qid) { mockserver->SetReplyQID(qid); } // gMock action to cancel a channel. ACTION_P2(CancelChannel, mockserver, channel) { ares_cancel(channel); } // C++ wrapper for struct hostent. struct HostEnt { HostEnt() : addrtype_(-1) {} HostEnt(const struct hostent* hostent); std::string name_; std::vector aliases_; int addrtype_; // AF_INET or AF_INET6 std::vector addrs_; }; std::ostream& operator<<(std::ostream& os, const HostEnt& result); // Structure that describes the result of an ares_host_callback invocation. struct HostResult { HostResult() : done_(false), status_(0), timeouts_(0) {} // Whether the callback has been invoked. bool done_; // Explicitly provided result information. int status_; int timeouts_; // Contents of the hostent structure, if provided. HostEnt host_; }; std::ostream& operator<<(std::ostream& os, const HostResult& result); // Structure that describes the result of an ares_callback invocation. struct SearchResult { // Whether the callback has been invoked. bool done_; // Explicitly provided result information. int status_; int timeouts_; std::vector data_; }; std::ostream& operator<<(std::ostream& os, const SearchResult& result); // Structure that describes the result of an ares_nameinfo_callback invocation. struct NameInfoResult { // Whether the callback has been invoked. bool done_; // Explicitly provided result information. int status_; int timeouts_; std::string node_; std::string service_; }; std::ostream& operator<<(std::ostream& os, const NameInfoResult& result); struct AddrInfoDeleter { void operator() (ares_addrinfo *ptr) { if (ptr) ares_freeaddrinfo(ptr); } }; // C++ wrapper for struct ares_addrinfo. using AddrInfo = std::unique_ptr; std::ostream& operator<<(std::ostream& os, const AddrInfo& result); // Structure that describes the result of an ares_addrinfo_callback invocation. struct AddrInfoResult { AddrInfoResult() : done_(false), status_(-1), timeouts_(0) {} // Whether the callback has been invoked. bool done_; // Explicitly provided result information. int status_; int timeouts_; // Contents of the ares_addrinfo structure, if provided. AddrInfo ai_; }; std::ostream& operator<<(std::ostream& os, const AddrInfoResult& result); // Standard implementation of ares callbacks that fill out the corresponding // structures. void HostCallback(void *data, int status, int timeouts, struct hostent *hostent); void SearchCallback(void *data, int status, int timeouts, unsigned char *abuf, int alen); void NameInfoCallback(void *data, int status, int timeouts, char *node, char *service); void AddrInfoCallback(void *data, int status, int timeouts, struct ares_addrinfo *res); // Retrieve the name servers used by a channel. std::vector GetNameServers(ares_channel channel); // RAII class to temporarily create a directory of a given name. class TransientDir { public: TransientDir(const std::string& dirname); ~TransientDir(); private: std::string dirname_; }; // C++ wrapper around tempnam() std::string TempNam(const char *dir, const char *prefix); // RAII class to temporarily create file of a given name and contents. class TransientFile { public: TransientFile(const std::string &filename, const std::string &contents); ~TransientFile(); protected: std::string filename_; }; // RAII class for a temporary file with the given contents. class TempFile : public TransientFile { public: TempFile(const std::string& contents); const char* filename() const { return filename_.c_str(); } }; #ifdef _WIN32 extern "C" { static int setenv(const char *name, const char *value, int overwrite) { char *buffer; size_t buf_size; if (name == NULL) return -1; if (value == NULL) value = ""; /* For unset */ if (!overwrite && getenv(name) != NULL) { return -1; } buf_size = strlen(name) + strlen(value) + 1 /* = */ + 1 /* NULL */; buffer = (char *)malloc(buf_size); _snprintf(buffer, buf_size, "%s=%s", name, value); _putenv(buffer); free(buffer); return 0; } static int unsetenv(const char *name) { return setenv(name, NULL, 1); } } /* extern "C" */ #endif // RAII class for a temporary environment variable value. class EnvValue { public: EnvValue(const char *name, const char *value) : name_(name), restore_(false) { char *original = getenv(name); if (original) { restore_ = true; original_ = original; } setenv(name_.c_str(), value, 1); } ~EnvValue() { if (restore_) { setenv(name_.c_str(), original_.c_str(), 1); } else { unsetenv(name_.c_str()); } } private: std::string name_; bool restore_; std::string original_; }; #ifdef HAVE_CONTAINER // Linux-specific functionality for running code in a container, implemented // in ares-test-ns.cc typedef std::function VoidToIntFn; typedef std::vector> NameContentList; class ContainerFilesystem { public: ContainerFilesystem(NameContentList files, const std::string& mountpt); ~ContainerFilesystem(); std::string root() const { return rootdir_; }; std::string mountpt() const { return mountpt_; }; private: void EnsureDirExists(const std::string& dir); std::string rootdir_; std::string mountpt_; std::list dirs_; std::vector> files_; }; int RunInContainer(ContainerFilesystem* fs, const std::string& hostname, const std::string& domainname, VoidToIntFn fn); #define ICLASS_NAME(casename, testname) Contained##casename##_##testname #define CONTAINED_TEST_F(casename, testname, hostname, domainname, files) \ class ICLASS_NAME(casename, testname) : public casename { \ public: \ ICLASS_NAME(casename, testname)() {} \ static int InnerTestBody(); \ }; \ TEST_F(ICLASS_NAME(casename, testname), _) { \ ContainerFilesystem chroot(files, ".."); \ VoidToIntFn fn(ICLASS_NAME(casename, testname)::InnerTestBody); \ EXPECT_EQ(0, RunInContainer(&chroot, hostname, domainname, fn)); \ } \ int ICLASS_NAME(casename, testname)::InnerTestBody() #endif /* Assigns virtual IO functions to a channel. These functions simply call * the actual system functions. */ class VirtualizeIO { public: VirtualizeIO(ares_channel); ~VirtualizeIO(); static const ares_socket_functions default_functions; private: ares_channel channel_; }; /* * Slightly white-box macro to generate two runs for a given test case: * One with no modifications, and one with all IO functions set to use * the virtual io structure. * Since no magic socket setup or anything is done in the latter case * this should probably only be used for test with very vanilla IO * requirements. */ #define VCLASS_NAME(casename, testname) Virt##casename##_##testname #define VIRT_NONVIRT_TEST_F(casename, testname) \ class VCLASS_NAME(casename, testname) : public casename { \ public: \ VCLASS_NAME(casename, testname)() {} \ void InnerTestBody(); \ }; \ GTEST_TEST_(casename, testname, VCLASS_NAME(casename, testname), \ ::testing::internal::GetTypeId()) { \ InnerTestBody(); \ } \ GTEST_TEST_(casename, testname##_virtualized, \ VCLASS_NAME(casename, testname), \ ::testing::internal::GetTypeId()) { \ VirtualizeIO vio(channel_); \ InnerTestBody(); \ } \ void VCLASS_NAME(casename, testname)::InnerTestBody() } // namespace test } // namespace ares #endif ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/buildconf0000755000175100001770000000003000000000000020743 0ustar00runnerdocker00000000000000#!/bin/sh autoreconf -iv././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/configure.ac0000644000175100001770000000107600000000000021351 0ustar00runnerdocker00000000000000AC_PREREQ(2.57) AC_INIT([c-ares-test],[-],[-]) AC_CONFIG_SRCDIR([ares-test.cc]) AC_CONFIG_MACRO_DIR([../m4]) AM_INIT_AUTOMAKE([no-define]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) AX_REQUIRE_DEFINED([AX_CXX_COMPILE_STDCXX_11]) AX_REQUIRE_DEFINED([AX_PTHREAD]) dnl Checks for programs. AC_PROG_CXX AX_CXX_COMPILE_STDCXX_11([noext],[mandatory]) LT_INIT AC_SUBST(LIBTOOL_DEPS) AX_PTHREAD AX_CODE_COVERAGE AX_CHECK_USER_NAMESPACE AX_CHECK_UTS_NAMESPACE AC_CHECK_HEADERS(netdb.h netinet/tcp.h) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_FILES([Makefile]) AC_OUTPUT ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/dns-dump.cc0000644000175100001770000000144100000000000021115 0ustar00runnerdocker00000000000000#include #include #ifdef _MSC_VER # include #else # include #endif #include #include #include "dns-proto.h" namespace ares { static void ShowFile(const char* filename) { int fd = open(filename, O_RDONLY); if (fd < 0) { std::cerr << "Failed to open '" << filename << "'" << std::endl; return; } std::vector contents; while (true) { unsigned char buffer[1024]; int len = read(fd, buffer, sizeof(buffer)); if (len <= 0) break; contents.insert(contents.end(), buffer, buffer + len); } std::cout << PacketToString(contents) << std::endl; } } // namespace ares int main(int argc, char* argv[]) { for (int ii = 1; ii < argc; ++ii) { ares::ShowFile(argv[ii]); } return 0; } ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/dns-proto-test.cc0000644000175100001770000000731600000000000022277 0ustar00runnerdocker00000000000000#include "ares-test.h" #include "dns-proto.h" #include namespace ares { namespace test { TEST(DNSProto, EncodeQuestions) { DNSPacket pkt; pkt.set_qid(0x1234).set_response().set_aa() .add_question(new DNSQuestion("example.com.", T_A)) .add_question(new DNSQuestion("www.example.com", T_AAAA, C_CHAOS)); std::vector data = { 0x12, 0x34, // qid 0x84, // response + query + AA + not-TC + not-RD 0x00, // not-RA + not-Z + not-AD + not-CD + rc=NoError 0x00, 0x02, // num questions 0x00, 0x00, // num answer RRs 0x00, 0x00, // num authority RRs 0x00, 0x00, // num additional RRs // Question 1 0x07, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 0x03, 'c', 'o', 'm', 0x00, 0x00, 0x01, // type A 0x00, 0x01, // class IN // Question 2 0x03, 'w', 'w', 'w', 0x07, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 0x03, 'c', 'o', 'm', 0x00, 0x00, 0x1C, // type AAAA = 28 0x00, 0x03, // class CHAOS = 3 }; EXPECT_EQ(data, pkt.data()); } TEST(DNSProto, EncodeSingleNameAnswers) { DNSPacket pkt; pkt.qid_ = 0x1234; pkt.response_ = true; pkt.aa_ = true; pkt.opcode_ = O_QUERY; pkt.add_answer(new DNSCnameRR("example.com", 0x01020304, "other.com.")); pkt.add_auth(new DNSPtrRR("www.example.com", 0x01020304, "www.other.com")); std::vector data = { 0x12, 0x34, // qid 0x84, // response + query + AA + not-TC + not-RD 0x00, // not-RA + not-Z + not-AD + not-CD + rc=NoError 0x00, 0x00, // num questions 0x00, 0x01, // num answer RRs 0x00, 0x01, // num authority RRs 0x00, 0x00, // num additional RRs // Answer 1 0x07, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 0x03, 'c', 'o', 'm', 0x00, 0x00, 0x05, // RR type 0x00, 0x01, // class IN 0x01, 0x02, 0x03, 0x04, // TTL 0x00, 0x0B, // rdata length 0x05, 'o', 't', 'h', 'e', 'r', 0x03, 'c', 'o', 'm', 0x00, // Authority 1 0x03, 'w', 'w', 'w', 0x07, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 0x03, 'c', 'o', 'm', 0x00, 0x00, 0x0c, // RR type 0x00, 0x01, // class IN 0x01, 0x02, 0x03, 0x04, // TTL 0x00, 0x0F, // rdata length 0x03, 'w', 'w', 'w', 0x05, 'o', 't', 'h', 'e', 'r', 0x03, 'c', 'o', 'm', 0x00, }; EXPECT_EQ(data, pkt.data()); } TEST(DNSProto, EncodeAddressAnswers) { DNSPacket pkt; pkt.qid_ = 0x1234; pkt.response_ = true; pkt.aa_ = true; pkt.opcode_ = O_QUERY; std::vector addrv4 = {0x02, 0x03, 0x04, 0x05}; pkt.add_answer(new DNSARR("example.com", 0x01020304, addrv4)); byte addrv6[16] = {0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04}; pkt.add_additional(new DNSAaaaRR("www.example.com", 0x01020304, addrv6, 16)); std::vector data = { 0x12, 0x34, // qid 0x84, // response + query + AA + not-TC + not-RD 0x00, // not-RA + not-Z + not-AD + not-CD + rc=NoError 0x00, 0x00, // num questions 0x00, 0x01, // num answer RRs 0x00, 0x00, // num authority RRs 0x00, 0x01, // num additional RRs // Answer 1 0x07, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 0x03, 'c', 'o', 'm', 0x00, 0x00, 0x01, // RR type 0x00, 0x01, // class IN 0x01, 0x02, 0x03, 0x04, // TTL 0x00, 0x04, // rdata length 0x02, 0x03, 0x04, 0x05, // Additional 1 0x03, 'w', 'w', 'w', 0x07, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 0x03, 'c', 'o', 'm', 0x00, 0x00, 0x1c, // RR type 0x00, 0x01, // class IN 0x01, 0x02, 0x03, 0x04, // TTL 0x00, 0x10, // rdata length 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04 }; EXPECT_EQ(data, pkt.data()); } } // namespace test } // namespace ares ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/dns-proto.cc0000644000175100001770000004545000000000000021323 0ustar00runnerdocker00000000000000 // Include ares internal file for DNS protocol details #include "ares_setup.h" #include "ares.h" #include "ares_dns.h" #include "dns-proto.h" #include #include #include namespace ares { std::string HexDump(std::vector data) { std::stringstream ss; for (size_t ii = 0; ii < data.size(); ii++) { char buffer[2 + 1]; sprintf(buffer, "%02x", data[ii]); ss << buffer; } return ss.str(); } std::string HexDump(const byte *data, int len) { return HexDump(std::vector(data, data + len)); } std::string HexDump(const char *data, int len) { return HexDump(reinterpret_cast(data), len); } std::string StatusToString(int status) { switch (status) { case ARES_SUCCESS: return "ARES_SUCCESS"; case ARES_ENODATA: return "ARES_ENODATA"; case ARES_EFORMERR: return "ARES_EFORMERR"; case ARES_ESERVFAIL: return "ARES_ESERVFAIL"; case ARES_ENOTFOUND: return "ARES_ENOTFOUND"; case ARES_ENOTIMP: return "ARES_ENOTIMP"; case ARES_EREFUSED: return "ARES_EREFUSED"; case ARES_EBADQUERY: return "ARES_EBADQUERY"; case ARES_EBADNAME: return "ARES_EBADNAME"; case ARES_EBADFAMILY: return "ARES_EBADFAMILY"; case ARES_EBADRESP: return "ARES_EBADRESP"; case ARES_ECONNREFUSED: return "ARES_ECONNREFUSED"; case ARES_ETIMEOUT: return "ARES_ETIMEOUT"; case ARES_EOF: return "ARES_EOF"; case ARES_EFILE: return "ARES_EFILE"; case ARES_ENOMEM: return "ARES_ENOMEM"; case ARES_EDESTRUCTION: return "ARES_EDESTRUCTION"; case ARES_EBADSTR: return "ARES_EBADSTR"; case ARES_EBADFLAGS: return "ARES_EBADFLAGS"; case ARES_ENONAME: return "ARES_ENONAME"; case ARES_EBADHINTS: return "ARES_EBADHINTS"; case ARES_ENOTINITIALIZED: return "ARES_ENOTINITIALIZED"; case ARES_ELOADIPHLPAPI: return "ARES_ELOADIPHLPAPI"; case ARES_EADDRGETNETWORKPARAMS: return "ARES_EADDRGETNETWORKPARAMS"; case ARES_ECANCELLED: return "ARES_ECANCELLED"; default: return "UNKNOWN"; } } std::string RcodeToString(int rcode) { switch (rcode) { case NOERROR: return "NOERROR"; case FORMERR: return "FORMERR"; case SERVFAIL: return "SERVFAIL"; case NXDOMAIN: return "NXDOMAIN"; case NOTIMP: return "NOTIMP"; case REFUSED: return "REFUSED"; case YXDOMAIN: return "YXDOMAIN"; case YXRRSET: return "YXRRSET"; case NXRRSET: return "NXRRSET"; case NOTAUTH: return "NOTAUTH"; case NOTZONE: return "NOTZONE"; case TSIG_BADSIG: return "BADSIG"; case TSIG_BADKEY: return "BADKEY"; case TSIG_BADTIME: return "BADTIME"; default: return "UNKNOWN"; } } std::string RRTypeToString(int rrtype) { switch (rrtype) { case T_A: return "A"; case T_NS: return "NS"; case T_MD: return "MD"; case T_MF: return "MF"; case T_CNAME: return "CNAME"; case T_SOA: return "SOA"; case T_MB: return "MB"; case T_MG: return "MG"; case T_MR: return "MR"; case T_NULL: return "NULL"; case T_WKS: return "WKS"; case T_PTR: return "PTR"; case T_HINFO: return "HINFO"; case T_MINFO: return "MINFO"; case T_MX: return "MX"; case T_TXT: return "TXT"; case T_RP: return "RP"; case T_AFSDB: return "AFSDB"; case T_X25: return "X25"; case T_ISDN: return "ISDN"; case T_RT: return "RT"; case T_NSAP: return "NSAP"; case T_NSAP_PTR: return "NSAP_PTR"; case T_SIG: return "SIG"; case T_KEY: return "KEY"; case T_PX: return "PX"; case T_GPOS: return "GPOS"; case T_AAAA: return "AAAA"; case T_LOC: return "LOC"; case T_NXT: return "NXT"; case T_EID: return "EID"; case T_NIMLOC: return "NIMLOC"; case T_SRV: return "SRV"; case T_ATMA: return "ATMA"; case T_NAPTR: return "NAPTR"; case T_KX: return "KX"; case T_CERT: return "CERT"; case T_A6: return "A6"; case T_DNAME: return "DNAME"; case T_SINK: return "SINK"; case T_OPT: return "OPT"; case T_APL: return "APL"; case T_DS: return "DS"; case T_SSHFP: return "SSHFP"; case T_RRSIG: return "RRSIG"; case T_NSEC: return "NSEC"; case T_DNSKEY: return "DNSKEY"; case T_TKEY: return "TKEY"; case T_TSIG: return "TSIG"; case T_IXFR: return "IXFR"; case T_AXFR: return "AXFR"; case T_MAILB: return "MAILB"; case T_MAILA: return "MAILA"; case T_ANY: return "ANY"; case T_URI: return "URI"; case T_MAX: return "MAX"; default: return "UNKNOWN"; } } std::string ClassToString(int qclass) { switch (qclass) { case C_IN: return "IN"; case C_CHAOS: return "CHAOS"; case C_HS: return "HESIOD"; case C_NONE: return "NONE"; case C_ANY: return "ANY"; default: return "UNKNOWN"; } } std::string AddressToString(const void* vaddr, int len) { const byte* addr = reinterpret_cast(vaddr); std::stringstream ss; if (len == 4) { char buffer[4*4 + 3 + 1]; sprintf(buffer, "%u.%u.%u.%u", (unsigned char)addr[0], (unsigned char)addr[1], (unsigned char)addr[2], (unsigned char)addr[3]); ss << buffer; } else if (len == 16) { for (int ii = 0; ii < 16; ii+=2) { if (ii > 0) ss << ':'; char buffer[4 + 1]; sprintf(buffer, "%02x%02x", (unsigned char)addr[ii], (unsigned char)addr[ii+1]); ss << buffer; } } else { ss << "!" << HexDump(addr, len) << "!"; } return ss.str(); } std::string PacketToString(const std::vector& packet) { const byte* data = packet.data(); int len = packet.size(); std::stringstream ss; if (len < NS_HFIXEDSZ) { ss << "(too short, len " << len << ")"; return ss.str(); } ss << ((DNS_HEADER_QR(data) == 0) ? "REQ " : "RSP "); switch (DNS_HEADER_OPCODE(data)) { case O_QUERY: ss << "QRY "; break; case O_IQUERY: ss << "IQRY "; break; case O_STATUS: ss << "STATUS "; break; case O_NOTIFY: ss << "NOTIFY "; break; case O_UPDATE: ss << "UPDATE "; break; default: ss << "UNKNOWN(" << DNS_HEADER_OPCODE(data) << ") "; break; } if (DNS_HEADER_AA(data)) ss << "AA "; if (DNS_HEADER_TC(data)) ss << "TC "; if (DNS_HEADER_RD(data)) ss << "RD "; if (DNS_HEADER_RA(data)) ss << "RA "; if (DNS_HEADER_Z(data)) ss << "Z "; if (DNS_HEADER_QR(data) == 1) ss << RcodeToString(DNS_HEADER_RCODE(data)); int nquestions = DNS_HEADER_QDCOUNT(data); int nanswers = DNS_HEADER_ANCOUNT(data); int nauths = DNS_HEADER_NSCOUNT(data); int nadds = DNS_HEADER_ARCOUNT(data); const byte* pq = data + NS_HFIXEDSZ; len -= NS_HFIXEDSZ; for (int ii = 0; ii < nquestions; ii++) { ss << " Q:" << QuestionToString(packet, &pq, &len); } const byte* prr = pq; for (int ii = 0; ii < nanswers; ii++) { ss << " A:" << RRToString(packet, &prr, &len); } for (int ii = 0; ii < nauths; ii++) { ss << " AUTH:" << RRToString(packet, &prr, &len); } for (int ii = 0; ii < nadds; ii++) { ss << " ADD:" << RRToString(packet, &prr, &len); } return ss.str(); } std::string QuestionToString(const std::vector& packet, const byte** data, int* len) { std::stringstream ss; ss << "{"; if (*len < NS_QFIXEDSZ) { ss << "(too short, len " << *len << ")"; return ss.str(); } char *name = nullptr; long enclen; int rc = ares_expand_name(*data, packet.data(), packet.size(), &name, &enclen); if (rc != ARES_SUCCESS) { ss << "(error from ares_expand_name)"; return ss.str(); } if (enclen > *len) { ss << "(error, encoded name len " << enclen << "bigger than remaining data " << *len << " bytes)"; return ss.str(); } *len -= enclen; *data += enclen; ss << "'" << name << "' "; ares_free_string(name); if (*len < NS_QFIXEDSZ) { ss << "(too short, len left " << *len << ")"; return ss.str(); } ss << ClassToString(DNS_QUESTION_CLASS(*data)) << " "; ss << RRTypeToString(DNS_QUESTION_TYPE(*data)); *data += NS_QFIXEDSZ; *len -= NS_QFIXEDSZ; ss << "}"; return ss.str(); } std::string RRToString(const std::vector& packet, const byte** data, int* len) { std::stringstream ss; ss << "{"; if (*len < NS_RRFIXEDSZ) { ss << "too short, len " << *len << ")"; return ss.str(); } char *name = nullptr; long enclen; int rc = ares_expand_name(*data, packet.data(), packet.size(), &name, &enclen); if (rc != ARES_SUCCESS) { ss << "(error from ares_expand_name)"; return ss.str(); } if (enclen > *len) { ss << "(error, encoded name len " << enclen << "bigger than remaining data " << *len << " bytes)"; return ss.str(); } *len -= enclen; *data += enclen; ss << "'" << name << "' "; ares_free_string(name); name = nullptr; if (*len < NS_RRFIXEDSZ) { ss << "(too short, len left " << *len << ")"; return ss.str(); } int rrtype = DNS_RR_TYPE(*data); if (rrtype == T_OPT) { ss << "MAXUDP=" << DNS_RR_CLASS(*data) << " "; ss << RRTypeToString(rrtype) << " "; ss << "RCODE2=" << DNS_RR_TTL(*data); } else { ss << ClassToString(DNS_RR_CLASS(*data)) << " "; ss << RRTypeToString(rrtype) << " "; ss << "TTL=" << DNS_RR_TTL(*data); } int rdatalen = DNS_RR_LEN(*data); *data += NS_RRFIXEDSZ; *len -= NS_RRFIXEDSZ; if (*len < rdatalen) { ss << "(RR too long at " << rdatalen << ", len left " << *len << ")"; } else { switch (rrtype) { case T_A: case T_AAAA: ss << " " << AddressToString(*data, rdatalen); break; case T_TXT: { const byte* p = *data; while (p < (*data + rdatalen)) { int len = *p++; if ((p + len) <= (*data + rdatalen)) { std::string txt(p, p + len); ss << " " << len << ":'" << txt << "'"; } else { ss << "(string too long)"; } p += len; } break; } case T_CNAME: case T_NS: case T_PTR: { int rc = ares_expand_name(*data, packet.data(), packet.size(), &name, &enclen); if (rc != ARES_SUCCESS) { ss << "(error from ares_expand_name)"; break; } ss << " '" << name << "'"; ares_free_string(name); break; } case T_MX: if (rdatalen > 2) { int rc = ares_expand_name(*data + 2, packet.data(), packet.size(), &name, &enclen); if (rc != ARES_SUCCESS) { ss << "(error from ares_expand_name)"; break; } ss << " " << DNS__16BIT(*data) << " '" << name << "'"; ares_free_string(name); } else { ss << "(RR too short)"; } break; case T_SRV: { if (rdatalen > 6) { const byte* p = *data; unsigned long prio = DNS__16BIT(p); unsigned long weight = DNS__16BIT(p + 2); unsigned long port = DNS__16BIT(p + 4); p += 6; int rc = ares_expand_name(p, packet.data(), packet.size(), &name, &enclen); if (rc != ARES_SUCCESS) { ss << "(error from ares_expand_name)"; break; } ss << prio << " " << weight << " " << port << " '" << name << "'"; ares_free_string(name); } else { ss << "(RR too short)"; } break; } case T_URI: { if (rdatalen > 4) { const byte* p = *data; unsigned long prio = DNS__16BIT(p); unsigned long weight = DNS__16BIT(p + 2); p += 4; std::string uri(p, p + (rdatalen - 4)); ss << prio << " " << weight << " '" << uri << "'"; } else { ss << "(RR too short)"; } break; } case T_SOA: { const byte* p = *data; int rc = ares_expand_name(p, packet.data(), packet.size(), &name, &enclen); if (rc != ARES_SUCCESS) { ss << "(error from ares_expand_name)"; break; } ss << " '" << name << "'"; ares_free_string(name); p += enclen; rc = ares_expand_name(p, packet.data(), packet.size(), &name, &enclen); if (rc != ARES_SUCCESS) { ss << "(error from ares_expand_name)"; break; } ss << " '" << name << "'"; ares_free_string(name); p += enclen; if ((p + 20) <= (*data + rdatalen)) { unsigned long serial = DNS__32BIT(p); unsigned long refresh = DNS__32BIT(p + 4); unsigned long retry = DNS__32BIT(p + 8); unsigned long expire = DNS__32BIT(p + 12); unsigned long minimum = DNS__32BIT(p + 16); ss << " " << serial << " " << refresh << " " << retry << " " << expire << " " << minimum; } else { ss << "(RR too short)"; } break; } case T_NAPTR: { if (rdatalen > 7) { const byte* p = *data; unsigned long order = DNS__16BIT(p); unsigned long pref = DNS__16BIT(p + 2); p += 4; ss << order << " " << pref; int len = *p++; std::string flags(p, p + len); ss << " " << flags; p += len; len = *p++; std::string service(p, p + len); ss << " '" << service << "'"; p += len; len = *p++; std::string regexp(p, p + len); ss << " '" << regexp << "'"; p += len; int rc = ares_expand_name(p, packet.data(), packet.size(), &name, &enclen); if (rc != ARES_SUCCESS) { ss << "(error from ares_expand_name)"; break; } ss << " '" << name << "'"; ares_free_string(name); } else { ss << "(RR too short)"; } break; } default: ss << " " << HexDump(*data, rdatalen); break; } } *data += rdatalen; *len -= rdatalen; ss << "}"; return ss.str(); } void PushInt32(std::vector* data, int value) { data->push_back((value & 0xff000000) >> 24); data->push_back((value & 0x00ff0000) >> 16); data->push_back((value & 0x0000ff00) >> 8); data->push_back(value & 0x000000ff); } void PushInt16(std::vector* data, int value) { data->push_back((value & 0xff00) >> 8); data->push_back(value & 0x00ff); } std::vector EncodeString(const std::string& name) { std::vector data; std::stringstream ss(name); std::string label; // TODO: cope with escapes while (std::getline(ss, label, '.')) { data.push_back(label.length()); data.insert(data.end(), label.begin(), label.end()); } data.push_back(0); return data; } std::vector DNSQuestion::data() const { std::vector data; std::vector encname = EncodeString(name_); data.insert(data.end(), encname.begin(), encname.end()); PushInt16(&data, rrtype_); PushInt16(&data, qclass_); return data; } std::vector DNSRR::data() const { std::vector data = DNSQuestion::data(); PushInt32(&data, ttl_); return data; } std::vector DNSSingleNameRR::data() const { std::vector data = DNSRR::data(); std::vector encname = EncodeString(other_); int len = encname.size(); PushInt16(&data, len); data.insert(data.end(), encname.begin(), encname.end()); return data; } std::vector DNSTxtRR::data() const { std::vector data = DNSRR::data(); int len = 0; for (const std::string& txt : txt_) { len += (1 + txt.size()); } PushInt16(&data, len); for (const std::string& txt : txt_) { data.push_back(txt.size()); data.insert(data.end(), txt.begin(), txt.end()); } return data; } std::vector DNSMxRR::data() const { std::vector data = DNSRR::data(); std::vector encname = EncodeString(other_); int len = 2 + encname.size(); PushInt16(&data, len); PushInt16(&data, pref_); data.insert(data.end(), encname.begin(), encname.end()); return data; } std::vector DNSSrvRR::data() const { std::vector data = DNSRR::data(); std::vector encname = EncodeString(target_); int len = 6 + encname.size(); PushInt16(&data, len); PushInt16(&data, prio_); PushInt16(&data, weight_); PushInt16(&data, port_); data.insert(data.end(), encname.begin(), encname.end()); return data; } std::vector DNSUriRR::data() const { std::vector data = DNSRR::data(); int len = 4 + target_.size(); PushInt16(&data, len); PushInt16(&data, prio_); PushInt16(&data, weight_); data.insert(data.end(), target_.begin(), target_.end()); return data; } std::vector DNSAddressRR::data() const { std::vector data = DNSRR::data(); int len = addr_.size(); PushInt16(&data, len); data.insert(data.end(), addr_.begin(), addr_.end()); return data; } std::vector DNSSoaRR::data() const { std::vector data = DNSRR::data(); std::vector encname1 = EncodeString(nsname_); std::vector encname2 = EncodeString(rname_); int len = encname1.size() + encname2.size() + 5*4; PushInt16(&data, len); data.insert(data.end(), encname1.begin(), encname1.end()); data.insert(data.end(), encname2.begin(), encname2.end()); PushInt32(&data, serial_); PushInt32(&data, refresh_); PushInt32(&data, retry_); PushInt32(&data, expire_); PushInt32(&data, minimum_); return data; } std::vector DNSOptRR::data() const { std::vector data = DNSRR::data(); int len = 0; for (const DNSOption& opt : opts_) { len += (4 + opt.data_.size()); } PushInt16(&data, len); for (const DNSOption& opt : opts_) { PushInt16(&data, opt.code_); PushInt16(&data, opt.data_.size()); data.insert(data.end(), opt.data_.begin(), opt.data_.end()); } return data; } std::vector DNSNaptrRR::data() const { std::vector data = DNSRR::data(); std::vector encname = EncodeString(replacement_); int len = (4 + 1 + flags_.size() + 1 + service_.size() + 1 + regexp_.size() + encname.size()); PushInt16(&data, len); PushInt16(&data, order_); PushInt16(&data, pref_); data.push_back(flags_.size()); data.insert(data.end(), flags_.begin(), flags_.end()); data.push_back(service_.size()); data.insert(data.end(), service_.begin(), service_.end()); data.push_back(regexp_.size()); data.insert(data.end(), regexp_.begin(), regexp_.end()); data.insert(data.end(), encname.begin(), encname.end()); return data; } std::vector DNSPacket::data() const { std::vector data; PushInt16(&data, qid_); byte b = 0x00; if (response_) b |= 0x80; b |= ((opcode_ & 0x0f) << 3); if (aa_) b |= 0x04; if (tc_) b |= 0x02; if (rd_) b |= 0x01; data.push_back(b); b = 0x00; if (ra_) b |= 0x80; if (z_) b |= 0x40; if (ad_) b |= 0x20; if (cd_) b |= 0x10; b |= (rcode_ & 0x0f); data.push_back(b); int count = questions_.size(); PushInt16(&data, count); count = answers_.size(); PushInt16(&data, count); count = auths_.size(); PushInt16(&data, count); count = adds_.size(); PushInt16(&data, count); for (const std::unique_ptr& question : questions_) { std::vector qdata = question->data(); data.insert(data.end(), qdata.begin(), qdata.end()); } for (const std::unique_ptr& rr : answers_) { std::vector rrdata = rr->data(); data.insert(data.end(), rrdata.begin(), rrdata.end()); } for (const std::unique_ptr& rr : auths_) { std::vector rrdata = rr->data(); data.insert(data.end(), rrdata.begin(), rrdata.end()); } for (const std::unique_ptr& rr : adds_) { std::vector rrdata = rr->data(); data.insert(data.end(), rrdata.begin(), rrdata.end()); } return data; } } // namespace ares ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/dns-proto.h0000644000175100001770000002010600000000000021154 0ustar00runnerdocker00000000000000// -*- mode: c++ -*- #ifndef DNS_PROTO_H #define DNS_PROTO_H // Utilities for processing DNS packet contents #include "ares_setup.h" #include "ares.h" // Include ares internal file for DNS protocol constants #include "ares_nameser.h" #include #include #include namespace ares { typedef unsigned char byte; std::string HexDump(std::vector data); std::string HexDump(const byte *data, int len); std::string HexDump(const char *data, int len); std::string StatusToString(int status); std::string RcodeToString(int rcode); std::string RRTypeToString(int rrtype); std::string ClassToString(int qclass); std::string AddressToString(const void* addr, int len); // Convert DNS protocol data to strings. // Note that these functions are not defensive; they assume // a validly formatted input, and so should not be used on // externally-determined inputs. std::string PacketToString(const std::vector& packet); std::string QuestionToString(const std::vector& packet, const byte** data, int* len); std::string RRToString(const std::vector& packet, const byte** data, int* len); // Manipulate DNS protocol data. void PushInt32(std::vector* data, int value); void PushInt16(std::vector* data, int value); std::vector EncodeString(const std::string& name); struct DNSQuestion { DNSQuestion(const std::string& name, int rrtype, int qclass) : name_(name), rrtype_(rrtype), qclass_(qclass) {} DNSQuestion(const std::string& name, int rrtype) : name_(name), rrtype_(rrtype), qclass_(C_IN) {} virtual ~DNSQuestion() {} virtual std::vector data() const; std::string name_; int rrtype_; int qclass_; }; struct DNSRR : public DNSQuestion { DNSRR(const std::string& name, int rrtype, int qclass, int ttl) : DNSQuestion(name, rrtype, qclass), ttl_(ttl) {} DNSRR(const std::string& name, int rrtype, int ttl) : DNSQuestion(name, rrtype), ttl_(ttl) {} virtual ~DNSRR() {} virtual std::vector data() const = 0; int ttl_; }; struct DNSAddressRR : public DNSRR { DNSAddressRR(const std::string& name, int rrtype, int ttl, const byte* addr, int addrlen) : DNSRR(name, rrtype, ttl), addr_(addr, addr + addrlen) {} DNSAddressRR(const std::string& name, int rrtype, int ttl, const std::vector& addr) : DNSRR(name, rrtype, ttl), addr_(addr) {} virtual std::vector data() const; std::vector addr_; }; struct DNSARR : public DNSAddressRR { DNSARR(const std::string& name, int ttl, const byte* addr, int addrlen) : DNSAddressRR(name, T_A, ttl, addr, addrlen) {} DNSARR(const std::string& name, int ttl, const std::vector& addr) : DNSAddressRR(name, T_A, ttl, addr) {} }; struct DNSAaaaRR : public DNSAddressRR { DNSAaaaRR(const std::string& name, int ttl, const byte* addr, int addrlen) : DNSAddressRR(name, T_AAAA, ttl, addr, addrlen) {} DNSAaaaRR(const std::string& name, int ttl, const std::vector& addr) : DNSAddressRR(name, T_AAAA, ttl, addr) {} }; struct DNSSingleNameRR : public DNSRR { DNSSingleNameRR(const std::string& name, int rrtype, int ttl, const std::string& other) : DNSRR(name, rrtype, ttl), other_(other) {} virtual std::vector data() const; std::string other_; }; struct DNSCnameRR : public DNSSingleNameRR { DNSCnameRR(const std::string& name, int ttl, const std::string& other) : DNSSingleNameRR(name, T_CNAME, ttl, other) {} }; struct DNSNsRR : public DNSSingleNameRR { DNSNsRR(const std::string& name, int ttl, const std::string& other) : DNSSingleNameRR(name, T_NS, ttl, other) {} }; struct DNSPtrRR : public DNSSingleNameRR { DNSPtrRR(const std::string& name, int ttl, const std::string& other) : DNSSingleNameRR(name, T_PTR, ttl, other) {} }; struct DNSTxtRR : public DNSRR { DNSTxtRR(const std::string& name, int ttl, const std::vector& txt) : DNSRR(name, T_TXT, ttl), txt_(txt) {} virtual std::vector data() const; std::vector txt_; }; struct DNSMxRR : public DNSRR { DNSMxRR(const std::string& name, int ttl, int pref, const std::string& other) : DNSRR(name, T_MX, ttl), pref_(pref), other_(other) {} virtual std::vector data() const; int pref_; std::string other_; }; struct DNSSrvRR : public DNSRR { DNSSrvRR(const std::string& name, int ttl, int prio, int weight, int port, const std::string& target) : DNSRR(name, T_SRV, ttl), prio_(prio), weight_(weight), port_(port), target_(target) {} virtual std::vector data() const; int prio_; int weight_; int port_; std::string target_; }; struct DNSUriRR : public DNSRR { DNSUriRR(const std::string& name, int ttl, int prio, int weight, const std::string& target) : DNSRR(name, T_URI, ttl), prio_(prio), weight_(weight), target_(target) {} virtual std::vector data() const; int prio_; int weight_; std::string target_; }; struct DNSSoaRR : public DNSRR { DNSSoaRR(const std::string& name, int ttl, const std::string& nsname, const std::string& rname, int serial, int refresh, int retry, int expire, int minimum) : DNSRR(name, T_SOA, ttl), nsname_(nsname), rname_(rname), serial_(serial), refresh_(refresh), retry_(retry), expire_(expire), minimum_(minimum) {} virtual std::vector data() const; std::string nsname_; std::string rname_; int serial_; int refresh_; int retry_; int expire_; int minimum_; }; struct DNSNaptrRR : public DNSRR { DNSNaptrRR(const std::string& name, int ttl, int order, int pref, const std::string& flags, const std::string& service, const std::string& regexp, const std::string& replacement) : DNSRR(name, T_NAPTR, ttl), order_(order), pref_(pref), flags_(flags), service_(service), regexp_(regexp), replacement_(replacement) {} virtual std::vector data() const; int order_; int pref_; std::string flags_; std::string service_; std::string regexp_; std::string replacement_; }; struct DNSOption { int code_; std::vector data_; }; struct DNSOptRR : public DNSRR { DNSOptRR(int extrcode, int udpsize) : DNSRR("", T_OPT, static_cast(udpsize), extrcode) {} virtual std::vector data() const; std::vector opts_; }; struct DNSPacket { DNSPacket() : qid_(0), response_(false), opcode_(O_QUERY), aa_(false), tc_(false), rd_(false), ra_(false), z_(false), ad_(false), cd_(false), rcode_(NOERROR) {} // Convenience functions that take ownership of given pointers. DNSPacket& add_question(DNSQuestion *q) { questions_.push_back(std::unique_ptr(q)); return *this; } DNSPacket& add_answer(DNSRR *q) { answers_.push_back(std::unique_ptr(q)); return *this; } DNSPacket& add_auth(DNSRR *q) { auths_.push_back(std::unique_ptr(q)); return *this; } DNSPacket& add_additional(DNSRR *q) { adds_.push_back(std::unique_ptr(q)); return *this; } // Chainable setters. DNSPacket& set_qid(int qid) { qid_ = qid; return *this; } DNSPacket& set_response(bool v = true) { response_ = v; return *this; } DNSPacket& set_aa(bool v = true) { aa_ = v; return *this; } DNSPacket& set_tc(bool v = true) { tc_ = v; return *this; } DNSPacket& set_rd(bool v = true) { rd_ = v; return *this; } DNSPacket& set_ra(bool v = true) { ra_ = v; return *this; } DNSPacket& set_z(bool v = true) { z_ = v; return *this; } DNSPacket& set_ad(bool v = true) { ad_ = v; return *this; } DNSPacket& set_cd(bool v = true) { cd_ = v; return *this; } DNSPacket& set_rcode(int rcode) { rcode_ = rcode; return *this; } // Return the encoded packet. std::vector data() const; int qid_; bool response_; int opcode_; bool aa_; bool tc_; bool rd_; bool ra_; bool z_; bool ad_; bool cd_; int rcode_; std::vector> questions_; std::vector> answers_; std::vector> auths_; std::vector> adds_; }; } // namespace ares #endif ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzcheck.sh0000755000175100001770000000020400000000000021406 0ustar00runnerdocker00000000000000#!/bin/sh set -e # Check that all of the base fuzzing corpus parse without errors ./aresfuzz fuzzinput/* ./aresfuzzname fuzznames/* ././@PaxHeader0000000000000000000000000000003400000000000011452 xustar000000000000000028 mtime=1696604227.0114155 pycares-4.4.0/deps/c-ares/test/fuzzinput/0000755000175100001770000000000000000000000021135 5ustar00runnerdocker00000000000000././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/004a216d3cff18b0c5c6b68b807f15290000644000175100001770000000004000000000000025341 0ustar00runnerdocker00000000000000awwwgooglecom././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/00539467ca159b36aea95e61f97291150000644000175100001770000000012200000000000025143 0ustar00runnerdocker00000000000000I8888in-addrarpa  T_ google-public-dns-agooglecom././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/00e846db8f43f2f507cd1666ed5a753e0000644000175100001770000000007600000000000025453 0ustar00runnerdocker00000000000000wwwgooglecomwwwgooglecomd././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/0177b7566f08c013699eaea9a77abeb30000644000175100001770000000010000000000000025435 0ustar00runnerdocker00000000000000wwwexamplecomwwwexamplecomd././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/020a4fa317715bfdb236ed13751e6b650000644000175100001770000000003700000000000025340 0ustar00runnerdocker00000000000000$wwwfirstcom././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/0310f2e81bea31f4fe3f330872a877dd0000644000175100001770000000010400000000000025424 0ustar00runnerdocker00000000000000ׄexamplecomexamplecomd!!././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/0449be67df1730b2d0887d412a9b7cc40000644000175100001770000000004100000000000025353 0ustar00runnerdocker00000000000000|wwwexamplecom././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/0449dd14f7aa94bf0d716bfe09b287a80000644000175100001770000000003700000000000025525 0ustar00runnerdocker00000000000000Wwwwthirdgov././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/04c93cdf7208979aa4df80a3a0d5a2d80000644000175100001770000000003700000000000025516 0ustar00runnerdocker00000000000000!kwwwfirstcom././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/0567e7171e08e75f3f91c4ca74c17adc0000644000175100001770000000004000000000000025440 0ustar00runnerdocker00000000000000Fwwwsecondorg././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/05ba948578a397e9cbc6a7b3e78622fa0000644000175100001770000000010000000000000025451 0ustar00runnerdocker00000000000000;wwwexamplecomwwwexamplecomd././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/060afe5ed25f3e2e86167e545f27edca0000644000175100001770000000021000000000000025577 0ustar00runnerdocker00000000000000K%googlecom Walt1aspmxl W (alt3/ W 2alt4/ W alt2/ W /././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/06d47d3681493f1b1d41236f460d896f0000644000175100001770000000007400000000000025152 0ustar00runnerdocker00000000000000%Pwwwthirdgovwwwthirdgov././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/0724a810b0e131c2fddb6de9003b90640000644000175100001770000000004100000000000025322 0ustar00runnerdocker00000000000000Vuwwwexamplecom././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/0b5279148826f5b962bcf1896bdb4ede0000644000175100001770000000014600000000000025461 0ustar00runnerdocker00000000000000] localhost@a root-serversnetnstld verisign-grscomx*9L :Q././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/114048c0f6b10bdc67ce9166405d195e0000644000175100001770000000007600000000000025273 0ustar00runnerdocker00000000000000~wwwgooglecomwwwgooglecom././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/11b8464a0ef8735d202955c34c36b0c70000644000175100001770000000011400000000000025205 0ustar00runnerdocker00000000000000 -abcwwwfirstcomabcwwwfirstcom././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/11cb626f1668c7b41954ce7d768fe5280000644000175100001770000000007400000000000025325 0ustar00runnerdocker00000000000000[}wwwgooglecom *P@  ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/14b133bf18125b75a1976fa63a1df6b70000644000175100001770000000007600000000000025352 0ustar00runnerdocker00000000000000u+wwwgooglecomwwwgooglecomd././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/153c6b3afa8faa03c8bc28f936a6d4cf0000644000175100001770000000010300000000000025725 0ustar00runnerdocker00000000000000`examplecomexamplecomd elsewherecom././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/182cad2a342ed7317b7c21a5d17020d10000644000175100001770000000007400000000000025322 0ustar00runnerdocker00000000000000(܄wwwfirstcomwwwfirstcom././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/1c61a61bb7057b52c5b15188345a52380000644000175100001770000000002500000000000025117 0ustar00runnerdocker00000000000000:www././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/1dbe2cf62ed2e4fa1c3cb473f08710b50000644000175100001770000000003500000000000025636 0ustar00runnerdocker00000000000000?pabcwww././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/21199be504fcfece5c7096ee0dbba5070000644000175100001770000000015300000000000025655 0ustar00runnerdocker00000000000000;examplecomexamplecomdexamplecomd!!././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/21891480074b5635dbbe7137bdcabccd0000644000175100001770000000004000000000000025477 0ustar00runnerdocker00000000000000#wwwsecondorg././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/233aea42e15aa73e131eefabf16088c90000644000175100001770000000004000000000000025553 0ustar00runnerdocker00000000000000+,wwwgooglecom././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/24660d4e7ac7aa21d600ea7a3d198bbb0000644000175100001770000000015400000000000025554 0ustar00runnerdocker00000000000000U100127in-addrarpa x8bin-addr-serversnstldianaorgx :././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/25589deb55c08429345f289d1c9b02540000644000175100001770000000007100000000000025154 0ustar00runnerdocker00000000000000j_imap_tcpgmailcom! !T_././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/2573bd823e4da11f727a17f8e1f35c260000644000175100001770000000003500000000000025355 0ustar00runnerdocker00000000000000vexamplecom././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/276f12da56866273e76059ad0e7be97e0000644000175100001770000000004000000000000025316 0ustar00runnerdocker00000000000000u+wwwgooglecom././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/29198a2e380cb19babec9e02116d213e0000644000175100001770000000003500000000000025420 0ustar00runnerdocker00000000000000Lexamplecom././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/2c94ba9434b1a1b9396fc5364f1013630000644000175100001770000000005000000000000025204 0ustar00runnerdocker00000000000000wwwwww././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/2d578c357dc2f5e02dc55cddb30641d10000644000175100001770000000014600000000000025510 0ustar00runnerdocker00000000000000$ localhosto@a root-serversnetnstld verisign-grscomx*9L :Q././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/2dff6cc5a223e67fde9e5e79af4569920000644000175100001770000000020600000000000025633 0ustar00runnerdocker00000000000000(܁88880000000000000000068406841002ip6arpa  T_ google-public-dns-agooglecom././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/2f103b1f9477f2d8934bd84328d51c750000644000175100001770000000015600000000000025235 0ustar00runnerdocker00000000000000bexamplecomexamplecomdexamplecomd examplecomd././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/31cd3a8413de13d9624adbb1613784bf0000644000175100001770000000004000000000000025415 0ustar00runnerdocker00000000000000Cwwwgooglecom././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/36415bdf1d180098fe6234b4186e69f30000644000175100001770000000003700000000000025231 0ustar00runnerdocker00000000000000;wwwthirdgov././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/3a04a80f0242e8dff0cd732e7c4767da0000644000175100001770000000057100000000000025515 0ustar00runnerdocker00000000000000Agooglecom +: +*P@   W(alt3aspmxl T_ns3 ;"q dns-admin < $#v=spf1 include:_spf.google.com ~all W alt2[ W [ W 2alt4[ T_issuesymantec.com T_ns4 T_ns1 T_ns2 W alt1[././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/44d0f973b7b0fb3e4a07770c943dcd5a0000644000175100001770000000004000000000000025507 0ustar00runnerdocker00000000000000„wwwgooglecom././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/50bc00daa0ddcd6cfb2b5d9f62c81f470000644000175100001770000000011400000000000025774 0ustar00runnerdocker00000000000000Jgooglecom $#v=spf1 include:_spf.google.com ~all././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/51ed2d1fb77b3078b54e94e85606b7df0000644000175100001770000000024000000000000025451 0ustar00runnerdocker00000000000000ځ10000000000000000000000000000000ip6arpa L:b ip6-serversP hostmastericannorgxW  :././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/5c5e0e899cf2e7d053a9e45fb76f6e5a0000644000175100001770000000007000000000000025624 0ustar00runnerdocker00000000000000҅examplecomexamplecomd././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/70152ed033f139443fbfb1b858bb3b1b0000644000175100001770000000004000000000000025411 0ustar00runnerdocker00000000000000džwwwgooglecom././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/7030ca2b24e5a7f9dd8f62096a48eb330000644000175100001770000000006000000000000025433 0ustar00runnerdocker00000000000000wwwgooglecom :././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/71eec1a0ef2d25bb9e2ef17f23be7e9e0000644000175100001770000000013400000000000026017 0ustar00runnerdocker000000000000001@a root-serversnetnstld verisign-grscomx*9L :Q././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/7a6b0177210ea4ef40b254daf99393c50000644000175100001770000000013600000000000025353 0ustar00runnerdocker00000000000000y020192in-addrarpa *zarinnetdns-ops6x*2W *0././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/7f1567733711ffb61839621af0cbfa330000644000175100001770000000002500000000000025275 0ustar00runnerdocker00000000000000Ԅwww././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/850c6d57c5bb7be8205fc2438d14d7e50000644000175100001770000000026300000000000025447 0ustar00runnerdocker00000000000000kā4030000000000000000020108bd01002ip6arpa @Mns1apnicnet'read-txt-record-of-zone-first-dns-adminj  :././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/a5c8cd2784a5792b9e91c2d7895b3b340000644000175100001770000000014600000000000025403 0ustar00runnerdocker00000000000000򙁃 localhosto@a root-serversnetnstld verisign-grscomx*9L :Q././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/a9135cdc7151d023300ff194bad90af90000644000175100001770000000014600000000000025421 0ustar00runnerdocker00000000000000j0 localhost@a root-serversnetnstld verisign-grscomx*9L :Q././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/af2597e8ac7dec1e8b4a47518312912a0000644000175100001770000000014400000000000025441 0ustar00runnerdocker00000000000000Agooglecom T_ns1 T_ns3 T_ns4 T_ns2 ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/answer_a0000644000175100001770000000007600000000000022662 0ustar00runnerdocker00000000000000 wwwgooglecomwwwgooglecom././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/answer_aaaa0000644000175100001770000000007600000000000023325 0ustar00runnerdocker00000000000000wwwgooglecomwwwgooglecom././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/b3f53ef826b831bb09dd25c7f59602490000644000175100001770000000007000000000000025367 0ustar00runnerdocker00000000000000Їexamplecomexamplecomd././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/cda0f8751f5c4993974c2b549d29bcc80000644000175100001770000000014600000000000025466 0ustar00runnerdocker00000000000000Ʈ localhostm@a root-serversnetnstld verisign-grscomx*9L :Q././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/ce6c26c0e469339873d0e7f616ab09450000644000175100001770000000006000000000000025310 0ustar00runnerdocker00000000000000YLwwwgooglecom :Մ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/clusterfuzz-56377905840128000000644000175100001770000000005000000000000025231 0ustar00runnerdocker00000000000000+...@U޻././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/clusterfuzz-56506958914519040000644000175100001770000000004000000000000025244 0ustar00runnerdocker00000000000000    ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/clusterfuzz-56513698322186240000644000175100001770000000036200000000000025245 0ustar00runnerdocker00000000000000[(!(((((((((]((((././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/clusterfuzz-56744622607564800000644000175100001770000000322200000000000025244 0ustar00runnerdocker00000000000000u $                              %            % ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/clusterfuzz-56806306726543360000644000175100001770000000365500000000000025254 0ustar00runnerdocker00000000000000                                             ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/clusterfuzz-56834971606712320000644000175100001770000014645600000000000025263 0ustar00runnerdocker00000000000000  3   u @!%!!%!!'! p ( + !!  + ! D###LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL,u+$ A     5 1(5 1(5 1(5   y,@yyUy,,,, @yy,y,u @!%!!%!!'! p ( + !!  + ! D###LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL,u+$ A     u @!%!!%!!'! p ( + !!  + ! D###LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL,u+$ A     u @!%!!%!!'! p ( + !!  + ! D###LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL,u+$ A ,,, @yy,y,u @!%!!%!!'! p ( + !!  + ! D###LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL,u+$ A     (5 1(5 1(5 1(5   y,@yyUy,,,, @yy,y,u @!%!!%!!'! p ( + !!  + ! D###LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL,u+$ A     5 1(5 1(5 1(5   y,@yyUy,,,, @yy,y,u @!%!!%!!'! p ( + !!  + ! D###LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL,u+$ A     u @!%!!%!!'! p ( + !!  + ! D###LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL,u+$ A     5 1(5 1(5 1(5   y,@yyUy,,,, @yy,y,u @!%!!%!!'! p ( + !!  + ! D###LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL,u+$ A     u @!%!!%!!'! p ( + !!  + ! D###LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL,u+$ A     5 1(5 1(5 1(5   y,@yyUy,,,, @yy,y,    ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/clusterfuzz-56873106554224640000644000175100001770000000142500000000000025243 0ustar00runnerdocker00000000000000u*uuuuu2uuu4uu ?   ? ~u3)~      2)~ uuuuu2uu u*uu* uuu*uuu# uuuuu2uuu*uuuuu* uuu*uuu*././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/clusterfuzz-56953415731773440000644000175100001770000000005400000000000025246 0ustar00runnerdocker00000000000000    ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/clusterfuzz-56978351036825600000644000175100001770000000037300000000000025252 0ustar00runnerdocker00000000000000u$@. !h;;pd!ho!h;;pd!hod;p  !h;;pd!ho ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/clusterfuzz-57285180816097280000644000175100001770000000163200000000000025254 0ustar00runnerdocker00000000000000[E((((((((((((((((((((((((((( ( ( (()((((((((( ((((((((( (././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/clusterfuzz-57329600173178880000644000175100001770000062555500000000000025272 0ustar00runnerdocker00000000000000  i%                                                                                                                       ;                                     /              !                     ;                                           %                      y,9,,, @y y,y,,,,, @yy,y9@y,8,,, y,@yyUy,,,, @yy,y,-*@y,9@y,9,,, @yy,y,0-@y,9,,, F@y y,y,,, ,, @, @yyUy,,,, @yy,yLL:::::::::::::::::::::::::::::::::::::%L'L%[ k((,i%#.yyyyyyyyyyyyyyyyyqyyyyyyyyyyyyyyyyyyyyyyyyi%#.(](@(<(((]`(@(<(((](@(p ((](@(p((](k}Rk!k@y y,y,,,,, @yy,y0@y,8,r,,, y,@yyUy,,,, @yy,y,,-*@y,y,,, @yy,y,,-*@y,9@,, @yy,y,0-@Cy,9,,, @y y,y,,,,, @yy,y4@y,8,,, y,@yyUy,,,, @yy,y,,-*@y, @, @yyUy,[ k(((((((,,, @yyyU(y,,,, 9@y,9,,, @yy,y,0-@y,9,,, @y y,y, @yy,y0@y, @yy,y,,,-*@y,5@,, @yy,y,y,@yyUy,,,, @yy,y,,-*@y,4@y,8,,, @y @y y,yu+$?LLi.......................................................,3.............../1 Ku+('!'*(&u+Yu+('!/0 1(6 ((((( #####LaL)              ;                                           %                                                                                     @                                                                            %                                               =                                                                                                                  =                                                                                                      k                                  % /1 K/1 Ku+('!'*(&u+Yu+('!/0 1(6 ((((( #####LaL)Yu+('!/0 1(6               /              !                     ;                                           %                                              :                                                  (5 'n;                                                                                      =                                                                                                      k                                  %                                               =                                                                                                                                                                  ;                                     /                                   ;                                           %                                                                                                                                                                                                                         /                                   ;            =                                                                                                                                         %                                               =                                                                                                                       ;   (                                                                      @ "                          ;   (                                                              @ "                                                ;                           ;                              !                     ;                                           %                                                                                                                                                                                             ,                                                                                      %                       1                        =                    &                                                                                                                       LL%L'L%[ k((,i%#.yyyyyyyyyyyyyyyyyqyyyyyyyyyyyyyyyyyyyyyyyyi%#.(](@(<(((]`(@(<(((](@(p ((](@(p((](k}Rk!k@y y,y,,,,, @yy,y0@y,8,r,,, y,@yyUy,,,, @yy,y,,-*@y,y,,, @yy,y,,-*@y,9@,, @yy,y,0-@Cy,9,,, @y y,y,,,,, @yy,y4@y,8,,, y,@yyUy,,,, @yy,y,,-*@y, @, @yyUy,[ k(((((((,,, @yyyU(y,,,, 9@y,9,,, @yy,y,0-@y,9,,, @y y,y, @yy,y0@y, @yy,y,,,-*@y,5@,, @yy,y,y,@yyUy,,,, @yy,y,,-*@y,4@y,8,,, @y @y y,yu+$?LLi.......................................................,3.............../1 Ku+('!'*(&u+Yu+('!/0 1(6 ((((( #####LaL)              ;                                           %                                                                                     @                                                                            %                                               =                                                                                                                  =                                                                                                      k                                  % /1 K/1 Ku+('!'*(&u+Yu+('!/0 1(6 ((((( #####LaL)Yu+('!/0 1(6 ((( #CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC333333  .!T_ma ( :+.T_CCC!CCCCBCCCCCCmau}!}+, +@,(  !T!  ,_.............~4 $q .........    ..'1 1le%3        u+(';"cop9/1 Ku+('!'*(&u+Yu+('!/0 1(6 ((((( #####LaL)Yu+('!/0 1(6               /              !                     ;                                           %                                              :                                                  (5 'n;                                                                                      =                                                                                                      k                                  %                                               =                                                                                                                                                                  ;                                     /                                   ;                                           %                                                                                                                                                                                                                         /                                   ;            =                                                                                                                                         %                                               =                                                                                                                       ;   (                                                                      @ "                          ;   (                                                              @ "                                                ;                           ;                              !                     ;                                           %                                                                                                                                                                                             ,                                                                                      %                       1                        =                    &                                                                                                                       LL%L'L%[ k((,i%#.yyyyyyyyyyyyyyyyyqyyyyyyyyyyyyyyyyyyyyyyyyi%#.(](@(<(((]`(@(<(((](@(p ((](@(p((](k}Rk!k@y y,y,,,,, @yy,y0@y,8,r,,, y,@yyUy,,,, @yy,y,,-*@y,y,,, @yy,y,,-*@y,9@,, @yy,y,0-@Cy,9,,, @y y,y,,,,, @yy,y4@y,8,,, y,@yyUy,,,, @yy,y,,-*@y, @, @yyUy,[ k(((((((,,, @yyyU(y,,,, 9@y,9,,, @yy,y,0-@y,9,,, @y y,y, @yy,y0@y, @yy,y,,,-*@y,5@,, @yy,y,y,@yyUy,,,, @yy,y,,-*@y,4@y,8,,, @y @y y,yu+$?LLi.......................................................,3.............../1 Ku+('!'*(&u+Yu+('!/0 1(6 ((((( #####LaL)              ;                                           %                                                                                     @                                                                            %                                               =                                                                                                                  =                                                                                                      k                                  % /1 K/1 Ku+('!'*(&u+Yu+('!/0 1(6 ((((( #####LaL)Yu+('!/0 1(6 ((( #CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC333333  .!T_ma ( :+.T_CCC!CCCCBCCCCCCmau}!}+, +@,(  !T!  ,_.............~4 $q .........    ..'1 1le%3        u+(';"cop9u+('!'*(&u+Yu+('!/0 1(6 ((((( #####LaL)Yu+('!/0 1(6 ((( #CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC333333  .!T_ma ( :+.T_CCC!CCCCBCCCCCCmau}!}+, +@,(  !T!  ,_.............~4 $q .........    ..'1 1le%3        u+(';"cop9(5 'n;                                                jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj                                                                                                                    %                =                                                                                                                                                   ;                                     /              !                     ;                                           %                                              :                                                  (5 'n;                                                                  jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj  jj     %                                                                                     @                                  k}Rk!'L%[ k((,i%#.yyyyyyyyyyyyyyyyyqyyyyyyyyyyyyyyyyyyyyyyyyi%#.(](@(<(((]`(@(<(((](@(p ((](@(p((](k}Rk!Vk[ k((,i%#.yyyyyyyyyyyyyyyyyqyyyyyyyyyyyyyyyyyyyyyyyyi%#.(](@(<(,,, @yy,, @yy,y,,-@y y,y,,*@y,4@y,9,,, @y y,y,,,,, @yy,y4@y,8#,,, y,@yyUy,,,, @yy,y,,-*@y,,,, @yy,y0@y,8,r,,, y,@yyUy,,,, @yy,y,@,-*@y,y,,, @yy,y,,9                                              ;                                     /              !                     ;                    h                       %                                                                                                                                                                                                                         ;                                     /                                   ;                                           %                                                                                     @                                                                            %                                               =                    &                                                                                                                      =                                                                                   %                                               =                                                                                                                       ;   (                                                                      @ "                          ;   (                                                              @ "                                                ;                           ;                              !                     ;                                           %                                                                                            k                                  % /1 K/1 Ku+('!'*(&u+Yu+('!/0 1(6 ((((( #####LaL)Yu+('!/0 1(6 ((( #CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC333333  .!T_ma ( :+.T_CCC!CCCCBCCCCCCmau}!}+, +@,(  !T!  ,_.............~4 $q .........    ..'1 1le%3        u+(';"cop9u+('!'*(&u+Yu+('!/0 1(6 ((((( #####LaLy0@y,8,r,,, y,@yyUy,,,, @yy,y,,-*@y,y,,, @yy,y,,-*@y,9@,, @yy,y,0-!@Cy,9,,, @y y,y,,,,, @yy,y4@y,8,,, y,@yyUy,,,, @yy,y,,-*@y, @, @yyUy,[ k((@y,9@,, @yy,y,+0-@y,9,,, @y y,y,,,,, @yy,y9@y,8,,yy,y, 0-@y,9,,yy,y,0-@y,9,,, @y y,y,,,,y,0-, @y y,y,,,,, @yy,y9@y,8,,, y,@yyUy,,,, @yy,y,,-*@y,4@y,9,,, @y @y y,y,,,,, @yy,yL                                     %                          /              !                     ;                                           %                                                  ;                                     /              !                     ;                                           %                                              :                                                  (5 'n;                                                               /1 Ku+('!'*(&u+Yu+('!/0 1(6 ((((( ####   jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj  jj #LaL)              ;                                           %                                                                                     @                                                                            %                                               =                    &                                                                  %                                                                                                                              @                                  u+(';"cop9(5                =              'n;     ,9,,, @y y,y,,,,, @y            k!                           k                                  % /1 K/1 Ku+('!'*(&u+Yu+('!/0 1(6 ((((( #####La@y y,y,,,,, @yy,y0@y,8,r,,, y,@yyUy,,,, @yLy,y,,-*@y,y,,, @yy,y,,-*@y,9@,, @yy,y,0-@Cy,9,,, @y y,y,,,,, @yy,y4@y,8,)././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/e4dd7e7c2dd4ed7c2e17a6af5d04f9c90000644000175100001770000000012300000000000026030 0ustar00runnerdocker00000000000000ZAwwwyoutubecom S youtube-uilgoogle-+:n././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/ed50ed8ee36230a5a69746ad830437e50000644000175100001770000000006000000000000025361 0ustar00runnerdocker00000000000000쁀wwwgooglecom 3:D././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/f1b900d50806021953321c3b604ee4970000644000175100001770000000015400000000000025042 0ustar00runnerdocker00000000000000(100127in-addrarpa 8bin-addr-serversnstldianaorgx :././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/f6606f624be8c628328cea01d2cd07a90000644000175100001770000000004500000000000025437 0ustar00runnerdocker00000000000000abccom##././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/f89f6c8176b564a7dd646f14305573ce0000644000175100001770000000006000000000000025322 0ustar00runnerdocker00000000000000LPwwwgooglecom :d././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/f9ad508d2dbd08d3aaaabc7d1174677d0000644000175100001770000000011600000000000025726 0ustar00runnerdocker00000000000000*3googlecom ;&ns2 dns-admin <././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzzinput/multi-indir0000644000175100001770000002257600000000000023331 0ustar00runnerdocker00000000000000340282366920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211458(920938463463374607431768211459(4294967297(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(1󠁈(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459(920938463463374607431768211459././@PaxHeader0000000000000000000000000000003400000000000011452 xustar000000000000000028 mtime=1696604227.0114155 pycares-4.4.0/deps/c-ares/test/fuzznames/0000755000175100001770000000000000000000000021101 5ustar00runnerdocker00000000000000././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzznames/name010000644000175100001770000000001300000000000022077 0ustar00runnerdocker00000000000000normal.name././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzznames/name020000644000175100001770000000001300000000000022100 0ustar00runnerdocker00000000000000singlelabel././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzznames/name030000644000175100001770000000012700000000000022107 0ustar00runnerdocker00000000000000www.labelismuchtoolong012345678901234567890123456789012345678901234567890123456789.com ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzznames/name040000644000175100001770000000003100000000000022102 0ustar00runnerdocker00000000000000labelwithescaped\.dot.dot././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzznames/name050000644000175100001770000000002400000000000022105 0ustar00runnerdocker00000000000000escaped.dot.at.end\.././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzznames/name060000644000175100001770000000001600000000000022107 0ustar00runnerdocker00000000000000absolute.name.././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzznames/name070000644000175100001770000000001400000000000022106 0ustar00runnerdocker00000000000000empty..label././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzznames/name080000644000175100001770000000002200000000000022106 0ustar00runnerdocker00000000000000utf8.££.data.com././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/fuzznames/name090000644000175100001770000000003700000000000022115 0ustar00runnerdocker00000000000000astral.plane.utf8.name.𐀀.org././@PaxHeader0000000000000000000000000000003400000000000011452 xustar000000000000000028 mtime=1696604227.0114155 pycares-4.4.0/deps/c-ares/test/gmock-1.11.0/0000755000175100001770000000000000000000000020673 5ustar00runnerdocker00000000000000././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/gmock-1.11.0/README.md0000644000175100001770000000060100000000000022147 0ustar00runnerdocker00000000000000Creating Combined gmock release =============================== ``` wget https://github.com/google/googletest/archive/refs/tags/release-1.11.0.tar.gz && \ tar -zxvpf release-1.11.0.tar.gz && \ python3 ./googletest-release-1.11.0/googlemock/scripts/fuse_gmock_files.py ./googletest-release-1.11.0/googlemock gmock-1.11.0 && \ rm -rf googletest-release-1.11.0 release-1.11.0.tar.gz ``` ././@PaxHeader0000000000000000000000000000003400000000000011452 xustar000000000000000028 mtime=1696604227.0154157 pycares-4.4.0/deps/c-ares/test/gmock-1.11.0/gmock/0000755000175100001770000000000000000000000021773 5ustar00runnerdocker00000000000000././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1696604223.0 pycares-4.4.0/deps/c-ares/test/gmock-1.11.0/gmock/gmock.h0000644000175100001770000156773200000000000023271 0ustar00runnerdocker00000000000000// Copyright 2007, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Google Mock - a framework for writing C++ mock classes. // // This is the main header file a user should include. // GOOGLETEST_CM0002 DO NOT DELETE #ifndef GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_H_ #define GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_H_ // This file implements the following syntax: // // ON_CALL(mock_object, Method(...)) // .With(...) ? // .WillByDefault(...); // // where With() is optional and WillByDefault() must appear exactly // once. // // EXPECT_CALL(mock_object, Method(...)) // .With(...) ? // .Times(...) ? // .InSequence(...) * // .WillOnce(...) * // .WillRepeatedly(...) ? // .RetiresOnSaturation() ? ; // // where all clauses are optional and WillOnce() can be repeated. // Copyright 2007, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Google Mock - a framework for writing C++ mock classes. // // The ACTION* family of macros can be used in a namespace scope to // define custom actions easily. The syntax: // // ACTION(name) { statements; } // // will define an action with the given name that executes the // statements. The value returned by the statements will be used as // the return value of the action. Inside the statements, you can // refer to the K-th (0-based) argument of the mock function by // 'argK', and refer to its type by 'argK_type'. For example: // // ACTION(IncrementArg1) { // arg1_type temp = arg1; // return ++(*temp); // } // // allows you to write // // ...WillOnce(IncrementArg1()); // // You can also refer to the entire argument tuple and its type by // 'args' and 'args_type', and refer to the mock function type and its // return type by 'function_type' and 'return_type'. // // Note that you don't need to specify the types of the mock function // arguments. However rest assured that your code is still type-safe: // you'll get a compiler error if *arg1 doesn't support the ++ // operator, or if the type of ++(*arg1) isn't compatible with the // mock function's return type, for example. // // Sometimes you'll want to parameterize the action. For that you can use // another macro: // // ACTION_P(name, param_name) { statements; } // // For example: // // ACTION_P(Add, n) { return arg0 + n; } // // will allow you to write: // // ...WillOnce(Add(5)); // // Note that you don't need to provide the type of the parameter // either. If you need to reference the type of a parameter named // 'foo', you can write 'foo_type'. For example, in the body of // ACTION_P(Add, n) above, you can write 'n_type' to refer to the type // of 'n'. // // We also provide ACTION_P2, ACTION_P3, ..., up to ACTION_P10 to support // multi-parameter actions. // // For the purpose of typing, you can view // // ACTION_Pk(Foo, p1, ..., pk) { ... } // // as shorthand for // // template // FooActionPk Foo(p1_type p1, ..., pk_type pk) { ... } // // In particular, you can provide the template type arguments // explicitly when invoking Foo(), as in Foo(5, false); // although usually you can rely on the compiler to infer the types // for you automatically. You can assign the result of expression // Foo(p1, ..., pk) to a variable of type FooActionPk. This can be useful when composing actions. // // You can also overload actions with different numbers of parameters: // // ACTION_P(Plus, a) { ... } // ACTION_P2(Plus, a, b) { ... } // // While it's tempting to always use the ACTION* macros when defining // a new action, you should also consider implementing ActionInterface // or using MakePolymorphicAction() instead, especially if you need to // use the action a lot. While these approaches require more work, // they give you more control on the types of the mock function // arguments and the action parameters, which in general leads to // better compiler error messages that pay off in the long run. They // also allow overloading actions based on parameter types (as opposed // to just based on the number of parameters). // // CAVEAT: // // ACTION*() can only be used in a namespace scope as templates cannot be // declared inside of a local class. // Users can, however, define any local functors (e.g. a lambda) that // can be used as actions. // // MORE INFORMATION: // // To learn more about using these macros, please search for 'ACTION' on // https://github.com/google/googletest/blob/master/docs/gmock_cook_book.md // GOOGLETEST_CM0002 DO NOT DELETE #ifndef GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_ACTIONS_H_ #define GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_ACTIONS_H_ #ifndef _WIN32_WCE # include #endif #include #include #include #include #include #include #include // Copyright 2007, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Google Mock - a framework for writing C++ mock classes. // // This file defines some utilities useful for implementing Google // Mock. They are subject to change without notice, so please DO NOT // USE THEM IN USER CODE. // GOOGLETEST_CM0002 DO NOT DELETE #ifndef GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_INTERNAL_UTILS_H_ #define GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_INTERNAL_UTILS_H_ #include #include // NOLINT #include #include // Copyright 2008, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Low-level types and utilities for porting Google Mock to various // platforms. All macros ending with _ and symbols defined in an // internal namespace are subject to change without notice. Code // outside Google Mock MUST NOT USE THEM DIRECTLY. Macros that don't // end with _ are part of Google Mock's public API and can be used by // code outside Google Mock. // GOOGLETEST_CM0002 DO NOT DELETE #ifndef GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_PORT_H_ #define GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_PORT_H_ #include #include #include #include // Most of the utilities needed for porting Google Mock are also // required for Google Test and are defined in gtest-port.h. // // Note to maintainers: to reduce code duplication, prefer adding // portability utilities to Google Test's gtest-port.h instead of // here, as Google Mock depends on Google Test. Only add a utility // here if it's truly specific to Google Mock. #include "gtest/gtest.h" // Copyright 2015, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Injection point for custom user configurations. See README for details // // ** Custom implementation starts here ** // GOOGLETEST_CM0002 DO NOT DELETE #ifndef GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_PORT_H_ #define GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_PORT_H_ #endif // GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_PORT_H_ // For MS Visual C++, check the compiler version. At least VS 2015 is // required to compile Google Mock. #if defined(_MSC_VER) && _MSC_VER < 1900 # error "At least Visual C++ 2015 (14.0) is required to compile Google Mock." #endif // Macro for referencing flags. This is public as we want the user to // use this syntax to reference Google Mock flags. #define GMOCK_FLAG(name) FLAGS_gmock_##name #if !defined(GMOCK_DECLARE_bool_) // Macros for declaring flags. # define GMOCK_DECLARE_bool_(name) extern GTEST_API_ bool GMOCK_FLAG(name) # define GMOCK_DECLARE_int32_(name) extern GTEST_API_ int32_t GMOCK_FLAG(name) # define GMOCK_DECLARE_string_(name) \ extern GTEST_API_ ::std::string GMOCK_FLAG(name) // Macros for defining flags. # define GMOCK_DEFINE_bool_(name, default_val, doc) \ GTEST_API_ bool GMOCK_FLAG(name) = (default_val) # define GMOCK_DEFINE_int32_(name, default_val, doc) \ GTEST_API_ int32_t GMOCK_FLAG(name) = (default_val) # define GMOCK_DEFINE_string_(name, default_val, doc) \ GTEST_API_ ::std::string GMOCK_FLAG(name) = (default_val) #endif // !defined(GMOCK_DECLARE_bool_) #endif // GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_PORT_H_ namespace testing { template class Matcher; namespace internal { // Silence MSVC C4100 (unreferenced formal parameter) and // C4805('==': unsafe mix of type 'const int' and type 'const bool') #ifdef _MSC_VER # pragma warning(push) # pragma warning(disable:4100) # pragma warning(disable:4805) #endif // Joins a vector of strings as if they are fields of a tuple; returns // the joined string. GTEST_API_ std::string JoinAsTuple(const Strings& fields); // Converts an identifier name to a space-separated list of lower-case // words. Each maximum substring of the form [A-Za-z][a-z]*|\d+ is // treated as one word. For example, both "FooBar123" and // "foo_bar_123" are converted to "foo bar 123". GTEST_API_ std::string ConvertIdentifierNameToWords(const char* id_name); // GetRawPointer(p) returns the raw pointer underlying p when p is a // smart pointer, or returns p itself when p is already a raw pointer. // The following default implementation is for the smart pointer case. template inline const typename Pointer::element_type* GetRawPointer(const Pointer& p) { return p.get(); } // This overloaded version is for the raw pointer case. template inline Element* GetRawPointer(Element* p) { return p; } // MSVC treats wchar_t as a native type usually, but treats it as the // same as unsigned short when the compiler option /Zc:wchar_t- is // specified. It defines _NATIVE_WCHAR_T_DEFINED symbol when wchar_t // is a native type. #if defined(_MSC_VER) && !defined(_NATIVE_WCHAR_T_DEFINED) // wchar_t is a typedef. #else # define GMOCK_WCHAR_T_IS_NATIVE_ 1 #endif // In what follows, we use the term "kind" to indicate whether a type // is bool, an integer type (excluding bool), a floating-point type, // or none of them. This categorization is useful for determining // when a matcher argument type can be safely converted to another // type in the implementation of SafeMatcherCast. enum TypeKind { kBool, kInteger, kFloatingPoint, kOther }; // KindOf::value is the kind of type T. template struct KindOf { enum { value = kOther }; // The default kind. }; // This macro declares that the kind of 'type' is 'kind'. #define GMOCK_DECLARE_KIND_(type, kind) \ template <> struct KindOf { enum { value = kind }; } GMOCK_DECLARE_KIND_(bool, kBool); // All standard integer types. GMOCK_DECLARE_KIND_(char, kInteger); GMOCK_DECLARE_KIND_(signed char, kInteger); GMOCK_DECLARE_KIND_(unsigned char, kInteger); GMOCK_DECLARE_KIND_(short, kInteger); // NOLINT GMOCK_DECLARE_KIND_(unsigned short, kInteger); // NOLINT GMOCK_DECLARE_KIND_(int, kInteger); GMOCK_DECLARE_KIND_(unsigned int, kInteger); GMOCK_DECLARE_KIND_(long, kInteger); // NOLINT GMOCK_DECLARE_KIND_(unsigned long, kInteger); // NOLINT GMOCK_DECLARE_KIND_(long long, kInteger); // NOLINT GMOCK_DECLARE_KIND_(unsigned long long, kInteger); // NOLINT #if GMOCK_WCHAR_T_IS_NATIVE_ GMOCK_DECLARE_KIND_(wchar_t, kInteger); #endif // All standard floating-point types. GMOCK_DECLARE_KIND_(float, kFloatingPoint); GMOCK_DECLARE_KIND_(double, kFloatingPoint); GMOCK_DECLARE_KIND_(long double, kFloatingPoint); #undef GMOCK_DECLARE_KIND_ // Evaluates to the kind of 'type'. #define GMOCK_KIND_OF_(type) \ static_cast< ::testing::internal::TypeKind>( \ ::testing::internal::KindOf::value) // LosslessArithmeticConvertibleImpl::value // is true if and only if arithmetic type From can be losslessly converted to // arithmetic type To. // // It's the user's responsibility to ensure that both From and To are // raw (i.e. has no CV modifier, is not a pointer, and is not a // reference) built-in arithmetic types, kFromKind is the kind of // From, and kToKind is the kind of To; the value is // implementation-defined when the above pre-condition is violated. template using LosslessArithmeticConvertibleImpl = std::integral_constant< bool, // clang-format off // Converting from bool is always lossless (kFromKind == kBool) ? true // Converting between any other type kinds will be lossy if the type // kinds are not the same. : (kFromKind != kToKind) ? false : (kFromKind == kInteger && // Converting between integers of different widths is allowed so long // as the conversion does not go from signed to unsigned. (((sizeof(From) < sizeof(To)) && !(std::is_signed::value && !std::is_signed::value)) || // Converting between integers of the same width only requires the // two types to have the same signedness. ((sizeof(From) == sizeof(To)) && (std::is_signed::value == std::is_signed::value))) ) ? true // Floating point conversions are lossless if and only if `To` is at least // as wide as `From`. : (kFromKind == kFloatingPoint && (sizeof(From) <= sizeof(To))) ? true : false // clang-format on >; // LosslessArithmeticConvertible::value is true if and only if // arithmetic type From can be losslessly converted to arithmetic type To. // // It's the user's responsibility to ensure that both From and To are // raw (i.e. has no CV modifier, is not a pointer, and is not a // reference) built-in arithmetic types; the value is // implementation-defined when the above pre-condition is violated. template using LosslessArithmeticConvertible = LosslessArithmeticConvertibleImpl; // This interface knows how to report a Google Mock failure (either // non-fatal or fatal). class FailureReporterInterface { public: // The type of a failure (either non-fatal or fatal). enum FailureType { kNonfatal, kFatal }; virtual ~FailureReporterInterface() {} // Reports a failure that occurred at the given source file location. virtual void ReportFailure(FailureType type, const char* file, int line, const std::string& message) = 0; }; // Returns the failure reporter used by Google Mock. GTEST_API_ FailureReporterInterface* GetFailureReporter(); // Asserts that condition is true; aborts the process with the given // message if condition is false. We cannot use LOG(FATAL) or CHECK() // as Google Mock might be used to mock the log sink itself. We // inline this function to prevent it from showing up in the stack // trace. inline void Assert(bool condition, const char* file, int line, const std::string& msg) { if (!condition) { GetFailureReporter()->ReportFailure(FailureReporterInterface::kFatal, file, line, msg); } } inline void Assert(bool condition, const char* file, int line) { Assert(condition, file, line, "Assertion failed."); } // Verifies that condition is true; generates a non-fatal failure if // condition is false. inline void Expect(bool condition, const char* file, int line, const std::string& msg) { if (!condition) { GetFailureReporter()->ReportFailure(FailureReporterInterface::kNonfatal, file, line, msg); } } inline void Expect(bool condition, const char* file, int line) { Expect(condition, file, line, "Expectation failed."); } // Severity level of a log. enum LogSeverity { kInfo = 0, kWarning = 1 }; // Valid values for the --gmock_verbose flag. // All logs (informational and warnings) are printed. const char kInfoVerbosity[] = "info"; // Only warnings are printed. const char kWarningVerbosity[] = "warning"; // No logs are printed. const char kErrorVerbosity[] = "error"; // Returns true if and only if a log with the given severity is visible // according to the --gmock_verbose flag. GTEST_API_ bool LogIsVisible(LogSeverity severity); // Prints the given message to stdout if and only if 'severity' >= the level // specified by the --gmock_verbose flag. If stack_frames_to_skip >= // 0, also prints the stack trace excluding the top // stack_frames_to_skip frames. In opt mode, any positive // stack_frames_to_skip is treated as 0, since we don't know which // function calls will be inlined by the compiler and need to be // conservative. GTEST_API_ void Log(LogSeverity severity, const std::string& message, int stack_frames_to_skip); // A marker class that is used to resolve parameterless expectations to the // correct overload. This must not be instantiable, to prevent client code from // accidentally resolving to the overload; for example: // // ON_CALL(mock, Method({}, nullptr))... // class WithoutMatchers { private: WithoutMatchers() {} friend GTEST_API_ WithoutMatchers GetWithoutMatchers(); }; // Internal use only: access the singleton instance of WithoutMatchers. GTEST_API_ WithoutMatchers GetWithoutMatchers(); // Disable MSVC warnings for infinite recursion, since in this case the // the recursion is unreachable. #ifdef _MSC_VER # pragma warning(push) # pragma warning(disable:4717) #endif // Invalid() is usable as an expression of type T, but will terminate // the program with an assertion failure if actually run. This is useful // when a value of type T is needed for compilation, but the statement // will not really be executed (or we don't care if the statement // crashes). template inline T Invalid() { Assert(false, "", -1, "Internal error: attempt to return invalid value"); // This statement is unreachable, and would never terminate even if it // could be reached. It is provided only to placate compiler warnings // about missing return statements. return Invalid(); } #ifdef _MSC_VER # pragma warning(pop) #endif // Given a raw type (i.e. having no top-level reference or const // modifier) RawContainer that's either an STL-style container or a // native array, class StlContainerView has the // following members: // // - type is a type that provides an STL-style container view to // (i.e. implements the STL container concept for) RawContainer; // - const_reference is a type that provides a reference to a const // RawContainer; // - ConstReference(raw_container) returns a const reference to an STL-style // container view to raw_container, which is a RawContainer. // - Copy(raw_container) returns an STL-style container view of a // copy of raw_container, which is a RawContainer. // // This generic version is used when RawContainer itself is already an // STL-style container. template class StlContainerView { public: typedef RawContainer type; typedef const type& const_reference; static const_reference ConstReference(const RawContainer& container) { static_assert(!std::is_const::value, "RawContainer type must not be const"); return container; } static type Copy(const RawContainer& container) { return container; } }; // This specialization is used when RawContainer is a native array type. template class StlContainerView { public: typedef typename std::remove_const::type RawElement; typedef internal::NativeArray type; // NativeArray can represent a native array either by value or by // reference (selected by a constructor argument), so 'const type' // can be used to reference a const native array. We cannot // 'typedef const type& const_reference' here, as that would mean // ConstReference() has to return a reference to a local variable. typedef const type const_reference; static const_reference ConstReference(const Element (&array)[N]) { static_assert(std::is_same::value, "Element type must not be const"); return type(array, N, RelationToSourceReference()); } static type Copy(const Element (&array)[N]) { return type(array, N, RelationToSourceCopy()); } }; // This specialization is used when RawContainer is a native array // represented as a (pointer, size) tuple. template class StlContainerView< ::std::tuple > { public: typedef typename std::remove_const< typename std::pointer_traits::element_type>::type RawElement; typedef internal::NativeArray type; typedef const type const_reference; static const_reference ConstReference( const ::std::tuple& array) { return type(std::get<0>(array), std::get<1>(array), RelationToSourceReference()); } static type Copy(const ::std::tuple& array) { return type(std::get<0>(array), std::get<1>(array), RelationToSourceCopy()); } }; // The following specialization prevents the user from instantiating // StlContainer with a reference type. template class StlContainerView; // A type transform to remove constness from the first part of a pair. // Pairs like that are used as the value_type of associative containers, // and this transform produces a similar but assignable pair. template struct RemoveConstFromKey { typedef T type; }; // Partially specialized to remove constness from std::pair. template struct RemoveConstFromKey > { typedef std::pair type; }; // Emit an assertion failure due to incorrect DoDefault() usage. Out-of-lined to // reduce code size. GTEST_API_ void IllegalDoDefault(const char* file, int line); template auto ApplyImpl(F&& f, Tuple&& args, IndexSequence) -> decltype( std::forward(f)(std::get(std::forward(args))...)) { return std::forward(f)(std::get(std::forward(args))...); } // Apply the function to a tuple of arguments. template auto Apply(F&& f, Tuple&& args) -> decltype( ApplyImpl(std::forward(f), std::forward(args), MakeIndexSequence::type>::value>())) { return ApplyImpl(std::forward(f), std::forward(args), MakeIndexSequence::type>::value>()); } // Template struct Function, where F must be a function type, contains // the following typedefs: // // Result: the function's return type. // Arg: the type of the N-th argument, where N starts with 0. // ArgumentTuple: the tuple type consisting of all parameters of F. // ArgumentMatcherTuple: the tuple type consisting of Matchers for all // parameters of F. // MakeResultVoid: the function type obtained by substituting void // for the return type of F. // MakeResultIgnoredValue: // the function type obtained by substituting Something // for the return type of F. template struct Function; template struct Function { using Result = R; static constexpr size_t ArgumentCount = sizeof...(Args); template using Arg = ElemFromList; using ArgumentTuple = std::tuple; using ArgumentMatcherTuple = std::tuple...>; using MakeResultVoid = void(Args...); using MakeResultIgnoredValue = IgnoredValue(Args...); }; template constexpr size_t Function::ArgumentCount; #ifdef _MSC_VER # pragma warning(pop) #endif } // namespace internal } // namespace testing #endif // GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_INTERNAL_UTILS_H_ #ifndef GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_PP_H_ #define GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_PP_H_ // Expands and concatenates the arguments. Constructed macros reevaluate. #define GMOCK_PP_CAT(_1, _2) GMOCK_PP_INTERNAL_CAT(_1, _2) // Expands and stringifies the only argument. #define GMOCK_PP_STRINGIZE(...) GMOCK_PP_INTERNAL_STRINGIZE(__VA_ARGS__) // Returns empty. Given a variadic number of arguments. #define GMOCK_PP_EMPTY(...) // Returns a comma. Given a variadic number of arguments. #define GMOCK_PP_COMMA(...) , // Returns the only argument. #define GMOCK_PP_IDENTITY(_1) _1 // Evaluates to the number of arguments after expansion. // // #define PAIR x, y // // GMOCK_PP_NARG() => 1 // GMOCK_PP_NARG(x) => 1 // GMOCK_PP_NARG(x, y) => 2 // GMOCK_PP_NARG(PAIR) => 2 // // Requires: the number of arguments after expansion is at most 15. #define GMOCK_PP_NARG(...) \ GMOCK_PP_INTERNAL_16TH( \ (__VA_ARGS__, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0)) // Returns 1 if the expansion of arguments has an unprotected comma. Otherwise // returns 0. Requires no more than 15 unprotected commas. #define GMOCK_PP_HAS_COMMA(...) \ GMOCK_PP_INTERNAL_16TH( \ (__VA_ARGS__, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0)) // Returns the first argument. #define GMOCK_PP_HEAD(...) GMOCK_PP_INTERNAL_HEAD((__VA_ARGS__, unusedArg)) // Returns the tail. A variadic list of all arguments minus the first. Requires // at least one argument. #define GMOCK_PP_TAIL(...) GMOCK_PP_INTERNAL_TAIL((__VA_ARGS__)) // Calls CAT(_Macro, NARG(__VA_ARGS__))(__VA_ARGS__) #define GMOCK_PP_VARIADIC_CALL(_Macro, ...) \ GMOCK_PP_IDENTITY( \ GMOCK_PP_CAT(_Macro, GMOCK_PP_NARG(__VA_ARGS__))(__VA_ARGS__)) // If the arguments after expansion have no tokens, evaluates to `1`. Otherwise // evaluates to `0`. // // Requires: * the number of arguments after expansion is at most 15. // * If the argument is a macro, it must be able to be called with one // argument. // // Implementation details: // // There is one case when it generates a compile error: if the argument is macro // that cannot be called with one argument. // // #define M(a, b) // it doesn't matter what it expands to // // // Expected: expands to `0`. // // Actual: compile error. // GMOCK_PP_IS_EMPTY(M) // // There are 4 cases tested: // // * __VA_ARGS__ possible expansion has no unparen'd commas. Expected 0. // * __VA_ARGS__ possible expansion is not enclosed in parenthesis. Expected 0. // * __VA_ARGS__ possible expansion is not a macro that ()-evaluates to a comma. // Expected 0 // * __VA_ARGS__ is empty, or has unparen'd commas, or is enclosed in // parenthesis, or is a macro that ()-evaluates to comma. Expected 1. // // We trigger detection on '0001', i.e. on empty. #define GMOCK_PP_IS_EMPTY(...) \ GMOCK_PP_INTERNAL_IS_EMPTY(GMOCK_PP_HAS_COMMA(__VA_ARGS__), \ GMOCK_PP_HAS_COMMA(GMOCK_PP_COMMA __VA_ARGS__), \ GMOCK_PP_HAS_COMMA(__VA_ARGS__()), \ GMOCK_PP_HAS_COMMA(GMOCK_PP_COMMA __VA_ARGS__())) // Evaluates to _Then if _Cond is 1 and _Else if _Cond is 0. #define GMOCK_PP_IF(_Cond, _Then, _Else) \ GMOCK_PP_CAT(GMOCK_PP_INTERNAL_IF_, _Cond)(_Then, _Else) // Similar to GMOCK_PP_IF but takes _Then and _Else in parentheses. // // GMOCK_PP_GENERIC_IF(1, (a, b, c), (d, e, f)) => a, b, c // GMOCK_PP_GENERIC_IF(0, (a, b, c), (d, e, f)) => d, e, f // #define GMOCK_PP_GENERIC_IF(_Cond, _Then, _Else) \ GMOCK_PP_REMOVE_PARENS(GMOCK_PP_IF(_Cond, _Then, _Else)) // Evaluates to the number of arguments after expansion. Identifies 'empty' as // 0. // // #define PAIR x, y // // GMOCK_PP_NARG0() => 0 // GMOCK_PP_NARG0(x) => 1 // GMOCK_PP_NARG0(x, y) => 2 // GMOCK_PP_NARG0(PAIR) => 2 // // Requires: * the number of arguments after expansion is at most 15. // * If the argument is a macro, it must be able to be called with one // argument. #define GMOCK_PP_NARG0(...) \ GMOCK_PP_IF(GMOCK_PP_IS_EMPTY(__VA_ARGS__), 0, GMOCK_PP_NARG(__VA_ARGS__)) // Expands to 1 if the first argument starts with something in parentheses, // otherwise to 0. #define GMOCK_PP_IS_BEGIN_PARENS(...) \ GMOCK_PP_HEAD(GMOCK_PP_CAT(GMOCK_PP_INTERNAL_IBP_IS_VARIADIC_R_, \ GMOCK_PP_INTERNAL_IBP_IS_VARIADIC_C __VA_ARGS__)) // Expands to 1 is there is only one argument and it is enclosed in parentheses. #define GMOCK_PP_IS_ENCLOSED_PARENS(...) \ GMOCK_PP_IF(GMOCK_PP_IS_BEGIN_PARENS(__VA_ARGS__), \ GMOCK_PP_IS_EMPTY(GMOCK_PP_EMPTY __VA_ARGS__), 0) // Remove the parens, requires GMOCK_PP_IS_ENCLOSED_PARENS(args) => 1. #define GMOCK_PP_REMOVE_PARENS(...) GMOCK_PP_INTERNAL_REMOVE_PARENS __VA_ARGS__ // Expands to _Macro(0, _Data, e1) _Macro(1, _Data, e2) ... _Macro(K -1, _Data, // eK) as many of GMOCK_INTERNAL_NARG0 _Tuple. // Requires: * |_Macro| can be called with 3 arguments. // * |_Tuple| expansion has no more than 15 elements. #define GMOCK_PP_FOR_EACH(_Macro, _Data, _Tuple) \ GMOCK_PP_CAT(GMOCK_PP_INTERNAL_FOR_EACH_IMPL_, GMOCK_PP_NARG0 _Tuple) \ (0, _Macro, _Data, _Tuple) // Expands to _Macro(0, _Data, ) _Macro(1, _Data, ) ... _Macro(K - 1, _Data, ) // Empty if _K = 0. // Requires: * |_Macro| can be called with 3 arguments. // * |_K| literal between 0 and 15 #define GMOCK_PP_REPEAT(_Macro, _Data, _N) \ GMOCK_PP_CAT(GMOCK_PP_INTERNAL_FOR_EACH_IMPL_, _N) \ (0, _Macro, _Data, GMOCK_PP_INTENRAL_EMPTY_TUPLE) // Increments the argument, requires the argument to be between 0 and 15. #define GMOCK_PP_INC(_i) GMOCK_PP_CAT(GMOCK_PP_INTERNAL_INC_, _i) // Returns comma if _i != 0. Requires _i to be between 0 and 15. #define GMOCK_PP_COMMA_IF(_i) GMOCK_PP_CAT(GMOCK_PP_INTERNAL_COMMA_IF_, _i) // Internal details follow. Do not use any of these symbols outside of this // file or we will break your code. #define GMOCK_PP_INTENRAL_EMPTY_TUPLE (, , , , , , , , , , , , , , , ) #define GMOCK_PP_INTERNAL_CAT(_1, _2) _1##_2 #define GMOCK_PP_INTERNAL_STRINGIZE(...) #__VA_ARGS__ #define GMOCK_PP_INTERNAL_CAT_5(_1, _2, _3, _4, _5) _1##_2##_3##_4##_5 #define GMOCK_PP_INTERNAL_IS_EMPTY(_1, _2, _3, _4) \ GMOCK_PP_HAS_COMMA(GMOCK_PP_INTERNAL_CAT_5(GMOCK_PP_INTERNAL_IS_EMPTY_CASE_, \ _1, _2, _3, _4)) #define GMOCK_PP_INTERNAL_IS_EMPTY_CASE_0001 , #define GMOCK_PP_INTERNAL_IF_1(_Then, _Else) _Then #define GMOCK_PP_INTERNAL_IF_0(_Then, _Else) _Else // Because of MSVC treating a token with a comma in it as a single token when // passed to another macro, we need to force it to evaluate it as multiple // tokens. We do that by using a "IDENTITY(MACRO PARENTHESIZED_ARGS)" macro. We // define one per possible macro that relies on this behavior. Note "_Args" must // be parenthesized. #define GMOCK_PP_INTERNAL_INTERNAL_16TH(_1, _2, _3, _4, _5, _6, _7, _8, _9, \ _10, _11, _12, _13, _14, _15, _16, \ ...) \ _16 #define GMOCK_PP_INTERNAL_16TH(_Args) \ GMOCK_PP_IDENTITY(GMOCK_PP_INTERNAL_INTERNAL_16TH _Args) #define GMOCK_PP_INTERNAL_INTERNAL_HEAD(_1, ...) _1 #define GMOCK_PP_INTERNAL_HEAD(_Args) \ GMOCK_PP_IDENTITY(GMOCK_PP_INTERNAL_INTERNAL_HEAD _Args) #define GMOCK_PP_INTERNAL_INTERNAL_TAIL(_1, ...) __VA_ARGS__ #define GMOCK_PP_INTERNAL_TAIL(_Args) \ GMOCK_PP_IDENTITY(GMOCK_PP_INTERNAL_INTERNAL_TAIL _Args) #define GMOCK_PP_INTERNAL_IBP_IS_VARIADIC_C(...) 1 _ #define GMOCK_PP_INTERNAL_IBP_IS_VARIADIC_R_1 1, #define GMOCK_PP_INTERNAL_IBP_IS_VARIADIC_R_GMOCK_PP_INTERNAL_IBP_IS_VARIADIC_C \ 0, #define GMOCK_PP_INTERNAL_REMOVE_PARENS(...) __VA_ARGS__ #define GMOCK_PP_INTERNAL_INC_0 1 #define GMOCK_PP_INTERNAL_INC_1 2 #define GMOCK_PP_INTERNAL_INC_2 3 #define GMOCK_PP_INTERNAL_INC_3 4 #define GMOCK_PP_INTERNAL_INC_4 5 #define GMOCK_PP_INTERNAL_INC_5 6 #define GMOCK_PP_INTERNAL_INC_6 7 #define GMOCK_PP_INTERNAL_INC_7 8 #define GMOCK_PP_INTERNAL_INC_8 9 #define GMOCK_PP_INTERNAL_INC_9 10 #define GMOCK_PP_INTERNAL_INC_10 11 #define GMOCK_PP_INTERNAL_INC_11 12 #define GMOCK_PP_INTERNAL_INC_12 13 #define GMOCK_PP_INTERNAL_INC_13 14 #define GMOCK_PP_INTERNAL_INC_14 15 #define GMOCK_PP_INTERNAL_INC_15 16 #define GMOCK_PP_INTERNAL_COMMA_IF_0 #define GMOCK_PP_INTERNAL_COMMA_IF_1 , #define GMOCK_PP_INTERNAL_COMMA_IF_2 , #define GMOCK_PP_INTERNAL_COMMA_IF_3 , #define GMOCK_PP_INTERNAL_COMMA_IF_4 , #define GMOCK_PP_INTERNAL_COMMA_IF_5 , #define GMOCK_PP_INTERNAL_COMMA_IF_6 , #define GMOCK_PP_INTERNAL_COMMA_IF_7 , #define GMOCK_PP_INTERNAL_COMMA_IF_8 , #define GMOCK_PP_INTERNAL_COMMA_IF_9 , #define GMOCK_PP_INTERNAL_COMMA_IF_10 , #define GMOCK_PP_INTERNAL_COMMA_IF_11 , #define GMOCK_PP_INTERNAL_COMMA_IF_12 , #define GMOCK_PP_INTERNAL_COMMA_IF_13 , #define GMOCK_PP_INTERNAL_COMMA_IF_14 , #define GMOCK_PP_INTERNAL_COMMA_IF_15 , #define GMOCK_PP_INTERNAL_CALL_MACRO(_Macro, _i, _Data, _element) \ _Macro(_i, _Data, _element) #define GMOCK_PP_INTERNAL_FOR_EACH_IMPL_0(_i, _Macro, _Data, _Tuple) #define GMOCK_PP_INTERNAL_FOR_EACH_IMPL_1(_i, _Macro, _Data, _Tuple) \ GMOCK_PP_INTERNAL_CALL_MACRO(_Macro, _i, _Data, GMOCK_PP_HEAD _Tuple) #define GMOCK_PP_INTERNAL_FOR_EACH_IMPL_2(_i, _Macro, _Data, _Tuple) \ GMOCK_PP_INTERNAL_CALL_MACRO(_Macro, _i, _Data, GMOCK_PP_HEAD _Tuple) \ GMOCK_PP_INTERNAL_FOR_EACH_IMPL_1(GMOCK_PP_INC(_i), _Macro, _Data, \ (GMOCK_PP_TAIL _Tuple)) #define GMOCK_PP_INTERNAL_FOR_EACH_IMPL_3(_i, _Macro, _Data, _Tuple) \ GMOCK_PP_INTERNAL_CALL_MACRO(_Macro, _i, _Data, GMOCK_PP_HEAD _Tuple) \ GMOCK_PP_INTERNAL_FOR_EACH_IMPL_2(GMOCK_PP_INC(_i), _Macro, _Data, \ (GMOCK_PP_TAIL _Tuple)) #define GMOCK_PP_INTERNAL_FOR_EACH_IMPL_4(_i, _Macro, _Data, _Tuple) \ GMOCK_PP_INTERNAL_CALL_MACRO(_Macro, _i, _Data, GMOCK_PP_HEAD _Tuple) \ GMOCK_PP_INTERNAL_FOR_EACH_IMPL_3(GMOCK_PP_INC(_i), _Macro, _Data, \ (GMOCK_PP_TAIL _Tuple)) #define GMOCK_PP_INTERNAL_FOR_EACH_IMPL_5(_i, _Macro, _Data, _Tuple) \ GMOCK_PP_INTERNAL_CALL_MACRO(_Macro, _i, _Data, GMOCK_PP_HEAD _Tuple) \ GMOCK_PP_INTERNAL_FOR_EACH_IMPL_4(GMOCK_PP_INC(_i), _Macro, _Data, \ (GMOCK_PP_TAIL _Tuple)) #define GMOCK_PP_INTERNAL_FOR_EACH_IMPL_6(_i, _Macro, _Data, _Tuple) \ GMOCK_PP_INTERNAL_CALL_MACRO(_Macro, _i, _Data, GMOCK_PP_HEAD _Tuple) \ GMOCK_PP_INTERNAL_FOR_EACH_IMPL_5(GMOCK_PP_INC(_i), _Macro, _Data, \ (GMOCK_PP_TAIL _Tuple)) #define GMOCK_PP_INTERNAL_FOR_EACH_IMPL_7(_i, _Macro, _Data, _Tuple) \ GMOCK_PP_INTERNAL_CALL_MACRO(_Macro, _i, _Data, GMOCK_PP_HEAD _Tuple) \ GMOCK_PP_INTERNAL_FOR_EACH_IMPL_6(GMOCK_PP_INC(_i), _Macro, _Data, \ (GMOCK_PP_TAIL _Tuple)) #define GMOCK_PP_INTERNAL_FOR_EACH_IMPL_8(_i, _Macro, _Data, _Tuple) \ GMOCK_PP_INTERNAL_CALL_MACRO(_Macro, _i, _Data, GMOCK_PP_HEAD _Tuple) \ GMOCK_PP_INTERNAL_FOR_EACH_IMPL_7(GMOCK_PP_INC(_i), _Macro, _Data, \ (GMOCK_PP_TAIL _Tuple)) #define GMOCK_PP_INTERNAL_FOR_EACH_IMPL_9(_i, _Macro, _Data, _Tuple) \ GMOCK_PP_INTERNAL_CALL_MACRO(_Macro, _i, _Data, GMOCK_PP_HEAD _Tuple) \ GMOCK_PP_INTERNAL_FOR_EACH_IMPL_8(GMOCK_PP_INC(_i), _Macro, _Data, \ (GMOCK_PP_TAIL _Tuple)) #define GMOCK_PP_INTERNAL_FOR_EACH_IMPL_10(_i, _Macro, _Data, _Tuple) \ GMOCK_PP_INTERNAL_CALL_MACRO(_Macro, _i, _Data, GMOCK_PP_HEAD _Tuple) \ GMOCK_PP_INTERNAL_FOR_EACH_IMPL_9(GMOCK_PP_INC(_i), _Macro, _Data, \ (GMOCK_PP_TAIL _Tuple)) #define GMOCK_PP_INTERNAL_FOR_EACH_IMPL_11(_i, _Macro, _Data, _Tuple) \ GMOCK_PP_INTERNAL_CALL_MACRO(_Macro, _i, _Data, GMOCK_PP_HEAD _Tuple) \ GMOCK_PP_INTERNAL_FOR_EACH_IMPL_10(GMOCK_PP_INC(_i), _Macro, _Data, \ (GMOCK_PP_TAIL _Tuple)) #define GMOCK_PP_INTERNAL_FOR_EACH_IMPL_12(_i, _Macro, _Data, _Tuple) \ GMOCK_PP_INTERNAL_CALL_MACRO(_Macro, _i, _Data, GMOCK_PP_HEAD _Tuple) \ GMOCK_PP_INTERNAL_FOR_EACH_IMPL_11(GMOCK_PP_INC(_i), _Macro, _Data, \ (GMOCK_PP_TAIL _Tuple)) #define GMOCK_PP_INTERNAL_FOR_EACH_IMPL_13(_i, _Macro, _Data, _Tuple) \ GMOCK_PP_INTERNAL_CALL_MACRO(_Macro, _i, _Data, GMOCK_PP_HEAD _Tuple) \ GMOCK_PP_INTERNAL_FOR_EACH_IMPL_12(GMOCK_PP_INC(_i), _Macro, _Data, \ (GMOCK_PP_TAIL _Tuple)) #define GMOCK_PP_INTERNAL_FOR_EACH_IMPL_14(_i, _Macro, _Data, _Tuple) \ GMOCK_PP_INTERNAL_CALL_MACRO(_Macro, _i, _Data, GMOCK_PP_HEAD _Tuple) \ GMOCK_PP_INTERNAL_FOR_EACH_IMPL_13(GMOCK_PP_INC(_i), _Macro, _Data, \ (GMOCK_PP_TAIL _Tuple)) #define GMOCK_PP_INTERNAL_FOR_EACH_IMPL_15(_i, _Macro, _Data, _Tuple) \ GMOCK_PP_INTERNAL_CALL_MACRO(_Macro, _i, _Data, GMOCK_PP_HEAD _Tuple) \ GMOCK_PP_INTERNAL_FOR_EACH_IMPL_14(GMOCK_PP_INC(_i), _Macro, _Data, \ (GMOCK_PP_TAIL _Tuple)) #endif // GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_PP_H_ #ifdef _MSC_VER # pragma warning(push) # pragma warning(disable:4100) #endif namespace testing { // To implement an action Foo, define: // 1. a class FooAction that implements the ActionInterface interface, and // 2. a factory function that creates an Action object from a // const FooAction*. // // The two-level delegation design follows that of Matcher, providing // consistency for extension developers. It also eases ownership // management as Action objects can now be copied like plain values. namespace internal { // BuiltInDefaultValueGetter::Get() returns a // default-constructed T value. BuiltInDefaultValueGetter::Get() crashes with an error. // // This primary template is used when kDefaultConstructible is true. template struct BuiltInDefaultValueGetter { static T Get() { return T(); } }; template struct BuiltInDefaultValueGetter { static T Get() { Assert(false, __FILE__, __LINE__, "Default action undefined for the function return type."); return internal::Invalid(); // The above statement will never be reached, but is required in // order for this function to compile. } }; // BuiltInDefaultValue::Get() returns the "built-in" default value // for type T, which is NULL when T is a raw pointer type, 0 when T is // a numeric type, false when T is bool, or "" when T is string or // std::string. In addition, in C++11 and above, it turns a // default-constructed T value if T is default constructible. For any // other type T, the built-in default T value is undefined, and the // function will abort the process. template class BuiltInDefaultValue { public: // This function returns true if and only if type T has a built-in default // value. static bool Exists() { return ::std::is_default_constructible::value; } static T Get() { return BuiltInDefaultValueGetter< T, ::std::is_default_constructible::value>::Get(); } }; // This partial specialization says that we use the same built-in // default value for T and const T. template class BuiltInDefaultValue { public: static bool Exists() { return BuiltInDefaultValue::Exists(); } static T Get() { return BuiltInDefaultValue::Get(); } }; // This partial specialization defines the default values for pointer // types. template class BuiltInDefaultValue { public: static bool Exists() { return true; } static T* Get() { return nullptr; } }; // The following specializations define the default values for // specific types we care about. #define GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(type, value) \ template <> \ class BuiltInDefaultValue { \ public: \ static bool Exists() { return true; } \ static type Get() { return value; } \ } GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(void, ); // NOLINT GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(::std::string, ""); GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(bool, false); GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(unsigned char, '\0'); GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(signed char, '\0'); GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(char, '\0'); // There's no need for a default action for signed wchar_t, as that // type is the same as wchar_t for gcc, and invalid for MSVC. // // There's also no need for a default action for unsigned wchar_t, as // that type is the same as unsigned int for gcc, and invalid for // MSVC. #if GMOCK_WCHAR_T_IS_NATIVE_ GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(wchar_t, 0U); // NOLINT #endif GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(unsigned short, 0U); // NOLINT GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(signed short, 0); // NOLINT GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(unsigned int, 0U); GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(signed int, 0); GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(unsigned long, 0UL); // NOLINT GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(signed long, 0L); // NOLINT GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(unsigned long long, 0); // NOLINT GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(signed long long, 0); // NOLINT GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(float, 0); GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(double, 0); #undef GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_ // Simple two-arg form of std::disjunction. template using disjunction = typename ::std::conditional::type; } // namespace internal // When an unexpected function call is encountered, Google Mock will // let it return a default value if the user has specified one for its // return type, or if the return type has a built-in default value; // otherwise Google Mock won't know what value to return and will have // to abort the process. // // The DefaultValue class allows a user to specify the // default value for a type T that is both copyable and publicly // destructible (i.e. anything that can be used as a function return // type). The usage is: // // // Sets the default value for type T to be foo. // DefaultValue::Set(foo); template class DefaultValue { public: // Sets the default value for type T; requires T to be // copy-constructable and have a public destructor. static void Set(T x) { delete producer_; producer_ = new FixedValueProducer(x); } // Provides a factory function to be called to generate the default value. // This method can be used even if T is only move-constructible, but it is not // limited to that case. typedef T (*FactoryFunction)(); static void SetFactory(FactoryFunction factory) { delete producer_; producer_ = new FactoryValueProducer(factory); } // Unsets the default value for type T. static void Clear() { delete producer_; producer_ = nullptr; } // Returns true if and only if the user has set the default value for type T. static bool IsSet() { return producer_ != nullptr; } // Returns true if T has a default return value set by the user or there // exists a built-in default value. static bool Exists() { return IsSet() || internal::BuiltInDefaultValue::Exists(); } // Returns the default value for type T if the user has set one; // otherwise returns the built-in default value. Requires that Exists() // is true, which ensures that the return value is well-defined. static T Get() { return producer_ == nullptr ? internal::BuiltInDefaultValue::Get() : producer_->Produce(); } private: class ValueProducer { public: virtual ~ValueProducer() {} virtual T Produce() = 0; }; class FixedValueProducer : public ValueProducer { public: explicit FixedValueProducer(T value) : value_(value) {} T Produce() override { return value_; } private: const T value_; GTEST_DISALLOW_COPY_AND_ASSIGN_(FixedValueProducer); }; class FactoryValueProducer : public ValueProducer { public: explicit FactoryValueProducer(FactoryFunction factory) : factory_(factory) {} T Produce() override { return factory_(); } private: const FactoryFunction factory_; GTEST_DISALLOW_COPY_AND_ASSIGN_(FactoryValueProducer); }; static ValueProducer* producer_; }; // This partial specialization allows a user to set default values for // reference types. template class DefaultValue { public: // Sets the default value for type T&. static void Set(T& x) { // NOLINT address_ = &x; } // Unsets the default value for type T&. static void Clear() { address_ = nullptr; } // Returns true if and only if the user has set the default value for type T&. static bool IsSet() { return address_ != nullptr; } // Returns true if T has a default return value set by the user or there // exists a built-in default value. static bool Exists() { return IsSet() || internal::BuiltInDefaultValue::Exists(); } // Returns the default value for type T& if the user has set one; // otherwise returns the built-in default value if there is one; // otherwise aborts the process. static T& Get() { return address_ == nullptr ? internal::BuiltInDefaultValue::Get() : *address_; } private: static T* address_; }; // This specialization allows DefaultValue::Get() to // compile. template <> class DefaultValue { public: static bool Exists() { return true; } static void Get() {} }; // Points to the user-set default value for type T. template typename DefaultValue::ValueProducer* DefaultValue::producer_ = nullptr; // Points to the user-set default value for type T&. template T* DefaultValue::address_ = nullptr; // Implement this interface to define an action for function type F. template class ActionInterface { public: typedef typename internal::Function::Result Result; typedef typename internal::Function::ArgumentTuple ArgumentTuple; ActionInterface() {} virtual ~ActionInterface() {} // Performs the action. This method is not const, as in general an // action can have side effects and be stateful. For example, a // get-the-next-element-from-the-collection action will need to // remember the current element. virtual Result Perform(const ArgumentTuple& args) = 0; private: GTEST_DISALLOW_COPY_AND_ASSIGN_(ActionInterface); }; // An Action is a copyable and IMMUTABLE (except by assignment) // object that represents an action to be taken when a mock function // of type F is called. The implementation of Action is just a // std::shared_ptr to const ActionInterface. Don't inherit from Action! // You can view an object implementing ActionInterface as a // concrete action (including its current state), and an Action // object as a handle to it. template class Action { // Adapter class to allow constructing Action from a legacy ActionInterface. // New code should create Actions from functors instead. struct ActionAdapter { // Adapter must be copyable to satisfy std::function requirements. ::std::shared_ptr> impl_; template typename internal::Function::Result operator()(Args&&... args) { return impl_->Perform( ::std::forward_as_tuple(::std::forward(args)...)); } }; template using IsCompatibleFunctor = std::is_constructible, G>; public: typedef typename internal::Function::Result Result; typedef typename internal::Function::ArgumentTuple ArgumentTuple; // Constructs a null Action. Needed for storing Action objects in // STL containers. Action() {} // Construct an Action from a specified callable. // This cannot take std::function directly, because then Action would not be // directly constructible from lambda (it would require two conversions). template < typename G, typename = typename std::enable_if, std::is_constructible, G>>::value>::type> Action(G&& fun) { // NOLINT Init(::std::forward(fun), IsCompatibleFunctor()); } // Constructs an Action from its implementation. explicit Action(ActionInterface* impl) : fun_(ActionAdapter{::std::shared_ptr>(impl)}) {} // This constructor allows us to turn an Action object into an // Action, as long as F's arguments can be implicitly converted // to Func's and Func's return type can be implicitly converted to F's. template explicit Action(const Action& action) : fun_(action.fun_) {} // Returns true if and only if this is the DoDefault() action. bool IsDoDefault() const { return fun_ == nullptr; } // Performs the action. Note that this method is const even though // the corresponding method in ActionInterface is not. The reason // is that a const Action means that it cannot be re-bound to // another concrete action, not that the concrete action it binds to // cannot change state. (Think of the difference between a const // pointer and a pointer to const.) Result Perform(ArgumentTuple args) const { if (IsDoDefault()) { internal::IllegalDoDefault(__FILE__, __LINE__); } return internal::Apply(fun_, ::std::move(args)); } private: template friend class Action; template void Init(G&& g, ::std::true_type) { fun_ = ::std::forward(g); } template void Init(G&& g, ::std::false_type) { fun_ = IgnoreArgs::type>{::std::forward(g)}; } template struct IgnoreArgs { template Result operator()(const Args&...) const { return function_impl(); } FunctionImpl function_impl; }; // fun_ is an empty function if and only if this is the DoDefault() action. ::std::function fun_; }; // The PolymorphicAction class template makes it easy to implement a // polymorphic action (i.e. an action that can be used in mock // functions of than one type, e.g. Return()). // // To define a polymorphic action, a user first provides a COPYABLE // implementation class that has a Perform() method template: // // class FooAction { // public: // template // Result Perform(const ArgumentTuple& args) const { // // Processes the arguments and returns a result, using // // std::get(args) to get the N-th (0-based) argument in the tuple. // } // ... // }; // // Then the user creates the polymorphic action using // MakePolymorphicAction(object) where object has type FooAction. See // the definition of Return(void) and SetArgumentPointee(value) for // complete examples. template class PolymorphicAction { public: explicit PolymorphicAction(const Impl& impl) : impl_(impl) {} template operator Action() const { return Action(new MonomorphicImpl(impl_)); } private: template class MonomorphicImpl : public ActionInterface { public: typedef typename internal::Function::Result Result; typedef typename internal::Function::ArgumentTuple ArgumentTuple; explicit MonomorphicImpl(const Impl& impl) : impl_(impl) {} Result Perform(const ArgumentTuple& args) override { return impl_.template Perform(args); } private: Impl impl_; }; Impl impl_; }; // Creates an Action from its implementation and returns it. The // created Action object owns the implementation. template Action MakeAction(ActionInterface* impl) { return Action(impl); } // Creates a polymorphic action from its implementation. This is // easier to use than the PolymorphicAction constructor as it // doesn't require you to explicitly write the template argument, e.g. // // MakePolymorphicAction(foo); // vs // PolymorphicAction(foo); template inline PolymorphicAction MakePolymorphicAction(const Impl& impl) { return PolymorphicAction(impl); } namespace internal { // Helper struct to specialize ReturnAction to execute a move instead of a copy // on return. Useful for move-only types, but could be used on any type. template struct ByMoveWrapper { explicit ByMoveWrapper(T value) : payload(std::move(value)) {} T payload; }; // Implements the polymorphic Return(x) action, which can be used in // any function that returns the type of x, regardless of the argument // types. // // Note: The value passed into Return must be converted into // Function::Result when this action is cast to Action rather than // when that action is performed. This is important in scenarios like // // MOCK_METHOD1(Method, T(U)); // ... // { // Foo foo; // X x(&foo); // EXPECT_CALL(mock, Method(_)).WillOnce(Return(x)); // } // // In the example above the variable x holds reference to foo which leaves // scope and gets destroyed. If copying X just copies a reference to foo, // that copy will be left with a hanging reference. If conversion to T // makes a copy of foo, the above code is safe. To support that scenario, we // need to make sure that the type conversion happens inside the EXPECT_CALL // statement, and conversion of the result of Return to Action is a // good place for that. // // The real life example of the above scenario happens when an invocation // of gtl::Container() is passed into Return. // template class ReturnAction { public: // Constructs a ReturnAction object from the value to be returned. // 'value' is passed by value instead of by const reference in order // to allow Return("string literal") to compile. explicit ReturnAction(R value) : value_(new R(std::move(value))) {} // This template type conversion operator allows Return(x) to be // used in ANY function that returns x's type. template operator Action() const { // NOLINT // Assert statement belongs here because this is the best place to verify // conditions on F. It produces the clearest error messages // in most compilers. // Impl really belongs in this scope as a local class but can't // because MSVC produces duplicate symbols in different translation units // in this case. Until MS fixes that bug we put Impl into the class scope // and put the typedef both here (for use in assert statement) and // in the Impl class. But both definitions must be the same. typedef typename Function::Result Result; GTEST_COMPILE_ASSERT_( !std::is_reference::value, use_ReturnRef_instead_of_Return_to_return_a_reference); static_assert(!std::is_void::value, "Can't use Return() on an action expected to return `void`."); return Action(new Impl(value_)); } private: // Implements the Return(x) action for a particular function type F. template class Impl : public ActionInterface { public: typedef typename Function::Result Result; typedef typename Function::ArgumentTuple ArgumentTuple; // The implicit cast is necessary when Result has more than one // single-argument constructor (e.g. Result is std::vector) and R // has a type conversion operator template. In that case, value_(value) // won't compile as the compiler doesn't known which constructor of // Result to call. ImplicitCast_ forces the compiler to convert R to // Result without considering explicit constructors, thus resolving the // ambiguity. value_ is then initialized using its copy constructor. explicit Impl(const std::shared_ptr& value) : value_before_cast_(*value), value_(ImplicitCast_(value_before_cast_)) {} Result Perform(const ArgumentTuple&) override { return value_; } private: GTEST_COMPILE_ASSERT_(!std::is_reference::value, Result_cannot_be_a_reference_type); // We save the value before casting just in case it is being cast to a // wrapper type. R value_before_cast_; Result value_; GTEST_DISALLOW_COPY_AND_ASSIGN_(Impl); }; // Partially specialize for ByMoveWrapper. This version of ReturnAction will // move its contents instead. template class Impl, F> : public ActionInterface { public: typedef typename Function::Result Result; typedef typename Function::ArgumentTuple ArgumentTuple; explicit Impl(const std::shared_ptr& wrapper) : performed_(false), wrapper_(wrapper) {} Result Perform(const ArgumentTuple&) override { GTEST_CHECK_(!performed_) << "A ByMove() action should only be performed once."; performed_ = true; return std::move(wrapper_->payload); } private: bool performed_; const std::shared_ptr wrapper_; }; const std::shared_ptr value_; }; // Implements the ReturnNull() action. class ReturnNullAction { public: // Allows ReturnNull() to be used in any pointer-returning function. In C++11 // this is enforced by returning nullptr, and in non-C++11 by asserting a // pointer type on compile time. template static Result Perform(const ArgumentTuple&) { return nullptr; } }; // Implements the Return() action. class ReturnVoidAction { public: // Allows Return() to be used in any void-returning function. template static void Perform(const ArgumentTuple&) { static_assert(std::is_void::value, "Result should be void."); } }; // Implements the polymorphic ReturnRef(x) action, which can be used // in any function that returns a reference to the type of x, // regardless of the argument types. template class ReturnRefAction { public: // Constructs a ReturnRefAction object from the reference to be returned. explicit ReturnRefAction(T& ref) : ref_(ref) {} // NOLINT // This template type conversion operator allows ReturnRef(x) to be // used in ANY function that returns a reference to x's type. template operator Action() const { typedef typename Function::Result Result; // Asserts that the function return type is a reference. This // catches the user error of using ReturnRef(x) when Return(x) // should be used, and generates some helpful error message. GTEST_COMPILE_ASSERT_(std::is_reference::value, use_Return_instead_of_ReturnRef_to_return_a_value); return Action(new Impl(ref_)); } private: // Implements the ReturnRef(x) action for a particular function type F. template class Impl : public ActionInterface { public: typedef typename Function::Result Result; typedef typename Function::ArgumentTuple ArgumentTuple; explicit Impl(T& ref) : ref_(ref) {} // NOLINT Result Perform(const ArgumentTuple&) override { return ref_; } private: T& ref_; }; T& ref_; }; // Implements the polymorphic ReturnRefOfCopy(x) action, which can be // used in any function that returns a reference to the type of x, // regardless of the argument types. template class ReturnRefOfCopyAction { public: // Constructs a ReturnRefOfCopyAction object from the reference to // be returned. explicit ReturnRefOfCopyAction(const T& value) : value_(value) {} // NOLINT // This template type conversion operator allows ReturnRefOfCopy(x) to be // used in ANY function that returns a reference to x's type. template operator Action() const { typedef typename Function::Result Result; // Asserts that the function return type is a reference. This // catches the user error of using ReturnRefOfCopy(x) when Return(x) // should be used, and generates some helpful error message. GTEST_COMPILE_ASSERT_( std::is_reference::value, use_Return_instead_of_ReturnRefOfCopy_to_return_a_value); return Action(new Impl(value_)); } private: // Implements the ReturnRefOfCopy(x) action for a particular function type F. template class Impl : public ActionInterface { public: typedef typename Function::Result Result; typedef typename Function::ArgumentTuple ArgumentTuple; explicit Impl(const T& value) : value_(value) {} // NOLINT Result Perform(const ArgumentTuple&) override { return value_; } private: T value_; }; const T value_; }; // Implements the polymorphic ReturnRoundRobin(v) action, which can be // used in any function that returns the element_type of v. template class ReturnRoundRobinAction { public: explicit ReturnRoundRobinAction(std::vector values) { GTEST_CHECK_(!values.empty()) << "ReturnRoundRobin requires at least one element."; state_->values = std::move(values); } template T operator()(Args&&...) const { return state_->Next(); } private: struct State { T Next() { T ret_val = values[i++]; if (i == values.size()) i = 0; return ret_val; } std::vector values; size_t i = 0; }; std::shared_ptr state_ = std::make_shared(); }; // Implements the polymorphic DoDefault() action. class DoDefaultAction { public: // This template type conversion operator allows DoDefault() to be // used in any function. template operator Action() const { return Action(); } // NOLINT }; // Implements the Assign action to set a given pointer referent to a // particular value. template class AssignAction { public: AssignAction(T1* ptr, T2 value) : ptr_(ptr), value_(value) {} template void Perform(const ArgumentTuple& /* args */) const { *ptr_ = value_; } private: T1* const ptr_; const T2 value_; }; #if !GTEST_OS_WINDOWS_MOBILE // Implements the SetErrnoAndReturn action to simulate return from // various system calls and libc functions. template class SetErrnoAndReturnAction { public: SetErrnoAndReturnAction(int errno_value, T result) : errno_(errno_value), result_(result) {} template Result Perform(const ArgumentTuple& /* args */) const { errno = errno_; return result_; } private: const int errno_; const T result_; }; #endif // !GTEST_OS_WINDOWS_MOBILE // Implements the SetArgumentPointee(x) action for any function // whose N-th argument (0-based) is a pointer to x's type. template struct SetArgumentPointeeAction { A value; template void operator()(const Args&... args) const { *::std::get(std::tie(args...)) = value; } }; // Implements the Invoke(object_ptr, &Class::Method) action. template struct InvokeMethodAction { Class* const obj_ptr; const MethodPtr method_ptr; template auto operator()(Args&&... args) const -> decltype((obj_ptr->*method_ptr)(std::forward(args)...)) { return (obj_ptr->*method_ptr)(std::forward(args)...); } }; // Implements the InvokeWithoutArgs(f) action. The template argument // FunctionImpl is the implementation type of f, which can be either a // function pointer or a functor. InvokeWithoutArgs(f) can be used as an // Action as long as f's type is compatible with F. template struct InvokeWithoutArgsAction { FunctionImpl function_impl; // Allows InvokeWithoutArgs(f) to be used as any action whose type is // compatible with f. template auto operator()(const Args&...) -> decltype(function_impl()) { return function_impl(); } }; // Implements the InvokeWithoutArgs(object_ptr, &Class::Method) action. template struct InvokeMethodWithoutArgsAction { Class* const obj_ptr; const MethodPtr method_ptr; using ReturnType = decltype((std::declval()->*std::declval())()); template ReturnType operator()(const Args&...) const { return (obj_ptr->*method_ptr)(); } }; // Implements the IgnoreResult(action) action. template class IgnoreResultAction { public: explicit IgnoreResultAction(const A& action) : action_(action) {} template operator Action() const { // Assert statement belongs here because this is the best place to verify // conditions on F. It produces the clearest error messages // in most compilers. // Impl really belongs in this scope as a local class but can't // because MSVC produces duplicate symbols in different translation units // in this case. Until MS fixes that bug we put Impl into the class scope // and put the typedef both here (for use in assert statement) and // in the Impl class. But both definitions must be the same. typedef typename internal::Function::Result Result; // Asserts at compile time that F returns void. static_assert(std::is_void::value, "Result type should be void."); return Action(new Impl(action_)); } private: template class Impl : public ActionInterface { public: typedef typename internal::Function::Result Result; typedef typename internal::Function::ArgumentTuple ArgumentTuple; explicit Impl(const A& action) : action_(action) {} void Perform(const ArgumentTuple& args) override { // Performs the action and ignores its result. action_.Perform(args); } private: // Type OriginalFunction is the same as F except that its return // type is IgnoredValue. typedef typename internal::Function::MakeResultIgnoredValue OriginalFunction; const Action action_; }; const A action_; }; template struct WithArgsAction { InnerAction action; // The inner action could be anything convertible to Action. // We use the conversion operator to detect the signature of the inner Action. template operator Action() const { // NOLINT using TupleType = std::tuple; Action::type...)> converted(action); return [converted](Args... args) -> R { return converted.Perform(std::forward_as_tuple( std::get(std::forward_as_tuple(std::forward(args)...))...)); }; } }; template struct DoAllAction { private: template using NonFinalType = typename std::conditional::value, T, const T&>::type; template std::vector Convert(IndexSequence) const { return {ActionT(std::get(actions))...}; } public: std::tuple actions; template operator Action() const { // NOLINT struct Op { std::vector...)>> converted; Action last; R operator()(Args... args) const { auto tuple_args = std::forward_as_tuple(std::forward(args)...); for (auto& a : converted) { a.Perform(tuple_args); } return last.Perform(std::move(tuple_args)); } }; return Op{Convert...)>>( MakeIndexSequence()), std::get(actions)}; } }; template struct ReturnNewAction { T* operator()() const { return internal::Apply( [](const Params&... unpacked_params) { return new T(unpacked_params...); }, params); } std::tuple params; }; template struct ReturnArgAction { template auto operator()(const Args&... args) const -> typename std::tuple_element>::type { return std::get(std::tie(args...)); } }; template struct SaveArgAction { Ptr pointer; template void operator()(const Args&... args) const { *pointer = std::get(std::tie(args...)); } }; template struct SaveArgPointeeAction { Ptr pointer; template void operator()(const Args&... args) const { *pointer = *std::get(std::tie(args...)); } }; template struct SetArgRefereeAction { T value; template void operator()(Args&&... args) const { using argk_type = typename ::std::tuple_element>::type; static_assert(std::is_lvalue_reference::value, "Argument must be a reference type."); std::get(std::tie(args...)) = value; } }; template struct SetArrayArgumentAction { I1 first; I2 last; template void operator()(const Args&... args) const { auto value = std::get(std::tie(args...)); for (auto it = first; it != last; ++it, (void)++value) { *value = *it; } } }; template struct DeleteArgAction { template void operator()(const Args&... args) const { delete std::get(std::tie(args...)); } }; template struct ReturnPointeeAction { Ptr pointer; template auto operator()(const Args&...) const -> decltype(*pointer) { return *pointer; } }; #if GTEST_HAS_EXCEPTIONS template struct ThrowAction { T exception; // We use a conversion operator to adapt to any return type. template operator Action() const { // NOLINT T copy = exception; return [copy](Args...) -> R { throw copy; }; } }; #endif // GTEST_HAS_EXCEPTIONS } // namespace internal // An Unused object can be implicitly constructed from ANY value. // This is handy when defining actions that ignore some or all of the // mock function arguments. For example, given // // MOCK_METHOD3(Foo, double(const string& label, double x, double y)); // MOCK_METHOD3(Bar, double(int index, double x, double y)); // // instead of // // double DistanceToOriginWithLabel(const string& label, double x, double y) { // return sqrt(x*x + y*y); // } // double DistanceToOriginWithIndex(int index, double x, double y) { // return sqrt(x*x + y*y); // } // ... // EXPECT_CALL(mock, Foo("abc", _, _)) // .WillOnce(Invoke(DistanceToOriginWithLabel)); // EXPECT_CALL(mock, Bar(5, _, _)) // .WillOnce(Invoke(DistanceToOriginWithIndex)); // // you could write // // // We can declare any uninteresting argument as Unused. // double DistanceToOrigin(Unused, double x, double y) { // return sqrt(x*x + y*y); // } // ... // EXPECT_CALL(mock, Foo("abc", _, _)).WillOnce(Invoke(DistanceToOrigin)); // EXPECT_CALL(mock, Bar(5, _, _)).WillOnce(Invoke(DistanceToOrigin)); typedef internal::IgnoredValue Unused; // Creates an action that does actions a1, a2, ..., sequentially in // each invocation. All but the last action will have a readonly view of the // arguments. template internal::DoAllAction::type...> DoAll( Action&&... action) { return {std::forward_as_tuple(std::forward(action)...)}; } // WithArg(an_action) creates an action that passes the k-th // (0-based) argument of the mock function to an_action and performs // it. It adapts an action accepting one argument to one that accepts // multiple arguments. For convenience, we also provide // WithArgs(an_action) (defined below) as a synonym. template internal::WithArgsAction::type, k> WithArg(InnerAction&& action) { return {std::forward(action)}; } // WithArgs(an_action) creates an action that passes // the selected arguments of the mock function to an_action and // performs it. It serves as an adaptor between actions with // different argument lists. template internal::WithArgsAction::type, k, ks...> WithArgs(InnerAction&& action) { return {std::forward(action)}; } // WithoutArgs(inner_action) can be used in a mock function with a // non-empty argument list to perform inner_action, which takes no // argument. In other words, it adapts an action accepting no // argument to one that accepts (and ignores) arguments. template internal::WithArgsAction::type> WithoutArgs(InnerAction&& action) { return {std::forward(action)}; } // Creates an action that returns 'value'. 'value' is passed by value // instead of const reference - otherwise Return("string literal") // will trigger a compiler error about using array as initializer. template internal::ReturnAction Return(R value) { return internal::ReturnAction(std::move(value)); } // Creates an action that returns NULL. inline PolymorphicAction ReturnNull() { return MakePolymorphicAction(internal::ReturnNullAction()); } // Creates an action that returns from a void function. inline PolymorphicAction Return() { return MakePolymorphicAction(internal::ReturnVoidAction()); } // Creates an action that returns the reference to a variable. template inline internal::ReturnRefAction ReturnRef(R& x) { // NOLINT return internal::ReturnRefAction(x); } // Prevent using ReturnRef on reference to temporary. template internal::ReturnRefAction ReturnRef(R&&) = delete; // Creates an action that returns the reference to a copy of the // argument. The copy is created when the action is constructed and // lives as long as the action. template inline internal::ReturnRefOfCopyAction ReturnRefOfCopy(const R& x) { return internal::ReturnRefOfCopyAction(x); } // Modifies the parent action (a Return() action) to perform a move of the // argument instead of a copy. // Return(ByMove()) actions can only be executed once and will assert this // invariant. template internal::ByMoveWrapper ByMove(R x) { return internal::ByMoveWrapper(std::move(x)); } // Creates an action that returns an element of `vals`. Calling this action will // repeatedly return the next value from `vals` until it reaches the end and // will restart from the beginning. template internal::ReturnRoundRobinAction ReturnRoundRobin(std::vector vals) { return internal::ReturnRoundRobinAction(std::move(vals)); } // Creates an action that returns an element of `vals`. Calling this action will // repeatedly return the next value from `vals` until it reaches the end and // will restart from the beginning. template internal::ReturnRoundRobinAction ReturnRoundRobin( std::initializer_list vals) { return internal::ReturnRoundRobinAction(std::vector(vals)); } // Creates an action that does the default action for the give mock function. inline internal::DoDefaultAction DoDefault() { return internal::DoDefaultAction(); } // Creates an action that sets the variable pointed by the N-th // (0-based) function argument to 'value'. template internal::SetArgumentPointeeAction SetArgPointee(T value) { return {std::move(value)}; } // The following version is DEPRECATED. template internal::SetArgumentPointeeAction SetArgumentPointee(T value) { return {std::move(value)}; } // Creates an action that sets a pointer referent to a given value. template PolymorphicAction > Assign(T1* ptr, T2 val) { return MakePolymorphicAction(internal::AssignAction(ptr, val)); } #if !GTEST_OS_WINDOWS_MOBILE // Creates an action that sets errno and returns the appropriate error. template PolymorphicAction > SetErrnoAndReturn(int errval, T result) { return MakePolymorphicAction( internal::SetErrnoAndReturnAction(errval, result)); } #endif // !GTEST_OS_WINDOWS_MOBILE // Various overloads for Invoke(). // Legacy function. // Actions can now be implicitly constructed from callables. No need to create // wrapper objects. // This function exists for backwards compatibility. template typename std::decay::type Invoke(FunctionImpl&& function_impl) { return std::forward(function_impl); } // Creates an action that invokes the given method on the given object // with the mock function's arguments. template internal::InvokeMethodAction Invoke(Class* obj_ptr, MethodPtr method_ptr) { return {obj_ptr, method_ptr}; } // Creates an action that invokes 'function_impl' with no argument. template internal::InvokeWithoutArgsAction::type> InvokeWithoutArgs(FunctionImpl function_impl) { return {std::move(function_impl)}; } // Creates an action that invokes the given method on the given object // with no argument. template internal::InvokeMethodWithoutArgsAction InvokeWithoutArgs( Class* obj_ptr, MethodPtr method_ptr) { return {obj_ptr, method_ptr}; } // Creates an action that performs an_action and throws away its // result. In other words, it changes the return type of an_action to // void. an_action MUST NOT return void, or the code won't compile. template inline internal::IgnoreResultAction IgnoreResult(const A& an_action) { return internal::IgnoreResultAction(an_action); } // Creates a reference wrapper for the given L-value. If necessary, // you can explicitly specify the type of the reference. For example, // suppose 'derived' is an object of type Derived, ByRef(derived) // would wrap a Derived&. If you want to wrap a const Base& instead, // where Base is a base class of Derived, just write: // // ByRef(derived) // // N.B. ByRef is redundant with std::ref, std::cref and std::reference_wrapper. // However, it may still be used for consistency with ByMove(). template inline ::std::reference_wrapper ByRef(T& l_value) { // NOLINT return ::std::reference_wrapper(l_value); } // The ReturnNew(a1, a2, ..., a_k) action returns a pointer to a new // instance of type T, constructed on the heap with constructor arguments // a1, a2, ..., and a_k. The caller assumes ownership of the returned value. template internal::ReturnNewAction::type...> ReturnNew( Params&&... params) { return {std::forward_as_tuple(std::forward(params)...)}; } // Action ReturnArg() returns the k-th argument of the mock function. template internal::ReturnArgAction ReturnArg() { return {}; } // Action SaveArg(pointer) saves the k-th (0-based) argument of the // mock function to *pointer. template internal::SaveArgAction SaveArg(Ptr pointer) { return {pointer}; } // Action SaveArgPointee(pointer) saves the value pointed to // by the k-th (0-based) argument of the mock function to *pointer. template internal::SaveArgPointeeAction SaveArgPointee(Ptr pointer) { return {pointer}; } // Action SetArgReferee(value) assigns 'value' to the variable // referenced by the k-th (0-based) argument of the mock function. template internal::SetArgRefereeAction::type> SetArgReferee( T&& value) { return {std::forward(value)}; } // Action SetArrayArgument(first, last) copies the elements in // source range [first, last) to the array pointed to by the k-th // (0-based) argument, which can be either a pointer or an // iterator. The action does not take ownership of the elements in the // source range. template internal::SetArrayArgumentAction SetArrayArgument(I1 first, I2 last) { return {first, last}; } // Action DeleteArg() deletes the k-th (0-based) argument of the mock // function. template internal::DeleteArgAction DeleteArg() { return {}; } // This action returns the value pointed to by 'pointer'. template internal::ReturnPointeeAction ReturnPointee(Ptr pointer) { return {pointer}; } // Action Throw(exception) can be used in a mock function of any type // to throw the given exception. Any copyable value can be thrown. #if GTEST_HAS_EXCEPTIONS template internal::ThrowAction::type> Throw(T&& exception) { return {std::forward(exception)}; } #endif // GTEST_HAS_EXCEPTIONS namespace internal { // A macro from the ACTION* family (defined later in gmock-generated-actions.h) // defines an action that can be used in a mock function. Typically, // these actions only care about a subset of the arguments of the mock // function. For example, if such an action only uses the second // argument, it can be used in any mock function that takes >= 2 // arguments where the type of the second argument is compatible. // // Therefore, the action implementation must be prepared to take more // arguments than it needs. The ExcessiveArg type is used to // represent those excessive arguments. In order to keep the compiler // error messages tractable, we define it in the testing namespace // instead of testing::internal. However, this is an INTERNAL TYPE // and subject to change without notice, so a user MUST NOT USE THIS // TYPE DIRECTLY. struct ExcessiveArg {}; // Builds an implementation of an Action<> for some particular signature, using // a class defined by an ACTION* macro. template struct ActionImpl; template struct ImplBase { struct Holder { // Allows each copy of the Action<> to get to the Impl. explicit operator const Impl&() const { return *ptr; } std::shared_ptr ptr; }; using type = typename std::conditional::value, Impl, Holder>::type; }; template struct ActionImpl : ImplBase::type { using Base = typename ImplBase::type; using function_type = R(Args...); using args_type = std::tuple; ActionImpl() = default; // Only defined if appropriate for Base. explicit ActionImpl(std::shared_ptr impl) : Base{std::move(impl)} { } R operator()(Args&&... arg) const { static constexpr size_t kMaxArgs = sizeof...(Args) <= 10 ? sizeof...(Args) : 10; return Apply(MakeIndexSequence{}, MakeIndexSequence<10 - kMaxArgs>{}, args_type{std::forward(arg)...}); } template R Apply(IndexSequence, IndexSequence, const args_type& args) const { // Impl need not be specific to the signature of action being implemented; // only the implementing function body needs to have all of the specific // types instantiated. Up to 10 of the args that are provided by the // args_type get passed, followed by a dummy of unspecified type for the // remainder up to 10 explicit args. static constexpr ExcessiveArg kExcessArg{}; return static_cast(*this).template gmock_PerformImpl< /*function_type=*/function_type, /*return_type=*/R, /*args_type=*/args_type, /*argN_type=*/typename std::tuple_element::type...>( /*args=*/args, std::get(args)..., ((void)excess_id, kExcessArg)...); } }; // Stores a default-constructed Impl as part of the Action<>'s // std::function<>. The Impl should be trivial to copy. template ::testing::Action MakeAction() { return ::testing::Action(ActionImpl()); } // Stores just the one given instance of Impl. template ::testing::Action MakeAction(std::shared_ptr impl) { return ::testing::Action(ActionImpl(std::move(impl))); } #define GMOCK_INTERNAL_ARG_UNUSED(i, data, el) \ , const arg##i##_type& arg##i GTEST_ATTRIBUTE_UNUSED_ #define GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_ \ const args_type& args GTEST_ATTRIBUTE_UNUSED_ GMOCK_PP_REPEAT( \ GMOCK_INTERNAL_ARG_UNUSED, , 10) #define GMOCK_INTERNAL_ARG(i, data, el) , const arg##i##_type& arg##i #define GMOCK_ACTION_ARG_TYPES_AND_NAMES_ \ const args_type& args GMOCK_PP_REPEAT(GMOCK_INTERNAL_ARG, , 10) #define GMOCK_INTERNAL_TEMPLATE_ARG(i, data, el) , typename arg##i##_type #define GMOCK_ACTION_TEMPLATE_ARGS_NAMES_ \ GMOCK_PP_TAIL(GMOCK_PP_REPEAT(GMOCK_INTERNAL_TEMPLATE_ARG, , 10)) #define GMOCK_INTERNAL_TYPENAME_PARAM(i, data, param) , typename param##_type #define GMOCK_ACTION_TYPENAME_PARAMS_(params) \ GMOCK_PP_TAIL(GMOCK_PP_FOR_EACH(GMOCK_INTERNAL_TYPENAME_PARAM, , params)) #define GMOCK_INTERNAL_TYPE_PARAM(i, data, param) , param##_type #define GMOCK_ACTION_TYPE_PARAMS_(params) \ GMOCK_PP_TAIL(GMOCK_PP_FOR_EACH(GMOCK_INTERNAL_TYPE_PARAM, , params)) #define GMOCK_INTERNAL_TYPE_GVALUE_PARAM(i, data, param) \ , param##_type gmock_p##i #define GMOCK_ACTION_TYPE_GVALUE_PARAMS_(params) \ GMOCK_PP_TAIL(GMOCK_PP_FOR_EACH(GMOCK_INTERNAL_TYPE_GVALUE_PARAM, , params)) #define GMOCK_INTERNAL_GVALUE_PARAM(i, data, param) \ , std::forward(gmock_p##i) #define GMOCK_ACTION_GVALUE_PARAMS_(params) \ GMOCK_PP_TAIL(GMOCK_PP_FOR_EACH(GMOCK_INTERNAL_GVALUE_PARAM, , params)) #define GMOCK_INTERNAL_INIT_PARAM(i, data, param) \ , param(::std::forward(gmock_p##i)) #define GMOCK_ACTION_INIT_PARAMS_(params) \ GMOCK_PP_TAIL(GMOCK_PP_FOR_EACH(GMOCK_INTERNAL_INIT_PARAM, , params)) #define GMOCK_INTERNAL_FIELD_PARAM(i, data, param) param##_type param; #define GMOCK_ACTION_FIELD_PARAMS_(params) \ GMOCK_PP_FOR_EACH(GMOCK_INTERNAL_FIELD_PARAM, , params) #define GMOCK_INTERNAL_ACTION(name, full_name, params) \ template \ class full_name { \ public: \ explicit full_name(GMOCK_ACTION_TYPE_GVALUE_PARAMS_(params)) \ : impl_(std::make_shared( \ GMOCK_ACTION_GVALUE_PARAMS_(params))) { } \ full_name(const full_name&) = default; \ full_name(full_name&&) noexcept = default; \ template \ operator ::testing::Action() const { \ return ::testing::internal::MakeAction(impl_); \ } \ private: \ class gmock_Impl { \ public: \ explicit gmock_Impl(GMOCK_ACTION_TYPE_GVALUE_PARAMS_(params)) \ : GMOCK_ACTION_INIT_PARAMS_(params) {} \ template \ return_type gmock_PerformImpl(GMOCK_ACTION_ARG_TYPES_AND_NAMES_) const; \ GMOCK_ACTION_FIELD_PARAMS_(params) \ }; \ std::shared_ptr impl_; \ }; \ template \ inline full_name name( \ GMOCK_ACTION_TYPE_GVALUE_PARAMS_(params)) { \ return full_name( \ GMOCK_ACTION_GVALUE_PARAMS_(params)); \ } \ template \ template \ return_type full_name::gmock_Impl:: \ gmock_PerformImpl(GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const } // namespace internal // Similar to GMOCK_INTERNAL_ACTION, but no bound parameters are stored. #define ACTION(name) \ class name##Action { \ public: \ explicit name##Action() noexcept {} \ name##Action(const name##Action&) noexcept {} \ template \ operator ::testing::Action() const { \ return ::testing::internal::MakeAction(); \ } \ private: \ class gmock_Impl { \ public: \ template \ return_type gmock_PerformImpl(GMOCK_ACTION_ARG_TYPES_AND_NAMES_) const; \ }; \ }; \ inline name##Action name() GTEST_MUST_USE_RESULT_; \ inline name##Action name() { return name##Action(); } \ template \ return_type name##Action::gmock_Impl::gmock_PerformImpl( \ GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const #define ACTION_P(name, ...) \ GMOCK_INTERNAL_ACTION(name, name##ActionP, (__VA_ARGS__)) #define ACTION_P2(name, ...) \ GMOCK_INTERNAL_ACTION(name, name##ActionP2, (__VA_ARGS__)) #define ACTION_P3(name, ...) \ GMOCK_INTERNAL_ACTION(name, name##ActionP3, (__VA_ARGS__)) #define ACTION_P4(name, ...) \ GMOCK_INTERNAL_ACTION(name, name##ActionP4, (__VA_ARGS__)) #define ACTION_P5(name, ...) \ GMOCK_INTERNAL_ACTION(name, name##ActionP5, (__VA_ARGS__)) #define ACTION_P6(name, ...) \ GMOCK_INTERNAL_ACTION(name, name##ActionP6, (__VA_ARGS__)) #define ACTION_P7(name, ...) \ GMOCK_INTERNAL_ACTION(name, name##ActionP7, (__VA_ARGS__)) #define ACTION_P8(name, ...) \ GMOCK_INTERNAL_ACTION(name, name##ActionP8, (__VA_ARGS__)) #define ACTION_P9(name, ...) \ GMOCK_INTERNAL_ACTION(name, name##ActionP9, (__VA_ARGS__)) #define ACTION_P10(name, ...) \ GMOCK_INTERNAL_ACTION(name, name##ActionP10, (__VA_ARGS__)) } // namespace testing #ifdef _MSC_VER # pragma warning(pop) #endif #endif // GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_ACTIONS_H_ // Copyright 2007, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Google Mock - a framework for writing C++ mock classes. // // This file implements some commonly used cardinalities. More // cardinalities can be defined by the user implementing the // CardinalityInterface interface if necessary. // GOOGLETEST_CM0002 DO NOT DELETE #ifndef GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_CARDINALITIES_H_ #define GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_CARDINALITIES_H_ #include #include #include // NOLINT GTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \ /* class A needs to have dll-interface to be used by clients of class B */) namespace testing { // To implement a cardinality Foo, define: // 1. a class FooCardinality that implements the // CardinalityInterface interface, and // 2. a factory function that creates a Cardinality object from a // const FooCardinality*. // // The two-level delegation design follows that of Matcher, providing // consistency for extension developers. It also eases ownership // management as Cardinality objects can now be copied like plain values. // The implementation of a cardinality. class CardinalityInterface { public: virtual ~CardinalityInterface() {} // Conservative estimate on the lower/upper bound of the number of // calls allowed. virtual int ConservativeLowerBound() const { return 0; } virtual int ConservativeUpperBound() const { return INT_MAX; } // Returns true if and only if call_count calls will satisfy this // cardinality. virtual bool IsSatisfiedByCallCount(int call_count) const = 0; // Returns true if and only if call_count calls will saturate this // cardinality. virtual bool IsSaturatedByCallCount(int call_count) const = 0; // Describes self to an ostream. virtual void DescribeTo(::std::ostream* os) const = 0; }; // A Cardinality is a copyable and IMMUTABLE (except by assignment) // object that specifies how many times a mock function is expected to // be called. The implementation of Cardinality is just a std::shared_ptr // to const CardinalityInterface. Don't inherit from Cardinality! class GTEST_API_ Cardinality { public: // Constructs a null cardinality. Needed for storing Cardinality // objects in STL containers. Cardinality() {} // Constructs a Cardinality from its implementation. explicit Cardinality(const CardinalityInterface* impl) : impl_(impl) {} // Conservative estimate on the lower/upper bound of the number of // calls allowed. int ConservativeLowerBound() const { return impl_->ConservativeLowerBound(); } int ConservativeUpperBound() const { return impl_->ConservativeUpperBound(); } // Returns true if and only if call_count calls will satisfy this // cardinality. bool IsSatisfiedByCallCount(int call_count) const { return impl_->IsSatisfiedByCallCount(call_count); } // Returns true if and only if call_count calls will saturate this // cardinality. bool IsSaturatedByCallCount(int call_count) const { return impl_->IsSaturatedByCallCount(call_count); } // Returns true if and only if call_count calls will over-saturate this // cardinality, i.e. exceed the maximum number of allowed calls. bool IsOverSaturatedByCallCount(int call_count) const { return impl_->IsSaturatedByCallCount(call_count) && !impl_->IsSatisfiedByCallCount(call_count); } // Describes self to an ostream void DescribeTo(::std::ostream* os) const { impl_->DescribeTo(os); } // Describes the given actual call count to an ostream. static void DescribeActualCallCountTo(int actual_call_count, ::std::ostream* os); private: std::shared_ptr impl_; }; // Creates a cardinality that allows at least n calls. GTEST_API_ Cardinality AtLeast(int n); // Creates a cardinality that allows at most n calls. GTEST_API_ Cardinality AtMost(int n); // Creates a cardinality that allows any number of calls. GTEST_API_ Cardinality AnyNumber(); // Creates a cardinality that allows between min and max calls. GTEST_API_ Cardinality Between(int min, int max); // Creates a cardinality that allows exactly n calls. GTEST_API_ Cardinality Exactly(int n); // Creates a cardinality from its implementation. inline Cardinality MakeCardinality(const CardinalityInterface* c) { return Cardinality(c); } } // namespace testing GTEST_DISABLE_MSC_WARNINGS_POP_() // 4251 #endif // GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_CARDINALITIES_H_ // Copyright 2007, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Google Mock - a framework for writing C++ mock classes. // // This file implements MOCK_METHOD. // GOOGLETEST_CM0002 DO NOT DELETE #ifndef GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_FUNCTION_MOCKER_H_ // NOLINT #define GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_FUNCTION_MOCKER_H_ // NOLINT #include // IWYU pragma: keep #include // IWYU pragma: keep // Copyright 2007, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Google Mock - a framework for writing C++ mock classes. // // This file implements the ON_CALL() and EXPECT_CALL() macros. // // A user can use the ON_CALL() macro to specify the default action of // a mock method. The syntax is: // // ON_CALL(mock_object, Method(argument-matchers)) // .With(multi-argument-matcher) // .WillByDefault(action); // // where the .With() clause is optional. // // A user can use the EXPECT_CALL() macro to specify an expectation on // a mock method. The syntax is: // // EXPECT_CALL(mock_object, Method(argument-matchers)) // .With(multi-argument-matchers) // .Times(cardinality) // .InSequence(sequences) // .After(expectations) // .WillOnce(action) // .WillRepeatedly(action) // .RetiresOnSaturation(); // // where all clauses are optional, and .InSequence()/.After()/ // .WillOnce() can appear any number of times. // GOOGLETEST_CM0002 DO NOT DELETE #ifndef GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_SPEC_BUILDERS_H_ #define GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_SPEC_BUILDERS_H_ #include #include #include #include #include #include #include #include #include // Copyright 2007, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Google Mock - a framework for writing C++ mock classes. // // The MATCHER* family of macros can be used in a namespace scope to // define custom matchers easily. // // Basic Usage // =========== // // The syntax // // MATCHER(name, description_string) { statements; } // // defines a matcher with the given name that executes the statements, // which must return a bool to indicate if the match succeeds. Inside // the statements, you can refer to the value being matched by 'arg', // and refer to its type by 'arg_type'. // // The description string documents what the matcher does, and is used // to generate the failure message when the match fails. Since a // MATCHER() is usually defined in a header file shared by multiple // C++ source files, we require the description to be a C-string // literal to avoid possible side effects. It can be empty, in which // case we'll use the sequence of words in the matcher name as the // description. // // For example: // // MATCHER(IsEven, "") { return (arg % 2) == 0; } // // allows you to write // // // Expects mock_foo.Bar(n) to be called where n is even. // EXPECT_CALL(mock_foo, Bar(IsEven())); // // or, // // // Verifies that the value of some_expression is even. // EXPECT_THAT(some_expression, IsEven()); // // If the above assertion fails, it will print something like: // // Value of: some_expression // Expected: is even // Actual: 7 // // where the description "is even" is automatically calculated from the // matcher name IsEven. // // Argument Type // ============= // // Note that the type of the value being matched (arg_type) is // determined by the context in which you use the matcher and is // supplied to you by the compiler, so you don't need to worry about // declaring it (nor can you). This allows the matcher to be // polymorphic. For example, IsEven() can be used to match any type // where the value of "(arg % 2) == 0" can be implicitly converted to // a bool. In the "Bar(IsEven())" example above, if method Bar() // takes an int, 'arg_type' will be int; if it takes an unsigned long, // 'arg_type' will be unsigned long; and so on. // // Parameterizing Matchers // ======================= // // Sometimes you'll want to parameterize the matcher. For that you // can use another macro: // // MATCHER_P(name, param_name, description_string) { statements; } // // For example: // // MATCHER_P(HasAbsoluteValue, value, "") { return abs(arg) == value; } // // will allow you to write: // // EXPECT_THAT(Blah("a"), HasAbsoluteValue(n)); // // which may lead to this message (assuming n is 10): // // Value of: Blah("a") // Expected: has absolute value 10 // Actual: -9 // // Note that both the matcher description and its parameter are // printed, making the message human-friendly. // // In the matcher definition body, you can write 'foo_type' to // reference the type of a parameter named 'foo'. For example, in the // body of MATCHER_P(HasAbsoluteValue, value) above, you can write // 'value_type' to refer to the type of 'value'. // // We also provide MATCHER_P2, MATCHER_P3, ..., up to MATCHER_P$n to // support multi-parameter matchers. // // Describing Parameterized Matchers // ================================= // // The last argument to MATCHER*() is a string-typed expression. The // expression can reference all of the matcher's parameters and a // special bool-typed variable named 'negation'. When 'negation' is // false, the expression should evaluate to the matcher's description; // otherwise it should evaluate to the description of the negation of // the matcher. For example, // // using testing::PrintToString; // // MATCHER_P2(InClosedRange, low, hi, // std::string(negation ? "is not" : "is") + " in range [" + // PrintToString(low) + ", " + PrintToString(hi) + "]") { // return low <= arg && arg <= hi; // } // ... // EXPECT_THAT(3, InClosedRange(4, 6)); // EXPECT_THAT(3, Not(InClosedRange(2, 4))); // // would generate two failures that contain the text: // // Expected: is in range [4, 6] // ... // Expected: is not in range [2, 4] // // If you specify "" as the description, the failure message will // contain the sequence of words in the matcher name followed by the // parameter values printed as a tuple. For example, // // MATCHER_P2(InClosedRange, low, hi, "") { ... } // ... // EXPECT_THAT(3, InClosedRange(4, 6)); // EXPECT_THAT(3, Not(InClosedRange(2, 4))); // // would generate two failures that contain the text: // // Expected: in closed range (4, 6) // ... // Expected: not (in closed range (2, 4)) // // Types of Matcher Parameters // =========================== // // For the purpose of typing, you can view // // MATCHER_Pk(Foo, p1, ..., pk, description_string) { ... } // // as shorthand for // // template // FooMatcherPk // Foo(p1_type p1, ..., pk_type pk) { ... } // // When you write Foo(v1, ..., vk), the compiler infers the types of // the parameters v1, ..., and vk for you. If you are not happy with // the result of the type inference, you can specify the types by // explicitly instantiating the template, as in Foo(5, // false). As said earlier, you don't get to (or need to) specify // 'arg_type' as that's determined by the context in which the matcher // is used. You can assign the result of expression Foo(p1, ..., pk) // to a variable of type FooMatcherPk. This // can be useful when composing matchers. // // While you can instantiate a matcher template with reference types, // passing the parameters by pointer usually makes your code more // readable. If, however, you still want to pass a parameter by // reference, be aware that in the failure message generated by the // matcher you will see the value of the referenced object but not its // address. // // Explaining Match Results // ======================== // // Sometimes the matcher description alone isn't enough to explain why // the match has failed or succeeded. For example, when expecting a // long string, it can be very helpful to also print the diff between // the expected string and the actual one. To achieve that, you can // optionally stream additional information to a special variable // named result_listener, whose type is a pointer to class // MatchResultListener: // // MATCHER_P(EqualsLongString, str, "") { // if (arg == str) return true; // // *result_listener << "the difference: " /// << DiffStrings(str, arg); // return false; // } // // Overloading Matchers // ==================== // // You can overload matchers with different numbers of parameters: // // MATCHER_P(Blah, a, description_string1) { ... } // MATCHER_P2(Blah, a, b, description_string2) { ... } // // Caveats // ======= // // When defining a new matcher, you should also consider implementing // MatcherInterface or using MakePolymorphicMatcher(). These // approaches require more work than the MATCHER* macros, but also // give you more control on the types of the value being matched and // the matcher parameters, which may leads to better compiler error // messages when the matcher is used wrong. They also allow // overloading matchers based on parameter types (as opposed to just // based on the number of parameters). // // MATCHER*() can only be used in a namespace scope as templates cannot be // declared inside of a local class. // // More Information // ================ // // To learn more about using these macros, please search for 'MATCHER' // on // https://github.com/google/googletest/blob/master/docs/gmock_cook_book.md // // This file also implements some commonly used argument matchers. More // matchers can be defined by the user implementing the // MatcherInterface interface if necessary. // // See googletest/include/gtest/gtest-matchers.h for the definition of class // Matcher, class MatcherInterface, and others. // GOOGLETEST_CM0002 DO NOT DELETE #ifndef GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_MATCHERS_H_ #define GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_MATCHERS_H_ #include #include #include #include #include #include #include // NOLINT #include #include #include #include #include // MSVC warning C5046 is new as of VS2017 version 15.8. #if defined(_MSC_VER) && _MSC_VER >= 1915 #define GMOCK_MAYBE_5046_ 5046 #else #define GMOCK_MAYBE_5046_ #endif GTEST_DISABLE_MSC_WARNINGS_PUSH_( 4251 GMOCK_MAYBE_5046_ /* class A needs to have dll-interface to be used by clients of class B */ /* Symbol involving type with internal linkage not defined */) namespace testing { // To implement a matcher Foo for type T, define: // 1. a class FooMatcherImpl that implements the // MatcherInterface interface, and // 2. a factory function that creates a Matcher object from a // FooMatcherImpl*. // // The two-level delegation design makes it possible to allow a user // to write "v" instead of "Eq(v)" where a Matcher is expected, which // is impossible if we pass matchers by pointers. It also eases // ownership management as Matcher objects can now be copied like // plain values. // A match result listener that stores the explanation in a string. class StringMatchResultListener : public MatchResultListener { public: StringMatchResultListener() : MatchResultListener(&ss_) {} // Returns the explanation accumulated so far. std::string str() const { return ss_.str(); } // Clears the explanation accumulated so far. void Clear() { ss_.str(""); } private: ::std::stringstream ss_; GTEST_DISALLOW_COPY_AND_ASSIGN_(StringMatchResultListener); }; // Anything inside the 'internal' namespace IS INTERNAL IMPLEMENTATION // and MUST NOT BE USED IN USER CODE!!! namespace internal { // The MatcherCastImpl class template is a helper for implementing // MatcherCast(). We need this helper in order to partially // specialize the implementation of MatcherCast() (C++ allows // class/struct templates to be partially specialized, but not // function templates.). // This general version is used when MatcherCast()'s argument is a // polymorphic matcher (i.e. something that can be converted to a // Matcher but is not one yet; for example, Eq(value)) or a value (for // example, "hello"). template class MatcherCastImpl { public: static Matcher Cast(const M& polymorphic_matcher_or_value) { // M can be a polymorphic matcher, in which case we want to use // its conversion operator to create Matcher. Or it can be a value // that should be passed to the Matcher's constructor. // // We can't call Matcher(polymorphic_matcher_or_value) when M is a // polymorphic matcher because it'll be ambiguous if T has an implicit // constructor from M (this usually happens when T has an implicit // constructor from any type). // // It won't work to unconditionally implicit_cast // polymorphic_matcher_or_value to Matcher because it won't trigger // a user-defined conversion from M to T if one exists (assuming M is // a value). return CastImpl(polymorphic_matcher_or_value, std::is_convertible>{}, std::is_convertible{}); } private: template static Matcher CastImpl(const M& polymorphic_matcher_or_value, std::true_type /* convertible_to_matcher */, std::integral_constant) { // M is implicitly convertible to Matcher, which means that either // M is a polymorphic matcher or Matcher has an implicit constructor // from M. In both cases using the implicit conversion will produce a // matcher. // // Even if T has an implicit constructor from M, it won't be called because // creating Matcher would require a chain of two user-defined conversions // (first to create T from M and then to create Matcher from T). return polymorphic_matcher_or_value; } // M can't be implicitly converted to Matcher, so M isn't a polymorphic // matcher. It's a value of a type implicitly convertible to T. Use direct // initialization to create a matcher. static Matcher CastImpl(const M& value, std::false_type /* convertible_to_matcher */, std::true_type /* convertible_to_T */) { return Matcher(ImplicitCast_(value)); } // M can't be implicitly converted to either Matcher or T. Attempt to use // polymorphic matcher Eq(value) in this case. // // Note that we first attempt to perform an implicit cast on the value and // only fall back to the polymorphic Eq() matcher afterwards because the // latter calls bool operator==(const Lhs& lhs, const Rhs& rhs) in the end // which might be undefined even when Rhs is implicitly convertible to Lhs // (e.g. std::pair vs. std::pair). // // We don't define this method inline as we need the declaration of Eq(). static Matcher CastImpl(const M& value, std::false_type /* convertible_to_matcher */, std::false_type /* convertible_to_T */); }; // This more specialized version is used when MatcherCast()'s argument // is already a Matcher. This only compiles when type T can be // statically converted to type U. template class MatcherCastImpl > { public: static Matcher Cast(const Matcher& source_matcher) { return Matcher(new Impl(source_matcher)); } private: class Impl : public MatcherInterface { public: explicit Impl(const Matcher& source_matcher) : source_matcher_(source_matcher) {} // We delegate the matching logic to the source matcher. bool MatchAndExplain(T x, MatchResultListener* listener) const override { using FromType = typename std::remove_cv::type>::type>::type; using ToType = typename std::remove_cv::type>::type>::type; // Do not allow implicitly converting base*/& to derived*/&. static_assert( // Do not trigger if only one of them is a pointer. That implies a // regular conversion and not a down_cast. (std::is_pointer::type>::value != std::is_pointer::type>::value) || std::is_same::value || !std::is_base_of::value, "Can't implicitly convert from to "); // Do the cast to `U` explicitly if necessary. // Otherwise, let implicit conversions do the trick. using CastType = typename std::conditional::value, T&, U>::type; return source_matcher_.MatchAndExplain(static_cast(x), listener); } void DescribeTo(::std::ostream* os) const override { source_matcher_.DescribeTo(os); } void DescribeNegationTo(::std::ostream* os) const override { source_matcher_.DescribeNegationTo(os); } private: const Matcher source_matcher_; }; }; // This even more specialized version is used for efficiently casting // a matcher to its own type. template class MatcherCastImpl > { public: static Matcher Cast(const Matcher& matcher) { return matcher; } }; // Template specialization for parameterless Matcher. template class MatcherBaseImpl { public: MatcherBaseImpl() = default; template operator ::testing::Matcher() const { // NOLINT(runtime/explicit) return ::testing::Matcher(new typename Derived::template gmock_Impl()); } }; // Template specialization for Matcher with parameters. template