├── .github ├── dependabot.yml └── workflows │ ├── build-wheels.yml │ ├── release-wheels.yml │ ├── run-cibuildwheel.yml │ ├── run-sdist.yml │ └── test.yml ├── .gitignore ├── .gitmodules ├── .readthedocs.yaml ├── ChangeLog ├── LICENSE ├── MANIFEST.in ├── PYPIREADME.rst ├── README.rst ├── deps └── build-config │ ├── config_android │ └── ares_config.h │ ├── config_cygwin │ └── ares_config.h │ ├── config_darwin │ └── ares_config.h │ ├── config_freebsd │ └── ares_config.h │ ├── config_linux │ └── ares_config.h │ ├── config_netbsd │ └── ares_config.h │ ├── config_openbsd │ └── ares_config.h │ ├── config_sunos │ └── ares_config.h │ └── include │ ├── ares_build.h │ └── ares_nameser.h ├── docs ├── Makefile ├── channel.rst ├── conf.py ├── constants.rst ├── errno.rst ├── event_loops.rst ├── index.rst ├── make.bat ├── pycares.rst └── requirements.txt ├── examples ├── cares-asyncio.py ├── cares-poll.py ├── cares-resolver.py ├── cares-select.py └── cares-selectors.py ├── pyproject.toml ├── setup.py ├── setup_cares.py ├── src ├── _cffi_src │ └── build_cares.py └── pycares │ ├── __init__.py │ ├── __main__.py │ ├── _version.py │ ├── errno.py │ ├── py.typed │ └── utils.py └── tests ├── __init__.py ├── fixtures └── badresolv.conf └── test_all.py /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: pip 4 | directory: "/" 5 | schedule: 6 | interval: daily 7 | 8 | - package-ecosystem: "github-actions" 9 | directory: "/" 10 | schedule: 11 | interval: "monthly" 12 | -------------------------------------------------------------------------------- /.github/workflows/build-wheels.yml: -------------------------------------------------------------------------------- 1 | name: Build Wheels 2 | 3 | on: [pull_request] 4 | 5 | concurrency: 6 | group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} 7 | cancel-in-progress: true 8 | 9 | jobs: 10 | build_wheels: 11 | uses: ./.github/workflows/run-cibuildwheel.yml 12 | with: 13 | prerelease-pythons: true 14 | 15 | build_sdist: 16 | uses: ./.github/workflows/run-sdist.yml 17 | 18 | check_build: 19 | needs: [build_wheels, build_sdist] 20 | runs-on: ubuntu-latest 21 | steps: 22 | - uses: actions/download-artifact@v4 23 | with: 24 | path: dist 25 | merge-multiple: true 26 | - run: ls -lR dist 27 | -------------------------------------------------------------------------------- /.github/workflows/release-wheels.yml: -------------------------------------------------------------------------------- 1 | name: Release Wheels 2 | 3 | on: 4 | release: 5 | types: 6 | - published 7 | 8 | jobs: 9 | build_wheels: 10 | uses: ./.github/workflows/run-cibuildwheel.yml 11 | with: 12 | fail-fast: true 13 | 14 | build_sdist: 15 | uses: ./.github/workflows/run-sdist.yml 16 | 17 | upload_pypi: 18 | needs: [build_wheels, build_sdist] 19 | if: github.event_name == 'release' && github.event.action == 'published' 20 | runs-on: ubuntu-latest 21 | steps: 22 | - uses: actions/download-artifact@v4 23 | with: 24 | path: dist 25 | merge-multiple: true 26 | - run: ls -lR dist 27 | - name: Upload to PyPI 28 | uses: pypa/gh-action-pypi-publish@release/v1 29 | with: 30 | user: __token__ 31 | password: ${{ secrets.pypi_password }} 32 | -------------------------------------------------------------------------------- /.github/workflows/run-cibuildwheel.yml: -------------------------------------------------------------------------------- 1 | on: 2 | workflow_call: 3 | inputs: 4 | fail-fast: 5 | description: Whether the wheel build should stop and fail as soon as any job fails. 6 | required: false 7 | default: false 8 | type: boolean 9 | prerelease-pythons: 10 | description: Whether the wheels should be built for pre-release Pythons that are not ABI stable yet. 11 | required: false 12 | default: false 13 | type: boolean 14 | 15 | jobs: 16 | build_wheels: 17 | name: Build wheels for ${{ matrix.name }} 18 | runs-on: ${{ matrix.os }} 19 | strategy: 20 | fail-fast: ${{ inputs.fail-fast }} 21 | matrix: 22 | include: 23 | - name: Windows 24 | os: windows-latest 25 | - name: macOS x86_64 26 | os: macos-13 27 | - name: macOS arm64 28 | os: macos-latest 29 | - name: Linux 30 | os: ubuntu-latest 31 | steps: 32 | - uses: actions/checkout@v4 33 | with: 34 | submodules: true 35 | - name: Set up QEMU 36 | if: runner.os == 'Linux' 37 | uses: docker/setup-qemu-action@v3 38 | with: 39 | platforms: all 40 | - name: Enable CPython prerelease 41 | if: ${{ inputs.prerelease-pythons }} 42 | run: echo "CIBW_ENABLE=cpython-prerelease" >> $GITHUB_ENV 43 | - name: Build wheels 44 | uses: pypa/cibuildwheel@v2.23.3 45 | with: 46 | output-dir: dist 47 | - uses: actions/upload-artifact@v4 48 | with: 49 | name: wheels-${{ matrix.os }} 50 | path: dist/*.whl 51 | -------------------------------------------------------------------------------- /.github/workflows/run-sdist.yml: -------------------------------------------------------------------------------- 1 | on: 2 | workflow_call: 3 | 4 | jobs: 5 | build_sdist: 6 | name: Build source distribution 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: actions/checkout@v4 10 | with: 11 | submodules: true 12 | - uses: actions/setup-python@v5 13 | name: Install Python 14 | with: 15 | check-latest: true 16 | python-version: '3.13' 17 | - name: Install setuptools 18 | run: python -m pip install -U setuptools 19 | - name: Build sdist 20 | run: python setup.py sdist 21 | - uses: actions/upload-artifact@v4 22 | with: 23 | name: sdist 24 | path: dist/*.tar.gz 25 | -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: Test 2 | 3 | on: [pull_request] 4 | 5 | concurrency: 6 | group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} 7 | cancel-in-progress: true 8 | 9 | jobs: 10 | build: 11 | name: Test on ${{ matrix.os }} / Python ${{ matrix.python-version }} 12 | runs-on: ${{ matrix.os }} 13 | strategy: 14 | fail-fast: false 15 | matrix: 16 | os: [ubuntu-latest, windows-latest, macos-13, macos-latest] 17 | python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] 18 | steps: 19 | - uses: actions/checkout@v4 20 | with: 21 | submodules: true 22 | - name: Setup Python 23 | uses: actions/setup-python@v5 24 | with: 25 | check-latest: true 26 | python-version: ${{ matrix.python-version }} 27 | - name: Install dependencies 28 | run: python -m pip install -U setuptools wheel 29 | - name: Build package 30 | run: python -m pip install . 31 | - name: Run tests 32 | run: python -m unittest -v 33 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | #python specific 2 | *.pyc 3 | *.pyd 4 | *.so 5 | build/* 6 | dist/* 7 | MANIFEST 8 | __pycache__/ 9 | *.eggs/ 10 | *.egg-info/ 11 | 12 | ## generic files to ignore 13 | *~ 14 | *.lock 15 | *.DS_Store 16 | *.swp 17 | *.out 18 | *.o 19 | *.a 20 | 21 | .tox/ 22 | docs/_build/ 23 | .venv/ 24 | venv/ 25 | wheelhouse/ 26 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "deps/c-ares"] 2 | path = deps/c-ares 3 | url = https://github.com/c-ares/c-ares.git 4 | -------------------------------------------------------------------------------- /.readthedocs.yaml: -------------------------------------------------------------------------------- 1 | version: 2 2 | 3 | sphinx: 4 | builder: html 5 | configuration: docs/conf.py 6 | fail_on_warning: false 7 | 8 | build: 9 | os: "ubuntu-22.04" 10 | tools: 11 | python: "3.11" 12 | 13 | python: 14 | install: 15 | - requirements: docs/requirements.txt 16 | 17 | -------------------------------------------------------------------------------- /ChangeLog: -------------------------------------------------------------------------------- 1 | No longer updated. Please check the commits. 2 | 3 | 4 | Version 4.0.0 5 | ============= 6 | - doc: uppdate README 7 | - core: add support for CAA queries 8 | - core: add support for getaddrinfo() 9 | - doc: update README 10 | - core: add ability to use the system installed c-ares 11 | - misc: set version to 4.0.0 12 | - test: remove TTL tests 13 | - core: update c-ares and use a submodule 14 | - core: drop bundled c-ares version 15 | - misc: drop tasks.py 16 | 17 | Version 3.2.0 18 | ============= 19 | - misc: add Python 3.9 classifier 20 | - core: drop py3.5 from CI and documentation 21 | - ci: run tests in Python 3.9 22 | - ci: fix SDK path in appveyor 23 | - ci: fix VS linker in appveyor 24 | - ci: update python installer script in appveyor 25 | - misc: add compiled windows dll to gitignore 26 | - test: skip SOA non-ascii test due to changes in remote host 27 | - test: fix broken chunked TXT test due to changes in remote host 28 | - test: skip ANY test due to problems with mac 29 | - ci: add action to release wheels to PyPi 30 | - ci: drop AppVeyor 31 | - ci: don't fail fast 32 | - ci: stop testing on Travis 33 | - test: add generic way to check for a CI 34 | - test: relax check 35 | - test: try to avoid spurious CI failures 36 | - ci: test all platforms on GH actions 37 | - ci: build wheels on GH Actions 38 | - build: fix build error on macOS 39 | - ci: explicitly set Python versions to build wheels for 40 | - ci: update cibuildwheel 41 | - ci: re-add IDNA test 42 | 43 | Version 3.1.1 44 | ============= 45 | - ffi: new style callbacks 46 | 47 | Version 3.1.0 48 | ============= 49 | - misc: add Python 3.8 classifier 50 | - (origin/master, origin/HEAD) build: use Travis to build Python Wheels 51 | - ci: use GH Actions to test on macOS 52 | - ci: run tests in Python 3.8 too 53 | - test: remove no longer valid test 54 | - test: remove empty test 55 | - errno: return str from errno.strerror 56 | - core: fix crash when processing .onion queries 57 | - test: fix test_query_txt_multiple_chunked 58 | - doc: fix path of _version.py file 59 | - core: fix support for ARES_OPT_LOOKUPS option 60 | - build: add cygwin support 61 | - core: fix struct in6_addr alignment 62 | - misc: simplify non-ascii txt test example 63 | - core: fix long TXT record with non-ascii bytes 64 | - build: remove extra add_include_dir line on linux 65 | - build: fix testing manylinux wheels 66 | 67 | Version 3.0.0 68 | ============= 69 | (changes since version 2.x) 70 | - core: drop C backend in favor of CFFI 71 | - core: drop Python < 3.5 support 72 | - core: use None instead of -1 for default values 73 | - core: add support for ANY queries 74 | - core: automagically encode query names with IDNA 75 | - core: add support for ares_search 76 | 77 | Version 3.0.0b5 78 | =============== 79 | - core: add support for ares_search 80 | 81 | Version 3.0.0b4 82 | =============== 83 | - core: give better errors descriptions for AresError 84 | - test: add IDNA test using the query() API 85 | - cffi: simplify destroying ares channel 86 | 87 | Version 3.0.0b3 88 | =============== 89 | - core: reorganize package 90 | - core: automagically encode query names with IDNA 91 | 92 | Version 3.0.0b2 93 | =============== 94 | - errno: fix errorcode dictionary 95 | 96 | Version 3.0.0b1 97 | =============== 98 | - core: add support for ANY queries 99 | - cffi: fix memory leak 100 | 101 | Version 3.0.0b0 102 | =============== 103 | - core: drop C backend 104 | - core: drop Python < 3.5 support 105 | - core: use None instead of -1 for default values 106 | - core: set TTL to -1 when we cannot parse it 107 | 108 | Version 2.4.0 109 | ============= 110 | - misc: fix building wheels for unavailable Python versions 111 | - test: skip getaddrinfo6 test on Travis 112 | - doc: add FreeBSD building instructions 113 | - build: fix MinGW build 114 | - ci, misc: add support for CPython 3.7 115 | - ci: run on latest PyPy versions on TravisCI 116 | - examples: extra examples 117 | - ci: fix AppVeyor build 118 | - test: fix TXT test 119 | - core: fix repr for PTR results 120 | 121 | Version 2.3.0 122 | ============= 123 | - core: fix CPython implementation TTL parsing issue 124 | - core: add ability to make queries using the command line 125 | - core: fix parsing TXT records with invalid UTF-8 chars 126 | - deps: removed unneeded c-ares files 127 | - core: update bundled c-ares to 1.13.0 128 | - ci: fix PyPy in Travis 129 | 130 | Version 2.2.0 131 | ============= 132 | - test: fix CNAME test 133 | - core: parse TTL in PTR replies 134 | - core: parse PTR aliases 135 | - doc: fix installation instructions in README 136 | - doc: fix Channel.set_local_ip documentation 137 | - core: accept local_ip and local_dev as kwargs 138 | - ci, misc: add support for CPython 3.6 139 | - ci: only run CI on master 140 | - ci: disable some Travis notifications 141 | - build: add scripts to build manylinux wheels 142 | 143 | Version 2.1.1 144 | ============= 145 | - cffi: fix setting nameserver in Channel.__init__ 146 | - doc: update Sphinx configuration so the docs can be built 147 | - core: backport fix for CVE-2016-5180 148 | - cffi: fix structure definition 149 | - ci: use PyPy 5.4.1 when testing on Travis 150 | 151 | Version 2.1.0 152 | ============= 153 | - core: fix parsing chunked TXT records 154 | 155 | Version 2.0.1 156 | ============= 157 | - core: fix importing from errno submodule 158 | 159 | Version 2.0.0 160 | ============= 161 | - doc: fix rst syntax in README 162 | - sample: fix correctly setting events mask 163 | - setup.py: mark as executable and add shebang 164 | - tests.py: assertions moved out of cb so C code cannot discard 165 | - tests.py: test reverse_address on IPv6 also 166 | - tests.py: ensure all query results have proper and bound type 167 | - pycares.c: register result struct-sequences in pycares namespace 168 | - ci: run tests with PyPy as well 169 | - ci: run tests on CPython 3.5 on Travis 170 | - test: moved test file to tests/tests.py 171 | - test: add Python 3.5 to tox.ini 172 | - ci: use PyPy 5 in Travis CI 173 | - build: refactor building bundled c-ares 174 | - ci: add Python 3.5 to AppVeyor 175 | - core: reorganize package 176 | - core: add CFFI core implementation 177 | - cffi: fix OSX support 178 | - cffi: fixup FreeBSD support 179 | - doc: MinGW support got axed 180 | - doc: update supported Python versions 181 | - core: update bundled c-ares to 9642b57 182 | 183 | Version 1.0.0 184 | ============= 185 | - build: fix build on Windows with Python 186 | - channel: return TTL information 187 | - channel:don't unnecessarily create a list for CNAME results 188 | - core: use inet_pton instead of inet_addr 189 | - channel: simplify PTR response handling 190 | - channel: make al queries return namedtuple-like objects 191 | - build: use setuptools 192 | - ci: add appveyor integration 193 | - build: enable verbose output when building c-ares 194 | - build: fix 64-bit build on Windows 195 | - build: drop support for older Python versions 196 | - doc: update documentation 197 | 198 | Version 0.7.0 199 | ============= 200 | - setup: Fix decoding in non-UTF-8 environments 201 | - build: updated Travis build process 202 | - Add rotate option 203 | - Update documentation 204 | 205 | Version 0.6.3 206 | ============= 207 | - Fix crash if ares_timeout returns NULL 208 | - Fix initializing channel with float timeouts < 1 209 | 210 | Version 0.6.2 211 | ============= 212 | - Fix crash due to a refcount bug 213 | 214 | Version 0.6.1 215 | ============= 216 | - Raise ValueError if query type is not valid 217 | - Re-enabled CNAME test 218 | - Fixed importing from errno submodule in Python 3 219 | 220 | Version 0.6.0 221 | ============= 222 | - Added asyncio integration example 223 | - Added event loop integration documantation 224 | - Mention Python 3.4 support 225 | - Fixed setup_cares.py to properly work with Python 3 226 | - Fix build on BSD systems 227 | 228 | Version 0.5.0 229 | ============= 230 | - Updated to c-ares 1.10.0 231 | 232 | Version 0.4.0 233 | ============= 234 | - Added support for compiling with Microsoft Visual Studio 235 | - Added socket_send_buffer_size, socket_receive_buffer_size, 236 | lookups and domains init options 237 | - Unified set_local_ip* functions 238 | 239 | Version 0.3.0 240 | ============= 241 | - Simplified gethostbyaddr interface 242 | - Added reverse_address method 243 | - Added PTR query support 244 | - Fixed pyuv resolver example 245 | 246 | Version 0.2.0 247 | ============= 248 | - Fixed checking port number boundaries 249 | - Refactored unicode support 250 | - Encode given hostnames with idna encoding 251 | for gethostbyname and query 252 | 253 | Version 0.1.0 254 | ============= 255 | - Initial release 256 | 257 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2012 by Saúl Ibarra Corretgé 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | 21 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include README.rst PYPIREADME.rst LICENSE ChangeLog 2 | include setup.py setup_cares.py tox.ini 3 | graft docs 4 | graft examples 5 | graft tests 6 | graft deps 7 | graft src 8 | recursive-exclude * __pycache__ 9 | recursive-exclude * *.py[co] 10 | recursive-exclude * *.[ao] 11 | recursive-exclude * *.so 12 | prune docs/_build 13 | -------------------------------------------------------------------------------- /PYPIREADME.rst: -------------------------------------------------------------------------------- 1 | Looking for new maintainers 2 | =========================== 3 | 4 | https://github.com/saghul/pycares/issues/139 5 | 6 | pycares: Python interface for c-ares 7 | ==================================== 8 | 9 | pycares is a Python module which provides an interface to c-ares. 10 | `c-ares `_ is a C library that performs 11 | DNS requests and name resolutions asynchronously. 12 | 13 | 14 | Documentation 15 | ------------- 16 | 17 | http://readthedocs.org/docs/pycares/ 18 | 19 | 20 | Bundled c-ares 21 | -------------- 22 | 23 | pycares currently bundles c-ares as a submodule for ease of building. Using the system 24 | provided c-ares is possible if the ``PYCARES_USE_SYSTEM_LIB`` environment variable is 25 | set to ``1`` when building. 26 | 27 | NOTE: Versions prior to 4.0.0 used to embed a modified c-ares with extended TTL support. 28 | That is no longer the case and as a result only A and AAAA records will have TTL information. 29 | Follow this PR in uppstream c-ares, looks like TTLs will be added: https://github.com/c-ares/c-ares/pull/393 30 | 31 | 32 | Installation 33 | ------------ 34 | 35 | GNU/Linux, macOS, Windows, others: 36 | 37 | :: 38 | 39 | pip install pycares 40 | 41 | FreeBSD: 42 | 43 | :: 44 | 45 | cd /usr/ports/dns/py-pycares && make install 46 | 47 | 48 | IDNA 2008 support 49 | ^^^^^^^^^^^^^^^^^ 50 | 51 | If the ``idna`` package is installed, pycares will support IDNA 2008 encoding otherwise the builtin idna codec will be used, 52 | which provides IDNA 2003 support. 53 | 54 | You can force this at installation time as follows: 55 | 56 | :: 57 | 58 | pip install pycares[idna] 59 | 60 | 61 | Running the test suite 62 | ---------------------- 63 | 64 | From the top level directory, run: ``python -m unittest -v`` 65 | 66 | NOTE: Running the tests requires internet access and are somewhat environment sensitive because real DNS quesries 67 | are made, there is no mocking. If you observe a failure that the CI cannot reproduce, please try to setup an 68 | environment as close as the current CI. 69 | 70 | 71 | Using it from the cli, a la dig 72 | ------------------------------- 73 | 74 | This module can be used directly from the command line in a similar fashion to dig (limited, of course): 75 | 76 | :: 77 | 78 | $ python -m pycares google.com 79 | ;; QUESTION SECTION: 80 | ;google.com IN A 81 | 82 | ;; ANSWER SECTION: 83 | google.com 300 IN A 172.217.17.142 84 | 85 | $ python -m pycares mx google.com 86 | ;; QUESTION SECTION: 87 | ;google.com IN MX 88 | 89 | ;; ANSWER SECTION: 90 | google.com 600 IN MX 50 alt4.aspmx.l.google.com 91 | google.com 600 IN MX 10 aspmx.l.google.com 92 | google.com 600 IN MX 40 alt3.aspmx.l.google.com 93 | google.com 600 IN MX 20 alt1.aspmx.l.google.com 94 | google.com 600 IN MX 30 alt2.aspmx.l.google.com 95 | 96 | 97 | Author 98 | ------ 99 | 100 | Saúl Ibarra Corretgé 101 | 102 | 103 | License 104 | ------- 105 | 106 | Unless stated otherwise on-file pycares uses the MIT license, check LICENSE file. 107 | 108 | 109 | Supported Python versions 110 | ------------------------- 111 | 112 | Python >= 3.9 are supported. Both CPython and PyPy are supported. 113 | 114 | 115 | Contributing 116 | ------------ 117 | 118 | If you'd like to contribute, fork the project, make a patch and send a pull 119 | request. Have a look at the surrounding code and please, make yours look 120 | alike :-) 121 | -------------------------------------------------------------------------------- /README.rst: -------------------------------------------------------------------------------- 1 | pycares: Python interface for c-ares 2 | ==================================== 3 | 4 | .. image:: https://badge.fury.io/py/pycares.png 5 | :target: https://pypi.org/project/pycares/ 6 | 7 | .. image:: https://github.com/saghul/pycares/workflows/Test/badge.svg 8 | :target: https://github.com/saghul/pycares/actions 9 | 10 | pycares is a Python module which provides an interface to c-ares. 11 | `c-ares `_ is a C library that performs 12 | DNS requests and name resolutions asynchronously. 13 | 14 | 15 | Documentation 16 | ------------- 17 | 18 | https://pycares.readthedocs.io/latest/ 19 | 20 | 21 | Bundled c-ares 22 | -------------- 23 | 24 | pycares currently bundles c-ares as a submodule for ease of building. Using the system 25 | provided c-ares is possible if the ``PYCARES_USE_SYSTEM_LIB`` environment variable is 26 | set to ``1`` when building. 27 | 28 | NOTE: Versions prior to 4.0.0 used to embed a modified c-ares with extended TTL support. 29 | That is no longer the case and as a result only A and AAAA records will have TTL information. 30 | Follow this PR in uppstream c-ares, looks like TTLs will be added: https://github.com/c-ares/c-ares/pull/393 31 | 32 | 33 | Installation 34 | ------------ 35 | 36 | GNU/Linux, macOS, Windows, others: 37 | 38 | :: 39 | 40 | pip install pycares 41 | 42 | FreeBSD: 43 | 44 | :: 45 | 46 | cd /usr/ports/dns/py-pycares && make install 47 | 48 | 49 | IDNA 2008 support 50 | ^^^^^^^^^^^^^^^^^ 51 | 52 | If the ``idna`` package is installed, pycares will support IDNA 2008 encoding otherwise the builtin idna codec will be used, 53 | which provides IDNA 2003 support. 54 | 55 | You can force this at installation time as follows: 56 | 57 | :: 58 | 59 | pip install pycares[idna] 60 | 61 | 62 | Running the test suite 63 | ---------------------- 64 | 65 | From the top level directory, run: ``python -m unittest -v`` 66 | 67 | NOTE: Running the tests requires internet access and are somewhat environment sensitive because real DNS quesries 68 | are made, there is no mocking. If you observe a failure that the CI cannot reproduce, please try to setup an 69 | environment as close as the current CI. 70 | 71 | 72 | Using it from the cli, a la dig 73 | ------------------------------- 74 | 75 | This module can be used directly from the command line in a similar fashion to dig (limited, of course): 76 | 77 | :: 78 | 79 | $ python -m pycares google.com 80 | ;; QUESTION SECTION: 81 | ;google.com IN A 82 | 83 | ;; ANSWER SECTION: 84 | google.com 300 IN A 172.217.17.142 85 | 86 | $ python -m pycares mx google.com 87 | ;; QUESTION SECTION: 88 | ;google.com IN MX 89 | 90 | ;; ANSWER SECTION: 91 | google.com 600 IN MX 50 alt4.aspmx.l.google.com 92 | google.com 600 IN MX 10 aspmx.l.google.com 93 | google.com 600 IN MX 40 alt3.aspmx.l.google.com 94 | google.com 600 IN MX 20 alt1.aspmx.l.google.com 95 | google.com 600 IN MX 30 alt2.aspmx.l.google.com 96 | 97 | 98 | Author 99 | ------ 100 | 101 | Saúl Ibarra Corretgé 102 | 103 | 104 | License 105 | ------- 106 | 107 | Unless stated otherwise on-file pycares uses the MIT license, check LICENSE file. 108 | 109 | 110 | Supported Python versions 111 | ------------------------- 112 | 113 | Python >= 3.9 are supported. Both CPython and PyPy are supported. 114 | 115 | 116 | Contributing 117 | ------------ 118 | 119 | If you'd like to contribute, fork the project, make a patch and send a pull 120 | request. Have a look at the surrounding code and please, make yours look 121 | alike :-) 122 | -------------------------------------------------------------------------------- /deps/build-config/config_android/ares_config.h: -------------------------------------------------------------------------------- 1 | /* ares_config.h. Generated from ares_config.h.in by configure. */ 2 | /* ares_config.h.in. Generated from configure.ac by autoheader. */ 3 | 4 | /* Define if building universal (internal helper macro) */ 5 | /* #undef AC_APPLE_UNIVERSAL_BUILD */ 6 | 7 | /* define this if ares is built for a big endian system */ 8 | /* #undef ARES_BIG_ENDIAN */ 9 | 10 | /* when building as static part of libcurl */ 11 | /* #undef BUILDING_LIBCURL */ 12 | 13 | /* Defined for build that exposes internal static functions for testing. */ 14 | /* #undef CARES_EXPOSE_STATICS */ 15 | 16 | /* Defined for build with symbol hiding. */ 17 | #define CARES_SYMBOL_HIDING 1 18 | 19 | /* Definition to make a library symbol externally visible. */ 20 | #define CARES_SYMBOL_SCOPE_EXTERN __attribute__ ((__visibility__ ("default"))) 21 | 22 | /* the signed version of size_t */ 23 | #define CARES_TYPEOF_ARES_SSIZE_T ssize_t 24 | 25 | /* Use resolver library to configure cares */ 26 | /* #undef CARES_USE_LIBRESOLV */ 27 | 28 | /* if a /etc/inet dir is being used */ 29 | /* #undef ETC_INET */ 30 | 31 | /* Define to the type of arg 2 for gethostname. */ 32 | #define GETHOSTNAME_TYPE_ARG2 size_t 33 | 34 | /* Define to the type qualifier of arg 1 for getnameinfo. */ 35 | #define GETNAMEINFO_QUAL_ARG1 const 36 | 37 | /* Define to the type of arg 1 for getnameinfo. */ 38 | #define GETNAMEINFO_TYPE_ARG1 struct sockaddr * 39 | 40 | /* Define to the type of arg 2 for getnameinfo. */ 41 | #define GETNAMEINFO_TYPE_ARG2 socklen_t 42 | 43 | /* Define to the type of args 4 and 6 for getnameinfo. */ 44 | #define GETNAMEINFO_TYPE_ARG46 socklen_t 45 | 46 | /* Define to the type of arg 7 for getnameinfo. */ 47 | #define GETNAMEINFO_TYPE_ARG7 int 48 | 49 | /* Define to 1 if you have AF_INET6. */ 50 | #define HAVE_AF_INET6 1 51 | 52 | /* Define to 1 if you have the header file. */ 53 | #define HAVE_ARPA_INET_H 1 54 | 55 | /* Define to 1 if you have the header file. */ 56 | //#define HAVE_ARPA_NAMESER_COMPAT_H 1 57 | 58 | /* Define to 1 if you have the header file. */ 59 | //#define HAVE_ARPA_NAMESER_H 1 60 | 61 | /* Define to 1 if you have the header file. */ 62 | #define HAVE_ASSERT_H 1 63 | 64 | /* Define to 1 if you have the `bitncmp' function. */ 65 | /* #undef HAVE_BITNCMP */ 66 | 67 | /* Define to 1 if bool is an available type. */ 68 | #define HAVE_BOOL_T 1 69 | 70 | /* Define to 1 if you have the clock_gettime function and monotonic timer. */ 71 | #define HAVE_CLOCK_GETTIME_MONOTONIC 1 72 | 73 | /* Define to 1 if you have the closesocket function. */ 74 | /* #undef HAVE_CLOSESOCKET */ 75 | 76 | /* Define to 1 if you have the CloseSocket camel case function. */ 77 | /* #undef HAVE_CLOSESOCKET_CAMEL */ 78 | 79 | /* Define to 1 if you have the connect function. */ 80 | #define HAVE_CONNECT 1 81 | 82 | /* define if the compiler supports basic C++11 syntax */ 83 | #define HAVE_CXX11 1 84 | 85 | /* Define to 1 if you have the header file. */ 86 | #define HAVE_DLFCN_H 1 87 | 88 | /* Define to 1 if you have the header file. */ 89 | #define HAVE_ERRNO_H 1 90 | 91 | /* Define to 1 if you have the fcntl function. */ 92 | #define HAVE_FCNTL 1 93 | 94 | /* Define to 1 if you have the header file. */ 95 | #define HAVE_FCNTL_H 1 96 | 97 | /* Define to 1 if you have a working fcntl O_NONBLOCK function. */ 98 | #define HAVE_FCNTL_O_NONBLOCK 1 99 | 100 | /* Define to 1 if you have the freeaddrinfo function. */ 101 | #define HAVE_FREEADDRINFO 1 102 | 103 | /* Define to 1 if you have a working getaddrinfo function. */ 104 | #define HAVE_GETADDRINFO 1 105 | 106 | /* Define to 1 if the getaddrinfo function is threadsafe. */ 107 | #define HAVE_GETADDRINFO_THREADSAFE 1 108 | 109 | /* Define to 1 if you have the getenv function. */ 110 | #define HAVE_GETENV 1 111 | 112 | /* Define to 1 if you have the gethostbyaddr function. */ 113 | #define HAVE_GETHOSTBYADDR 1 114 | 115 | /* Define to 1 if you have the gethostbyname function. */ 116 | #define HAVE_GETHOSTBYNAME 1 117 | 118 | /* Define to 1 if you have the gethostname function. */ 119 | #define HAVE_GETHOSTNAME 1 120 | 121 | /* Define to 1 if you have the getnameinfo function. */ 122 | #define HAVE_GETNAMEINFO 1 123 | 124 | /* Define to 1 if you have the `gettimeofday' function. */ 125 | #define HAVE_GETTIMEOFDAY 1 126 | 127 | /* Define to 1 if you have the `if_indextoname' function. */ 128 | #define HAVE_IF_INDEXTONAME 1 129 | 130 | /* Define to 1 if you have a IPv6 capable working inet_net_pton function. */ 131 | /* #undef HAVE_INET_NET_PTON */ 132 | 133 | /* Define to 1 if you have a IPv6 capable working inet_ntop function. */ 134 | #define HAVE_INET_NTOP 1 135 | 136 | /* Define to 1 if you have a IPv6 capable working inet_pton function. */ 137 | #define HAVE_INET_PTON 1 138 | 139 | /* Define to 1 if you have the header file. */ 140 | #define HAVE_INTTYPES_H 1 141 | 142 | /* Define to 1 if you have the ioctl function. */ 143 | #define HAVE_IOCTL 1 144 | 145 | /* Define to 1 if you have the ioctlsocket function. */ 146 | /* #undef HAVE_IOCTLSOCKET */ 147 | 148 | /* Define to 1 if you have the IoctlSocket camel case function. */ 149 | /* #undef HAVE_IOCTLSOCKET_CAMEL */ 150 | 151 | /* Define to 1 if you have a working IoctlSocket camel case FIONBIO function. 152 | */ 153 | /* #undef HAVE_IOCTLSOCKET_CAMEL_FIONBIO */ 154 | 155 | /* Define to 1 if you have a working ioctlsocket FIONBIO function. */ 156 | /* #undef HAVE_IOCTLSOCKET_FIONBIO */ 157 | 158 | /* Define to 1 if you have a working ioctl FIONBIO function. */ 159 | #define HAVE_IOCTL_FIONBIO 1 160 | 161 | /* Define to 1 if you have a working ioctl SIOCGIFADDR function. */ 162 | #define HAVE_IOCTL_SIOCGIFADDR 1 163 | 164 | /* Define to 1 if you have the `resolve' library (-lresolve). */ 165 | /* #undef HAVE_LIBRESOLVE */ 166 | 167 | /* Define to 1 if you have the header file. */ 168 | #define HAVE_LIMITS_H 1 169 | 170 | /* if your compiler supports LL */ 171 | #define HAVE_LL 1 172 | 173 | /* Define to 1 if the compiler supports the 'long long' data type. */ 174 | #define HAVE_LONGLONG 1 175 | 176 | /* Define to 1 if you have the malloc.h header file. */ 177 | #define HAVE_MALLOC_H 1 178 | 179 | /* Define to 1 if you have the memory.h header file. */ 180 | #define HAVE_MEMORY_H 1 181 | 182 | /* Define to 1 if you have the MSG_NOSIGNAL flag. */ 183 | #define HAVE_MSG_NOSIGNAL 1 184 | 185 | /* Define to 1 if you have the header file. */ 186 | #define HAVE_NETDB_H 1 187 | 188 | /* Define to 1 if you have the header file. */ 189 | #define HAVE_NETINET_IN_H 1 190 | 191 | /* Define to 1 if you have the header file. */ 192 | #define HAVE_NETINET_TCP_H 1 193 | 194 | /* Define to 1 if you have the header file. */ 195 | #define HAVE_NET_IF_H 1 196 | 197 | /* Define to 1 if you have PF_INET6. */ 198 | #define HAVE_PF_INET6 1 199 | 200 | /* Define to 1 if you have the recv function. */ 201 | #define HAVE_RECV 1 202 | 203 | /* Define to 1 if you have the recvfrom function. */ 204 | #define HAVE_RECVFROM 1 205 | 206 | /* Define to 1 if you have the send function. */ 207 | #define HAVE_SEND 1 208 | 209 | /* Define to 1 if you have the setsockopt function. */ 210 | #define HAVE_SETSOCKOPT 1 211 | 212 | /* Define to 1 if you have a working setsockopt SO_NONBLOCK function. */ 213 | /* #undef HAVE_SETSOCKOPT_SO_NONBLOCK */ 214 | 215 | /* Define to 1 if you have the header file. */ 216 | #define HAVE_SIGNAL_H 1 217 | 218 | /* Define to 1 if sig_atomic_t is an available typedef. */ 219 | #define HAVE_SIG_ATOMIC_T 1 220 | 221 | /* Define to 1 if sig_atomic_t is already defined as volatile. */ 222 | /* #undef HAVE_SIG_ATOMIC_T_VOLATILE */ 223 | 224 | /* Define to 1 if your struct sockaddr_in6 has sin6_scope_id. */ 225 | #define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1 226 | 227 | /* Define to 1 if you have the socket function. */ 228 | #define HAVE_SOCKET 1 229 | 230 | /* Define to 1 if you have the header file. */ 231 | /* #undef HAVE_SOCKET_H */ 232 | 233 | /* Define to 1 if you have the header file. */ 234 | #define HAVE_STDBOOL_H 1 235 | 236 | /* Define to 1 if you have the header file. */ 237 | #define HAVE_STDINT_H 1 238 | 239 | /* Define to 1 if you have the header file. */ 240 | #define HAVE_STDLIB_H 1 241 | 242 | /* Define to 1 if you have the strcasecmp function. */ 243 | #define HAVE_STRCASECMP 1 244 | 245 | /* Define to 1 if you have the strcmpi function. */ 246 | /* #undef HAVE_STRCMPI */ 247 | 248 | /* Define to 1 if you have the strdup function. */ 249 | #define HAVE_STRDUP 1 250 | 251 | /* Define to 1 if you have the stricmp function. */ 252 | /* #undef HAVE_STRICMP */ 253 | 254 | /* Define to 1 if you have the header file. */ 255 | #define HAVE_STRINGS_H 1 256 | 257 | /* Define to 1 if you have the header file. */ 258 | #define HAVE_STRING_H 1 259 | 260 | /* Define to 1 if you have the strncasecmp function. */ 261 | #define HAVE_STRNCASECMP 1 262 | 263 | /* Define to 1 if you have the strncmpi function. */ 264 | /* #undef HAVE_STRNCMPI */ 265 | 266 | /* Define to 1 if you have the strnicmp function. */ 267 | /* #undef HAVE_STRNICMP */ 268 | 269 | /* Define to 1 if you have the header file. */ 270 | #define HAVE_STROPTS_H 1 271 | 272 | /* Define to 1 if you have struct addrinfo. */ 273 | #define HAVE_STRUCT_ADDRINFO 1 274 | 275 | /* Define to 1 if you have struct in6_addr. */ 276 | #define HAVE_STRUCT_IN6_ADDR 1 277 | 278 | /* Define to 1 if you have struct sockaddr_in6. */ 279 | #define HAVE_STRUCT_SOCKADDR_IN6 1 280 | 281 | /* if struct sockaddr_storage is defined */ 282 | #define HAVE_STRUCT_SOCKADDR_STORAGE 1 283 | 284 | /* Define to 1 if you have the timeval struct. */ 285 | #define HAVE_STRUCT_TIMEVAL 1 286 | 287 | /* Define to 1 if you have the header file. */ 288 | #define HAVE_SYS_IOCTL_H 1 289 | 290 | /* Define to 1 if you have the header file. */ 291 | #define HAVE_SYS_PARAM_H 1 292 | 293 | /* Define to 1 if you have the header file. */ 294 | #define HAVE_SYS_SELECT_H 1 295 | 296 | /* Define to 1 if you have the header file. */ 297 | #define HAVE_SYS_SOCKET_H 1 298 | 299 | /* Define to 1 if you have the header file. */ 300 | #define HAVE_SYS_STAT_H 1 301 | 302 | /* Define to 1 if you have the header file. */ 303 | #define HAVE_SYS_TIME_H 1 304 | 305 | /* Define to 1 if you have the header file. */ 306 | #define HAVE_SYS_TYPES_H 1 307 | 308 | /* Define to 1 if you have the header file. */ 309 | #define HAVE_SYS_UIO_H 1 310 | 311 | /* Define to 1 if you have the header file. */ 312 | #define HAVE_TIME_H 1 313 | 314 | /* Define to 1 if you have the header file. */ 315 | #define HAVE_UNISTD_H 1 316 | 317 | /* Define to 1 if you have the windows.h header file. */ 318 | /* #undef HAVE_WINDOWS_H */ 319 | 320 | /* Define to 1 if you have the winsock2.h header file. */ 321 | /* #undef HAVE_WINSOCK2_H */ 322 | 323 | /* Define to 1 if you have the winsock.h header file. */ 324 | /* #undef HAVE_WINSOCK_H */ 325 | 326 | /* Define to 1 if you have the writev function. */ 327 | #define HAVE_WRITEV 1 328 | 329 | /* Define to 1 if you have the ws2tcpip.h header file. */ 330 | /* #undef HAVE_WS2TCPIP_H */ 331 | 332 | /* Define to the sub-directory where libtool stores uninstalled libraries. */ 333 | #define LT_OBJDIR ".libs/" 334 | 335 | /* Define to 1 if you need the malloc.h header file even with stdlib.h */ 336 | /* #undef NEED_MALLOC_H */ 337 | 338 | /* Define to 1 if you need the memory.h header file even with stdlib.h */ 339 | /* #undef NEED_MEMORY_H */ 340 | 341 | /* Define to 1 if _REENTRANT preprocessor symbol must be defined. */ 342 | /* #undef NEED_REENTRANT */ 343 | 344 | /* Define to 1 if _THREAD_SAFE preprocessor symbol must be defined. */ 345 | /* #undef NEED_THREAD_SAFE */ 346 | 347 | /* cpu-machine-OS */ 348 | #define OS "i686-pc-linux-gnu" 349 | 350 | /* Name of package */ 351 | #define PACKAGE "c-ares" 352 | 353 | /* Define to the address where bug reports for this package should be sent. */ 354 | #define PACKAGE_BUGREPORT "c-ares mailing list: http://cool.haxx.se/mailman/listinfo/c-ares" 355 | 356 | /* Define to the full name of this package. */ 357 | #define PACKAGE_NAME "c-ares" 358 | 359 | /* Define to the full name and version of this package. */ 360 | #define PACKAGE_STRING "c-ares 1.13.0" 361 | 362 | /* Define to the one symbol short name of this package. */ 363 | #define PACKAGE_TARNAME "c-ares" 364 | 365 | /* Define to the home page for this package. */ 366 | #define PACKAGE_URL "" 367 | 368 | /* Define to the version of this package. */ 369 | #define PACKAGE_VERSION "1.13.0" 370 | 371 | /* a suitable file/device to read random data from */ 372 | #define CARES_RANDOM_FILE "/dev/urandom" 373 | 374 | /* Define to the type qualifier pointed by arg 5 for recvfrom. */ 375 | #define RECVFROM_QUAL_ARG5 376 | 377 | /* Define to the type of arg 1 for recvfrom. */ 378 | #define RECVFROM_TYPE_ARG1 int 379 | 380 | /* Define to the type pointed by arg 2 for recvfrom. */ 381 | #define RECVFROM_TYPE_ARG2 void 382 | 383 | /* Define to 1 if the type pointed by arg 2 for recvfrom is void. */ 384 | #define RECVFROM_TYPE_ARG2_IS_VOID 1 385 | 386 | /* Define to the type of arg 3 for recvfrom. */ 387 | #define RECVFROM_TYPE_ARG3 size_t 388 | 389 | /* Define to the type of arg 4 for recvfrom. */ 390 | #define RECVFROM_TYPE_ARG4 int 391 | 392 | /* Define to the type pointed by arg 5 for recvfrom. */ 393 | #define RECVFROM_TYPE_ARG5 struct sockaddr 394 | 395 | /* Define to 1 if the type pointed by arg 5 for recvfrom is void. */ 396 | /* #undef RECVFROM_TYPE_ARG5_IS_VOID */ 397 | 398 | /* Define to the type pointed by arg 6 for recvfrom. */ 399 | #define RECVFROM_TYPE_ARG6 socklen_t 400 | 401 | /* Define to 1 if the type pointed by arg 6 for recvfrom is void. */ 402 | /* #undef RECVFROM_TYPE_ARG6_IS_VOID */ 403 | 404 | /* Define to the function return type for recvfrom. */ 405 | #define RECVFROM_TYPE_RETV ssize_t 406 | 407 | /* Define to the type of arg 1 for recv. */ 408 | #define RECV_TYPE_ARG1 int 409 | 410 | /* Define to the type of arg 2 for recv. */ 411 | #define RECV_TYPE_ARG2 void * 412 | 413 | /* Define to the type of arg 3 for recv. */ 414 | #define RECV_TYPE_ARG3 size_t 415 | 416 | /* Define to the type of arg 4 for recv. */ 417 | #define RECV_TYPE_ARG4 int 418 | 419 | /* Define to the function return type for recv. */ 420 | #define RECV_TYPE_RETV ssize_t 421 | 422 | /* Define as the return type of signal handlers (`int' or `void'). */ 423 | #define RETSIGTYPE void 424 | 425 | /* Define to the type qualifier of arg 2 for send. */ 426 | #define SEND_QUAL_ARG2 const 427 | 428 | /* Define to the type of arg 1 for send. */ 429 | #define SEND_TYPE_ARG1 int 430 | 431 | /* Define to the type of arg 2 for send. */ 432 | #define SEND_TYPE_ARG2 void * 433 | 434 | /* Define to the type of arg 3 for send. */ 435 | #define SEND_TYPE_ARG3 size_t 436 | 437 | /* Define to the type of arg 4 for send. */ 438 | #define SEND_TYPE_ARG4 int 439 | 440 | /* Define to the function return type for send. */ 441 | #define SEND_TYPE_RETV ssize_t 442 | 443 | /* Define to 1 if you have the ANSI C header files. */ 444 | #define STDC_HEADERS 1 445 | 446 | /* Define to 1 if you can safely include both and . */ 447 | #define TIME_WITH_SYS_TIME 1 448 | 449 | /* Define to disable non-blocking sockets. */ 450 | /* #undef USE_BLOCKING_SOCKETS */ 451 | 452 | /* Version number of package */ 453 | #define VERSION "1.13.0" 454 | 455 | /* Define to avoid automatic inclusion of winsock.h */ 456 | /* #undef WIN32_LEAN_AND_MEAN */ 457 | 458 | /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most 459 | significant byte first (like Motorola and SPARC, unlike Intel). */ 460 | #if defined AC_APPLE_UNIVERSAL_BUILD 461 | # if defined __BIG_ENDIAN__ 462 | # define WORDS_BIGENDIAN 1 463 | # endif 464 | #else 465 | # ifndef WORDS_BIGENDIAN 466 | /* # undef WORDS_BIGENDIAN */ 467 | # endif 468 | #endif 469 | 470 | /* Define to 1 if OS is AIX. */ 471 | #ifndef _ALL_SOURCE 472 | /* # undef _ALL_SOURCE */ 473 | #endif 474 | 475 | /* Enable large inode numbers on Mac OS X 10.5. */ 476 | #ifndef _DARWIN_USE_64_BIT_INODE 477 | # define _DARWIN_USE_64_BIT_INODE 1 478 | #endif 479 | 480 | /* Number of bits in a file offset, on hosts where this is settable. */ 481 | /* #undef _FILE_OFFSET_BITS */ 482 | 483 | /* Define for large files, on AIX-style hosts. */ 484 | /* #undef _LARGE_FILES */ 485 | 486 | /* Define to empty if `const' does not conform to ANSI C. */ 487 | /* #undef const */ 488 | 489 | /* Type to use in place of in_addr_t when system does not provide it. */ 490 | /* #undef in_addr_t */ 491 | 492 | /* Define to `unsigned int' if does not define. */ 493 | /* #undef size_t */ 494 | 495 | /* the signed version of size_t */ 496 | /* #undef ssize_t */ 497 | -------------------------------------------------------------------------------- /deps/build-config/config_cygwin/ares_config.h: -------------------------------------------------------------------------------- 1 | /* ares_config.h. Generated from ares_config.h.in by configure. */ 2 | /* ares_config.h.in. Generated from configure.ac by autoheader. */ 3 | 4 | /* Define if building universal (internal helper macro) */ 5 | /* #undef AC_APPLE_UNIVERSAL_BUILD */ 6 | 7 | /* define this if ares is built for a big endian system */ 8 | /* #undef ARES_BIG_ENDIAN */ 9 | 10 | /* when building as static part of libcurl */ 11 | /* #undef BUILDING_LIBCURL */ 12 | 13 | /* when building c-ares library */ 14 | /* #undef CARES_BUILDING_LIBRARY */ 15 | 16 | /* when not building a shared library */ 17 | /* #undef CARES_STATICLIB */ 18 | 19 | /* Define to 1 to enable hiding of library internal symbols. */ 20 | #define CARES_SYMBOL_HIDING 1 21 | 22 | /* Definition to make a library symbol externally visible. */ 23 | #define CARES_SYMBOL_SCOPE_EXTERN __attribute__ ((visibility ("default"))) 24 | 25 | /* the signed version of size_t */ 26 | #define CARES_TYPEOF_ARES_SSIZE_T ssize_t 27 | 28 | /* if a /etc/inet dir is being used */ 29 | /* #undef ETC_INET */ 30 | 31 | /* Define to the type qualifier of arg 1 for getnameinfo. */ 32 | #define GETNAMEINFO_QUAL_ARG1 const 33 | 34 | /* Define to the type of arg 1 for getnameinfo. */ 35 | #define GETNAMEINFO_TYPE_ARG1 struct sockaddr * 36 | 37 | /* Define to the type of arg 2 for getnameinfo. */ 38 | #define GETNAMEINFO_TYPE_ARG2 socklen_t 39 | 40 | /* Define to the type of args 4 and 6 for getnameinfo. */ 41 | #define GETNAMEINFO_TYPE_ARG46 int 42 | 43 | /* Define to the type of arg 7 for getnameinfo. */ 44 | #define GETNAMEINFO_TYPE_ARG7 int 45 | 46 | /* Define to 1 if you have AF_INET6. */ 47 | #define HAVE_AF_INET6 1 48 | 49 | /* Define to 1 if you have the header file. */ 50 | #define HAVE_ARPA_INET_H 1 51 | 52 | /* Define to 1 if you have the header file. */ 53 | #define HAVE_ARPA_NAMESER_COMPAT_H 1 54 | 55 | /* Define to 1 if you have the header file. */ 56 | #define HAVE_ARPA_NAMESER_H 1 57 | 58 | /* Define to 1 if you have the header file. */ 59 | #define HAVE_ASSERT_H 1 60 | 61 | /* Define to 1 if you have the `bitncmp' function. */ 62 | /* #undef HAVE_BITNCMP */ 63 | 64 | /* Define to 1 if bool is an available type. */ 65 | #define HAVE_BOOL_T 1 66 | 67 | /* Define to 1 if you have the clock_gettime function and monotonic timer. */ 68 | /* #undef HAVE_CLOCK_GETTIME_MONOTONIC */ 69 | 70 | /* Define to 1 if you have the closesocket function. */ 71 | /* #undef HAVE_CLOSESOCKET */ 72 | 73 | /* Define to 1 if you have the CloseSocket camel case function. */ 74 | /* #undef HAVE_CLOSESOCKET_CAMEL */ 75 | 76 | /* Define to 1 if you have the connect function. */ 77 | #define HAVE_CONNECT 1 78 | 79 | /* Define to 1 if you have the header file. */ 80 | #define HAVE_DLFCN_H 1 81 | 82 | /* Define to 1 if you have the header file. */ 83 | #define HAVE_ERRNO_H 1 84 | 85 | /* Define to 1 if you have the fcntl function. */ 86 | #define HAVE_FCNTL 1 87 | 88 | /* Define to 1 if you have the header file. */ 89 | #define HAVE_FCNTL_H 1 90 | 91 | /* Define to 1 if you have a working fcntl O_NONBLOCK function. */ 92 | #define HAVE_FCNTL_O_NONBLOCK 1 93 | 94 | /* Define to 1 if you have the freeaddrinfo function. */ 95 | #define HAVE_FREEADDRINFO 1 96 | 97 | /* Define to 1 if you have a working getaddrinfo function. */ 98 | #define HAVE_GETADDRINFO 1 99 | 100 | /* Define to 1 if the getaddrinfo function is threadsafe. */ 101 | /* #undef HAVE_GETADDRINFO_THREADSAFE */ 102 | 103 | /* Define to 1 if you have the gethostbyaddr function. */ 104 | #define HAVE_GETHOSTBYADDR 1 105 | 106 | /* Define to 1 if you have the gethostbyname function. */ 107 | #define HAVE_GETHOSTBYNAME 1 108 | 109 | /* Define to 1 if you have the gethostname function. */ 110 | #define HAVE_GETHOSTNAME 1 111 | 112 | /* Define to 1 if you have the getnameinfo function. */ 113 | #define HAVE_GETNAMEINFO 1 114 | 115 | /* Define to 1 if you have the `gettimeofday' function. */ 116 | #define HAVE_GETTIMEOFDAY 1 117 | 118 | /* Define to 1 if you have the `if_indextoname' function. */ 119 | #define HAVE_IF_INDEXTONAME 1 120 | 121 | /* Define to 1 if you have the `inet_net_pton' function. */ 122 | /* #undef HAVE_INET_NET_PTON */ 123 | 124 | /* Define to 1 if inet_net_pton supports IPv6. */ 125 | /* #undef HAVE_INET_NET_PTON_IPV6 */ 126 | 127 | /* Define to 1 if you have a IPv6 capable working inet_ntop function. */ 128 | #define HAVE_INET_NTOP 1 129 | 130 | /* Define to 1 if you have a IPv6 capable working inet_pton function. */ 131 | #define HAVE_INET_PTON 1 132 | 133 | /* Define to 1 if you have the header file. */ 134 | #define HAVE_INTTYPES_H 1 135 | 136 | /* Define to 1 if you have the ioctl function. */ 137 | #define HAVE_IOCTL 1 138 | 139 | /* Define to 1 if you have the ioctlsocket function. */ 140 | /* #undef HAVE_IOCTLSOCKET */ 141 | 142 | /* Define to 1 if you have the IoctlSocket camel case function. */ 143 | /* #undef HAVE_IOCTLSOCKET_CAMEL */ 144 | 145 | /* Define to 1 if you have a working IoctlSocket camel case FIONBIO function. 146 | */ 147 | /* #undef HAVE_IOCTLSOCKET_CAMEL_FIONBIO */ 148 | 149 | /* Define to 1 if you have a working ioctlsocket FIONBIO function. */ 150 | /* #undef HAVE_IOCTLSOCKET_FIONBIO */ 151 | 152 | /* Define to 1 if you have a working ioctl FIONBIO function. */ 153 | #define HAVE_IOCTL_FIONBIO 1 154 | 155 | /* Define to 1 if you have a working ioctl SIOCGIFADDR function. */ 156 | #define HAVE_IOCTL_SIOCGIFADDR 1 157 | 158 | /* Define to 1 if you have the `resolve' library (-lresolve). */ 159 | /* #undef HAVE_LIBRESOLVE */ 160 | 161 | /* Define to 1 if you have the header file. */ 162 | #define HAVE_LIMITS_H 1 163 | 164 | /* if your compiler supports LL */ 165 | #define HAVE_LL 1 166 | 167 | /* Define to 1 if the compiler supports the 'long long' data type. */ 168 | #define HAVE_LONGLONG 1 169 | 170 | /* Define to 1 if you have the malloc.h header file. */ 171 | #define HAVE_MALLOC_H 1 172 | 173 | /* Define to 1 if you have the memory.h header file. */ 174 | #define HAVE_MEMORY_H 1 175 | 176 | /* Define to 1 if you have the MSG_NOSIGNAL flag. */ 177 | #define HAVE_MSG_NOSIGNAL 1 178 | 179 | /* Define to 1 if you have the header file. */ 180 | #define HAVE_NETDB_H 1 181 | 182 | /* Define to 1 if you have the header file. */ 183 | #define HAVE_NETINET_IN_H 1 184 | 185 | /* Define to 1 if you have the header file. */ 186 | #define HAVE_NETINET_TCP_H 1 187 | 188 | /* Define to 1 if you have the header file. */ 189 | #define HAVE_NET_IF_H 1 190 | 191 | /* Define to 1 if you have PF_INET6. */ 192 | #define HAVE_PF_INET6 1 193 | 194 | /* Define to 1 if you have the recv function. */ 195 | #define HAVE_RECV 1 196 | 197 | /* Define to 1 if you have the recvfrom function. */ 198 | #define HAVE_RECVFROM 1 199 | 200 | /* Define to 1 if you have the send function. */ 201 | #define HAVE_SEND 1 202 | 203 | /* Define to 1 if you have the setsockopt function. */ 204 | #define HAVE_SETSOCKOPT 1 205 | 206 | /* Define to 1 if you have a working setsockopt SO_NONBLOCK function. */ 207 | /* #undef HAVE_SETSOCKOPT_SO_NONBLOCK */ 208 | 209 | /* Define to 1 if you have the header file. */ 210 | #define HAVE_SIGNAL_H 1 211 | 212 | /* Define to 1 if sig_atomic_t is an available typedef. */ 213 | #define HAVE_SIG_ATOMIC_T 1 214 | 215 | /* Define to 1 if sig_atomic_t is already defined as volatile. */ 216 | /* #undef HAVE_SIG_ATOMIC_T_VOLATILE */ 217 | 218 | /* Define to 1 if your struct sockaddr_in6 has sin6_scope_id. */ 219 | #define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1 220 | 221 | /* Define to 1 if you have the socket function. */ 222 | #define HAVE_SOCKET 1 223 | 224 | /* Define to 1 if you have the header file. */ 225 | /* #undef HAVE_SOCKET_H */ 226 | 227 | /* Define to 1 if you have the header file. */ 228 | #define HAVE_STDBOOL_H 1 229 | 230 | /* Define to 1 if you have the header file. */ 231 | #define HAVE_STDINT_H 1 232 | 233 | /* Define to 1 if you have the header file. */ 234 | #define HAVE_STDLIB_H 1 235 | 236 | /* Define to 1 if you have the strcasecmp function. */ 237 | #define HAVE_STRCASECMP 1 238 | 239 | /* Define to 1 if you have the strcmpi function. */ 240 | /* #undef HAVE_STRCMPI */ 241 | 242 | /* Define to 1 if you have the strdup function. */ 243 | #define HAVE_STRDUP 1 244 | 245 | /* Define to 1 if you have the stricmp function. */ 246 | /* #undef HAVE_STRICMP */ 247 | 248 | /* Define to 1 if you have the header file. */ 249 | #define HAVE_STRINGS_H 1 250 | 251 | /* Define to 1 if you have the header file. */ 252 | #define HAVE_STRING_H 1 253 | 254 | /* Define to 1 if you have the strncasecmp function. */ 255 | #define HAVE_STRNCASECMP 1 256 | 257 | /* Define to 1 if you have the strncmpi function. */ 258 | /* #undef HAVE_STRNCMPI */ 259 | 260 | /* Define to 1 if you have the strnicmp function. */ 261 | /* #undef HAVE_STRNICMP */ 262 | 263 | /* Define to 1 if you have the header file. */ 264 | /* #undef HAVE_STROPTS_H */ 265 | 266 | /* Define to 1 if you have struct addrinfo. */ 267 | #define HAVE_STRUCT_ADDRINFO 1 268 | 269 | /* Define to 1 if you have struct in6_addr. */ 270 | #define HAVE_STRUCT_IN6_ADDR 1 271 | 272 | /* Define to 1 if you have struct sockaddr_in6. */ 273 | #define HAVE_STRUCT_SOCKADDR_IN6 1 274 | 275 | /* if struct sockaddr_storage is defined */ 276 | #define HAVE_STRUCT_SOCKADDR_STORAGE 1 277 | 278 | /* Define to 1 if you have the timeval struct. */ 279 | #define HAVE_STRUCT_TIMEVAL 1 280 | 281 | /* Define to 1 if you have the header file. */ 282 | #define HAVE_SYS_IOCTL_H 1 283 | 284 | /* Define to 1 if you have the header file. */ 285 | #define HAVE_SYS_PARAM_H 1 286 | 287 | /* Define to 1 if you have the header file. */ 288 | #define HAVE_SYS_SELECT_H 1 289 | 290 | /* Define to 1 if you have the header file. */ 291 | #define HAVE_SYS_SOCKET_H 1 292 | 293 | /* Define to 1 if you have the header file. */ 294 | #define HAVE_SYS_STAT_H 1 295 | 296 | /* Define to 1 if you have the header file. */ 297 | #define HAVE_SYS_TIME_H 1 298 | 299 | /* Define to 1 if you have the header file. */ 300 | #define HAVE_SYS_TYPES_H 1 301 | 302 | /* Define to 1 if you have the header file. */ 303 | #define HAVE_SYS_UIO_H 1 304 | 305 | /* Define to 1 if you have the header file. */ 306 | #define HAVE_TIME_H 1 307 | 308 | /* Define to 1 if you have the header file. */ 309 | #define HAVE_UNISTD_H 1 310 | 311 | /* Define to 1 if you have the windows.h header file. */ 312 | /* #undef HAVE_WINDOWS_H */ 313 | 314 | /* Define to 1 if you have the winsock2.h header file. */ 315 | /* #undef HAVE_WINSOCK2_H */ 316 | 317 | /* Define to 1 if you have the winsock.h header file. */ 318 | /* #undef HAVE_WINSOCK_H */ 319 | 320 | /* Define to 1 if you have the writev function. */ 321 | #define HAVE_WRITEV 1 322 | 323 | /* Define to 1 if you have the ws2tcpip.h header file. */ 324 | /* #undef HAVE_WS2TCPIP_H */ 325 | 326 | /* Define to the sub-directory in which libtool stores uninstalled libraries. 327 | */ 328 | #define LT_OBJDIR ".libs/" 329 | 330 | /* Define to 1 if you are building a native Windows target. */ 331 | /* #undef NATIVE_WINDOWS */ 332 | 333 | /* Define to 1 if you need the malloc.h header file even with stdlib.h */ 334 | /* #undef NEED_MALLOC_H */ 335 | 336 | /* Define to 1 if you need the memory.h header file even with stdlib.h */ 337 | /* #undef NEED_MEMORY_H */ 338 | 339 | /* Define to 1 if _REENTRANT preprocessor symbol must be defined. */ 340 | /* #undef NEED_REENTRANT */ 341 | 342 | /* Define to 1 if _THREAD_SAFE preprocessor symbol must be defined. */ 343 | /* #undef NEED_THREAD_SAFE */ 344 | 345 | /* Define to 1 if your C compiler doesn't accept -c and -o together. */ 346 | /* #undef NO_MINUS_C_MINUS_O */ 347 | 348 | /* cpu-machine-OS */ 349 | #define OS "i686-pc-cygwin" 350 | 351 | /* Name of package */ 352 | #define PACKAGE "c-ares" 353 | 354 | /* Define to the address where bug reports for this package should be sent. */ 355 | #define PACKAGE_BUGREPORT "c-ares mailing list => http://cool.haxx.se/mailman/listinfo/c-ares" 356 | 357 | /* Define to the full name of this package. */ 358 | #define PACKAGE_NAME "c-ares" 359 | 360 | /* Define to the full name and version of this package. */ 361 | #define PACKAGE_STRING "c-ares 1.13.0" 362 | 363 | /* Define to the one symbol short name of this package. */ 364 | #define PACKAGE_TARNAME "c-ares" 365 | 366 | /* Define to the home page for this package. */ 367 | #define PACKAGE_URL "" 368 | 369 | /* Define to the version of this package. */ 370 | #define PACKAGE_VERSION "1.13.0" 371 | 372 | /* a suitable file/device to read random data from */ 373 | #define CARES_RANDOM_FILE "/dev/urandom" 374 | 375 | /* Define to the type of arg 1 for recvfrom. */ 376 | #define RECVFROM_TYPE_ARG1 int 377 | 378 | /* Define to the type pointed by arg 2 for recvfrom. */ 379 | #define RECVFROM_TYPE_ARG2 void 380 | 381 | /* Define to 1 if the type pointed by arg 2 for recvfrom is void. */ 382 | #define RECVFROM_TYPE_ARG2_IS_VOID 1 383 | 384 | /* Define to the type of arg 3 for recvfrom. */ 385 | #define RECVFROM_TYPE_ARG3 size_t 386 | 387 | /* Define to the type of arg 4 for recvfrom. */ 388 | #define RECVFROM_TYPE_ARG4 int 389 | 390 | /* Define to the type pointed by arg 5 for recvfrom. */ 391 | #define RECVFROM_TYPE_ARG5 struct sockaddr 392 | 393 | /* Define to 1 if the type pointed by arg 5 for recvfrom is void. */ 394 | /* #undef RECVFROM_TYPE_ARG5_IS_VOID */ 395 | 396 | /* Define to the type pointed by arg 6 for recvfrom. */ 397 | #define RECVFROM_TYPE_ARG6 socklen_t 398 | 399 | /* Define to 1 if the type pointed by arg 6 for recvfrom is void. */ 400 | /* #undef RECVFROM_TYPE_ARG6_IS_VOID */ 401 | 402 | /* Define to the function return type for recvfrom. */ 403 | #define RECVFROM_TYPE_RETV int 404 | 405 | /* Define to the type of arg 1 for recv. */ 406 | #define RECV_TYPE_ARG1 int 407 | 408 | /* Define to the type of arg 2 for recv. */ 409 | #define RECV_TYPE_ARG2 void * 410 | 411 | /* Define to the type of arg 3 for recv. */ 412 | #define RECV_TYPE_ARG3 size_t 413 | 414 | /* Define to the type of arg 4 for recv. */ 415 | #define RECV_TYPE_ARG4 int 416 | 417 | /* Define to the function return type for recv. */ 418 | #define RECV_TYPE_RETV int 419 | 420 | /* Define as the return type of signal handlers (`int' or `void'). */ 421 | #define RETSIGTYPE void 422 | 423 | /* Define to the type qualifier of arg 2 for send. */ 424 | #define SEND_QUAL_ARG2 const 425 | 426 | /* Define to the type of arg 1 for send. */ 427 | #define SEND_TYPE_ARG1 int 428 | 429 | /* Define to the type of arg 2 for send. */ 430 | #define SEND_TYPE_ARG2 void * 431 | 432 | /* Define to the type of arg 3 for send. */ 433 | #define SEND_TYPE_ARG3 size_t 434 | 435 | /* Define to the type of arg 4 for send. */ 436 | #define SEND_TYPE_ARG4 int 437 | 438 | /* Define to the function return type for send. */ 439 | #define SEND_TYPE_RETV int 440 | 441 | /* The size of `int', as computed by sizeof. */ 442 | #define SIZEOF_INT 4 443 | 444 | /* The size of `long', as computed by sizeof. */ 445 | #define SIZEOF_LONG 4 446 | 447 | /* The size of `size_t', as computed by sizeof. */ 448 | #define SIZEOF_SIZE_T 4 449 | 450 | /* The size of `struct in6_addr', as computed by sizeof. */ 451 | #define SIZEOF_STRUCT_IN6_ADDR 16 452 | 453 | /* The size of `struct in_addr', as computed by sizeof. */ 454 | #define SIZEOF_STRUCT_IN_ADDR 4 455 | 456 | /* The size of `time_t', as computed by sizeof. */ 457 | #define SIZEOF_TIME_T 4 458 | 459 | /* Define to 1 if you have the ANSI C header files. */ 460 | #define STDC_HEADERS 1 461 | 462 | /* Define to 1 if you can safely include both and . */ 463 | #define TIME_WITH_SYS_TIME 1 464 | 465 | /* Define to disable non-blocking sockets. */ 466 | /* #undef USE_BLOCKING_SOCKETS */ 467 | 468 | /* Version number of package */ 469 | #define VERSION "1.7.1" 470 | 471 | /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most 472 | significant byte first (like Motorola and SPARC, unlike Intel). */ 473 | #if defined AC_APPLE_UNIVERSAL_BUILD 474 | # if defined __BIG_ENDIAN__ 475 | # define WORDS_BIGENDIAN 1 476 | # endif 477 | #else 478 | # ifndef WORDS_BIGENDIAN 479 | /* # undef WORDS_BIGENDIAN */ 480 | # endif 481 | #endif 482 | 483 | /* Define to 1 if OS is AIX. */ 484 | #ifndef _ALL_SOURCE 485 | /* # undef _ALL_SOURCE */ 486 | #endif 487 | 488 | /* Number of bits in a file offset, on hosts where this is settable. */ 489 | /* #undef _FILE_OFFSET_BITS */ 490 | 491 | /* Define for large files, on AIX-style hosts. */ 492 | /* #undef _LARGE_FILES */ 493 | 494 | /* Define to empty if `const' does not conform to ANSI C. */ 495 | /* #undef const */ 496 | 497 | /* Type to use in place of in_addr_t when system does not provide it. */ 498 | /* #undef in_addr_t */ 499 | 500 | /* Define to `unsigned int' if does not define. */ 501 | /* #undef size_t */ 502 | 503 | /* the signed version of size_t */ 504 | /* #undef ssize_t */ 505 | 506 | #define HAVE_GETENV 1 507 | -------------------------------------------------------------------------------- /deps/build-config/config_darwin/ares_config.h: -------------------------------------------------------------------------------- 1 | /* ares_config.h. Generated from ares_config.h.in by configure. */ 2 | /* ares_config.h.in. Generated from configure.ac by autoheader. */ 3 | 4 | /* Define if building universal (internal helper macro) */ 5 | /* #undef AC_APPLE_UNIVERSAL_BUILD */ 6 | 7 | /* define this if ares is built for a big endian system */ 8 | /* #undef ARES_BIG_ENDIAN */ 9 | 10 | /* when building as static part of libcurl */ 11 | /* #undef BUILDING_LIBCURL */ 12 | 13 | /* Defined for build that exposes internal static functions for testing. */ 14 | /* #undef CARES_EXPOSE_STATICS */ 15 | 16 | /* Defined for build with symbol hiding. */ 17 | #define CARES_SYMBOL_HIDING 1 18 | 19 | /* Definition to make a library symbol externally visible. */ 20 | #define CARES_SYMBOL_SCOPE_EXTERN __attribute__ ((__visibility__ ("default"))) 21 | 22 | /* the signed version of size_t */ 23 | #define CARES_TYPEOF_ARES_SSIZE_T ssize_t 24 | 25 | /* Use resolver library to configure cares */ 26 | /* #undef CARES_USE_LIBRESOLV */ 27 | 28 | /* if a /etc/inet dir is being used */ 29 | /* #undef ETC_INET */ 30 | 31 | /* Define to the type of arg 2 for gethostname. */ 32 | #define GETHOSTNAME_TYPE_ARG2 size_t 33 | 34 | /* Define to the type qualifier of arg 1 for getnameinfo. */ 35 | #define GETNAMEINFO_QUAL_ARG1 const 36 | 37 | /* Define to the type of arg 1 for getnameinfo. */ 38 | #define GETNAMEINFO_TYPE_ARG1 struct sockaddr * 39 | 40 | /* Define to the type of arg 2 for getnameinfo. */ 41 | #define GETNAMEINFO_TYPE_ARG2 socklen_t 42 | 43 | /* Define to the type of args 4 and 6 for getnameinfo. */ 44 | #define GETNAMEINFO_TYPE_ARG46 socklen_t 45 | 46 | /* Define to the type of arg 7 for getnameinfo. */ 47 | #define GETNAMEINFO_TYPE_ARG7 int 48 | 49 | /* Define to 1 if you have AF_INET6. */ 50 | #define HAVE_AF_INET6 1 51 | 52 | /* Define to 1 if you have the header file. */ 53 | #define HAVE_ARPA_INET_H 1 54 | 55 | /* Define to 1 if you have the header file. */ 56 | #define HAVE_ARPA_NAMESER_COMPAT_H 1 57 | 58 | /* Define to 1 if you have the header file. */ 59 | #define HAVE_ARPA_NAMESER_H 1 60 | 61 | /* Define to 1 if you have the header file. */ 62 | #define HAVE_ASSERT_H 1 63 | 64 | /* Define to 1 if you have the `bitncmp' function. */ 65 | /* #undef HAVE_BITNCMP */ 66 | 67 | /* Define to 1 if bool is an available type. */ 68 | #define HAVE_BOOL_T 1 69 | 70 | /* Define to 1 if you have the clock_gettime function and monotonic timer. */ 71 | /* #undef HAVE_CLOCK_GETTIME_MONOTONIC */ 72 | 73 | /* Define to 1 if you have the closesocket function. */ 74 | /* #undef HAVE_CLOSESOCKET */ 75 | 76 | /* Define to 1 if you have the CloseSocket camel case function. */ 77 | /* #undef HAVE_CLOSESOCKET_CAMEL */ 78 | 79 | /* Define to 1 if you have the connect function. */ 80 | #define HAVE_CONNECT 1 81 | 82 | /* define if the compiler supports basic C++11 syntax */ 83 | #define HAVE_CXX11 1 84 | 85 | /* Define to 1 if you have the header file. */ 86 | #define HAVE_DLFCN_H 1 87 | 88 | /* Define to 1 if you have the header file. */ 89 | #define HAVE_ERRNO_H 1 90 | 91 | /* Define to 1 if you have the fcntl function. */ 92 | #define HAVE_FCNTL 1 93 | 94 | /* Define to 1 if you have the header file. */ 95 | #define HAVE_FCNTL_H 1 96 | 97 | /* Define to 1 if you have a working fcntl O_NONBLOCK function. */ 98 | #define HAVE_FCNTL_O_NONBLOCK 1 99 | 100 | /* Define to 1 if you have the freeaddrinfo function. */ 101 | #define HAVE_FREEADDRINFO 1 102 | 103 | /* Define to 1 if you have a working getaddrinfo function. */ 104 | #define HAVE_GETADDRINFO 1 105 | 106 | /* Define to 1 if the getaddrinfo function is threadsafe. */ 107 | #define HAVE_GETADDRINFO_THREADSAFE 1 108 | 109 | /* Define to 1 if you have the getenv function. */ 110 | #define HAVE_GETENV 1 111 | 112 | /* Define to 1 if you have the gethostbyaddr function. */ 113 | #define HAVE_GETHOSTBYADDR 1 114 | 115 | /* Define to 1 if you have the gethostbyname function. */ 116 | #define HAVE_GETHOSTBYNAME 1 117 | 118 | /* Define to 1 if you have the gethostname function. */ 119 | #define HAVE_GETHOSTNAME 1 120 | 121 | /* Define to 1 if you have the getnameinfo function. */ 122 | #define HAVE_GETNAMEINFO 1 123 | 124 | /* Define to 1 if you have the `gettimeofday' function. */ 125 | #define HAVE_GETTIMEOFDAY 1 126 | 127 | /* Define to 1 if you have the `if_indextoname' function. */ 128 | #define HAVE_IF_INDEXTONAME 1 129 | 130 | /* Define to 1 if you have a IPv6 capable working inet_net_pton function. */ 131 | #define HAVE_INET_NET_PTON 1 132 | 133 | /* Define to 1 if you have a IPv6 capable working inet_ntop function. */ 134 | #define HAVE_INET_NTOP 1 135 | 136 | /* Define to 1 if you have a IPv6 capable working inet_pton function. */ 137 | #define HAVE_INET_PTON 1 138 | 139 | /* Define to 1 if you have the header file. */ 140 | #define HAVE_INTTYPES_H 1 141 | 142 | /* Define to 1 if you have the ioctl function. */ 143 | #define HAVE_IOCTL 1 144 | 145 | /* Define to 1 if you have the ioctlsocket function. */ 146 | /* #undef HAVE_IOCTLSOCKET */ 147 | 148 | /* Define to 1 if you have the IoctlSocket camel case function. */ 149 | /* #undef HAVE_IOCTLSOCKET_CAMEL */ 150 | 151 | /* Define to 1 if you have a working IoctlSocket camel case FIONBIO function. 152 | */ 153 | /* #undef HAVE_IOCTLSOCKET_CAMEL_FIONBIO */ 154 | 155 | /* Define to 1 if you have a working ioctlsocket FIONBIO function. */ 156 | /* #undef HAVE_IOCTLSOCKET_FIONBIO */ 157 | 158 | /* Define to 1 if you have a working ioctl FIONBIO function. */ 159 | #define HAVE_IOCTL_FIONBIO 1 160 | 161 | /* Define to 1 if you have a working ioctl SIOCGIFADDR function. */ 162 | #define HAVE_IOCTL_SIOCGIFADDR 1 163 | 164 | /* Define to 1 if you have the `resolve' library (-lresolve). */ 165 | /* #undef HAVE_LIBRESOLVE */ 166 | 167 | /* Define to 1 if you have the header file. */ 168 | #define HAVE_LIMITS_H 1 169 | 170 | /* if your compiler supports LL */ 171 | #define HAVE_LL 1 172 | 173 | /* Define to 1 if the compiler supports the 'long long' data type. */ 174 | #define HAVE_LONGLONG 1 175 | 176 | /* Define to 1 if you have the malloc.h header file. */ 177 | /* #undef HAVE_MALLOC_H */ 178 | 179 | /* Define to 1 if you have the memory.h header file. */ 180 | #define HAVE_MEMORY_H 1 181 | 182 | /* Define to 1 if you have the MSG_NOSIGNAL flag. */ 183 | /* #undef HAVE_MSG_NOSIGNAL */ 184 | 185 | /* Define to 1 if you have the header file. */ 186 | #define HAVE_NETDB_H 1 187 | 188 | /* Define to 1 if you have the header file. */ 189 | #define HAVE_NETINET_IN_H 1 190 | 191 | /* Define to 1 if you have the header file. */ 192 | #define HAVE_NETINET_TCP_H 1 193 | 194 | /* Define to 1 if you have the header file. */ 195 | #define HAVE_NET_IF_H 1 196 | 197 | /* Define to 1 if you have PF_INET6. */ 198 | #define HAVE_PF_INET6 1 199 | 200 | /* Define to 1 if you have the recv function. */ 201 | #define HAVE_RECV 1 202 | 203 | /* Define to 1 if you have the recvfrom function. */ 204 | #define HAVE_RECVFROM 1 205 | 206 | /* Define to 1 if you have the send function. */ 207 | #define HAVE_SEND 1 208 | 209 | /* Define to 1 if you have the setsockopt function. */ 210 | #define HAVE_SETSOCKOPT 1 211 | 212 | /* Define to 1 if you have a working setsockopt SO_NONBLOCK function. */ 213 | /* #undef HAVE_SETSOCKOPT_SO_NONBLOCK */ 214 | 215 | /* Define to 1 if you have the header file. */ 216 | #define HAVE_SIGNAL_H 1 217 | 218 | /* Define to 1 if sig_atomic_t is an available typedef. */ 219 | #define HAVE_SIG_ATOMIC_T 1 220 | 221 | /* Define to 1 if sig_atomic_t is already defined as volatile. */ 222 | /* #undef HAVE_SIG_ATOMIC_T_VOLATILE */ 223 | 224 | /* Define to 1 if your struct sockaddr_in6 has sin6_scope_id. */ 225 | #define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1 226 | 227 | /* Define to 1 if you have the socket function. */ 228 | #define HAVE_SOCKET 1 229 | 230 | /* Define to 1 if you have the header file. */ 231 | /* #undef HAVE_SOCKET_H */ 232 | 233 | /* Define to 1 if you have the header file. */ 234 | #define HAVE_STDBOOL_H 1 235 | 236 | /* Define to 1 if you have the header file. */ 237 | #define HAVE_STDINT_H 1 238 | 239 | /* Define to 1 if you have the header file. */ 240 | #define HAVE_STDLIB_H 1 241 | 242 | /* Define to 1 if you have the strcasecmp function. */ 243 | #define HAVE_STRCASECMP 1 244 | 245 | /* Define to 1 if you have the strcmpi function. */ 246 | /* #undef HAVE_STRCMPI */ 247 | 248 | /* Define to 1 if you have the strdup function. */ 249 | #define HAVE_STRDUP 1 250 | 251 | /* Define to 1 if you have the stricmp function. */ 252 | /* #undef HAVE_STRICMP */ 253 | 254 | /* Define to 1 if you have the header file. */ 255 | #define HAVE_STRINGS_H 1 256 | 257 | /* Define to 1 if you have the header file. */ 258 | #define HAVE_STRING_H 1 259 | 260 | /* Define to 1 if you have the strncasecmp function. */ 261 | #define HAVE_STRNCASECMP 1 262 | 263 | /* Define to 1 if you have the strncmpi function. */ 264 | /* #undef HAVE_STRNCMPI */ 265 | 266 | /* Define to 1 if you have the strnicmp function. */ 267 | /* #undef HAVE_STRNICMP */ 268 | 269 | /* Define to 1 if you have the header file. */ 270 | /* #undef HAVE_STROPTS_H */ 271 | 272 | /* Define to 1 if you have struct addrinfo. */ 273 | #define HAVE_STRUCT_ADDRINFO 1 274 | 275 | /* Define to 1 if you have struct in6_addr. */ 276 | #define HAVE_STRUCT_IN6_ADDR 1 277 | 278 | /* Define to 1 if you have struct sockaddr_in6. */ 279 | #define HAVE_STRUCT_SOCKADDR_IN6 1 280 | 281 | /* if struct sockaddr_storage is defined */ 282 | #define HAVE_STRUCT_SOCKADDR_STORAGE 1 283 | 284 | /* Define to 1 if you have the timeval struct. */ 285 | #define HAVE_STRUCT_TIMEVAL 1 286 | 287 | /* Define to 1 if you have the header file. */ 288 | #define HAVE_SYS_IOCTL_H 1 289 | 290 | /* Define to 1 if you have the header file. */ 291 | #define HAVE_SYS_PARAM_H 1 292 | 293 | /* Define to 1 if you have the header file. */ 294 | #define HAVE_SYS_SELECT_H 1 295 | 296 | /* Define to 1 if you have the header file. */ 297 | #define HAVE_SYS_SOCKET_H 1 298 | 299 | /* Define to 1 if you have the header file. */ 300 | #define HAVE_SYS_STAT_H 1 301 | 302 | /* Define to 1 if you have the header file. */ 303 | #define HAVE_SYS_TIME_H 1 304 | 305 | /* Define to 1 if you have the header file. */ 306 | #define HAVE_SYS_TYPES_H 1 307 | 308 | /* Define to 1 if you have the header file. */ 309 | #define HAVE_SYS_UIO_H 1 310 | 311 | /* Define to 1 if you have the header file. */ 312 | #define HAVE_TIME_H 1 313 | 314 | /* Define to 1 if you have the header file. */ 315 | #define HAVE_UNISTD_H 1 316 | 317 | /* Define to 1 if you have the windows.h header file. */ 318 | /* #undef HAVE_WINDOWS_H */ 319 | 320 | /* Define to 1 if you have the winsock2.h header file. */ 321 | /* #undef HAVE_WINSOCK2_H */ 322 | 323 | /* Define to 1 if you have the winsock.h header file. */ 324 | /* #undef HAVE_WINSOCK_H */ 325 | 326 | /* Define to 1 if you have the writev function. */ 327 | #define HAVE_WRITEV 1 328 | 329 | /* Define to 1 if you have the ws2tcpip.h header file. */ 330 | /* #undef HAVE_WS2TCPIP_H */ 331 | 332 | /* Define to the sub-directory where libtool stores uninstalled libraries. */ 333 | #define LT_OBJDIR ".libs/" 334 | 335 | /* Define to 1 if you need the malloc.h header file even with stdlib.h */ 336 | /* #undef NEED_MALLOC_H */ 337 | 338 | /* Define to 1 if you need the memory.h header file even with stdlib.h */ 339 | /* #undef NEED_MEMORY_H */ 340 | 341 | /* Define to 1 if _REENTRANT preprocessor symbol must be defined. */ 342 | /* #undef NEED_REENTRANT */ 343 | 344 | /* Define to 1 if _THREAD_SAFE preprocessor symbol must be defined. */ 345 | /* #undef NEED_THREAD_SAFE */ 346 | 347 | /* cpu-machine-OS */ 348 | #define OS "x86_64-apple-darwin16.7.0" 349 | 350 | /* Name of package */ 351 | #define PACKAGE "c-ares" 352 | 353 | /* Define to the address where bug reports for this package should be sent. */ 354 | #define PACKAGE_BUGREPORT "c-ares mailing list: http://cool.haxx.se/mailman/listinfo/c-ares" 355 | 356 | /* Define to the full name of this package. */ 357 | #define PACKAGE_NAME "c-ares" 358 | 359 | /* Define to the full name and version of this package. */ 360 | #define PACKAGE_STRING "c-ares 1.13.0" 361 | 362 | /* Define to the one symbol short name of this package. */ 363 | #define PACKAGE_TARNAME "c-ares" 364 | 365 | /* Define to the home page for this package. */ 366 | #define PACKAGE_URL "" 367 | 368 | /* Define to the version of this package. */ 369 | #define PACKAGE_VERSION "1.13.0" 370 | 371 | /* a suitable file/device to read random data from */ 372 | #define CARES_RANDOM_FILE "/dev/urandom" 373 | 374 | /* Define to the type qualifier pointed by arg 5 for recvfrom. */ 375 | #define RECVFROM_QUAL_ARG5 376 | 377 | /* Define to the type of arg 1 for recvfrom. */ 378 | #define RECVFROM_TYPE_ARG1 int 379 | 380 | /* Define to the type pointed by arg 2 for recvfrom. */ 381 | #define RECVFROM_TYPE_ARG2 void 382 | 383 | /* Define to 1 if the type pointed by arg 2 for recvfrom is void. */ 384 | #define RECVFROM_TYPE_ARG2_IS_VOID 1 385 | 386 | /* Define to the type of arg 3 for recvfrom. */ 387 | #define RECVFROM_TYPE_ARG3 size_t 388 | 389 | /* Define to the type of arg 4 for recvfrom. */ 390 | #define RECVFROM_TYPE_ARG4 int 391 | 392 | /* Define to the type pointed by arg 5 for recvfrom. */ 393 | #define RECVFROM_TYPE_ARG5 struct sockaddr 394 | 395 | /* Define to 1 if the type pointed by arg 5 for recvfrom is void. */ 396 | /* #undef RECVFROM_TYPE_ARG5_IS_VOID */ 397 | 398 | /* Define to the type pointed by arg 6 for recvfrom. */ 399 | #define RECVFROM_TYPE_ARG6 socklen_t 400 | 401 | /* Define to 1 if the type pointed by arg 6 for recvfrom is void. */ 402 | /* #undef RECVFROM_TYPE_ARG6_IS_VOID */ 403 | 404 | /* Define to the function return type for recvfrom. */ 405 | #define RECVFROM_TYPE_RETV ssize_t 406 | 407 | /* Define to the type of arg 1 for recv. */ 408 | #define RECV_TYPE_ARG1 int 409 | 410 | /* Define to the type of arg 2 for recv. */ 411 | #define RECV_TYPE_ARG2 void * 412 | 413 | /* Define to the type of arg 3 for recv. */ 414 | #define RECV_TYPE_ARG3 size_t 415 | 416 | /* Define to the type of arg 4 for recv. */ 417 | #define RECV_TYPE_ARG4 int 418 | 419 | /* Define to the function return type for recv. */ 420 | #define RECV_TYPE_RETV ssize_t 421 | 422 | /* Define as the return type of signal handlers (`int' or `void'). */ 423 | #define RETSIGTYPE void 424 | 425 | /* Define to the type qualifier of arg 2 for send. */ 426 | #define SEND_QUAL_ARG2 const 427 | 428 | /* Define to the type of arg 1 for send. */ 429 | #define SEND_TYPE_ARG1 int 430 | 431 | /* Define to the type of arg 2 for send. */ 432 | #define SEND_TYPE_ARG2 void * 433 | 434 | /* Define to the type of arg 3 for send. */ 435 | #define SEND_TYPE_ARG3 size_t 436 | 437 | /* Define to the type of arg 4 for send. */ 438 | #define SEND_TYPE_ARG4 int 439 | 440 | /* Define to the function return type for send. */ 441 | #define SEND_TYPE_RETV ssize_t 442 | 443 | /* Define to 1 if you have the ANSI C header files. */ 444 | #define STDC_HEADERS 1 445 | 446 | /* Define to 1 if you can safely include both and . */ 447 | #define TIME_WITH_SYS_TIME 1 448 | 449 | /* Define to disable non-blocking sockets. */ 450 | /* #undef USE_BLOCKING_SOCKETS */ 451 | 452 | /* Version number of package */ 453 | #define VERSION "1.13.0" 454 | 455 | /* Define to avoid automatic inclusion of winsock.h */ 456 | /* #undef WIN32_LEAN_AND_MEAN */ 457 | 458 | /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most 459 | significant byte first (like Motorola and SPARC, unlike Intel). */ 460 | #if defined AC_APPLE_UNIVERSAL_BUILD 461 | # if defined __BIG_ENDIAN__ 462 | # define WORDS_BIGENDIAN 1 463 | # endif 464 | #else 465 | # ifndef WORDS_BIGENDIAN 466 | /* # undef WORDS_BIGENDIAN */ 467 | # endif 468 | #endif 469 | 470 | /* Define to 1 if OS is AIX. */ 471 | #ifndef _ALL_SOURCE 472 | /* # undef _ALL_SOURCE */ 473 | #endif 474 | 475 | /* Enable large inode numbers on Mac OS X 10.5. */ 476 | #ifndef _DARWIN_USE_64_BIT_INODE 477 | # define _DARWIN_USE_64_BIT_INODE 1 478 | #endif 479 | 480 | /* Number of bits in a file offset, on hosts where this is settable. */ 481 | /* #undef _FILE_OFFSET_BITS */ 482 | 483 | /* Define for large files, on AIX-style hosts. */ 484 | /* #undef _LARGE_FILES */ 485 | 486 | /* Define to empty if `const' does not conform to ANSI C. */ 487 | /* #undef const */ 488 | 489 | /* Type to use in place of in_addr_t when system does not provide it. */ 490 | /* #undef in_addr_t */ 491 | 492 | /* Define to `unsigned int' if does not define. */ 493 | /* #undef size_t */ 494 | -------------------------------------------------------------------------------- /deps/build-config/config_linux/ares_config.h: -------------------------------------------------------------------------------- 1 | /* ares_config.h. Generated from ares_config.h.in by configure. */ 2 | /* ares_config.h.in. Generated from configure.ac by autoheader. */ 3 | 4 | /* Define if building universal (internal helper macro) */ 5 | /* #undef AC_APPLE_UNIVERSAL_BUILD */ 6 | 7 | /* define this if ares is built for a big endian system */ 8 | /* #undef ARES_BIG_ENDIAN */ 9 | 10 | /* when building as static part of libcurl */ 11 | /* #undef BUILDING_LIBCURL */ 12 | 13 | /* Defined for build that exposes internal static functions for testing. */ 14 | /* #undef CARES_EXPOSE_STATICS */ 15 | 16 | /* Defined for build with symbol hiding. */ 17 | #define CARES_SYMBOL_HIDING 1 18 | 19 | /* Definition to make a library symbol externally visible. */ 20 | #define CARES_SYMBOL_SCOPE_EXTERN __attribute__ ((__visibility__ ("default"))) 21 | 22 | /* the signed version of size_t */ 23 | #define CARES_TYPEOF_ARES_SSIZE_T ssize_t 24 | 25 | /* Use resolver library to configure cares */ 26 | /* #undef CARES_USE_LIBRESOLV */ 27 | 28 | /* if a /etc/inet dir is being used */ 29 | /* #undef ETC_INET */ 30 | 31 | /* Define to the type of arg 2 for gethostname. */ 32 | #define GETHOSTNAME_TYPE_ARG2 size_t 33 | 34 | /* Define to the type qualifier of arg 1 for getnameinfo. */ 35 | #define GETNAMEINFO_QUAL_ARG1 const 36 | 37 | /* Define to the type of arg 1 for getnameinfo. */ 38 | #define GETNAMEINFO_TYPE_ARG1 struct sockaddr * 39 | 40 | /* Define to the type of arg 2 for getnameinfo. */ 41 | #define GETNAMEINFO_TYPE_ARG2 socklen_t 42 | 43 | /* Define to the type of args 4 and 6 for getnameinfo. */ 44 | #define GETNAMEINFO_TYPE_ARG46 socklen_t 45 | 46 | /* Define to the type of arg 7 for getnameinfo. */ 47 | #define GETNAMEINFO_TYPE_ARG7 int 48 | 49 | /* Specifies the number of arguments to getservbyport_r */ 50 | #define GETSERVBYPORT_R_ARGS 6 51 | 52 | /* Specifies the size of the buffer to pass to getservbyport_r */ 53 | #define GETSERVBYPORT_R_BUFSIZE 4096 54 | 55 | /* Define to 1 if you have AF_INET6. */ 56 | #define HAVE_AF_INET6 1 57 | 58 | /* Define to 1 if you have the header file. */ 59 | #define HAVE_ARPA_INET_H 1 60 | 61 | /* Define to 1 if you have the header file. */ 62 | #define HAVE_ARPA_NAMESER_COMPAT_H 1 63 | 64 | /* Define to 1 if you have the header file. */ 65 | #define HAVE_ARPA_NAMESER_H 1 66 | 67 | /* Define to 1 if you have the header file. */ 68 | #define HAVE_ASSERT_H 1 69 | 70 | /* Define to 1 if you have the `bitncmp' function. */ 71 | /* #undef HAVE_BITNCMP */ 72 | 73 | /* Define to 1 if bool is an available type. */ 74 | #define HAVE_BOOL_T 1 75 | 76 | /* Define to 1 if you have the clock_gettime function and monotonic timer. */ 77 | #define HAVE_CLOCK_GETTIME_MONOTONIC 1 78 | 79 | /* Define to 1 if you have the closesocket function. */ 80 | /* #undef HAVE_CLOSESOCKET */ 81 | 82 | /* Define to 1 if you have the CloseSocket camel case function. */ 83 | /* #undef HAVE_CLOSESOCKET_CAMEL */ 84 | 85 | /* Define to 1 if you have the connect function. */ 86 | #define HAVE_CONNECT 1 87 | 88 | /* define if the compiler supports basic C++11 syntax */ 89 | #define HAVE_CXX11 1 90 | 91 | /* Define to 1 if you have the header file. */ 92 | #define HAVE_DLFCN_H 1 93 | 94 | /* Define to 1 if you have the header file. */ 95 | #define HAVE_ERRNO_H 1 96 | 97 | /* Define to 1 if you have the fcntl function. */ 98 | #define HAVE_FCNTL 1 99 | 100 | /* Define to 1 if you have the header file. */ 101 | #define HAVE_FCNTL_H 1 102 | 103 | /* Define to 1 if you have a working fcntl O_NONBLOCK function. */ 104 | #define HAVE_FCNTL_O_NONBLOCK 1 105 | 106 | /* Define to 1 if you have the freeaddrinfo function. */ 107 | #define HAVE_FREEADDRINFO 1 108 | 109 | /* Define to 1 if you have a working getaddrinfo function. */ 110 | #define HAVE_GETADDRINFO 1 111 | 112 | /* Define to 1 if the getaddrinfo function is threadsafe. */ 113 | #define HAVE_GETADDRINFO_THREADSAFE 1 114 | 115 | /* Define to 1 if you have the getenv function. */ 116 | #define HAVE_GETENV 1 117 | 118 | /* Define to 1 if you have the gethostbyaddr function. */ 119 | #define HAVE_GETHOSTBYADDR 1 120 | 121 | /* Define to 1 if you have the gethostbyname function. */ 122 | #define HAVE_GETHOSTBYNAME 1 123 | 124 | /* Define to 1 if you have the gethostname function. */ 125 | #define HAVE_GETHOSTNAME 1 126 | 127 | /* Define to 1 if you have the getnameinfo function. */ 128 | #define HAVE_GETNAMEINFO 1 129 | 130 | /* Define to 1 if you have the getservbyport_r function. */ 131 | #define HAVE_GETSERVBYPORT_R 1 132 | 133 | /* Define to 1 if you have the `gettimeofday' function. */ 134 | #define HAVE_GETTIMEOFDAY 1 135 | 136 | /* Define to 1 if you have the `if_indextoname' function. */ 137 | #define HAVE_IF_INDEXTONAME 1 138 | 139 | /* Define to 1 if you have a IPv6 capable working inet_net_pton function. */ 140 | /* #undef HAVE_INET_NET_PTON */ 141 | 142 | /* Define to 1 if you have a IPv6 capable working inet_ntop function. */ 143 | #define HAVE_INET_NTOP 1 144 | 145 | /* Define to 1 if you have a IPv6 capable working inet_pton function. */ 146 | #define HAVE_INET_PTON 1 147 | 148 | /* Define to 1 if you have the header file. */ 149 | #define HAVE_INTTYPES_H 1 150 | 151 | /* Define to 1 if you have the ioctl function. */ 152 | #define HAVE_IOCTL 1 153 | 154 | /* Define to 1 if you have the ioctlsocket function. */ 155 | /* #undef HAVE_IOCTLSOCKET */ 156 | 157 | /* Define to 1 if you have the IoctlSocket camel case function. */ 158 | /* #undef HAVE_IOCTLSOCKET_CAMEL */ 159 | 160 | /* Define to 1 if you have a working IoctlSocket camel case FIONBIO function. 161 | */ 162 | /* #undef HAVE_IOCTLSOCKET_CAMEL_FIONBIO */ 163 | 164 | /* Define to 1 if you have a working ioctlsocket FIONBIO function. */ 165 | /* #undef HAVE_IOCTLSOCKET_FIONBIO */ 166 | 167 | /* Define to 1 if you have a working ioctl FIONBIO function. */ 168 | #define HAVE_IOCTL_FIONBIO 1 169 | 170 | /* Define to 1 if you have a working ioctl SIOCGIFADDR function. */ 171 | #define HAVE_IOCTL_SIOCGIFADDR 1 172 | 173 | /* Define to 1 if you have the `resolve' library (-lresolve). */ 174 | /* #undef HAVE_LIBRESOLVE */ 175 | 176 | /* Define to 1 if you have the header file. */ 177 | #define HAVE_LIMITS_H 1 178 | 179 | /* if your compiler supports LL */ 180 | #define HAVE_LL 1 181 | 182 | /* Define to 1 if the compiler supports the 'long long' data type. */ 183 | #define HAVE_LONGLONG 1 184 | 185 | /* Define to 1 if you have the malloc.h header file. */ 186 | #define HAVE_MALLOC_H 1 187 | 188 | /* Define to 1 if you have the memory.h header file. */ 189 | #define HAVE_MEMORY_H 1 190 | 191 | /* Define to 1 if you have the MSG_NOSIGNAL flag. */ 192 | #define HAVE_MSG_NOSIGNAL 1 193 | 194 | /* Define to 1 if you have the header file. */ 195 | #define HAVE_NETDB_H 1 196 | 197 | /* Define to 1 if you have the header file. */ 198 | #define HAVE_NETINET_IN_H 1 199 | 200 | /* Define to 1 if you have the header file. */ 201 | #define HAVE_NETINET_TCP_H 1 202 | 203 | /* Define to 1 if you have the header file. */ 204 | #define HAVE_NET_IF_H 1 205 | 206 | /* Define to 1 if you have PF_INET6. */ 207 | #define HAVE_PF_INET6 1 208 | 209 | /* Define to 1 if you have the recv function. */ 210 | #define HAVE_RECV 1 211 | 212 | /* Define to 1 if you have the recvfrom function. */ 213 | #define HAVE_RECVFROM 1 214 | 215 | /* Define to 1 if you have the send function. */ 216 | #define HAVE_SEND 1 217 | 218 | /* Define to 1 if you have the setsockopt function. */ 219 | #define HAVE_SETSOCKOPT 1 220 | 221 | /* Define to 1 if you have a working setsockopt SO_NONBLOCK function. */ 222 | /* #undef HAVE_SETSOCKOPT_SO_NONBLOCK */ 223 | 224 | /* Define to 1 if you have the header file. */ 225 | #define HAVE_SIGNAL_H 1 226 | 227 | /* Define to 1 if sig_atomic_t is an available typedef. */ 228 | #define HAVE_SIG_ATOMIC_T 1 229 | 230 | /* Define to 1 if sig_atomic_t is already defined as volatile. */ 231 | /* #undef HAVE_SIG_ATOMIC_T_VOLATILE */ 232 | 233 | /* Define to 1 if your struct sockaddr_in6 has sin6_scope_id. */ 234 | #define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1 235 | 236 | /* Define to 1 if you have the socket function. */ 237 | #define HAVE_SOCKET 1 238 | 239 | /* Define to 1 if you have the header file. */ 240 | /* #undef HAVE_SOCKET_H */ 241 | 242 | /* Define to 1 if you have the header file. */ 243 | #define HAVE_STDBOOL_H 1 244 | 245 | /* Define to 1 if you have the header file. */ 246 | #define HAVE_STDINT_H 1 247 | 248 | /* Define to 1 if you have the header file. */ 249 | #define HAVE_STDLIB_H 1 250 | 251 | /* Define to 1 if you have the strcasecmp function. */ 252 | #define HAVE_STRCASECMP 1 253 | 254 | /* Define to 1 if you have the strcmpi function. */ 255 | /* #undef HAVE_STRCMPI */ 256 | 257 | /* Define to 1 if you have the strdup function. */ 258 | #define HAVE_STRDUP 1 259 | 260 | /* Define to 1 if you have the stricmp function. */ 261 | /* #undef HAVE_STRICMP */ 262 | 263 | /* Define to 1 if you have the header file. */ 264 | #define HAVE_STRINGS_H 1 265 | 266 | /* Define to 1 if you have the header file. */ 267 | #define HAVE_STRING_H 1 268 | 269 | /* Define to 1 if you have the strncasecmp function. */ 270 | #define HAVE_STRNCASECMP 1 271 | 272 | /* Define to 1 if you have the strncmpi function. */ 273 | /* #undef HAVE_STRNCMPI */ 274 | 275 | /* Define to 1 if you have the strnicmp function. */ 276 | /* #undef HAVE_STRNICMP */ 277 | 278 | /* Define to 1 if you have the header file. */ 279 | #define HAVE_STROPTS_H 1 280 | 281 | /* Define to 1 if you have struct addrinfo. */ 282 | #define HAVE_STRUCT_ADDRINFO 1 283 | 284 | /* Define to 1 if you have struct in6_addr. */ 285 | #define HAVE_STRUCT_IN6_ADDR 1 286 | 287 | /* Define to 1 if you have struct sockaddr_in6. */ 288 | #define HAVE_STRUCT_SOCKADDR_IN6 1 289 | 290 | /* if struct sockaddr_storage is defined */ 291 | #define HAVE_STRUCT_SOCKADDR_STORAGE 1 292 | 293 | /* Define to 1 if you have the timeval struct. */ 294 | #define HAVE_STRUCT_TIMEVAL 1 295 | 296 | /* Define to 1 if you have the header file. */ 297 | #define HAVE_SYS_IOCTL_H 1 298 | 299 | /* Define to 1 if you have the header file. */ 300 | #define HAVE_SYS_PARAM_H 1 301 | 302 | /* Define to 1 if you have the header file. */ 303 | #define HAVE_SYS_SELECT_H 1 304 | 305 | /* Define to 1 if you have the header file. */ 306 | #define HAVE_SYS_SOCKET_H 1 307 | 308 | /* Define to 1 if you have the header file. */ 309 | #define HAVE_SYS_STAT_H 1 310 | 311 | /* Define to 1 if you have the header file. */ 312 | #define HAVE_SYS_TIME_H 1 313 | 314 | /* Define to 1 if you have the header file. */ 315 | #define HAVE_SYS_TYPES_H 1 316 | 317 | /* Define to 1 if you have the header file. */ 318 | #define HAVE_SYS_UIO_H 1 319 | 320 | /* Define to 1 if you have the header file. */ 321 | #define HAVE_TIME_H 1 322 | 323 | /* Define to 1 if you have the header file. */ 324 | #define HAVE_UNISTD_H 1 325 | 326 | /* Define to 1 if you have the windows.h header file. */ 327 | /* #undef HAVE_WINDOWS_H */ 328 | 329 | /* Define to 1 if you have the winsock2.h header file. */ 330 | /* #undef HAVE_WINSOCK2_H */ 331 | 332 | /* Define to 1 if you have the winsock.h header file. */ 333 | /* #undef HAVE_WINSOCK_H */ 334 | 335 | /* Define to 1 if you have the writev function. */ 336 | #define HAVE_WRITEV 1 337 | 338 | /* Define to 1 if you have the ws2tcpip.h header file. */ 339 | /* #undef HAVE_WS2TCPIP_H */ 340 | 341 | /* Define to the sub-directory where libtool stores uninstalled libraries. */ 342 | #define LT_OBJDIR ".libs/" 343 | 344 | /* Define to 1 if you need the malloc.h header file even with stdlib.h */ 345 | /* #undef NEED_MALLOC_H */ 346 | 347 | /* Define to 1 if you need the memory.h header file even with stdlib.h */ 348 | /* #undef NEED_MEMORY_H */ 349 | 350 | /* Define to 1 if _REENTRANT preprocessor symbol must be defined. */ 351 | /* #undef NEED_REENTRANT */ 352 | 353 | /* Define to 1 if _THREAD_SAFE preprocessor symbol must be defined. */ 354 | /* #undef NEED_THREAD_SAFE */ 355 | 356 | /* cpu-machine-OS */ 357 | #define OS "x86_64-pc-linux-gnu" 358 | 359 | /* Name of package */ 360 | #define PACKAGE "c-ares" 361 | 362 | /* Define to the address where bug reports for this package should be sent. */ 363 | #define PACKAGE_BUGREPORT "c-ares mailing list: http://cool.haxx.se/mailman/listinfo/c-ares" 364 | 365 | /* Define to the full name of this package. */ 366 | #define PACKAGE_NAME "c-ares" 367 | 368 | /* Define to the full name and version of this package. */ 369 | #define PACKAGE_STRING "c-ares 1.13.0" 370 | 371 | /* Define to the one symbol short name of this package. */ 372 | #define PACKAGE_TARNAME "c-ares" 373 | 374 | /* Define to the home page for this package. */ 375 | #define PACKAGE_URL "" 376 | 377 | /* Define to the version of this package. */ 378 | #define PACKAGE_VERSION "1.13.0" 379 | 380 | /* a suitable file/device to read random data from */ 381 | #define CARES_RANDOM_FILE "/dev/urandom" 382 | 383 | /* Define to the type qualifier pointed by arg 5 for recvfrom. */ 384 | #define RECVFROM_QUAL_ARG5 385 | 386 | /* Define to the type of arg 1 for recvfrom. */ 387 | #define RECVFROM_TYPE_ARG1 int 388 | 389 | /* Define to the type pointed by arg 2 for recvfrom. */ 390 | #define RECVFROM_TYPE_ARG2 void 391 | 392 | /* Define to 1 if the type pointed by arg 2 for recvfrom is void. */ 393 | #define RECVFROM_TYPE_ARG2_IS_VOID 1 394 | 395 | /* Define to the type of arg 3 for recvfrom. */ 396 | #define RECVFROM_TYPE_ARG3 size_t 397 | 398 | /* Define to the type of arg 4 for recvfrom. */ 399 | #define RECVFROM_TYPE_ARG4 int 400 | 401 | /* Define to the type pointed by arg 5 for recvfrom. */ 402 | #define RECVFROM_TYPE_ARG5 struct sockaddr 403 | 404 | /* Define to 1 if the type pointed by arg 5 for recvfrom is void. */ 405 | /* #undef RECVFROM_TYPE_ARG5_IS_VOID */ 406 | 407 | /* Define to the type pointed by arg 6 for recvfrom. */ 408 | #define RECVFROM_TYPE_ARG6 socklen_t 409 | 410 | /* Define to 1 if the type pointed by arg 6 for recvfrom is void. */ 411 | /* #undef RECVFROM_TYPE_ARG6_IS_VOID */ 412 | 413 | /* Define to the function return type for recvfrom. */ 414 | #define RECVFROM_TYPE_RETV ssize_t 415 | 416 | /* Define to the type of arg 1 for recv. */ 417 | #define RECV_TYPE_ARG1 int 418 | 419 | /* Define to the type of arg 2 for recv. */ 420 | #define RECV_TYPE_ARG2 void * 421 | 422 | /* Define to the type of arg 3 for recv. */ 423 | #define RECV_TYPE_ARG3 size_t 424 | 425 | /* Define to the type of arg 4 for recv. */ 426 | #define RECV_TYPE_ARG4 int 427 | 428 | /* Define to the function return type for recv. */ 429 | #define RECV_TYPE_RETV ssize_t 430 | 431 | /* Define as the return type of signal handlers (`int' or `void'). */ 432 | #define RETSIGTYPE void 433 | 434 | /* Define to the type qualifier of arg 2 for send. */ 435 | #define SEND_QUAL_ARG2 const 436 | 437 | /* Define to the type of arg 1 for send. */ 438 | #define SEND_TYPE_ARG1 int 439 | 440 | /* Define to the type of arg 2 for send. */ 441 | #define SEND_TYPE_ARG2 void * 442 | 443 | /* Define to the type of arg 3 for send. */ 444 | #define SEND_TYPE_ARG3 size_t 445 | 446 | /* Define to the type of arg 4 for send. */ 447 | #define SEND_TYPE_ARG4 int 448 | 449 | /* Define to the function return type for send. */ 450 | #define SEND_TYPE_RETV ssize_t 451 | 452 | /* Define to 1 if you have the ANSI C header files. */ 453 | #define STDC_HEADERS 1 454 | 455 | /* Define to 1 if you can safely include both and . */ 456 | #define TIME_WITH_SYS_TIME 1 457 | 458 | /* Define to disable non-blocking sockets. */ 459 | /* #undef USE_BLOCKING_SOCKETS */ 460 | 461 | /* Version number of package */ 462 | #define VERSION "1.13.0" 463 | 464 | /* Define to avoid automatic inclusion of winsock.h */ 465 | /* #undef WIN32_LEAN_AND_MEAN */ 466 | 467 | /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most 468 | significant byte first (like Motorola and SPARC, unlike Intel). */ 469 | #if defined AC_APPLE_UNIVERSAL_BUILD 470 | # if defined __BIG_ENDIAN__ 471 | # define WORDS_BIGENDIAN 1 472 | # endif 473 | #else 474 | # ifndef WORDS_BIGENDIAN 475 | /* # undef WORDS_BIGENDIAN */ 476 | # endif 477 | #endif 478 | 479 | /* Define to 1 if OS is AIX. */ 480 | #ifndef _ALL_SOURCE 481 | /* # undef _ALL_SOURCE */ 482 | #endif 483 | 484 | /* Enable large inode numbers on Mac OS X 10.5. */ 485 | #ifndef _DARWIN_USE_64_BIT_INODE 486 | # define _DARWIN_USE_64_BIT_INODE 1 487 | #endif 488 | 489 | /* Number of bits in a file offset, on hosts where this is settable. */ 490 | /* #undef _FILE_OFFSET_BITS */ 491 | 492 | /* Define for large files, on AIX-style hosts. */ 493 | /* #undef _LARGE_FILES */ 494 | 495 | /* Define to empty if `const' does not conform to ANSI C. */ 496 | /* #undef const */ 497 | 498 | /* Type to use in place of in_addr_t when system does not provide it. */ 499 | /* #undef in_addr_t */ 500 | 501 | /* Define to `unsigned int' if does not define. */ 502 | /* #undef size_t */ 503 | -------------------------------------------------------------------------------- /deps/build-config/config_netbsd/ares_config.h: -------------------------------------------------------------------------------- 1 | /* ares_config.h. Generated from ares_config.h.in by configure. */ 2 | /* ares_config.h.in. Generated from configure.ac by autoheader. */ 3 | 4 | /* Define if building universal (internal helper macro) */ 5 | /* #undef AC_APPLE_UNIVERSAL_BUILD */ 6 | 7 | /* define this if ares is built for a big endian system */ 8 | /* #undef ARES_BIG_ENDIAN */ 9 | 10 | /* when building as static part of libcurl */ 11 | /* #undef BUILDING_LIBCURL */ 12 | 13 | /* Defined for build that exposes internal static functions for testing. */ 14 | /* #undef CARES_EXPOSE_STATICS */ 15 | 16 | /* Defined for build with symbol hiding. */ 17 | /* #undef CARES_SYMBOL_HIDING */ 18 | 19 | /* the signed version of size_t */ 20 | #define CARES_TYPEOF_ARES_SSIZE_T ssize_t 21 | 22 | /* Definition to make a library symbol externally visible. */ 23 | /* #undef CARES_SYMBOL_SCOPE_EXTERN */ 24 | 25 | /* Use resolver library to configure cares */ 26 | /* #undef CARES_USE_LIBRESOLV */ 27 | 28 | /* if a /etc/inet dir is being used */ 29 | /* #undef ETC_INET */ 30 | 31 | /* Define to the type of arg 2 for gethostname. */ 32 | #define GETHOSTNAME_TYPE_ARG2 size_t 33 | 34 | /* Define to the type qualifier of arg 1 for getnameinfo. */ 35 | #define GETNAMEINFO_QUAL_ARG1 const 36 | 37 | /* Define to the type of arg 1 for getnameinfo. */ 38 | #define GETNAMEINFO_TYPE_ARG1 struct sockaddr * 39 | 40 | /* Define to the type of arg 2 for getnameinfo. */ 41 | #define GETNAMEINFO_TYPE_ARG2 socklen_t 42 | 43 | /* Define to the type of args 4 and 6 for getnameinfo. */ 44 | #define GETNAMEINFO_TYPE_ARG46 size_t 45 | 46 | /* Define to the type of arg 7 for getnameinfo. */ 47 | #define GETNAMEINFO_TYPE_ARG7 int 48 | 49 | /* Specifies the number of arguments to getservbyport_r */ 50 | #define GETSERVBYPORT_R_ARGS 4 51 | 52 | /* Specifies the size of the buffer to pass to getservbyport_r */ 53 | #define GETSERVBYPORT_R_BUFSIZE sizeof(struct servent_data) 54 | 55 | /* Define to 1 if you have AF_INET6. */ 56 | #define HAVE_AF_INET6 1 57 | 58 | /* Define to 1 if you have the header file. */ 59 | #define HAVE_ARPA_INET_H 1 60 | 61 | /* Define to 1 if you have the header file. */ 62 | /* #undef HAVE_ARPA_NAMESER_COMPAT_H */ 63 | 64 | /* Define to 1 if you have the header file. */ 65 | #define HAVE_ARPA_NAMESER_H 1 66 | 67 | /* Define to 1 if you have the header file. */ 68 | #define HAVE_ASSERT_H 1 69 | 70 | /* Define to 1 if you have the `bitncmp' function. */ 71 | /* #undef HAVE_BITNCMP */ 72 | 73 | /* Define to 1 if bool is an available type. */ 74 | #define HAVE_BOOL_T 1 75 | 76 | /* Define to 1 if you have the clock_gettime function and monotonic timer. */ 77 | #define HAVE_CLOCK_GETTIME_MONOTONIC 1 78 | 79 | /* Define to 1 if you have the closesocket function. */ 80 | /* #undef HAVE_CLOSESOCKET */ 81 | 82 | /* Define to 1 if you have the CloseSocket camel case function. */ 83 | /* #undef HAVE_CLOSESOCKET_CAMEL */ 84 | 85 | /* Define to 1 if you have the connect function. */ 86 | #define HAVE_CONNECT 1 87 | 88 | /* define if the compiler supports basic C++11 syntax */ 89 | #define HAVE_CXX11 1 90 | 91 | /* Define to 1 if you have the header file. */ 92 | #define HAVE_DLFCN_H 1 93 | 94 | /* Define to 1 if you have the header file. */ 95 | #define HAVE_ERRNO_H 1 96 | 97 | /* Define to 1 if you have the fcntl function. */ 98 | #define HAVE_FCNTL 1 99 | 100 | /* Define to 1 if you have the header file. */ 101 | #define HAVE_FCNTL_H 1 102 | 103 | /* Define to 1 if you have a working fcntl O_NONBLOCK function. */ 104 | #define HAVE_FCNTL_O_NONBLOCK 1 105 | 106 | /* Define to 1 if you have the freeaddrinfo function. */ 107 | #define HAVE_FREEADDRINFO 1 108 | 109 | /* Define to 1 if you have a working getaddrinfo function. */ 110 | #define HAVE_GETADDRINFO 1 111 | 112 | /* Define to 1 if the getaddrinfo function is threadsafe. */ 113 | /* #undef HAVE_GETADDRINFO_THREADSAFE */ 114 | 115 | /* Define to 1 if you have the getenv function. */ 116 | #define HAVE_GETENV 1 117 | 118 | /* Define to 1 if you have the gethostbyaddr function. */ 119 | #define HAVE_GETHOSTBYADDR 1 120 | 121 | /* Define to 1 if you have the gethostbyname function. */ 122 | #define HAVE_GETHOSTBYNAME 1 123 | 124 | /* Define to 1 if you have the gethostname function. */ 125 | #define HAVE_GETHOSTNAME 1 126 | 127 | /* Define to 1 if you have the getnameinfo function. */ 128 | #define HAVE_GETNAMEINFO 1 129 | 130 | /* Define to 1 if you have the getservbyport_r function. */ 131 | #define HAVE_GETSERVBYPORT_R 1 132 | 133 | /* Define to 1 if you have the `gettimeofday' function. */ 134 | #define HAVE_GETTIMEOFDAY 1 135 | 136 | /* Define to 1 if you have the `if_indextoname' function. */ 137 | #define HAVE_IF_INDEXTONAME 1 138 | 139 | /* Define to 1 if you have a IPv6 capable working inet_net_pton function. */ 140 | #define HAVE_INET_NET_PTON 1 141 | 142 | /* Define to 1 if you have a IPv6 capable working inet_ntop function. */ 143 | #define HAVE_INET_NTOP 1 144 | 145 | /* Define to 1 if you have a IPv6 capable working inet_pton function. */ 146 | #define HAVE_INET_PTON 1 147 | 148 | /* Define to 1 if you have the header file. */ 149 | #define HAVE_INTTYPES_H 1 150 | 151 | /* Define to 1 if you have the ioctl function. */ 152 | #define HAVE_IOCTL 1 153 | 154 | /* Define to 1 if you have the ioctlsocket function. */ 155 | /* #undef HAVE_IOCTLSOCKET */ 156 | 157 | /* Define to 1 if you have the IoctlSocket camel case function. */ 158 | /* #undef HAVE_IOCTLSOCKET_CAMEL */ 159 | 160 | /* Define to 1 if you have a working IoctlSocket camel case FIONBIO function. 161 | */ 162 | /* #undef HAVE_IOCTLSOCKET_CAMEL_FIONBIO */ 163 | 164 | /* Define to 1 if you have a working ioctlsocket FIONBIO function. */ 165 | /* #undef HAVE_IOCTLSOCKET_FIONBIO */ 166 | 167 | /* Define to 1 if you have a working ioctl FIONBIO function. */ 168 | #define HAVE_IOCTL_FIONBIO 1 169 | 170 | /* Define to 1 if you have a working ioctl SIOCGIFADDR function. */ 171 | #define HAVE_IOCTL_SIOCGIFADDR 1 172 | 173 | /* Define to 1 if you have the `resolve' library (-lresolve). */ 174 | /* #undef HAVE_LIBRESOLVE */ 175 | 176 | /* Define to 1 if you have the header file. */ 177 | #define HAVE_LIMITS_H 1 178 | 179 | /* if your compiler supports LL */ 180 | #define HAVE_LL 1 181 | 182 | /* Define to 1 if the compiler supports the 'long long' data type. */ 183 | #define HAVE_LONGLONG 1 184 | 185 | /* Define to 1 if you have the malloc.h header file. */ 186 | #define HAVE_MALLOC_H 1 187 | 188 | /* Define to 1 if you have the memory.h header file. */ 189 | #define HAVE_MEMORY_H 1 190 | 191 | /* Define to 1 if you have the MSG_NOSIGNAL flag. */ 192 | /* #undef HAVE_MSG_NOSIGNAL */ 193 | 194 | /* Define to 1 if you have the header file. */ 195 | #define HAVE_NETDB_H 1 196 | 197 | /* Define to 1 if you have the header file. */ 198 | #define HAVE_NETINET_IN_H 1 199 | 200 | /* Define to 1 if you have the header file. */ 201 | #define HAVE_NETINET_TCP_H 1 202 | 203 | /* Define to 1 if you have the header file. */ 204 | #define HAVE_NET_IF_H 1 205 | 206 | /* Define to 1 if you have PF_INET6. */ 207 | #define HAVE_PF_INET6 1 208 | 209 | /* Define to 1 if you have the recv function. */ 210 | #define HAVE_RECV 1 211 | 212 | /* Define to 1 if you have the recvfrom function. */ 213 | #define HAVE_RECVFROM 1 214 | 215 | /* Define to 1 if you have the send function. */ 216 | #define HAVE_SEND 1 217 | 218 | /* Define to 1 if you have the setsockopt function. */ 219 | #define HAVE_SETSOCKOPT 1 220 | 221 | /* Define to 1 if you have a working setsockopt SO_NONBLOCK function. */ 222 | /* #undef HAVE_SETSOCKOPT_SO_NONBLOCK */ 223 | 224 | /* Define to 1 if you have the header file. */ 225 | #define HAVE_SIGNAL_H 1 226 | 227 | /* Define to 1 if sig_atomic_t is an available typedef. */ 228 | #define HAVE_SIG_ATOMIC_T 1 229 | 230 | /* Define to 1 if sig_atomic_t is already defined as volatile. */ 231 | /* #undef HAVE_SIG_ATOMIC_T_VOLATILE */ 232 | 233 | /* Define to 1 if your struct sockaddr_in6 has sin6_scope_id. */ 234 | #define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1 235 | 236 | /* Define to 1 if you have the socket function. */ 237 | #define HAVE_SOCKET 1 238 | 239 | /* Define to 1 if you have the header file. */ 240 | /* #undef HAVE_SOCKET_H */ 241 | 242 | /* Define to 1 if you have the header file. */ 243 | #define HAVE_STDBOOL_H 1 244 | 245 | /* Define to 1 if you have the header file. */ 246 | #define HAVE_STDINT_H 1 247 | 248 | /* Define to 1 if you have the header file. */ 249 | #define HAVE_STDLIB_H 1 250 | 251 | /* Define to 1 if you have the strcasecmp function. */ 252 | #define HAVE_STRCASECMP 1 253 | 254 | /* Define to 1 if you have the strcmpi function. */ 255 | /* #undef HAVE_STRCMPI */ 256 | 257 | /* Define to 1 if you have the strdup function. */ 258 | #define HAVE_STRDUP 1 259 | 260 | /* Define to 1 if you have the stricmp function. */ 261 | /* #undef HAVE_STRICMP */ 262 | 263 | /* Define to 1 if you have the header file. */ 264 | #define HAVE_STRINGS_H 1 265 | 266 | /* Define to 1 if you have the header file. */ 267 | #define HAVE_STRING_H 1 268 | 269 | /* Define to 1 if you have the strncasecmp function. */ 270 | #define HAVE_STRNCASECMP 1 271 | 272 | /* Define to 1 if you have the strncmpi function. */ 273 | /* #undef HAVE_STRNCMPI */ 274 | 275 | /* Define to 1 if you have the strnicmp function. */ 276 | /* #undef HAVE_STRNICMP */ 277 | 278 | /* Define to 1 if you have the header file. */ 279 | /* #undef HAVE_STROPTS_H */ 280 | 281 | /* Define to 1 if you have struct addrinfo. */ 282 | #define HAVE_STRUCT_ADDRINFO 1 283 | 284 | /* Define to 1 if you have struct in6_addr. */ 285 | #define HAVE_STRUCT_IN6_ADDR 1 286 | 287 | /* Define to 1 if you have struct sockaddr_in6. */ 288 | #define HAVE_STRUCT_SOCKADDR_IN6 1 289 | 290 | /* if struct sockaddr_storage is defined */ 291 | #define HAVE_STRUCT_SOCKADDR_STORAGE 1 292 | 293 | /* Define to 1 if you have the timeval struct. */ 294 | #define HAVE_STRUCT_TIMEVAL 1 295 | 296 | /* Define to 1 if you have the header file. */ 297 | #define HAVE_SYS_IOCTL_H 1 298 | 299 | /* Define to 1 if you have the header file. */ 300 | #define HAVE_SYS_PARAM_H 1 301 | 302 | /* Define to 1 if you have the header file. */ 303 | #define HAVE_SYS_SELECT_H 1 304 | 305 | /* Define to 1 if you have the header file. */ 306 | #define HAVE_SYS_SOCKET_H 1 307 | 308 | /* Define to 1 if you have the header file. */ 309 | #define HAVE_SYS_STAT_H 1 310 | 311 | /* Define to 1 if you have the header file. */ 312 | #define HAVE_SYS_TIME_H 1 313 | 314 | /* Define to 1 if you have the header file. */ 315 | #define HAVE_SYS_TYPES_H 1 316 | 317 | /* Define to 1 if you have the header file. */ 318 | #define HAVE_SYS_UIO_H 1 319 | 320 | /* Define to 1 if you have the header file. */ 321 | #define HAVE_TIME_H 1 322 | 323 | /* Define to 1 if you have the header file. */ 324 | #define HAVE_UNISTD_H 1 325 | 326 | /* Define to 1 if you have the windows.h header file. */ 327 | /* #undef HAVE_WINDOWS_H */ 328 | 329 | /* Define to 1 if you have the winsock2.h header file. */ 330 | /* #undef HAVE_WINSOCK2_H */ 331 | 332 | /* Define to 1 if you have the winsock.h header file. */ 333 | /* #undef HAVE_WINSOCK_H */ 334 | 335 | /* Define to 1 if you have the writev function. */ 336 | #define HAVE_WRITEV 1 337 | 338 | /* Define to 1 if you have the ws2tcpip.h header file. */ 339 | /* #undef HAVE_WS2TCPIP_H */ 340 | 341 | /* Define to the sub-directory where libtool stores uninstalled libraries. */ 342 | #define LT_OBJDIR ".libs/" 343 | 344 | /* Define to 1 if you need the malloc.h header file even with stdlib.h */ 345 | /* #undef NEED_MALLOC_H */ 346 | 347 | /* Define to 1 if you need the memory.h header file even with stdlib.h */ 348 | /* #undef NEED_MEMORY_H */ 349 | 350 | /* Define to 1 if _REENTRANT preprocessor symbol must be defined. */ 351 | /* #undef NEED_REENTRANT */ 352 | 353 | /* Define to 1 if _THREAD_SAFE preprocessor symbol must be defined. */ 354 | /* #undef NEED_THREAD_SAFE */ 355 | 356 | /* cpu-machine-OS */ 357 | #define OS "x86_64-unknown-freebsd10.3" 358 | 359 | /* Name of package */ 360 | #define PACKAGE "c-ares" 361 | 362 | /* Define to the address where bug reports for this package should be sent. */ 363 | #define PACKAGE_BUGREPORT "c-ares mailing list: http://cool.haxx.se/mailman/listinfo/c-ares" 364 | 365 | /* Define to the full name of this package. */ 366 | #define PACKAGE_NAME "c-ares" 367 | 368 | /* Define to the full name and version of this package. */ 369 | #define PACKAGE_STRING "c-ares 1.13.0" 370 | 371 | /* Define to the one symbol short name of this package. */ 372 | #define PACKAGE_TARNAME "c-ares" 373 | 374 | /* Define to the home page for this package. */ 375 | #define PACKAGE_URL "" 376 | 377 | /* Define to the version of this package. */ 378 | #define PACKAGE_VERSION "1.13.0" 379 | 380 | /* a suitable file/device to read random data from */ 381 | #define CARES_RANDOM_FILE "/dev/urandom" 382 | 383 | /* Define to the type qualifier pointed by arg 5 for recvfrom. */ 384 | #define RECVFROM_QUAL_ARG5 385 | 386 | /* Define to the type of arg 1 for recvfrom. */ 387 | #define RECVFROM_TYPE_ARG1 int 388 | 389 | /* Define to the type pointed by arg 2 for recvfrom. */ 390 | #define RECVFROM_TYPE_ARG2 void 391 | 392 | /* Define to 1 if the type pointed by arg 2 for recvfrom is void. */ 393 | #define RECVFROM_TYPE_ARG2_IS_VOID 1 394 | 395 | /* Define to the type of arg 3 for recvfrom. */ 396 | #define RECVFROM_TYPE_ARG3 size_t 397 | 398 | /* Define to the type of arg 4 for recvfrom. */ 399 | #define RECVFROM_TYPE_ARG4 int 400 | 401 | /* Define to the type pointed by arg 5 for recvfrom. */ 402 | #define RECVFROM_TYPE_ARG5 struct sockaddr 403 | 404 | /* Define to 1 if the type pointed by arg 5 for recvfrom is void. */ 405 | /* #undef RECVFROM_TYPE_ARG5_IS_VOID */ 406 | 407 | /* Define to the type pointed by arg 6 for recvfrom. */ 408 | #define RECVFROM_TYPE_ARG6 socklen_t 409 | 410 | /* Define to 1 if the type pointed by arg 6 for recvfrom is void. */ 411 | /* #undef RECVFROM_TYPE_ARG6_IS_VOID */ 412 | 413 | /* Define to the function return type for recvfrom. */ 414 | #define RECVFROM_TYPE_RETV ssize_t 415 | 416 | /* Define to the type of arg 1 for recv. */ 417 | #define RECV_TYPE_ARG1 int 418 | 419 | /* Define to the type of arg 2 for recv. */ 420 | #define RECV_TYPE_ARG2 void * 421 | 422 | /* Define to the type of arg 3 for recv. */ 423 | #define RECV_TYPE_ARG3 size_t 424 | 425 | /* Define to the type of arg 4 for recv. */ 426 | #define RECV_TYPE_ARG4 int 427 | 428 | /* Define to the function return type for recv. */ 429 | #define RECV_TYPE_RETV ssize_t 430 | 431 | /* Define as the return type of signal handlers (`int' or `void'). */ 432 | #define RETSIGTYPE void 433 | 434 | /* Define to the type qualifier of arg 2 for send. */ 435 | #define SEND_QUAL_ARG2 const 436 | 437 | /* Define to the type of arg 1 for send. */ 438 | #define SEND_TYPE_ARG1 int 439 | 440 | /* Define to the type of arg 2 for send. */ 441 | #define SEND_TYPE_ARG2 void * 442 | 443 | /* Define to the type of arg 3 for send. */ 444 | #define SEND_TYPE_ARG3 size_t 445 | 446 | /* Define to the type of arg 4 for send. */ 447 | #define SEND_TYPE_ARG4 int 448 | 449 | /* Define to the function return type for send. */ 450 | #define SEND_TYPE_RETV ssize_t 451 | 452 | /* Define to 1 if you have the ANSI C header files. */ 453 | #define STDC_HEADERS 1 454 | 455 | /* Define to 1 if you can safely include both and . */ 456 | #define TIME_WITH_SYS_TIME 1 457 | 458 | /* Define to disable non-blocking sockets. */ 459 | /* #undef USE_BLOCKING_SOCKETS */ 460 | 461 | /* Version number of package */ 462 | #define VERSION "1.13.0" 463 | 464 | /* Define to avoid automatic inclusion of winsock.h */ 465 | /* #undef WIN32_LEAN_AND_MEAN */ 466 | 467 | /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most 468 | significant byte first (like Motorola and SPARC, unlike Intel). */ 469 | #if defined AC_APPLE_UNIVERSAL_BUILD 470 | # if defined __BIG_ENDIAN__ 471 | # define WORDS_BIGENDIAN 1 472 | # endif 473 | #else 474 | # ifndef WORDS_BIGENDIAN 475 | /* # undef WORDS_BIGENDIAN */ 476 | # endif 477 | #endif 478 | 479 | /* Define to 1 if OS is AIX. */ 480 | #ifndef _ALL_SOURCE 481 | /* # undef _ALL_SOURCE */ 482 | #endif 483 | 484 | /* Enable large inode numbers on Mac OS X 10.5. */ 485 | #ifndef _DARWIN_USE_64_BIT_INODE 486 | # define _DARWIN_USE_64_BIT_INODE 1 487 | #endif 488 | 489 | /* Number of bits in a file offset, on hosts where this is settable. */ 490 | /* #undef _FILE_OFFSET_BITS */ 491 | 492 | /* Define for large files, on AIX-style hosts. */ 493 | /* #undef _LARGE_FILES */ 494 | 495 | /* Define to empty if `const' does not conform to ANSI C. */ 496 | /* #undef const */ 497 | 498 | /* Type to use in place of in_addr_t when system does not provide it. */ 499 | /* #undef in_addr_t */ 500 | 501 | /* Define to `unsigned int' if does not define. */ 502 | /* #undef size_t */ 503 | 504 | /* the signed version of size_t */ 505 | /* #undef ssize_t */ 506 | -------------------------------------------------------------------------------- /deps/build-config/config_sunos/ares_config.h: -------------------------------------------------------------------------------- 1 | /* ares_config.h. Generated from ares_config.h.in by configure. */ 2 | /* ares_config.h.in. Generated from configure.ac by autoheader. */ 3 | 4 | /* Define if building universal (internal helper macro) */ 5 | /* #undef AC_APPLE_UNIVERSAL_BUILD */ 6 | 7 | /* define this if ares is built for a big endian system */ 8 | /* #undef ARES_BIG_ENDIAN */ 9 | 10 | /* when building as static part of libcurl */ 11 | /* #undef BUILDING_LIBCURL */ 12 | 13 | /* Defined for build that exposes internal static functions for testing. */ 14 | /* #undef CARES_EXPOSE_STATICS */ 15 | 16 | /* Defined for build with symbol hiding. */ 17 | #define CARES_SYMBOL_HIDING 1 18 | 19 | /* Definition to make a library symbol externally visible. */ 20 | #define CARES_SYMBOL_SCOPE_EXTERN __attribute__ ((__visibility__ ("default"))) 21 | 22 | /* the signed version of size_t */ 23 | #define CARES_TYPEOF_ARES_SSIZE_T ssize_t 24 | 25 | /* Use resolver library to configure cares */ 26 | /* #undef CARES_USE_LIBRESOLV */ 27 | 28 | /* if a /etc/inet dir is being used */ 29 | #define ETC_INET 1 30 | 31 | /* Define to the type of arg 2 for gethostname. */ 32 | #define GETHOSTNAME_TYPE_ARG2 int 33 | 34 | /* Define to the type qualifier of arg 1 for getnameinfo. */ 35 | #define GETNAMEINFO_QUAL_ARG1 const 36 | 37 | /* Define to the type of arg 1 for getnameinfo. */ 38 | #define GETNAMEINFO_TYPE_ARG1 struct sockaddr * 39 | 40 | /* Define to the type of arg 2 for getnameinfo. */ 41 | #define GETNAMEINFO_TYPE_ARG2 socklen_t 42 | 43 | /* Define to the type of args 4 and 6 for getnameinfo. */ 44 | #define GETNAMEINFO_TYPE_ARG46 size_t 45 | 46 | /* Define to the type of arg 7 for getnameinfo. */ 47 | #define GETNAMEINFO_TYPE_ARG7 int 48 | 49 | /* Specifies the number of arguments to getservbyport_r */ 50 | #define GETSERVBYPORT_R_ARGS 5 51 | 52 | /* Specifies the size of the buffer to pass to getservbyport_r */ 53 | #define GETSERVBYPORT_R_BUFSIZE 4096 54 | 55 | /* Define to 1 if you have AF_INET6. */ 56 | #define HAVE_AF_INET6 1 57 | 58 | /* Define to 1 if you have the header file. */ 59 | #define HAVE_ARPA_INET_H 1 60 | 61 | /* Define to 1 if you have the header file. */ 62 | #define HAVE_ARPA_NAMESER_COMPAT_H 1 63 | 64 | /* Define to 1 if you have the header file. */ 65 | #define HAVE_ARPA_NAMESER_H 1 66 | 67 | /* Define to 1 if you have the header file. */ 68 | #define HAVE_ASSERT_H 1 69 | 70 | /* Define to 1 if you have the `bitncmp' function. */ 71 | /* #undef HAVE_BITNCMP */ 72 | 73 | /* Define to 1 if bool is an available type. */ 74 | #define HAVE_BOOL_T 1 75 | 76 | /* Define to 1 if you have the clock_gettime function and monotonic timer. */ 77 | #define HAVE_CLOCK_GETTIME_MONOTONIC 1 78 | 79 | /* Define to 1 if you have the closesocket function. */ 80 | /* #undef HAVE_CLOSESOCKET */ 81 | 82 | /* Define to 1 if you have the CloseSocket camel case function. */ 83 | /* #undef HAVE_CLOSESOCKET_CAMEL */ 84 | 85 | /* Define to 1 if you have the connect function. */ 86 | #define HAVE_CONNECT 1 87 | 88 | /* define if the compiler supports basic C++11 syntax */ 89 | #define HAVE_CXX11 1 90 | 91 | /* Define to 1 if you have the header file. */ 92 | #define HAVE_DLFCN_H 1 93 | 94 | /* Define to 1 if you have the header file. */ 95 | #define HAVE_ERRNO_H 1 96 | 97 | /* Define to 1 if you have the fcntl function. */ 98 | #define HAVE_FCNTL 1 99 | 100 | /* Define to 1 if you have the header file. */ 101 | #define HAVE_FCNTL_H 1 102 | 103 | /* Define to 1 if you have a working fcntl O_NONBLOCK function. */ 104 | #define HAVE_FCNTL_O_NONBLOCK 1 105 | 106 | /* Define to 1 if you have the freeaddrinfo function. */ 107 | #define HAVE_FREEADDRINFO 1 108 | 109 | /* Define to 1 if you have a working getaddrinfo function. */ 110 | #define HAVE_GETADDRINFO 1 111 | 112 | /* Define to 1 if the getaddrinfo function is threadsafe. */ 113 | #define HAVE_GETADDRINFO_THREADSAFE 1 114 | 115 | /* Define to 1 if you have the getenv function. */ 116 | #define HAVE_GETENV 1 117 | 118 | /* Define to 1 if you have the gethostbyaddr function. */ 119 | #define HAVE_GETHOSTBYADDR 1 120 | 121 | /* Define to 1 if you have the gethostbyname function. */ 122 | #define HAVE_GETHOSTBYNAME 1 123 | 124 | /* Define to 1 if you have the gethostname function. */ 125 | #define HAVE_GETHOSTNAME 1 126 | 127 | /* Define to 1 if you have the getnameinfo function. */ 128 | #define HAVE_GETNAMEINFO 1 129 | 130 | /* Define to 1 if you have the getservbyport_r function. */ 131 | #define HAVE_GETSERVBYPORT_R 1 132 | 133 | /* Define to 1 if you have the `gettimeofday' function. */ 134 | #define HAVE_GETTIMEOFDAY 1 135 | 136 | /* Define to 1 if you have the `if_indextoname' function. */ 137 | #define HAVE_IF_INDEXTONAME 1 138 | 139 | /* Define to 1 if you have a IPv6 capable working inet_net_pton function. */ 140 | /* #undef HAVE_INET_NET_PTON */ 141 | 142 | /* Define to 1 if you have a IPv6 capable working inet_ntop function. */ 143 | #define HAVE_INET_NTOP 1 144 | 145 | /* Define to 1 if you have a IPv6 capable working inet_pton function. */ 146 | #define HAVE_INET_PTON 1 147 | 148 | /* Define to 1 if you have the header file. */ 149 | #define HAVE_INTTYPES_H 1 150 | 151 | /* Define to 1 if you have the ioctl function. */ 152 | #define HAVE_IOCTL 1 153 | 154 | /* Define to 1 if you have the ioctlsocket function. */ 155 | /* #undef HAVE_IOCTLSOCKET */ 156 | 157 | /* Define to 1 if you have the IoctlSocket camel case function. */ 158 | /* #undef HAVE_IOCTLSOCKET_CAMEL */ 159 | 160 | /* Define to 1 if you have a working IoctlSocket camel case FIONBIO function. 161 | */ 162 | /* #undef HAVE_IOCTLSOCKET_CAMEL_FIONBIO */ 163 | 164 | /* Define to 1 if you have a working ioctlsocket FIONBIO function. */ 165 | /* #undef HAVE_IOCTLSOCKET_FIONBIO */ 166 | 167 | /* Define to 1 if you have a working ioctl FIONBIO function. */ 168 | /* #undef HAVE_IOCTL_FIONBIO */ 169 | 170 | /* Define to 1 if you have a working ioctl SIOCGIFADDR function. */ 171 | /* #undef HAVE_IOCTL_SIOCGIFADDR */ 172 | 173 | /* Define to 1 if you have the `resolve' library (-lresolve). */ 174 | /* #undef HAVE_LIBRESOLVE */ 175 | 176 | /* Define to 1 if you have the header file. */ 177 | #define HAVE_LIMITS_H 1 178 | 179 | /* if your compiler supports LL */ 180 | #define HAVE_LL 1 181 | 182 | /* Define to 1 if the compiler supports the 'long long' data type. */ 183 | #define HAVE_LONGLONG 1 184 | 185 | /* Define to 1 if you have the malloc.h header file. */ 186 | #define HAVE_MALLOC_H 1 187 | 188 | /* Define to 1 if you have the memory.h header file. */ 189 | #define HAVE_MEMORY_H 1 190 | 191 | /* Define to 1 if you have the MSG_NOSIGNAL flag. */ 192 | /* #undef HAVE_MSG_NOSIGNAL */ 193 | 194 | /* Define to 1 if you have the header file. */ 195 | #define HAVE_NETDB_H 1 196 | 197 | /* Define to 1 if you have the header file. */ 198 | #define HAVE_NETINET_IN_H 1 199 | 200 | /* Define to 1 if you have the header file. */ 201 | #define HAVE_NETINET_TCP_H 1 202 | 203 | /* Define to 1 if you have the header file. */ 204 | #define HAVE_NET_IF_H 1 205 | 206 | /* Define to 1 if you have PF_INET6. */ 207 | #define HAVE_PF_INET6 1 208 | 209 | /* Define to 1 if you have the recv function. */ 210 | #define HAVE_RECV 1 211 | 212 | /* Define to 1 if you have the recvfrom function. */ 213 | #define HAVE_RECVFROM 1 214 | 215 | /* Define to 1 if you have the send function. */ 216 | #define HAVE_SEND 1 217 | 218 | /* Define to 1 if you have the setsockopt function. */ 219 | #define HAVE_SETSOCKOPT 1 220 | 221 | /* Define to 1 if you have a working setsockopt SO_NONBLOCK function. */ 222 | /* #undef HAVE_SETSOCKOPT_SO_NONBLOCK */ 223 | 224 | /* Define to 1 if you have the header file. */ 225 | #define HAVE_SIGNAL_H 1 226 | 227 | /* Define to 1 if sig_atomic_t is an available typedef. */ 228 | #define HAVE_SIG_ATOMIC_T 1 229 | 230 | /* Define to 1 if sig_atomic_t is already defined as volatile. */ 231 | /* #undef HAVE_SIG_ATOMIC_T_VOLATILE */ 232 | 233 | /* Define to 1 if your struct sockaddr_in6 has sin6_scope_id. */ 234 | #define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1 235 | 236 | /* Define to 1 if you have the socket function. */ 237 | #define HAVE_SOCKET 1 238 | 239 | /* Define to 1 if you have the header file. */ 240 | /* #undef HAVE_SOCKET_H */ 241 | 242 | /* Define to 1 if you have the header file. */ 243 | #define HAVE_STDBOOL_H 1 244 | 245 | /* Define to 1 if you have the header file. */ 246 | #define HAVE_STDINT_H 1 247 | 248 | /* Define to 1 if you have the header file. */ 249 | #define HAVE_STDLIB_H 1 250 | 251 | /* Define to 1 if you have the strcasecmp function. */ 252 | #define HAVE_STRCASECMP 1 253 | 254 | /* Define to 1 if you have the strcmpi function. */ 255 | /* #undef HAVE_STRCMPI */ 256 | 257 | /* Define to 1 if you have the strdup function. */ 258 | #define HAVE_STRDUP 1 259 | 260 | /* Define to 1 if you have the stricmp function. */ 261 | /* #undef HAVE_STRICMP */ 262 | 263 | /* Define to 1 if you have the header file. */ 264 | #define HAVE_STRINGS_H 1 265 | 266 | /* Define to 1 if you have the header file. */ 267 | #define HAVE_STRING_H 1 268 | 269 | /* Define to 1 if you have the strncasecmp function. */ 270 | #define HAVE_STRNCASECMP 1 271 | 272 | /* Define to 1 if you have the strncmpi function. */ 273 | /* #undef HAVE_STRNCMPI */ 274 | 275 | /* Define to 1 if you have the strnicmp function. */ 276 | /* #undef HAVE_STRNICMP */ 277 | 278 | /* Define to 1 if you have the header file. */ 279 | #define HAVE_STROPTS_H 1 280 | 281 | /* Define to 1 if you have struct addrinfo. */ 282 | #define HAVE_STRUCT_ADDRINFO 1 283 | 284 | /* Define to 1 if you have struct in6_addr. */ 285 | #define HAVE_STRUCT_IN6_ADDR 1 286 | 287 | /* Define to 1 if you have struct sockaddr_in6. */ 288 | #define HAVE_STRUCT_SOCKADDR_IN6 1 289 | 290 | /* if struct sockaddr_storage is defined */ 291 | #define HAVE_STRUCT_SOCKADDR_STORAGE 1 292 | 293 | /* Define to 1 if you have the timeval struct. */ 294 | #define HAVE_STRUCT_TIMEVAL 1 295 | 296 | /* Define to 1 if you have the header file. */ 297 | #define HAVE_SYS_IOCTL_H 1 298 | 299 | /* Define to 1 if you have the header file. */ 300 | #define HAVE_SYS_PARAM_H 1 301 | 302 | /* Define to 1 if you have the header file. */ 303 | #define HAVE_SYS_SELECT_H 1 304 | 305 | /* Define to 1 if you have the header file. */ 306 | #define HAVE_SYS_SOCKET_H 1 307 | 308 | /* Define to 1 if you have the header file. */ 309 | #define HAVE_SYS_STAT_H 1 310 | 311 | /* Define to 1 if you have the header file. */ 312 | #define HAVE_SYS_TIME_H 1 313 | 314 | /* Define to 1 if you have the header file. */ 315 | #define HAVE_SYS_TYPES_H 1 316 | 317 | /* Define to 1 if you have the header file. */ 318 | #define HAVE_SYS_UIO_H 1 319 | 320 | /* Define to 1 if you have the header file. */ 321 | #define HAVE_TIME_H 1 322 | 323 | /* Define to 1 if you have the header file. */ 324 | #define HAVE_UNISTD_H 1 325 | 326 | /* Define to 1 if you have the windows.h header file. */ 327 | /* #undef HAVE_WINDOWS_H */ 328 | 329 | /* Define to 1 if you have the winsock2.h header file. */ 330 | /* #undef HAVE_WINSOCK2_H */ 331 | 332 | /* Define to 1 if you have the winsock.h header file. */ 333 | /* #undef HAVE_WINSOCK_H */ 334 | 335 | /* Define to 1 if you have the writev function. */ 336 | #define HAVE_WRITEV 1 337 | 338 | /* Define to 1 if you have the ws2tcpip.h header file. */ 339 | /* #undef HAVE_WS2TCPIP_H */ 340 | 341 | /* Define to the sub-directory where libtool stores uninstalled libraries. */ 342 | #define LT_OBJDIR ".libs/" 343 | 344 | /* Define to 1 if you need the malloc.h header file even with stdlib.h */ 345 | /* #undef NEED_MALLOC_H */ 346 | 347 | /* Define to 1 if you need the memory.h header file even with stdlib.h */ 348 | /* #undef NEED_MEMORY_H */ 349 | 350 | /* Define to 1 if _REENTRANT preprocessor symbol must be defined. */ 351 | #define NEED_REENTRANT 1 352 | 353 | /* Define to 1 if _THREAD_SAFE preprocessor symbol must be defined. */ 354 | /* #undef NEED_THREAD_SAFE */ 355 | 356 | /* cpu-machine-OS */ 357 | #define OS "i386-pc-solaris2.11" 358 | 359 | /* Name of package */ 360 | #define PACKAGE "c-ares" 361 | 362 | /* Define to the address where bug reports for this package should be sent. */ 363 | #define PACKAGE_BUGREPORT "c-ares mailing list: http://cool.haxx.se/mailman/listinfo/c-ares" 364 | 365 | /* Define to the full name of this package. */ 366 | #define PACKAGE_NAME "c-ares" 367 | 368 | /* Define to the full name and version of this package. */ 369 | #define PACKAGE_STRING "c-ares 1.13.0" 370 | 371 | /* Define to the one symbol short name of this package. */ 372 | #define PACKAGE_TARNAME "c-ares" 373 | 374 | /* Define to the home page for this package. */ 375 | #define PACKAGE_URL "" 376 | 377 | /* Define to the version of this package. */ 378 | #define PACKAGE_VERSION "1.13.0" 379 | 380 | /* a suitable file/device to read random data from */ 381 | #define CARES_RANDOM_FILE "/dev/urandom" 382 | 383 | /* Define to the type qualifier pointed by arg 5 for recvfrom. */ 384 | #define RECVFROM_QUAL_ARG5 385 | 386 | /* Define to the type of arg 1 for recvfrom. */ 387 | #define RECVFROM_TYPE_ARG1 int 388 | 389 | /* Define to the type pointed by arg 2 for recvfrom. */ 390 | #define RECVFROM_TYPE_ARG2 void 391 | 392 | /* Define to 1 if the type pointed by arg 2 for recvfrom is void. */ 393 | #define RECVFROM_TYPE_ARG2_IS_VOID 1 394 | 395 | /* Define to the type of arg 3 for recvfrom. */ 396 | #define RECVFROM_TYPE_ARG3 size_t 397 | 398 | /* Define to the type of arg 4 for recvfrom. */ 399 | #define RECVFROM_TYPE_ARG4 int 400 | 401 | /* Define to the type pointed by arg 5 for recvfrom. */ 402 | #define RECVFROM_TYPE_ARG5 struct sockaddr 403 | 404 | /* Define to 1 if the type pointed by arg 5 for recvfrom is void. */ 405 | /* #undef RECVFROM_TYPE_ARG5_IS_VOID */ 406 | 407 | /* Define to the type pointed by arg 6 for recvfrom. */ 408 | #define RECVFROM_TYPE_ARG6 void 409 | 410 | /* Define to 1 if the type pointed by arg 6 for recvfrom is void. */ 411 | #define RECVFROM_TYPE_ARG6_IS_VOID 1 412 | 413 | /* Define to the function return type for recvfrom. */ 414 | #define RECVFROM_TYPE_RETV int 415 | 416 | /* Define to the type of arg 1 for recv. */ 417 | #define RECV_TYPE_ARG1 int 418 | 419 | /* Define to the type of arg 2 for recv. */ 420 | #define RECV_TYPE_ARG2 void * 421 | 422 | /* Define to the type of arg 3 for recv. */ 423 | #define RECV_TYPE_ARG3 size_t 424 | 425 | /* Define to the type of arg 4 for recv. */ 426 | #define RECV_TYPE_ARG4 int 427 | 428 | /* Define to the function return type for recv. */ 429 | #define RECV_TYPE_RETV int 430 | 431 | /* Define as the return type of signal handlers (`int' or `void'). */ 432 | #define RETSIGTYPE void 433 | 434 | /* Define to the type qualifier of arg 2 for send. */ 435 | #define SEND_QUAL_ARG2 const 436 | 437 | /* Define to the type of arg 1 for send. */ 438 | #define SEND_TYPE_ARG1 int 439 | 440 | /* Define to the type of arg 2 for send. */ 441 | #define SEND_TYPE_ARG2 void * 442 | 443 | /* Define to the type of arg 3 for send. */ 444 | #define SEND_TYPE_ARG3 size_t 445 | 446 | /* Define to the type of arg 4 for send. */ 447 | #define SEND_TYPE_ARG4 int 448 | 449 | /* Define to the function return type for send. */ 450 | #define SEND_TYPE_RETV int 451 | 452 | /* Define to 1 if you have the ANSI C header files. */ 453 | #define STDC_HEADERS 1 454 | 455 | /* Define to 1 if you can safely include both and . */ 456 | #define TIME_WITH_SYS_TIME 1 457 | 458 | /* Define to disable non-blocking sockets. */ 459 | /* #undef USE_BLOCKING_SOCKETS */ 460 | 461 | /* Version number of package */ 462 | #define VERSION "1.13.0" 463 | 464 | /* Define to avoid automatic inclusion of winsock.h */ 465 | /* #undef WIN32_LEAN_AND_MEAN */ 466 | 467 | /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most 468 | significant byte first (like Motorola and SPARC, unlike Intel). */ 469 | #if defined AC_APPLE_UNIVERSAL_BUILD 470 | # if defined __BIG_ENDIAN__ 471 | # define WORDS_BIGENDIAN 1 472 | # endif 473 | #else 474 | # ifndef WORDS_BIGENDIAN 475 | /* # undef WORDS_BIGENDIAN */ 476 | # endif 477 | #endif 478 | 479 | /* Define to 1 if OS is AIX. */ 480 | #ifndef _ALL_SOURCE 481 | /* # undef _ALL_SOURCE */ 482 | #endif 483 | 484 | /* Enable large inode numbers on Mac OS X 10.5. */ 485 | #ifndef _DARWIN_USE_64_BIT_INODE 486 | # define _DARWIN_USE_64_BIT_INODE 1 487 | #endif 488 | 489 | /* Number of bits in a file offset, on hosts where this is settable. */ 490 | #define _FILE_OFFSET_BITS 64 491 | 492 | /* Define for large files, on AIX-style hosts. */ 493 | /* #undef _LARGE_FILES */ 494 | 495 | /* Define to empty if `const' does not conform to ANSI C. */ 496 | /* #undef const */ 497 | 498 | /* Type to use in place of in_addr_t when system does not provide it. */ 499 | /* #undef in_addr_t */ 500 | 501 | /* Define to `unsigned int' if does not define. */ 502 | /* #undef size_t */ 503 | 504 | /* the signed version of size_t */ 505 | /* #undef ssize_t */ 506 | -------------------------------------------------------------------------------- /deps/build-config/include/ares_build.h: -------------------------------------------------------------------------------- 1 | #ifndef __CARES_BUILD_H 2 | #define __CARES_BUILD_H 3 | 4 | 5 | /* Copyright (C) 2009 - 2013 by Daniel Stenberg et al 6 | * 7 | * Permission to use, copy, modify, and distribute this software and its 8 | * documentation for any purpose and without fee is hereby granted, provided 9 | * that the above copyright notice appear in all copies and that both that 10 | * copyright notice and this permission notice appear in supporting 11 | * documentation, and that the name of M.I.T. not be used in advertising or 12 | * publicity pertaining to distribution of the software without specific, 13 | * written prior permission. M.I.T. makes no representations about the 14 | * suitability of this software for any purpose. It is provided "as is" 15 | * without express or implied warranty. 16 | */ 17 | 18 | /* ================================================================ */ 19 | /* NOTES FOR CONFIGURE CAPABLE SYSTEMS */ 20 | /* ================================================================ */ 21 | 22 | /* 23 | * NOTE 1: 24 | * ------- 25 | * 26 | * See file ares_build.h.in, run configure, and forget that this file 27 | * exists it is only used for non-configure systems. 28 | * But you can keep reading if you want ;-) 29 | * 30 | */ 31 | 32 | /* ================================================================ */ 33 | /* NOTES FOR NON-CONFIGURE SYSTEMS */ 34 | /* ================================================================ */ 35 | 36 | /* 37 | * NOTE 1: 38 | * ------- 39 | * 40 | * Nothing in this file is intended to be modified or adjusted by the 41 | * c-ares library user nor by the c-ares library builder. 42 | * 43 | * If you think that something actually needs to be changed, adjusted 44 | * or fixed in this file, then, report it on the c-ares development 45 | * mailing list: http://cool.haxx.se/mailman/listinfo/c-ares/ 46 | * 47 | * Try to keep one section per platform, compiler and architecture, 48 | * otherwise, if an existing section is reused for a different one and 49 | * later on the original is adjusted, probably the piggybacking one can 50 | * be adversely changed. 51 | * 52 | * In order to differentiate between platforms/compilers/architectures 53 | * use only compiler built in predefined preprocessor symbols. 54 | * 55 | * This header file shall only export symbols which are 'cares' or 'CARES' 56 | * prefixed, otherwise public name space would be polluted. 57 | * 58 | * NOTE 2: 59 | * ------- 60 | * 61 | * Right now you might be staring at file ares_build.h.dist or ares_build.h, 62 | * this is due to the following reason: file ares_build.h.dist is renamed 63 | * to ares_build.h when the c-ares source code distribution archive file is 64 | * created. 65 | * 66 | * File ares_build.h.dist is not included in the distribution archive. 67 | * File ares_build.h is not present in the git tree. 68 | * 69 | * The distributed ares_build.h file is only intended to be used on systems 70 | * which can not run the also distributed configure script. 71 | * 72 | * On systems capable of running the configure script, the configure process 73 | * will overwrite the distributed ares_build.h file with one that is suitable 74 | * and specific to the library being configured and built, which is generated 75 | * from the ares_build.h.in template file. 76 | * 77 | * If you check out from git on a non-configure platform, you must run the 78 | * appropriate buildconf* script to set up ares_build.h and other local files. 79 | * 80 | */ 81 | 82 | /* ================================================================ */ 83 | /* DEFINITION OF THESE SYMBOLS SHALL NOT TAKE PLACE ANYWHERE ELSE */ 84 | /* ================================================================ */ 85 | 86 | #ifdef CARES_TYPEOF_ARES_SOCKLEN_T 87 | # error "CARES_TYPEOF_ARES_SOCKLEN_T shall not be defined except in ares_build.h" 88 | Error Compilation_aborted_CARES_TYPEOF_ARES_SOCKLEN_T_already_defined 89 | #endif 90 | 91 | /* ================================================================ */ 92 | /* EXTERNAL INTERFACE SETTINGS FOR NON-CONFIGURE SYSTEMS ONLY */ 93 | /* ================================================================ */ 94 | 95 | #if defined(__DJGPP__) || defined(__GO32__) 96 | # define CARES_TYPEOF_ARES_SOCKLEN_T int 97 | 98 | #elif defined(__SALFORDC__) 99 | # define CARES_TYPEOF_ARES_SOCKLEN_T int 100 | 101 | #elif defined(__BORLANDC__) 102 | # define CARES_TYPEOF_ARES_SOCKLEN_T int 103 | 104 | #elif defined(__TURBOC__) 105 | # define CARES_TYPEOF_ARES_SOCKLEN_T int 106 | 107 | #elif defined(__WATCOMC__) 108 | # define CARES_TYPEOF_ARES_SOCKLEN_T int 109 | 110 | #elif defined(__POCC__) 111 | # define CARES_TYPEOF_ARES_SOCKLEN_T int 112 | 113 | #elif defined(__LCC__) 114 | # define CARES_TYPEOF_ARES_SOCKLEN_T int 115 | 116 | #elif defined(__SYMBIAN32__) 117 | # define CARES_TYPEOF_ARES_SOCKLEN_T unsigned int 118 | 119 | #elif defined(__MWERKS__) 120 | # define CARES_TYPEOF_ARES_SOCKLEN_T int 121 | 122 | #elif defined(_WIN32_WCE) 123 | # define CARES_TYPEOF_ARES_SOCKLEN_T int 124 | 125 | #elif defined(__MINGW32__) 126 | # define CARES_TYPEOF_ARES_SOCKLEN_T int 127 | 128 | #elif defined(__VMS) 129 | # define CARES_TYPEOF_ARES_SOCKLEN_T unsigned int 130 | 131 | #elif defined(__OS400__) 132 | # if defined(__ILEC400__) 133 | # define CARES_TYPEOF_ARES_SOCKLEN_T socklen_t 134 | # define CARES_PULL_SYS_TYPES_H 1 135 | # define CARES_PULL_SYS_SOCKET_H 1 136 | # endif 137 | 138 | #elif defined(__MVS__) 139 | # if defined(__IBMC__) || defined(__IBMCPP__) 140 | # define CARES_TYPEOF_ARES_SOCKLEN_T socklen_t 141 | # define CARES_PULL_SYS_TYPES_H 1 142 | # define CARES_PULL_SYS_SOCKET_H 1 143 | # endif 144 | 145 | #elif defined(__370__) 146 | # if defined(__IBMC__) || defined(__IBMCPP__) 147 | # define CARES_TYPEOF_ARES_SOCKLEN_T socklen_t 148 | # define CARES_PULL_SYS_TYPES_H 1 149 | # define CARES_PULL_SYS_SOCKET_H 1 150 | # endif 151 | 152 | #elif defined(TPF) 153 | # define CARES_TYPEOF_ARES_SOCKLEN_T int 154 | 155 | /* ===================================== */ 156 | /* KEEP MSVC THE PENULTIMATE ENTRY */ 157 | /* ===================================== */ 158 | 159 | #elif defined(_MSC_VER) 160 | # define CARES_TYPEOF_ARES_SOCKLEN_T int 161 | 162 | /* ===================================== */ 163 | /* KEEP GENERIC GCC THE LAST ENTRY */ 164 | /* ===================================== */ 165 | 166 | #elif defined(__GNUC__) 167 | # define CARES_TYPEOF_ARES_SOCKLEN_T socklen_t 168 | # define CARES_PULL_SYS_TYPES_H 1 169 | # define CARES_PULL_SYS_SOCKET_H 1 170 | 171 | #else 172 | # error "Unknown non-configure build target!" 173 | Error Compilation_aborted_Unknown_non_configure_build_target 174 | #endif 175 | 176 | /* CARES_PULL_SYS_TYPES_H is defined above when inclusion of header file */ 177 | /* sys/types.h is required here to properly make type definitions below. */ 178 | #ifdef CARES_PULL_SYS_TYPES_H 179 | # include 180 | #endif 181 | 182 | /* CARES_PULL_SYS_SOCKET_H is defined above when inclusion of header file */ 183 | /* sys/socket.h is required here to properly make type definitions below. */ 184 | #ifdef CARES_PULL_SYS_SOCKET_H 185 | # include 186 | #endif 187 | 188 | /* Data type definition of ares_socklen_t. */ 189 | 190 | #ifdef CARES_TYPEOF_ARES_SOCKLEN_T 191 | typedef CARES_TYPEOF_ARES_SOCKLEN_T ares_socklen_t; 192 | #endif 193 | 194 | /* Data type definition of ares_ssize_t. */ 195 | #ifdef _WIN32 196 | # ifdef _WIN64 197 | # define CARES_TYPEOF_ARES_SSIZE_T __int64 198 | # else 199 | # define CARES_TYPEOF_ARES_SSIZE_T long 200 | # endif 201 | #else 202 | # define CARES_TYPEOF_ARES_SSIZE_T ssize_t 203 | #endif 204 | 205 | typedef CARES_TYPEOF_ARES_SSIZE_T ares_ssize_t; 206 | 207 | #endif /* __CARES_BUILD_H */ 208 | -------------------------------------------------------------------------------- /deps/build-config/include/ares_nameser.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef ARES_NAMESER_H 3 | #define ARES_NAMESER_H 4 | 5 | #ifdef HAVE_ARPA_NAMESER_H 6 | # include 7 | #endif 8 | #ifdef HAVE_ARPA_NAMESER_COMPAT_H 9 | # include 10 | #endif 11 | 12 | /* ============================================================================ 13 | * arpa/nameser.h may or may not provide ALL of the below defines, so check 14 | * each one individually and set if not 15 | * ============================================================================ 16 | */ 17 | 18 | #ifndef NS_PACKETSZ 19 | # define NS_PACKETSZ 512 /* maximum packet size */ 20 | #endif 21 | 22 | #ifndef NS_MAXDNAME 23 | # define NS_MAXDNAME 256 /* maximum domain name */ 24 | #endif 25 | 26 | #ifndef NS_MAXCDNAME 27 | # define NS_MAXCDNAME 255 /* maximum compressed domain name */ 28 | #endif 29 | 30 | #ifndef NS_MAXLABEL 31 | # define NS_MAXLABEL 63 32 | #endif 33 | 34 | #ifndef NS_HFIXEDSZ 35 | # define NS_HFIXEDSZ 12 /* #/bytes of fixed data in header */ 36 | #endif 37 | 38 | #ifndef NS_QFIXEDSZ 39 | # define NS_QFIXEDSZ 4 /* #/bytes of fixed data in query */ 40 | #endif 41 | 42 | #ifndef NS_RRFIXEDSZ 43 | # define NS_RRFIXEDSZ 10 /* #/bytes of fixed data in r record */ 44 | #endif 45 | 46 | #ifndef NS_INT16SZ 47 | # define NS_INT16SZ 2 48 | #endif 49 | 50 | #ifndef NS_INADDRSZ 51 | # define NS_INADDRSZ 4 52 | #endif 53 | 54 | #ifndef NS_IN6ADDRSZ 55 | # define NS_IN6ADDRSZ 16 56 | #endif 57 | 58 | #ifndef NS_CMPRSFLGS 59 | # define NS_CMPRSFLGS 0xc0 /* Flag bits indicating name compression. */ 60 | #endif 61 | 62 | #ifndef NS_DEFAULTPORT 63 | # define NS_DEFAULTPORT 53 /* For both TCP and UDP. */ 64 | #endif 65 | 66 | /* ============================================================================ 67 | * arpa/nameser.h should provide these enumerations always, so if not found, 68 | * provide them 69 | * ============================================================================ 70 | */ 71 | #ifndef HAVE_ARPA_NAMESER_H 72 | 73 | typedef enum __ns_class { 74 | ns_c_invalid = 0, /* Cookie. */ 75 | ns_c_in = 1, /* Internet. */ 76 | ns_c_2 = 2, /* unallocated/unsupported. */ 77 | ns_c_chaos = 3, /* MIT Chaos-net. */ 78 | ns_c_hs = 4, /* MIT Hesiod. */ 79 | /* Query class values which do not appear in resource records */ 80 | ns_c_none = 254, /* for prereq. sections in update requests */ 81 | ns_c_any = 255, /* Wildcard match. */ 82 | ns_c_max = 65536 83 | } ns_class; 84 | 85 | typedef enum __ns_type { 86 | ns_t_invalid = 0, /* Cookie. */ 87 | ns_t_a = 1, /* Host address. */ 88 | ns_t_ns = 2, /* Authoritative server. */ 89 | ns_t_md = 3, /* Mail destination. */ 90 | ns_t_mf = 4, /* Mail forwarder. */ 91 | ns_t_cname = 5, /* Canonical name. */ 92 | ns_t_soa = 6, /* Start of authority zone. */ 93 | ns_t_mb = 7, /* Mailbox domain name. */ 94 | ns_t_mg = 8, /* Mail group member. */ 95 | ns_t_mr = 9, /* Mail rename name. */ 96 | ns_t_null = 10, /* Null resource record. */ 97 | ns_t_wks = 11, /* Well known service. */ 98 | ns_t_ptr = 12, /* Domain name pointer. */ 99 | ns_t_hinfo = 13, /* Host information. */ 100 | ns_t_minfo = 14, /* Mailbox information. */ 101 | ns_t_mx = 15, /* Mail routing information. */ 102 | ns_t_txt = 16, /* Text strings. */ 103 | ns_t_rp = 17, /* Responsible person. */ 104 | ns_t_afsdb = 18, /* AFS cell database. */ 105 | ns_t_x25 = 19, /* X_25 calling address. */ 106 | ns_t_isdn = 20, /* ISDN calling address. */ 107 | ns_t_rt = 21, /* Router. */ 108 | ns_t_nsap = 22, /* NSAP address. */ 109 | ns_t_nsap_ptr = 23, /* Reverse NSAP lookup (deprecated). */ 110 | ns_t_sig = 24, /* Security signature. */ 111 | ns_t_key = 25, /* Security key. */ 112 | ns_t_px = 26, /* X.400 mail mapping. */ 113 | ns_t_gpos = 27, /* Geographical position (withdrawn). */ 114 | ns_t_aaaa = 28, /* Ip6 Address. */ 115 | ns_t_loc = 29, /* Location Information. */ 116 | ns_t_nxt = 30, /* Next domain (security). */ 117 | ns_t_eid = 31, /* Endpoint identifier. */ 118 | ns_t_nimloc = 32, /* Nimrod Locator. */ 119 | ns_t_srv = 33, /* Server Selection. */ 120 | ns_t_atma = 34, /* ATM Address */ 121 | ns_t_naptr = 35, /* Naming Authority PoinTeR */ 122 | ns_t_kx = 36, /* Key Exchange */ 123 | ns_t_cert = 37, /* Certification record */ 124 | ns_t_a6 = 38, /* IPv6 address (deprecates AAAA) */ 125 | ns_t_dname = 39, /* Non-terminal DNAME (for IPv6) */ 126 | ns_t_sink = 40, /* Kitchen sink (experimentatl) */ 127 | ns_t_opt = 41, /* EDNS0 option (meta-RR) */ 128 | ns_t_apl = 42, /* Address prefix list (RFC3123) */ 129 | ns_t_ds = 43, /* Delegation Signer (RFC4034) */ 130 | ns_t_sshfp = 44, /* SSH Key Fingerprint (RFC4255) */ 131 | ns_t_rrsig = 46, /* Resource Record Signature (RFC4034) */ 132 | ns_t_nsec = 47, /* Next Secure (RFC4034) */ 133 | ns_t_dnskey = 48, /* DNS Public Key (RFC4034) */ 134 | ns_t_tkey = 249, /* Transaction key */ 135 | ns_t_tsig = 250, /* Transaction signature. */ 136 | ns_t_ixfr = 251, /* Incremental zone transfer. */ 137 | ns_t_axfr = 252, /* Transfer zone of authority. */ 138 | ns_t_mailb = 253, /* Transfer mailbox records. */ 139 | ns_t_maila = 254, /* Transfer mail agent records. */ 140 | ns_t_any = 255, /* Wildcard match. */ 141 | ns_t_zxfr = 256, /* BIND-specific, nonstandard. */ 142 | ns_t_caa = 257, /* Certification Authority Authorization. */ 143 | ns_t_max = 65536 144 | } ns_type; 145 | 146 | typedef enum __ns_opcode { 147 | ns_o_query = 0, /* Standard query. */ 148 | ns_o_iquery = 1, /* Inverse query (deprecated/unsupported). */ 149 | ns_o_status = 2, /* Name server status query (unsupported). */ 150 | /* Opcode 3 is undefined/reserved. */ 151 | ns_o_notify = 4, /* Zone change notification. */ 152 | ns_o_update = 5, /* Zone update message. */ 153 | ns_o_max = 6 154 | } ns_opcode; 155 | 156 | typedef enum __ns_rcode { 157 | ns_r_noerror = 0, /* No error occurred. */ 158 | ns_r_formerr = 1, /* Format error. */ 159 | ns_r_servfail = 2, /* Server failure. */ 160 | ns_r_nxdomain = 3, /* Name error. */ 161 | ns_r_notimpl = 4, /* Unimplemented. */ 162 | ns_r_refused = 5, /* Operation refused. */ 163 | /* these are for BIND_UPDATE */ 164 | ns_r_yxdomain = 6, /* Name exists */ 165 | ns_r_yxrrset = 7, /* RRset exists */ 166 | ns_r_nxrrset = 8, /* RRset does not exist */ 167 | ns_r_notauth = 9, /* Not authoritative for zone */ 168 | ns_r_notzone = 10, /* Zone of record different from zone section */ 169 | ns_r_max = 11, 170 | /* The following are TSIG extended errors */ 171 | ns_r_badsig = 16, 172 | ns_r_badkey = 17, 173 | ns_r_badtime = 18 174 | } ns_rcode; 175 | 176 | #endif /* HAVE_ARPA_NAMESER_H */ 177 | 178 | 179 | /* ============================================================================ 180 | * arpa/nameser_compat.h typically sets these. However on some systems 181 | * arpa/nameser.h does, but may not set all of them. Lets conditionally 182 | * define each 183 | * ============================================================================ 184 | */ 185 | 186 | #ifndef PACKETSZ 187 | # define PACKETSZ NS_PACKETSZ 188 | #endif 189 | 190 | #ifndef MAXDNAME 191 | # define MAXDNAME NS_MAXDNAME 192 | #endif 193 | 194 | #ifndef MAXCDNAME 195 | # define MAXCDNAME NS_MAXCDNAME 196 | #endif 197 | 198 | #ifndef MAXLABEL 199 | # define MAXLABEL NS_MAXLABEL 200 | #endif 201 | 202 | #ifndef HFIXEDSZ 203 | # define HFIXEDSZ NS_HFIXEDSZ 204 | #endif 205 | 206 | #ifndef QFIXEDSZ 207 | # define QFIXEDSZ NS_QFIXEDSZ 208 | #endif 209 | 210 | #ifndef RRFIXEDSZ 211 | # define RRFIXEDSZ NS_RRFIXEDSZ 212 | #endif 213 | 214 | #ifndef INDIR_MASK 215 | # define INDIR_MASK NS_CMPRSFLGS 216 | #endif 217 | 218 | #ifndef NAMESERVER_PORT 219 | # define NAMESERVER_PORT NS_DEFAULTPORT 220 | #endif 221 | 222 | 223 | /* opcodes */ 224 | #ifndef O_QUERY 225 | # define O_QUERY 0 /* ns_o_query */ 226 | #endif 227 | #ifndef O_IQUERY 228 | # define O_IQUERY 1 /* ns_o_iquery */ 229 | #endif 230 | #ifndef O_STATUS 231 | # define O_STATUS 2 /* ns_o_status */ 232 | #endif 233 | #ifndef O_NOTIFY 234 | # define O_NOTIFY 4 /* ns_o_notify */ 235 | #endif 236 | #ifndef O_UPDATE 237 | # define O_UPDATE 5 /* ns_o_update */ 238 | #endif 239 | 240 | 241 | /* response codes */ 242 | #ifndef SERVFAIL 243 | # define SERVFAIL ns_r_servfail 244 | #endif 245 | #ifndef NOTIMP 246 | # define NOTIMP ns_r_notimpl 247 | #endif 248 | #ifndef REFUSED 249 | # define REFUSED ns_r_refused 250 | #endif 251 | #if defined(_WIN32) && !defined(HAVE_ARPA_NAMESER_COMPAT_H) && defined(NOERROR) 252 | # undef NOERROR /* it seems this is already defined in winerror.h */ 253 | #endif 254 | #ifndef NOERROR 255 | # define NOERROR ns_r_noerror 256 | #endif 257 | #ifndef FORMERR 258 | # define FORMERR ns_r_formerr 259 | #endif 260 | #ifndef NXDOMAIN 261 | # define NXDOMAIN ns_r_nxdomain 262 | #endif 263 | /* Non-standard response codes, use numeric values */ 264 | #ifndef YXDOMAIN 265 | # define YXDOMAIN 6 /* ns_r_yxdomain */ 266 | #endif 267 | #ifndef YXRRSET 268 | # define YXRRSET 7 /* ns_r_yxrrset */ 269 | #endif 270 | #ifndef NXRRSET 271 | # define NXRRSET 8 /* ns_r_nxrrset */ 272 | #endif 273 | #ifndef NOTAUTH 274 | # define NOTAUTH 9 /* ns_r_notauth */ 275 | #endif 276 | #ifndef NOTZONE 277 | # define NOTZONE 10 /* ns_r_notzone */ 278 | #endif 279 | #ifndef TSIG_BADSIG 280 | # define TSIG_BADSIG 16 /* ns_r_badsig */ 281 | #endif 282 | #ifndef TSIG_BADKEY 283 | # define TSIG_BADKEY 17 /* ns_r_badkey */ 284 | #endif 285 | #ifndef TSIG_BADTIME 286 | # define TSIG_BADTIME 18 /* ns_r_badtime */ 287 | #endif 288 | 289 | 290 | /* classes */ 291 | #ifndef C_IN 292 | # define C_IN 1 /* ns_c_in */ 293 | #endif 294 | #ifndef C_CHAOS 295 | # define C_CHAOS 3 /* ns_c_chaos */ 296 | #endif 297 | #ifndef C_HS 298 | # define C_HS 4 /* ns_c_hs */ 299 | #endif 300 | #ifndef C_NONE 301 | # define C_NONE 254 /* ns_c_none */ 302 | #endif 303 | #ifndef C_ANY 304 | # define C_ANY 255 /* ns_c_any */ 305 | #endif 306 | 307 | 308 | /* types */ 309 | #ifndef T_A 310 | # define T_A 1 /* ns_t_a */ 311 | #endif 312 | #ifndef T_NS 313 | # define T_NS 2 /* ns_t_ns */ 314 | #endif 315 | #ifndef T_MD 316 | # define T_MD 3 /* ns_t_md */ 317 | #endif 318 | #ifndef T_MF 319 | # define T_MF 4 /* ns_t_mf */ 320 | #endif 321 | #ifndef T_CNAME 322 | # define T_CNAME 5 /* ns_t_cname */ 323 | #endif 324 | #ifndef T_SOA 325 | # define T_SOA 6 /* ns_t_soa */ 326 | #endif 327 | #ifndef T_MB 328 | # define T_MB 7 /* ns_t_mb */ 329 | #endif 330 | #ifndef T_MG 331 | # define T_MG 8 /* ns_t_mg */ 332 | #endif 333 | #ifndef T_MR 334 | # define T_MR 9 /* ns_t_mr */ 335 | #endif 336 | #ifndef T_NULL 337 | # define T_NULL 10 /* ns_t_null */ 338 | #endif 339 | #ifndef T_WKS 340 | # define T_WKS 11 /* ns_t_wks */ 341 | #endif 342 | #ifndef T_PTR 343 | # define T_PTR 12 /* ns_t_ptr */ 344 | #endif 345 | #ifndef T_HINFO 346 | # define T_HINFO 13 /* ns_t_hinfo */ 347 | #endif 348 | #ifndef T_MINFO 349 | # define T_MINFO 14 /* ns_t_minfo */ 350 | #endif 351 | #ifndef T_MX 352 | # define T_MX 15 /* ns_t_mx */ 353 | #endif 354 | #ifndef T_TXT 355 | # define T_TXT 16 /* ns_t_txt */ 356 | #endif 357 | #ifndef T_RP 358 | # define T_RP 17 /* ns_t_rp */ 359 | #endif 360 | #ifndef T_AFSDB 361 | # define T_AFSDB 18 /* ns_t_afsdb */ 362 | #endif 363 | #ifndef T_X25 364 | # define T_X25 19 /* ns_t_x25 */ 365 | #endif 366 | #ifndef T_ISDN 367 | # define T_ISDN 20 /* ns_t_isdn */ 368 | #endif 369 | #ifndef T_RT 370 | # define T_RT 21 /* ns_t_rt */ 371 | #endif 372 | #ifndef T_NSAP 373 | # define T_NSAP 22 /* ns_t_nsap */ 374 | #endif 375 | #ifndef T_NSAP_PTR 376 | # define T_NSAP_PTR 23 /* ns_t_nsap_ptr */ 377 | #endif 378 | #ifndef T_SIG 379 | # define T_SIG 24 /* ns_t_sig */ 380 | #endif 381 | #ifndef T_KEY 382 | # define T_KEY 25 /* ns_t_key */ 383 | #endif 384 | #ifndef T_PX 385 | # define T_PX 26 /* ns_t_px */ 386 | #endif 387 | #ifndef T_GPOS 388 | # define T_GPOS 27 /* ns_t_gpos */ 389 | #endif 390 | #ifndef T_AAAA 391 | # define T_AAAA 28 /* ns_t_aaaa */ 392 | #endif 393 | #ifndef T_LOC 394 | # define T_LOC 29 /* ns_t_loc */ 395 | #endif 396 | #ifndef T_NXT 397 | # define T_NXT 30 /* ns_t_nxt */ 398 | #endif 399 | #ifndef T_EID 400 | # define T_EID 31 /* ns_t_eid */ 401 | #endif 402 | #ifndef T_NIMLOC 403 | # define T_NIMLOC 32 /* ns_t_nimloc */ 404 | #endif 405 | #ifndef T_SRV 406 | # define T_SRV 33 /* ns_t_srv */ 407 | #endif 408 | #ifndef T_ATMA 409 | # define T_ATMA 34 /* ns_t_atma */ 410 | #endif 411 | #ifndef T_NAPTR 412 | # define T_NAPTR 35 /* ns_t_naptr */ 413 | #endif 414 | #ifndef T_KX 415 | # define T_KX 36 /* ns_t_kx */ 416 | #endif 417 | #ifndef T_CERT 418 | # define T_CERT 37 /* ns_t_cert */ 419 | #endif 420 | #ifndef T_A6 421 | # define T_A6 38 /* ns_t_a6 */ 422 | #endif 423 | #ifndef T_DNAME 424 | # define T_DNAME 39 /* ns_t_dname */ 425 | #endif 426 | #ifndef T_SINK 427 | # define T_SINK 40 /* ns_t_sink */ 428 | #endif 429 | #ifndef T_OPT 430 | # define T_OPT 41 /* ns_t_opt */ 431 | #endif 432 | #ifndef T_APL 433 | # define T_APL 42 /* ns_t_apl */ 434 | #endif 435 | #ifndef T_DS 436 | # define T_DS 43 /* ns_t_ds */ 437 | #endif 438 | #ifndef T_SSHFP 439 | # define T_SSHFP 44 /* ns_t_sshfp */ 440 | #endif 441 | #ifndef T_RRSIG 442 | # define T_RRSIG 46 /* ns_t_rrsig */ 443 | #endif 444 | #ifndef T_NSEC 445 | # define T_NSEC 47 /* ns_t_nsec */ 446 | #endif 447 | #ifndef T_DNSKEY 448 | # define T_DNSKEY 48 /* ns_t_dnskey */ 449 | #endif 450 | #ifndef T_TKEY 451 | # define T_TKEY 249 /* ns_t_tkey */ 452 | #endif 453 | #ifndef T_TSIG 454 | # define T_TSIG 250 /* ns_t_tsig */ 455 | #endif 456 | #ifndef T_IXFR 457 | # define T_IXFR 251 /* ns_t_ixfr */ 458 | #endif 459 | #ifndef T_AXFR 460 | # define T_AXFR 252 /* ns_t_axfr */ 461 | #endif 462 | #ifndef T_MAILB 463 | # define T_MAILB 253 /* ns_t_mailb */ 464 | #endif 465 | #ifndef T_MAILA 466 | # define T_MAILA 254 /* ns_t_maila */ 467 | #endif 468 | #ifndef T_ANY 469 | # define T_ANY 255 /* ns_t_any */ 470 | #endif 471 | #ifndef T_ZXFR 472 | # define T_ZXFR 256 /* ns_t_zxfr */ 473 | #endif 474 | #ifndef T_CAA 475 | # define T_CAA 257 /* ns_t_caa */ 476 | #endif 477 | #ifndef T_MAX 478 | # define T_MAX 65536 /* ns_t_max */ 479 | #endif 480 | 481 | 482 | #endif /* ARES_NAMESER_H */ 483 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line. 5 | SPHINXOPTS = 6 | SPHINXBUILD = sphinx-build 7 | PAPER = 8 | BUILDDIR = _build 9 | 10 | # Internal variables. 11 | PAPEROPT_a4 = -D latex_paper_size=a4 12 | PAPEROPT_letter = -D latex_paper_size=letter 13 | ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . 14 | # the i18n builder cannot share the environment and doctrees with the others 15 | I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . 16 | 17 | .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext 18 | 19 | help: 20 | @echo "Please use \`make ' where is one of" 21 | @echo " html to make standalone HTML files" 22 | @echo " dirhtml to make HTML files named index.html in directories" 23 | @echo " singlehtml to make a single large HTML file" 24 | @echo " pickle to make pickle files" 25 | @echo " json to make JSON files" 26 | @echo " htmlhelp to make HTML files and a HTML help project" 27 | @echo " qthelp to make HTML files and a qthelp project" 28 | @echo " devhelp to make HTML files and a Devhelp project" 29 | @echo " epub to make an epub" 30 | @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" 31 | @echo " latexpdf to make LaTeX files and run them through pdflatex" 32 | @echo " text to make text files" 33 | @echo " man to make manual pages" 34 | @echo " texinfo to make Texinfo files" 35 | @echo " info to make Texinfo files and run them through makeinfo" 36 | @echo " gettext to make PO message catalogs" 37 | @echo " changes to make an overview of all changed/added/deprecated items" 38 | @echo " linkcheck to check all external links for integrity" 39 | @echo " doctest to run all doctests embedded in the documentation (if enabled)" 40 | 41 | clean: 42 | -rm -rf $(BUILDDIR)/* 43 | 44 | html: 45 | $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html 46 | @echo 47 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." 48 | 49 | dirhtml: 50 | $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml 51 | @echo 52 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." 53 | 54 | singlehtml: 55 | $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml 56 | @echo 57 | @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." 58 | 59 | pickle: 60 | $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle 61 | @echo 62 | @echo "Build finished; now you can process the pickle files." 63 | 64 | json: 65 | $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json 66 | @echo 67 | @echo "Build finished; now you can process the JSON files." 68 | 69 | htmlhelp: 70 | $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp 71 | @echo 72 | @echo "Build finished; now you can run HTML Help Workshop with the" \ 73 | ".hhp project file in $(BUILDDIR)/htmlhelp." 74 | 75 | qthelp: 76 | $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp 77 | @echo 78 | @echo "Build finished; now you can run "qcollectiongenerator" with the" \ 79 | ".qhcp project file in $(BUILDDIR)/qthelp, like this:" 80 | @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/pycares.qhcp" 81 | @echo "To view the help file:" 82 | @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/pycares.qhc" 83 | 84 | devhelp: 85 | $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp 86 | @echo 87 | @echo "Build finished." 88 | @echo "To view the help file:" 89 | @echo "# mkdir -p $$HOME/.local/share/devhelp/pycares" 90 | @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/pycares" 91 | @echo "# devhelp" 92 | 93 | epub: 94 | $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub 95 | @echo 96 | @echo "Build finished. The epub file is in $(BUILDDIR)/epub." 97 | 98 | latex: 99 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 100 | @echo 101 | @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." 102 | @echo "Run \`make' in that directory to run these through (pdf)latex" \ 103 | "(use \`make latexpdf' here to do that automatically)." 104 | 105 | latexpdf: 106 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 107 | @echo "Running LaTeX files through pdflatex..." 108 | $(MAKE) -C $(BUILDDIR)/latex all-pdf 109 | @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." 110 | 111 | text: 112 | $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text 113 | @echo 114 | @echo "Build finished. The text files are in $(BUILDDIR)/text." 115 | 116 | man: 117 | $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man 118 | @echo 119 | @echo "Build finished. The manual pages are in $(BUILDDIR)/man." 120 | 121 | texinfo: 122 | $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo 123 | @echo 124 | @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." 125 | @echo "Run \`make' in that directory to run these through makeinfo" \ 126 | "(use \`make info' here to do that automatically)." 127 | 128 | info: 129 | $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo 130 | @echo "Running Texinfo files through makeinfo..." 131 | make -C $(BUILDDIR)/texinfo info 132 | @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." 133 | 134 | gettext: 135 | $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale 136 | @echo 137 | @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." 138 | 139 | changes: 140 | $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes 141 | @echo 142 | @echo "The overview file is in $(BUILDDIR)/changes." 143 | 144 | linkcheck: 145 | $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck 146 | @echo 147 | @echo "Link check complete; look for any errors in the above output " \ 148 | "or in $(BUILDDIR)/linkcheck/output.txt." 149 | 150 | doctest: 151 | $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest 152 | @echo "Testing of doctests in the sources finished, look at the " \ 153 | "results in $(BUILDDIR)/doctest/output.txt." 154 | -------------------------------------------------------------------------------- /docs/channel.rst: -------------------------------------------------------------------------------- 1 | .. _channel: 2 | 3 | 4 | .. currentmodule:: pycares 5 | 6 | 7 | ==================================== 8 | :py:class:`Channel` - Ares Channel 9 | ==================================== 10 | 11 | 12 | .. 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]) 13 | 14 | :param int flags: Flags controlling the behavior of the resolver. See ``constants`` 15 | for available values. 16 | 17 | :param float timeout: The number of seconds each name server is given to respond to 18 | a query on the first try. The default is five seconds. 19 | 20 | :param int tries: The number of tries the resolver will try contacting each name 21 | server before giving up. The default is four tries. 22 | 23 | :param int ndots: The number of dots which must be present in a domain name for it 24 | to be queried for "as is" prior to querying for it with the default domain 25 | extensions appended. The default value is 1 unless set otherwise by resolv.conf 26 | or the RES_OPTIONS environment variable. 27 | 28 | :param int tcp_port: The (TCP) port to use for queries. The default is 53. 29 | 30 | :param int udp_port: The (UDP) port to use for queries. The default is 53. 31 | 32 | :param list servers: List of nameservers to be used to do the lookups. 33 | 34 | :param list domains: The domains to search, instead of the domains specified 35 | in resolv.conf or the domain derived from the kernel hostname variable. 36 | 37 | :param str lookup: The lookups to perform for host queries. lookups should 38 | be set to a string of the characters "b" or "f", where "b" indicates a 39 | DNS lookup and "f" indicates a lookup in the hosts file. 40 | 41 | :param callable sock_state_cb: A callback function to be invoked when a 42 | socket changes state. Callback signature: ``sock_state_cb(self, fd, readable, writable)`` 43 | 44 | This option is mutually exclusive with the ``event_thread`` option. 45 | 46 | :param bool event_thread: If set to True, c-ares will use its own thread 47 | to process events. This is the recommended way to use c-ares, as it 48 | allows for automatic reinitialization of the channel when the 49 | system resolver configuration changes. Verify that c-ares was 50 | compiled with thread-safety by calling :py:func:`ares_threadsafety` 51 | before using this option. 52 | 53 | This option is mutually exclusive with the ``sock_state_cb`` option. 54 | 55 | :param int socket_send_buffer_size: Size for the created socket's send buffer. 56 | 57 | :param int socket_receive_buffer_size: Size for the created socket's receive buffer. 58 | 59 | :param bool rotate: If set to True, the nameservers are rotated when doing queries. 60 | 61 | :param str local_ip: Sets the local IP address for DNS operations. 62 | 63 | :param str local_dev: Sets the local network adapter to use for DNS operations. Linux only. 64 | 65 | :param str resolvconf_path: Path to resolv.conf, defaults to /etc/resolv.conf. Unix only. 66 | 67 | The c-ares ``Channel`` provides asynchronous DNS operations. 68 | 69 | .. py:method:: getaddrinfo(host, port, callback, family=0, type=0, proto=0, flags=0) 70 | 71 | :param string host: Hostname to resolve. 72 | 73 | :param string port: Service to resolve. Can be a string, int or None. 74 | 75 | :param callable callback: Callback to be called with the result of the query. 76 | 77 | The ``family``, ``type`` and ``proto`` arguments can be optionally specified in order to narrow the list of 78 | addresses returned. Passing zero as a value for each of these arguments selects the full range of results. 79 | The ``flags`` argument can be one or several of the ``AI_*`` constants, and will influence how results are 80 | computed and returned. For example, ``AI_NUMERICHOST`` will disable domain name resolution. 81 | 82 | Translate the host/port argument into a sequence of 5-tuples that contain all the necessary arguments for 83 | creating a socket connected to that service. 84 | 85 | Callback signature: ``callback(result, errorno)`` 86 | 87 | 88 | .. py:method:: gethostbyname(name, family, callback) 89 | 90 | :param string name: Name to query. 91 | 92 | :param int family: Socket family. 93 | 94 | :param callable callback: Callback to be called with the result of the query. 95 | 96 | Retrieves host information corresponding to a host name from a host database. 97 | 98 | Callback signature: ``callback(result, errorno)`` 99 | 100 | 101 | .. py:method:: gethostbyaddr(name, callback) 102 | 103 | :param string name: Name to query. 104 | 105 | :param callable callback: Callback to be called with the result of the query. 106 | 107 | Retrieves the host information corresponding to a network address. 108 | 109 | Callback signature: ``callback(result, errorno)`` 110 | 111 | 112 | .. py:method:: getnameinfo(address, flags, callback) 113 | 114 | :param tuple address: address tuple to get info about. 115 | 116 | :param int flags: Query flags, see the NI flags section. 117 | 118 | :param callable callback: Callback to be called with the result of the query. 119 | 120 | Provides protocol-independent name resolution from an address to a host name and 121 | from a port number to the service name. 122 | 123 | ``address`` must be a 2-item tuple for IPv4 or a 4-item tuple for IPv6. Format of 124 | fields is the same as one returned by `getaddrinfo()`. 125 | 126 | Callback signature: ``callback(result, errorno)`` 127 | 128 | 129 | .. py:method:: query(name, query_type, callback) 130 | 131 | :param string name: Name to query. 132 | 133 | :param int query_type: Type of query to perform. 134 | 135 | :param callable callback: Callback to be called with the result of the query. 136 | 137 | Do a DNS query of the specified type. Available types: 138 | - ``QUERY_TYPE_A`` 139 | - ``QUERY_TYPE_AAAA`` 140 | - ``QUERY_TYPE_ANY`` 141 | - ``QUERY_TYPE_CAA`` 142 | - ``QUERY_TYPE_CNAME`` 143 | - ``QUERY_TYPE_MX`` 144 | - ``QUERY_TYPE_NAPTR`` 145 | - ``QUERY_TYPE_NS`` 146 | - ``QUERY_TYPE_PTR`` 147 | - ``QUERY_TYPE_SOA`` 148 | - ``QUERY_TYPE_SRV`` 149 | - ``QUERY_TYPE_TXT`` 150 | 151 | Callback signature: ``callback(result, errorno)``. The result type varies depending on the 152 | query type: 153 | 154 | - A: (list of) ``ares_query_a_result``, fields: 155 | 156 | - host 157 | - ttl 158 | 159 | - AAAA: (list of) ``ares_query_aaaa_result``, fields: 160 | 161 | - host 162 | - ttl 163 | 164 | - CAA: (list of) ``ares_query_caa_result``, fields: 165 | 166 | - critical 167 | - property 168 | - value 169 | - ttl 170 | 171 | - CNAME: ``ares_query_cname_result``, fields: 172 | 173 | - cname 174 | - ttl 175 | 176 | - MX: (list of) ``ares_query_mx_result``, fields: 177 | 178 | - host 179 | - priority 180 | - ttl 181 | 182 | - NAPTR: (list of) ``ares_query_naptr_result``, fields: 183 | 184 | - order 185 | - preference 186 | - flags 187 | - service 188 | - regex 189 | - replacement 190 | - ttl 191 | 192 | - NS: (list of) ``ares_query_ns_result``, fields: 193 | 194 | - host 195 | - ttl 196 | 197 | - PTR: (list of) ``ares_query_ptr_result``, fields: 198 | 199 | - name 200 | - ttl 201 | 202 | - SOA: ``ares_query_soa_result``, fields: 203 | 204 | - nsname 205 | - hostmaster 206 | - serial 207 | - refresh 208 | - retry 209 | - expires 210 | - minttl 211 | - ttl 212 | 213 | - SRV: (list of) ``ares_query_srv_result``, fields: 214 | 215 | - host 216 | - port 217 | - priority 218 | - weight 219 | - ttl 220 | 221 | - TXT: (list of) ``ares_query_txt_result``, fields: 222 | 223 | - text 224 | - ttl 225 | 226 | - ANY: a list of any of the above. 227 | 228 | .. note:: 229 | TTL is not implemented for CNAME and NS), so it's set to -1. 230 | 231 | .. py:method:: search(name, query_type, callback) 232 | 233 | :param string name: Name to query. 234 | 235 | :param int query_type: Type of query to perform. 236 | 237 | :param callable callback: Callback to be called with the result of the query. 238 | 239 | Tis function does the same as :py:meth:`query` but it will honor the ``domain`` and ``search`` directives in 240 | ``resolv.conf``. 241 | 242 | .. py:method:: cancel() 243 | 244 | Cancel any pending query on this channel. All pending callbacks will be called with ARES_ECANCELLED errorno. 245 | 246 | .. py:method:: reinit() 247 | 248 | Reinitialize the channel. 249 | 250 | For more details, see the `ares_reinit documentation `_. 251 | 252 | .. py:method:: process_fd(read_fd, write_fd) 253 | 254 | :param int read_fd: File descriptor ready to read from. 255 | 256 | :param int write_fd: File descriptor ready to write to. 257 | 258 | Process the given file descriptors for read and/or write events. 259 | 260 | .. py:method:: getsock() 261 | 262 | Return a tuple containing 2 lists with the file descriptors ready to read and write. 263 | 264 | .. py:method:: timeout([max_timeout]) 265 | 266 | :param float max_timeout: Maximum timeout. 267 | 268 | Determines the maximum time for which the caller should wait before invoking ``process_fd`` to process timeouts. 269 | If the ``max_timeout`` parameter is specified, it is stored on the channel and the appropriate value is then 270 | returned. 271 | 272 | .. py:method:: set_local_ip(local_ip) 273 | 274 | :param str local_ip: IP address. 275 | 276 | Set the local IPv4 or IPv6 address from which the queries will be sent. 277 | 278 | .. py:method:: set_local_dev(local_dev) 279 | 280 | :param str local_dev: Network device name. 281 | 282 | Set the local ethernet device from which the queries will be sent. 283 | 284 | .. py:attribute:: servers 285 | 286 | List of nameservers to use for DNS queries. 287 | 288 | -------------------------------------------------------------------------------- /docs/conf.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # pycares documentation build configuration file, created by 4 | # sphinx-quickstart on Sun Jul 8 23:23:25 2012. 5 | # 6 | # This file is execfile()d with the current directory set to its containing dir. 7 | # 8 | # Note that not all possible configuration values are present in this 9 | # autogenerated file. 10 | # 11 | # All configuration values have a default; values that are commented out 12 | # serve to show the default. 13 | 14 | import re 15 | 16 | def get_version(): 17 | return re.search(r"""__version__\s+=\s+(?P['"])(?P.+?)(?P=quote)""", open('../src/pycares/_version.py').read()).group('version') 18 | _version = get_version() 19 | 20 | # If extensions (or modules to document with autodoc) are in another directory, 21 | # add these directories to sys.path here. If the directory is relative to the 22 | # documentation root, use os.path.abspath to make it absolute, like shown here. 23 | #sys.path.insert(0, os.path.abspath('.')) 24 | 25 | # -- General configuration ----------------------------------------------------- 26 | 27 | # If your documentation needs a minimal Sphinx version, state it here. 28 | #needs_sphinx = '1.0' 29 | 30 | # Add any Sphinx extension module names here, as strings. They can be extensions 31 | # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. 32 | extensions = ['sphinx.ext.viewcode'] 33 | 34 | # Add any paths that contain templates here, relative to this directory. 35 | templates_path = ['_templates'] 36 | 37 | # The suffix of source filenames. 38 | source_suffix = '.rst' 39 | 40 | # The encoding of source files. 41 | #source_encoding = 'utf-8-sig' 42 | 43 | # The master toctree document. 44 | master_doc = 'index' 45 | 46 | # General information about the project. 47 | project = u'pycares' 48 | copyright = u'2012-present, Saúl Ibarra Corretgé' 49 | 50 | # The version info for the project you're documenting, acts as replacement for 51 | # |version| and |release|, also used in various other places throughout the 52 | # built documents. 53 | # 54 | # The short X.Y version. 55 | version = _version 56 | # The full version, including alpha/beta/rc tags. 57 | release = _version 58 | 59 | # The language for content autogenerated by Sphinx. Refer to documentation 60 | # for a list of supported languages. 61 | #language = None 62 | 63 | # There are two options for replacing |today|: either, you set today to some 64 | # non-false value, then it is used: 65 | #today = '' 66 | # Else, today_fmt is used as the format for a strftime call. 67 | #today_fmt = '%B %d, %Y' 68 | 69 | # List of patterns, relative to source directory, that match files and 70 | # directories to ignore when looking for source files. 71 | exclude_patterns = ['_build'] 72 | 73 | # The reST default role (used for this markup: `text`) to use for all documents. 74 | #default_role = None 75 | 76 | # If true, '()' will be appended to :func: etc. cross-reference text. 77 | #add_function_parentheses = True 78 | 79 | # If true, the current module name will be prepended to all description 80 | # unit titles (such as .. function::). 81 | #add_module_names = True 82 | 83 | # If true, sectionauthor and moduleauthor directives will be shown in the 84 | # output. They are ignored by default. 85 | #show_authors = False 86 | 87 | # The name of the Pygments (syntax highlighting) style to use. 88 | pygments_style = 'sphinx' 89 | 90 | # A list of ignored prefixes for module index sorting. 91 | #modindex_common_prefix = [] 92 | 93 | 94 | # -- Options for HTML output --------------------------------------------------- 95 | 96 | # The theme to use for HTML and HTML Help pages. See the documentation for 97 | # a list of builtin themes. 98 | html_theme = 'sphinx_rtd_theme' 99 | 100 | # Theme options are theme-specific and customize the look and feel of a theme 101 | # further. For a list of options available for each theme, see the 102 | # documentation. 103 | #html_theme_options = {} 104 | 105 | # Add any paths that contain custom themes here, relative to this directory. 106 | #html_theme_path = [] 107 | 108 | # The name for this set of Sphinx documents. If None, it defaults to 109 | # " v documentation". 110 | #html_title = None 111 | 112 | # A shorter title for the navigation bar. Default is the same as html_title. 113 | #html_short_title = None 114 | 115 | # The name of an image file (relative to this directory) to place at the top 116 | # of the sidebar. 117 | #html_logo = None 118 | 119 | # The name of an image file (within the static path) to use as favicon of the 120 | # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 121 | # pixels large. 122 | #html_favicon = None 123 | 124 | # Add any paths that contain custom static files (such as style sheets) here, 125 | # relative to this directory. They are copied after the builtin static files, 126 | # so a file named "default.css" will overwrite the builtin "default.css". 127 | html_static_path = ['_static'] 128 | 129 | # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, 130 | # using the given strftime format. 131 | #html_last_updated_fmt = '%b %d, %Y' 132 | 133 | # If true, SmartyPants will be used to convert quotes and dashes to 134 | # typographically correct entities. 135 | #html_use_smartypants = True 136 | 137 | # Custom sidebar templates, maps document names to template names. 138 | #html_sidebars = {} 139 | 140 | # Additional templates that should be rendered to pages, maps page names to 141 | # template names. 142 | #html_additional_pages = {} 143 | 144 | # If false, no module index is generated. 145 | #html_domain_indices = True 146 | 147 | # If false, no index is generated. 148 | #html_use_index = True 149 | 150 | # If true, the index is split into individual pages for each letter. 151 | #html_split_index = False 152 | 153 | # If true, links to the reST sources are added to the pages. 154 | #html_show_sourcelink = True 155 | 156 | # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. 157 | #html_show_sphinx = True 158 | 159 | # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. 160 | #html_show_copyright = True 161 | 162 | # If true, an OpenSearch description file will be output, and all pages will 163 | # contain a tag referring to it. The value of this option must be the 164 | # base URL from which the finished HTML is served. 165 | #html_use_opensearch = '' 166 | 167 | # This is the file name suffix for HTML files (e.g. ".xhtml"). 168 | #html_file_suffix = None 169 | 170 | # Output file base name for HTML help builder. 171 | htmlhelp_basename = 'pycaresdoc' 172 | 173 | 174 | # -- Options for LaTeX output -------------------------------------------------- 175 | 176 | latex_elements = { 177 | # The paper size ('letterpaper' or 'a4paper'). 178 | #'papersize': 'letterpaper', 179 | 180 | # The font size ('10pt', '11pt' or '12pt'). 181 | #'pointsize': '10pt', 182 | 183 | # Additional stuff for the LaTeX preamble. 184 | #'preamble': '', 185 | } 186 | 187 | # Grouping the document tree into LaTeX files. List of tuples 188 | # (source start file, target name, title, author, documentclass [howto/manual]). 189 | latex_documents = [ 190 | ('index', 'pycares.tex', u'pycares Documentation', 191 | u'Saúl Ibarra Corretgé', 'manual'), 192 | ] 193 | 194 | # The name of an image file (relative to this directory) to place at the top of 195 | # the title page. 196 | #latex_logo = None 197 | 198 | # For "manual" documents, if this is true, then toplevel headings are parts, 199 | # not chapters. 200 | #latex_use_parts = False 201 | 202 | # If true, show page references after internal links. 203 | #latex_show_pagerefs = False 204 | 205 | # If true, show URL addresses after external links. 206 | #latex_show_urls = False 207 | 208 | # Documents to append as an appendix to all manuals. 209 | #latex_appendices = [] 210 | 211 | # If false, no module index is generated. 212 | #latex_domain_indices = True 213 | 214 | 215 | # -- Options for manual page output -------------------------------------------- 216 | 217 | # One entry per manual page. List of tuples 218 | # (source start file, name, description, authors, manual section). 219 | man_pages = [ 220 | ('index', 'pycares', u'pycares Documentation', 221 | [u'Saúl Ibarra Corretgé'], 1) 222 | ] 223 | 224 | # If true, show URL addresses after external links. 225 | #man_show_urls = False 226 | 227 | 228 | # -- Options for Texinfo output ------------------------------------------------ 229 | 230 | # Grouping the document tree into Texinfo files. List of tuples 231 | # (source start file, target name, title, author, 232 | # dir menu entry, description, category) 233 | texinfo_documents = [ 234 | ('index', 'pycares', u'pycares Documentation', 235 | u'Saúl Ibarra Corretgé', 'pycares', 'One line description of project.', 236 | 'Miscellaneous'), 237 | ] 238 | 239 | # Documents to append as an appendix to all manuals. 240 | #texinfo_appendices = [] 241 | 242 | # If false, no module index is generated. 243 | #texinfo_domain_indices = True 244 | 245 | # How to display URL addresses: 'footnote', 'no', or 'inline'. 246 | #texinfo_show_urls = 'footnote' 247 | -------------------------------------------------------------------------------- /docs/constants.rst: -------------------------------------------------------------------------------- 1 | .. _constants: 2 | 3 | ======================== 4 | c-ares library constants 5 | ======================== 6 | 7 | 8 | Channel flags 9 | ============= 10 | 11 | .. py:data:: pycares.ARES_FLAG_USEVC 12 | .. py:data:: pycares.ARES_FLAG_PRIMARY 13 | .. py:data:: pycares.ARES_FLAG_IGNTC 14 | .. py:data:: pycares.ARES_FLAG_NORECURSE 15 | .. py:data:: pycares.ARES_FLAG_STAYOPEN 16 | .. py:data:: pycares.ARES_FLAG_NOSEARCH 17 | .. py:data:: pycares.ARES_FLAG_NOALIASES 18 | .. py:data:: pycares.ARES_FLAG_NOCHECKRESP 19 | 20 | .. seealso:: 21 | `c-ares documentation for ares_init `_ 22 | 23 | 24 | Nameinfo constants 25 | ================== 26 | 27 | .. py:data:: pycares.ARES_NI_NOFQDN 28 | .. py:data:: pycares.ARES_NI_NUMERICHOST 29 | .. py:data:: pycares.ARES_NI_NAMEREQD 30 | .. py:data:: pycares.ARES_NI_NUMERICSERV 31 | .. py:data:: pycares.ARES_NI_DGRAM 32 | .. py:data:: pycares.ARES_NI_TCP 33 | .. py:data:: pycares.ARES_NI_UDP 34 | .. py:data:: pycares.ARES_NI_SCTP 35 | .. py:data:: pycares.ARES_NI_DCCP 36 | .. py:data:: pycares.ARES_NI_NUMERICSCOPE 37 | .. py:data:: pycares.ARES_NI_LOOKUPHOST 38 | .. py:data:: pycares.ARES_NI_LOOKUPSERVICE 39 | .. py:data:: pycares.ARES_NI_IDN 40 | .. py:data:: pycares.ARES_NI_IDN_ALLOW_UNASSIGNED 41 | .. py:data:: pycares.ARES_NI_IDN_USE_STD3_ASCII_RULES 42 | 43 | .. seealso:: 44 | `c-ares documentation for ares_getnameinfo `_ 45 | 46 | Others 47 | ====== 48 | 49 | .. py:data:: pycares.ARES_SOCKET_BAD 50 | 51 | 52 | -------------------------------------------------------------------------------- /docs/errno.rst: -------------------------------------------------------------------------------- 1 | .. _errno: 2 | 3 | 4 | .. currentmodule:: pycares 5 | 6 | 7 | ====================================================== 8 | :py:mod:`pycares.errno` --- Error constant definitions 9 | ====================================================== 10 | 11 | 12 | This module contains the defined error constants from c-ares. 13 | 14 | .. py:attribute:: pycares.errno.errorcode 15 | 16 | Mapping (code, string) with c-ares error codes. 17 | 18 | .. py:function:: pycares.errno.strerror(errorno) 19 | 20 | :param int errorno: Error number. 21 | 22 | Get the string representation of the given c-ares error number. 23 | 24 | -------------------------------------------------------------------------------- /docs/event_loops.rst: -------------------------------------------------------------------------------- 1 | .. _event_loops: 2 | 3 | ====================== 4 | Event loop integration 5 | ====================== 6 | 7 | 8 | pycares can be integrated in an already existing event loop without much trouble. 9 | The examples folder contains several examples: 10 | 11 | * cares-select.py: integration with plain select 12 | * cares-poll.py: integration with plain poll 13 | * cares-selectors.py: integration with the builtin selectors module 14 | * cares-resolver.py: integration with the pyuv event loop 15 | * cares-asyncio.py: integration with the asyncio framework 16 | 17 | Additionally, `Tornado `_ provides integration 18 | with pycaes through a `resolver module `_. 19 | 20 | -------------------------------------------------------------------------------- /docs/index.rst: -------------------------------------------------------------------------------- 1 | .. currentmodule:: pycares 2 | 3 | ################################# 4 | Welcome to pycares documentation! 5 | ################################# 6 | 7 | Python interface for c-ares. 8 | 9 | pycares is a Python module which provides an interface to c-ares. 10 | c-ares (https://c-ares.org) c-ares is a C library that performs 11 | DNS requests and name resolves asynchronously. 12 | 13 | 14 | Contents 15 | ######## 16 | 17 | .. toctree:: 18 | :maxdepth: 3 19 | :titlesonly: 20 | 21 | pycares 22 | 23 | 24 | Indices and tables 25 | ################## 26 | 27 | * :ref:`genindex` 28 | * :ref:`modindex` 29 | * :ref:`search` 30 | 31 | -------------------------------------------------------------------------------- /docs/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | REM Command file for Sphinx documentation 4 | 5 | if "%SPHINXBUILD%" == "" ( 6 | set SPHINXBUILD=sphinx-build 7 | ) 8 | set BUILDDIR=_build 9 | set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% . 10 | set I18NSPHINXOPTS=%SPHINXOPTS% . 11 | if NOT "%PAPER%" == "" ( 12 | set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% 13 | set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS% 14 | ) 15 | 16 | if "%1" == "" goto help 17 | 18 | if "%1" == "help" ( 19 | :help 20 | echo.Please use `make ^` where ^ is one of 21 | echo. html to make standalone HTML files 22 | echo. dirhtml to make HTML files named index.html in directories 23 | echo. singlehtml to make a single large HTML file 24 | echo. pickle to make pickle files 25 | echo. json to make JSON files 26 | echo. htmlhelp to make HTML files and a HTML help project 27 | echo. qthelp to make HTML files and a qthelp project 28 | echo. devhelp to make HTML files and a Devhelp project 29 | echo. epub to make an epub 30 | echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter 31 | echo. text to make text files 32 | echo. man to make manual pages 33 | echo. texinfo to make Texinfo files 34 | echo. gettext to make PO message catalogs 35 | echo. changes to make an overview over all changed/added/deprecated items 36 | echo. linkcheck to check all external links for integrity 37 | echo. doctest to run all doctests embedded in the documentation if enabled 38 | goto end 39 | ) 40 | 41 | if "%1" == "clean" ( 42 | for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i 43 | del /q /s %BUILDDIR%\* 44 | goto end 45 | ) 46 | 47 | if "%1" == "html" ( 48 | %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html 49 | if errorlevel 1 exit /b 1 50 | echo. 51 | echo.Build finished. The HTML pages are in %BUILDDIR%/html. 52 | goto end 53 | ) 54 | 55 | if "%1" == "dirhtml" ( 56 | %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml 57 | if errorlevel 1 exit /b 1 58 | echo. 59 | echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. 60 | goto end 61 | ) 62 | 63 | if "%1" == "singlehtml" ( 64 | %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml 65 | if errorlevel 1 exit /b 1 66 | echo. 67 | echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. 68 | goto end 69 | ) 70 | 71 | if "%1" == "pickle" ( 72 | %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle 73 | if errorlevel 1 exit /b 1 74 | echo. 75 | echo.Build finished; now you can process the pickle files. 76 | goto end 77 | ) 78 | 79 | if "%1" == "json" ( 80 | %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json 81 | if errorlevel 1 exit /b 1 82 | echo. 83 | echo.Build finished; now you can process the JSON files. 84 | goto end 85 | ) 86 | 87 | if "%1" == "htmlhelp" ( 88 | %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp 89 | if errorlevel 1 exit /b 1 90 | echo. 91 | echo.Build finished; now you can run HTML Help Workshop with the ^ 92 | .hhp project file in %BUILDDIR%/htmlhelp. 93 | goto end 94 | ) 95 | 96 | if "%1" == "qthelp" ( 97 | %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp 98 | if errorlevel 1 exit /b 1 99 | echo. 100 | echo.Build finished; now you can run "qcollectiongenerator" with the ^ 101 | .qhcp project file in %BUILDDIR%/qthelp, like this: 102 | echo.^> qcollectiongenerator %BUILDDIR%\qthelp\pycares.qhcp 103 | echo.To view the help file: 104 | echo.^> assistant -collectionFile %BUILDDIR%\qthelp\pycares.ghc 105 | goto end 106 | ) 107 | 108 | if "%1" == "devhelp" ( 109 | %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp 110 | if errorlevel 1 exit /b 1 111 | echo. 112 | echo.Build finished. 113 | goto end 114 | ) 115 | 116 | if "%1" == "epub" ( 117 | %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub 118 | if errorlevel 1 exit /b 1 119 | echo. 120 | echo.Build finished. The epub file is in %BUILDDIR%/epub. 121 | goto end 122 | ) 123 | 124 | if "%1" == "latex" ( 125 | %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex 126 | if errorlevel 1 exit /b 1 127 | echo. 128 | echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. 129 | goto end 130 | ) 131 | 132 | if "%1" == "text" ( 133 | %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text 134 | if errorlevel 1 exit /b 1 135 | echo. 136 | echo.Build finished. The text files are in %BUILDDIR%/text. 137 | goto end 138 | ) 139 | 140 | if "%1" == "man" ( 141 | %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man 142 | if errorlevel 1 exit /b 1 143 | echo. 144 | echo.Build finished. The manual pages are in %BUILDDIR%/man. 145 | goto end 146 | ) 147 | 148 | if "%1" == "texinfo" ( 149 | %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo 150 | if errorlevel 1 exit /b 1 151 | echo. 152 | echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo. 153 | goto end 154 | ) 155 | 156 | if "%1" == "gettext" ( 157 | %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale 158 | if errorlevel 1 exit /b 1 159 | echo. 160 | echo.Build finished. The message catalogs are in %BUILDDIR%/locale. 161 | goto end 162 | ) 163 | 164 | if "%1" == "changes" ( 165 | %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes 166 | if errorlevel 1 exit /b 1 167 | echo. 168 | echo.The overview file is in %BUILDDIR%/changes. 169 | goto end 170 | ) 171 | 172 | if "%1" == "linkcheck" ( 173 | %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck 174 | if errorlevel 1 exit /b 1 175 | echo. 176 | echo.Link check complete; look for any errors in the above output ^ 177 | or in %BUILDDIR%/linkcheck/output.txt. 178 | goto end 179 | ) 180 | 181 | if "%1" == "doctest" ( 182 | %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest 183 | if errorlevel 1 exit /b 1 184 | echo. 185 | echo.Testing of doctests in the sources finished, look at the ^ 186 | results in %BUILDDIR%/doctest/output.txt. 187 | goto end 188 | ) 189 | 190 | :end 191 | -------------------------------------------------------------------------------- /docs/pycares.rst: -------------------------------------------------------------------------------- 1 | .. _pycares: 2 | 3 | 4 | ************************************************* 5 | :py:mod:`pycares` --- Python interface to c-ares. 6 | ************************************************* 7 | 8 | .. py:module:: pycares 9 | :platform: POSIX, Windows 10 | :synopsis: Python interface to c-ares. 11 | 12 | .. seealso:: 13 | `c-ares source code 14 | `_. 15 | 16 | ares_threadsafety 17 | ================= 18 | 19 | .. py:function:: ares_threadsafety() 20 | 21 | Check if c-ares was compiled with thread safety support. 22 | 23 | :returns: True if thread-safe, False otherwise. 24 | :rtype: bool 25 | 26 | 27 | Objects 28 | ******* 29 | 30 | .. toctree:: 31 | :maxdepth: 2 32 | :titlesonly: 33 | 34 | channel 35 | constants 36 | errno 37 | event_loops 38 | 39 | -------------------------------------------------------------------------------- /docs/requirements.txt: -------------------------------------------------------------------------------- 1 | Sphinx==8.2.3 2 | sphinx-rtd-theme==3.0.2 3 | -------------------------------------------------------------------------------- /examples/cares-asyncio.py: -------------------------------------------------------------------------------- 1 | 2 | import asyncio 3 | import socket 4 | 5 | import pycares 6 | 7 | 8 | class DNSResolver(object): 9 | EVENT_READ = 0 10 | EVENT_WRITE = 1 11 | 12 | def __init__(self, loop=None): 13 | self._channel = pycares.Channel(sock_state_cb=self._sock_state_cb) 14 | self._timer = None 15 | self._fds = set() 16 | self.loop = loop or asyncio.get_event_loop() 17 | 18 | def _sock_state_cb(self, fd, readable, writable): 19 | if readable or writable: 20 | if readable: 21 | self.loop.add_reader(fd, self._process_events, fd, self.EVENT_READ) 22 | if writable: 23 | self.loop.add_writer(fd, self._process_events, fd, self.EVENT_WRITE) 24 | self._fds.add(fd) 25 | if self._timer is None: 26 | self._timer = self.loop.call_later(1.0, self._timer_cb) 27 | else: 28 | # socket is now closed 29 | self._fds.discard(fd) 30 | if not self._fds: 31 | self._timer.cancel() 32 | self._timer = None 33 | 34 | def _timer_cb(self): 35 | self._channel.process_fd(pycares.ARES_SOCKET_BAD, pycares.ARES_SOCKET_BAD) 36 | self._timer = self.loop.call_later(1.0, self._timer_cb) 37 | 38 | def _process_events(self, fd, event): 39 | if event == self.EVENT_READ: 40 | read_fd = fd 41 | write_fd = pycares.ARES_SOCKET_BAD 42 | elif event == self.EVENT_WRITE: 43 | read_fd = pycares.ARES_SOCKET_BAD 44 | write_fd = fd 45 | else: 46 | read_fd = write_fd = pycares.ARES_SOCKET_BAD 47 | self._channel.process_fd(read_fd, write_fd) 48 | 49 | def query(self, query_type, name, cb): 50 | self._channel.query(query_type, name, cb) 51 | 52 | def gethostbyname(self, name, cb): 53 | self._channel.gethostbyname(name, socket.AF_INET, cb) 54 | 55 | 56 | def main(): 57 | def cb(result, error): 58 | print("Result: {}, Error: {}".format(result, error)) 59 | loop = asyncio.get_event_loop() 60 | resolver = DNSResolver(loop) 61 | resolver.query('google.com', pycares.QUERY_TYPE_A, cb) 62 | resolver.query('sip2sip.info', pycares.QUERY_TYPE_SOA, cb) 63 | resolver.gethostbyname('apple.com', cb) 64 | loop.run_forever() 65 | 66 | 67 | if __name__ == '__main__': 68 | main() 69 | 70 | -------------------------------------------------------------------------------- /examples/cares-poll.py: -------------------------------------------------------------------------------- 1 | 2 | import pycares 3 | import select 4 | import socket 5 | 6 | 7 | class DNSResolver(object): 8 | def __init__(self): 9 | self._channel = pycares.Channel(sock_state_cb=self._sock_state_cb) 10 | self.poll = select.epoll() if hasattr(select, "epoll") else select.poll() 11 | self._fd_map = set() 12 | 13 | def _sock_state_cb(self, fd, readable, writable): 14 | print("fd {} read {} write {}".format(fd, readable, writable)) 15 | if readable or writable: 16 | event = (select.POLLIN if readable else 0) | (select.POLLOUT if writable else 0) 17 | if fd not in self._fd_map: 18 | # New socket 19 | print("register %d" % fd) 20 | self.poll.register(fd, event) 21 | self._fd_map.add(fd) 22 | else: 23 | print("modify %d" % fd) 24 | self.poll.modify(fd, event) 25 | else: 26 | # Socket is now closed 27 | self._fd_map.remove(fd) 28 | print("unregister %d" % fd) 29 | self.poll.unregister(fd) 30 | 31 | def wait_channel(self): 32 | while True: 33 | if not self._fd_map: 34 | break 35 | timeout = self._channel.timeout(1.0) 36 | if not timeout: 37 | self._channel.process_fd(pycares.ARES_SOCKET_BAD, pycares.ARES_SOCKET_BAD) 38 | continue 39 | for fd, event in self.poll.poll(timeout): 40 | if event & (select.POLLIN | select.POLLPRI): 41 | self._channel.process_fd(fd, pycares.ARES_SOCKET_BAD) 42 | if event & select.POLLOUT: 43 | self._channel.process_fd(pycares.ARES_SOCKET_BAD, fd) 44 | 45 | def query(self, query_type, name, cb): 46 | self._channel.query(query_type, name, cb) 47 | 48 | def gethostbyname(self, name, cb): 49 | self._channel.gethostbyname(name, socket.AF_INET, cb) 50 | 51 | 52 | if __name__ == '__main__': 53 | def query_cb(result, error): 54 | print(result) 55 | print(error) 56 | def gethostbyname_cb(result, error): 57 | print(result) 58 | print(error) 59 | resolver = DNSResolver() 60 | resolver.query('google.com', pycares.QUERY_TYPE_A, query_cb) 61 | resolver.query('facebook.com', pycares.QUERY_TYPE_A, query_cb) 62 | resolver.query('sip2sip.info', pycares.QUERY_TYPE_SOA, query_cb) 63 | resolver.gethostbyname('apple.com', gethostbyname_cb) 64 | resolver.wait_channel() 65 | -------------------------------------------------------------------------------- /examples/cares-resolver.py: -------------------------------------------------------------------------------- 1 | 2 | import pycares 3 | import pyuv 4 | import socket 5 | 6 | 7 | class DNSResolver(object): 8 | def __init__(self, loop): 9 | self._channel = pycares.Channel(sock_state_cb=self._sock_state_cb) 10 | self.loop = loop 11 | self._timer = pyuv.Timer(self.loop) 12 | self._fd_map = {} 13 | 14 | def _sock_state_cb(self, fd, readable, writable): 15 | if readable or writable: 16 | if fd not in self._fd_map: 17 | # New socket 18 | handle = pyuv.Poll(self.loop, fd) 19 | handle.fd = fd 20 | self._fd_map[fd] = handle 21 | else: 22 | handle = self._fd_map[fd] 23 | if not self._timer.active: 24 | self._timer.start(self._timer_cb, 1.0, 1.0) 25 | handle.start((pyuv.UV_READABLE if readable else 0) | (pyuv.UV_WRITABLE if writable else 0), self._poll_cb) 26 | else: 27 | # Socket is now closed 28 | handle = self._fd_map.pop(fd) 29 | handle.close() 30 | if not self._fd_map: 31 | self._timer.stop() 32 | 33 | def _timer_cb(self, timer): 34 | self._channel.process_fd(pycares.ARES_SOCKET_BAD, pycares.ARES_SOCKET_BAD) 35 | 36 | def _poll_cb(self, handle, events, error): 37 | read_fd = handle.fd 38 | write_fd = handle.fd 39 | if error is not None: 40 | # There was an error, pretend the socket is ready 41 | self._channel.process_fd(read_fd, write_fd) 42 | return 43 | if not events & pyuv.UV_READABLE: 44 | read_fd = pycares.ARES_SOCKET_BAD 45 | if not events & pyuv.UV_WRITABLE: 46 | write_fd = pycares.ARES_SOCKET_BAD 47 | self._channel.process_fd(read_fd, write_fd) 48 | 49 | def query(self, query_type, name, cb): 50 | self._channel.query(query_type, name, cb) 51 | 52 | def gethostbyname(self, name, cb): 53 | self._channel.gethostbyname(name, socket.AF_INET, cb) 54 | 55 | 56 | if __name__ == '__main__': 57 | def query_cb(result, error): 58 | print(result) 59 | print(error) 60 | def gethostbyname_cb(result, error): 61 | print(result) 62 | print(error) 63 | loop = pyuv.Loop.default_loop() 64 | resolver = DNSResolver(loop) 65 | resolver.query('google.com', pycares.QUERY_TYPE_A, query_cb) 66 | resolver.query('sip2sip.info', pycares.QUERY_TYPE_SOA, query_cb) 67 | resolver.gethostbyname('apple.com', gethostbyname_cb) 68 | loop.run() 69 | 70 | -------------------------------------------------------------------------------- /examples/cares-select.py: -------------------------------------------------------------------------------- 1 | 2 | import pycares 3 | import select 4 | import socket 5 | 6 | 7 | def wait_channel(channel): 8 | while True: 9 | read_fds, write_fds = channel.getsock() 10 | if not read_fds and not write_fds: 11 | break 12 | timeout = channel.timeout() 13 | if not timeout: 14 | channel.process_fd(pycares.ARES_SOCKET_BAD, pycares.ARES_SOCKET_BAD) 15 | continue 16 | rlist, wlist, xlist = select.select(read_fds, write_fds, [], timeout) 17 | for fd in rlist: 18 | channel.process_fd(fd, pycares.ARES_SOCKET_BAD) 19 | for fd in wlist: 20 | channel.process_fd(pycares.ARES_SOCKET_BAD, fd) 21 | 22 | 23 | if __name__ == '__main__': 24 | def cb(result, error): 25 | print(result) 26 | print(error) 27 | channel = pycares.Channel() 28 | channel.gethostbyname('google.com', socket.AF_INET, cb) 29 | channel.query('google.com', pycares.QUERY_TYPE_A, cb) 30 | channel.query('sip2sip.info', pycares.QUERY_TYPE_SOA, cb) 31 | wait_channel(channel) 32 | print('Done!') 33 | 34 | -------------------------------------------------------------------------------- /examples/cares-selectors.py: -------------------------------------------------------------------------------- 1 | 2 | import pycares 3 | import selectors 4 | import socket 5 | 6 | 7 | class DNSResolver(object): 8 | def __init__(self): 9 | self._channel = pycares.Channel(sock_state_cb=self._sock_state_cb) 10 | self.poll = selectors.DefaultSelector() 11 | self._fd_map = set() 12 | 13 | def _sock_state_cb(self, fd, readable, writable): 14 | print("fd {} read {} write {}".format(fd, readable, writable)) 15 | if readable or writable: 16 | event = (selectors.EVENT_READ if readable else 0) | (selectors.EVENT_WRITE if writable else 0) 17 | if fd not in self._fd_map: 18 | # New socket 19 | print("register %d" % fd) 20 | self.poll.register(fd, event) 21 | self._fd_map.add(fd) 22 | else: 23 | print("modify %d" % fd) 24 | self.poll.modify(fd, event) 25 | else: 26 | # Socket is now closed 27 | self._fd_map.remove(fd) 28 | print("unregister %d" % fd) 29 | self.poll.unregister(fd) 30 | 31 | def wait_channel(self): 32 | while True: 33 | if not self._fd_map: 34 | break 35 | timeout = self._channel.timeout(1.0) 36 | if not timeout: 37 | self._channel.process_fd(pycares.ARES_SOCKET_BAD, pycares.ARES_SOCKET_BAD) 38 | continue 39 | for key, event in self.poll.select(timeout): 40 | read_fd = key.fd if event & selectors.EVENT_READ else pycares.ARES_SOCKET_BAD 41 | write_fd = key.fd if event & selectors.EVENT_WRITE else pycares.ARES_SOCKET_BAD 42 | self._channel.process_fd(read_fd, write_fd) 43 | 44 | def query(self, query_type, name, cb): 45 | self._channel.query(query_type, name, cb) 46 | 47 | def gethostbyname(self, name, cb): 48 | self._channel.gethostbyname(name, socket.AF_INET, cb) 49 | 50 | 51 | if __name__ == '__main__': 52 | def query_cb(result, error): 53 | print(result) 54 | print(error) 55 | def gethostbyname_cb(result, error): 56 | print(result) 57 | print(error) 58 | resolver = DNSResolver() 59 | resolver.query('google.com', pycares.QUERY_TYPE_A, query_cb) 60 | resolver.query('google.com', pycares.QUERY_TYPE_AAAA, query_cb) 61 | resolver.query('facebook.com', pycares.QUERY_TYPE_A, query_cb) 62 | resolver.query('sip2sip.info', pycares.QUERY_TYPE_SOA, query_cb) 63 | resolver.gethostbyname('apple.com', gethostbyname_cb) 64 | resolver.wait_channel() 65 | 66 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools", "wheel", "cffi>=1.5.0"] 3 | build-backend = "setuptools.build_meta" 4 | 5 | [tool.cibuildwheel] 6 | build = "cp3*" 7 | 8 | [tool.cibuildwheel.linux] 9 | archs = ["auto", "aarch64", "ppc64le", "s390x"] 10 | before-all = """ 11 | set -eux 12 | # musllinux_* 13 | if command -v apk; then 14 | apk add libffi-dev 15 | fi 16 | # manylinux_2_24 17 | if command -v apt; then 18 | apt install libffi-dev 19 | fi 20 | # manylinux_* 21 | if command -v yum; then 22 | yum install -y libffi-devel 23 | fi 24 | """ 25 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | import codecs 5 | import os 6 | import re 7 | import sys 8 | 9 | # we have to import setup_cares.py which is in project's root folder 10 | sys.path.insert(0, os.path.dirname(os.path.realpath(__file__))) 11 | 12 | from setuptools import setup 13 | 14 | from setup_cares import cares_build_ext 15 | 16 | 17 | def get_version(): 18 | return re.search(r"""__version__\s+=\s+(?P['"])(?P.+?)(?P=quote)""", open('src/pycares/_version.py').read()).group('version') 19 | 20 | 21 | setup(name = 'pycares', 22 | version = get_version(), 23 | author = 'Saúl Ibarra Corretgé', 24 | author_email = 's@saghul.net', 25 | license = 'MIT', 26 | url = 'http://github.com/saghul/pycares', 27 | description = 'Python interface for c-ares', 28 | long_description = codecs.open('PYPIREADME.rst', encoding='utf-8').read(), 29 | long_description_content_type = 'text/x-rst', 30 | platforms = ['POSIX', 'Microsoft Windows'], 31 | classifiers = [ 32 | 'Development Status :: 5 - Production/Stable', 33 | 'Intended Audience :: Developers', 34 | 'License :: OSI Approved :: MIT License', 35 | 'Operating System :: POSIX', 36 | 'Operating System :: Microsoft :: Windows', 37 | 'Programming Language :: Python', 38 | 'Programming Language :: Python :: 3', 39 | 'Programming Language :: Python :: 3.9', 40 | 'Programming Language :: Python :: 3.10', 41 | 'Programming Language :: Python :: 3.11', 42 | 'Programming Language :: Python :: 3.12', 43 | 'Programming Language :: Python :: 3.13', 44 | 'Programming Language :: Python :: Implementation :: CPython', 45 | 'Programming Language :: Python :: Implementation :: PyPy', 46 | ], 47 | cmdclass = {'build_ext': cares_build_ext}, 48 | install_requires = ['cffi>=1.5.0'], 49 | extras_require = {'idna': ['idna >= 2.1']}, 50 | python_requires = '>=3.9', 51 | cffi_modules = ['src/_cffi_src/build_cares.py:ffi'], 52 | package_dir = {'': 'src'}, 53 | packages = ['pycares'], 54 | ext_package = 'pycares', 55 | zip_safe = False 56 | ) 57 | -------------------------------------------------------------------------------- /setup_cares.py: -------------------------------------------------------------------------------- 1 | 2 | import os 3 | import sys 4 | import select 5 | 6 | from setuptools.command.build_ext import build_ext 7 | 8 | use_system_lib = bool(int(os.environ.get('PYCARES_USE_SYSTEM_LIB', 0))) 9 | 10 | cares_sources = [ 11 | 'deps/c-ares/src/lib/ares_addrinfo_localhost.c', 12 | 'deps/c-ares/src/lib/ares_addrinfo2hostent.c', 13 | 'deps/c-ares/src/lib/ares_android.c', 14 | 'deps/c-ares/src/lib/ares_cancel.c', 15 | 'deps/c-ares/src/lib/ares_close_sockets.c', 16 | 'deps/c-ares/src/lib/ares_conn.c', 17 | 'deps/c-ares/src/lib/ares_cookie.c', 18 | 'deps/c-ares/src/lib/ares_data.c', 19 | 'deps/c-ares/src/lib/ares_destroy.c', 20 | 'deps/c-ares/src/lib/ares_free_hostent.c', 21 | 'deps/c-ares/src/lib/ares_free_string.c', 22 | 'deps/c-ares/src/lib/ares_freeaddrinfo.c', 23 | 'deps/c-ares/src/lib/ares_getaddrinfo.c', 24 | 'deps/c-ares/src/lib/ares_getenv.c', 25 | 'deps/c-ares/src/lib/ares_gethostbyaddr.c', 26 | 'deps/c-ares/src/lib/ares_gethostbyname.c', 27 | 'deps/c-ares/src/lib/ares_getnameinfo.c', 28 | 'deps/c-ares/src/lib/ares_hosts_file.c', 29 | 'deps/c-ares/src/lib/ares_init.c', 30 | 'deps/c-ares/src/lib/ares_library_init.c', 31 | 'deps/c-ares/src/lib/ares_metrics.c', 32 | 'deps/c-ares/src/lib/ares_options.c', 33 | 'deps/c-ares/src/lib/ares_parse_into_addrinfo.c', 34 | 'deps/c-ares/src/lib/ares_process.c', 35 | 'deps/c-ares/src/lib/ares_qcache.c', 36 | 'deps/c-ares/src/lib/ares_query.c', 37 | 'deps/c-ares/src/lib/ares_search.c', 38 | 'deps/c-ares/src/lib/ares_send.c', 39 | 'deps/c-ares/src/lib/ares_set_socket_functions.c', 40 | 'deps/c-ares/src/lib/ares_socket.c', 41 | 'deps/c-ares/src/lib/ares_sortaddrinfo.c', 42 | 'deps/c-ares/src/lib/ares_strerror.c', 43 | 'deps/c-ares/src/lib/ares_sysconfig_files.c', 44 | 'deps/c-ares/src/lib/ares_sysconfig.c', 45 | 'deps/c-ares/src/lib/ares_timeout.c', 46 | 'deps/c-ares/src/lib/ares_update_servers.c', 47 | 'deps/c-ares/src/lib/ares_version.c', 48 | 'deps/c-ares/src/lib/dsa/ares_array.c', 49 | 'deps/c-ares/src/lib/dsa/ares_htable_asvp.c', 50 | 'deps/c-ares/src/lib/dsa/ares_htable_dict.c', 51 | 'deps/c-ares/src/lib/dsa/ares_htable_strvp.c', 52 | 'deps/c-ares/src/lib/dsa/ares_htable_szvp.c', 53 | 'deps/c-ares/src/lib/dsa/ares_htable_vpstr.c', 54 | 'deps/c-ares/src/lib/dsa/ares_htable_vpvp.c', 55 | 'deps/c-ares/src/lib/dsa/ares_htable.c', 56 | 'deps/c-ares/src/lib/dsa/ares_llist.c', 57 | 'deps/c-ares/src/lib/dsa/ares_slist.c', 58 | 'deps/c-ares/src/lib/event/ares_event_configchg.c', 59 | 'deps/c-ares/src/lib/event/ares_event_thread.c', 60 | 'deps/c-ares/src/lib/event/ares_event_wake_pipe.c', 61 | 'deps/c-ares/src/lib/inet_net_pton.c', 62 | 'deps/c-ares/src/lib/inet_ntop.c', 63 | 'deps/c-ares/src/lib/legacy/ares_create_query.c', 64 | 'deps/c-ares/src/lib/legacy/ares_expand_name.c', 65 | 'deps/c-ares/src/lib/legacy/ares_expand_string.c', 66 | 'deps/c-ares/src/lib/legacy/ares_fds.c', 67 | 'deps/c-ares/src/lib/legacy/ares_getsock.c', 68 | 'deps/c-ares/src/lib/legacy/ares_parse_a_reply.c', 69 | 'deps/c-ares/src/lib/legacy/ares_parse_aaaa_reply.c', 70 | 'deps/c-ares/src/lib/legacy/ares_parse_caa_reply.c', 71 | 'deps/c-ares/src/lib/legacy/ares_parse_mx_reply.c', 72 | 'deps/c-ares/src/lib/legacy/ares_parse_naptr_reply.c', 73 | 'deps/c-ares/src/lib/legacy/ares_parse_ns_reply.c', 74 | 'deps/c-ares/src/lib/legacy/ares_parse_ptr_reply.c', 75 | 'deps/c-ares/src/lib/legacy/ares_parse_soa_reply.c', 76 | 'deps/c-ares/src/lib/legacy/ares_parse_srv_reply.c', 77 | 'deps/c-ares/src/lib/legacy/ares_parse_txt_reply.c', 78 | 'deps/c-ares/src/lib/legacy/ares_parse_uri_reply.c', 79 | 'deps/c-ares/src/lib/record/ares_dns_mapping.c', 80 | 'deps/c-ares/src/lib/record/ares_dns_multistring.c', 81 | 'deps/c-ares/src/lib/record/ares_dns_name.c', 82 | 'deps/c-ares/src/lib/record/ares_dns_parse.c', 83 | 'deps/c-ares/src/lib/record/ares_dns_record.c', 84 | 'deps/c-ares/src/lib/record/ares_dns_write.c', 85 | 'deps/c-ares/src/lib/str/ares_buf.c', 86 | 'deps/c-ares/src/lib/str/ares_str.c', 87 | 'deps/c-ares/src/lib/str/ares_strsplit.c', 88 | 'deps/c-ares/src/lib/util/ares_iface_ips.c', 89 | 'deps/c-ares/src/lib/util/ares_math.c', 90 | 'deps/c-ares/src/lib/util/ares_rand.c', 91 | 'deps/c-ares/src/lib/util/ares_threads.c', 92 | 'deps/c-ares/src/lib/util/ares_timeval.c', 93 | 'deps/c-ares/src/lib/util/ares_uri.c', 94 | ] 95 | 96 | if sys.platform == 'win32': 97 | cares_sources += ['deps/c-ares/src/lib/ares_sysconfig_win.c', 98 | 'deps/c-ares/src/lib/windows_port.c', 99 | 'deps/c-ares/src/lib/event/ares_event_win32.c'] 100 | 101 | if sys.platform == 'darwin': 102 | cares_sources += ['deps/c-ares/src/lib/ares_sysconfig_mac.c'] 103 | 104 | class cares_build_ext(build_ext): 105 | cares_dir = os.path.join('deps', 'c-ares') 106 | build_config_dir = os.path.join('deps', 'build-config') 107 | 108 | def add_include_dir(self, dir, force=False): 109 | if use_system_lib and not force: 110 | return 111 | dirs = self.compiler.include_dirs 112 | dirs.insert(0, dir) 113 | self.compiler.set_include_dirs(dirs) 114 | 115 | def build_extensions(self): 116 | self.add_include_dir(os.path.join(self.cares_dir, 'include')) 117 | self.add_include_dir(os.path.join(self.cares_dir, 'src', 'lib')) 118 | self.add_include_dir(os.path.join(self.cares_dir, 'src', 'lib', 'include')) 119 | self.add_include_dir(os.path.join(self.build_config_dir, 'include'), True) 120 | if sys.platform != 'win32': 121 | self.compiler.define_macro('HAVE_CONFIG_H', 1) 122 | self.compiler.define_macro('_LARGEFILE_SOURCE', 1) 123 | self.compiler.define_macro('_FILE_OFFSET_BITS', 64) 124 | if sys.platform.startswith('linux'): 125 | # Check if it's actually Android 126 | if os.environ.get('ANDROID_ROOT') and os.environ.get('ANDROID_DATA'): 127 | self.add_include_dir(os.path.join(self.build_config_dir, 'config_android')) 128 | else: 129 | self.add_include_dir(os.path.join(self.build_config_dir, 'config_linux')) 130 | self.compiler.add_library('dl') 131 | self.compiler.add_library('rt') 132 | elif sys.platform == 'darwin': 133 | self.add_include_dir(os.path.join(self.build_config_dir, 'config_darwin')) 134 | self.compiler.define_macro('_DARWIN_USE_64_BIT_INODE', 1) 135 | elif sys.platform.startswith('freebsd'): 136 | self.add_include_dir(os.path.join(self.build_config_dir, 'config_freebsd')) 137 | self.compiler.add_library('kvm') 138 | elif sys.platform.startswith('dragonfly'): 139 | self.add_include_dir(os.path.join(self.build_config_dir, 'config_freebsd')) 140 | elif sys.platform.startswith('netbsd'): 141 | self.add_include_dir(os.path.join(self.build_config_dir, 'config_netbsd')) 142 | elif sys.platform.startswith('openbsd'): 143 | self.add_include_dir(os.path.join(self.build_config_dir, 'config_openbsd')) 144 | elif sys.platform.startswith('sunos'): 145 | self.add_include_dir(os.path.join(self.build_config_dir, 'config_sunos')) 146 | self.compiler.add_library('socket') 147 | self.compiler.add_library('nsl') 148 | self.compiler.add_library('kstat') 149 | elif sys.platform == 'cygwin': 150 | self.add_include_dir(os.path.join(self.build_config_dir, 'config_cygwin')) 151 | elif sys.platform == 'win32': 152 | if 'mingw' not in self.compiler.compiler_type: 153 | self.extensions[0].extra_link_args = ['/NODEFAULTLIB:libcmt'] 154 | self.compiler.add_library('advapi32') 155 | self.compiler.add_library('iphlpapi') 156 | self.compiler.add_library('psapi') 157 | self.compiler.add_library('ws2_32') 158 | self.compiler.define_macro("CARES_HAVE_WINSOCK2_H", 1) 159 | self.compiler.define_macro("CARES_HAVE_WS2TCPIP_H", 1) 160 | self.compiler.define_macro("CARES_HAVE_WINDOWS_H", 1) 161 | 162 | 163 | if use_system_lib: 164 | self.compiler.add_library('cares') 165 | else: 166 | sources = cares_sources.copy() 167 | self.compiler.define_macro('CARES_THREADS', 1) 168 | self.compiler.define_macro('CARES_STATICLIB', 1) 169 | if hasattr(select, 'poll'): 170 | sources += ['deps/c-ares/src/lib/event/ares_event_poll.c'] 171 | self.compiler.define_macro('HAVE_POLL', 1) 172 | self.compiler.define_macro('HAVE_POLL_H', 1) 173 | if hasattr(select, 'kqueue'): 174 | sources += ['deps/c-ares/src/lib/event/ares_event_kqueue.c'] 175 | self.compiler.define_macro('HAVE_KQUEUE', 1) 176 | self.compiler.define_macro('HAVE_SYS_TYPES_H', 1) 177 | self.compiler.define_macro('HAVE_SYS_EVENT_H', 1) 178 | self.compiler.define_macro('HAVE_SYS_TIME_H', 1) 179 | self.compiler.define_macro('HAVE_FCNTL_H', 1) 180 | if hasattr(select, 'epoll'): 181 | sources += ['deps/c-ares/src/lib/event/ares_event_epoll.c'] 182 | self.compiler.define_macro('HAVE_EPOLL', 1) 183 | self.compiler.define_macro('HAVE_SYS_EPOLL_H', 1) 184 | self.compiler.define_macro('HAVE_FCNTL_H', 1) 185 | if hasattr(os, 'pipe') and sys.platform != 'win32': 186 | sources += ['deps/c-ares/src/lib/event/ares_event_select.c'] 187 | self.compiler.define_macro('HAVE_PIPE', 1) 188 | self.extensions[0].sources += sources 189 | 190 | build_ext.build_extensions(self) 191 | -------------------------------------------------------------------------------- /src/pycares/__main__.py: -------------------------------------------------------------------------------- 1 | 2 | import collections.abc 3 | import pycares 4 | import select 5 | import socket 6 | import sys 7 | 8 | 9 | def wait_channel(channel): 10 | while True: 11 | read_fds, write_fds = channel.getsock() 12 | if not read_fds and not write_fds: 13 | break 14 | timeout = channel.timeout() 15 | if not timeout: 16 | channel.process_fd(pycares.ARES_SOCKET_BAD, pycares.ARES_SOCKET_BAD) 17 | continue 18 | rlist, wlist, xlist = select.select(read_fds, write_fds, [], timeout) 19 | for fd in rlist: 20 | channel.process_fd(fd, pycares.ARES_SOCKET_BAD) 21 | for fd in wlist: 22 | channel.process_fd(pycares.ARES_SOCKET_BAD, fd) 23 | 24 | 25 | def cb(result, error): 26 | if error is not None: 27 | print('Error: (%d) %s' % (error, pycares.errno.strerror(error))) 28 | else: 29 | parts = [ 30 | ';; QUESTION SECTION:', 31 | ';%s\t\t\tIN\t%s' % (hostname, qtype.upper()), 32 | '', 33 | ';; ANSWER SECTION:' 34 | ] 35 | 36 | if not isinstance(result, collections.abc.Iterable): 37 | result = [result] 38 | 39 | for r in result: 40 | txt = '%s\t\t%d\tIN\t%s' % (hostname, r.ttl, r.type) 41 | if r.type in ('A', 'AAAA'): 42 | parts.append('%s\t%s' % (txt, r.host)) 43 | elif r.type == 'CAA': 44 | parts.append('%s\t%d %s "%s"' % (txt, r.critical, r.property, r.value)) 45 | elif r.type == 'CNAME': 46 | parts.append('%s\t%s' % (txt, r.cname)) 47 | elif r.type == 'MX': 48 | parts.append('%s\t%d %s' % (txt, r.priority, r.host)) 49 | elif r.type == 'NAPTR': 50 | parts.append('%s\t%d %d "%s" "%s" "%s" %s' % (txt, r.order, r.preference, r.flags, r.service, r.regex, r.replacement)) 51 | elif r.type == 'NS': 52 | parts.append('%s\t%s' % (txt, r.host)) 53 | elif r.type == 'PTR': 54 | parts.append('%s\t%s' % (txt, r.name)) 55 | elif r.type == 'SOA': 56 | 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)) 57 | elif r.type == 'SRV': 58 | parts.append('%s\t%d %d %d %s' % (txt, r.priority, r.weight, r.port, r.host)) 59 | elif r.type == 'TXT': 60 | parts.append('%s\t"%s"' % (txt, r.text)) 61 | 62 | print('\n'.join(parts)) 63 | 64 | 65 | channel = pycares.Channel() 66 | 67 | if len(sys.argv) not in (2, 3): 68 | print('Invalid arguments! Usage: python -m pycares [query_type] hostname') 69 | sys.exit(1) 70 | 71 | if len(sys.argv) == 2: 72 | _, hostname = sys.argv 73 | qtype = 'A' 74 | else: 75 | _, qtype, hostname = sys.argv 76 | 77 | try: 78 | query_type = getattr(pycares, 'QUERY_TYPE_%s' % qtype.upper()) 79 | except Exception: 80 | print('Invalid query type: %s' % qtype) 81 | sys.exit(1) 82 | 83 | channel.query(hostname, query_type, cb) 84 | wait_channel(channel) 85 | -------------------------------------------------------------------------------- /src/pycares/_version.py: -------------------------------------------------------------------------------- 1 | 2 | __version__ = '4.8.0' 3 | -------------------------------------------------------------------------------- /src/pycares/errno.py: -------------------------------------------------------------------------------- 1 | from typing import Union 2 | 3 | from ._cares import ffi as _ffi, lib as _lib 4 | from .utils import maybe_str 5 | 6 | ARES_SUCCESS = _lib.ARES_SUCCESS 7 | # error codes 8 | ARES_ENODATA = _lib.ARES_ENODATA 9 | ARES_EFORMERR = _lib.ARES_EFORMERR 10 | ARES_ESERVFAIL = _lib.ARES_ESERVFAIL 11 | ARES_ENOTFOUND = _lib.ARES_ENOTFOUND 12 | ARES_ENOTIMP = _lib.ARES_ENOTIMP 13 | ARES_EREFUSED = _lib.ARES_EREFUSED 14 | ARES_EBADQUERY = _lib.ARES_EBADQUERY 15 | ARES_EBADNAME = _lib.ARES_EBADNAME 16 | ARES_EBADFAMILY = _lib.ARES_EBADFAMILY 17 | ARES_EBADRESP = _lib.ARES_EBADRESP 18 | ARES_ECONNREFUSED = _lib.ARES_ECONNREFUSED 19 | ARES_ETIMEOUT = _lib.ARES_ETIMEOUT 20 | ARES_EOF = _lib.ARES_EOF 21 | ARES_EFILE = _lib.ARES_EFILE 22 | ARES_ENOMEM = _lib.ARES_ENOMEM 23 | ARES_EDESTRUCTION = _lib.ARES_EDESTRUCTION 24 | ARES_EBADSTR = _lib.ARES_EBADSTR 25 | ARES_EBADFLAGS = _lib.ARES_EBADFLAGS 26 | ARES_ENONAME = _lib.ARES_ENONAME 27 | ARES_EBADHINTS = _lib.ARES_EBADHINTS 28 | ARES_ENOTINITIALIZED = _lib.ARES_ENOTINITIALIZED 29 | ARES_ELOADIPHLPAPI = _lib.ARES_ELOADIPHLPAPI 30 | ARES_EADDRGETNETWORKPARAMS = _lib.ARES_EADDRGETNETWORKPARAMS 31 | ARES_ECANCELLED = _lib.ARES_ECANCELLED 32 | ARES_ESERVICE = _lib.ARES_ESERVICE 33 | 34 | errorcode = { 35 | ARES_SUCCESS: "ARES_SUCCESS", 36 | # error codes 37 | ARES_ENODATA: "ARES_ENODATA", 38 | ARES_EFORMERR: "ARES_EFORMERR", 39 | ARES_ESERVFAIL: "ARES_ESERVFAIL", 40 | ARES_ENOTFOUND: "ARES_ENOTFOUND", 41 | ARES_ENOTIMP: "ARES_ENOTIMP", 42 | ARES_EREFUSED: "ARES_EREFUSED", 43 | ARES_EBADQUERY: "ARES_EBADQUERY", 44 | ARES_EBADNAME: "ARES_EBADNAME", 45 | ARES_EBADFAMILY: "ARES_EBADFAMILY", 46 | ARES_EBADRESP: "ARES_EBADRESP", 47 | ARES_ECONNREFUSED: "ARES_ECONNREFUSED", 48 | ARES_ETIMEOUT: "ARES_ETIMEOUT", 49 | ARES_EOF: "ARES_EOF", 50 | ARES_EFILE: "ARES_EFILE", 51 | ARES_ENOMEM: "ARES_ENOMEM", 52 | ARES_EDESTRUCTION: "ARES_EDESTRUCTION", 53 | ARES_EBADSTR: "ARES_EBADSTR", 54 | ARES_EBADFLAGS: "ARES_EBADFLAGS", 55 | ARES_ENONAME: "ARES_ENONAME", 56 | ARES_EBADHINTS: "ARES_EBADHINTS", 57 | ARES_ENOTINITIALIZED: "ARES_ENOTINITIALIZED", 58 | ARES_ELOADIPHLPAPI: "ARES_ELOADIPHLPAPI", 59 | ARES_EADDRGETNETWORKPARAMS: "ARES_EADDRGETNETWORKPARAMS", 60 | ARES_ECANCELLED: "ARES_ECANCELLED", 61 | ARES_ESERVICE: "ARES_ESERVICE", 62 | } 63 | 64 | 65 | def strerror(code: int) -> Union[str, bytes]: 66 | return maybe_str(_ffi.string(_lib.ares_strerror(code))) 67 | 68 | 69 | __all__ = ("errorcode", "strerror", *errorcode.values()) 70 | -------------------------------------------------------------------------------- /src/pycares/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saghul/pycares/b572e287bcf411eac173df2ae6ffba34a53deca9/src/pycares/py.typed -------------------------------------------------------------------------------- /src/pycares/utils.py: -------------------------------------------------------------------------------- 1 | 2 | from typing import Union 3 | 4 | try: 5 | import idna as idna2008 6 | except ImportError: 7 | idna2008 = None 8 | 9 | 10 | def ascii_bytes(data): 11 | if isinstance(data, str): 12 | return data.encode('ascii') 13 | if isinstance(data, bytes): 14 | return data 15 | raise TypeError('only str (ascii encoding) and bytes are supported') 16 | 17 | 18 | def maybe_str(data): 19 | if isinstance(data, str): 20 | return data 21 | if isinstance(data, bytes): 22 | try: 23 | return data.decode('ascii') 24 | except UnicodeDecodeError: 25 | return data 26 | raise TypeError('only str (ascii encoding) and bytes are supported') 27 | 28 | 29 | def parse_name_idna2008(name: str) -> str: 30 | parts = name.split('.') 31 | r = [] 32 | for part in parts: 33 | if part.isascii(): 34 | r.append(part.encode('ascii')) 35 | else: 36 | r.append(idna2008.encode(part)) 37 | return b'.'.join(r) 38 | 39 | 40 | def parse_name(name: Union[str, bytes]) -> bytes: 41 | if isinstance(name, str): 42 | if name.isascii(): 43 | return name.encode('ascii') 44 | if idna2008 is not None: 45 | return parse_name_idna2008(name) 46 | return name.encode('idna') 47 | if isinstance(name, bytes): 48 | return name 49 | raise TypeError('only str and bytes are supported') 50 | 51 | 52 | __all__ = ['ascii_bytes', 'maybe_str', 'parse_name'] 53 | 54 | -------------------------------------------------------------------------------- /tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saghul/pycares/b572e287bcf411eac173df2ae6ffba34a53deca9/tests/__init__.py -------------------------------------------------------------------------------- /tests/fixtures/badresolv.conf: -------------------------------------------------------------------------------- 1 | nameserver 1.2.3.4 2 | --------------------------------------------------------------------------------