pax_global_header00006660000000000000000000000064141333052740014514gustar00rootroot0000000000000052 comment=b1b98341085f93c1cd60479f7aac240c5f2e681b pycares-pycares-4.1.2/000077500000000000000000000000001413330527400146325ustar00rootroot00000000000000pycares-pycares-4.1.2/.github/000077500000000000000000000000001413330527400161725ustar00rootroot00000000000000pycares-pycares-4.1.2/.github/workflows/000077500000000000000000000000001413330527400202275ustar00rootroot00000000000000pycares-pycares-4.1.2/.github/workflows/build-wheels.yml000066400000000000000000000014061413330527400233370ustar00rootroot00000000000000name: Build Wheels on: [pull_request] jobs: build_wheels: name: Build wheels on ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: matrix: os: [ubuntu-20.04, windows-2019, macos-10.15] steps: - uses: actions/checkout@v2 with: submodules: true - name: Set up QEMU if: runner.os == 'Linux' uses: docker/setup-qemu-action@v1 with: platforms: all - name: Build wheels uses: pypa/cibuildwheel@v2.0.1 with: output-dir: ./wheelhouse env: CIBW_BUILD: "cp36-* cp37-* cp38-* cp39-* cp310-*" CIBW_ARCHS_LINUX: auto aarch64 CIBW_PRERELEASE_PYTHONS: True CIBW_BEFORE_ALL_LINUX: yum install -y libffi-devel pycares-pycares-4.1.2/.github/workflows/release-wheels.yml000066400000000000000000000033651413330527400236660ustar00rootroot00000000000000name: Release Wheels on: release: types: - published jobs: build_wheels: name: Build wheels on ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: matrix: os: [ubuntu-20.04, windows-2019, macos-10.15] steps: - uses: actions/checkout@v2 with: submodules: true - name: Set up QEMU if: runner.os == 'Linux' uses: docker/setup-qemu-action@v1 with: platforms: all - name: Build wheels uses: pypa/cibuildwheel@v2.0.1 with: output-dir: ./wheelhouse env: CIBW_BUILD: "cp36-* cp37-* cp38-* cp39-* cp310-*" CIBW_ARCHS_LINUX: auto aarch64 CIBW_PRERELEASE_PYTHONS: True CIBW_BEFORE_ALL_LINUX: yum install -y libffi-devel - uses: actions/upload-artifact@v2 with: path: ./wheelhouse/*.whl build_sdist: name: Build source distribution runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 with: submodules: true - uses: actions/setup-python@v2 name: Install Python with: python-version: '3.8' - name: Build sdist run: python setup.py sdist - uses: actions/upload-artifact@v2 with: path: dist/*.tar.gz upload_pypi: needs: [build_wheels, build_sdist] runs-on: ubuntu-latest # upload to PyPI when a GitHub Release is created if: github.event_name == 'release' && github.event.action == 'published' steps: - uses: actions/download-artifact@v2 with: name: artifact path: dist - uses: pypa/gh-action-pypi-publish@master with: user: __token__ password: ${{ secrets.pypi_password }} pycares-pycares-4.1.2/.github/workflows/test.yml000066400000000000000000000013251413330527400217320ustar00rootroot00000000000000name: Test on: [pull_request] jobs: build: name: Test on ${{ matrix.os }} / Python ${{ matrix.python-version }} runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: os: [ubuntu-20.04, windows-2019, macos-10.15] python-version: [ '3.6', '3.7', '3.8', '3.9', '3.10'] steps: - uses: actions/checkout@v2 with: submodules: true - name: Setup Python uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} - name: Install dependencies run: python -m pip install -U setuptools wheel - name: Build package run: python setup.py install - name: Run tests run: python tests/tests.py pycares-pycares-4.1.2/.gitignore000066400000000000000000000003151413330527400166210ustar00rootroot00000000000000#python specific *.pyc *.pyd *.so build/* dist/* MANIFEST __pycache__/ *.eggs/ *.egg-info/ ## generic files to ignore *~ *.lock *.DS_Store *.swp *.out *.o *.a .tox/ docs/_build/ .venv/ venv/ wheelhouse/ pycares-pycares-4.1.2/.gitmodules000066400000000000000000000001321413330527400170030ustar00rootroot00000000000000[submodule "deps/c-ares"] path = deps/c-ares url = https://github.com/c-ares/c-ares.git pycares-pycares-4.1.2/ChangeLog000066400000000000000000000163771413330527400164220ustar00rootroot00000000000000Version 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 pycares-pycares-4.1.2/LICENSE000066400000000000000000000020561413330527400156420ustar00rootroot00000000000000Copyright (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. pycares-pycares-4.1.2/MANIFEST.in000066400000000000000000000004321413330527400163670ustar00rootroot00000000000000include 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 pycares-pycares-4.1.2/PYPIREADME.rst000066400000000000000000000057001413330527400170250ustar00rootroot00000000000000Looking 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 ---------------------- There are several ways of running the test suite: - Run the test with the current Python interpreter: From the toplevel directory, run: ``python tests/tests.py`` - Use Tox to run the test suite in several virtualenvs with several interpreters From the toplevel directory, run: ``tox -e py36,py37,py38,py39`` this will run the test suite on Python 3.6 through 3.9 (you'll need to have them installed beforehand) 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.6 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 :-) pycares-pycares-4.1.2/README.rst000066400000000000000000000062361413330527400163300ustar00rootroot00000000000000Looking 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 ---------------------- There are several ways of running the test suite: - Run the test with the current Python interpreter: From the toplevel directory, run: ``python tests/tests.py`` - Use Tox to run the test suite in several virtualenvs with several interpreters From the toplevel directory, run: ``tox -e py36,py37,py38,py39`` this will run the test suite on Python 3.6 through 3.9 (you'll need to have them installed beforehand) 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.6 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 :-) pycares-pycares-4.1.2/deps/000077500000000000000000000000001413330527400155655ustar00rootroot00000000000000pycares-pycares-4.1.2/deps/build-config/000077500000000000000000000000001413330527400201275ustar00rootroot00000000000000pycares-pycares-4.1.2/deps/build-config/config_android/000077500000000000000000000000001413330527400230745ustar00rootroot00000000000000pycares-pycares-4.1.2/deps/build-config/config_android/ares_config.h000066400000000000000000000345331413330527400255340ustar00rootroot00000000000000/* 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 */ pycares-pycares-4.1.2/deps/build-config/config_cygwin/000077500000000000000000000000001413330527400227545ustar00rootroot00000000000000pycares-pycares-4.1.2/deps/build-config/config_cygwin/ares_config.h000066400000000000000000000350221413330527400254060ustar00rootroot00000000000000/* 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 pycares-pycares-4.1.2/deps/build-config/config_darwin/000077500000000000000000000000001413330527400227405ustar00rootroot00000000000000pycares-pycares-4.1.2/deps/build-config/config_darwin/ares_config.h000066400000000000000000000344651413330527400254040ustar00rootroot00000000000000/* 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 */ pycares-pycares-4.1.2/deps/build-config/config_freebsd/000077500000000000000000000000001413330527400230665ustar00rootroot00000000000000pycares-pycares-4.1.2/deps/build-config/config_freebsd/ares_config.h000066400000000000000000000345401413330527400255240ustar00rootroot00000000000000/* 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 */ pycares-pycares-4.1.2/deps/build-config/config_linux/000077500000000000000000000000001413330527400226135ustar00rootroot00000000000000pycares-pycares-4.1.2/deps/build-config/config_linux/ares_config.h000066400000000000000000000344401413330527400252500ustar00rootroot00000000000000/* 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 */ pycares-pycares-4.1.2/deps/build-config/config_netbsd/000077500000000000000000000000001413330527400227335ustar00rootroot00000000000000pycares-pycares-4.1.2/deps/build-config/config_netbsd/ares_config.h000066400000000000000000000345301413330527400253700ustar00rootroot00000000000000/* 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 */ pycares-pycares-4.1.2/deps/build-config/config_openbsd/000077500000000000000000000000001413330527400231065ustar00rootroot00000000000000pycares-pycares-4.1.2/deps/build-config/config_openbsd/ares_config.h000066400000000000000000000345301413330527400255430ustar00rootroot00000000000000/* 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 */ pycares-pycares-4.1.2/deps/build-config/config_sunos/000077500000000000000000000000001413330527400226235ustar00rootroot00000000000000pycares-pycares-4.1.2/deps/build-config/config_sunos/ares_config.h000066400000000000000000000345001413330527400252550ustar00rootroot00000000000000/* 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 */ pycares-pycares-4.1.2/deps/build-config/include/000077500000000000000000000000001413330527400215525ustar00rootroot00000000000000pycares-pycares-4.1.2/deps/build-config/include/ares_build.h000066400000000000000000000153721413330527400240440ustar00rootroot00000000000000#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 */ pycares-pycares-4.1.2/deps/build-config/include/ares_nameser.h000066400000000000000000000321171413330527400243730ustar00rootroot00000000000000 #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 */ pycares-pycares-4.1.2/deps/c-ares/000077500000000000000000000000001413330527400167375ustar00rootroot00000000000000pycares-pycares-4.1.2/docs/000077500000000000000000000000001413330527400155625ustar00rootroot00000000000000pycares-pycares-4.1.2/docs/Makefile000066400000000000000000000127001413330527400172220ustar00rootroot00000000000000# Makefile for Sphinx documentation # # You can set these variables from the command line. SPHINXOPTS = SPHINXBUILD = sphinx-build PAPER = BUILDDIR = _build # Internal variables. PAPEROPT_a4 = -D latex_paper_size=a4 PAPEROPT_letter = -D latex_paper_size=letter ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . # the i18n builder cannot share the environment and doctrees with the others I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext help: @echo "Please use \`make ' where is one of" @echo " html to make standalone HTML files" @echo " dirhtml to make HTML files named index.html in directories" @echo " singlehtml to make a single large HTML file" @echo " pickle to make pickle files" @echo " json to make JSON files" @echo " htmlhelp to make HTML files and a HTML help project" @echo " qthelp to make HTML files and a qthelp project" @echo " devhelp to make HTML files and a Devhelp project" @echo " epub to make an epub" @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" @echo " latexpdf to make LaTeX files and run them through pdflatex" @echo " text to make text files" @echo " man to make manual pages" @echo " texinfo to make Texinfo files" @echo " info to make Texinfo files and run them through makeinfo" @echo " gettext to make PO message catalogs" @echo " changes to make an overview of all changed/added/deprecated items" @echo " linkcheck to check all external links for integrity" @echo " doctest to run all doctests embedded in the documentation (if enabled)" clean: -rm -rf $(BUILDDIR)/* html: $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." dirhtml: $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." singlehtml: $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml @echo @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." pickle: $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle @echo @echo "Build finished; now you can process the pickle files." json: $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json @echo @echo "Build finished; now you can process the JSON files." htmlhelp: $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp @echo @echo "Build finished; now you can run HTML Help Workshop with the" \ ".hhp project file in $(BUILDDIR)/htmlhelp." qthelp: $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp @echo @echo "Build finished; now you can run "qcollectiongenerator" with the" \ ".qhcp project file in $(BUILDDIR)/qthelp, like this:" @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/pycares.qhcp" @echo "To view the help file:" @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/pycares.qhc" devhelp: $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp @echo @echo "Build finished." @echo "To view the help file:" @echo "# mkdir -p $$HOME/.local/share/devhelp/pycares" @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/pycares" @echo "# devhelp" epub: $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub @echo @echo "Build finished. The epub file is in $(BUILDDIR)/epub." latex: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." @echo "Run \`make' in that directory to run these through (pdf)latex" \ "(use \`make latexpdf' here to do that automatically)." latexpdf: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo "Running LaTeX files through pdflatex..." $(MAKE) -C $(BUILDDIR)/latex all-pdf @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." text: $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text @echo @echo "Build finished. The text files are in $(BUILDDIR)/text." man: $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man @echo @echo "Build finished. The manual pages are in $(BUILDDIR)/man." texinfo: $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo @echo @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." @echo "Run \`make' in that directory to run these through makeinfo" \ "(use \`make info' here to do that automatically)." info: $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo @echo "Running Texinfo files through makeinfo..." make -C $(BUILDDIR)/texinfo info @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." gettext: $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale @echo @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." changes: $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes @echo @echo "The overview file is in $(BUILDDIR)/changes." linkcheck: $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck @echo @echo "Link check complete; look for any errors in the above output " \ "or in $(BUILDDIR)/linkcheck/output.txt." doctest: $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest @echo "Testing of doctests in the sources finished, look at the " \ "results in $(BUILDDIR)/doctest/output.txt." pycares-pycares-4.1.2/docs/channel.rst000066400000000000000000000214711413330527400177310ustar00rootroot00000000000000.. _channel: .. currentmodule:: pycares ==================================== :py:class:`Channel` - Ares Channel ==================================== .. py:class:: Channel([flags, timeout, tries, ndots, tcp_port, udp_port, servers, domains, lookups, sock_state_cb, socket_send_buffer_size, socket_receive_buffer_size, rotate, local_ip, local_dev, resolvconf_path]) :param int flags: Flags controlling the behavior of the resolver. See ``constants`` for available values. :param float timeout: The number of seconds each name server is given to respond to a query on the first try. The default is five seconds. :param int tries: The number of tries the resolver will try contacting each name server before giving up. The default is four tries. :param int ndots: 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. :param int tcp_port: The (TCP) port to use for queries. The default is 53. :param int udp_port: The (UDP) port to use for queries. The default is 53. :param list servers: List of nameservers to be used to do the lookups. :param list domains: The domains to search, instead of the domains specified in resolv.conf or the domain derived from the kernel hostname variable. :param str lookup: The lookups to perform for host queries. 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. :param callable sock_state_cb: A callback function to be invoked when a socket changes state. Callback signature: ``sock_state_cb(self, fd, readable, writable)`` :param int socket_send_buffer_size: Size for the created socket's send buffer. :param int socket_receive_buffer_size: Size for the created socket's receive buffer. :param bool rotate: If set to True, the nameservers are rotated when doing queries. :param str local_ip: Sets the local IP address for DNS operations. :param str local_dev: Sets the local network adapter to use for DNS operations. Linux only. :param str resolvconf_path: Path to resolv.conf, defaults to /etc/resolv.conf. Unix only. The c-ares ``Channel`` provides asynchronous DNS operations. .. py:method:: getaddrinfo(host, port, callback, family=0, type=0, proto=0, flags=0) :param string host: Hostname to resolve. :param string port: Service to resolve. Can be a string, int or None. :param callable callback: Callback to be called with the result of the query. The ``family``, ``type`` and ``proto`` arguments can be optionally specified in order to narrow the list of addresses returned. Passing zero as a value for each of these arguments selects the full range of results. The ``flags`` argument can be one or several of the ``AI_*`` constants, and will influence how results are computed and returned. For example, ``AI_NUMERICHOST`` will disable domain name resolution. Translate the host/port argument into a sequence of 5-tuples that contain all the necessary arguments for creating a socket connected to that service. Callback signature: ``callback(result, errorno)`` .. py:method:: gethostbyname(name, family, callback) :param string name: Name to query. :param int family: Socket family. :param callable callback: Callback to be called with the result of the query. Retrieves host information corresponding to a host name from a host database. Callback signature: ``callback(result, errorno)`` .. py:method:: gethostbyaddr(name, callback) :param string name: Name to query. :param callable callback: Callback to be called with the result of the query. Retrieves the host information corresponding to a network address. Callback signature: ``callback(result, errorno)`` .. py:method:: getnameinfo(address, flags, callback) :param tuple address: address tuple to get info about. :param int flags: Query flags, see the NI flags section. :param callable callback: Callback to be called with the result of the query. Provides protocol-independent name resolution from an address to a host name and from a port number to the service name. ``address`` must be a 2-item tuple for IPv4 or a 4-item tuple for IPv6. Format of fields is the same as one returned by `getaddrinfo()`. Callback signature: ``callback(result, errorno)`` .. py:method:: query(name, query_type, callback) :param string name: Name to query. :param int query_type: Type of query to perform. :param callable callback: Callback to be called with the result of the query. Do a DNS query of the specified type. Available types: - ``QUERY_TYPE_A`` - ``QUERY_TYPE_AAAA`` - ``QUERY_TYPE_ANY`` - ``QUERY_TYPE_CAA`` - ``QUERY_TYPE_CNAME`` - ``QUERY_TYPE_MX`` - ``QUERY_TYPE_NAPTR`` - ``QUERY_TYPE_NS`` - ``QUERY_TYPE_PTR`` - ``QUERY_TYPE_SOA`` - ``QUERY_TYPE_SRV`` - ``QUERY_TYPE_TXT`` Callback signature: ``callback(result, errorno)``. The result type varies depending on the query type: - A: (list of) ``ares_query_a_result``, fields: - host - ttl - AAAA: (list of) ``ares_query_aaaa_result``, fields: - host - ttl - CAA: (list of) ``ares_query_caa_result``, fields: - critical - property - value - ttl - CNAME: ``ares_query_cname_result``, fields: - cname - ttl - MX: (list of) ``ares_query_mx_result``, fields: - host - priority - ttl - NAPTR: (list of) ``ares_query_naptr_result``, fields: - order - preference - flags - service - regex - replacement - ttl - NS: (list of) ``ares_query_ns_result``, fields: - host - ttl - PTR: (list of) ``ares_query_ptr_result``, fields: - name - ttl - SOA: ``ares_query_soa_result``, fields: - nsname - hostmaster - serial - refresh - retry - expires - minttl - ttl - SRV: (list of) ``ares_query_srv_result``, fields: - host - port - priority - weight - ttl - TXT: (list of) ``ares_query_txt_result``, fields: - text - ttl - ANY: a list of any of the above. .. note:: TTL is not implemented for CNAME and NS), so it's set to -1. .. py:method:: search(name, query_type, callback) :param string name: Name to query. :param int query_type: Type of query to perform. :param callable callback: Callback to be called with the result of the query. Tis function does the same as :py:meth:`query` but it will honor the ``domain`` and ``search`` directives in ``resolv.conf``. .. py:method:: cancel() Cancel any pending query on this channel. All pending callbacks will be called with ARES_ECANCELLED errorno. .. py:method:: process_fd(read_fd, write_fd) :param int read_fd: File descriptor ready to read from. :param int write_fd: File descriptor ready to write to. Process the given file descriptors for read and/or write events. .. py:method:: getsock() Return a tuple containing 2 lists with the file descriptors ready to read and write. .. py:method:: timeout([max_timeout]) :param float max_timeout: Maximum timeout. Determines the maximum time for which the caller should wait before invoking ``process_fd`` to process timeouts. If the ``max_timeout`` parameter is specified, it is stored on the channel and the appropriate value is then returned. .. py:method:: set_local_ip(local_ip) :param str local_ip: IP address. Set the local IPv4 or IPv6 address from which the queries will be sent. .. py:method:: set_local_dev(local_dev) :param str local_dev: Network device name. Set the local ethernet device from which the queries will be sent. .. py:attribute:: servers List of nameservers to use for DNS queries. pycares-pycares-4.1.2/docs/conf.py000066400000000000000000000174631413330527400170740ustar00rootroot00000000000000# -*- coding: utf-8 -*- # # pycares documentation build configuration file, created by # sphinx-quickstart on Sun Jul 8 23:23:25 2012. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that are commented out # serve to show the default. import re def get_version(): return re.search(r"""__version__\s+=\s+(?P['"])(?P.+?)(?P=quote)""", open('../src/pycares/_version.py').read()).group('version') _version = get_version() # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. #sys.path.insert(0, os.path.abspath('.')) # -- General configuration ----------------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. #needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = ['sphinx.ext.viewcode'] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # The suffix of source filenames. source_suffix = '.rst' # The encoding of source files. #source_encoding = 'utf-8-sig' # The master toctree document. master_doc = 'index' # General information about the project. project = u'pycares' copyright = u'2012, Saúl Ibarra Corretgé' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. version = _version # The full version, including alpha/beta/rc tags. release = _version # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. #language = None # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: #today = '' # Else, today_fmt is used as the format for a strftime call. #today_fmt = '%B %d, %Y' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. exclude_patterns = ['_build'] # The reST default role (used for this markup: `text`) to use for all documents. #default_role = None # If true, '()' will be appended to :func: etc. cross-reference text. #add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). #add_module_names = True # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. #show_authors = False # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' # A list of ignored prefixes for module index sorting. #modindex_common_prefix = [] # -- Options for HTML output --------------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. html_theme = 'sphinx_rtd_theme' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. #html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. #html_theme_path = [] # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". #html_title = None # A shorter title for the navigation bar. Default is the same as html_title. #html_short_title = None # The name of an image file (relative to this directory) to place at the top # of the sidebar. #html_logo = None # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. #html_favicon = None # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. #html_last_updated_fmt = '%b %d, %Y' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. #html_use_smartypants = True # Custom sidebar templates, maps document names to template names. #html_sidebars = {} # Additional templates that should be rendered to pages, maps page names to # template names. #html_additional_pages = {} # If false, no module index is generated. #html_domain_indices = True # If false, no index is generated. #html_use_index = True # If true, the index is split into individual pages for each letter. #html_split_index = False # If true, links to the reST sources are added to the pages. #html_show_sourcelink = True # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. #html_show_sphinx = True # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. #html_show_copyright = True # If true, an OpenSearch description file will be output, and all pages will # contain a tag referring to it. The value of this option must be the # base URL from which the finished HTML is served. #html_use_opensearch = '' # This is the file name suffix for HTML files (e.g. ".xhtml"). #html_file_suffix = None # Output file base name for HTML help builder. htmlhelp_basename = 'pycaresdoc' # -- Options for LaTeX output -------------------------------------------------- latex_elements = { # The paper size ('letterpaper' or 'a4paper'). #'papersize': 'letterpaper', # The font size ('10pt', '11pt' or '12pt'). #'pointsize': '10pt', # Additional stuff for the LaTeX preamble. #'preamble': '', } # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass [howto/manual]). latex_documents = [ ('index', 'pycares.tex', u'pycares Documentation', u'Saúl Ibarra Corretgé', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of # the title page. #latex_logo = None # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. #latex_use_parts = False # If true, show page references after internal links. #latex_show_pagerefs = False # If true, show URL addresses after external links. #latex_show_urls = False # Documents to append as an appendix to all manuals. #latex_appendices = [] # If false, no module index is generated. #latex_domain_indices = True # -- Options for manual page output -------------------------------------------- # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ ('index', 'pycares', u'pycares Documentation', [u'Saúl Ibarra Corretgé'], 1) ] # If true, show URL addresses after external links. #man_show_urls = False # -- Options for Texinfo output ------------------------------------------------ # Grouping the document tree into Texinfo files. List of tuples # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ ('index', 'pycares', u'pycares Documentation', u'Saúl Ibarra Corretgé', 'pycares', 'One line description of project.', 'Miscellaneous'), ] # Documents to append as an appendix to all manuals. #texinfo_appendices = [] # If false, no module index is generated. #texinfo_domain_indices = True # How to display URL addresses: 'footnote', 'no', or 'inline'. #texinfo_show_urls = 'footnote' pycares-pycares-4.1.2/docs/constants.rst000066400000000000000000000024511413330527400203320ustar00rootroot00000000000000.. _constants: ======================== c-ares library constants ======================== Channel flags ============= .. py:data:: pycares.ARES_FLAG_USEVC .. py:data:: pycares.ARES_FLAG_PRIMARY .. py:data:: pycares.ARES_FLAG_IGNTC .. py:data:: pycares.ARES_FLAG_NORECURSE .. py:data:: pycares.ARES_FLAG_STAYOPEN .. py:data:: pycares.ARES_FLAG_NOSEARCH .. py:data:: pycares.ARES_FLAG_NOALIASES .. py:data:: pycares.ARES_FLAG_NOCHECKRESP .. seealso:: `c-ares documentation for ares_init `_ Nameinfo constants ================== .. py:data:: pycares.ARES_NI_NOFQDN .. py:data:: pycares.ARES_NI_NUMERICHOST .. py:data:: pycares.ARES_NI_NAMEREQD .. py:data:: pycares.ARES_NI_NUMERICSERV .. py:data:: pycares.ARES_NI_DGRAM .. py:data:: pycares.ARES_NI_TCP .. py:data:: pycares.ARES_NI_UDP .. py:data:: pycares.ARES_NI_SCTP .. py:data:: pycares.ARES_NI_DCCP .. py:data:: pycares.ARES_NI_NUMERICSCOPE .. py:data:: pycares.ARES_NI_LOOKUPHOST .. py:data:: pycares.ARES_NI_LOOKUPSERVICE .. py:data:: pycares.ARES_NI_IDN .. py:data:: pycares.ARES_NI_IDN_ALLOW_UNASSIGNED .. py:data:: pycares.ARES_NI_IDN_USE_STD3_ASCII_RULES .. seealso:: `c-ares documentation for ares_getnameinfo `_ Others ====== .. py:data:: pycares.ARES_SOCKET_BAD pycares-pycares-4.1.2/docs/errno.rst000066400000000000000000000010161413330527400174370ustar00rootroot00000000000000.. _errno: .. currentmodule:: pycares ====================================================== :py:mod:`pycares.errno` --- Error constant definitions ====================================================== This module contains the defined error constants from c-ares. .. py:attribute:: pycares.errno.errorcode Mapping (code, string) with c-ares error codes. .. py:function:: pycares.errno.strerror(errorno) :param int errorno: Error number. Get the string representation of the given c-ares error number. pycares-pycares-4.1.2/docs/event_loops.rst000066400000000000000000000012701413330527400206510ustar00rootroot00000000000000.. _event_loops: ====================== Event loop integration ====================== pycares can be integrated in an already existing event loop without much trouble. The examples folder contains several examples: * cares-select.py: integration with plain select * cares-poll.py: integration with plain poll * cares-selectors.py: integration with the builtin selectors module * cares-resolver.py: integration with the pyuv event loop * cares-asyncio.py: integration with the asyncio framework Additionally, `Tornado `_ provides integration with pycaes through a `resolver module `_. pycares-pycares-4.1.2/docs/index.rst000066400000000000000000000010011413330527400174130ustar00rootroot00000000000000.. currentmodule:: pycares ################################# Welcome to pycares documentation! ################################# Python interface for c-ares. pycares is a Python module which provides an interface to c-ares. c-ares (https://c-ares.org) c-ares is a C library that performs DNS requests and name resolves asynchronously. Contents ######## .. toctree:: :maxdepth: 3 :titlesonly: pycares Indices and tables ################## * :ref:`genindex` * :ref:`modindex` * :ref:`search` pycares-pycares-4.1.2/docs/make.bat000066400000000000000000000117521413330527400171750ustar00rootroot00000000000000@ECHO OFF REM Command file for Sphinx documentation if "%SPHINXBUILD%" == "" ( set SPHINXBUILD=sphinx-build ) set BUILDDIR=_build set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% . set I18NSPHINXOPTS=%SPHINXOPTS% . if NOT "%PAPER%" == "" ( set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS% ) if "%1" == "" goto help if "%1" == "help" ( :help echo.Please use `make ^` where ^ is one of echo. html to make standalone HTML files echo. dirhtml to make HTML files named index.html in directories echo. singlehtml to make a single large HTML file echo. pickle to make pickle files echo. json to make JSON files echo. htmlhelp to make HTML files and a HTML help project echo. qthelp to make HTML files and a qthelp project echo. devhelp to make HTML files and a Devhelp project echo. epub to make an epub echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter echo. text to make text files echo. man to make manual pages echo. texinfo to make Texinfo files echo. gettext to make PO message catalogs echo. changes to make an overview over all changed/added/deprecated items echo. linkcheck to check all external links for integrity echo. doctest to run all doctests embedded in the documentation if enabled goto end ) if "%1" == "clean" ( for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i del /q /s %BUILDDIR%\* goto end ) if "%1" == "html" ( %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html if errorlevel 1 exit /b 1 echo. echo.Build finished. The HTML pages are in %BUILDDIR%/html. goto end ) if "%1" == "dirhtml" ( %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml if errorlevel 1 exit /b 1 echo. echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. goto end ) if "%1" == "singlehtml" ( %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml if errorlevel 1 exit /b 1 echo. echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. goto end ) if "%1" == "pickle" ( %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle if errorlevel 1 exit /b 1 echo. echo.Build finished; now you can process the pickle files. goto end ) if "%1" == "json" ( %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json if errorlevel 1 exit /b 1 echo. echo.Build finished; now you can process the JSON files. goto end ) if "%1" == "htmlhelp" ( %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp if errorlevel 1 exit /b 1 echo. echo.Build finished; now you can run HTML Help Workshop with the ^ .hhp project file in %BUILDDIR%/htmlhelp. goto end ) if "%1" == "qthelp" ( %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp if errorlevel 1 exit /b 1 echo. echo.Build finished; now you can run "qcollectiongenerator" with the ^ .qhcp project file in %BUILDDIR%/qthelp, like this: echo.^> qcollectiongenerator %BUILDDIR%\qthelp\pycares.qhcp echo.To view the help file: echo.^> assistant -collectionFile %BUILDDIR%\qthelp\pycares.ghc goto end ) if "%1" == "devhelp" ( %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp if errorlevel 1 exit /b 1 echo. echo.Build finished. goto end ) if "%1" == "epub" ( %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub if errorlevel 1 exit /b 1 echo. echo.Build finished. The epub file is in %BUILDDIR%/epub. goto end ) if "%1" == "latex" ( %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex if errorlevel 1 exit /b 1 echo. echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. goto end ) if "%1" == "text" ( %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text if errorlevel 1 exit /b 1 echo. echo.Build finished. The text files are in %BUILDDIR%/text. goto end ) if "%1" == "man" ( %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man if errorlevel 1 exit /b 1 echo. echo.Build finished. The manual pages are in %BUILDDIR%/man. goto end ) if "%1" == "texinfo" ( %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo if errorlevel 1 exit /b 1 echo. echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo. goto end ) if "%1" == "gettext" ( %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale if errorlevel 1 exit /b 1 echo. echo.Build finished. The message catalogs are in %BUILDDIR%/locale. goto end ) if "%1" == "changes" ( %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes if errorlevel 1 exit /b 1 echo. echo.The overview file is in %BUILDDIR%/changes. goto end ) if "%1" == "linkcheck" ( %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck if errorlevel 1 exit /b 1 echo. echo.Link check complete; look for any errors in the above output ^ or in %BUILDDIR%/linkcheck/output.txt. goto end ) if "%1" == "doctest" ( %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest if errorlevel 1 exit /b 1 echo. echo.Testing of doctests in the sources finished, look at the ^ results in %BUILDDIR%/doctest/output.txt. goto end ) :end pycares-pycares-4.1.2/docs/pycares.rst000066400000000000000000000007151413330527400177650ustar00rootroot00000000000000.. _pycares: ************************************************* :py:mod:`pycares` --- Python interface to c-ares. ************************************************* .. py:module:: pycares :platform: POSIX, Windows :synopsis: Python interface to c-ares. .. seealso:: `c-ares source code `_. Objects ******* .. toctree:: :maxdepth: 2 :titlesonly: channel constants errno event_loops pycares-pycares-4.1.2/examples/000077500000000000000000000000001413330527400164505ustar00rootroot00000000000000pycares-pycares-4.1.2/examples/cares-asyncio.py000066400000000000000000000041061413330527400215630ustar00rootroot00000000000000 import asyncio import socket import pycares class DNSResolver(object): EVENT_READ = 0 EVENT_WRITE = 1 def __init__(self, loop=None): self._channel = pycares.Channel(sock_state_cb=self._sock_state_cb) self._timer = None self._fds = set() self.loop = loop or asyncio.get_event_loop() def _sock_state_cb(self, fd, readable, writable): if readable or writable: if readable: self.loop.add_reader(fd, self._process_events, fd, self.EVENT_READ) if writable: self.loop.add_writer(fd, self._process_events, fd, self.EVENT_WRITE) self._fds.add(fd) if self._timer is None: self._timer = self.loop.call_later(1.0, self._timer_cb) else: # socket is now closed self._fds.discard(fd) if not self._fds: self._timer.cancel() self._timer = None def _timer_cb(self): self._channel.process_fd(pycares.ARES_SOCKET_BAD, pycares.ARES_SOCKET_BAD) self._timer = self.loop.call_later(1.0, self._timer_cb) def _process_events(self, fd, event): if event == self.EVENT_READ: read_fd = fd write_fd = pycares.ARES_SOCKET_BAD elif event == self.EVENT_WRITE: read_fd = pycares.ARES_SOCKET_BAD write_fd = fd else: read_fd = write_fd = pycares.ARES_SOCKET_BAD self._channel.process_fd(read_fd, write_fd) def query(self, query_type, name, cb): self._channel.query(query_type, name, cb) def gethostbyname(self, name, cb): self._channel.gethostbyname(name, socket.AF_INET, cb) def main(): def cb(result, error): print("Result: {}, Error: {}".format(result, error)) loop = asyncio.get_event_loop() resolver = DNSResolver(loop) resolver.query('google.com', pycares.QUERY_TYPE_A, cb) resolver.query('sip2sip.info', pycares.QUERY_TYPE_SOA, cb) resolver.gethostbyname('apple.com', cb) loop.run_forever() if __name__ == '__main__': main() pycares-pycares-4.1.2/examples/cares-poll.py000066400000000000000000000043701413330527400210670ustar00rootroot00000000000000 import pycares import select import socket class DNSResolver(object): def __init__(self): self._channel = pycares.Channel(sock_state_cb=self._sock_state_cb) self.poll = select.epoll() if hasattr(select, "epoll") else select.poll() self._fd_map = set() def _sock_state_cb(self, fd, readable, writable): print("fd {} read {} write {}".format(fd, readable, writable)) if readable or writable: event = (select.POLLIN if readable else 0) | (select.POLLOUT if writable else 0) if fd not in self._fd_map: # New socket print("register %d" % fd) self.poll.register(fd, event) self._fd_map.add(fd) else: print("modify %d" % fd) self.poll.modify(fd, event) else: # Socket is now closed self._fd_map.remove(fd) print("unregister %d" % fd) self.poll.unregister(fd) def wait_channel(self): while True: if not self._fd_map: break timeout = self._channel.timeout(1.0) if not timeout: self._channel.process_fd(pycares.ARES_SOCKET_BAD, pycares.ARES_SOCKET_BAD) continue for fd, event in self.poll.poll(timeout): if event & (select.POLLIN | select.POLLPRI): self._channel.process_fd(fd, pycares.ARES_SOCKET_BAD) if event & select.POLLOUT: self._channel.process_fd(pycares.ARES_SOCKET_BAD, fd) def query(self, query_type, name, cb): self._channel.query(query_type, name, cb) def gethostbyname(self, name, cb): self._channel.gethostbyname(name, socket.AF_INET, cb) if __name__ == '__main__': def query_cb(result, error): print(result) print(error) def gethostbyname_cb(result, error): print(result) print(error) resolver = DNSResolver() resolver.query('google.com', pycares.QUERY_TYPE_A, query_cb) resolver.query('facebook.com', pycares.QUERY_TYPE_A, query_cb) resolver.query('sip2sip.info', pycares.QUERY_TYPE_SOA, query_cb) resolver.gethostbyname('apple.com', gethostbyname_cb) resolver.wait_channel() pycares-pycares-4.1.2/examples/cares-resolver.py000066400000000000000000000043651413330527400217660ustar00rootroot00000000000000 import pycares import pyuv import socket class DNSResolver(object): def __init__(self, loop): self._channel = pycares.Channel(sock_state_cb=self._sock_state_cb) self.loop = loop self._timer = pyuv.Timer(self.loop) self._fd_map = {} def _sock_state_cb(self, fd, readable, writable): if readable or writable: if fd not in self._fd_map: # New socket handle = pyuv.Poll(self.loop, fd) handle.fd = fd self._fd_map[fd] = handle else: handle = self._fd_map[fd] if not self._timer.active: self._timer.start(self._timer_cb, 1.0, 1.0) handle.start((pyuv.UV_READABLE if readable else 0) | (pyuv.UV_WRITABLE if writable else 0), self._poll_cb) else: # Socket is now closed handle = self._fd_map.pop(fd) handle.close() if not self._fd_map: self._timer.stop() def _timer_cb(self, timer): self._channel.process_fd(pycares.ARES_SOCKET_BAD, pycares.ARES_SOCKET_BAD) def _poll_cb(self, handle, events, error): read_fd = handle.fd write_fd = handle.fd if error is not None: # There was an error, pretend the socket is ready self._channel.process_fd(read_fd, write_fd) return if not events & pyuv.UV_READABLE: read_fd = pycares.ARES_SOCKET_BAD if not events & pyuv.UV_WRITABLE: write_fd = pycares.ARES_SOCKET_BAD self._channel.process_fd(read_fd, write_fd) def query(self, query_type, name, cb): self._channel.query(query_type, name, cb) def gethostbyname(self, name, cb): self._channel.gethostbyname(name, socket.AF_INET, cb) if __name__ == '__main__': def query_cb(result, error): print(result) print(error) def gethostbyname_cb(result, error): print(result) print(error) loop = pyuv.Loop.default_loop() resolver = DNSResolver(loop) resolver.query('google.com', pycares.QUERY_TYPE_A, query_cb) resolver.query('sip2sip.info', pycares.QUERY_TYPE_SOA, query_cb) resolver.gethostbyname('apple.com', gethostbyname_cb) loop.run() pycares-pycares-4.1.2/examples/cares-select.py000066400000000000000000000017051413330527400213770ustar00rootroot00000000000000 import pycares import select import socket def wait_channel(channel): while True: read_fds, write_fds = channel.getsock() if not read_fds and not write_fds: break timeout = channel.timeout() if not timeout: channel.process_fd(pycares.ARES_SOCKET_BAD, pycares.ARES_SOCKET_BAD) continue rlist, wlist, xlist = select.select(read_fds, write_fds, [], timeout) for fd in rlist: channel.process_fd(fd, pycares.ARES_SOCKET_BAD) for fd in wlist: channel.process_fd(pycares.ARES_SOCKET_BAD, fd) if __name__ == '__main__': def cb(result, error): print(result) print(error) channel = pycares.Channel() channel.gethostbyname('google.com', socket.AF_INET, cb) channel.query('google.com', pycares.QUERY_TYPE_A, cb) channel.query('sip2sip.info', pycares.QUERY_TYPE_SOA, cb) wait_channel(channel) print('Done!') pycares-pycares-4.1.2/examples/cares-selectors.py000066400000000000000000000044551413330527400221300ustar00rootroot00000000000000 import pycares import selectors import socket class DNSResolver(object): def __init__(self): self._channel = pycares.Channel(sock_state_cb=self._sock_state_cb) self.poll = selectors.DefaultSelector() self._fd_map = set() def _sock_state_cb(self, fd, readable, writable): print("fd {} read {} write {}".format(fd, readable, writable)) if readable or writable: event = (selectors.EVENT_READ if readable else 0) | (selectors.EVENT_WRITE if writable else 0) if fd not in self._fd_map: # New socket print("register %d" % fd) self.poll.register(fd, event) self._fd_map.add(fd) else: print("modify %d" % fd) self.poll.modify(fd, event) else: # Socket is now closed self._fd_map.remove(fd) print("unregister %d" % fd) self.poll.unregister(fd) def wait_channel(self): while True: if not self._fd_map: break timeout = self._channel.timeout(1.0) if not timeout: self._channel.process_fd(pycares.ARES_SOCKET_BAD, pycares.ARES_SOCKET_BAD) continue for key, event in self.poll.select(timeout): read_fd = key.fd if event & selectors.EVENT_READ else pycares.ARES_SOCKET_BAD write_fd = key.fd if event & selectors.EVENT_WRITE else pycares.ARES_SOCKET_BAD self._channel.process_fd(read_fd, write_fd) def query(self, query_type, name, cb): self._channel.query(query_type, name, cb) def gethostbyname(self, name, cb): self._channel.gethostbyname(name, socket.AF_INET, cb) if __name__ == '__main__': def query_cb(result, error): print(result) print(error) def gethostbyname_cb(result, error): print(result) print(error) resolver = DNSResolver() resolver.query('google.com', pycares.QUERY_TYPE_A, query_cb) resolver.query('google.com', pycares.QUERY_TYPE_AAAA, query_cb) resolver.query('facebook.com', pycares.QUERY_TYPE_A, query_cb) resolver.query('sip2sip.info', pycares.QUERY_TYPE_SOA, query_cb) resolver.gethostbyname('apple.com', gethostbyname_cb) resolver.wait_channel() pycares-pycares-4.1.2/setup.py000077500000000000000000000037121413330527400163520ustar00rootroot00000000000000#!/usr/bin/env python # -*- coding: utf-8 -*- import codecs import re from setuptools import setup from setup_cares import cares_build_ext def get_version(): return re.search(r"""__version__\s+=\s+(?P['"])(?P.+?)(?P=quote)""", open('src/pycares/_version.py').read()).group('version') setup(name = 'pycares', version = get_version(), author = 'Saúl Ibarra Corretgé', author_email = 's@saghul.net', license = 'MIT', url = 'http://github.com/saghul/pycares', description = 'Python interface for c-ares', long_description = codecs.open('PYPIREADME.rst', encoding='utf-8').read(), long_description_content_type = 'text/x-rst', platforms = ['POSIX', 'Microsoft Windows'], classifiers = [ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: POSIX', 'Operating System :: Microsoft :: Windows', 'Programming Language :: Python', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: Implementation :: CPython', 'Programming Language :: Python :: Implementation :: PyPy', ], cmdclass = {'build_ext': cares_build_ext}, setup_requires = ['cffi>=1.5.0'], install_requires = ['cffi>=1.5.0'], extras_require = {'idna': ['idna >= 2.1']}, cffi_modules = ['src/_cffi_src/build_cares.py:ffi'], package_dir = {'': 'src'}, packages = ['pycares'], ext_package = 'pycares', zip_safe = False ) pycares-pycares-4.1.2/setup_cares.py000066400000000000000000000133231413330527400175230ustar00rootroot00000000000000 import os import sys from distutils.command.build_ext import build_ext use_system_lib = bool(int(os.environ.get('PYCARES_USE_SYSTEM_LIB', 0))) cares_sources = [ 'deps/c-ares/src/lib/ares__close_sockets.c', 'deps/c-ares/src/lib/ares__get_hostent.c', 'deps/c-ares/src/lib/ares__parse_into_addrinfo.c', 'deps/c-ares/src/lib/ares__read_line.c', 'deps/c-ares/src/lib/ares__readaddrinfo.c', 'deps/c-ares/src/lib/ares__sortaddrinfo.c', 'deps/c-ares/src/lib/ares__timeval.c', 'deps/c-ares/src/lib/ares_android.c', 'deps/c-ares/src/lib/ares_cancel.c', 'deps/c-ares/src/lib/ares_create_query.c', 'deps/c-ares/src/lib/ares_data.c', 'deps/c-ares/src/lib/ares_destroy.c', 'deps/c-ares/src/lib/ares_expand_name.c', 'deps/c-ares/src/lib/ares_expand_string.c', 'deps/c-ares/src/lib/ares_fds.c', 'deps/c-ares/src/lib/ares_free_hostent.c', 'deps/c-ares/src/lib/ares_free_string.c', 'deps/c-ares/src/lib/ares_freeaddrinfo.c', 'deps/c-ares/src/lib/ares_getaddrinfo.c', 'deps/c-ares/src/lib/ares_getenv.c', 'deps/c-ares/src/lib/ares_gethostbyaddr.c', 'deps/c-ares/src/lib/ares_gethostbyname.c', 'deps/c-ares/src/lib/ares_getnameinfo.c', 'deps/c-ares/src/lib/ares_getsock.c', 'deps/c-ares/src/lib/ares_init.c', 'deps/c-ares/src/lib/ares_library_init.c', 'deps/c-ares/src/lib/ares_llist.c', 'deps/c-ares/src/lib/ares_mkquery.c', 'deps/c-ares/src/lib/ares_nowarn.c', 'deps/c-ares/src/lib/ares_options.c', 'deps/c-ares/src/lib/ares_parse_a_reply.c', 'deps/c-ares/src/lib/ares_parse_aaaa_reply.c', 'deps/c-ares/src/lib/ares_parse_caa_reply.c', 'deps/c-ares/src/lib/ares_parse_mx_reply.c', 'deps/c-ares/src/lib/ares_parse_naptr_reply.c', 'deps/c-ares/src/lib/ares_parse_ns_reply.c', 'deps/c-ares/src/lib/ares_parse_ptr_reply.c', 'deps/c-ares/src/lib/ares_parse_soa_reply.c', 'deps/c-ares/src/lib/ares_parse_srv_reply.c', 'deps/c-ares/src/lib/ares_parse_txt_reply.c', 'deps/c-ares/src/lib/ares_process.c', 'deps/c-ares/src/lib/ares_query.c', 'deps/c-ares/src/lib/ares_search.c', 'deps/c-ares/src/lib/ares_send.c', 'deps/c-ares/src/lib/ares_strcasecmp.c', 'deps/c-ares/src/lib/ares_strdup.c', 'deps/c-ares/src/lib/ares_strerror.c', 'deps/c-ares/src/lib/ares_strsplit.c', 'deps/c-ares/src/lib/ares_timeout.c', 'deps/c-ares/src/lib/ares_version.c', 'deps/c-ares/src/lib/ares_writev.c', 'deps/c-ares/src/lib/bitncmp.c', 'deps/c-ares/src/lib/inet_net_pton.c', 'deps/c-ares/src/lib/inet_ntop.c', ] if sys.platform == 'win32': cares_sources += ['deps/c-ares/src/lib/windows_port.c', 'deps/c-ares/src/lib/ares_platform.c'] class cares_build_ext(build_ext): cares_dir = os.path.join('deps', 'c-ares') build_config_dir = os.path.join('deps', 'build-config') def add_include_dir(self, dir, force=False): if use_system_lib and not force: return dirs = self.compiler.include_dirs dirs.insert(0, dir) self.compiler.set_include_dirs(dirs) def build_extensions(self): self.add_include_dir(os.path.join(self.cares_dir, 'include')) self.add_include_dir(os.path.join(self.build_config_dir, 'include'), True) if sys.platform != 'win32': self.compiler.define_macro('HAVE_CONFIG_H', 1) self.compiler.define_macro('_LARGEFILE_SOURCE', 1) self.compiler.define_macro('_FILE_OFFSET_BITS', 64) if sys.platform.startswith('linux'): # Check if it's actually Android if os.environ.get('ANDROID_ROOT') and os.environ.get('ANDROID_DATA'): self.add_include_dir(os.path.join(self.build_config_dir, 'config_android')) else: self.add_include_dir(os.path.join(self.build_config_dir, 'config_linux')) self.compiler.add_library('dl') self.compiler.add_library('rt') elif sys.platform == 'darwin': self.add_include_dir(os.path.join(self.build_config_dir, 'config_darwin')) self.compiler.define_macro('_DARWIN_USE_64_BIT_INODE', 1) elif sys.platform.startswith('freebsd'): self.add_include_dir(os.path.join(self.build_config_dir, 'config_freebsd')) self.compiler.add_library('kvm') elif sys.platform.startswith('dragonfly'): self.add_include_dir(os.path.join(self.build_config_dir, 'config_freebsd')) elif sys.platform.startswith('netbsd'): self.add_include_dir(os.path.join(self.build_config_dir, 'config_netbsd')) elif sys.platform.startswith('openbsd'): self.add_include_dir(os.path.join(self.build_config_dir, 'config_openbsd')) elif sys.platform.startswith('sunos'): self.add_include_dir(os.path.join(self.build_config_dir, 'config_sunos')) self.compiler.add_library('socket') self.compiler.add_library('nsl') self.compiler.add_library('kstat') elif sys.platform == 'cygwin': self.add_include_dir(os.path.join(self.build_config_dir, 'config_cygwin')) elif sys.platform == 'win32': if 'mingw' not in self.compiler.compiler_type: self.extensions[0].extra_link_args = ['/NODEFAULTLIB:libcmt'] self.compiler.add_library('advapi32') self.compiler.add_library('iphlpapi') self.compiler.add_library('psapi') self.compiler.add_library('ws2_32') self.compiler.define_macro('CARES_PULL_WS2TCPIP_H', 1) if use_system_lib: self.compiler.add_library('cares') else: self.compiler.define_macro('CARES_STATICLIB', 1) self.extensions[0].sources += cares_sources build_ext.build_extensions(self) pycares-pycares-4.1.2/src/000077500000000000000000000000001413330527400154215ustar00rootroot00000000000000pycares-pycares-4.1.2/src/_cffi_src/000077500000000000000000000000001413330527400173365ustar00rootroot00000000000000pycares-pycares-4.1.2/src/_cffi_src/build_cares.py000066400000000000000000000441751413330527400221770ustar00rootroot00000000000000 import cffi import sys if sys.platform == 'win32': PLATFORM_TYPES = """ typedef long time_t; typedef long suseconds_t; typedef short h_addrtype_t; typedef short h_length_t; typedef short sa_family_t; typedef unsigned short in_port_t; """ else: PLATFORM_TYPES = """ typedef long... time_t; typedef long... suseconds_t; typedef int h_addrtype_t; typedef int h_length_t; typedef int... sa_family_t; typedef uint16_t in_port_t; """ TYPES = """ struct in_addr { uint32_t s_addr; }; struct in6_addr { uint8_t s6_addr[16]; ...; }; struct timeval { time_t tv_sec; suseconds_t tv_usec; }; struct hostent { char *h_name; char **h_aliases; h_addrtype_t h_addrtype; h_length_t h_length; char **h_addr_list; }; struct sockaddr { sa_family_t sa_family; ...; }; struct sockaddr_in { sa_family_t sin_family; in_port_t sin_port; struct in_addr sin_addr; ...; }; struct sockaddr_in6 { sa_family_t sin6_family; in_port_t sin6_port; uint32_t sin6_flowinfo; struct in6_addr sin6_addr; uint32_t sin6_scope_id; ...; }; #define INET_ADDRSTRLEN ... #define INET6_ADDRSTRLEN ... #define C_IN ... #define C_CHAOS ... #define C_HS ... #define C_NONE ... #define C_ANY ... #define T_A ... #define T_AAAA ... #define T_ANY ... #define T_CAA ... #define T_CNAME ... #define T_MX ... #define T_NAPTR ... #define T_NS ... #define T_PTR ... #define T_SOA ... #define T_SRV ... #define T_TXT ... typedef int... ares_socket_t; typedef int... ares_socklen_t; #define ARES_SUCCESS ... #define ARES_ENODATA ... #define ARES_EFORMERR ... #define ARES_ESERVFAIL ... #define ARES_ENOTFOUND ... #define ARES_ENOTIMP ... #define ARES_EREFUSED ... #define ARES_EBADQUERY ... #define ARES_EBADNAME ... #define ARES_EBADFAMILY ... #define ARES_EBADRESP ... #define ARES_ECONNREFUSED ... #define ARES_ETIMEOUT ... #define ARES_EOF ... #define ARES_EFILE ... #define ARES_ENOMEM ... #define ARES_EDESTRUCTION ... #define ARES_EBADSTR ... #define ARES_EBADFLAGS ... #define ARES_ENONAME ... #define ARES_EBADHINTS ... #define ARES_ENOTINITIALIZED ... #define ARES_ELOADIPHLPAPI ... #define ARES_EADDRGETNETWORKPARAMS ... #define ARES_ECANCELLED ... #define ARES_ESERVICE ... #define ARES_FLAG_USEVC ... #define ARES_FLAG_PRIMARY ... #define ARES_FLAG_IGNTC ... #define ARES_FLAG_NORECURSE ... #define ARES_FLAG_STAYOPEN ... #define ARES_FLAG_NOSEARCH ... #define ARES_FLAG_NOALIASES ... #define ARES_FLAG_NOCHECKRESP ... #define ARES_FLAG_EDNS ... #define ARES_OPT_FLAGS ... #define ARES_OPT_TIMEOUT ... #define ARES_OPT_TRIES ... #define ARES_OPT_NDOTS ... #define ARES_OPT_UDP_PORT ... #define ARES_OPT_TCP_PORT ... #define ARES_OPT_SERVERS ... #define ARES_OPT_DOMAINS ... #define ARES_OPT_LOOKUPS ... #define ARES_OPT_SOCK_STATE_CB ... #define ARES_OPT_SORTLIST ... #define ARES_OPT_SOCK_SNDBUF ... #define ARES_OPT_SOCK_RCVBUF ... #define ARES_OPT_TIMEOUTMS ... #define ARES_OPT_ROTATE ... #define ARES_OPT_EDNSPSZ ... #define ARES_OPT_RESOLVCONF ... #define ARES_NI_NOFQDN ... #define ARES_NI_NUMERICHOST ... #define ARES_NI_NAMEREQD ... #define ARES_NI_NUMERICSERV ... #define ARES_NI_DGRAM ... #define ARES_NI_TCP ... #define ARES_NI_UDP ... #define ARES_NI_SCTP ... #define ARES_NI_DCCP ... #define ARES_NI_NUMERICSCOPE ... #define ARES_NI_LOOKUPHOST ... #define ARES_NI_LOOKUPSERVICE ... #define ARES_NI_IDN ... #define ARES_NI_IDN_ALLOW_UNASSIGNED ... #define ARES_NI_IDN_USE_STD3_ASCII_RULES ... #define ARES_AI_CANONNAME ... #define ARES_AI_NUMERICHOST ... #define ARES_AI_PASSIVE ... #define ARES_AI_NUMERICSERV ... #define ARES_AI_V4MAPPED ... #define ARES_AI_ALL ... #define ARES_AI_ADDRCONFIG ... #define ARES_AI_IDN ... #define ARES_AI_IDN_ALLOW_UNASSIGNED ... #define ARES_AI_IDN_USE_STD3_ASCII_RULES ... #define ARES_AI_CANONIDN ... #define ARES_AI_MASK ... #define ARES_GETSOCK_MAXNUM ... int ARES_GETSOCK_READABLE(int, int); int ARES_GETSOCK_WRITABLE(int, int); #define ARES_LIB_INIT_ALL ... #define ARES_SOCKET_BAD ... typedef void (*ares_sock_state_cb)(void *data, ares_socket_t socket_fd, int readable, int writable); 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 void (*ares_addrinfo_callback)(void *arg, int status, int timeouts, struct ares_addrinfo *res); struct ares_channeldata; typedef struct ares_channeldata *ares_channel; struct ares_options { int flags; int timeout; 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; char *resolvconf_path; ...; }; 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; unsigned char *value; size_t length; }; 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; }; struct ares_txt_ext { struct ares_txt_ext *next; unsigned char *txt; size_t length; 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; }; /* * 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; }; struct ares_addrinfo_hints { int ai_flags; int ai_family; int ai_socktype; int ai_protocol; }; struct ares_addr_node { struct ares_addr_node *next; int family; union { struct in_addr addr4; struct ares_in6_addr addr6; } addr; }; """ FUNCTIONS = """ int ares_library_init(int flags); void ares_library_cleanup(void); const char *ares_version(int *version); int ares_init(ares_channel *channelptr); int ares_init_options(ares_channel *channelptr, struct ares_options *options, int optmask); int ares_save_options(ares_channel channel, struct ares_options *options, int *optmask); void ares_destroy_options(struct ares_options *options); int ares_dup(ares_channel *dest, ares_channel src); void ares_destroy(ares_channel channel); void ares_cancel(ares_channel channel); void ares_set_local_ip4(ares_channel channel, unsigned int local_ip); void ares_set_local_ip6(ares_channel channel, const unsigned char* local_ip6); void ares_set_local_dev(ares_channel channel, const char* local_dev_name); void ares_set_socket_callback(ares_channel channel, ares_sock_create_callback callback, void *user_data); void ares_getaddrinfo(ares_channel channel, const char* node, const char* service, const struct ares_addrinfo_hints* hints, ares_addrinfo_callback callback, void* arg); void ares_freeaddrinfo(struct ares_addrinfo* ai); void ares_send(ares_channel channel, const unsigned char *qbuf, int qlen, ares_callback callback, void *arg); void ares_query(ares_channel channel, const char *name, int dnsclass, int type, ares_callback callback, void *arg); void ares_search(ares_channel channel, const char *name, int dnsclass, int type, ares_callback callback, void *arg); void ares_gethostbyname(ares_channel channel, const char *name, int family, ares_host_callback callback, void *arg); int ares_gethostbyname_file(ares_channel channel, const char *name, int family, struct hostent **host); void ares_gethostbyaddr(ares_channel channel, const void *addr, int addrlen, int family, ares_host_callback callback, void *arg); void ares_getnameinfo(ares_channel channel, const struct sockaddr *sa, ares_socklen_t salen, int flags, ares_nameinfo_callback callback, void *arg); int ares_getsock(ares_channel channel, ares_socket_t *socks, int numsocks); struct timeval *ares_timeout(ares_channel channel, struct timeval *maxtv, struct timeval *tv); void ares_process_fd(ares_channel channel, ares_socket_t read_fd, ares_socket_t write_fd); 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); int ares_mkquery(const char *name, int dnsclass, int type, unsigned short id, int rd, unsigned char **buf, int *buflen); int ares_expand_name(const unsigned char *encoded, const unsigned char *abuf, int alen, char **s, long *enclen); int ares_expand_string(const unsigned char *encoded, const unsigned char *abuf, int alen, unsigned char **s, long *enclen); int ares_parse_a_reply(const unsigned char *abuf, int alen, struct hostent **host, struct ares_addrttl *addrttls, int *naddrttls); int ares_parse_aaaa_reply(const unsigned char *abuf, int alen, struct hostent **host, struct ares_addr6ttl *addrttls, int *naddrttls); int ares_parse_caa_reply(const unsigned char* abuf, int alen, struct ares_caa_reply** caa_out); int ares_parse_ptr_reply(const unsigned char *abuf, int alen, const void *addr, int addrlen, int family, struct hostent **host); int ares_parse_ns_reply(const unsigned char *abuf, int alen, struct hostent **host); int ares_parse_srv_reply(const unsigned char* abuf, int alen, struct ares_srv_reply** srv_out); int ares_parse_mx_reply(const unsigned char* abuf, int alen, struct ares_mx_reply** mx_out); int ares_parse_txt_reply_ext(const unsigned char* abuf, int alen, struct ares_txt_ext** txt_out); int ares_parse_naptr_reply(const unsigned char* abuf, int alen, struct ares_naptr_reply** naptr_out); int ares_parse_soa_reply(const unsigned char* abuf, int alen, struct ares_soa_reply** soa_out); void ares_free_string(void *str); void ares_free_hostent(struct hostent *host); void ares_free_data(void *dataptr); const char *ares_strerror(int code); int ares_set_servers(ares_channel channel, struct ares_addr_node *servers); int ares_get_servers(ares_channel channel, struct ares_addr_node **servers); const char *ares_inet_ntop(int af, const void *src, char *dst, ares_socklen_t size); int ares_inet_pton(int af, const char *src, void *dst); """ CALLBACKS = """ extern "Python" void _sock_state_cb(void *data, ares_socket_t socket_fd, int readable, int writable); extern "Python" void _host_cb(void *arg, int status, int timeouts, struct hostent *hostent); extern "Python" void _nameinfo_cb(void *arg, int status, int timeouts, char *node, char *service); extern "Python" void _query_cb(void *arg, int status, int timeouts, unsigned char *abuf, int alen); extern "Python" void _addrinfo_cb(void *arg, int status, int timeouts, struct ares_addrinfo *res); """ INCLUDES = """ #ifdef _WIN32 #define WIN32_LEAN_AND_MEAN # include #else # include # include # include /* struct hostent */ # include /* struct sockaddr_in/sockaddr_in6 */ #endif #include #include """ ffi = cffi.FFI() ffi.cdef(PLATFORM_TYPES + TYPES + FUNCTIONS + CALLBACKS) ffi.set_source('_cares', INCLUDES) pycares-pycares-4.1.2/src/pycares/000077500000000000000000000000001413330527400170675ustar00rootroot00000000000000pycares-pycares-4.1.2/src/pycares/__init__.py000066400000000000000000000720721413330527400212100ustar00rootroot00000000000000 from ._cares import ffi as _ffi, lib as _lib import _cffi_backend # hint for bundler tools if _lib.ARES_SUCCESS != _lib.ares_library_init(_lib.ARES_LIB_INIT_ALL): raise RuntimeError('Could not initialize c-ares') from . import errno from .utils import ascii_bytes, maybe_str, parse_name from ._version import __version__ import collections.abc import socket import math import functools import sys exported_pycares_symbols = [ # Flag values 'ARES_FLAG_USEVC', 'ARES_FLAG_PRIMARY', 'ARES_FLAG_IGNTC', 'ARES_FLAG_NORECURSE', 'ARES_FLAG_STAYOPEN', 'ARES_FLAG_NOSEARCH', 'ARES_FLAG_NOALIASES', 'ARES_FLAG_NOCHECKRESP', # Nameinfo flag values 'ARES_NI_NOFQDN', 'ARES_NI_NUMERICHOST', 'ARES_NI_NAMEREQD', 'ARES_NI_NUMERICSERV', 'ARES_NI_DGRAM', 'ARES_NI_TCP', 'ARES_NI_UDP', 'ARES_NI_SCTP', 'ARES_NI_DCCP', 'ARES_NI_NUMERICSCOPE', 'ARES_NI_LOOKUPHOST', 'ARES_NI_LOOKUPSERVICE', 'ARES_NI_IDN', 'ARES_NI_IDN_ALLOW_UNASSIGNED', 'ARES_NI_IDN_USE_STD3_ASCII_RULES', # Bad socket 'ARES_SOCKET_BAD', ] for symbol in exported_pycares_symbols: globals()[symbol] = getattr(_lib, symbol) exported_pycares_symbols_map = { # Query types "QUERY_TYPE_A" : "T_A", "QUERY_TYPE_AAAA" : "T_AAAA", "QUERY_TYPE_ANY" : "T_ANY", "QUERY_TYPE_CAA" : "T_CAA", "QUERY_TYPE_CNAME" : "T_CNAME", "QUERY_TYPE_MX" : "T_MX", "QUERY_TYPE_NAPTR" : "T_NAPTR", "QUERY_TYPE_NS" : "T_NS", "QUERY_TYPE_PTR" : "T_PTR", "QUERY_TYPE_SOA" : "T_SOA", "QUERY_TYPE_SRV" : "T_SRV", "QUERY_TYPE_TXT" : "T_TXT", # Query classes "QUERY_CLASS_IN" : "C_IN", "QUERY_CLASS_CHAOS": "C_CHAOS", "QUERY_CLASS_HS" : "C_HS", "QUERY_CLASS_NONE" :"C_NONE", "QUERY_CLASS_ANY" : "C_ANY", } for k, v in exported_pycares_symbols_map.items(): globals()[k] = getattr(_lib, v) globals()['ARES_VERSION'] = maybe_str(_ffi.string(_lib.ares_version(_ffi.NULL))) PYCARES_ADDRTTL_SIZE = 256 class AresError(Exception): pass # callback helpers _global_set = set() @_ffi.def_extern() def _sock_state_cb(data, socket_fd, readable, writable): sock_state_cb = _ffi.from_handle(data) sock_state_cb(socket_fd, readable, writable) @_ffi.def_extern() def _host_cb(arg, status, timeouts, hostent): callback = _ffi.from_handle(arg) _global_set.discard(arg) if status != _lib.ARES_SUCCESS: result = None else: result = ares_host_result(hostent) status = None callback(result, status) @_ffi.def_extern() def _nameinfo_cb(arg, status, timeouts, node, service): callback = _ffi.from_handle(arg) _global_set.discard(arg) if status != _lib.ARES_SUCCESS: result = None else: result = ares_nameinfo_result(node, service) status = None callback(result, status) @_ffi.def_extern() def _query_cb(arg, status, timeouts, abuf, alen): callback, query_type = _ffi.from_handle(arg) _global_set.discard(arg) if status == _lib.ARES_SUCCESS: if query_type == _lib.T_ANY: result = [] for qtype in (_lib.T_A, _lib.T_AAAA, _lib.T_CAA, _lib.T_CNAME, _lib.T_MX, _lib.T_NAPTR, _lib.T_NS, _lib.T_PTR, _lib.T_SOA, _lib.T_SRV, _lib.T_TXT): r, status = parse_result(qtype, abuf, alen) if status not in (None, _lib.ARES_ENODATA, _lib.ARES_EBADRESP): result = None break if r is not None: if isinstance(r, collections.abc.Iterable): result.extend(r) else: result.append(r) else: status = None else: result, status = parse_result(query_type, abuf, alen) else: result = None callback(result, status) @_ffi.def_extern() def _addrinfo_cb(arg, status, timeouts, res): callback = _ffi.from_handle(arg) _global_set.discard(arg) if status != _lib.ARES_SUCCESS: result = None else: result = ares_addrinfo_result(res) status = None callback(result, status) def parse_result(query_type, abuf, alen): if query_type == _lib.T_A: addrttls = _ffi.new("struct ares_addrttl[]", PYCARES_ADDRTTL_SIZE) naddrttls = _ffi.new("int*", PYCARES_ADDRTTL_SIZE) parse_status = _lib.ares_parse_a_reply(abuf, alen, _ffi.NULL, addrttls, naddrttls) if parse_status != _lib.ARES_SUCCESS: result = None status = parse_status else: result = [ares_query_a_result(addrttls[i]) for i in range(naddrttls[0])] status = None elif query_type == _lib.T_AAAA: addrttls = _ffi.new("struct ares_addr6ttl[]", PYCARES_ADDRTTL_SIZE) naddrttls = _ffi.new("int*", PYCARES_ADDRTTL_SIZE) parse_status = _lib.ares_parse_aaaa_reply(abuf, alen, _ffi.NULL, addrttls, naddrttls) if parse_status != _lib.ARES_SUCCESS: result = None status = parse_status else: result = [ares_query_aaaa_result(addrttls[i]) for i in range(naddrttls[0])] status = None elif query_type == _lib.T_CAA: caa_reply = _ffi.new("struct ares_caa_reply **") parse_status = _lib.ares_parse_caa_reply(abuf, alen, caa_reply) if parse_status != _lib.ARES_SUCCESS: result = None status = parse_status else: result = [] caa_reply_ptr = caa_reply[0] while caa_reply_ptr != _ffi.NULL: result.append(ares_query_caa_result(caa_reply_ptr)) caa_reply_ptr = caa_reply_ptr.next _lib.ares_free_data(caa_reply[0]) status = None elif query_type == _lib.T_CNAME: host = _ffi.new("struct hostent **") parse_status = _lib.ares_parse_a_reply(abuf, alen, host, _ffi.NULL, _ffi.NULL) if parse_status != _lib.ARES_SUCCESS: result = None status = parse_status else: result = ares_query_cname_result(host[0]) _lib.ares_free_hostent(host[0]) status = None elif query_type == _lib.T_MX: mx_reply = _ffi.new("struct ares_mx_reply **") parse_status = _lib.ares_parse_mx_reply(abuf, alen, mx_reply) if parse_status != _lib.ARES_SUCCESS: result = None status = parse_status else: result = [] mx_reply_ptr = mx_reply[0] while mx_reply_ptr != _ffi.NULL: result.append(ares_query_mx_result(mx_reply_ptr)) mx_reply_ptr = mx_reply_ptr.next _lib.ares_free_data(mx_reply[0]) status = None elif query_type == _lib.T_NAPTR: naptr_reply = _ffi.new("struct ares_naptr_reply **") parse_status = _lib.ares_parse_naptr_reply(abuf, alen, naptr_reply) if parse_status != _lib.ARES_SUCCESS: result = None status = parse_status else: result = [] naptr_reply_ptr = naptr_reply[0] while naptr_reply_ptr != _ffi.NULL: result.append(ares_query_naptr_result(naptr_reply_ptr)) naptr_reply_ptr = naptr_reply_ptr.next _lib.ares_free_data(naptr_reply[0]) status = None elif query_type == _lib.T_NS: hostent = _ffi.new("struct hostent **") parse_status = _lib.ares_parse_ns_reply(abuf, alen, hostent) if parse_status != _lib.ARES_SUCCESS: result = None status = parse_status else: result = [] host = hostent[0] i = 0 while host.h_aliases[i] != _ffi.NULL: result.append(ares_query_ns_result(host.h_aliases[i])) i += 1 _lib.ares_free_hostent(host) status = None elif query_type == _lib.T_PTR: hostent = _ffi.new("struct hostent **") parse_status = _lib.ares_parse_ptr_reply(abuf, alen, _ffi.NULL, 0, socket.AF_UNSPEC, hostent) if parse_status != _lib.ARES_SUCCESS: result = None status = parse_status else: aliases = [] host = hostent[0] i = 0 while host.h_aliases[i] != _ffi.NULL: aliases.append(maybe_str(_ffi.string(host.h_aliases[i]))) i += 1 result = ares_query_ptr_result(host, aliases) _lib.ares_free_hostent(host) status = None elif query_type == _lib.T_SOA: soa_reply = _ffi.new("struct ares_soa_reply **") parse_status = _lib.ares_parse_soa_reply(abuf, alen, soa_reply) if parse_status != _lib.ARES_SUCCESS: result = None status = parse_status else: result = ares_query_soa_result(soa_reply[0]) _lib.ares_free_data(soa_reply[0]) status = None elif query_type == _lib.T_SRV: srv_reply = _ffi.new("struct ares_srv_reply **") parse_status = _lib.ares_parse_srv_reply(abuf, alen, srv_reply) if parse_status != _lib.ARES_SUCCESS: result = None status = parse_status else: result = [] srv_reply_ptr = srv_reply[0] while srv_reply_ptr != _ffi.NULL: result.append(ares_query_srv_result(srv_reply_ptr)) srv_reply_ptr = srv_reply_ptr.next _lib.ares_free_data(srv_reply[0]) status = None elif query_type == _lib.T_TXT: txt_reply = _ffi.new("struct ares_txt_ext **") parse_status = _lib.ares_parse_txt_reply_ext(abuf, alen, txt_reply) if parse_status != _lib.ARES_SUCCESS: result = None status = parse_status else: result = [] txt_reply_ptr = txt_reply[0] tmp_obj = None while True: if txt_reply_ptr == _ffi.NULL: if tmp_obj is not None: result.append(ares_query_txt_result(tmp_obj)) break if txt_reply_ptr.record_start == 1: if tmp_obj is not None: result.append(ares_query_txt_result(tmp_obj)) tmp_obj = ares_query_txt_result_chunk(txt_reply_ptr) else: new_chunk = ares_query_txt_result_chunk(txt_reply_ptr) tmp_obj.text += new_chunk.text txt_reply_ptr = txt_reply_ptr.next _lib.ares_free_data(txt_reply[0]) status = None else: raise ValueError("invalid query type specified") return result, status class Channel: __qtypes__ = (_lib.T_A, _lib.T_AAAA, _lib.T_ANY, _lib.T_CAA, _lib.T_CNAME, _lib.T_MX, _lib.T_NAPTR, _lib.T_NS, _lib.T_PTR, _lib.T_SOA, _lib.T_SRV, _lib.T_TXT) __qclasses__ = (_lib.C_IN, _lib.C_CHAOS, _lib.C_HS, _lib.C_NONE, _lib.C_ANY) def __init__(self, flags = None, timeout = None, tries = None, ndots = None, tcp_port = None, udp_port = None, servers = None, domains = None, lookups = None, sock_state_cb = None, socket_send_buffer_size = None, socket_receive_buffer_size = None, rotate = False, local_ip = None, local_dev = None, resolvconf_path = None): channel = _ffi.new("ares_channel *") options = _ffi.new("struct ares_options *") optmask = 0 if flags is not None: options.flags = flags optmask = optmask | _lib.ARES_OPT_FLAGS if timeout is not None: options.timeout = int(timeout * 1000) optmask = optmask | _lib.ARES_OPT_TIMEOUTMS if tries is not None: options.tries = tries optmask = optmask | _lib.ARES_OPT_TRIES if ndots is not None: options.ndots = ndots optmask = optmask | _lib.ARES_OPT_NDOTS if tcp_port is not None: options.tcp_port = tcp_port optmask = optmask | _lib.ARES_OPT_TCP_PORT if udp_port is not None: options.udp_port = udp_port optmask = optmask | _lib.ARES_OPT_UDP_PORT if socket_send_buffer_size is not None: options.socket_send_buffer_size = socket_send_buffer_size optmask = optmask | _lib.ARES_OPT_SOCK_SNDBUF if socket_receive_buffer_size is not None: options.socket_receive_buffer_size = socket_receive_buffer_size optmask = optmask | _lib.ARES_OPT_SOCK_RCVBUF if sock_state_cb: if not callable(sock_state_cb): raise TypeError("sock_state_cb is not callable") userdata = _ffi.new_handle(sock_state_cb) # This must be kept alive while the channel is alive. self._sock_state_cb_handle = userdata options.sock_state_cb = _lib._sock_state_cb options.sock_state_cb_data = userdata optmask = optmask | _lib.ARES_OPT_SOCK_STATE_CB if lookups: options.lookups = _ffi.new('char[]', ascii_bytes(lookups)) optmask = optmask | _lib.ARES_OPT_LOOKUPS if domains: strs = [_ffi.new("char[]", ascii_bytes(i)) for i in domains] c = _ffi.new("char *[%d]" % (len(domains) + 1)) for i in range(len(domains)): c[i] = strs[i] options.domains = c options.ndomains = len(domains) optmask = optmask | _lib.ARES_OPT_DOMAINS if rotate: optmask = optmask | _lib.ARES_OPT_ROTATE if resolvconf_path is not None: optmask = optmask | _lib.ARES_OPT_RESOLVCONF options.resolvconf_path = _ffi.new('char[]', ascii_bytes(resolvconf_path)) r = _lib.ares_init_options(channel, options, optmask) if r != _lib.ARES_SUCCESS: raise AresError('Failed to initialize c-ares channel') self._channel = _ffi.gc(channel, lambda x: _lib.ares_destroy(x[0])) if servers: self.servers = servers if local_ip: self.set_local_ip(local_ip) if local_dev: self.set_local_dev(local_dev) def cancel(self): _lib.ares_cancel(self._channel[0]) @property def servers(self): servers = _ffi.new("struct ares_addr_node **") r = _lib.ares_get_servers(self._channel[0], servers) if r != _lib.ARES_SUCCESS: raise AresError(r, errno.strerror(r)) server_list = [] server = _ffi.new("struct ares_addr_node **", servers[0]) while True: if server == _ffi.NULL: break ip = _ffi.new("char []", _lib.INET6_ADDRSTRLEN) s = server[0] if _ffi.NULL != _lib.ares_inet_ntop(s.family, _ffi.addressof(s.addr), ip, _lib.INET6_ADDRSTRLEN): server_list.append(maybe_str(_ffi.string(ip, _lib.INET6_ADDRSTRLEN))) server = s.next return server_list @servers.setter def servers(self, servers): c = _ffi.new("struct ares_addr_node[%d]" % len(servers)) for i, server in enumerate(servers): if _lib.ares_inet_pton(socket.AF_INET, ascii_bytes(server), _ffi.addressof(c[i].addr.addr4)) == 1: c[i].family = socket.AF_INET elif _lib.ares_inet_pton(socket.AF_INET6, ascii_bytes(server), _ffi.addressof(c[i].addr.addr6)) == 1: c[i].family = socket.AF_INET6 else: raise ValueError("invalid IP address") if i > 0: c[i - 1].next = _ffi.addressof(c[i]) r = _lib.ares_set_servers(self._channel[0], c) if r != _lib.ARES_SUCCESS: raise AresError(r, errno.strerror(r)) def getsock(self): rfds = [] wfds = [] socks = _ffi.new("ares_socket_t [%d]" % _lib.ARES_GETSOCK_MAXNUM) bitmask = _lib.ares_getsock(self._channel[0], socks, _lib.ARES_GETSOCK_MAXNUM) for i in range(_lib.ARES_GETSOCK_MAXNUM): if _lib.ARES_GETSOCK_READABLE(bitmask, i): rfds.append(socks[i]) if _lib.ARES_GETSOCK_WRITABLE(bitmask, i): wfds.append(socks[i]) return rfds, wfds def process_fd(self, read_fd, write_fd): _lib.ares_process_fd(self._channel[0], _ffi.cast("ares_socket_t", read_fd), _ffi.cast("ares_socket_t", write_fd)) def timeout(self, t = None): maxtv = _ffi.NULL tv = _ffi.new("struct timeval*") if t is not None: if t >= 0.0: maxtv = _ffi.new("struct timeval*") maxtv.tv_sec = int(math.floor(t)) maxtv.tv_usec = int(math.fmod(t, 1.0) * 1000000) else: raise ValueError("timeout needs to be a positive number or None") _lib.ares_timeout(self._channel[0], maxtv, tv) if tv == _ffi.NULL: return 0.0 return (tv.tv_sec + tv.tv_usec / 1000000.0) def gethostbyaddr(self, addr, callback): if not callable(callback): raise TypeError("a callable is required") addr4 = _ffi.new("struct in_addr*") addr6 = _ffi.new("struct ares_in6_addr*") if _lib.ares_inet_pton(socket.AF_INET, ascii_bytes(addr), (addr4)) == 1: address = addr4 family = socket.AF_INET elif _lib.ares_inet_pton(socket.AF_INET6, ascii_bytes(addr), (addr6)) == 1: address = addr6 family = socket.AF_INET6 else: raise ValueError("invalid IP address") userdata = _ffi.new_handle(callback) _global_set.add(userdata) _lib.ares_gethostbyaddr(self._channel[0], address, _ffi.sizeof(address[0]), family, _lib._host_cb, userdata) def gethostbyname(self, name, family, callback): if not callable(callback): raise TypeError("a callable is required") userdata = _ffi.new_handle(callback) _global_set.add(userdata) _lib.ares_gethostbyname(self._channel[0], parse_name(name), family, _lib._host_cb, userdata) def getaddrinfo(self, host, port, callback, family=0, type=0, proto=0, flags=0): if not callable(callback): raise TypeError("a callable is required") if port is None: service = _ffi.NULL elif isinstance(port, int): service = str(port).encode('ascii') else: service = ascii_bytes(port) userdata = _ffi.new_handle(callback) _global_set.add(userdata) hints = _ffi.new('struct ares_addrinfo_hints*') hints.ai_flags = flags hints.ai_family = family hints.ai_socktype = type hints.ai_protocol = proto _lib.ares_getaddrinfo(self._channel[0], parse_name(host), service, hints, _lib._addrinfo_cb, userdata) def query(self, name, query_type, callback, query_class=None): self._do_query(_lib.ares_query, name, query_type, callback, query_class=query_class) def search(self, name, query_type, callback, query_class=None): self._do_query(_lib.ares_search, name, query_type, callback, query_class=query_class) def _do_query(self, func, name, query_type, callback, query_class=None): if not callable(callback): raise TypeError('a callable is required') if query_type not in self.__qtypes__: raise ValueError('invalid query type specified') if query_class is None: query_class = _lib.C_IN if query_class not in self.__qclasses__: raise ValueError('invalid query class specified') userdata = _ffi.new_handle((callback, query_type)) _global_set.add(userdata) func(self._channel[0], parse_name(name), query_class, query_type, _lib._query_cb, userdata) def set_local_ip(self, ip): addr4 = _ffi.new("struct in_addr*") addr6 = _ffi.new("struct ares_in6_addr*") if _lib.ares_inet_pton(socket.AF_INET, ascii_bytes(ip), addr4) == 1: _lib.ares_set_local_ip4(self._channel[0], socket.ntohl(addr4.s_addr)) elif _lib.ares_inet_pton(socket.AF_INET6, ascii_bytes(ip), addr6) == 1: _lib.ares_set_local_ip6(self._channel[0], addr6) else: raise ValueError("invalid IP address") def getnameinfo(self, address, flags, callback): if not callable(callback): raise TypeError("a callable is required") if len(address) == 2: (ip, port) = address sa4 = _ffi.new("struct sockaddr_in*") if _lib.ares_inet_pton(socket.AF_INET, ascii_bytes(ip), _ffi.addressof(sa4.sin_addr)) != 1: raise ValueError("Invalid IPv4 address %r" % ip) sa4.sin_family = socket.AF_INET sa4.sin_port = socket.htons(port) sa = sa4 elif len(address) == 4: (ip, port, flowinfo, scope_id) = address sa6 = _ffi.new("struct sockaddr_in6*") if _lib.ares_inet_pton(socket.AF_INET6, ascii_bytes(ip), _ffi.addressof(sa6.sin6_addr)) != 1: raise ValueError("Invalid IPv6 address %r" % ip) sa6.sin6_family = socket.AF_INET6 sa6.sin6_port = socket.htons(port) sa6.sin6_flowinfo = socket.htonl(flowinfo) # I'm unsure about byteorder here. sa6.sin6_scope_id = scope_id # Yes, without htonl. sa = sa6 else: raise ValueError("Invalid address argument") userdata = _ffi.new_handle(callback) _global_set.add(userdata) _lib.ares_getnameinfo(self._channel[0], _ffi.cast("struct sockaddr*", sa), _ffi.sizeof(sa[0]), flags, _lib._nameinfo_cb, userdata) def set_local_dev(self, dev): _lib.ares_set_local_dev(self._channel[0], dev) class AresResult: __slots__ = () def __repr__(self): attrs = ['%s=%s' % (a, getattr(self, a)) for a in self.__slots__] return '<%s> %s' % (self.__class__.__name__, ', '.join(attrs)) # DNS query result types # class ares_query_a_result(AresResult): __slots__ = ('host', 'ttl') type = 'A' def __init__(self, ares_addrttl): buf = _ffi.new("char[]", _lib.INET6_ADDRSTRLEN) _lib.ares_inet_ntop(socket.AF_INET, _ffi.addressof(ares_addrttl.ipaddr), buf, _lib.INET6_ADDRSTRLEN) self.host = maybe_str(_ffi.string(buf, _lib.INET6_ADDRSTRLEN)) self.ttl = ares_addrttl.ttl class ares_query_aaaa_result(AresResult): __slots__ = ('host', 'ttl') type = 'AAAA' def __init__(self, ares_addrttl): buf = _ffi.new("char[]", _lib.INET6_ADDRSTRLEN) _lib.ares_inet_ntop(socket.AF_INET6, _ffi.addressof(ares_addrttl.ip6addr), buf, _lib.INET6_ADDRSTRLEN) self.host = maybe_str(_ffi.string(buf, _lib.INET6_ADDRSTRLEN)) self.ttl = ares_addrttl.ttl class ares_query_caa_result(AresResult): __slots__ = ('critical', 'property', 'value', 'ttl') type = 'CAA' def __init__(self, caa): self.critical = caa.critical self.property = maybe_str(_ffi.string(caa.property, caa.plength)) self.value = maybe_str(_ffi.string(caa.value, caa.length)) self.ttl = -1 class ares_query_cname_result(AresResult): __slots__ = ('cname', 'ttl') type = 'CNAME' def __init__(self, host): self.cname = maybe_str(_ffi.string(host.h_name)) self.ttl = -1 class ares_query_mx_result(AresResult): __slots__ = ('host', 'priority', 'ttl') type = 'MX' def __init__(self, mx): self.host = maybe_str(_ffi.string(mx.host)) self.priority = mx.priority self.ttl = -1 class ares_query_naptr_result(AresResult): __slots__ = ('order', 'preference', 'flags', 'service', 'regex', 'replacement', 'ttl') type = 'NAPTR' def __init__(self, naptr): self.order = naptr.order self.preference = naptr.preference self.flags = maybe_str(_ffi.string(naptr.flags)) self.service = maybe_str(_ffi.string(naptr.service)) self.regex = maybe_str(_ffi.string(naptr.regexp)) self.replacement = maybe_str(_ffi.string(naptr.replacement)) self.ttl = -1 class ares_query_ns_result(AresResult): __slots__ = ('host', 'ttl') type = 'NS' def __init__(self, ns): self.host = maybe_str(_ffi.string(ns)) self.ttl = -1 class ares_query_ptr_result(AresResult): __slots__ = ('name', 'ttl', 'aliases') type = 'PTR' def __init__(self, hostent, aliases): self.name = maybe_str(_ffi.string(hostent.h_name)) self.aliases = aliases self.ttl = -1 class ares_query_soa_result(AresResult): __slots__ = ('nsname', 'hostmaster', 'serial', 'refresh', 'retry', 'expires', 'minttl', 'ttl') type = 'SOA' def __init__(self, soa): self.nsname = maybe_str(_ffi.string(soa.nsname)) self.hostmaster = maybe_str(_ffi.string(soa.hostmaster)) self.serial = soa.serial self.refresh = soa.refresh self.retry = soa.retry self.expires = soa.expire self.minttl = soa.minttl self.ttl = -1 class ares_query_srv_result(AresResult): __slots__ = ('host', 'port', 'priority', 'weight', 'ttl') type = 'SRV' def __init__(self, srv): self.host = maybe_str(_ffi.string(srv.host)) self.port = srv.port self.priority = srv.priority self.weight = srv.weight self.ttl = -1 class ares_query_txt_result(AresResult): __slots__ = ('text', 'ttl') type = 'TXT' def __init__(self, txt_chunk): self.text = maybe_str(txt_chunk.text) self.ttl = -1 class ares_query_txt_result_chunk(AresResult): __slots__ = ('text', 'ttl') type = 'TXT' def __init__(self, txt): self.text = _ffi.string(txt.txt) self.ttl = -1 # Other result types # class ares_host_result(AresResult): __slots__ = ('name', 'aliases', 'addresses') def __init__(self, hostent): self.name = maybe_str(_ffi.string(hostent.h_name)) self.aliases = [] self.addresses = [] i = 0 while hostent.h_aliases[i] != _ffi.NULL: self.aliases.append(maybe_str(_ffi.string(hostent.h_aliases[i]))) i += 1 i = 0 while hostent.h_addr_list[i] != _ffi.NULL: buf = _ffi.new("char[]", _lib.INET6_ADDRSTRLEN) if _ffi.NULL != _lib.ares_inet_ntop(hostent.h_addrtype, hostent.h_addr_list[i], buf, _lib.INET6_ADDRSTRLEN): self.addresses.append(maybe_str(_ffi.string(buf, _lib.INET6_ADDRSTRLEN))) i += 1 class ares_nameinfo_result(AresResult): __slots__ = ('node', 'service') def __init__(self, node, service): self.node = maybe_str(_ffi.string(node)) self.service = maybe_str(_ffi.string(service)) if service != _ffi.NULL else None class ares_addrinfo_node_result(AresResult): __slots__ = ('ttl', 'flags', 'family', 'socktype', 'protocol', 'addr') def __init__(self, ares_node): self.ttl = ares_node.ai_ttl self.flags = ares_node.ai_flags self.socktype = ares_node.ai_socktype self.protocol = ares_node.ai_protocol addr = ares_node.ai_addr assert addr.sa_family == ares_node.ai_family ip = _ffi.new("char []", _lib.INET6_ADDRSTRLEN) if addr.sa_family == socket.AF_INET: self.family = socket.AF_INET s = _ffi.cast("struct sockaddr_in*", addr) if _ffi.NULL != _lib.ares_inet_ntop(s.sin_family, _ffi.addressof(s.sin_addr), ip, _lib.INET6_ADDRSTRLEN): # (address, port) 2-tuple for AF_INET self.addr = (_ffi.string(ip, _lib.INET6_ADDRSTRLEN), socket.ntohs(s.sin_port)) elif addr.sa_family == socket.AF_INET6: self.family = socket.AF_INET6 s = _ffi.cast("struct sockaddr_in6*", addr) if _ffi.NULL != _lib.ares_inet_ntop(s.sin6_family, _ffi.addressof(s.sin6_addr), ip, _lib.INET6_ADDRSTRLEN): # (address, port, flow info, scope id) 4-tuple for AF_INET6 self.addr = (_ffi.string(ip, _lib.INET6_ADDRSTRLEN), socket.ntohs(s.sin6_port), s.sin6_flowinfo, s.sin6_scope_id) else: raise ValueError("invalid sockaddr family") class ares_addrinfo_cname_result(AresResult): __slots__ = ('ttl', 'alias', 'name') def __init__(self, ares_cname): self.ttl = ares_cname.ttl self.alias = maybe_str(_ffi.string(ares_cname.alias)) self.name = maybe_str(_ffi.string(ares_cname.name)) class ares_addrinfo_result(AresResult): __slots__ = ('cnames', 'nodes') def __init__(self, ares_addrinfo): self.cnames = [] self.nodes = [] cname_ptr = ares_addrinfo.cnames while cname_ptr != _ffi.NULL: self.cnames.append(ares_addrinfo_cname_result(cname_ptr)) cname_ptr = cname_ptr.next node_ptr = ares_addrinfo.nodes while node_ptr != _ffi.NULL: self.nodes.append(ares_addrinfo_node_result(node_ptr)) node_ptr = node_ptr.ai_next _lib.ares_freeaddrinfo(ares_addrinfo) __all__ = exported_pycares_symbols + list(exported_pycares_symbols_map.keys()) + ['AresError', 'Channel', 'errno', '__version__'] del exported_pycares_symbols, exported_pycares_symbols_map pycares-pycares-4.1.2/src/pycares/__main__.py000066400000000000000000000053541413330527400211700ustar00rootroot00000000000000 import collections.abc import pycares import select import socket import sys def wait_channel(channel): while True: read_fds, write_fds = channel.getsock() if not read_fds and not write_fds: break timeout = channel.timeout() if not timeout: channel.process_fd(pycares.ARES_SOCKET_BAD, pycares.ARES_SOCKET_BAD) continue rlist, wlist, xlist = select.select(read_fds, write_fds, [], timeout) for fd in rlist: channel.process_fd(fd, pycares.ARES_SOCKET_BAD) for fd in wlist: channel.process_fd(pycares.ARES_SOCKET_BAD, fd) def cb(result, error): if error is not None: print('Error: (%d) %s' % (error, pycares.errno.strerror(error))) else: parts = [ ';; QUESTION SECTION:', ';%s\t\t\tIN\t%s' % (hostname, qtype.upper()), '', ';; ANSWER SECTION:' ] if not isinstance(result, collections.abc.Iterable): result = [result] for r in result: txt = '%s\t\t%d\tIN\t%s' % (hostname, r.ttl, r.type) if r.type in ('A', 'AAAA'): parts.append('%s\t%s' % (txt, r.host)) elif r.type == 'CAA': parts.append('%s\t%d %s "%s"' % (txt, r.critical, r.property, r.value)) elif r.type == 'CNAME': parts.append('%s\t%s' % (txt, r.cname)) elif r.type == 'MX': parts.append('%s\t%d %s' % (txt, r.priority, r.host)) elif r.type == 'NAPTR': parts.append('%s\t%d %d "%s" "%s" "%s" %s' % (txt, r.order, r.preference, r.flags, r.service, r.regex, r.replacement)) elif r.type == 'NS': parts.append('%s\t%s' % (txt, r.host)) elif r.type == 'PTR': parts.append('%s\t%s' % (txt, r.name)) elif r.type == 'SOA': parts.append('%s\t%s %s %d %d %d %d %d' % (txt, r.nsname, r.hostmaster, r.serial, r.refresh, r.retry, r.expires, r.minttl)) elif r.type == 'SRV': parts.append('%s\t%d %d %d %s' % (txt, r.priority, r.weight, r.port, r.host)) elif r.type == 'TXT': parts.append('%s\t"%s"' % (txt, r.text)) print('\n'.join(parts)) channel = pycares.Channel() if len(sys.argv) not in (2, 3): print('Invalid arguments! Usage: python -m pycares [query_type] hostname') sys.exit(1) if len(sys.argv) == 2: _, hostname = sys.argv qtype = 'A' else: _, qtype, hostname = sys.argv try: query_type = getattr(pycares, 'QUERY_TYPE_%s' % qtype.upper()) except Exception: print('Invalid query type: %s' % qtype) sys.exit(1) channel.query(hostname, query_type, cb) wait_channel(channel) pycares-pycares-4.1.2/src/pycares/_version.py000066400000000000000000000000271413330527400212640ustar00rootroot00000000000000 __version__ = '4.1.2' pycares-pycares-4.1.2/src/pycares/errno.py000066400000000000000000000020171413330527400205660ustar00rootroot00000000000000 from ._cares import ffi as _ffi, lib as _lib from .utils import maybe_str exported_pycares_symbols = [ 'ARES_SUCCESS', # error codes 'ARES_ENODATA', 'ARES_EFORMERR', 'ARES_ESERVFAIL', 'ARES_ENOTFOUND', 'ARES_ENOTIMP', 'ARES_EREFUSED', 'ARES_EBADQUERY', 'ARES_EBADNAME', 'ARES_EBADFAMILY', 'ARES_EBADRESP', 'ARES_ECONNREFUSED', 'ARES_ETIMEOUT', 'ARES_EOF', 'ARES_EFILE', 'ARES_ENOMEM', 'ARES_EDESTRUCTION', 'ARES_EBADSTR', 'ARES_EBADFLAGS', 'ARES_ENONAME', 'ARES_EBADHINTS', 'ARES_ENOTINITIALIZED', 'ARES_ELOADIPHLPAPI', 'ARES_EADDRGETNETWORKPARAMS', 'ARES_ECANCELLED', 'ARES_ESERVICE' ] errorcode = {} for symbol in exported_pycares_symbols: value = getattr(_lib, symbol) globals()[symbol] = value globals()["errorcode"][value] = symbol def strerror(code): return maybe_str(_ffi.string(_lib.ares_strerror(code))) __all__ = exported_pycares_symbols + ['errorcode', 'strerror'] del exported_pycares_symbols pycares-pycares-4.1.2/src/pycares/utils.py000066400000000000000000000024771413330527400206130ustar00rootroot00000000000000 try: import idna as idna2008 except ImportError: idna2008 = None def ascii_bytes(data): if isinstance(data, str): return data.encode('ascii') if isinstance(data, bytes): return data raise TypeError('only str (ascii encoding) and bytes are supported') def maybe_str(data): if isinstance(data, str): return data if isinstance(data, bytes): try: return data.decode('ascii') except UnicodeDecodeError: return data raise TypeError('only str (ascii encoding) and bytes are supported') def is_all_ascii(text): for c in text: if ord(c) > 0x7f: return False return True def parse_name_idna2008(name): parts = name.split('.') r = [] for part in parts: if is_all_ascii(part): r.append(part.encode('ascii')) else: r.append(idna2008.encode(part)) return b'.'.join(r) def parse_name(name): if isinstance(name, str): if is_all_ascii(name): return name.encode('ascii') if idna2008 is not None: return parse_name_idna2008(name) return name.encode('idna') if isinstance(name, bytes): return name raise TypeError('only str and bytes are supported') __all__ = ['ascii_bytes', 'maybe_str', 'parse_name'] pycares-pycares-4.1.2/tests/000077500000000000000000000000001413330527400157745ustar00rootroot00000000000000pycares-pycares-4.1.2/tests/fixtures/000077500000000000000000000000001413330527400176455ustar00rootroot00000000000000pycares-pycares-4.1.2/tests/fixtures/badresolv.conf000066400000000000000000000000231413330527400224700ustar00rootroot00000000000000nameserver 1.2.3.4 pycares-pycares-4.1.2/tests/tests.py000077500000000000000000000676001413330527400175240ustar00rootroot00000000000000#!/usr/bin/env python import ipaddress import os import select import socket import sys import unittest import pycares FIXTURES_PATH = os.path.realpath(os.path.join(os.path.dirname(__file__), 'fixtures')) class DNSTest(unittest.TestCase): def setUp(self): self.channel = pycares.Channel(timeout=10.0, tries=1, servers=['8.8.8.8', '8.8.4.4']) self.is_ci = os.environ.get('APPVEYOR') or os.environ.get('TRAVIS') or os.environ.get('GITHUB_ACTION') def tearDown(self): self.channel = None def wait(self): while True: read_fds, write_fds = self.channel.getsock() if not read_fds and not write_fds: break timeout = self.channel.timeout() if timeout == 0.0: self.channel.process_fd(pycares.ARES_SOCKET_BAD, pycares.ARES_SOCKET_BAD) continue rlist, wlist, xlist = select.select(read_fds, write_fds, [], timeout) for fd in rlist: self.channel.process_fd(fd, pycares.ARES_SOCKET_BAD) for fd in wlist: self.channel.process_fd(pycares.ARES_SOCKET_BAD, fd) def assertNoError(self, errorno): if errorno == pycares.errno.ARES_ETIMEOUT and self.is_ci: raise unittest.SkipTest('timeout') self.assertEqual(errorno, None) @unittest.skipIf(sys.platform == 'win32', 'skipped on Windows') def test_getaddrinfo(self): self.result, self.errorno = None, None def cb(result, errorno): self.result, self.errorno = result, errorno self.channel.getaddrinfo('localhost', 80, cb) self.wait() self.assertNoError(self.errorno) self.assertEqual(type(self.result), pycares.ares_addrinfo_result) self.assertTrue(len(self.result.nodes) > 0) for node in self.result.nodes: self.assertEqual(node.addr[1], 80) @unittest.skipIf(sys.platform == 'win32', 'skipped on Windows') def test_getaddrinfo2(self): self.result, self.errorno = None, None def cb(result, errorno): self.result, self.errorno = result, errorno self.channel.getaddrinfo('localhost', 'http', cb) self.wait() self.assertNoError(self.errorno) self.assertEqual(type(self.result), pycares.ares_addrinfo_result) self.assertTrue(len(self.result.nodes) > 0) for node in self.result.nodes: self.assertEqual(node.addr[1], 80) @unittest.skipIf(sys.platform == 'win32', 'skipped on Windows') def test_getaddrinfo3(self): self.result, self.errorno = None, None def cb(result, errorno): self.result, self.errorno = result, errorno self.channel.getaddrinfo('localhost', None, cb) self.wait() self.assertNoError(self.errorno) self.assertEqual(type(self.result), pycares.ares_addrinfo_result) self.assertTrue(len(self.result.nodes) > 0) for node in self.result.nodes: self.assertEqual(node.addr[1], 0) @unittest.skipIf(sys.platform == 'win32', 'skipped on Windows') def test_getaddrinfo4(self): self.result, self.errorno = None, None def cb(result, errorno): self.result, self.errorno = result, errorno self.channel.getaddrinfo('localhost', 'http', cb, family=socket.AF_INET) self.wait() self.assertNoError(self.errorno) self.assertEqual(type(self.result), pycares.ares_addrinfo_result) self.assertEqual(len(self.result.nodes), 1) node = self.result.nodes[0] self.assertEqual(node.addr[0], b'127.0.0.1') self.assertEqual(node.addr[1], 80) def test_getaddrinfo5(self): self.result, self.errorno = None, None def cb(result, errorno): self.result, self.errorno = result, errorno self.channel.getaddrinfo('google.com', 'http', cb) self.wait() self.assertNoError(self.errorno) self.assertEqual(type(self.result), pycares.ares_addrinfo_result) self.assertTrue(len(self.result.nodes) > 0) @unittest.skipIf(sys.platform == 'win32', 'skipped on Windows') def test_gethostbyaddr(self): self.result, self.errorno = None, None def cb(result, errorno): self.result, self.errorno = result, errorno self.channel.gethostbyaddr('127.0.0.1', cb) self.wait() self.assertNoError(self.errorno) self.assertEqual(type(self.result), pycares.ares_host_result) @unittest.skipIf(sys.platform == 'win32', 'skipped on Windows') def test_gethostbyaddr6(self): self.result, self.errorno = None, None def cb(result, errorno): self.result, self.errorno = result, errorno self.channel.gethostbyaddr('::1', cb) self.wait() self.assertNoError(self.errorno) self.assertEqual(type(self.result), pycares.ares_host_result) @unittest.skipIf(sys.platform == 'win32', 'skipped on Windows') def test_gethostbyname(self): self.result, self.errorno = None, None def cb(result, errorno): self.result, self.errorno = result, errorno self.channel.gethostbyname('localhost', socket.AF_INET, cb) self.wait() self.assertNoError(self.errorno) self.assertEqual(type(self.result), pycares.ares_host_result) @unittest.skipIf(sys.platform == 'win32', 'skipped on Windows') def test_gethostbyname_small_timeout(self): self.result, self.errorno = None, None def cb(result, errorno): self.result, self.errorno = result, errorno self.channel = pycares.Channel(timeout=0.5, tries=1) self.channel.gethostbyname('localhost', socket.AF_INET, cb) self.wait() self.assertNoError(self.errorno) self.assertEqual(type(self.result), pycares.ares_host_result) @unittest.skipIf(sys.platform == 'win32', 'skipped on Windows') def test_getnameinfo(self): self.result, self.errorno = None, None def cb(result, errorno): self.result, self.errorno = result, errorno self.channel.getnameinfo(('127.0.0.1', 80), pycares.ARES_NI_LOOKUPHOST|pycares.ARES_NI_LOOKUPSERVICE, cb) self.wait() self.assertNoError(self.errorno) self.assertEqual(type(self.result), pycares.ares_nameinfo_result) self.assertIn(self.result.node, ('localhost.localdomain', 'localhost')) self.assertEqual(self.result.service, 'http') @unittest.skipIf(sys.platform == 'win32', 'skipped on Windows') @unittest.expectedFailure # c-ares is broken (does not return numeric service if asked) and unconditionally adds zero scope def test_getnameinfo_ipv6(self): self.result, self.errorno = None, None def cb(result, errorno): self.result, self.errorno = result, errorno self.channel.getnameinfo(('fd01:dec0:0:1::2020', 80, 0, 0), pycares.ARES_NI_NUMERICHOST|pycares.ARES_NI_NUMERICSERV, cb) self.wait() self.assertNoError(self.errorno) self.assertEqual(type(self.result), pycares.ares_nameinfo_result) self.assertEqual(self.result.node, 'fd01:dec0:0:1::2020') self.assertEqual(self.result.service, '80') @unittest.skipIf(sys.platform == 'win32', 'skipped on Windows') @unittest.expectedFailure # c-ares is broken (does not return numeric service if asked) def test_getnameinfo_ipv6_ll(self): self.result, self.errorno = None, None def cb(result, errorno): self.result, self.errorno = result, errorno self.channel.getnameinfo(('fe80::5abd:fee7:4177:60c0', 80, 0, 666), pycares.ARES_NI_NUMERICHOST|pycares.ARES_NI_NUMERICSERV|pycares.ARES_NI_NUMERICSCOPE, cb) self.wait() self.assertNoError(self.errorno) self.assertEqual(type(self.result), pycares.ares_nameinfo_result) self.assertEqual(self.result.node, 'fe80::5abd:fee7:4177:60c0%666') self.assertEqual(self.result.service, '80') def test_query_a(self): self.result, self.errorno = None, None def cb(result, errorno): self.result, self.errorno = result, errorno self.channel.query('google.com', pycares.QUERY_TYPE_A, cb) self.wait() self.assertNoError(self.errorno) for r in self.result: self.assertEqual(type(r), pycares.ares_query_a_result) self.assertNotEqual(r.host, None) def test_query_a_bad(self): self.result, self.errorno = None, None def cb(result, errorno): self.result, self.errorno = result, errorno self.channel.query('hgf8g2od29hdohid.com', pycares.QUERY_TYPE_A, cb) self.wait() self.assertEqual(self.result, None) self.assertEqual(self.errorno, pycares.errno.ARES_ENOTFOUND) def test_query_a_rotate(self): self.result, self.errorno = None, None self.errorno_count, self.count = 0, 0 def cb(result, errorno): self.result, self.errorno = result, errorno if errorno: self.errorno_count += 1 self.count += 1 self.channel = pycares.Channel(timeout=1.0, tries=1, rotate=True) self.channel.query('google.com', pycares.QUERY_TYPE_A, cb) self.channel.query('google.com', pycares.QUERY_TYPE_A, cb) self.channel.query('google.com', pycares.QUERY_TYPE_A, cb) self.wait() self.assertEqual(self.count, 3) self.assertEqual(self.errorno_count, 0) def test_query_aaaa(self): self.result, self.errorno = None, None def cb(result, errorno): self.result, self.errorno = result, errorno self.channel.query('ipv6.google.com', pycares.QUERY_TYPE_AAAA, cb) self.wait() self.assertNoError(self.errorno) for r in self.result: self.assertEqual(type(r), pycares.ares_query_aaaa_result) self.assertNotEqual(r.host, None) def test_query_caa(self): self.result, self.errorno = None, None def cb(result, errorno): self.result, self.errorno = result, errorno self.channel.query('wikipedia.org', pycares.QUERY_TYPE_CAA, cb) self.wait() self.assertNoError(self.errorno) self.assertTrue(len(self.result) > 0) for r in self.result: self.assertEqual(type(r), pycares.ares_query_caa_result) def test_query_cname(self): self.result, self.errorno = None, None def cb(result, errorno): self.result, self.errorno = result, errorno self.channel.query('www.amazon.com', pycares.QUERY_TYPE_CNAME, cb) self.wait() self.assertNoError(self.errorno) self.assertEqual(type(self.result), pycares.ares_query_cname_result) def test_query_mx(self): self.result, self.errorno = None, None def cb(result, errorno): self.result, self.errorno = result, errorno self.channel.query('google.com', pycares.QUERY_TYPE_MX, cb) self.wait() self.assertNoError(self.errorno) for r in self.result: self.assertEqual(type(r), pycares.ares_query_mx_result) def test_query_ns(self): self.result, self.errorno = None, None def cb(result, errorno): self.result, self.errorno = result, errorno self.channel.query('google.com', pycares.QUERY_TYPE_NS, cb) self.wait() self.assertNoError(self.errorno) for r in self.result: self.assertEqual(type(r), pycares.ares_query_ns_result) def test_query_txt(self): self.result, self.errorno = None, None def cb(result, errorno): self.result, self.errorno = result, errorno self.channel.query('google.com', pycares.QUERY_TYPE_TXT, cb) self.wait() self.assertNoError(self.errorno) for r in self.result: self.assertEqual(type(r), pycares.ares_query_txt_result) def test_query_txt_chunked(self): self.result, self.errorno = None, None def cb(result, errorno): self.result, self.errorno = result, errorno self.channel.query('jobscoutdaily.com', pycares.QUERY_TYPE_TXT, cb) self.wait() self.assertNoError(self.errorno) # If the chunks are aggregated, only one TXT record should be visible. Three would show if they are not properly merged. # jobscoutdaily.com. 21600 IN TXT "v=spf1 " "include:emailcampaigns.net include:spf.dynect.net include:ccsend.com include:_spf.elasticemail.com ip4:67.200.116.86 ip4:67.200.116.90 ip4:67.200.116.97 ip4:67.200.116.111 ip4:74.199.198.2 " " ~all" self.assertEqual(len(self.result), 1) self.assertEqual(self.result[0].text, 'v=spf1 include:emailcampaigns.net include:spf.dynect.net include:ccsend.com include:_spf.elasticemail.com ip4:67.200.116.86 ip4:67.200.116.90 ip4:67.200.116.97 ip4:67.200.116.111 ip4:74.199.198.2 ~all') def test_query_txt_multiple_chunked(self): self.result, self.errorno = None, None def cb(result, errorno): self.result, self.errorno = result, errorno self.channel.query('google.com', pycares.QUERY_TYPE_TXT, cb) self.wait() self.assertNoError(self.errorno) # > dig -t txt google.com # google.com. 3593 IN TXT "docusign=05958488-4752-4ef2-95eb-aa7ba8a3bd0e" # google.com. 3593 IN TXT "globalsign-smime-dv=CDYX+XFHUw2wml6/Gb8+59BsH31KzUr6c1l2BPvqKX8=" # google.com. 3593 IN TXT "facebook-domain-verification=22rm551cu4k0ab0bxsw536tlds4h95" # google.com. 3593 IN TXT "docusign=1b0a6754-49b1-4db5-8540-d2c12664b289" # google.com. 3593 IN TXT "MS=E4A68B9AB2BB9670BCE15412F62916164C0B20BB" # google.com. 3593 IN TXT "v=spf1 include:_spf.google.com ~all" # google.com. 3593 IN TXT "google-site-verification=wD8N7i1JTNTkezJ49swvWW48f8_9xveREV4oB-0Hf5o" # google.com. 3593 IN TXT "apple-domain-verification=30afIBcvSuDV2PLX" # google.com. 3593 IN TXT "google-site-verification=TV9-DBe4R80X4v0M4U_bd_J9cpOJM0nikft0jAgjmsQ" self.assertEqual(len(self.result), 9) def test_query_txt_bytes1(self): self.result, self.errorno = None, None def cb(result, errorno): self.result, self.errorno = result, errorno self.channel.query('google.com', pycares.QUERY_TYPE_TXT, cb) self.wait() self.assertNoError(self.errorno) for r in self.result: self.assertEqual(type(r), pycares.ares_query_txt_result) self.assertIsInstance(r.text, str) # it's ASCII def test_query_txt_bytes2(self): self.result, self.errorno = None, None def cb(result, errorno): self.result, self.errorno = result, errorno self.channel.query('wide.com.es', pycares.QUERY_TYPE_TXT, cb) self.wait() self.assertNoError(self.errorno) for r in self.result: self.assertEqual(type(r), pycares.ares_query_txt_result) self.assertIsInstance(r.text, bytes) def test_query_txt_multiple_chunked_with_non_ascii_content(self): self.result, self.errorno = None, None def cb(result, errorno): self.result, self.errorno = result, errorno self.channel.query('txt-non-ascii.dns-test.hmnid.ru', pycares.QUERY_TYPE_TXT, cb) self.wait() self.assertNoError(self.errorno) # txt-non-ascii.dns-test.hmnid.ru. IN TXT "ascii string" "some\208misc\208stuff" self.assertEqual(len(self.result), 1) r = self.result[0] self.assertEqual(type(r), pycares.ares_query_txt_result) self.assertIsInstance(r.text, bytes) def test_query_class_chaos(self): self.result, self.errorno = None, None def cb(result, errorno): self.result, self.errorno = result, errorno self.channel.servers = ['199.7.83.42'] # l.root-servers.net self.channel.query('id.server', pycares.QUERY_TYPE_TXT, cb, pycares.QUERY_CLASS_CHAOS) self.wait() self.assertNoError(self.errorno) # id.server. 0 CH TXT "aa.de-ham.l.root" self.assertEqual(len(self.result), 1) r = self.result[0] self.assertEqual(type(r), pycares.ares_query_txt_result) self.assertIsInstance(r.text, str) def test_query_class_invalid(self): self.assertRaises(ValueError, self.channel.query, 'google.com', pycares.QUERY_TYPE_A, lambda *x: None, "INVALIDTYPE") self.wait() def test_query_soa(self): self.result, self.errorno = None, None def cb(result, errorno): self.result, self.errorno = result, errorno self.channel.query('google.com', pycares.QUERY_TYPE_SOA, cb) self.wait() self.assertNoError(self.errorno) self.assertEqual(type(self.result), pycares.ares_query_soa_result) def test_query_srv(self): self.result, self.errorno = None, None def cb(result, errorno): self.result, self.errorno = result, errorno self.channel.query('_xmpp-server._tcp.google.com', pycares.QUERY_TYPE_SRV, cb) self.wait() self.assertNoError(self.errorno) for r in self.result: self.assertEqual(type(r), pycares.ares_query_srv_result) def test_query_naptr(self): self.result, self.errorno = None, None def cb(result, errorno): self.result, self.errorno = result, errorno self.channel.query('sip2sip.info', pycares.QUERY_TYPE_NAPTR, cb) self.wait() self.assertNoError(self.errorno) for r in self.result: self.assertEqual(type(r), pycares.ares_query_naptr_result) def test_query_ptr(self): self.result, self.errorno = None, None def cb(result, errorno): self.result, self.errorno = result, errorno ip = '8.8.8.8' self.channel.query(ipaddress.ip_address(ip).reverse_pointer, pycares.QUERY_TYPE_PTR, cb) self.wait() self.assertNoError(self.errorno) self.assertEqual(type(self.result), pycares.ares_query_ptr_result) self.assertEqual(type(self.result.aliases), list) def test_query_ptr_ipv6(self): self.result, self.errorno = None, None def cb(result, errorno): self.result, self.errorno = result, errorno ip = '2001:4860:4860::8888' self.channel.query(ipaddress.ip_address(ip).reverse_pointer, pycares.QUERY_TYPE_PTR, cb) self.wait() self.assertNoError(self.errorno) self.assertEqual(type(self.result), pycares.ares_query_ptr_result) self.assertEqual(type(self.result.aliases), list) @unittest.skip("ANY type does not work on Mac.") def test_query_any(self): self.result, self.errorno = None, None def cb(result, errorno): self.result, self.errorno = result, errorno self.channel.query('google.com', pycares.QUERY_TYPE_ANY, cb) self.wait() self.assertNoError(self.errorno) self.assertTrue(len(self.result) > 1) def test_query_cancelled(self): self.result, self.errorno = None, None def cb(result, errorno): self.result, self.errorno = result, errorno self.channel.query('google.com', pycares.QUERY_TYPE_NS, cb) self.channel.cancel() self.wait() self.assertEqual(self.result, None) self.assertEqual(self.errorno, pycares.errno.ARES_ECANCELLED) def test_query_bad_type(self): self.assertRaises(ValueError, self.channel.query, 'google.com', 667, lambda *x: None) self.wait() def test_query_timeout(self): self.result, self.errorno = None, None def cb(result, errorno): self.result, self.errorno = result, errorno self.channel.servers = ['1.2.3.4'] self.channel.query('google.com', pycares.QUERY_TYPE_A, cb) self.wait() self.assertEqual(self.result, None) self.assertEqual(self.errorno, pycares.errno.ARES_ETIMEOUT) def test_query_onion(self): self.result, self.errorno = None, None def cb(result, errorno): self.result, self.errorno = result, errorno self.channel.query('foo.onion', pycares.QUERY_TYPE_A, cb) self.wait() self.assertEqual(self.result, None) self.assertEqual(self.errorno, pycares.errno.ARES_ENOTFOUND) def test_channel_nameservers(self): self.result, self.errorno = None, None def cb(result, errorno): self.result, self.errorno = result, errorno self.channel = pycares.Channel(timeout=5.0, tries=1, servers=['8.8.8.8']) self.channel.query('google.com', pycares.QUERY_TYPE_A, cb) self.wait() self.assertNoError(self.errorno) def test_channel_nameservers2(self): self.result, self.errorno = None, None def cb(result, errorno): self.result, self.errorno = result, errorno self.channel.servers = ['8.8.8.8'] self.channel.query('google.com', pycares.QUERY_TYPE_A, cb) self.wait() self.assertNoError(self.errorno) def test_channel_nameservers3(self): servers = ['8.8.8.8', '8.8.4.4'] self.channel.servers = servers servers2 = self.channel.servers self.assertEqual(servers, servers2) def test_channel_local_ip(self): self.result, self.errorno = None, None def cb(result, errorno): self.result, self.errorno = result, errorno self.channel = pycares.Channel(timeout=5.0, tries=1, servers=['8.8.8.8'], local_ip='127.0.0.1') self.channel.query('google.com', pycares.QUERY_TYPE_A, cb) self.wait() self.assertEqual(self.result, None) self.assertEqual(self.errorno, pycares.errno.ARES_ECONNREFUSED) def test_channel_local_ip2(self): self.result, self.errorno = None, None def cb(result, errorno): self.result, self.errorno = result, errorno self.channel.servers = ['8.8.8.8'] self.channel.set_local_ip('127.0.0.1') self.channel.query('google.com', pycares.QUERY_TYPE_A, cb) self.wait() self.assertEqual(self.result, None) self.assertEqual(self.errorno, pycares.errno.ARES_ECONNREFUSED) self.assertRaises(ValueError, self.channel.set_local_ip, 'an invalid ip') def test_channel_timeout(self): self.result, self.errorno = None, None def cb(result, errorno): self.result, self.errorno = result, errorno self.channel = pycares.Channel(timeout=0.5, tries=1) self.channel.gethostbyname('google.com', socket.AF_INET, cb) timeout = self.channel.timeout() self.assertTrue(timeout > 0.0) self.channel.cancel() self.wait() self.assertEqual(self.result, None) self.assertEqual(self.errorno, pycares.errno.ARES_ECANCELLED) def test_import_errno(self): from pycares.errno import ARES_SUCCESS self.assertTrue(True) # FIXME @unittest.skip("The site used for this test no longer returns a non-ascii SOA.") def test_result_not_ascii(self): self.result, self.errorno = None, None def cb(result, errorno): self.result, self.errorno = result, errorno self.channel.query('ayesas.com', pycares.QUERY_TYPE_SOA, cb) self.wait() self.assertNoError(self.errorno) self.assertEqual(type(self.result), pycares.ares_query_soa_result) self.assertIsInstance(self.result.hostmaster, bytes) # it's not ASCII def test_idna_encoding(self): host = 'españa.icom.museum' self.result, self.errorno = None, None def cb(result, errorno): self.result, self.errorno = result, errorno # try encoding it as utf-8 self.channel.gethostbyname(host.encode(), socket.AF_INET, cb) self.wait() self.assertNotEqual(self.errorno, None) self.assertEqual(self.result, None) # use it as is (it's IDNA encoded internally) self.channel.gethostbyname(host, socket.AF_INET, cb) self.wait() self.assertNoError(self.errorno) self.assertEqual(type(self.result), pycares.ares_host_result) def test_idna_encoding_query_a(self): host = 'españa.icom.museum' self.result, self.errorno = None, None def cb(result, errorno): self.result, self.errorno = result, errorno # try encoding it as utf-8 self.channel.query(host.encode(), pycares.QUERY_TYPE_A, cb) self.wait() self.assertEqual(self.errorno, pycares.errno.ARES_ENOTFOUND) self.assertEqual(self.result, None) # use it as is (it's IDNA encoded internally) self.channel.query(host, pycares.QUERY_TYPE_A, cb) self.wait() self.assertNoError(self.errorno) for r in self.result: self.assertEqual(type(r), pycares.ares_query_a_result) self.assertNotEqual(r.host, None) def test_idna2008_encoding(self): try: import idna except ImportError: raise unittest.SkipTest('idna module not installed') host = 'straße.de' self.result, self.errorno = None, None def cb(result, errorno): self.result, self.errorno = result, errorno self.channel.gethostbyname(host, socket.AF_INET, cb) self.wait() self.assertNoError(self.errorno) self.assertEqual(type(self.result), pycares.ares_host_result) self.assertTrue('81.169.145.78' in self.result.addresses) @unittest.skipIf(sys.platform == 'win32', 'skipped on Windows') def test_custom_resolvconf(self): self.result, self.errorno = None, None def cb(result, errorno): self.result, self.errorno = result, errorno self.channel = pycares.Channel(tries=1, timeout=2.0, resolvconf_path=os.path.join(FIXTURES_PATH, 'badresolv.conf')) self.channel.query('google.com', pycares.QUERY_TYPE_A, cb) self.wait() self.assertEqual(self.result, None) self.assertEqual(self.errorno, pycares.errno.ARES_ETIMEOUT) def test_errorcode_dict(self): for err in ('ARES_SUCCESS', 'ARES_ENODATA', 'ARES_ECANCELLED'): val = getattr(pycares.errno, err) self.assertEqual(pycares.errno.errorcode[val], err) def test_search(self): self.result, self.errorno = None, None def cb(result, errorno): self.result, self.errorno = result, errorno self.channel = pycares.Channel(timeout=5.0, tries=1, domains=['google.com']) self.channel.search('cloud', pycares.QUERY_TYPE_A, cb) self.wait() self.assertNoError(self.errorno) for r in self.result: self.assertEqual(type(r), pycares.ares_query_a_result) self.assertNotEqual(r.host, None) def test_lookup(self): channel = pycares.Channel( lookups="b", timeout=1, tries=1, socket_receive_buffer_size=4096, servers=["8.8.8.8", "8.8.4.4"], tcp_port=53, udp_port=53, rotate=True, ) def on_result(result, errorno): self.result, self.errorno = result, errorno for domain in [ "google.com", "microsoft.com", "apple.com", "amazon.com", "baidu.com", "alipay.com", "tencent.com", ]: self.result, self.errorno = None, None self.channel.query(domain, pycares.QUERY_TYPE_A, on_result) self.wait() self.assertNoError(self.errorno) self.assertTrue(self.result is not None and len(self.result) > 0) for r in self.result: self.assertEqual(type(r), pycares.ares_query_a_result) self.assertNotEqual(r.host, None) self.assertTrue(r.type == 'A') def test_strerror_str(self): for key in pycares.errno.errorcode: self.assertTrue(type(pycares.errno.strerror(key)), str) if __name__ == '__main__': unittest.main(verbosity=2) pycares-pycares-4.1.2/tox.ini000066400000000000000000000002161413330527400161440ustar00rootroot00000000000000[tox] envlist = py36, py37, py38, py39, py310 [testenv] commands = python tests/tests.py [testenv:idna] extras = idna basepython = python3