Showing preview only (896K chars total). Download the full file or copy to clipboard to get everything.
Repository: MiniDNS/minidns
Branch: master
Commit: 46a3e8c6c107
Files: 231
Total size: 820.3 KB
Directory structure:
gitextract_xohl602z/
├── .github/
│ └── workflows/
│ └── ci.yml
├── .gitignore
├── LICENCE
├── LICENCE_APACHE
├── LICENCE_LGPL2.1
├── LICENCE_WTFPL
├── Makefile
├── README.md
├── build-logic/
│ ├── build.gradle
│ ├── settings.gradle
│ └── src/
│ └── main/
│ └── groovy/
│ ├── org.minidns.android-boot-classpath-conventions.gradle
│ ├── org.minidns.android-conventions.gradle
│ ├── org.minidns.application-conventions.gradle
│ ├── org.minidns.common-conventions.gradle
│ ├── org.minidns.java-conventions.gradle
│ └── org.minidns.javadoc-conventions.gradle
├── build.gradle
├── config/
│ ├── checkstyle/
│ │ ├── checkstyle.xml
│ │ ├── header.txt
│ │ └── suppressions.xml
│ └── scalaStyle.xml
├── gradle/
│ └── wrapper/
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradle.properties.example
├── gradlew
├── gradlew.bat
├── minidns-android23/
│ ├── build.gradle
│ └── src/
│ ├── main/
│ │ └── java/
│ │ └── org/
│ │ └── minidns/
│ │ └── dnsserverlookup/
│ │ └── android21/
│ │ └── AndroidUsingLinkProperties.java
│ └── test/
│ └── java/
│ └── org/
│ └── minidns/
│ └── dnsserverlookup/
│ └── android21/
│ └── AndroidUsingLinkPropertiesTest.java
├── minidns-async/
│ ├── build.gradle
│ └── src/
│ ├── main/
│ │ └── java/
│ │ └── org/
│ │ └── minidns/
│ │ └── source/
│ │ └── async/
│ │ ├── AsyncDnsRequest.java
│ │ ├── AsyncNetworkDataSource.java
│ │ └── ChannelSelectedHandler.java
│ └── test/
│ └── java/
│ └── org/
│ └── minidns/
│ └── source/
│ └── async/
│ └── AsyncNetworkDataSourceTest.java
├── minidns-client/
│ ├── build.gradle
│ └── src/
│ ├── main/
│ │ ├── java/
│ │ │ └── org/
│ │ │ └── minidns/
│ │ │ ├── AbstractDnsClient.java
│ │ │ ├── DnsCache.java
│ │ │ ├── DnsClient.java
│ │ │ ├── MiniDnsConfiguration.java
│ │ │ ├── MiniDnsException.java
│ │ │ ├── MiniDnsFuture.java
│ │ │ ├── MiniDnsInitialization.java
│ │ │ ├── RrSet.java
│ │ │ ├── cache/
│ │ │ │ ├── ExtendedLruCache.java
│ │ │ │ ├── FullLruCache.java
│ │ │ │ ├── LruCache.java
│ │ │ │ └── MiniDnsCacheFactory.java
│ │ │ ├── dnsqueryresult/
│ │ │ │ ├── CachedDnsQueryResult.java
│ │ │ │ ├── DirectCachedDnsQueryResult.java
│ │ │ │ ├── DnsQueryResult.java
│ │ │ │ ├── StandardDnsQueryResult.java
│ │ │ │ └── SynthesizedCachedDnsQueryResult.java
│ │ │ ├── dnsserverlookup/
│ │ │ │ ├── AbstractDnsServerLookupMechanism.java
│ │ │ │ ├── AndroidUsingExec.java
│ │ │ │ ├── AndroidUsingReflection.java
│ │ │ │ ├── DnsServerLookupMechanism.java
│ │ │ │ └── UnixUsingEtcResolvConf.java
│ │ │ └── source/
│ │ │ ├── AbstractDnsDataSource.java
│ │ │ ├── DnsDataSource.java
│ │ │ ├── NetworkDataSource.java
│ │ │ └── NetworkDataSourceWithAccounting.java
│ │ └── resources/
│ │ └── de.measite.minidns/
│ │ └── .keep
│ └── test/
│ └── java/
│ └── org/
│ └── minidns/
│ ├── DnsClientTest.java
│ ├── DnsWorld.java
│ ├── LruCacheTest.java
│ ├── dnsqueryresult/
│ │ └── TestWorldDnsQueryResult.java
│ ├── dnsserverlookup/
│ │ └── AndroidUsingExecTest.java
│ └── source/
│ └── NetworkDataSourceTest.java
├── minidns-core/
│ ├── build.gradle
│ └── src/
│ ├── main/
│ │ └── java/
│ │ └── org/
│ │ └── minidns/
│ │ ├── constants/
│ │ │ ├── DnsRootServer.java
│ │ │ └── DnssecConstants.java
│ │ ├── dnslabel/
│ │ │ ├── ALabel.java
│ │ │ ├── DnsLabel.java
│ │ │ ├── FakeALabel.java
│ │ │ ├── LdhLabel.java
│ │ │ ├── LeadingOrTrailingHyphenLabel.java
│ │ │ ├── NonLdhLabel.java
│ │ │ ├── NonReservedLdhLabel.java
│ │ │ ├── OtherNonLdhLabel.java
│ │ │ ├── ReservedLdhLabel.java
│ │ │ ├── UnderscoreLabel.java
│ │ │ └── XnLabel.java
│ │ ├── dnsmessage/
│ │ │ ├── DnsMessage.java
│ │ │ └── Question.java
│ │ ├── dnsname/
│ │ │ ├── DnsName.java
│ │ │ └── InvalidDnsNameException.java
│ │ ├── edns/
│ │ │ ├── Edns.java
│ │ │ ├── EdnsOption.java
│ │ │ ├── Nsid.java
│ │ │ └── UnknownEdnsOption.java
│ │ ├── idna/
│ │ │ ├── DefaultIdnaTransformator.java
│ │ │ ├── IdnaTransformator.java
│ │ │ └── MiniDnsIdna.java
│ │ ├── record/
│ │ │ ├── A.java
│ │ │ ├── AAAA.java
│ │ │ ├── CNAME.java
│ │ │ ├── DLV.java
│ │ │ ├── DNAME.java
│ │ │ ├── DNSKEY.java
│ │ │ ├── DS.java
│ │ │ ├── Data.java
│ │ │ ├── DelegatingDnssecRR.java
│ │ │ ├── InternetAddressRR.java
│ │ │ ├── MX.java
│ │ │ ├── NS.java
│ │ │ ├── NSEC.java
│ │ │ ├── NSEC3.java
│ │ │ ├── NSEC3PARAM.java
│ │ │ ├── OPENPGPKEY.java
│ │ │ ├── OPT.java
│ │ │ ├── PTR.java
│ │ │ ├── RRSIG.java
│ │ │ ├── RRWithTarget.java
│ │ │ ├── Record.java
│ │ │ ├── SOA.java
│ │ │ ├── SRV.java
│ │ │ ├── TLSA.java
│ │ │ ├── TXT.java
│ │ │ └── UNKNOWN.java
│ │ └── util/
│ │ ├── Base32.java
│ │ ├── Base64.java
│ │ ├── CallbackRecipient.java
│ │ ├── CollectionsUtil.java
│ │ ├── ExceptionCallback.java
│ │ ├── Hex.java
│ │ ├── InetAddressUtil.java
│ │ ├── MultipleIoException.java
│ │ ├── NameUtil.java
│ │ ├── PlatformDetection.java
│ │ ├── SafeCharSequence.java
│ │ ├── SrvUtil.java
│ │ └── SuccessCallback.java
│ └── test/
│ ├── java/
│ │ └── org/
│ │ └── minidns/
│ │ ├── Assert.java
│ │ ├── dnslabel/
│ │ │ └── DnsLabelTest.java
│ │ ├── dnsmessage/
│ │ │ └── DnsMessageTest.java
│ │ ├── dnsname/
│ │ │ └── DnsNameTest.java
│ │ ├── record/
│ │ │ ├── RecordsTest.java
│ │ │ └── TLSATest.java
│ │ └── util/
│ │ ├── Base32Test.java
│ │ ├── Base64Test.java
│ │ ├── InetAddressUtilTest.java
│ │ ├── NameUtilTest.java
│ │ └── SrvUtilTest.java
│ └── resources/
│ └── org/
│ └── minidns/
│ └── dnsmessage/
│ ├── codinghorror-txt
│ ├── com-ds-rrsig
│ ├── com-ns
│ ├── com-nsec3
│ ├── example-nsec
│ ├── gmail-domainkey-txt
│ ├── gmail-mx
│ ├── google-aaaa
│ ├── gpn-srv
│ ├── oracle-soa
│ ├── root-dnskey
│ └── sun-a
├── minidns-dane/
│ ├── build.gradle
│ └── src/
│ ├── main/
│ │ └── java/
│ │ └── org/
│ │ └── minidns/
│ │ └── dane/
│ │ └── java7/
│ │ └── DaneExtendedTrustManager.java
│ └── test/
│ └── java/
│ └── org/
│ └── minidns/
│ └── dane/
│ └── java7/
│ └── DaneJava7Test.java
├── minidns-dnssec/
│ ├── build.gradle
│ └── src/
│ ├── main/
│ │ ├── java/
│ │ │ └── org/
│ │ │ └── minidns/
│ │ │ ├── dane/
│ │ │ │ ├── DaneCertificateException.java
│ │ │ │ ├── DaneVerifier.java
│ │ │ │ ├── ExpectingTrustManager.java
│ │ │ │ └── X509TrustManagerUtil.java
│ │ │ └── dnssec/
│ │ │ ├── DigestCalculator.java
│ │ │ ├── DnssecClient.java
│ │ │ ├── DnssecQueryResult.java
│ │ │ ├── DnssecResultNotAuthenticException.java
│ │ │ ├── DnssecUnverifiedReason.java
│ │ │ ├── DnssecValidationFailedException.java
│ │ │ ├── DnssecValidatorInitializationException.java
│ │ │ ├── SignatureVerifier.java
│ │ │ ├── Verifier.java
│ │ │ └── algorithms/
│ │ │ ├── AlgorithmMap.java
│ │ │ ├── DsaSignatureVerifier.java
│ │ │ ├── EcdsaSignatureVerifier.java
│ │ │ ├── EcgostSignatureVerifier.java
│ │ │ ├── JavaSecDigestCalculator.java
│ │ │ ├── JavaSecSignatureVerifier.java
│ │ │ └── RsaSignatureVerifier.java
│ │ └── resources/
│ │ └── .keep-minidns-dnssec-main-resources
│ └── test/
│ ├── java/
│ │ └── org/
│ │ └── minidns/
│ │ └── dnssec/
│ │ ├── DnssecClientTest.java
│ │ ├── DnssecWorld.java
│ │ ├── VerifierTest.java
│ │ └── algorithms/
│ │ ├── AlgorithmTest.java
│ │ ├── DigestTest.java
│ │ ├── DsaSingatureVerifierTest.java
│ │ ├── RsaSignatureVerifierTest.java
│ │ └── SignatureVerifierTest.java
│ └── resources/
│ └── .keep-minidns-dnssec-test-resources
├── minidns-hla/
│ ├── build.gradle
│ └── src/
│ ├── main/
│ │ └── java/
│ │ └── org/
│ │ └── minidns/
│ │ └── hla/
│ │ ├── DnssecResolverApi.java
│ │ ├── ResolutionUnsuccessfulException.java
│ │ ├── ResolverApi.java
│ │ ├── ResolverResult.java
│ │ ├── SrvResolverResult.java
│ │ └── srv/
│ │ ├── SrvProto.java
│ │ ├── SrvService.java
│ │ ├── SrvServiceProto.java
│ │ └── SrvType.java
│ └── test/
│ └── java/
│ └── org/
│ └── minidns/
│ └── hla/
│ └── MiniDnsHlaTest.java
├── minidns-integration-test/
│ ├── build.gradle
│ └── src/
│ ├── main/
│ │ └── java/
│ │ └── org/
│ │ └── minidns/
│ │ ├── integrationtest/
│ │ │ ├── AsyncApiTest.java
│ │ │ ├── CoreTest.java
│ │ │ ├── DaneTest.java
│ │ │ ├── DnssecTest.java
│ │ │ ├── HlaTest.java
│ │ │ ├── IntegrationTest.java
│ │ │ ├── IntegrationTestHelper.java
│ │ │ ├── IntegrationTestTools.java
│ │ │ ├── IterativeDnssecTest.java
│ │ │ └── NsidTest.java
│ │ └── jul/
│ │ └── MiniDnsJul.java
│ └── test/
│ └── java/
│ └── org/
│ └── minidns/
│ └── integrationtest/
│ └── IntegrationTestTest.java
├── minidns-iterative-resolver/
│ ├── build.gradle
│ └── src/
│ ├── main/
│ │ └── java/
│ │ └── org/
│ │ └── minidns/
│ │ └── iterative/
│ │ ├── IterativeClientException.java
│ │ ├── IterativeDnsClient.java
│ │ ├── ReliableDnsClient.java
│ │ └── ResolutionState.java
│ └── test/
│ └── java/
│ └── org/
│ └── minidns/
│ └── iterative/
│ └── IterativeDnsClientTest.java
├── minidns-repl/
│ ├── build.gradle
│ ├── scala.repl
│ └── src/
│ ├── main/
│ │ └── java/
│ │ └── org/
│ │ └── minidns/
│ │ └── minidnsrepl/
│ │ ├── DnssecStats.java
│ │ ├── MiniDnsRepl.java
│ │ └── MiniDnsStats.java
│ └── test/
│ └── java/
│ └── org/
│ └── minidns/
│ └── minidnsrepl/
│ └── ReplTest.java
├── misc/
│ ├── resolve.pl
│ └── sbt/
│ ├── .gitignore
│ └── build.sbt
├── repl
├── settings.gradle
└── version
================================================
FILE CONTENTS
================================================
================================================
FILE: .github/workflows/ci.yml
================================================
name: CI
on: [push, pull_request]
jobs:
build:
name: Build MiniDNS
runs-on: ubuntu-24.04
strategy:
matrix:
java:
- 17
- 21
env:
PRIMARY_JAVA_VERSION: 21
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
# Caches
- name: Cache Maven
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: maven-${{ hashFiles('**/build.gradle') }}
restore-keys: |
maven-
- name: Cache Gradle
uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: gradle-caches-${{ hashFiles('**/build.gradle') }}
restore-keys:
gradle-caches
- name: Cache Gradle Binary
uses: actions/cache@v2
with:
path: |
~/gradle-bin-${GRADLE_VERSION}/
key: gradle-bin-${GRADLE_VERSION}
- name: Cache Android SDK
uses: actions/cache@v2
with:
path: |
~/.android/sdk
key: android-${{ hashFiles('build.gradle') }}
restore-keys: |
android-
# Pre-reqs
- name: Install Android SDK Manager
uses: android-actions/setup-android@v2
- name: Install Android SDK
run: |
sdkmanager \
"platforms;android-19" \
"platforms;android-23"
# Testing
- name: Gradle Check
run: ./gradlew check --stacktrace
# Test local publish
- name: Gradle publish
run: ./gradlew publishToMavenLocal --stacktrace
# Javadoc
- name: Javadoc
if: ${{ matrix.java == env.PRIMARY_JAVA_VERSION }}
run: ./gradlew javadocAll --stacktrace
# Test Coverage Report
- name: Jacoco Test Coverage
run: ./gradlew minidns-hla:testCodeCoverageReport
# Coveralls
- name: Report coverage stats to Coveralls
if: ${{ matrix.java == env.PRIMARY_JAVA_VERSION }}
uses: coverallsapp/github-action@v2
with:
format: jacoco
file: minidns-hla/build/reports/jacoco/testCodeCoverageReport/testCodeCoverageReport.xml
# Upload build artifacts
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: smack-java-${{ matrix.java }}
path: |
minidns-*/build/libs/*.jar
!**/*-test-fixtures.jar
!**/*-tests.jar
================================================
FILE: .gitignore
================================================
# From https://github.com/github/gitignore
# # # # # # # # # # # #
# Android gitignore #
# # # # # # # # # # # #
# Built application files
*.apk
*.ap_
# Files for the Dalvik VM
*.dex
# Java class files
*.class
# Generated files
bin/
gen/
# Gradle files
.gradle/
build/
# Local configuration file (sdk path, etc)
local.properties
gradle.properties
# Proguard folder generated by Eclipse
proguard/
# # # # # # # #
# VIM / Linux #
# # # # # # # #
[._]*.s[a-w][a-z]
[._]s[a-w][a-z]
*.un~
Session.vim
.netrwhist
*~
.directory
# # # # # #
# Eclipse #
# # # # # #
*.pydevproject
.metadata
.gradle
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.settings/
.loadpath
.classpath
.project
# External tool builders
.externalToolBuilders/
# Locally stored "Eclipse launch configurations"
*.launch
# CDT-specific
.cproject
# PDT-specific
.buildpath
# sbteclipse plugin
.target
# TeXlipse plugin
.texlipse
# # # # # # # # #
# IntelliJ IDEA #
# # # # # # # # #
.idea/
*.iml
# # # # #
# OS X #
# # # # #
.DS_Store
.AppleDouble
.LSOverride
# Icon must ends with two \r.
Icon
# Thumbnails
._*
# Files that might appear on external disk
.Spotlight-V100
.Trashes
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
# Auto generated version file
/minidns-core/src/main/resources/org.minidns/version
================================================
FILE: LICENCE
================================================
This software may be used under the terms of (at your choice)
- LGPL version 2 (or later) (see LICENCE_LGPL2.1 for details)
- Apache Software licence (see LICENCE_APACHE for details)
- WTFPL (see LICENCE_WTFPL for details)
================================================
FILE: LICENCE_APACHE
================================================
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
================================================
FILE: LICENCE_LGPL2.1
================================================
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!
================================================
FILE: LICENCE_WTFPL
================================================
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2014 Rene Treffer <treffer+wtfpl@measite.de>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.
================================================
FILE: Makefile
================================================
GRADLE ?= ./gradlew
.PHONY: all
all: check codecov eclipse javadocAll inttest
.PHONY: codecov
codecov:
$(GRADLE) minidns-hla:testCodeCoverageReport
echo "Code coverage report available at $(PWD)/minidns-hla/build/reports/jacoco/testCodeCoverageReport/html/index.html"
.PHONY: check
check:
$(GRADLE) $@
.PHONY: eclipse
eclipse:
$(GRADLE) $@
.PHONY: inttest
inttest:
$(GRADLE) $@
.PHONY: javadocAll
javadocAll:
$(GRADLE) $@
echo "javadoc available at $(PWD)/build/javadoc/index.html"
================================================
FILE: README.md
================================================
MiniDNS - A DNSSEC enabled DNS library
======================================
[](https://github.com/MiniDNS/minidns/actions?query=workflow%3A%22CI%22) [](https://coveralls.io/r/MiniDNS/minidns)
MiniDNS ("**M**odular **I**nternet **N**ame **I**nformer for **DNS**") is a DNS library for Android and Java SE. It can parse resource records (A, AAAA, NS, SRV, …) and is easy to use and extend. MiniDNS aims to be secure, modular, efficient and as simple as possible. It also provides support for **DNSSEC** and **DANE**, and is thus the ideal resolver if you want to bring DNSSEC close to your application.
It comes with a pluggable cache mechanism, a pre-configured cache and an easy to use high-level API (`minidns-hla`) for those who just want to perform a reliable lookup of a domain name.
**Notice:** DNSSEC/DANE support has not yet undergo a security audit.
If you find the project useful and if you are able to provide the resources for a security audit, then please contact us.
If you are looking for a DNSSEC-enabled resolver in C (and/or Lua) then hava a look at the [Knot Resolver](https://www.knot-resolver.cz/). Also this library is not intended to be used as a DNS server. You might want to
look into [dnsjava](http://dnsjava.org/) for such functionality.
**MiniDNS release resources** (javadoc, …) an be found at https://minidns.org/releases
Quickstart
----------
The easiest way to use MiniDNS is by its high-level API provided by the minidns-hla Maven artifact. Simply add the artifact to your projects dependencies. For example with gradle
```groovy
compile "org.minidns:minidns-hla:$minidnsVersion"
```
Then you can use the `ResolverApi` or `DnssecResolverApi` class to perform DNS lookups and check if the result was authenticated via DNSSEC. The following example shows a lookup of A records of 'verteiltesysteme.net'.
```java
ResolverResult<A> result = DnssecResolverApi.INSTANCE.resolve("verteiltesysteme.net", A.class);
if (!result.wasSuccessful()) {
RESPONSE_CODE responseCode = result.getResponseCode();
// Perform error handling.
…
return;
}
if (!result.isAuthenticData()) {
// Response was not secured with DNSSEC.
…
return;
}
Set<A> answers = result.getAnswers();
for (A a : answers) {
InetAddress inetAddress = a.getInetAddress();
// Do someting with the InetAddress, e.g. connect to.
…
}
```
MiniDNS also provides full support for SRV resource records and their handling.
```java
SrvResolverResult result = DnssecResolverApi.INSTANCE.resolveSrv(SrvType.xmpp_client, "example.org")
if (!result.wasSuccessful()) {
RESPONSE_CODE responseCode = result.getResponseCode();
// Perform error handling.
…
return;
}
if (!result.isAuthenticData()) {
// Response was not secured with DNSSEC.
…
return;
}
List<ResolvedSrvRecord> srvRecords = result.getSortedSrvResolvedAddresses();
// Loop over the domain names pointed by the SRV RR. MiniDNS will return the list
// correctly sorted by the priority and weight of the related SRV RR.
for (ResolvedSrvRecord srvRecord : srvRecord) {
// Loop over the Internet Address RRs resolved for the SRV RR. The order of
// the list depends on the prefered IP version setting of MiniDNS.
for (InternetAddressRR inetAddressRR : srvRecord.addresses) {
InetAddress inetAddress = inetAddressRR.getInetAddress();
int port = srvAddresses.port;
// Try to connect to inetAddress at port.
…
}
}
```
REPL
----
MiniDNS comes with a REPL which can be used to perform DNS lookups and to test the library. Simple use `./repl` to start the REPL. The loaded REPL comes with some predefined variables that you can use to perform lookups. For example `c` is a simple DNS client. See `minidns-repl/scala.repl` for more.
```text
minidns $ ./repl
...
scala> c query ("measite.de", TYPE.A)
res0: dnsqueryresult.DnsQueryResult = DnsMessage@54653(QUERY NO_ERROR qr rd ra) { \
[Q: measite.de. IN A] \
[A: measite.de. 3599 IN A 85.10.226.249] \
[X: EDNS: version: 0, flags:; udp: 512]
}
```
================================================
FILE: build-logic/build.gradle
================================================
plugins {
id 'groovy-gradle-plugin'
}
repositories {
gradlePluginPortal()
}
dependencies {
implementation "biz.aQute.bnd:biz.aQute.bnd.gradle:7.0.0"
implementation "net.ltgt.gradle:gradle-errorprone-plugin:4.0.1"
implementation "ru.vyarus:gradle-animalsniffer-plugin:1.7.1"
}
================================================
FILE: build-logic/settings.gradle
================================================
rootProject.name = 'minidns-build-logic'
================================================
FILE: build-logic/src/main/groovy/org.minidns.android-boot-classpath-conventions.gradle
================================================
compileJava {
options.bootstrapClasspath = files(androidBootClasspath)
}
javadoc {
classpath += files(androidBootClasspath)
}
================================================
FILE: build-logic/src/main/groovy/org.minidns.android-conventions.gradle
================================================
plugins {
id 'ru.vyarus.animalsniffer'
id 'org.minidns.common-conventions'
}
dependencies {
signature "net.sf.androidscents.signature:android-api-level-${minAndroidSdk}:4.4.2_r4@signature"
}
animalsniffer {
sourceSets = [sourceSets.main]
}
================================================
FILE: build-logic/src/main/groovy/org.minidns.application-conventions.gradle
================================================
plugins {
id 'application'
}
application {
applicationDefaultJvmArgs = ["-enableassertions"]
}
run {
// Pass all system properties down to the "application" run
systemProperties System.getProperties()
}
================================================
FILE: build-logic/src/main/groovy/org.minidns.common-conventions.gradle
================================================
ext {
javaVersion = JavaVersion.VERSION_11
javaMajor = javaVersion.getMajorVersion()
minAndroidSdk = 19
androidBootClasspath = getAndroidRuntimeJar(minAndroidSdk)
// Export the function by turning it into a closure.
// https://stackoverflow.com/a/23290820/194894
getAndroidRuntimeJar = this.&getAndroidRuntimeJar
}
repositories {
mavenLocal()
mavenCentral()
}
def getAndroidRuntimeJar(androidApiLevel) {
def androidHome = getAndroidHome()
def androidJar = new File("$androidHome/platforms/android-${androidApiLevel}/android.jar")
if (androidJar.isFile()) {
return androidJar
} else {
throw new Exception("Can't find android.jar for API level ${androidApiLevel}. Please install corresponding SDK platform package")
}
}
def getAndroidHome() {
def androidHomeEnv = System.getenv("ANDROID_HOME")
if (androidHomeEnv == null) {
throw new Exception("ANDROID_HOME environment variable is not set")
}
def androidHome = new File(androidHomeEnv)
if (!androidHome.isDirectory()) throw new Exception("Environment variable ANDROID_HOME is not pointing to a directory")
return androidHome
}
================================================
FILE: build-logic/src/main/groovy/org.minidns.java-conventions.gradle
================================================
plugins {
id 'biz.aQute.bnd.builder'
id 'checkstyle'
id 'eclipse'
id 'idea'
id 'jacoco'
id 'java'
id 'java-library'
id 'java-test-fixtures'
id 'maven-publish'
id 'net.ltgt.errorprone'
id 'signing'
id 'jacoco-report-aggregation'
id 'test-report-aggregation'
id 'org.minidns.common-conventions'
id 'org.minidns.javadoc-conventions'
}
version readVersionFile()
ext {
isSnapshot = version.endsWith('-SNAPSHOT')
gitCommit = getGitCommit()
rootConfigDir = new File(rootDir, 'config')
sonatypeCredentialsAvailable = project.hasProperty('sonatypeUsername') && project.hasProperty('sonatypePassword')
isReleaseVersion = !isSnapshot
isContinuousIntegrationEnvironment = Boolean.parseBoolean(System.getenv('CI'))
signingRequired = !(isSnapshot || isContinuousIntegrationEnvironment)
sonatypeSnapshotUrl = 'https://oss.sonatype.org/content/repositories/snapshots'
sonatypeStagingUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2'
builtDate = (new java.text.SimpleDateFormat("yyyy-MM-dd")).format(new Date())
junitVersion = '5.9.2'
if (project.hasProperty("useSonatype")) {
useSonatype = project.getProperty("useSonatype").toBoolean()
} else {
// Default to true
useSonatype = true
}
}
group = 'org.minidns'
java {
sourceCompatibility = javaVersion
targetCompatibility = sourceCompatibility
}
eclipse {
classpath {
downloadJavadoc = true
}
}
// Make all project's 'test' target depend on javadoc, so that
// javadoc is also linted.
test.dependsOn javadoc
tasks.withType(JavaCompile) {
// Some systems may not have set their platform default
// converter to 'utf8', but we use unicode in our source
// files. Therefore ensure that javac uses unicode
options.encoding = "utf8"
options.compilerArgs = [
'-Xlint:all',
// Set '-options' because a non-java7 javac will emit a
// warning if source/target is set to 1.7 and
// bootclasspath is *not* set.
'-Xlint:-options',
// TODO: Enable xlint serial
'-Xlint:-serial',
'-Werror',
]
options.release = Integer.valueOf(javaMajor)
}
jacoco {
toolVersion = "0.8.12"
}
jacocoTestReport {
dependsOn test
reports {
xml.required = true
}
}
dependencies {
testImplementation "org.junit.jupiter:junit-jupiter-api:$junitVersion"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junitVersion"
testFixturesApi "org.junit.jupiter:junit-jupiter-api:$junitVersion"
testImplementation "org.junit.jupiter:junit-jupiter-params:$junitVersion"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junitVersion"
// https://stackoverflow.com/a/77274251/194894
testRuntimeOnly "org.junit.platform:junit-platform-launcher:1.11.0"
errorprone 'com.google.errorprone:error_prone_core:2.32.0'
}
test {
useJUnitPlatform()
maxParallelForks = Runtime.runtime.availableProcessors().intdiv(2) ?: 1
// Enable full stacktraces of failed tests. Especially handy
// for CI environments.
testLogging {
events "failed"
exceptionFormat "full"
}
}
jar {
manifest {
attributes(
'Implementation-Version': version,
'Implementation-GitRevision': gitCommit,
'Built-JDK': System.getProperty('java.version'),
'Built-Gradle': gradle.gradleVersion,
'Built-By': System.getProperty('user.name')
)
}
bundle {
bnd(
'-removeheaders': 'Tool, Bnd-*',
'-exportcontents': 'org.minidns.*',
'Import-Package': '!android,*'
)
}
}
checkstyle {
toolVersion = '10.18.2'
configProperties.checkstyleLicenseHeader = "header"
}
task sourcesJar(type: Jar, dependsOn: classes) {
archiveClassifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier = 'javadoc'
from javadoc.destinationDir
}
task testsJar(type: Jar) {
archiveClassifier = 'tests'
from sourceSets.test.output
}
configurations {
testRuntime
}
artifacts {
// Add a 'testRuntime' configuration including the tests so that
// it can be consumed by other projects. See
// http://stackoverflow.com/a/21946676/194894
testRuntime testsJar
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
artifact testsJar
pom {
name = 'MiniDNS'
packaging = 'jar'
inceptionYear = '2014'
url = 'https://github.com/minidns/minidns'
afterEvaluate {
description = project.description
}
scm {
url = 'https://github.com/minidns/minidns'
connection = 'scm:https://github.com/minidns/minidns'
developerConnection = 'scm:git://github.com/minidns/minidns.git'
}
licenses {
license {
name = 'The Apache Software License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution = 'repo'
}
}
developers {
developer {
id = 'rtreffer'
name = 'Rene Treffer'
email = 'treffer@measite.de'
}
developer {
id = 'flow'
name = 'Florian Schmaus'
email = 'flow@geekplace.eu'
}
}
}
}
}
repositories {
if (sonatypeCredentialsAvailable && useSonatype) {
maven {
url isSnapshot ? sonatypeSnapshotUrl : sonatypeStagingUrl
credentials {
username = sonatypeUsername
password = sonatypePassword
}
}
}
// Use
// gradle publish -P customRepoUrl=https://www.igniterealtime.org/archiva/repository/maven -P customRepoUsername=bamboo -P customRepoPassword=hidden -P useSonatype=false
// to deploy to this repo.
if (project.hasProperty("customRepoUrl")) {
maven {
name 'customRepo'
url customRepoUrl
if (project.hasProperty("customRepoUsername")) {
credentials {
username customRepoUsername
password customRepoPassword
}
}
}
}
}
}
// Workaround for gpg signatory not supporting the 'required' option
// See https://github.com/gradle/gradle/issues/5064#issuecomment-381924984
// Note what we use 'signing.gnupg.keyName' instead of 'signing.keyId'.
tasks.withType(Sign) {
onlyIf {
project.hasProperty('signing.gnupg.keyName')
}
}
signing {
required { signingRequired }
useGpgCmd()
sign publishing.publications.mavenJava
}
tasks.withType(JavaCompile) {
options.errorprone {
disableWarningsInGeneratedCode = true
excludedPaths = ".*/jmh_generated/.*"
error(
"UnusedVariable",
"UnusedMethod",
"MethodCanBeStatic",
)
errorproneArgs = [
// Disable MissingCasesInEnumSwitch error prone check
// because this check is already done by javac as incomplete-switch.
'-Xep:MissingCasesInEnumSwitch:OFF',
'-Xep:StringSplitter:OFF',
'-Xep:JavaTimeDefaultTimeZone:OFF',
'-Xep:InlineMeSuggester:OFF',
]
}
}
// Work around https://github.com/gradle/gradle/issues/4046
task copyJavadocDocFiles(type: Copy) {
from('src/javadoc')
into 'build/docs/javadoc'
include '**/doc-files/*.*'
}
javadoc.dependsOn copyJavadocDocFiles
def getGitCommit() {
def projectDirFile = new File("$projectDir")
def cmd = 'git describe --always --tags --dirty=+'
def proc = cmd.execute(null, projectDirFile)
def exitStatus = proc.waitFor()
if (exitStatus != 0) return "non-git build"
def gitCommit = proc.text.trim()
assert !gitCommit.isEmpty()
gitCommit
}
def readVersionFile() {
def versionFile = new File(rootDir, 'version')
if (!versionFile.isFile()) {
throw new Exception("Could not find version file")
}
if (versionFile.text.isEmpty()) {
throw new Exception("Version file does not contain a version")
}
versionFile.text.trim()
}
================================================
FILE: build-logic/src/main/groovy/org.minidns.javadoc-conventions.gradle
================================================
plugins {
// Javadoc linking requires repositories to bet configured. And
// those are declared in common-conventions, hence we add it here.
id 'org.minidns.common-conventions'
}
tasks.withType(Javadoc) {
// The '-quiet' as second argument is actually a hack,
// since the one parameter addStringOption doesn't seem to
// work, we extra add '-quiet', which is added anyway by
// gradle.
// We disable 'missing' as we do most of javadoc checking via checkstyle.
options.addStringOption('Xdoclint:all,-missing', '-quiet')
// Abort on javadoc warnings.
// See JDK-8200363 (https://bugs.openjdk.java.net/browse/JDK-8200363)
// for information about the -Xwerror option.
options.addStringOption('Xwerror', '-quiet')
options.addStringOption('-release', javaMajor)
}
tasks.withType(Javadoc) {
options.charSet = "UTF-8"
}
================================================
FILE: build.gradle
================================================
plugins {
// The scalastyle plugin of smack-repl wants the root project to
// have a ideaProject task, so let's add one.
id 'idea'
id 'org.minidns.javadoc-conventions'
}
ext {
javadocAllDir = new File(buildDir, 'javadoc')
nonJavadocAllProjects = [
':minidns-integration-test',
':minidns-repl',
].collect{ project(it) }
javadocAllProjects = subprojects - nonJavadocAllProjects
}
evaluationDependsOnChildren()
task javadocAll(type: Javadoc) {
source javadocAllProjects.collect {project ->
project.sourceSets.main.allJava.findAll {
// Filter out symbolic links to avoid
// "warning: a package-info.java file has already been seen for package"
// javadoc warnings.
!java.nio.file.Files.isSymbolicLink(it.toPath())
}
}
destinationDir = javadocAllDir
// Might need a classpath
classpath = files(subprojects.collect {project ->
project.sourceSets.main.compileClasspath})
classpath += files(androidBootClasspath)
options {
linkSource = true
use = true
links = [
"https://docs.oracle.com/en/java/javase/${javaMajor}/docs/api/",
] as String[]
overview = "$projectDir/resources/javadoc-overview.html"
}
// Finally copy the javadoc doc-files from the subprojects, which
// are potentially generated, to the javadocAll directory. Note
// that we use a copy *method* and not a *task* because the inputs
// of copy tasks is determined within the configuration phase. And
// since some of the inputs are generated, they will not get
// picked up if we used a copy method. See also
// https://stackoverflow.com/a/40518516/194894
doLast {
copy {
javadocAllProjects.each {
from ("${it.projectDir}/src/javadoc") {
include '**/doc-files/*.*'
}
}
into javadocAllDir
}
}
}
task inttest {
description 'Verify correct functionality by running some integration tests.'
dependsOn project(':minidns-integration-test').tasks.run
}
================================================
FILE: config/checkstyle/checkstyle.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<module name="Checker">
<module name="SuppressionFilter">
<property name="file" value="${config_loc}/suppressions.xml"/>
</module>
<module name="Header">
<property name="headerFile" value="${config_loc}/header.txt"/>
<property name="ignoreLines" value="3"/>
<property name="fileExtensions" value="java"/>
</module>
<module name="NewlineAtEndOfFile">
<property name="lineSeparator" value="lf"/>
</module>
<module name="RegexpSingleline">
<property name="format" value="MXParser"/>
<property name="message" value="Must not use MXParser, use XmlPullParserFactory instead"/>
</module>
<module name="RegexpSingleline">
<property name="format" value="^\s+$"/>
<property name="message" value="Line containing only whitespace character(s)"/>
</module>
<module name="RegexpSingleline">
<property name="format" value="^ +\t+"/>
<property name="message" value="Line containing tab(s) after space"/>
</module>
<module name="RegexpSingleline">
<!-- We use {2,} instead of + here to address the typical case where a file was written
with tabs but javadoc is causing '\t *' -->
<property name="format" value="^\t+ {2,}"/>
<property name="message" value="Line containing space(s) after tab(s)"/>
</module>
<module name="RegexpSingleline">
<!--
Explaining the following Regex
^ \s* [\S && [^ \*/]]+ \s+ $
| | | | | +- End of Line (6)
| | | | +- At least one whitespace (5)
| | | +- At least one or more of the previous character class (4)
| | +- All non-whitespace characters except '*' and '/' (to exclude javadoc) (3)
| +- Zero or more space characters (2)
+- Start of Line (1)
Rationale:
Matches trailing whitespace (5) in lines containing at least one (4) non-whitespace character
that is not one of the characters used by javadoc (3).
-->
<property name="format" value="^\s*[\S&&[^\*/]]+\s+$"/>
<property name="message" value="Line containing trailing whitespace character(s)"/>
</module>
<module name="RegexpSingleline">
<property name="format" value="^\s*//[^\s]"/>
<property name="message" value="Comment start ('//') followed by non-space character. You would not continue after a punctuation without a space, would you?"/>
</module>
<!-- <module name="JavadocPackage"/> -->
<module name="TreeWalker">
<module name="SuppressionCommentFilter"/>
<module name="FinalClass"/>
<module name="UnusedImports">
<property name="processJavadoc" value="true"/>
</module>
<module name="AvoidStarImport"/>
<module name="IllegalImport"/>
<module name="RedundantImport"/>
<module name="RedundantModifier"/>
<module name="ModifierOrder"/>
<module name="UpperEll"/>
<module name="ArrayTypeStyle"/>
<module name="GenericWhitespace"/>
<module name="EmptyStatement"/>
<module name="PackageDeclaration"/>
<module name="LeftCurly"/>
<module name="RegexpSinglelineJava">
<property name="format" value="printStackTrace"/>
<property name="message" value="Usage of printStackTrace"/>
<property name="ignoreComments" value="true"/>
</module>
<module name="RegexpSinglelineJava">
<property name="format" value="println"/>
<property name="message" value="Usage of println"/>
<property name="ignoreComments" value="true"/>
</module>
<module name="JavadocMethod">
<!-- TODO stricten those checks -->
</module>
<module name="JavadocStyle">
<property name="scope" value="public"/>
<property name="checkEmptyJavadoc" value="true"/>
<property name="checkHtml" value="false"/>
</module>
<module name="ParenPad">
</module>
<module name="NoWhitespaceAfter">
<property name="tokens" value="INC
, DEC
, UNARY_MINUS
, UNARY_PLUS
, BNOT, LNOT
, DOT
, ARRAY_DECLARATOR
, INDEX_OP
"/>
</module>
<module name="WhitespaceAfter">
<property name="tokens" value="TYPECAST
, LITERAL_IF
, LITERAL_ELSE
, LITERAL_WHILE
, LITERAL_DO
, LITERAL_FOR
, DO_WHILE
, COMMA
"/>
</module>
<module name="WhitespaceAround">
<property
name="ignoreEnhancedForColon"
value="false"
/>
<!-- Currently disabled tokens: LCURLY, RCURLY, WILDCARD_TYPE, GENERIC_START, GENERIC_END -->
<property
name="tokens"
value="ASSIGN
, ARRAY_INIT
, BAND
, BAND_ASSIGN
, BOR
, BOR_ASSIGN
, BSR
, BSR_ASSIGN
, BXOR
, BXOR_ASSIGN
, COLON
, DIV
, DIV_ASSIGN
, DO_WHILE
, EQUAL
, GE
, GT
, LAMBDA
, LAND
, LE
, LITERAL_CATCH
, LITERAL_DO
, LITERAL_ELSE
, LITERAL_FINALLY
, LITERAL_FOR
, LITERAL_IF
, LITERAL_RETURN
, LITERAL_SWITCH
, LITERAL_SYNCHRONIZED
, LITERAL_TRY
, LITERAL_WHILE
, LOR
, LT
, MINUS
, MINUS_ASSIGN
, MOD
, MOD_ASSIGN
, NOT_EQUAL
, PLUS
, PLUS_ASSIGN
, QUESTION
, SL
, SLIST
, SL_ASSIGN
, SR
, SR_ASSIGN
, STAR
, STAR_ASSIGN
, LITERAL_ASSERT
, TYPE_EXTENSION_AND
"/>
</module>
<!-- TODO: Enable this check
<module name="CustomImportOrder">
<property name="customImportOrderRules"
value="STATIC###STANDARD_JAVA_PACKAGE###SPECIAL_IMPORTS###THIRD_PARTY_PACKAGE"/>
<property name="specialImportsRegExp" value="^org\.minidns"/>
<property name="sortImportsInGroupAlphabetically" value="true"/>
<property name="separateLineBetweenGroups" value="true"/>
</module>
-->
<module name="MissingJavadocPackage"/>
<module name="UnnecessaryParentheses"/>
<module name="UnnecessarySemicolonInEnumeration"/>
<module name="UnnecessarySemicolonInTryWithResources"/>
</module>
</module>
================================================
FILE: config/checkstyle/header.txt
================================================
/*
* Copyright 2015-2024 the original author or authors
*
* This software is licensed under the Apache License, Version 2.0,
* the GNU Lesser General Public License version 2 or later ("LGPL")
* and the WTFPL.
* You may choose either license to govern your use of this software only
* upon the condition that you accept all of the terms of either
* the Apache License 2.0, the LGPL 2.1+ or the WTFPL.
*/
================================================
FILE: config/checkstyle/suppressions.xml
================================================
<?xml version="1.0"?>
<!DOCTYPE suppressions PUBLIC
"-//Puppy Crawl//DTD Suppressions 1.1//EN"
"http://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
<suppressions>
<!-- Suppress JavadocPackage in the test packages -->
<suppress checks="JavadocPackage" files="[\\/]test[\\/]"/>
</suppressions>
================================================
FILE: config/scalaStyle.xml
================================================
<scalastyle commentFilter="enabled">
<name>Scalastyle standard configuration</name>
<check level="error" class="org.scalastyle.file.FileTabChecker" enabled="true"></check>
<check level="error" class="org.scalastyle.file.FileLengthChecker" enabled="true">
<parameters>
<parameter name="maxFileLength"><![CDATA[800]]></parameter>
</parameters>
</check>
<check level="error" class="org.scalastyle.file.HeaderMatchesChecker" enabled="true">
<parameters>
<parameter name="regex">true</parameter>
<parameter name="header"><![CDATA[/\*\*
\*
\* Copyright 2.*
\*
\* Licensed under the Apache License, Version 2\.0 \(the "License"\);
\* you may not use this file except in compliance with the License.
\* You may obtain a copy of the License at
\*
\* http://www.apache.org/licenses/LICENSE-2\.0
\*
\* Unless required by applicable law or agreed to in writing, software
\* distributed under the License is distributed on an "AS IS" BASIS,
\* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\* See the License for the specific language governing permissions and
\* limitations under the License.
\*/]]></parameter>
</parameters>
</check>
<check level="error" class="org.scalastyle.scalariform.SpacesAfterPlusChecker" enabled="true"></check>
<check level="error" class="org.scalastyle.file.WhitespaceEndOfLineChecker" enabled="true"></check>
<check level="error" class="org.scalastyle.scalariform.SpacesBeforePlusChecker" enabled="true"></check>
<check level="error" class="org.scalastyle.file.FileLineLengthChecker" enabled="true">
<parameters>
<parameter name="maxLineLength"><![CDATA[160]]></parameter>
<parameter name="tabSize"><![CDATA[4]]></parameter>
</parameters>
</check>
<check level="error" class="org.scalastyle.scalariform.ClassNamesChecker" enabled="true">
<parameters>
<parameter name="regex"><![CDATA[[A-Z][A-Za-z]*]]></parameter>
</parameters>
</check>
<check level="error" class="org.scalastyle.scalariform.ObjectNamesChecker" enabled="true">
<parameters>
<parameter name="regex"><![CDATA[[A-Z][A-Za-z]*]]></parameter>
</parameters>
</check>
<check level="error" class="org.scalastyle.scalariform.PackageObjectNamesChecker" enabled="true">
<parameters>
<parameter name="regex"><![CDATA[^[a-z][A-Za-z]*$]]></parameter>
</parameters>
</check>
<check level="error" class="org.scalastyle.scalariform.EqualsHashCodeChecker" enabled="true"></check>
<check level="error" class="org.scalastyle.scalariform.IllegalImportsChecker" enabled="true">
<parameters>
<parameter name="illegalImports"><![CDATA[sun._,java.awt._]]></parameter>
</parameters>
</check>
<check level="error" class="org.scalastyle.scalariform.ParameterNumberChecker" enabled="true">
<parameters>
<parameter name="maxParameters"><![CDATA[8]]></parameter>
</parameters>
</check>
<check level="error" class="org.scalastyle.scalariform.MagicNumberChecker" enabled="true">
<parameters>
<parameter name="ignore"><![CDATA[-1,0,1,2,3]]></parameter>
</parameters>
</check>
<check level="error" class="org.scalastyle.scalariform.NoWhitespaceBeforeLeftBracketChecker" enabled="true"></check>
<check level="error" class="org.scalastyle.scalariform.NoWhitespaceAfterLeftBracketChecker" enabled="true"></check>
<check level="error" class="org.scalastyle.scalariform.ReturnChecker" enabled="true"></check>
<check level="error" class="org.scalastyle.scalariform.NullChecker" enabled="true"></check>
<check level="error" class="org.scalastyle.scalariform.NoCloneChecker" enabled="true"></check>
<check level="error" class="org.scalastyle.scalariform.NoFinalizeChecker" enabled="true"></check>
<check level="error" class="org.scalastyle.scalariform.CovariantEqualsChecker" enabled="true"></check>
<check level="error" class="org.scalastyle.scalariform.StructuralTypeChecker" enabled="true"></check>
<check level="error" class="org.scalastyle.file.RegexChecker" enabled="true">
<parameters>
<parameter name="regex"><![CDATA[println]]></parameter>
</parameters>
</check>
<check level="error" class="org.scalastyle.scalariform.NumberOfTypesChecker" enabled="true">
<parameters>
<parameter name="maxTypes"><![CDATA[30]]></parameter>
</parameters>
</check>
<check level="error" class="org.scalastyle.scalariform.CyclomaticComplexityChecker" enabled="true">
<parameters>
<parameter name="maximum"><![CDATA[10]]></parameter>
</parameters>
</check>
<check level="error" class="org.scalastyle.scalariform.UppercaseLChecker" enabled="true"></check>
<check level="error" class="org.scalastyle.scalariform.SimplifyBooleanExpressionChecker" enabled="true"></check>
<check level="error" class="org.scalastyle.scalariform.IfBraceChecker" enabled="true">
<parameters>
<parameter name="singleLineAllowed"><![CDATA[true]]></parameter>
<parameter name="doubleLineAllowed"><![CDATA[false]]></parameter>
</parameters>
</check>
<check level="error" class="org.scalastyle.scalariform.MethodLengthChecker" enabled="true">
<parameters>
<parameter name="maxLength"><![CDATA[50]]></parameter>
</parameters>
</check>
<check level="error" class="org.scalastyle.scalariform.MethodNamesChecker" enabled="true">
<parameters>
<parameter name="regex"><![CDATA[^[a-z][A-Za-z0-9]*$]]></parameter>
</parameters>
</check>
<check level="error" class="org.scalastyle.scalariform.NumberOfMethodsInTypeChecker" enabled="true">
<parameters>
<parameter name="maxMethods"><![CDATA[30]]></parameter>
</parameters>
</check>
<check level="error" class="org.scalastyle.scalariform.PublicMethodsHaveTypeChecker" enabled="true"></check>
<check level="error" class="org.scalastyle.file.NewLineAtEofChecker" enabled="true"></check>
<check level="error" class="org.scalastyle.file.NoNewLineAtEofChecker" enabled="false"></check>
<check level="error" class="org.scalastyle.scalariform.WhileChecker" enabled="false"></check>
<check level="error" class="org.scalastyle.scalariform.VarFieldChecker" enabled="false"></check>
<check level="error" class="org.scalastyle.scalariform.VarLocalChecker" enabled="false"></check>
<check level="error" class="org.scalastyle.scalariform.RedundantIfChecker" enabled="false"></check>
<check level="error" class="org.scalastyle.scalariform.TokenChecker" enabled="false">
<parameters>
<parameter name="regex"><![CDATA[println]]></parameter>
</parameters>
</check>
<check level="error" class="org.scalastyle.scalariform.DeprecatedJavaChecker" enabled="true"></check>
<check level="error" class="org.scalastyle.scalariform.EmptyClassChecker" enabled="true"></check>
<check level="error" class="org.scalastyle.scalariform.ClassTypeParameterChecker" enabled="true">
<parameters>
<parameter name="regex"><![CDATA[^[A-Z_]$]]></parameter>
</parameters>
</check>
<check level="error" class="org.scalastyle.scalariform.UnderscoreImportChecker" enabled="true"></check>
<check level="error" class="org.scalastyle.scalariform.LowercasePatternMatchChecker" enabled="true"></check>
<check level="error" class="org.scalastyle.scalariform.MultipleStringLiteralsChecker" enabled="true">
<parameters>
<parameter name="allowed"><![CDATA[2]]></parameter>
<parameter name="ignoreRegex"><![CDATA[^""$]]></parameter>
</parameters>
</check>
<check level="error" class="org.scalastyle.scalariform.ImportGroupingChecker" enabled="true"></check>
</scalastyle>
================================================
FILE: gradle/wrapper/gradle-wrapper.properties
================================================
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
================================================
FILE: gradle.properties.example
================================================
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# GPG settings
#
# gpg key id
#signing.keyId=DEADBEEF
# the gpg key passphrase
#signing.password=correcthorsebatterystaple
# gpg keyring (this is the default gnupg keyring containing private keys)
#signing.secretKeyRingFile=/home/ubuntu/.gnupg/secring.gpg
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# nexus settings
#
# the nexus username used for log in
#nexusUsername=ubuntu
# the nexus password
#nexusPassword=correcthorsebatterystaple
================================================
FILE: gradlew
================================================
#!/bin/sh
#
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#
##############################################################################
#
# Gradle start up script for POSIX generated by Gradle.
#
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
app_path=$0
# Need this for daisy-chained symlinks.
while
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
[ -h "$app_path" ]
do
ls=$( ls -ld "$app_path" )
link=${ls#*' -> '}
case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
warn () {
echo "$*"
} >&2
die () {
echo
echo "$*"
echo
exit 1
} >&2
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "$( uname )" in #(
CYGWIN* ) cygwin=true ;; #(
Darwin* ) darwin=true ;; #(
MSYS* | MINGW* ) msys=true ;; #(
NONSTOP* ) nonstop=true ;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD=$JAVA_HOME/jre/sh/java
else
JAVACMD=$JAVA_HOME/bin/java
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD=java
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi
# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
fi
# Collect all arguments for the java command, stacking in reverse order:
# * args from the command line
# * the main class name
# * -classpath
# * -D...appname settings
# * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" )
# Now convert the arguments - kludge to limit ourselves to /bin/sh
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
fi
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
done
fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
"$@"
# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@"
================================================
FILE: gradlew.bat
================================================
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
if %ERRORLEVEL% equ 0 goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
================================================
FILE: minidns-android23/build.gradle
================================================
plugins {
id 'org.minidns.java-conventions'
id 'org.minidns.android-conventions'
}
ext {
myAndroidSdkApi = 23
androidBootClasspath = getAndroidRuntimeJar(myAndroidSdkApi)
}
description = "MiniDNS code that requires an Android SDK API of ${myAndroidSdkApi} or higher"
dependencies {
api project(':minidns-client')
testImplementation project(path: ":minidns-client", configuration: "testRuntime")
// Add the Android jar to the Eclipse .classpath.
implementation files(androidBootClasspath)
// For AnimalSniffer
signature "net.sf.androidscents.signature:android-api-level-${myAndroidSdkApi}:6.0_r3@signature"
}
================================================
FILE: minidns-android23/src/main/java/org/minidns/dnsserverlookup/android21/AndroidUsingLinkProperties.java
================================================
/*
* Copyright 2015-2024 the original author or authors
*
* This software is licensed under the Apache License, Version 2.0,
* the GNU Lesser General Public License version 2 or later ("LGPL")
* and the WTFPL.
* You may choose either license to govern your use of this software only
* upon the condition that you accept all of the terms of either
* the Apache License 2.0, the LGPL 2.1+ or the WTFPL.
*/
package org.minidns.dnsserverlookup.android21;
import android.annotation.TargetApi;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.LinkProperties;
import android.net.Network;
import android.net.RouteInfo;
import android.os.Build;
import java.net.InetAddress;
import java.util.ArrayList;
import java.util.List;
import org.minidns.DnsClient;
import org.minidns.dnsserverlookup.AbstractDnsServerLookupMechanism;
import org.minidns.dnsserverlookup.AndroidUsingExec;
/**
* A DNS server lookup mechanism using Android's Link Properties method available on Android API 21 or higher. Use
* {@link #setup(Context)} to setup this mechanism.
* <p>
* Requires the ACCESS_NETWORK_STATE permission.
* </p>
*/
public class AndroidUsingLinkProperties extends AbstractDnsServerLookupMechanism {
private final ConnectivityManager connectivityManager;
/**
* Setup this DNS server lookup mechanism. You need to invoke this method only once, ideally before you do your
* first DNS lookup.
*
* @param context a Context instance.
* @return the instance of the newly setup mechanism
*/
public static AndroidUsingLinkProperties setup(Context context) {
AndroidUsingLinkProperties androidUsingLinkProperties = new AndroidUsingLinkProperties(context);
DnsClient.addDnsServerLookupMechanism(androidUsingLinkProperties);
return androidUsingLinkProperties;
}
/**
* Construct this DNS server lookup mechanism.
*
* @param context an Android context.
*/
public AndroidUsingLinkProperties(Context context) {
super(AndroidUsingLinkProperties.class.getSimpleName(), AndroidUsingExec.PRIORITY - 1);
connectivityManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
}
@Override
public boolean isAvailable() {
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP;
}
@TargetApi(Build.VERSION_CODES.M)
private List<String> getDnsServerAddressesOfActiveNetwork() {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
return null;
}
// ConnectivityManager.getActiveNetwork() is API 23.
Network activeNetwork = connectivityManager.getActiveNetwork();
if (activeNetwork == null) {
return null;
}
LinkProperties linkProperties = connectivityManager.getLinkProperties(activeNetwork);
if (linkProperties == null) {
return null;
}
List<InetAddress> dnsServers = linkProperties.getDnsServers();
return toListOfStrings(dnsServers);
}
@Override
@TargetApi(21)
public List<String> getDnsServerAddresses() {
// First, try the API 23 approach using ConnectivityManager.getActiveNetwork().
List<String> servers = getDnsServerAddressesOfActiveNetwork();
if (servers != null) {
return servers;
}
Network[] networks = connectivityManager.getAllNetworks();
if (networks == null) {
return null;
}
servers = new ArrayList<>(networks.length * 2);
for (Network network : networks) {
LinkProperties linkProperties = connectivityManager.getLinkProperties(network);
if (linkProperties == null) {
continue;
}
// Prioritize the DNS servers of links which have a default route
if (hasDefaultRoute(linkProperties)) {
servers.addAll(0, toListOfStrings(linkProperties.getDnsServers()));
} else {
servers.addAll(toListOfStrings(linkProperties.getDnsServers()));
}
}
if (servers.isEmpty()) {
return null;
}
return servers;
}
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private static boolean hasDefaultRoute(LinkProperties linkProperties) {
for (RouteInfo route : linkProperties.getRoutes()) {
if (route.isDefaultRoute()) {
return true;
}
}
return false;
}
}
================================================
FILE: minidns-android23/src/test/java/org/minidns/dnsserverlookup/android21/AndroidUsingLinkPropertiesTest.java
================================================
/*
* Copyright 2015-2024 the original author or authors
*
* This software is licensed under the Apache License, Version 2.0,
* the GNU Lesser General Public License version 2 or later ("LGPL")
* and the WTFPL.
* You may choose either license to govern your use of this software only
* upon the condition that you accept all of the terms of either
* the Apache License 2.0, the LGPL 2.1+ or the WTFPL.
*/
package org.minidns.dnsserverlookup.android21;
import org.junit.jupiter.api.Test;
public class AndroidUsingLinkPropertiesTest {
/**
* Dummy test to make jacocoRootReport happy.
*/
@Test
public void nopTest() {
}
}
================================================
FILE: minidns-async/build.gradle
================================================
plugins {
id 'org.minidns.java-conventions'
id 'org.minidns.android-conventions'
}
description = "Asynchronous DNS lookups using Java NIO"
dependencies {
api project(':minidns-client')
testImplementation project(path: ":minidns-client", configuration: "testRuntime")
}
================================================
FILE: minidns-async/src/main/java/org/minidns/source/async/AsyncDnsRequest.java
================================================
/*
* Copyright 2015-2024 the original author or authors
*
* This software is licensed under the Apache License, Version 2.0,
* the GNU Lesser General Public License version 2 or later ("LGPL")
* and the WTFPL.
* You may choose either license to govern your use of this software only
* upon the condition that you accept all of the terms of either
* the Apache License 2.0, the LGPL 2.1+ or the WTFPL.
*/
package org.minidns.source.async;
import java.io.IOException;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.nio.ByteBuffer;
import java.nio.channels.Channel;
import java.nio.channels.ClosedChannelException;
import java.nio.channels.DatagramChannel;
import java.nio.channels.SelectableChannel;
import java.nio.channels.SelectionKey;
import java.nio.channels.SocketChannel;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Future;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.minidns.MiniDnsException;
import org.minidns.MiniDnsFuture;
import org.minidns.MiniDnsFuture.InternalMiniDnsFuture;
import org.minidns.dnsmessage.DnsMessage;
import org.minidns.dnsqueryresult.DnsQueryResult;
import org.minidns.dnsqueryresult.DnsQueryResult.QueryMethod;
import org.minidns.dnsqueryresult.StandardDnsQueryResult;
import org.minidns.source.DnsDataSource.OnResponseCallback;
import org.minidns.source.AbstractDnsDataSource.QueryMode;
import org.minidns.util.MultipleIoException;
/**
* A DNS request that is performed asynchronously.
*/
public class AsyncDnsRequest {
private static final Logger LOGGER = Logger.getLogger(AsyncDnsRequest.class.getName());
private final InternalMiniDnsFuture<DnsQueryResult, IOException> future = new InternalMiniDnsFuture<DnsQueryResult, IOException>() {
@SuppressWarnings("UnsynchronizedOverridesSynchronized")
@Override
public boolean cancel(boolean mayInterruptIfRunning) {
boolean res = super.cancel(mayInterruptIfRunning);
cancelAsyncDnsRequest();
return res;
}
};
private final DnsMessage request;
private final int udpPayloadSize;
private final InetSocketAddress socketAddress;
private final AsyncNetworkDataSource asyncNds;
private final OnResponseCallback onResponseCallback;
private final boolean skipUdp;
private ByteBuffer writeBuffer;
private List<IOException> exceptions;
private SelectionKey selectionKey;
final long deadline;
/**
* Creates a new AsyncDnsRequest instance.
*
* @param request the DNS message of the request.
* @param inetAddress The IP address of the DNS server to ask.
* @param port The port of the DNS server to ask.
* @param udpPayloadSize The configured UDP payload size.
* @param asyncNds A reference to the {@link AsyncNetworkDataSource} instance manageing the requests.
* @param onResponseCallback the optional callback when a response was received.
*/
AsyncDnsRequest(DnsMessage request, InetAddress inetAddress, int port, int udpPayloadSize, AsyncNetworkDataSource asyncNds, OnResponseCallback onResponseCallback) {
this.request = request;
this.udpPayloadSize = udpPayloadSize;
this.asyncNds = asyncNds;
this.onResponseCallback = onResponseCallback;
final QueryMode queryMode = asyncNds.getQueryMode();
switch (queryMode) {
case dontCare:
case udpTcp:
skipUdp = false;
break;
case tcp:
skipUdp = true;
break;
default:
throw new IllegalStateException("Unsupported query mode: " + queryMode);
}
deadline = System.currentTimeMillis() + asyncNds.getTimeout();
socketAddress = new InetSocketAddress(inetAddress, port);
}
private void ensureWriteBufferIsInitialized() {
if (writeBuffer != null) {
if (!writeBuffer.hasRemaining()) {
((java.nio.Buffer) writeBuffer).rewind();
}
return;
}
writeBuffer = request.getInByteBuffer();
}
private synchronized void cancelAsyncDnsRequest() {
if (selectionKey != null) {
selectionKey.cancel();
}
asyncNds.cancelled(this);
}
private synchronized void registerWithSelector(SelectableChannel channel, int ops, ChannelSelectedHandler handler)
throws ClosedChannelException {
if (future.isCancelled()) {
return;
}
selectionKey = asyncNds.registerWithSelector(channel, ops, handler);
}
private void addException(IOException e) {
if (exceptions == null) {
exceptions = new ArrayList<>(4);
}
exceptions.add(e);
}
private void gotResult(DnsQueryResult result) {
if (onResponseCallback != null) {
onResponseCallback.onResponse(request, result);
}
asyncNds.finished(this);
future.setResult(result);
}
MiniDnsFuture<DnsQueryResult, IOException> getFuture() {
return future;
}
boolean wasDeadlineMissedAndFutureNotified() {
if (System.currentTimeMillis() < deadline) {
return false;
}
future.setException(new IOException("Timeout"));
return true;
}
void startHandling() {
if (!skipUdp) {
startUdpRequest();
} else {
startTcpRequest();
}
}
private void abortRequestAndCleanup(Channel channel, String errorMessage, IOException exception) {
if (exception == null) {
// TODO: Can this case be removed? Is 'exception' ever null?
LOGGER.info("Exception was null in abortRequestAndCleanup()");
exception = new IOException(errorMessage);
}
LOGGER.log(Level.SEVERE, "Error connecting " + channel + ": " + errorMessage, exception);
addException(exception);
if (selectionKey != null) {
selectionKey.cancel();
}
if (channel != null && channel.isOpen()) {
try {
channel.close();
} catch (IOException e) {
LOGGER.log(Level.SEVERE, "Exception closing socket channel", e);
addException(e);
}
}
}
private void abortUdpRequestAndCleanup(DatagramChannel datagramChannel, String errorMessage, IOException exception) {
abortRequestAndCleanup(datagramChannel, errorMessage, exception);
startTcpRequest();
}
private void startUdpRequest() {
if (future.isCancelled()) {
return;
}
DatagramChannel datagramChannel;
try {
datagramChannel = DatagramChannel.open();
} catch (IOException e) {
LOGGER.log(Level.SEVERE, "Exception opening datagram channel", e);
addException(e);
startTcpRequest();
return;
}
try {
datagramChannel.configureBlocking(false);
} catch (IOException e) {
abortUdpRequestAndCleanup(datagramChannel, "Exception configuring datagram channel", e);
return;
}
try {
datagramChannel.connect(socketAddress);
} catch (IOException e) {
abortUdpRequestAndCleanup(datagramChannel, "Exception connecting datagram channel to " + socketAddress, e);
return;
}
try {
registerWithSelector(datagramChannel, SelectionKey.OP_WRITE, new UdpWritableChannelSelectedHandler(future));
} catch (ClosedChannelException e) {
abortUdpRequestAndCleanup(datagramChannel, "Exception registering datagram channel for OP_WRITE", e);
return;
}
}
class UdpWritableChannelSelectedHandler extends ChannelSelectedHandler {
UdpWritableChannelSelectedHandler(Future<?> future) {
super(future);
}
@Override
public void handleChannelSelectedAndNotCancelled(SelectableChannel channel, SelectionKey selectionKey) {
DatagramChannel datagramChannel = (DatagramChannel) channel;
ensureWriteBufferIsInitialized();
try {
datagramChannel.write(writeBuffer);
} catch (IOException e) {
abortUdpRequestAndCleanup(datagramChannel, "Exception writing to datagram channel", e);
return;
}
if (writeBuffer.hasRemaining()) {
try {
registerWithSelector(datagramChannel, SelectionKey.OP_WRITE, this);
} catch (ClosedChannelException e) {
abortUdpRequestAndCleanup(datagramChannel, "Exception registering datagram channel for OP_WRITE", e);
}
return;
}
try {
registerWithSelector(datagramChannel, SelectionKey.OP_READ, new UdpReadableChannelSelectedHandler(future));
} catch (ClosedChannelException e) {
abortUdpRequestAndCleanup(datagramChannel, "Exception registering datagram channel for OP_READ", e);
return;
}
}
}
class UdpReadableChannelSelectedHandler extends ChannelSelectedHandler {
UdpReadableChannelSelectedHandler(Future<?> future) {
super(future);
}
final ByteBuffer byteBuffer = ByteBuffer.allocate(udpPayloadSize);
@Override
public void handleChannelSelectedAndNotCancelled(SelectableChannel channel, SelectionKey selectionKey) {
DatagramChannel datagramChannel = (DatagramChannel) channel;
try {
datagramChannel.read(byteBuffer);
} catch (IOException e) {
abortUdpRequestAndCleanup(datagramChannel, "Exception reading from datagram channel", e);
return;
}
selectionKey.cancel();
try {
datagramChannel.close();
} catch (IOException e) {
LOGGER.log(Level.SEVERE, "Exception closing datagram channel", e);
addException(e);
}
DnsMessage response;
try {
response = new DnsMessage(byteBuffer.array());
} catch (IOException e) {
abortUdpRequestAndCleanup(datagramChannel, "Exception constructing dns message from datagram channel", e);
return;
}
if (response.id != request.id) {
addException(new MiniDnsException.IdMismatch(request, response));
startTcpRequest();
return;
}
if (response.truncated) {
startTcpRequest();
return;
}
DnsQueryResult result = new StandardDnsQueryResult(socketAddress.getAddress(), socketAddress.getPort(),
QueryMethod.asyncUdp, request, response);
gotResult(result);
}
}
private void abortTcpRequestAndCleanup(SocketChannel socketChannel, String errorMessage, IOException exception) {
abortRequestAndCleanup(socketChannel, errorMessage, exception);
future.setException(MultipleIoException.toIOException(exceptions));
}
private void startTcpRequest() {
SocketChannel socketChannel = null;
try {
socketChannel = SocketChannel.open();
} catch (IOException e) {
abortTcpRequestAndCleanup(socketChannel, "Exception opening socket channel", e);
return;
}
try {
socketChannel.configureBlocking(false);
} catch (IOException e) {
abortTcpRequestAndCleanup(socketChannel, "Exception configuring socket channel", e);
return;
}
try {
registerWithSelector(socketChannel, SelectionKey.OP_CONNECT, new TcpConnectedChannelSelectedHandler(future));
} catch (ClosedChannelException e) {
abortTcpRequestAndCleanup(socketChannel, "Exception registering socket channel", e);
return;
}
try {
socketChannel.connect(socketAddress);
} catch (IOException e) {
abortTcpRequestAndCleanup(socketChannel, "Exception connecting socket channel to " + socketAddress, e);
return;
}
}
class TcpConnectedChannelSelectedHandler extends ChannelSelectedHandler {
TcpConnectedChannelSelectedHandler(Future<?> future) {
super(future);
}
@Override
public void handleChannelSelectedAndNotCancelled(SelectableChannel channel, SelectionKey selectionKey) {
SocketChannel socketChannel = (SocketChannel) channel;
boolean connected;
try {
connected = socketChannel.finishConnect();
} catch (IOException e) {
abortTcpRequestAndCleanup(socketChannel, "Exception finish connecting socket channel", e);
return;
}
assert connected;
try {
registerWithSelector(socketChannel, SelectionKey.OP_WRITE, new TcpWritableChannelSelectedHandler(future));
} catch (ClosedChannelException e) {
abortTcpRequestAndCleanup(socketChannel, "Exception registering socket channel for OP_WRITE", e);
return;
}
}
}
class TcpWritableChannelSelectedHandler extends ChannelSelectedHandler {
TcpWritableChannelSelectedHandler(Future<?> future) {
super(future);
}
/**
* ByteBuffer array of length 2. First buffer is for the length of the DNS message, second one is the actual DNS message.
*/
private ByteBuffer[] writeBuffers;
@Override
public void handleChannelSelectedAndNotCancelled(SelectableChannel channel, SelectionKey selectionKey) {
SocketChannel socketChannel = (SocketChannel) channel;
if (writeBuffers == null) {
ensureWriteBufferIsInitialized();
ByteBuffer messageLengthByteBuffer = ByteBuffer.allocate(2);
int messageLength = writeBuffer.capacity();
assert messageLength <= Short.MAX_VALUE;
messageLengthByteBuffer.putShort((short) (messageLength & 0xffff));
((java.nio.Buffer) messageLengthByteBuffer).rewind();
writeBuffers = new ByteBuffer[2];
writeBuffers[0] = messageLengthByteBuffer;
writeBuffers[1] = writeBuffer;
}
try {
socketChannel.write(writeBuffers);
} catch (IOException e) {
abortTcpRequestAndCleanup(socketChannel, "Exception writing to socket channel", e);
return;
}
if (moreToWrite()) {
try {
registerWithSelector(socketChannel, SelectionKey.OP_WRITE, this);
} catch (ClosedChannelException e) {
abortTcpRequestAndCleanup(socketChannel, "Exception registering socket channel for OP_WRITE", e);
}
return;
}
try {
registerWithSelector(socketChannel, SelectionKey.OP_READ, new TcpReadableChannelSelectedHandler(future));
} catch (ClosedChannelException e) {
abortTcpRequestAndCleanup(socketChannel, "Exception registering socket channel for OP_READ", e);
return;
}
}
private boolean moreToWrite() {
for (int i = 0; i < writeBuffers.length; i++) {
if (writeBuffers[i].hasRemaining()) {
return true;
}
}
return false;
}
}
class TcpReadableChannelSelectedHandler extends ChannelSelectedHandler {
TcpReadableChannelSelectedHandler(Future<?> future) {
super(future);
}
final ByteBuffer messageLengthByteBuffer = ByteBuffer.allocate(2);
ByteBuffer byteBuffer;
@Override
public void handleChannelSelectedAndNotCancelled(SelectableChannel channel, SelectionKey selectionKey) {
SocketChannel socketChannel = (SocketChannel) channel;
int bytesRead;
if (byteBuffer == null) {
try {
bytesRead = socketChannel.read(messageLengthByteBuffer);
} catch (IOException e) {
abortTcpRequestAndCleanup(socketChannel, "Exception reading from socket channel", e);
return;
}
if (bytesRead < 0) {
abortTcpRequestAndCleanup(socketChannel, "Socket closed by remote host " + socketAddress, null);
return;
}
if (messageLengthByteBuffer.hasRemaining()) {
try {
registerWithSelector(socketChannel, SelectionKey.OP_READ, this);
} catch (ClosedChannelException e) {
abortTcpRequestAndCleanup(socketChannel, "Exception registering socket channel for OP_READ", e);
}
return;
}
((java.nio.Buffer) messageLengthByteBuffer).rewind();
short messageLengthSignedShort = messageLengthByteBuffer.getShort();
int messageLength = messageLengthSignedShort & 0xffff;
byteBuffer = ByteBuffer.allocate(messageLength);
}
try {
bytesRead = socketChannel.read(byteBuffer);
} catch (IOException e) {
throw new Error(e);
}
if (bytesRead < 0) {
abortTcpRequestAndCleanup(socketChannel, "Socket closed by remote host " + socketAddress, null);
return;
}
if (byteBuffer.hasRemaining()) {
try {
registerWithSelector(socketChannel, SelectionKey.OP_READ, this);
} catch (ClosedChannelException e) {
abortTcpRequestAndCleanup(socketChannel, "Exception registering socket channel for OP_READ", e);
}
return;
}
selectionKey.cancel();
try {
socketChannel.close();
} catch (IOException e) {
addException(e);
}
DnsMessage response;
try {
response = new DnsMessage(byteBuffer.array());
} catch (IOException e) {
abortTcpRequestAndCleanup(socketChannel, "Exception creating DNS message form socket channel bytes", e);
return;
}
if (request.id != response.id) {
MiniDnsException idMismatchException = new MiniDnsException.IdMismatch(request, response);
addException(idMismatchException);
AsyncDnsRequest.this.future.setException(MultipleIoException.toIOException(exceptions));
return;
}
DnsQueryResult result = new StandardDnsQueryResult(socketAddress.getAddress(), socketAddress.getPort(),
QueryMethod.asyncTcp, request, response);
gotResult(result);
}
}
}
================================================
FILE: minidns-async/src/main/java/org/minidns/source/async/AsyncNetworkDataSource.java
================================================
/*
* Copyright 2015-2024 the original author or authors
*
* This software is licensed under the Apache License, Version 2.0,
* the GNU Lesser General Public License version 2 or later ("LGPL")
* and the WTFPL.
* You may choose either license to govern your use of this software only
* upon the condition that you accept all of the terms of either
* the Apache License 2.0, the LGPL 2.1+ or the WTFPL.
*/
package org.minidns.source.async;
import java.io.IOException;
import java.net.InetAddress;
import java.nio.channels.ClosedChannelException;
import java.nio.channels.SelectableChannel;
import java.nio.channels.SelectionKey;
import java.nio.channels.Selector;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.Set;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.minidns.MiniDnsFuture;
import org.minidns.dnsmessage.DnsMessage;
import org.minidns.dnsqueryresult.DnsQueryResult;
import org.minidns.source.AbstractDnsDataSource;
/**
* A DNS data sources that resolves requests via the network asynchronously.
*/
public class AsyncNetworkDataSource extends AbstractDnsDataSource {
/**
* The logger of this data source.
*/
protected static final Logger LOGGER = Logger.getLogger(AsyncNetworkDataSource.class.getName());
private static final int REACTOR_THREAD_COUNT = 1;
private static final Queue<AsyncDnsRequest> INCOMING_REQUESTS = new ConcurrentLinkedQueue<>();
private static final Selector SELECTOR;
private static final Lock REGISTRATION_LOCK = new ReentrantLock();
private static final Queue<SelectionKey> PENDING_SELECTION_KEYS = new ConcurrentLinkedQueue<>();
private static final Thread[] REACTOR_THREADS = new Thread[REACTOR_THREAD_COUNT];
private static final PriorityQueue<AsyncDnsRequest> DEADLINE_QUEUE = new PriorityQueue<>(16, new Comparator<AsyncDnsRequest>() {
@Override
public int compare(AsyncDnsRequest o1, AsyncDnsRequest o2) {
if (o1.deadline > o2.deadline) {
return 1;
} else if (o1.deadline < o2.deadline) {
return -1;
}
return 0;
}
});
static {
try {
SELECTOR = Selector.open();
} catch (IOException e) {
throw new IllegalStateException(e);
}
for (int i = 0; i < REACTOR_THREAD_COUNT; i++) {
Thread reactorThread = new Thread(new Reactor());
reactorThread.setDaemon(true);
reactorThread.setName("MiniDNS Reactor Thread #" + i);
reactorThread.start();
REACTOR_THREADS[i] = reactorThread;
}
}
@Override
public MiniDnsFuture<DnsQueryResult, IOException> queryAsync(DnsMessage message, InetAddress address, int port, OnResponseCallback onResponseCallback) {
AsyncDnsRequest asyncDnsRequest = new AsyncDnsRequest(message, address, port, udpPayloadSize, this, onResponseCallback);
INCOMING_REQUESTS.add(asyncDnsRequest);
synchronized (DEADLINE_QUEUE) {
DEADLINE_QUEUE.add(asyncDnsRequest);
}
SELECTOR.wakeup();
return asyncDnsRequest.getFuture();
}
@Override
public DnsQueryResult query(DnsMessage message, InetAddress address, int port) throws IOException {
MiniDnsFuture<DnsQueryResult, IOException> future = queryAsync(message, address, port, null);
try {
return future.get();
} catch (InterruptedException e) {
// This should never happen.
throw new AssertionError(e);
} catch (ExecutionException e) {
Throwable wrappedThrowable = e.getCause();
if (wrappedThrowable instanceof IOException) {
throw (IOException) wrappedThrowable;
}
// This should never happen.
throw new AssertionError(e);
}
}
SelectionKey registerWithSelector(SelectableChannel channel, int ops, Object attachment) throws ClosedChannelException {
REGISTRATION_LOCK.lock();
try {
SELECTOR.wakeup();
return channel.register(SELECTOR, ops, attachment);
} finally {
REGISTRATION_LOCK.unlock();
}
}
void finished(AsyncDnsRequest asyncDnsRequest) {
synchronized (DEADLINE_QUEUE) {
DEADLINE_QUEUE.remove(asyncDnsRequest);
}
}
void cancelled(AsyncDnsRequest asyncDnsRequest) {
finished(asyncDnsRequest);
// Wakeup since the async DNS request was removed from the deadline queue.
SELECTOR.wakeup();
}
private static final class Reactor implements Runnable {
@Override
public void run() {
while (!Thread.interrupted()) {
Collection<SelectionKey> mySelectedKeys = performSelect();
handleSelectedKeys(mySelectedKeys);
handlePendingSelectionKeys();
handleIncomingRequests();
}
}
private static void handleSelectedKeys(Collection<SelectionKey> selectedKeys) {
for (SelectionKey selectionKey : selectedKeys) {
ChannelSelectedHandler channelSelectedHandler = (ChannelSelectedHandler) selectionKey.attachment();
SelectableChannel channel = selectionKey.channel();
channelSelectedHandler.handleChannelSelected(channel, selectionKey);
}
}
@SuppressWarnings({"LockNotBeforeTry", "MixedMutabilityReturnType"})
private static Collection<SelectionKey> performSelect() {
AsyncDnsRequest nearestDeadline = null;
AsyncDnsRequest nextInQueue;
synchronized (DEADLINE_QUEUE) {
while ((nextInQueue = DEADLINE_QUEUE.peek()) != null) {
if (nextInQueue.wasDeadlineMissedAndFutureNotified()) {
// We notified the future, associated with the AsyncDnsRequest nearestDeadline,
// that the deadline has passed, hence remove it from the queue.
DEADLINE_QUEUE.poll();
} else {
// We found a nearest deadline that has not yet passed, break out of the loop.
nearestDeadline = nextInQueue;
break;
}
}
}
long selectWait;
if (nearestDeadline == null) {
// There is no deadline, wait indefinitely in select().
selectWait = 0;
} else {
// There is a deadline in the future, only block in select() until the deadline.
selectWait = nextInQueue.deadline - System.currentTimeMillis();
if (selectWait < 0) {
// We already have a missed deadline. Do not call select() and handle the tasks which are past their
// deadline.
return Collections.emptyList();
}
}
List<SelectionKey> selectedKeys;
int newSelectedKeysCount;
synchronized (SELECTOR) {
// Ensure that a wakeup() in registerWithSelector() gives the corresponding
// register() in the same method the chance to actually register the channel. In
// other words: This construct ensure that there is never another select()
// between a corresponding wakeup() and register() calls.
// See also https://stackoverflow.com/a/1112809/194894
REGISTRATION_LOCK.lock();
REGISTRATION_LOCK.unlock();
try {
newSelectedKeysCount = SELECTOR.select(selectWait);
} catch (IOException e) {
LOGGER.log(Level.WARNING, "IOException while using select()", e);
return Collections.emptyList();
}
if (newSelectedKeysCount == 0) {
return Collections.emptyList();
}
Set<SelectionKey> selectedKeySet = SELECTOR.selectedKeys();
for (SelectionKey selectionKey : selectedKeySet) {
selectionKey.interestOps(0);
}
selectedKeys = new ArrayList<>(selectedKeySet.size());
selectedKeys.addAll(selectedKeySet);
selectedKeySet.clear();
}
int selectedKeysCount = selectedKeys.size();
final Level LOG_LEVEL = Level.FINER;
if (LOGGER.isLoggable(LOG_LEVEL)) {
LOGGER.log(LOG_LEVEL, "New selected key count: " + newSelectedKeysCount + ". Total selected key count "
+ selectedKeysCount);
}
int myKeyCount = selectedKeysCount / REACTOR_THREAD_COUNT;
Collection<SelectionKey> mySelectedKeys = new ArrayList<>(myKeyCount);
Iterator<SelectionKey> it = selectedKeys.iterator();
for (int i = 0; i < myKeyCount; i++) {
SelectionKey selectionKey = it.next();
mySelectedKeys.add(selectionKey);
}
while (it.hasNext()) {
// Drain to PENDING_SELECTION_KEYS
SelectionKey selectionKey = it.next();
PENDING_SELECTION_KEYS.add(selectionKey);
}
return mySelectedKeys;
}
private static void handlePendingSelectionKeys() {
int pendingSelectionKeysSize = PENDING_SELECTION_KEYS.size();
if (pendingSelectionKeysSize == 0) {
return;
}
int myKeyCount = pendingSelectionKeysSize / REACTOR_THREAD_COUNT;
Collection<SelectionKey> selectedKeys = new ArrayList<>(myKeyCount);
for (int i = 0; i < myKeyCount; i++) {
SelectionKey selectionKey = PENDING_SELECTION_KEYS.poll();
if (selectionKey == null) {
// We lost a race :)
break;
}
selectedKeys.add(selectionKey);
}
if (!PENDING_SELECTION_KEYS.isEmpty()) {
// There is more work in the pending selection keys queue, wakeup another thread to handle it.
SELECTOR.wakeup();
}
handleSelectedKeys(selectedKeys);
}
private static void handleIncomingRequests() {
int incomingRequestsSize = INCOMING_REQUESTS.size();
if (incomingRequestsSize == 0) {
return;
}
int myRequestsCount = incomingRequestsSize / REACTOR_THREAD_COUNT;
// The division could result in myRequestCount being zero despite pending incoming
// requests. Therefore, ensure this thread tries to get at least one incoming
// request by invoking poll(). Otherwise, we might end up in a busy loop
// where myRequestCount is zero, and this thread invokes a selector.wakeup() below
// because incomingRequestsSize is not empty, but the woken-up reactor thread
// will end up with myRequestCount being zero again, restarting the busy-loop cycle.
if (myRequestsCount == 0) myRequestsCount = 1;
Collection<AsyncDnsRequest> requests = new ArrayList<>(myRequestsCount);
for (int i = 0; i < myRequestsCount; i++) {
AsyncDnsRequest asyncDnsRequest = INCOMING_REQUESTS.poll();
if (asyncDnsRequest == null) {
// We lost a race :)
break;
}
requests.add(asyncDnsRequest);
}
if (!INCOMING_REQUESTS.isEmpty()) {
SELECTOR.wakeup();
}
for (AsyncDnsRequest asyncDnsRequest : requests) {
asyncDnsRequest.startHandling();
}
}
}
}
================================================
FILE: minidns-async/src/main/java/org/minidns/source/async/ChannelSelectedHandler.java
================================================
/*
* Copyright 2015-2024 the original author or authors
*
* This software is licensed under the Apache License, Version 2.0,
* the GNU Lesser General Public License version 2 or later ("LGPL")
* and the WTFPL.
* You may choose either license to govern your use of this software only
* upon the condition that you accept all of the terms of either
* the Apache License 2.0, the LGPL 2.1+ or the WTFPL.
*/
package org.minidns.source.async;
import java.io.IOException;
import java.nio.channels.SelectableChannel;
import java.nio.channels.SelectionKey;
import java.util.concurrent.Future;
import java.util.logging.Level;
import java.util.logging.Logger;
abstract class ChannelSelectedHandler {
private static final Logger LOGGER = Logger.getLogger(ChannelSelectedHandler.class.getName());
final Future<?> future;
ChannelSelectedHandler(Future<?> future) {
this.future = future;
}
void handleChannelSelected(SelectableChannel channel, SelectionKey selectionKey) {
if (future.isCancelled()) {
try {
channel.close();
} catch (IOException e) {
LOGGER.log(Level.INFO, "Could not close channel", e);
}
return;
}
handleChannelSelectedAndNotCancelled(channel, selectionKey);
}
protected abstract void handleChannelSelectedAndNotCancelled(SelectableChannel channel, SelectionKey selectionKey);
}
================================================
FILE: minidns-async/src/test/java/org/minidns/source/async/AsyncNetworkDataSourceTest.java
================================================
/*
* Copyright 2015-2024 the original author or authors
*
* This software is licensed under the Apache License, Version 2.0,
* the GNU Lesser General Public License version 2 or later ("LGPL")
* and the WTFPL.
* You may choose either license to govern your use of this software only
* upon the condition that you accept all of the terms of either
* the Apache License 2.0, the LGPL 2.1+ or the WTFPL.
*/
package org.minidns.source.async;
import org.junit.jupiter.api.Test;
public class AsyncNetworkDataSourceTest {
/**
* Dummy test to make jacocoRootReport happy.
*/
@Test
public void nopTest() {
}
}
================================================
FILE: minidns-client/build.gradle
================================================
plugins {
id 'org.minidns.java-conventions'
id 'org.minidns.android-conventions'
}
description = "A small non-recursing DNS client"
dependencies {
api project(':minidns-core')
testImplementation project(path: ":minidns-core", configuration: "testRuntime")
}
jar {
bundle {
bnd(
// minidns-client invokes Class.forName("android.os.…")
// which causes OSGi to import android.os, because OSGi's
// bnd scans for `Class.forName` usages per default.
// See also https://github.com/openhab/openhab-addons/pull/11670#issuecomment-982539016
'-noclassforname': 'true',
)
}
}
================================================
FILE: minidns-client/src/main/java/org/minidns/AbstractDnsClient.java
================================================
/*
* Copyright 2015-2024 the original author or authors
*
* This software is licensed under the Apache License, Version 2.0,
* the GNU Lesser General Public License version 2 or later ("LGPL")
* and the WTFPL.
* You may choose either license to govern your use of this software only
* upon the condition that you accept all of the terms of either
* the Apache License 2.0, the LGPL 2.1+ or the WTFPL.
*/
package org.minidns;
import org.minidns.MiniDnsFuture.InternalMiniDnsFuture;
import org.minidns.cache.LruCache;
import org.minidns.dnsmessage.DnsMessage;
import org.minidns.dnsmessage.Question;
import org.minidns.dnsname.DnsName;
import org.minidns.dnsqueryresult.DnsQueryResult;
import org.minidns.record.A;
import org.minidns.record.AAAA;
import org.minidns.record.Data;
import org.minidns.record.NS;
import org.minidns.record.Record;
import org.minidns.record.Record.CLASS;
import org.minidns.record.Record.TYPE;
import org.minidns.source.DnsDataSource;
import org.minidns.source.NetworkDataSource;
import java.io.IOException;
import java.net.InetAddress;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import java.util.Collections;
import java.util.HashSet;
import java.util.Random;
import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
* A minimal DNS client for SRV/A/AAAA/NS and CNAME lookups, with IDN support.
* This circumvents the missing javax.naming package on android.
*/
public abstract class AbstractDnsClient {
protected static final LruCache DEFAULT_CACHE = new LruCache();
protected static final Logger LOGGER = Logger.getLogger(AbstractDnsClient.class.getName());
/**
* This callback is used by the synchronous query() method <b>and</b> by the asynchronous queryAync() method in order to update the
* cache. In the asynchronous case, hand this callback into the async call, so that it can get called once the result is available.
*/
private final DnsDataSource.OnResponseCallback onResponseCallback = new DnsDataSource.OnResponseCallback() {
@Override
public void onResponse(DnsMessage requestMessage, DnsQueryResult responseMessage) {
final Question q = requestMessage.getQuestion();
if (cache != null && isResponseCacheable(q, responseMessage)) {
cache.put(requestMessage.asNormalizedVersion(), responseMessage);
}
}
};
/**
* The internal random class for sequence generation.
*/
protected final Random random;
protected final Random insecureRandom = new Random();
/**
* The internal DNS cache.
*/
protected final DnsCache cache;
protected DnsDataSource dataSource = new NetworkDataSource();
public enum IpVersionSetting {
v4only(true, false),
v6only(false, true),
v4v6(true, true),
v6v4(true, true),
;
public final boolean v4;
public final boolean v6;
IpVersionSetting(boolean v4, boolean v6) {
this.v4 = v4;
this.v6 = v6;
}
}
protected static IpVersionSetting DEFAULT_IP_VERSION_SETTING = IpVersionSetting.v4v6;
public static void setDefaultIpVersion(IpVersionSetting preferedIpVersion) {
if (preferedIpVersion == null) {
throw new IllegalArgumentException();
}
AbstractDnsClient.DEFAULT_IP_VERSION_SETTING = preferedIpVersion;
}
protected IpVersionSetting ipVersionSetting = DEFAULT_IP_VERSION_SETTING;
public void setPreferedIpVersion(IpVersionSetting preferedIpVersion) {
if (preferedIpVersion == null) {
throw new IllegalArgumentException();
}
ipVersionSetting = preferedIpVersion;
}
public IpVersionSetting getPreferedIpVersion() {
return ipVersionSetting;
}
/**
* Create a new DNS client with the given DNS cache.
*
* @param cache The backend DNS cache.
*/
protected AbstractDnsClient(DnsCache cache) {
Random random;
try {
random = SecureRandom.getInstance("SHA1PRNG");
} catch (NoSuchAlgorithmException e1) {
random = new SecureRandom();
}
this.random = random;
this.cache = cache;
}
/**
* Create a new DNS client using the global default cache.
*/
protected AbstractDnsClient() {
this(DEFAULT_CACHE);
}
/**
* Query the system nameservers for a single entry of any class.
*
* This can be used to determine the name server version, if name
* is version.bind, type is TYPE.TXT and clazz is CLASS.CH.
*
* @param name The DNS name to request.
* @param type The DNS type to request (SRV, A, AAAA, ...).
* @param clazz The class of the request (usually IN for Internet).
* @return The response (or null on timeout/error).
* @throws IOException if an IO error occurs.
*/
public final DnsQueryResult query(String name, TYPE type, CLASS clazz) throws IOException {
Question q = new Question(name, type, clazz);
return query(q);
}
/**
* Query the system nameservers for a single entry of the class IN
* (which is used for MX, SRV, A, AAAA and most other RRs).
*
* @param name The DNS name to request.
* @param type The DNS type to request (SRV, A, AAAA, ...).
* @return The response (or null on timeout/error).
* @throws IOException if an IO error occurs.
*/
public final DnsQueryResult query(DnsName name, TYPE type) throws IOException {
Question q = new Question(name, type, CLASS.IN);
return query(q);
}
/**
* Query the system nameservers for a single entry of the class IN
* (which is used for MX, SRV, A, AAAA and most other RRs).
*
* @param name The DNS name to request.
* @param type The DNS type to request (SRV, A, AAAA, ...).
* @return The response (or null on timeout/error).
* @throws IOException if an IO error occurs.
*/
public final DnsQueryResult query(CharSequence name, TYPE type) throws IOException {
Question q = new Question(name, type, CLASS.IN);
return query(q);
}
public DnsQueryResult query(Question q) throws IOException {
DnsMessage.Builder query = buildMessage(q);
return query(query);
}
/**
* Send a query request to the DNS system.
*
* @param query The query to send to the server.
* @return The response (or null).
* @throws IOException if an IO error occurs.
*/
protected abstract DnsQueryResult query(DnsMessage.Builder query) throws IOException;
public final MiniDnsFuture<DnsQueryResult, IOException> queryAsync(CharSequence name, TYPE type) {
Question q = new Question(name, type, CLASS.IN);
return queryAsync(q);
}
public final MiniDnsFuture<DnsQueryResult, IOException> queryAsync(Question q) {
DnsMessage.Builder query = buildMessage(q);
return queryAsync(query);
}
/**
* Default implementation of an asynchronous DNS query which just wraps the synchronous case.
* <p>
* Subclasses override this method to support true asynchronous queries.
* </p>
*
* @param query the query.
* @return a future for this query.
*/
protected MiniDnsFuture<DnsQueryResult, IOException> queryAsync(DnsMessage.Builder query) {
InternalMiniDnsFuture<DnsQueryResult, IOException> future = new InternalMiniDnsFuture<>();
DnsQueryResult result;
try {
result = query(query);
} catch (IOException e) {
future.setException(e);
return future;
}
future.setResult(result);
return future;
}
public final DnsQueryResult query(Question q, InetAddress server, int port) throws IOException {
DnsMessage query = getQueryFor(q);
return query(query, server, port);
}
public final DnsQueryResult query(DnsMessage requestMessage, InetAddress address, int port) throws IOException {
// See if we have the answer to this question already cached
DnsQueryResult responseMessage = (cache == null) ? null : cache.get(requestMessage);
if (responseMessage != null) {
return responseMessage;
}
final Question q = requestMessage.getQuestion();
final Level TRACE_LOG_LEVEL = Level.FINE;
LOGGER.log(TRACE_LOG_LEVEL, "Asking {0} on {1} for {2} with:\n{3}", new Object[] { address, port, q, requestMessage });
try {
responseMessage = dataSource.query(requestMessage, address, port);
} catch (IOException e) {
LOGGER.log(TRACE_LOG_LEVEL, "IOException {0} on {1} while resolving {2}: {3}", new Object[] { address, port, q, e});
throw e;
}
LOGGER.log(TRACE_LOG_LEVEL, "Response from {0} on {1} for {2}:\n{3}", new Object[] { address, port, q, responseMessage });
onResponseCallback.onResponse(requestMessage, responseMessage);
return responseMessage;
}
public final MiniDnsFuture<DnsQueryResult, IOException> queryAsync(DnsMessage requestMessage, InetAddress address, int port) {
// See if we have the answer to this question already cached
DnsQueryResult responseMessage = (cache == null) ? null : cache.get(requestMessage);
if (responseMessage != null) {
return MiniDnsFuture.from(responseMessage);
}
final Question q = requestMessage.getQuestion();
final Level TRACE_LOG_LEVEL = Level.FINE;
LOGGER.log(TRACE_LOG_LEVEL, "Asynchronusly asking {0} on {1} for {2} with:\n{3}", new Object[] { address, port, q, requestMessage });
return dataSource.queryAsync(requestMessage, address, port, onResponseCallback);
}
/**
* Whether a response from the DNS system should be cached or not.
*
* @param q The question the response message should answer.
* @param result The DNS query result.
* @return True, if the response should be cached, false otherwise.
*/
protected boolean isResponseCacheable(Question q, DnsQueryResult result) {
DnsMessage dnsMessage = result.response;
for (Record<? extends Data> record : dnsMessage.answerSection) {
if (record.isAnswer(q)) {
return true;
}
}
return false;
}
/**
* Builds a {@link DnsMessage} object carrying the given Question.
*
* @param question {@link Question} to be put in the DNS request.
* @return A {@link DnsMessage} requesting the answer for the given Question.
*/
final DnsMessage.Builder buildMessage(Question question) {
DnsMessage.Builder message = DnsMessage.builder();
message.setQuestion(question);
message.setId(random.nextInt());
message = newQuestion(message);
return message;
}
protected abstract DnsMessage.Builder newQuestion(DnsMessage.Builder questionMessage);
/**
* Query a nameserver for a single entry.
*
* @param name The DNS name to request.
* @param type The DNS type to request (SRV, A, AAAA, ...).
* @param clazz The class of the request (usually IN for Internet).
* @param address The DNS server address.
* @param port The DNS server port.
* @return The response (or null on timeout / failure).
* @throws IOException On IO Errors.
*/
public DnsQueryResult query(String name, TYPE type, CLASS clazz, InetAddress address, int port)
throws IOException {
Question q = new Question(name, type, clazz);
return query(q, address, port);
}
/**
* Query a nameserver for a single entry.
*
* @param name The DNS name to request.
* @param type The DNS type to request (SRV, A, AAAA, ...).
* @param clazz The class of the request (usually IN for Internet).
* @param address The DNS server host.
* @return The response (or null on timeout / failure).
* @throws IOException On IO Errors.
*/
public DnsQueryResult query(String name, TYPE type, CLASS clazz, InetAddress address)
throws IOException {
Question q = new Question(name, type, clazz);
return query(q, address);
}
/**
* Query a nameserver for a single entry of class IN.
*
* @param name The DNS name to request.
* @param type The DNS type to request (SRV, A, AAAA, ...).
* @param address The DNS server host.
* @return The response (or null on timeout / failure).
* @throws IOException On IO Errors.
*/
public DnsQueryResult query(String name, TYPE type, InetAddress address)
throws IOException {
Question q = new Question(name, type, CLASS.IN);
return query(q, address);
}
public final DnsQueryResult query(DnsMessage query, InetAddress host) throws IOException {
return query(query, host, 53);
}
/**
* Query a specific server for one entry.
*
* @param q The question section of the DNS query.
* @param address The dns server address.
* @return The a DNS query result.
* @throws IOException On IOErrors.
*/
public DnsQueryResult query(Question q, InetAddress address) throws IOException {
return query(q, address, 53);
}
public final MiniDnsFuture<DnsQueryResult, IOException> queryAsync(DnsMessage query, InetAddress dnsServer) {
return queryAsync(query, dnsServer, 53);
}
/**
* Returns the currently used {@link DnsDataSource}. See {@link #setDataSource(DnsDataSource)} for details.
*
* @return The currently used {@link DnsDataSource}
*/
public DnsDataSource getDataSource() {
return dataSource;
}
/**
* Set a {@link DnsDataSource} to be used by the DnsClient.
* The default implementation will direct all queries directly to the Internet.
*
* This can be used to define a non-default handling for outgoing data. This can be useful to redirect the requests
* to a proxy or to modify requests after or responses before they are handled by the DnsClient implementation.
*
* @param dataSource An implementation of DNSDataSource that shall be used.
*/
public void setDataSource(DnsDataSource dataSource) {
if (dataSource == null) {
throw new IllegalArgumentException();
}
this.dataSource = dataSource;
}
/**
* Get the cache used by this DNS client.
*
* @return the cached used by this DNS client or <code>null</code>.
*/
public DnsCache getCache() {
return cache;
}
protected DnsMessage getQueryFor(Question q) {
DnsMessage.Builder messageBuilder = buildMessage(q);
DnsMessage query = messageBuilder.build();
return query;
}
private <D extends Data> Set<D> getCachedRecordsFor(DnsName dnsName, TYPE type) {
if (cache == null)
return Collections.emptySet();
Question dnsNameNs = new Question(dnsName, type);
DnsMessage queryDnsNameNs = getQueryFor(dnsNameNs);
DnsQueryResult cachedResult = cache.get(queryDnsNameNs);
if (cachedResult == null)
return Collections.emptySet();
return cachedResult.response.getAnswersFor(dnsNameNs);
}
public Set<NS> getCachedNameserverRecordsFor(DnsName dnsName) {
return getCachedRecordsFor(dnsName, TYPE.NS);
}
public Set<A> getCachedIPv4AddressesFor(DnsName dnsName) {
return getCachedRecordsFor(dnsName, TYPE.A);
}
public Set<AAAA> getCachedIPv6AddressesFor(DnsName dnsName) {
return getCachedRecordsFor(dnsName, TYPE.AAAA);
}
@SuppressWarnings("unchecked")
private <D extends Data> Set<D> getCachedIPNameserverAddressesFor(DnsName dnsName, TYPE type) {
Set<NS> nsSet = getCachedNameserverRecordsFor(dnsName);
if (nsSet.isEmpty())
return Collections.emptySet();
Set<D> res = new HashSet<>(3 * nsSet.size());
for (NS ns : nsSet) {
Set<D> addresses;
switch (type) {
case A:
addresses = (Set<D>) getCachedIPv4AddressesFor(ns.target);
break;
case AAAA:
addresses = (Set<D>) getCachedIPv6AddressesFor(ns.target);
break;
default:
throw new AssertionError();
}
res.addAll(addresses);
}
return res;
}
public Set<A> getCachedIPv4NameserverAddressesFor(DnsName dnsName) {
return getCachedIPNameserverAddressesFor(dnsName, TYPE.A);
}
public Set<AAAA> getCachedIPv6NameserverAddressesFor(DnsName dnsName) {
return getCachedIPNameserverAddressesFor(dnsName, TYPE.AAAA);
}
}
================================================
FILE: minidns-client/src/main/java/org/minidns/DnsCache.java
================================================
/*
* Copyright 2015-2024 the original author or authors
*
* This software is licensed under the Apache License, Version 2.0,
* the GNU Lesser General Public License version 2 or later ("LGPL")
* and the WTFPL.
* You may choose either license to govern your use of this software only
* upon the condition that you accept all of the terms of either
* the Apache License 2.0, the LGPL 2.1+ or the WTFPL.
*/
package org.minidns;
import org.minidns.dnsmessage.DnsMessage;
import org.minidns.dnsname.DnsName;
import org.minidns.dnsqueryresult.CachedDnsQueryResult;
import org.minidns.dnsqueryresult.DnsQueryResult;
/**
* Cache for DNS Entries. Implementations must be thread safe.
*/
public abstract class DnsCache {
public static final int DEFAULT_CACHE_SIZE = 512;
/**
* Add an an dns answer/response for a given dns question. Implementations
* should honor the ttl / receive timestamp.
* @param query The query message containing a question.
* @param result The DNS query result.
*/
public final void put(DnsMessage query, DnsQueryResult result) {
putNormalized(query.asNormalizedVersion(), result);
}
protected abstract void putNormalized(DnsMessage normalizedQuery, DnsQueryResult result);
public abstract void offer(DnsMessage query, DnsQueryResult result, DnsName authoritativeZone);
/**
* Request a cached dns response.
* @param query The query message containing a question.
* @return The dns message.
*/
public final CachedDnsQueryResult get(DnsMessage query) {
return getNormalized(query.asNormalizedVersion());
}
protected abstract CachedDnsQueryResult getNormalized(DnsMessage normalizedQuery);
}
================================================
FILE: minidns-client/src/main/java/org/minidns/DnsClient.java
================================================
/*
* Copyright 2015-2024 the original author or authors
*
* This software is licensed under the Apache License, Version 2.0,
* the GNU Lesser General Public License version 2 or later ("LGPL")
* and the WTFPL.
* You may choose either license to govern your use of this software only
* upon the condition that you accept all of the terms of either
* the Apache License 2.0, the LGPL 2.1+ or the WTFPL.
*/
package org.minidns;
import org.minidns.MiniDnsException.ErrorResponseException;
import org.minidns.MiniDnsException.NoQueryPossibleException;
import org.minidns.dnsmessage.DnsMessage;
import org.minidns.dnsmessage.Question;
import org.minidns.dnsname.DnsName;
import org.minidns.dnsqueryresult.DnsQueryResult;
import org.minidns.dnsserverlookup.AndroidUsingExec;
import org.minidns.dnsserverlookup.AndroidUsingReflection;
import org.minidns.dnsserverlookup.DnsServerLookupMechanism;
import org.minidns.dnsserverlookup.UnixUsingEtcResolvConf;
import org.minidns.record.Record.TYPE;
import org.minidns.util.CollectionsUtil;
import org.minidns.util.InetAddressUtil;
import org.minidns.util.MultipleIoException;
import java.io.IOException;
import java.net.Inet4Address;
import java.net.Inet6Address;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.CopyOnWriteArraySet;
import java.util.logging.Level;
/**
* A minimal DNS client for SRV/A/AAAA/NS and CNAME lookups, with IDN support.
* This circumvents the missing javax.naming package on android.
*/
public class DnsClient extends AbstractDnsClient {
static final List<DnsServerLookupMechanism> LOOKUP_MECHANISMS = new CopyOnWriteArrayList<>();
static final Set<Inet4Address> STATIC_IPV4_DNS_SERVERS = new CopyOnWriteArraySet<>();
static final Set<Inet6Address> STATIC_IPV6_DNS_SERVERS = new CopyOnWriteArraySet<>();
static {
addDnsServerLookupMechanism(AndroidUsingExec.INSTANCE);
addDnsServerLookupMechanism(AndroidUsingReflection.INSTANCE);
addDnsServerLookupMechanism(UnixUsingEtcResolvConf.INSTANCE);
try {
Inet4Address googleV4Dns = InetAddressUtil.ipv4From("8.8.8.8");
STATIC_IPV4_DNS_SERVERS.add(googleV4Dns);
} catch (IllegalArgumentException e) {
LOGGER.log(Level.WARNING, "Could not add static IPv4 DNS Server", e);
}
try {
Inet6Address googleV6Dns = InetAddressUtil.ipv6From("[2001:4860:4860::8888]");
STATIC_IPV6_DNS_SERVERS.add(googleV6Dns);
} catch (IllegalArgumentException e) {
LOGGER.log(Level.WARNING, "Could not add static IPv6 DNS Server", e);
}
}
private static final Set<String> blacklistedDnsServers = Collections.newSetFromMap(new ConcurrentHashMap<String, Boolean>(4));
private final Set<InetAddress> nonRaServers = Collections.newSetFromMap(new ConcurrentHashMap<InetAddress, Boolean>(4));
private boolean askForDnssec = false;
private boolean disableResultFilter = false;
private boolean useHardcodedDnsServers = true;
/**
* Create a new DNS client using the global default cache.
*/
public DnsClient() {
super();
}
public DnsClient(DnsCache dnsCache) {
super(dnsCache);
}
@Override
protected DnsMessage.Builder newQuestion(DnsMessage.Builder message) {
message.setRecursionDesired(true);
message.getEdnsBuilder().setUdpPayloadSize(dataSource.getUdpPayloadSize()).setDnssecOk(askForDnssec);
return message;
}
private List<InetAddress> getServerAddresses() {
List<InetAddress> dnsServerAddresses = findDnsAddresses();
if (useHardcodedDnsServers) {
InetAddress primaryHardcodedDnsServer, secondaryHardcodedDnsServer = null;
switch (ipVersionSetting) {
case v4v6:
primaryHardcodedDnsServer = getRandomHardcodedIpv4DnsServer();
secondaryHardcodedDnsServer = getRandomHarcodedIpv6DnsServer();
break;
case v6v4:
primaryHardcodedDnsServer = getRandomHarcodedIpv6DnsServer();
secondaryHardcodedDnsServer = getRandomHardcodedIpv4DnsServer();
break;
case v4only:
primaryHardcodedDnsServer = getRandomHardcodedIpv4DnsServer();
break;
case v6only:
primaryHardcodedDnsServer = getRandomHarcodedIpv6DnsServer();
break;
default:
throw new AssertionError("Unknown ipVersionSetting: " + ipVersionSetting);
}
dnsServerAddresses.add(primaryHardcodedDnsServer);
if (secondaryHardcodedDnsServer != null) {
dnsServerAddresses.add(secondaryHardcodedDnsServer);
}
}
return dnsServerAddresses;
}
@Override
public DnsQueryResult query(DnsMessage.Builder queryBuilder) throws IOException {
DnsMessage q = newQuestion(queryBuilder).build();
// While this query method does in fact re-use query(Question, String)
// we still do a cache lookup here in order to avoid unnecessary
// findDNS()calls, which are expensive on Android. Note that we do not
// put the results back into the Cache, as this is already done by
// query(Question, String).
DnsQueryResult dnsQueryResult = (cache == null) ? null : cache.get(q);
if (dnsQueryResult != null) {
return dnsQueryResult;
}
List<InetAddress> dnsServerAddresses = getServerAddresses();
List<IOException> ioExceptions = new ArrayList<>(dnsServerAddresses.size());
for (InetAddress dns : dnsServerAddresses) {
if (nonRaServers.contains(dns)) {
LOGGER.finer("Skipping " + dns + " because it was marked as \"recursion not available\"");
continue;
}
try {
dnsQueryResult = query(q, dns);
} catch (IOException ioe) {
ioExceptions.add(ioe);
continue;
}
DnsMessage responseMessage = dnsQueryResult.response;
if (!responseMessage.recursionAvailable) {
boolean newRaServer = nonRaServers.add(dns);
if (newRaServer) {
LOGGER.warning("The DNS server " + dns
+ " returned a response without the \"recursion available\" (RA) flag set. This likely indicates a misconfiguration because the server is not suitable for DNS resolution");
}
continue;
}
if (disableResultFilter) {
return dnsQueryResult;
}
switch (responseMessage.responseCode) {
case NO_ERROR:
case NX_DOMAIN:
break;
default:
String warning = "Response from " + dns + " asked for " + q.getQuestion() + " with error code: "
+ responseMessage.responseCode + '.';
if (!LOGGER.isLoggable(Level.FINE)) {
// Only append the responseMessage is log level is not fine. If it is fine or higher, the
// response has already been logged.
warning += "\n" + responseMessage;
}
LOGGER.warning(warning);
ErrorResponseException exception = new ErrorResponseException(q, dnsQueryResult);
ioExceptions.add(exception);
continue;
}
return dnsQueryResult;
}
MultipleIoException.throwIfRequired(ioExceptions);
// TODO: Shall we add the attempted DNS servers to the exception?
throw new NoQueryPossibleException(q);
}
@Override
protected MiniDnsFuture<DnsQueryResult, IOException> queryAsync(DnsMessage.Builder queryBuilder) {
DnsMessage q = newQuestion(queryBuilder).build();
// While this query method does in fact re-use query(Question, String)
// we still do a cache lookup here in order to avoid unnecessary
// findDNS()calls, which are expensive on Android. Note that we do not
// put the results back into the Cache, as this is already done by
// query(Question, String).
DnsQueryResult responseMessage = (cache == null) ? null : cache.get(q);
if (responseMessage != null) {
return MiniDnsFuture.from(responseMessage);
}
final List<InetAddress> dnsServerAddresses = getServerAddresses();
// Filter loop.
Iterator<InetAddress> it = dnsServerAddresses.iterator();
while (it.hasNext()) {
InetAddress dns = it.next();
if (nonRaServers.contains(dns)) {
it.remove();
LOGGER.finer("Skipping " + dns + " because it was marked as \"recursion not available\"");
continue;
}
}
List<MiniDnsFuture<DnsQueryResult, IOException>> futures = new ArrayList<>(dnsServerAddresses.size());
// "Main" loop.
for (InetAddress dns : dnsServerAddresses) {
MiniDnsFuture<DnsQueryResult, IOException> f = queryAsync(q, dns);
futures.add(f);
}
return MiniDnsFuture.anySuccessfulOf(futures);
}
/**
* Retrieve a list of currently configured DNS servers IP addresses. This method does verify that only IP addresses are returned and
* nothing else (e.g. DNS names).
* <p>
* The addresses are discovered by using one (or more) of the configured {@link DnsServerLookupMechanism}s.
* </p>
*
* @return A list of DNS server IP addresses configured for this system.
*/
public static List<String> findDNS() {
List<String> res = null;
final Level TRACE_LOG_LEVEL = Level.FINE;
for (DnsServerLookupMechanism mechanism : LOOKUP_MECHANISMS) {
try {
res = mechanism.getDnsServerAddresses();
} catch (SecurityException exception) {
LOGGER.log(Level.WARNING, "Could not lookup DNS server", exception);
}
if (res == null) {
LOGGER.log(TRACE_LOG_LEVEL, "DnsServerLookupMechanism '" + mechanism.getName() + "' did not return any DNS server");
continue;
}
if (LOGGER.isLoggable(TRACE_LOG_LEVEL)) {
// TODO: Use String.join() once MiniDNS is Android API 26 (or higher).
StringBuilder sb = new StringBuilder();
for (Iterator<String> it = res.iterator(); it.hasNext();) {
String s = it.next();
sb.append(s);
if (it.hasNext()) {
sb.append(", ");
}
}
String dnsServers = sb.toString();
LOGGER.log(TRACE_LOG_LEVEL, "DnsServerLookupMechanism {0} returned the following DNS servers: {1}",
new Object[] { mechanism.getName(), dnsServers });
}
assert !res.isEmpty();
// We could cache if res only contains IP addresses and avoid the verification in case. Not sure if its really that beneficial
// though, because the list returned by the server mechanism is rather short.
// Verify the returned DNS servers: Ensure that only valid IP addresses are returned. We want to avoid that something else,
// especially a valid DNS name is returned, as this would cause the following String to InetAddress conversation using
// getByName(String) to cause a DNS lookup, which would be performed outside of the realm of MiniDNS and therefore also outside
// of its DNSSEC guarantees.
Iterator<String> it = res.iterator();
while (it.hasNext()) {
String potentialDnsServer = it.next();
if (!InetAddressUtil.isIpAddress(potentialDnsServer)) {
LOGGER.warning("The DNS server lookup mechanism '" + mechanism.getName()
+ "' returned an invalid non-IP address result: '" + potentialDnsServer + "'");
it.remove();
} else if (blacklistedDnsServers.contains(potentialDnsServer)) {
LOGGER.fine("The DNS server lookup mechanism '" + mechanism.getName()
+ "' returned a blacklisted result: '" + potentialDnsServer + "'");
it.remove();
}
}
if (!res.isEmpty()) {
break;
}
LOGGER.warning("The DNS server lookup mechanism '" + mechanism.getName()
+ "' returned not a single valid IP address after sanitazion");
res = null;
}
return res;
}
/**
* Retrieve a list of currently configured DNS server addresses.
* <p>
* Note that unlike {@link #findDNS()}, the list returned by this method
* will take the IP version setting into account, and order the list by the
* preferred address types (IPv4/v6). The returned list is modifiable.
* </p>
*
* @return A list of DNS server addresses.
* @see #findDNS()
*/
public static List<InetAddress> findDnsAddresses() {
// The findDNS() method contract guarantees that only IP addresses will be returned.
List<String> res = findDNS();
if (res == null) {
return new ArrayList<>();
}
final IpVersionSetting setting = DEFAULT_IP_VERSION_SETTING;
List<Inet4Address> ipv4DnsServer = null;
List<Inet6Address> ipv6DnsServer = null;
if (setting.v4) {
ipv4DnsServer = new ArrayList<>(res.size());
}
if (setting.v6) {
ipv6DnsServer = new ArrayList<>(res.size());
}
int validServerAddresses = 0;
for (String dnsServerString : res) {
// The following invariant must hold: "dnsServerString is a IP address". Therefore findDNS() must only return a List of Strings
// representing IP addresses. Otherwise the following call of getByName(String) may perform a DNS lookup without MiniDNS being
// involved. Something we want to avoid.
assert InetAddressUtil.isIpAddress(dnsServerString);
InetAddress dnsServerAddress;
try {
dnsServerAddress = InetAddress.getByName(dnsServerString);
} catch (UnknownHostException e) {
LOGGER.log(Level.SEVERE, "Could not transform '" + dnsServerString + "' to InetAddress", e);
continue;
}
if (dnsServerAddress instanceof Inet4Address) {
if (!setting.v4) {
continue;
}
Inet4Address ipv4DnsServerAddress = (Inet4Address) dnsServerAddress;
ipv4DnsServer.add(ipv4DnsServerAddress);
} else if (dnsServerAddress instanceof Inet6Address) {
if (!setting.v6) {
continue;
}
Inet6Address ipv6DnsServerAddress = (Inet6Address) dnsServerAddress;
ipv6DnsServer.add(ipv6DnsServerAddress);
} else {
throw new AssertionError("The address '" + dnsServerAddress + "' is neither of type Inet(4|6)Address");
}
validServerAddresses++;
}
List<InetAddress> dnsServers = new ArrayList<>(validServerAddresses);
switch (setting) {
case v4v6:
dnsServers.addAll(ipv4DnsServer);
dnsServers.addAll(ipv6DnsServer);
break;
case v6v4:
dnsServers.addAll(ipv6DnsServer);
dnsServers.addAll(ipv4DnsServer);
break;
case v4only:
dnsServers.addAll(ipv4DnsServer);
break;
case v6only:
dnsServers.addAll(ipv6DnsServer);
break;
}
return dnsServers;
}
public static void addDnsServerLookupMechanism(DnsServerLookupMechanism dnsServerLookup) {
if (!dnsServerLookup.isAvailable()) {
LOGGER.fine("Not adding " + dnsServerLookup.getName() + " as it is not available.");
return;
}
synchronized (LOOKUP_MECHANISMS) {
// We can't use Collections.sort(CopyOnWriteArrayList) with Java 7. So we first create a temp array, sort it, and replace
// LOOKUP_MECHANISMS with the result. For more information about the Java 7 Collections.sort(CopyOnWriteArarayList) issue see
// http://stackoverflow.com/a/34827492/194894
// TODO: Remove that workaround once MiniDNS is Java 8 only.
ArrayList<DnsServerLookupMechanism> tempList = new ArrayList<>(LOOKUP_MECHANISMS.size() + 1);
tempList.addAll(LOOKUP_MECHANISMS);
tempList.add(dnsServerLookup);
// Sadly, this Collections.sort() does not with the CopyOnWriteArrayList on Java 7.
Collections.sort(tempList);
LOOKUP_MECHANISMS.clear();
LOOKUP_MECHANISMS.addAll(tempList);
}
}
public static boolean removeDNSServerLookupMechanism(DnsServerLookupMechanism dnsServerLookup) {
synchronized (LOOKUP_MECHANISMS) {
return LOOKUP_MECHANISMS.remove(dnsServerLookup);
}
}
public static boolean addBlacklistedDnsServer(String dnsServer) {
return blacklistedDnsServers.add(dnsServer);
}
public static boolean removeBlacklistedDnsServer(String dnsServer) {
return blacklistedDnsServers.remove(dnsServer);
}
public boolean isAskForDnssec() {
return askForDnssec;
}
public void setAskForDnssec(boolean askForDnssec) {
this.askForDnssec = askForDnssec;
}
public boolean isDisableResultFilter() {
return disableResultFilter;
}
public void setDisableResultFilter(boolean disableResultFilter) {
this.disableResultFilter = disableResultFilter;
}
public boolean isUseHardcodedDnsServersEnabled() {
return useHardcodedDnsServers;
}
public void setUseHardcodedDnsServers(boolean useHardcodedDnsServers) {
this.useHardcodedDnsServers = useHardcodedDnsServers;
}
public InetAddress getRandomHardcodedIpv4DnsServer() {
return CollectionsUtil.getRandomFrom(STATIC_IPV4_DNS_SERVERS, insecureRandom);
}
public InetAddress getRandomHarcodedIpv6DnsServer() {
return CollectionsUtil.getRandomFrom(STATIC_IPV6_DNS_SERVERS, insecureRandom);
}
private static Question getReverseIpLookupQuestionFor(DnsName dnsName) {
return new Question(dnsName, TYPE.PTR);
}
public static Question getReverseIpLookupQuestionFor(Inet4Address inet4Address) {
DnsName reversedIpAddress = InetAddressUtil.reverseIpAddressOf(inet4Address);
DnsName dnsName = DnsName.from(reversedIpAddress, DnsName.IN_ADDR_ARPA);
return getReverseIpLookupQuestionFor(dnsName);
}
public static Question getReverseIpLookupQuestionFor(Inet6Address inet6Address) {
DnsName reversedIpAddress = InetAddressUtil.reverseIpAddressOf(inet6Address);
DnsName dnsName = DnsName.from(reversedIpAddress, DnsName.IP6_ARPA);
return getReverseIpLookupQuestionFor(dnsName);
}
public static Question getReverseIpLookupQuestionFor(InetAddress inetAddress) {
if (inetAddress instanceof Inet4Address) {
return getReverseIpLookupQuestionFor((Inet4Address) inetAddress);
} else if (inetAddress instanceof Inet6Address) {
return getReverseIpLookupQuestionFor((Inet6Address) inetAddress);
} else {
throw new IllegalArgumentException("The provided inetAddress '" + inetAddress
+ "' is neither of type Inet4Address nor Inet6Address");
}
}
}
================================================
FILE: minidns-client/src/main/java/org/minidns/MiniDnsConfiguration.java
================================================
/*
* Copyright 2015-2024 the original author or authors
*
* This software is licensed under the Apache License, Version 2.0,
* the GNU Lesser General Public License version 2 or later ("LGPL")
* and the WTFPL.
* You may choose either license to govern your use of this software only
* upon the condition that you accept all of the terms of either
* the Apache License 2.0, the LGPL 2.1+ or the WTFPL.
*/
package org.minidns;
public class MiniDnsConfiguration {
public static String getVersion() {
return MiniDnsInitialization.VERSION;
}
}
================================================
FILE: minidns-client/src/main/java/org/minidns/MiniDnsException.java
================================================
/*
* Copyright 2015-2024 the original author or authors
*
* This software is licensed under the Apache License, Version 2.0,
* the GNU Lesser General Public License version 2 or later ("LGPL")
* and the WTFPL.
* You may choose either license to govern your use of this software only
* upon the condition that you accept all of the terms of either
* the Apache License 2.0, the LGPL 2.1+ or the WTFPL.
*/
package org.minidns;
import java.io.IOException;
import org.minidns.dnsmessage.DnsMessage;
import org.minidns.dnsqueryresult.DnsQueryResult;
public abstract class MiniDnsException extends IOException {
/**
*
*/
private static final long serialVersionUID = 1L;
protected MiniDnsException(String message) {
super(message);
}
public static class IdMismatch extends MiniDnsException {
/**
*
*/
private static final long serialVersionUID = 1L;
private final DnsMessage request;
private final DnsMessage response;
public IdMismatch(DnsMessage request, DnsMessage response) {
super(getString(request, response));
assert request.id != response.id;
this.request = request;
this.response = response;
}
public DnsMessage getRequest() {
return request;
}
public DnsMessage getResponse() {
return response;
}
private static String getString(DnsMessage request, DnsMessage response) {
return "The response's ID doesn't matches the request ID. Request: " + request.id + ". Response: " + response.id;
}
}
public static class NullResultException extends MiniDnsException {
/**
*
*/
private static final long serialVersionUID = 1L;
private final DnsMessage request;
public NullResultException(DnsMessage request) {
super("The request yielded a 'null' result while resolving.");
this.request = request;
}
public DnsMessage getRequest() {
return request;
}
}
public static class ErrorResponseException extends MiniDnsException {
/**
*
*/
private static final long serialVersionUID = 1L;
private final DnsMessage request;
private final DnsQueryResult result;
public ErrorResponseException(DnsMessage request, DnsQueryResult result) {
super("Received " + result.response.responseCode + " error response\n" + result);
this.request = request;
this.result = result;
}
public DnsMessage getRequest() {
return request;
}
public DnsQueryResult getResult() {
return result;
}
}
public static class NoQueryPossibleException extends MiniDnsException {
/**
*
*/
private static final long serialVersionUID = 1L;
private final DnsMessage request;
public NoQueryPossibleException(DnsMessage request) {
super("No DNS server could be queried");
this.request = request;
}
public DnsMessage getRequest() {
return request;
}
}
}
================================================
FILE: minidns-client/src/main/java/org/minidns/MiniDnsFuture.java
================================================
/*
* Copyright 2015-2024 the original author or authors
*
* This software is licensed under the Apache License, Version 2.0,
* the GNU Lesser General Public License version 2 or later ("LGPL")
* and the WTFPL.
* You may choose either license to govern your use of this software only
* upon the condition that you accept all of the terms of either
* the Apache License 2.0, the LGPL 2.1+ or the WTFPL.
*/
package org.minidns;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.CancellationException;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Future;
import java.util.concurrent.RejectedExecutionHandler;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import org.minidns.util.CallbackRecipient;
import org.minidns.util.ExceptionCallback;
import org.minidns.util.MultipleIoException;
import org.minidns.util.SuccessCallback;
public abstract class MiniDnsFuture<V, E extends Exception> implements Future<V>, CallbackRecipient<V, E> {
private boolean cancelled;
protected V result;
protected E exception;
private SuccessCallback<V> successCallback;
private ExceptionCallback<E> exceptionCallback;
@Override
public synchronized boolean cancel(boolean mayInterruptIfRunning) {
if (isDone()) {
return false;
}
cancelled = true;
if (mayInterruptIfRunning) {
notifyAll();
}
return true;
}
@Override
public final synchronized boolean isCancelled() {
return cancelled;
}
@Override
public final synchronized boolean isDone() {
return hasResult() || hasException();
}
public final synchronized boolean hasResult() {
return result != null;
}
public final synchronized boolean hasException() {
return exception != null;
}
@Override
public CallbackRecipient<V, E> onSuccess(SuccessCallback<V> successCallback) {
this.successCallback = successCallback;
maybeInvokeCallbacks();
return this;
}
@Override
public CallbackRecipient<V, E> onError(ExceptionCallback<E> exceptionCallback) {
this.exceptionCallback = exceptionCallback;
maybeInvokeCallbacks();
return this;
}
private V getOrThrowExecutionException() throws ExecutionException {
assert result != null || exception != null || cancelled;
if (result != null) {
return result;
}
if (exception != null) {
throw new ExecutionException(exception);
}
assert cancelled;
throw new CancellationException();
}
@Override
public final synchronized V get() throws InterruptedException, ExecutionException {
while (result == null && exception == null && !cancelled) {
wait();
}
return getOrThrowExecutionException();
}
public final synchronized V getOrThrow() throws E {
while (result == null && exception == null && !cancelled) {
try {
wait();
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
if (exception != null) {
throw exception;
}
if (cancelled) {
throw new CancellationException();
}
assert result != null;
return result;
}
@Override
public final synchronized V get(long timeout, TimeUnit unit)
throws InterruptedException, ExecutionException, TimeoutException {
final long deadline = System.currentTimeMillis() + unit.toMillis(timeout);
while (result != null && exception != null && !cancelled) {
final long waitTimeRemaining = deadline - System.currentTimeMillis();
if (waitTimeRemaining > 0) {
wait(waitTimeRemaining);
}
}
if (cancelled) {
throw new CancellationException();
}
if (result == null || exception == null) {
throw new TimeoutException();
}
return getOrThrowExecutionException();
}
private static final ExecutorService EXECUTOR_SERVICE;
static {
ThreadFactory threadFactory = new ThreadFactory() {
@Override
public Thread newThread(Runnable r) {
Thread thread = new Thread(r);
thread.setDaemon(true);
thread.setName("MiniDnsFuture Thread");
return thread;
}
};
BlockingQueue<Runnable> blockingQueue = new ArrayBlockingQueue<>(128);
RejectedExecutionHandler rejectedExecutionHandler = new RejectedExecutionHandler() {
@Override
public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) {
r.run();
}
};
int cores = Runtime.getRuntime().availableProcessors();
int maximumPoolSize = cores <= 4 ? 2 : cores;
ExecutorService executorService = new ThreadPoolExecutor(0, maximumPoolSize, 60L, TimeUnit.SECONDS, blockingQueue, threadFactory,
rejectedExecutionHandler);
EXECUTOR_SERVICE = executorService;
}
@SuppressWarnings("FutureReturnValueIgnored")
protected final synchronized void maybeInvokeCallbacks() {
if (cancelled) {
return;
}
if (result != null && successCallback != null) {
EXECUTOR_SERVICE.submit(new Runnable() {
@Override
public void run() {
successCallback.onSuccess(result);
}
});
} else if (exception != null && exceptionCallback != null) {
EXECUTOR_SERVICE.submit(new Runnable() {
@Override
public void run() {
exceptionCallback.processException(exception);
}
});
}
}
public static class InternalMiniDnsFuture<V, E extends Exception> extends MiniDnsFuture<V, E> {
public final synchronized void setResult(V result) {
if (isDone()) {
return;
}
this.result = result;
this.notifyAll();
maybeInvokeCallbacks();
}
public final synchronized void setException(E exception) {
if (isDone()) {
return;
}
this.exception = exception;
this.notifyAll();
maybeInvokeCallbacks();
}
}
public static <V, E extends Exception> MiniDnsFuture<V, E> from(V result) {
InternalMiniDnsFuture<V, E> future = new InternalMiniDnsFuture<>();
future.setResult(result);
return future;
}
public static <V> MiniDnsFuture<V, IOException> anySuccessfulOf(Collection<MiniDnsFuture<V, IOException>> futures) {
return anySuccessfulOf(futures, exceptions -> MultipleIoException.toIOException(exceptions));
}
public interface ExceptionsWrapper<EI extends Exception, EO extends Exception> {
EO wrap(List<EI> exceptions);
}
public static <V, EI extends Exception, EO extends Exception> MiniDnsFuture<V, EO> anySuccessfulOf(
Collection<MiniDnsFuture<V, EI>> futures,
ExceptionsWrapper<EI, EO> exceptionsWrapper) {
InternalMiniDnsFuture<V, EO> returnedFuture = new InternalMiniDnsFuture<>();
final List<EI> exceptions = Collections.synchronizedList(new ArrayList<>(futures.size()));
for (MiniDnsFuture<V, EI> future : futures) {
future.onSuccess(new SuccessCallback<V>() {
@Override
public void onSuccess(V result) {
// Cancel all futures. Yes, this includes the future which just returned the
// result and futures which already failed with an exception, but then cancel
// will be a no-op.
for (MiniDnsFuture<V, EI> futureToCancel : futures) {
futureToCancel.cancel(true);
}
returnedFuture.setResult(result);
}
});
future.onError(new ExceptionCallback<EI>() {
@Override
public void processException(EI exception) {
exceptions.add(exception);
// Signal the main future about the exceptions, but only if all sub-futures returned an exception.
if (exceptions.size() == futures.size()) {
EO returnedException = exceptionsWrapper.wrap(exceptions);
returnedFuture.setException(returnedException);
}
}
});
}
return returnedFuture;
}
}
================================================
FILE: minidns-client/src/main/java/org/minidns/MiniDnsInitialization.java
================================================
/*
* Copyright 2015-2024 the original author or authors
*
* This software is licensed under the Apache License, Version 2.0,
* the GNU Lesser General Public License version 2 or later ("LGPL")
* and the WTFPL.
* You may choose either license to govern your use of this software only
* upon the condition that you accept all of the terms of either
* the Apache License 2.0, the LGPL 2.1+ or the WTFPL.
*/
package org.minidns;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.util.logging.Level;
import java.util.logging.Logger;
public class MiniDnsInitialization {
private static final Logger LOGGER = Logger.getLogger(MiniDnsInitialization.class.getName());
static final String VERSION;
static {
String miniDnsVersion;
BufferedReader reader = null;
try {
InputStream is = MiniDnsInitialization.class.getClassLoader().getResourceAsStream("org.minidns/version");
reader = new BufferedReader(new InputStreamReader(is, StandardCharsets.UTF_8));
miniDnsVersion = reader.readLine();
} catch (Exception e) {
LOGGER.log(Level.SEVERE, "Could not determine MiniDNS version", e);
miniDnsVersion = "unkown";
} finally {
if (reader != null) {
try {
reader.close();
} catch (IOException e) {
LOGGER.log(Level.WARNING, "IOException closing stream", e);
}
}
}
VERSION = miniDnsVersion;
}
}
================================================
FILE: minidns-client/src/main/java/org/minidns/RrSet.java
================================================
/*
* Copyright 2015-2024 the original author or authors
*
* This software is licensed under the Apache License, Version 2.0,
* the GNU Lesser General Public License version 2 or later ("LGPL")
* and the WTFPL.
* You may choose either license to govern your use of this software only
* upon the condition that you accept all of the terms of either
* the Apache License 2.0, the LGPL 2.1+ or the WTFPL.
*/
package org.minidns;
import java.util.Collections;
import java.util.LinkedHashSet;
import java.util.Set;
import org.minidns.dnsname.DnsName;
import org.minidns.record.Data;
import org.minidns.record.Record;
import org.minidns.record.Record.CLASS;
import org.minidns.record.Record.TYPE;
public final class RrSet {
public final DnsName name;
public final TYPE type;
public final CLASS clazz;
public final Set<Record<? extends Data>> records;
private RrSet(DnsName name, TYPE type, CLASS clazz, Set<Record<? extends Data>> records) {
this.name = name;
this.type = type;
this.clazz = clazz;
this.records = Collections.unmodifiableSet(records);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(name).append('\t').append(clazz).append('\t').append(type).append('\n');
for (Record<?> record : records) {
sb.append(record).append('\n');
}
return sb.toString();
}
public static Builder builder() {
return new Builder();
}
public static final class Builder {
private DnsName name;
private TYPE type;
private CLASS clazz;
Set<Record<? extends Data>> records = new LinkedHashSet<>(8);
private Builder() {
}
public Builder addRecord(Record<? extends Data> record) {
if (name == null) {
name = record.name;
type = record.type;
clazz = record.clazz;
} else if (!couldContain(record)) {
throw new IllegalArgumentException(
"Can not add " + record + " to RRSet " + name + ' ' + type + ' ' + clazz);
}
boolean didNotExist = records.add(record);
assert didNotExist;
return this;
}
public boolean couldContain(Record<? extends Data> record) {
if (name == null) {
return true;
}
return name.equals(record.name) && type == record.type && clazz == record.clazz;
}
public boolean addIfPossible(Record<? extends Data> record) {
if (!couldContain(record)) {
return false;
}
addRecord(record);
return true;
}
public RrSet build() {
if (name == null) {
// There is no RR added to this builder.
throw new IllegalStateException();
}
return new RrSet(name, type, clazz, records);
}
}
}
================================================
FILE: minidns-client/src/main/java/org/minidns/cache/ExtendedLruCache.java
================================================
/*
* Copyright 2015-2024 the original author or authors
*
* This software is licensed under the Apache License, Version 2.0,
* the GNU Lesser General Public License version 2 or later ("LGPL")
* and the WTFPL.
* You may choose either license to govern your use of this software only
* upon the condition that you accept all of the terms of either
* the Apache License 2.0, the LGPL 2.1+ or the WTFPL.
*/
package org.minidns.cache;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import org.minidns.dnsmessage.DnsMessage;
import org.minidns.dnsmessage.Question;
import org.minidns.dnsname.DnsName;
import org.minidns.dnsqueryresult.CachedDnsQueryResult;
import org.minidns.dnsqueryresult.DnsQueryResult;
import org.minidns.dnsqueryresult.SynthesizedCachedDnsQueryResult;
import org.minidns.record.Data;
import org.minidns.record.Record;
/**
* A variant of {@link LruCache} also using the data found in the sections for caching.
*/
public class ExtendedLruCache extends LruCache {
public ExtendedLruCache() {
this(DEFAULT_CACHE_SIZE);
}
public ExtendedLruCache(int capacity) {
super(capacity);
}
public ExtendedLruCache(int capacity, long maxTTL) {
super(capacity, maxTTL);
}
@SuppressWarnings("UnsynchronizedOverridesSynchronized")
@Override
protected void putNormalized(DnsMessage q, DnsQueryResult result) {
super.putNormalized(q, result);
DnsMessage message = result.response;
Map<DnsMessage, List<Record<? extends Data>>> extraCaches = new HashMap<>(message.additionalSection.size());
gather(extraCaches, q, message.answerSection, null);
gather(extraCaches, q, message.authoritySection, null);
gather(extraCaches, q, message.additionalSection, null);
putExtraCaches(result, extraCaches);
}
@Override
public void offer(DnsMessage query, DnsQueryResult result, DnsName authoritativeZone) {
DnsMessage reply = result.response;
// The reply shouldn't be an authoritative answers when offer() is used. That would be a case for put().
assert !reply.authoritativeAnswer;
Map<DnsMessage, List<Record<? extends Data>>> extraCaches = new HashMap<>(reply.additionalSection.size());
// N.B. not gathering from reply.answerSection here. Since it is a non authoritativeAnswer it shouldn't contain anything.
gather(extraCaches, query, reply.authoritySection, authoritativeZone);
gather(extraCaches, query, reply.additionalSection, authoritativeZone);
putExtraCaches(result, extraCaches);
}
private void gather(Map<DnsMessage, List<Record<?extends Data>>> extraCaches, DnsMessage q, List<Record<? extends Data>> records, DnsName authoritativeZone) {
for (Record<? extends Data> extraRecord : records) {
if (!shouldGather(extraRecord, q.getQuestion(), authoritativeZone))
continue;
DnsMessage.Builder additionalRecordQuestionBuilder = extraRecord.getQuestionMessage();
if (additionalRecordQuestionBuilder == null)
continue;
additionalRecordQuestionBuilder.copyFlagsFrom(q);
additionalRecordQuestionBuilder.setAdditionalResourceRecords(q.additionalSection);
DnsMessage additionalRecordQuestion = additionalRecordQuestionBuilder.build();
if (additionalRecordQuestion.equals(q)) {
// No need to cache the additional question if it is the same as the original question.
continue;
}
List<Record<? extends Data>> additionalRecords = extraCaches.get(additionalRecordQuestion);
if (additionalRecords == null) {
additionalRecords = new ArrayList<>();
extraCaches.put(additionalRecordQuestion, additionalRecords);
}
additionalRecords.add(extraRecord);
}
}
private void putExtraCaches(DnsQueryResult synthesynthesizationSource, Map<DnsMessage, List<Record<? extends Data>>> extraCaches) {
DnsMessage reply = synthesynthesizationSource.response;
for (Entry<DnsMessage, List<Record<? extends Data>>> entry : extraCaches.entrySet()) {
DnsMessage question = entry.getKey();
DnsMessage answer = reply.asBuilder()
.setQuestion(question.getQuestion())
.setAuthoritativeAnswer(true)
.addAnswers(entry.getValue())
.build();
CachedDnsQueryResult cachedDnsQueryResult = new SynthesizedCachedDnsQueryResult(question, answer, synthesynthesizationSource);
synchronized (this) {
backend.put(question, cachedDnsQueryResult);
}
}
}
protected boolean shouldGather(Record<? extends Data> extraRecord, Question question, DnsName authoritativeZone) {
boolean extraRecordIsChildOfQuestion = extraRecord.name.isChildOf(question.name);
boolean extraRecordIsChildOfAuthoritativeZone = false;
if (authoritativeZone != null) {
extraRecordIsChildOfAuthoritativeZone = extraRecord.name.isChildOf(authoritativeZone);
}
return extraRecordIsChildOfQuestion || extraRecordIsChildOfAuthoritativeZone;
}
}
================================================
FILE: minidns-client/src/main/java/org/minidns/cache/FullLruCache.java
================================================
/*
* Copyright 2015-2024 the original author or authors
*
* This software is licensed under the Apache License, Version 2.0,
* the GNU Lesser General Public License version 2 or later ("LGPL")
* and the WTFPL.
* You may choose either license to govern your use of this software only
* upon the condition that you accept all of the terms of either
* the Apache License 2.0, the LGPL 2.1+ or the WTFPL.
*/
package org.minidns.cache;
import org.minidns.dnsmessage.Question;
import org.minidns.dnsname.DnsName;
import org.minidns.record.Data;
import org.minidns.record.Record;
/**
* An <b>insecure</b> variant of {@link LruCache} also using all the data found in the sections of an answer.
*/
public class FullLruCache extends ExtendedLruCache {
public FullLruCache() {
this(DEFAULT_CACHE_SIZE);
}
public FullLruCache(int capacity) {
super(capacity);
}
public FullLruCache(int capacity, long maxTTL) {
super(capacity, maxTTL);
}
@Override
protected boolean shouldGather(Record<? extends Data> extraRecord, Question question, DnsName authoritativeZone) {
return true;
}
}
================================================
FILE: minidns-client/src/main/java/org/minidns/cache/LruCache.java
================================================
/*
* Copyright 2015-2024 the original author or authors
*
* This software is licensed under the Apache License, Version 2.0,
* the GNU Lesser General Public License version 2 or later ("LGPL")
* and the WTFPL.
* You may choose either license to govern your use of this software only
* upon the condition that you accept all of the terms of either
* the Apache License 2.0, the LGPL 2.1+ or the WTFPL.
*/
package org.minidns.cache;
import java.util.LinkedHashMap;
import java.util.Map.Entry;
import org.minidns.DnsCache;
import org.minidns.dnsmessage.DnsMessage;
import org.minidns.dnsname.DnsName;
import org.minidns.dnsqueryresult.CachedDnsQueryResult;
import org.minidns.dnsqueryresult.DirectCachedDnsQueryResult;
import org.minidns.dnsqueryresult.DnsQueryResult;
/**
* LRU based DNSCache backed by a LinkedHashMap.
*/
public class LruCache extends DnsCache {
/**
* Internal miss count.
*/
protected long missCount = 0L;
/**
* Internal expire count (subset of misses that was caused by expire).
*/
protected long expireCount = 0L;
/**
* Internal hit count.
*/
protected long hitCount = 0L;
/**
* The internal capacity of the backend cache.
*/
protected int capacity;
/**
* The upper bound of the ttl. All longer TTLs will be capped by this ttl.
*/
protected long maxTTL;
/**
* The backend cache.
*/
protected LinkedHashMap<DnsMessage, CachedDnsQueryResult> backend;
/**
* Create a new LRUCache with given capacity and upper bound ttl.
* @param capacity The internal capacity.
* @param maxTTL The upper bound for any ttl.
*/
@SuppressWarnings("serial")
public LruCache(final int capacity, final long maxTTL) {
this.capacity = capacity;
this.maxTTL = maxTTL;
backend = new LinkedHashMap<DnsMessage, CachedDnsQueryResult>(
Math.min(capacity + (capacity + 3) / 4 + 2, 11), 0.75f, true) {
@Override
protected boolean removeEldestEntry(
Entry<DnsMessage, CachedDnsQueryResult> eldest) {
return size() > capacity;
}
};
}
/**
* Create a new LRUCache with given capacity.
* @param capacity The capacity of this cache.
*/
public LruCache(final int capacity) {
this(capacity, Long.MAX_VALUE);
}
public LruCache() {
this(DEFAULT_CACHE_SIZE);
}
@Override
protected synchronized void putNormalized(DnsMessage q, DnsQueryResult result) {
if (result.response.receiveTimestamp <= 0L) {
return;
}
backend.put(q, new DirectCachedDnsQueryResult(q, result));
}
@Override
protected synchronized CachedDnsQueryResult getNormalized(DnsMessage q) {
CachedDnsQueryResult result = backend.get(q);
if (result == null) {
missCount++;
return null;
}
DnsMessage message = result.response;
// RFC 2181 § 5.2 says that all TTLs in a RRSet should be equal, if this isn't the case, then we assume the
// shortest TTL to be the effective one.
final long answersMinTtl = message.getAnswersMinTtl();
final long ttl = Math.min(answersMinTtl, maxTTL);
final long expiryDate = message.receiveTimestamp + (ttl * 1000);
final long now = System.currentTimeMillis();
if (expiryDate < now) {
missCount++;
expireCount++;
backend.remove(q);
return null;
} else {
hitCount++;
return result;
}
}
/**
* Clear all entries in this cache.
*/
public synchronized void clear() {
backend.clear();
missCount = 0L;
hitCount = 0L;
expireCount = 0L;
}
/**
* Get the miss count of this cache which is the number of fruitless
* get calls since this cache was last resetted.
* @return The number of cache misses.
*/
public long getMissCount() {
return missCount;
}
/**
* The number of expires (cache hits that have had a ttl to low to be
* retrieved).
* @return The expire count.
*/
public long getExpireCount() {
return expireCount;
}
/**
gitextract_xohl602z/ ├── .github/ │ └── workflows/ │ └── ci.yml ├── .gitignore ├── LICENCE ├── LICENCE_APACHE ├── LICENCE_LGPL2.1 ├── LICENCE_WTFPL ├── Makefile ├── README.md ├── build-logic/ │ ├── build.gradle │ ├── settings.gradle │ └── src/ │ └── main/ │ └── groovy/ │ ├── org.minidns.android-boot-classpath-conventions.gradle │ ├── org.minidns.android-conventions.gradle │ ├── org.minidns.application-conventions.gradle │ ├── org.minidns.common-conventions.gradle │ ├── org.minidns.java-conventions.gradle │ └── org.minidns.javadoc-conventions.gradle ├── build.gradle ├── config/ │ ├── checkstyle/ │ │ ├── checkstyle.xml │ │ ├── header.txt │ │ └── suppressions.xml │ └── scalaStyle.xml ├── gradle/ │ └── wrapper/ │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradle.properties.example ├── gradlew ├── gradlew.bat ├── minidns-android23/ │ ├── build.gradle │ └── src/ │ ├── main/ │ │ └── java/ │ │ └── org/ │ │ └── minidns/ │ │ └── dnsserverlookup/ │ │ └── android21/ │ │ └── AndroidUsingLinkProperties.java │ └── test/ │ └── java/ │ └── org/ │ └── minidns/ │ └── dnsserverlookup/ │ └── android21/ │ └── AndroidUsingLinkPropertiesTest.java ├── minidns-async/ │ ├── build.gradle │ └── src/ │ ├── main/ │ │ └── java/ │ │ └── org/ │ │ └── minidns/ │ │ └── source/ │ │ └── async/ │ │ ├── AsyncDnsRequest.java │ │ ├── AsyncNetworkDataSource.java │ │ └── ChannelSelectedHandler.java │ └── test/ │ └── java/ │ └── org/ │ └── minidns/ │ └── source/ │ └── async/ │ └── AsyncNetworkDataSourceTest.java ├── minidns-client/ │ ├── build.gradle │ └── src/ │ ├── main/ │ │ ├── java/ │ │ │ └── org/ │ │ │ └── minidns/ │ │ │ ├── AbstractDnsClient.java │ │ │ ├── DnsCache.java │ │ │ ├── DnsClient.java │ │ │ ├── MiniDnsConfiguration.java │ │ │ ├── MiniDnsException.java │ │ │ ├── MiniDnsFuture.java │ │ │ ├── MiniDnsInitialization.java │ │ │ ├── RrSet.java │ │ │ ├── cache/ │ │ │ │ ├── ExtendedLruCache.java │ │ │ │ ├── FullLruCache.java │ │ │ │ ├── LruCache.java │ │ │ │ └── MiniDnsCacheFactory.java │ │ │ ├── dnsqueryresult/ │ │ │ │ ├── CachedDnsQueryResult.java │ │ │ │ ├── DirectCachedDnsQueryResult.java │ │ │ │ ├── DnsQueryResult.java │ │ │ │ ├── StandardDnsQueryResult.java │ │ │ │ └── SynthesizedCachedDnsQueryResult.java │ │ │ ├── dnsserverlookup/ │ │ │ │ ├── AbstractDnsServerLookupMechanism.java │ │ │ │ ├── AndroidUsingExec.java │ │ │ │ ├── AndroidUsingReflection.java │ │ │ │ ├── DnsServerLookupMechanism.java │ │ │ │ └── UnixUsingEtcResolvConf.java │ │ │ └── source/ │ │ │ ├── AbstractDnsDataSource.java │ │ │ ├── DnsDataSource.java │ │ │ ├── NetworkDataSource.java │ │ │ └── NetworkDataSourceWithAccounting.java │ │ └── resources/ │ │ └── de.measite.minidns/ │ │ └── .keep │ └── test/ │ └── java/ │ └── org/ │ └── minidns/ │ ├── DnsClientTest.java │ ├── DnsWorld.java │ ├── LruCacheTest.java │ ├── dnsqueryresult/ │ │ └── TestWorldDnsQueryResult.java │ ├── dnsserverlookup/ │ │ └── AndroidUsingExecTest.java │ └── source/ │ └── NetworkDataSourceTest.java ├── minidns-core/ │ ├── build.gradle │ └── src/ │ ├── main/ │ │ └── java/ │ │ └── org/ │ │ └── minidns/ │ │ ├── constants/ │ │ │ ├── DnsRootServer.java │ │ │ └── DnssecConstants.java │ │ ├── dnslabel/ │ │ │ ├── ALabel.java │ │ │ ├── DnsLabel.java │ │ │ ├── FakeALabel.java │ │ │ ├── LdhLabel.java │ │ │ ├── LeadingOrTrailingHyphenLabel.java │ │ │ ├── NonLdhLabel.java │ │ │ ├── NonReservedLdhLabel.java │ │ │ ├── OtherNonLdhLabel.java │ │ │ ├── ReservedLdhLabel.java │ │ │ ├── UnderscoreLabel.java │ │ │ └── XnLabel.java │ │ ├── dnsmessage/ │ │ │ ├── DnsMessage.java │ │ │ └── Question.java │ │ ├── dnsname/ │ │ │ ├── DnsName.java │ │ │ └── InvalidDnsNameException.java │ │ ├── edns/ │ │ │ ├── Edns.java │ │ │ ├── EdnsOption.java │ │ │ ├── Nsid.java │ │ │ └── UnknownEdnsOption.java │ │ ├── idna/ │ │ │ ├── DefaultIdnaTransformator.java │ │ │ ├── IdnaTransformator.java │ │ │ └── MiniDnsIdna.java │ │ ├── record/ │ │ │ ├── A.java │ │ │ ├── AAAA.java │ │ │ ├── CNAME.java │ │ │ ├── DLV.java │ │ │ ├── DNAME.java │ │ │ ├── DNSKEY.java │ │ │ ├── DS.java │ │ │ ├── Data.java │ │ │ ├── DelegatingDnssecRR.java │ │ │ ├── InternetAddressRR.java │ │ │ ├── MX.java │ │ │ ├── NS.java │ │ │ ├── NSEC.java │ │ │ ├── NSEC3.java │ │ │ ├── NSEC3PARAM.java │ │ │ ├── OPENPGPKEY.java │ │ │ ├── OPT.java │ │ │ ├── PTR.java │ │ │ ├── RRSIG.java │ │ │ ├── RRWithTarget.java │ │ │ ├── Record.java │ │ │ ├── SOA.java │ │ │ ├── SRV.java │ │ │ ├── TLSA.java │ │ │ ├── TXT.java │ │ │ └── UNKNOWN.java │ │ └── util/ │ │ ├── Base32.java │ │ ├── Base64.java │ │ ├── CallbackRecipient.java │ │ ├── CollectionsUtil.java │ │ ├── ExceptionCallback.java │ │ ├── Hex.java │ │ ├── InetAddressUtil.java │ │ ├── MultipleIoException.java │ │ ├── NameUtil.java │ │ ├── PlatformDetection.java │ │ ├── SafeCharSequence.java │ │ ├── SrvUtil.java │ │ └── SuccessCallback.java │ └── test/ │ ├── java/ │ │ └── org/ │ │ └── minidns/ │ │ ├── Assert.java │ │ ├── dnslabel/ │ │ │ └── DnsLabelTest.java │ │ ├── dnsmessage/ │ │ │ └── DnsMessageTest.java │ │ ├── dnsname/ │ │ │ └── DnsNameTest.java │ │ ├── record/ │ │ │ ├── RecordsTest.java │ │ │ └── TLSATest.java │ │ └── util/ │ │ ├── Base32Test.java │ │ ├── Base64Test.java │ │ ├── InetAddressUtilTest.java │ │ ├── NameUtilTest.java │ │ └── SrvUtilTest.java │ └── resources/ │ └── org/ │ └── minidns/ │ └── dnsmessage/ │ ├── codinghorror-txt │ ├── com-ds-rrsig │ ├── com-ns │ ├── com-nsec3 │ ├── example-nsec │ ├── gmail-domainkey-txt │ ├── gmail-mx │ ├── google-aaaa │ ├── gpn-srv │ ├── oracle-soa │ ├── root-dnskey │ └── sun-a ├── minidns-dane/ │ ├── build.gradle │ └── src/ │ ├── main/ │ │ └── java/ │ │ └── org/ │ │ └── minidns/ │ │ └── dane/ │ │ └── java7/ │ │ └── DaneExtendedTrustManager.java │ └── test/ │ └── java/ │ └── org/ │ └── minidns/ │ └── dane/ │ └── java7/ │ └── DaneJava7Test.java ├── minidns-dnssec/ │ ├── build.gradle │ └── src/ │ ├── main/ │ │ ├── java/ │ │ │ └── org/ │ │ │ └── minidns/ │ │ │ ├── dane/ │ │ │ │ ├── DaneCertificateException.java │ │ │ │ ├── DaneVerifier.java │ │ │ │ ├── ExpectingTrustManager.java │ │ │ │ └── X509TrustManagerUtil.java │ │ │ └── dnssec/ │ │ │ ├── DigestCalculator.java │ │ │ ├── DnssecClient.java │ │ │ ├── DnssecQueryResult.java │ │ │ ├── DnssecResultNotAuthenticException.java │ │ │ ├── DnssecUnverifiedReason.java │ │ │ ├── DnssecValidationFailedException.java │ │ │ ├── DnssecValidatorInitializationException.java │ │ │ ├── SignatureVerifier.java │ │ │ ├── Verifier.java │ │ │ └── algorithms/ │ │ │ ├── AlgorithmMap.java │ │ │ ├── DsaSignatureVerifier.java │ │ │ ├── EcdsaSignatureVerifier.java │ │ │ ├── EcgostSignatureVerifier.java │ │ │ ├── JavaSecDigestCalculator.java │ │ │ ├── JavaSecSignatureVerifier.java │ │ │ └── RsaSignatureVerifier.java │ │ └── resources/ │ │ └── .keep-minidns-dnssec-main-resources │ └── test/ │ ├── java/ │ │ └── org/ │ │ └── minidns/ │ │ └── dnssec/ │ │ ├── DnssecClientTest.java │ │ ├── DnssecWorld.java │ │ ├── VerifierTest.java │ │ └── algorithms/ │ │ ├── AlgorithmTest.java │ │ ├── DigestTest.java │ │ ├── DsaSingatureVerifierTest.java │ │ ├── RsaSignatureVerifierTest.java │ │ └── SignatureVerifierTest.java │ └── resources/ │ └── .keep-minidns-dnssec-test-resources ├── minidns-hla/ │ ├── build.gradle │ └── src/ │ ├── main/ │ │ └── java/ │ │ └── org/ │ │ └── minidns/ │ │ └── hla/ │ │ ├── DnssecResolverApi.java │ │ ├── ResolutionUnsuccessfulException.java │ │ ├── ResolverApi.java │ │ ├── ResolverResult.java │ │ ├── SrvResolverResult.java │ │ └── srv/ │ │ ├── SrvProto.java │ │ ├── SrvService.java │ │ ├── SrvServiceProto.java │ │ └── SrvType.java │ └── test/ │ └── java/ │ └── org/ │ └── minidns/ │ └── hla/ │ └── MiniDnsHlaTest.java ├── minidns-integration-test/ │ ├── build.gradle │ └── src/ │ ├── main/ │ │ └── java/ │ │ └── org/ │ │ └── minidns/ │ │ ├── integrationtest/ │ │ │ ├── AsyncApiTest.java │ │ │ ├── CoreTest.java │ │ │ ├── DaneTest.java │ │ │ ├── DnssecTest.java │ │ │ ├── HlaTest.java │ │ │ ├── IntegrationTest.java │ │ │ ├── IntegrationTestHelper.java │ │ │ ├── IntegrationTestTools.java │ │ │ ├── IterativeDnssecTest.java │ │ │ └── NsidTest.java │ │ └── jul/ │ │ └── MiniDnsJul.java │ └── test/ │ └── java/ │ └── org/ │ └── minidns/ │ └── integrationtest/ │ └── IntegrationTestTest.java ├── minidns-iterative-resolver/ │ ├── build.gradle │ └── src/ │ ├── main/ │ │ └── java/ │ │ └── org/ │ │ └── minidns/ │ │ └── iterative/ │ │ ├── IterativeClientException.java │ │ ├── IterativeDnsClient.java │ │ ├── ReliableDnsClient.java │ │ └── ResolutionState.java │ └── test/ │ └── java/ │ └── org/ │ └── minidns/ │ └── iterative/ │ └── IterativeDnsClientTest.java ├── minidns-repl/ │ ├── build.gradle │ ├── scala.repl │ └── src/ │ ├── main/ │ │ └── java/ │ │ └── org/ │ │ └── minidns/ │ │ └── minidnsrepl/ │ │ ├── DnssecStats.java │ │ ├── MiniDnsRepl.java │ │ └── MiniDnsStats.java │ └── test/ │ └── java/ │ └── org/ │ └── minidns/ │ └── minidnsrepl/ │ └── ReplTest.java ├── misc/ │ ├── resolve.pl │ └── sbt/ │ ├── .gitignore │ └── build.sbt ├── repl ├── settings.gradle └── version
SYMBOL INDEX (1512 symbols across 172 files)
FILE: minidns-android23/src/main/java/org/minidns/dnsserverlookup/android21/AndroidUsingLinkProperties.java
class AndroidUsingLinkProperties (line 36) | public class AndroidUsingLinkProperties extends AbstractDnsServerLookupM...
method setup (line 47) | public static AndroidUsingLinkProperties setup(Context context) {
method AndroidUsingLinkProperties (line 58) | public AndroidUsingLinkProperties(Context context) {
method isAvailable (line 63) | @Override
method getDnsServerAddressesOfActiveNetwork (line 68) | @TargetApi(Build.VERSION_CODES.M)
method getDnsServerAddresses (line 89) | @Override
method hasDefaultRoute (line 125) | @TargetApi(Build.VERSION_CODES.LOLLIPOP)
FILE: minidns-android23/src/test/java/org/minidns/dnsserverlookup/android21/AndroidUsingLinkPropertiesTest.java
class AndroidUsingLinkPropertiesTest (line 15) | public class AndroidUsingLinkPropertiesTest {
method nopTest (line 20) | @Test
FILE: minidns-async/src/main/java/org/minidns/source/async/AsyncDnsRequest.java
class AsyncDnsRequest (line 43) | public class AsyncDnsRequest {
method cancel (line 48) | @SuppressWarnings("UnsynchronizedOverridesSynchronized")
method AsyncDnsRequest (line 87) | AsyncDnsRequest(DnsMessage request, InetAddress inetAddress, int port,...
method ensureWriteBufferIsInitialized (line 110) | private void ensureWriteBufferIsInitialized() {
method cancelAsyncDnsRequest (line 120) | private synchronized void cancelAsyncDnsRequest() {
method registerWithSelector (line 127) | private synchronized void registerWithSelector(SelectableChannel chann...
method addException (line 135) | private void addException(IOException e) {
method gotResult (line 142) | private void gotResult(DnsQueryResult result) {
method getFuture (line 150) | MiniDnsFuture<DnsQueryResult, IOException> getFuture() {
method wasDeadlineMissedAndFutureNotified (line 154) | boolean wasDeadlineMissedAndFutureNotified() {
method startHandling (line 163) | void startHandling() {
method abortRequestAndCleanup (line 171) | private void abortRequestAndCleanup(Channel channel, String errorMessa...
method abortUdpRequestAndCleanup (line 194) | private void abortUdpRequestAndCleanup(DatagramChannel datagramChannel...
method startUdpRequest (line 199) | private void startUdpRequest() {
class UdpWritableChannelSelectedHandler (line 236) | class UdpWritableChannelSelectedHandler extends ChannelSelectedHandler {
method UdpWritableChannelSelectedHandler (line 238) | UdpWritableChannelSelectedHandler(Future<?> future) {
method handleChannelSelectedAndNotCancelled (line 242) | @Override
class UdpReadableChannelSelectedHandler (line 274) | class UdpReadableChannelSelectedHandler extends ChannelSelectedHandler {
method UdpReadableChannelSelectedHandler (line 276) | UdpReadableChannelSelectedHandler(Future<?> future) {
method handleChannelSelectedAndNotCancelled (line 282) | @Override
method abortTcpRequestAndCleanup (line 326) | private void abortTcpRequestAndCleanup(SocketChannel socketChannel, St...
method startTcpRequest (line 331) | private void startTcpRequest() {
class TcpConnectedChannelSelectedHandler (line 362) | class TcpConnectedChannelSelectedHandler extends ChannelSelectedHandler {
method TcpConnectedChannelSelectedHandler (line 364) | TcpConnectedChannelSelectedHandler(Future<?> future) {
method handleChannelSelectedAndNotCancelled (line 368) | @Override
class TcpWritableChannelSelectedHandler (line 392) | class TcpWritableChannelSelectedHandler extends ChannelSelectedHandler {
method TcpWritableChannelSelectedHandler (line 394) | TcpWritableChannelSelectedHandler(Future<?> future) {
method handleChannelSelectedAndNotCancelled (line 403) | @Override
method moreToWrite (line 445) | private boolean moreToWrite() {
class TcpReadableChannelSelectedHandler (line 455) | class TcpReadableChannelSelectedHandler extends ChannelSelectedHandler {
method TcpReadableChannelSelectedHandler (line 457) | TcpReadableChannelSelectedHandler(Future<?> future) {
method handleChannelSelectedAndNotCancelled (line 465) | @Override
FILE: minidns-async/src/main/java/org/minidns/source/async/AsyncNetworkDataSource.java
class AsyncNetworkDataSource (line 43) | public class AsyncNetworkDataSource extends AbstractDnsDataSource {
method compare (line 63) | @Override
method queryAsync (line 90) | @Override
method query (line 101) | @Override
method registerWithSelector (line 119) | SelectionKey registerWithSelector(SelectableChannel channel, int ops, ...
method finished (line 129) | void finished(AsyncDnsRequest asyncDnsRequest) {
method cancelled (line 135) | void cancelled(AsyncDnsRequest asyncDnsRequest) {
class Reactor (line 141) | private static final class Reactor implements Runnable {
method run (line 142) | @Override
method handleSelectedKeys (line 154) | private static void handleSelectedKeys(Collection<SelectionKey> sele...
method performSelect (line 162) | @SuppressWarnings({"LockNotBeforeTry", "MixedMutabilityReturnType"})
method handlePendingSelectionKeys (line 251) | private static void handlePendingSelectionKeys() {
method handleIncomingRequests (line 276) | private static void handleIncomingRequests() {
FILE: minidns-async/src/main/java/org/minidns/source/async/ChannelSelectedHandler.java
class ChannelSelectedHandler (line 20) | abstract class ChannelSelectedHandler {
method ChannelSelectedHandler (line 26) | ChannelSelectedHandler(Future<?> future) {
method handleChannelSelected (line 30) | void handleChannelSelected(SelectableChannel channel, SelectionKey sel...
method handleChannelSelectedAndNotCancelled (line 42) | protected abstract void handleChannelSelectedAndNotCancelled(Selectabl...
FILE: minidns-async/src/test/java/org/minidns/source/async/AsyncNetworkDataSourceTest.java
class AsyncNetworkDataSourceTest (line 15) | public class AsyncNetworkDataSourceTest {
method nopTest (line 20) | @Test
FILE: minidns-client/src/main/java/org/minidns/AbstractDnsClient.java
class AbstractDnsClient (line 44) | public abstract class AbstractDnsClient {
method onResponse (line 55) | @Override
type IpVersionSetting (line 78) | public enum IpVersionSetting {
method IpVersionSetting (line 89) | IpVersionSetting(boolean v4, boolean v6) {
method setDefaultIpVersion (line 98) | public static void setDefaultIpVersion(IpVersionSetting preferedIpVers...
method setPreferedIpVersion (line 107) | public void setPreferedIpVersion(IpVersionSetting preferedIpVersion) {
method getPreferedIpVersion (line 114) | public IpVersionSetting getPreferedIpVersion() {
method AbstractDnsClient (line 123) | protected AbstractDnsClient(DnsCache cache) {
method AbstractDnsClient (line 137) | protected AbstractDnsClient() {
method query (line 153) | public final DnsQueryResult query(String name, TYPE type, CLASS clazz)...
method query (line 167) | public final DnsQueryResult query(DnsName name, TYPE type) throws IOEx...
method query (line 181) | public final DnsQueryResult query(CharSequence name, TYPE type) throws...
method query (line 186) | public DnsQueryResult query(Question q) throws IOException {
method query (line 198) | protected abstract DnsQueryResult query(DnsMessage.Builder query) thro...
method queryAsync (line 200) | public final MiniDnsFuture<DnsQueryResult, IOException> queryAsync(Cha...
method queryAsync (line 205) | public final MiniDnsFuture<DnsQueryResult, IOException> queryAsync(Que...
method queryAsync (line 219) | protected MiniDnsFuture<DnsQueryResult, IOException> queryAsync(DnsMes...
method query (line 232) | public final DnsQueryResult query(Question q, InetAddress server, int ...
method query (line 237) | public final DnsQueryResult query(DnsMessage requestMessage, InetAddre...
method queryAsync (line 263) | public final MiniDnsFuture<DnsQueryResult, IOException> queryAsync(Dns...
method isResponseCacheable (line 285) | protected boolean isResponseCacheable(Question q, DnsQueryResult resul...
method buildMessage (line 301) | final DnsMessage.Builder buildMessage(Question question) {
method newQuestion (line 309) | protected abstract DnsMessage.Builder newQuestion(DnsMessage.Builder q...
method query (line 322) | public DnsQueryResult query(String name, TYPE type, CLASS clazz, InetA...
method query (line 338) | public DnsQueryResult query(String name, TYPE type, CLASS clazz, InetA...
method query (line 353) | public DnsQueryResult query(String name, TYPE type, InetAddress address)
method query (line 359) | public final DnsQueryResult query(DnsMessage query, InetAddress host) ...
method query (line 371) | public DnsQueryResult query(Question q, InetAddress address) throws IO...
method queryAsync (line 375) | public final MiniDnsFuture<DnsQueryResult, IOException> queryAsync(Dns...
method getDataSource (line 384) | public DnsDataSource getDataSource() {
method setDataSource (line 397) | public void setDataSource(DnsDataSource dataSource) {
method getCache (line 409) | public DnsCache getCache() {
method getQueryFor (line 413) | protected DnsMessage getQueryFor(Question q) {
method getCachedRecordsFor (line 419) | private <D extends Data> Set<D> getCachedRecordsFor(DnsName dnsName, T...
method getCachedNameserverRecordsFor (line 433) | public Set<NS> getCachedNameserverRecordsFor(DnsName dnsName) {
method getCachedIPv4AddressesFor (line 437) | public Set<A> getCachedIPv4AddressesFor(DnsName dnsName) {
method getCachedIPv6AddressesFor (line 441) | public Set<AAAA> getCachedIPv6AddressesFor(DnsName dnsName) {
method getCachedIPNameserverAddressesFor (line 445) | @SuppressWarnings("unchecked")
method getCachedIPv4NameserverAddressesFor (line 470) | public Set<A> getCachedIPv4NameserverAddressesFor(DnsName dnsName) {
method getCachedIPv6NameserverAddressesFor (line 474) | public Set<AAAA> getCachedIPv6NameserverAddressesFor(DnsName dnsName) {
FILE: minidns-client/src/main/java/org/minidns/DnsCache.java
class DnsCache (line 21) | public abstract class DnsCache {
method put (line 31) | public final void put(DnsMessage query, DnsQueryResult result) {
method putNormalized (line 35) | protected abstract void putNormalized(DnsMessage normalizedQuery, DnsQ...
method offer (line 37) | public abstract void offer(DnsMessage query, DnsQueryResult result, Dn...
method get (line 44) | public final CachedDnsQueryResult get(DnsMessage query) {
method getNormalized (line 48) | protected abstract CachedDnsQueryResult getNormalized(DnsMessage norma...
FILE: minidns-client/src/main/java/org/minidns/DnsClient.java
class DnsClient (line 47) | public class DnsClient extends AbstractDnsClient {
method DnsClient (line 86) | public DnsClient() {
method DnsClient (line 90) | public DnsClient(DnsCache dnsCache) {
method newQuestion (line 94) | @Override
method getServerAddresses (line 101) | private List<InetAddress> getServerAddresses() {
method query (line 134) | @Override
method queryAsync (line 204) | @Override
method findDNS (line 249) | public static List<String> findDNS() {
method findDnsAddresses (line 324) | public static List<InetAddress> findDnsAddresses() {
method addDnsServerLookupMechanism (line 397) | public static void addDnsServerLookupMechanism(DnsServerLookupMechanis...
method removeDNSServerLookupMechanism (line 419) | public static boolean removeDNSServerLookupMechanism(DnsServerLookupMe...
method addBlacklistedDnsServer (line 425) | public static boolean addBlacklistedDnsServer(String dnsServer) {
method removeBlacklistedDnsServer (line 429) | public static boolean removeBlacklistedDnsServer(String dnsServer) {
method isAskForDnssec (line 433) | public boolean isAskForDnssec() {
method setAskForDnssec (line 437) | public void setAskForDnssec(boolean askForDnssec) {
method isDisableResultFilter (line 441) | public boolean isDisableResultFilter() {
method setDisableResultFilter (line 445) | public void setDisableResultFilter(boolean disableResultFilter) {
method isUseHardcodedDnsServersEnabled (line 449) | public boolean isUseHardcodedDnsServersEnabled() {
method setUseHardcodedDnsServers (line 453) | public void setUseHardcodedDnsServers(boolean useHardcodedDnsServers) {
method getRandomHardcodedIpv4DnsServer (line 457) | public InetAddress getRandomHardcodedIpv4DnsServer() {
method getRandomHarcodedIpv6DnsServer (line 461) | public InetAddress getRandomHarcodedIpv6DnsServer() {
method getReverseIpLookupQuestionFor (line 465) | private static Question getReverseIpLookupQuestionFor(DnsName dnsName) {
method getReverseIpLookupQuestionFor (line 469) | public static Question getReverseIpLookupQuestionFor(Inet4Address inet...
method getReverseIpLookupQuestionFor (line 475) | public static Question getReverseIpLookupQuestionFor(Inet6Address inet...
method getReverseIpLookupQuestionFor (line 481) | public static Question getReverseIpLookupQuestionFor(InetAddress inetA...
FILE: minidns-client/src/main/java/org/minidns/MiniDnsConfiguration.java
class MiniDnsConfiguration (line 13) | public class MiniDnsConfiguration {
method getVersion (line 15) | public static String getVersion() {
FILE: minidns-client/src/main/java/org/minidns/MiniDnsException.java
class MiniDnsException (line 18) | public abstract class MiniDnsException extends IOException {
method MiniDnsException (line 24) | protected MiniDnsException(String message) {
class IdMismatch (line 28) | public static class IdMismatch extends MiniDnsException {
method IdMismatch (line 38) | public IdMismatch(DnsMessage request, DnsMessage response) {
method getRequest (line 45) | public DnsMessage getRequest() {
method getResponse (line 49) | public DnsMessage getResponse() {
method getString (line 53) | private static String getString(DnsMessage request, DnsMessage respo...
class NullResultException (line 58) | public static class NullResultException extends MiniDnsException {
method NullResultException (line 67) | public NullResultException(DnsMessage request) {
method getRequest (line 72) | public DnsMessage getRequest() {
class ErrorResponseException (line 77) | public static class ErrorResponseException extends MiniDnsException {
method ErrorResponseException (line 87) | public ErrorResponseException(DnsMessage request, DnsQueryResult res...
method getRequest (line 93) | public DnsMessage getRequest() {
method getResult (line 97) | public DnsQueryResult getResult() {
class NoQueryPossibleException (line 102) | public static class NoQueryPossibleException extends MiniDnsException {
method NoQueryPossibleException (line 111) | public NoQueryPossibleException(DnsMessage request) {
method getRequest (line 116) | public DnsMessage getRequest() {
FILE: minidns-client/src/main/java/org/minidns/MiniDnsFuture.java
class MiniDnsFuture (line 35) | public abstract class MiniDnsFuture<V, E extends Exception> implements F...
method cancel (line 47) | @Override
method isCancelled (line 62) | @Override
method isDone (line 67) | @Override
method hasResult (line 72) | public final synchronized boolean hasResult() {
method hasException (line 76) | public final synchronized boolean hasException() {
method onSuccess (line 80) | @Override
method onError (line 87) | @Override
method getOrThrowExecutionException (line 94) | private V getOrThrowExecutionException() throws ExecutionException {
method get (line 107) | @Override
method getOrThrow (line 116) | public final synchronized V getOrThrow() throws E {
method get (line 137) | @Override
method newThread (line 163) | @Override
method rejectedExecution (line 173) | @Override
method maybeInvokeCallbacks (line 186) | @SuppressWarnings("FutureReturnValueIgnored")
class InternalMiniDnsFuture (line 209) | public static class InternalMiniDnsFuture<V, E extends Exception> exte...
method setResult (line 210) | public final synchronized void setResult(V result) {
method setException (line 221) | public final synchronized void setException(E exception) {
method from (line 233) | public static <V, E extends Exception> MiniDnsFuture<V, E> from(V resu...
method anySuccessfulOf (line 239) | public static <V> MiniDnsFuture<V, IOException> anySuccessfulOf(Collec...
type ExceptionsWrapper (line 243) | public interface ExceptionsWrapper<EI extends Exception, EO extends Ex...
method wrap (line 244) | EO wrap(List<EI> exceptions);
method anySuccessfulOf (line 247) | public static <V, EI extends Exception, EO extends Exception> MiniDnsF...
FILE: minidns-client/src/main/java/org/minidns/MiniDnsInitialization.java
class MiniDnsInitialization (line 21) | public class MiniDnsInitialization {
FILE: minidns-client/src/main/java/org/minidns/RrSet.java
class RrSet (line 23) | public final class RrSet {
method RrSet (line 30) | private RrSet(DnsName name, TYPE type, CLASS clazz, Set<Record<? exten...
method toString (line 37) | @Override
method builder (line 47) | public static Builder builder() {
class Builder (line 51) | public static final class Builder {
method Builder (line 57) | private Builder() {
method addRecord (line 60) | public Builder addRecord(Record<? extends Data> record) {
method couldContain (line 76) | public boolean couldContain(Record<? extends Data> record) {
method addIfPossible (line 83) | public boolean addIfPossible(Record<? extends Data> record) {
method build (line 91) | public RrSet build() {
FILE: minidns-client/src/main/java/org/minidns/cache/ExtendedLruCache.java
class ExtendedLruCache (line 31) | public class ExtendedLruCache extends LruCache {
method ExtendedLruCache (line 33) | public ExtendedLruCache() {
method ExtendedLruCache (line 37) | public ExtendedLruCache(int capacity) {
method ExtendedLruCache (line 41) | public ExtendedLruCache(int capacity, long maxTTL) {
method putNormalized (line 45) | @SuppressWarnings("UnsynchronizedOverridesSynchronized")
method offer (line 59) | @Override
method gather (line 74) | private void gather(Map<DnsMessage, List<Record<?extends Data>>> extra...
method putExtraCaches (line 102) | private void putExtraCaches(DnsQueryResult synthesynthesizationSource,...
method shouldGather (line 118) | protected boolean shouldGather(Record<? extends Data> extraRecord, Que...
FILE: minidns-client/src/main/java/org/minidns/cache/FullLruCache.java
class FullLruCache (line 21) | public class FullLruCache extends ExtendedLruCache {
method FullLruCache (line 23) | public FullLruCache() {
method FullLruCache (line 27) | public FullLruCache(int capacity) {
method FullLruCache (line 31) | public FullLruCache(int capacity, long maxTTL) {
method shouldGather (line 35) | @Override
FILE: minidns-client/src/main/java/org/minidns/cache/LruCache.java
class LruCache (line 26) | public class LruCache extends DnsCache {
method LruCache (line 63) | @SuppressWarnings("serial")
method LruCache (line 81) | public LruCache(final int capacity) {
method LruCache (line 85) | public LruCache() {
method putNormalized (line 89) | @Override
method getNormalized (line 97) | @Override
method clear (line 128) | public synchronized void clear() {
method getMissCount (line 140) | public long getMissCount() {
method getExpireCount (line 149) | public long getExpireCount() {
method getHitCount (line 157) | public long getHitCount() {
method toString (line 161) | @Override
method offer (line 166) | @Override
FILE: minidns-client/src/main/java/org/minidns/cache/MiniDnsCacheFactory.java
type MiniDnsCacheFactory (line 15) | public interface MiniDnsCacheFactory {
method newCache (line 17) | DnsCache newCache();
FILE: minidns-client/src/main/java/org/minidns/dnsqueryresult/CachedDnsQueryResult.java
class CachedDnsQueryResult (line 15) | public abstract class CachedDnsQueryResult extends DnsQueryResult {
method CachedDnsQueryResult (line 19) | protected CachedDnsQueryResult(DnsMessage query, DnsQueryResult cached...
method CachedDnsQueryResult (line 24) | protected CachedDnsQueryResult(DnsMessage query, DnsMessage response, ...
FILE: minidns-client/src/main/java/org/minidns/dnsqueryresult/DirectCachedDnsQueryResult.java
class DirectCachedDnsQueryResult (line 15) | public class DirectCachedDnsQueryResult extends CachedDnsQueryResult {
method DirectCachedDnsQueryResult (line 17) | public DirectCachedDnsQueryResult(DnsMessage query, DnsQueryResult cac...
FILE: minidns-client/src/main/java/org/minidns/dnsqueryresult/DnsQueryResult.java
class DnsQueryResult (line 16) | public abstract class DnsQueryResult {
type QueryMethod (line 18) | public enum QueryMethod {
method DnsQueryResult (line 34) | protected DnsQueryResult(QueryMethod queryMethod, DnsMessage query, Dn...
method toString (line 44) | @Override
method wasSuccessful (line 49) | public boolean wasSuccessful() {
FILE: minidns-client/src/main/java/org/minidns/dnsqueryresult/StandardDnsQueryResult.java
class StandardDnsQueryResult (line 17) | public class StandardDnsQueryResult extends DnsQueryResult {
method StandardDnsQueryResult (line 23) | public StandardDnsQueryResult(InetAddress serverAddress, int port, Que...
FILE: minidns-client/src/main/java/org/minidns/dnsqueryresult/SynthesizedCachedDnsQueryResult.java
class SynthesizedCachedDnsQueryResult (line 15) | public class SynthesizedCachedDnsQueryResult extends CachedDnsQueryResult {
method SynthesizedCachedDnsQueryResult (line 17) | public SynthesizedCachedDnsQueryResult(DnsMessage query, DnsMessage re...
FILE: minidns-client/src/main/java/org/minidns/dnsserverlookup/AbstractDnsServerLookupMechanism.java
class AbstractDnsServerLookupMechanism (line 19) | public abstract class AbstractDnsServerLookupMechanism implements DnsSer...
method AbstractDnsServerLookupMechanism (line 26) | protected AbstractDnsServerLookupMechanism(String name, int priority) {
method getName (line 31) | @Override
method getPriority (line 36) | @Override
method compareTo (line 41) | @Override
method getDnsServerAddresses (line 49) | @Override
method toListOfStrings (line 52) | protected static List<String> toListOfStrings(Collection<? extends Ine...
FILE: minidns-client/src/main/java/org/minidns/dnsserverlookup/AndroidUsingExec.java
class AndroidUsingExec (line 32) | public final class AndroidUsingExec extends AbstractDnsServerLookupMecha...
method AndroidUsingExec (line 37) | private AndroidUsingExec() {
method getDnsServerAddresses (line 41) | @Override
method isAvailable (line 60) | @Override
method parseProps (line 66) | static Set<String> parseProps(BufferedReader lnr, boolean logWarning) ...
FILE: minidns-client/src/main/java/org/minidns/dnsserverlookup/AndroidUsingReflection.java
class AndroidUsingReflection (line 26) | public class AndroidUsingReflection extends AbstractDnsServerLookupMecha...
method AndroidUsingReflection (line 33) | protected AndroidUsingReflection() {
method getDnsServerAddresses (line 48) | @Override
method isAvailable (line 93) | @Override
FILE: minidns-client/src/main/java/org/minidns/dnsserverlookup/DnsServerLookupMechanism.java
type DnsServerLookupMechanism (line 15) | public interface DnsServerLookupMechanism extends Comparable<DnsServerLo...
method getName (line 17) | String getName();
method getPriority (line 19) | int getPriority();
method isAvailable (line 21) | boolean isAvailable();
method getDnsServerAddresses (line 32) | List<String> getDnsServerAddresses();
FILE: minidns-client/src/main/java/org/minidns/dnsserverlookup/UnixUsingEtcResolvConf.java
class UnixUsingEtcResolvConf (line 28) | public final class UnixUsingEtcResolvConf extends AbstractDnsServerLooku...
method UnixUsingEtcResolvConf (line 41) | private UnixUsingEtcResolvConf() {
method getDnsServerAddresses (line 45) | @Override
method isAvailable (line 91) | @Override
FILE: minidns-client/src/main/java/org/minidns/source/AbstractDnsDataSource.java
class AbstractDnsDataSource (line 22) | public abstract class AbstractDnsDataSource implements DnsDataSource {
method query (line 24) | @Override
method queryAsync (line 27) | @Override
method getTimeout (line 48) | @Override
method setTimeout (line 53) | @Override
method getUdpPayloadSize (line 61) | @Override
method setUdpPayloadSize (line 66) | public void setUdpPayloadSize(int udpPayloadSize) {
method cacheResult (line 75) | protected final void cacheResult(DnsMessage request, DnsQueryResult re...
type QueryMode (line 83) | public enum QueryMode {
method setQueryMode (line 102) | public void setQueryMode(QueryMode queryMode) {
method getQueryMode (line 109) | public QueryMode getQueryMode() {
FILE: minidns-client/src/main/java/org/minidns/source/DnsDataSource.java
type DnsDataSource (line 20) | public interface DnsDataSource {
method query (line 22) | DnsQueryResult query(DnsMessage message, InetAddress address, int port...
method queryAsync (line 24) | MiniDnsFuture<DnsQueryResult, IOException> queryAsync(DnsMessage messa...
method getUdpPayloadSize (line 26) | int getUdpPayloadSize();
method getTimeout (line 33) | int getTimeout();
method setTimeout (line 41) | void setTimeout(int timeout);
type OnResponseCallback (line 43) | interface OnResponseCallback {
method onResponse (line 44) | void onResponse(DnsMessage request, DnsQueryResult result);
FILE: minidns-client/src/main/java/org/minidns/source/NetworkDataSource.java
class NetworkDataSource (line 34) | public class NetworkDataSource extends AbstractDnsDataSource {
method query (line 39) | @Override
method queryUdp (line 85) | protected DnsMessage queryUdp(DnsMessage message, InetAddress address,...
method queryTcp (line 109) | protected DnsMessage queryTcp(DnsMessage message, InetAddress address,...
method createSocket (line 145) | protected Socket createSocket() {
method createDatagramSocket (line 155) | protected DatagramSocket createDatagramSocket() throws SocketException {
FILE: minidns-client/src/main/java/org/minidns/source/NetworkDataSourceWithAccounting.java
class NetworkDataSourceWithAccounting (line 22) | public class NetworkDataSourceWithAccounting extends NetworkDataSource {
method query (line 36) | @Override
method queryUdp (line 52) | @Override
method queryTcp (line 68) | @Override
method getStats (line 84) | public Stats getStats() {
method from (line 88) | public static NetworkDataSourceWithAccounting from(AbstractDnsClient c...
class Stats (line 96) | public static final class Stats {
method Stats (line 114) | private Stats(NetworkDataSourceWithAccounting ndswa) {
method toString (line 133) | @Override
method toString (line 156) | private static String toString(int i) {
FILE: minidns-client/src/test/java/org/minidns/DnsClientTest.java
class DnsClientTest (line 41) | public class DnsClientTest {
method testLookupMechanismOrder (line 43) | @Test
class TestDnsServerLookupMechanism (line 63) | private static class TestDnsServerLookupMechanism extends AbstractDnsS...
method TestDnsServerLookupMechanism (line 64) | protected TestDnsServerLookupMechanism(DnsServerLookupMechanism look...
method isAvailable (line 67) | @Override
method getDnsServerAddresses (line 71) | @Override
method testSingleRecordQuery (line 77) | @Test
method testReturnNullSource (line 95) | @Test
FILE: minidns-client/src/test/java/org/minidns/DnsWorld.java
class DnsWorld (line 57) | public class DnsWorld extends AbstractDnsDataSource {
method query (line 62) | @Override
method addPreparedResponse (line 86) | public void addPreparedResponse(PreparedResponse answer) {
type PreparedResponse (line 90) | public interface PreparedResponse {
method isResponse (line 91) | boolean isResponse(DnsMessage request, InetAddress address);
method getResponse (line 93) | DnsMessage getResponse();
class AnswerResponse (line 96) | public static class AnswerResponse implements PreparedResponse {
method AnswerResponse (line 100) | public AnswerResponse(DnsMessage request, DnsMessage response) {
method isResponse (line 105) | @Override
method getResponse (line 116) | @Override
method hasQuestion (line 121) | private static boolean hasQuestion(Collection<Question> questions, Q...
method toString (line 131) | @Override
class RootAnswerResponse (line 139) | public static class RootAnswerResponse extends AnswerResponse {
method RootAnswerResponse (line 141) | public RootAnswerResponse(DnsMessage request, DnsMessage response) {
method isResponse (line 145) | @Override
method toString (line 150) | @Override
class AddressedAnswerResponse (line 156) | public static class AddressedAnswerResponse extends AnswerResponse {
method AddressedAnswerResponse (line 160) | public AddressedAnswerResponse(InetAddress address, DnsMessage reque...
method isResponse (line 165) | @Override
method toString (line 170) | @Override
class HintsResponse (line 176) | public abstract static class HintsResponse implements PreparedResponse {
method HintsResponse (line 180) | public HintsResponse(DnsName ending, DnsMessage response) {
method questionHintable (line 185) | boolean questionHintable(DnsMessage request) {
method getResponse (line 194) | @Override
method toString (line 199) | @Override
class RootHintsResponse (line 207) | public static class RootHintsResponse extends HintsResponse {
method RootHintsResponse (line 209) | public RootHintsResponse(DnsName ending, DnsMessage response) {
method isResponse (line 213) | @Override
class AddressedHintsResponse (line 224) | public static class AddressedHintsResponse extends HintsResponse {
method AddressedHintsResponse (line 227) | public AddressedHintsResponse(InetAddress address, DnsName ending, D...
method isResponse (line 232) | @Override
method toString (line 237) | @Override
class Zone (line 245) | public static class Zone {
method Zone (line 251) | public Zone(String zoneName, InetAddress address, List<Record<? exte...
method getRRSets (line 257) | public List<RrSet> getRRSets() {
method isRootZone (line 274) | boolean isRootZone() {
method applyZones (line 279) | public static DnsWorld applyZones(AbstractDnsClient client, Zone... zo...
method attachSignatures (line 325) | static void attachSignatures(DnsMessage.Builder response, List<Record<...
method attachGlues (line 348) | static void attachGlues(DnsMessage.Builder response, Collection<Record...
method findGlues (line 365) | private static List<Record<? extends Data>> findGlues(DnsName name, Li...
method applyStubRecords (line 379) | @SafeVarargs
method rootZone (line 394) | @SafeVarargs
method rootZone (line 403) | public static Zone rootZone(List<Record<? extends Data>> records) {
method zone (line 407) | @SafeVarargs
method zone (line 416) | public static Zone zone(String zoneName, String nsName, String nsIp, L...
method zone (line 426) | public static Zone zone(String zoneName, InetAddress address, List<Rec...
method record (line 430) | public static <D extends Data> Record<D> record(String name, long ttl,...
method record (line 434) | public static <D extends Data> Record<D> record(DnsName name, long ttl...
method record (line 438) | public static <D extends Data> Record<D> record(String name, D data) {
method record (line 442) | public static <D extends Data> Record<D> record(DnsName name, D data) {
method a (line 446) | public static A a(byte[] ip) {
method a (line 450) | public static A a(CharSequence ipCharSequence) {
method aaaa (line 454) | public static AAAA aaaa(byte[] ip) {
method CharSequence (line 458) | public static AAAA CharSequence(CharSequence ipCharSequence) {
method cname (line 462) | public static CNAME cname(String name) {
method cname (line 466) | public static CNAME cname(DnsName name) {
method dnskey (line 470) | public static DNSKEY dnskey(int flags, int protocol, SignatureAlgorith...
method dnskey (line 474) | public static DNSKEY dnskey(int flags, SignatureAlgorithm algorithm, b...
method ds (line 478) | public static DS ds(int keyTag, SignatureAlgorithm algorithm, DigestAl...
method ds (line 482) | public static DS ds(int keyTag, SignatureAlgorithm algorithm, byte dig...
method dlv (line 486) | public static DLV dlv(int keyTag, SignatureAlgorithm algorithm, Digest...
method mx (line 490) | public static MX mx(int priority, String name) {
method mx (line 494) | public static MX mx(int priority, DnsName name) {
method mx (line 498) | public static MX mx(String name) {
method ns (line 502) | public static NS ns(String name) {
method ns (line 506) | public static NS ns(DnsName name) {
method nsec (line 510) | public static NSEC nsec(String next, TYPE... types) {
method nsec (line 514) | public static NSEC nsec(DnsName next, TYPE... types) {
method nsec3 (line 519) | public static NSEC3 nsec3(byte hashAlgorithm, byte flags, int iteratio...
method rrsig (line 524) | public static RRSIG rrsig(TYPE typeCovered, SignatureAlgorithm algorit...
method rrsig (line 530) | public static RRSIG rrsig(TYPE typeCovered, SignatureAlgorithm algorit...
method rrsig (line 536) | public static RRSIG rrsig(TYPE typeCovered, int algorithm,
method rrsig (line 545) | public static RRSIG rrsig(TYPE typeCovered, int algorithm,
method soa (line 554) | public static SOA soa(String mname, String rname, long serial, int ref...
method soa (line 558) | public static SOA soa(DnsName mname, DnsName rname, long serial, int r...
method srv (line 562) | public static SRV srv(int priority, int weight, int port, String name) {
method srv (line 566) | public static SRV srv(int priority, int weight, int port, DnsName name) {
method srv (line 570) | public static SRV srv(int port, String name) {
method lookupRrSetFor (line 574) | public RrSet lookupRrSetFor(DnsName name, TYPE type) {
method lookupSingleAuthoritativeNameserverForZone (line 583) | public InetAddress lookupSingleAuthoritativeNameserverForZone(DnsName ...
FILE: minidns-client/src/test/java/org/minidns/LruCacheTest.java
class LruCacheTest (line 28) | public class LruCacheTest {
method testOutdatedCacheEntry (line 30) | @Test
method testOverfilledCache (line 45) | @Test
method createSampleMessage (line 71) | private static TestWorldDnsQueryResult createSampleMessage(Question qu...
method createSampleMessage (line 75) | private static TestWorldDnsQueryResult createSampleMessage(Question qu...
FILE: minidns-client/src/test/java/org/minidns/dnsqueryresult/TestWorldDnsQueryResult.java
class TestWorldDnsQueryResult (line 16) | public class TestWorldDnsQueryResult extends DnsQueryResult {
method TestWorldDnsQueryResult (line 20) | public TestWorldDnsQueryResult(DnsMessage query, DnsMessage response) {
method TestWorldDnsQueryResult (line 24) | public TestWorldDnsQueryResult(DnsMessage query, DnsMessage response, ...
FILE: minidns-client/src/test/java/org/minidns/dnsserverlookup/AndroidUsingExecTest.java
class AndroidUsingExecTest (line 24) | public class AndroidUsingExecTest {
method parsePropsWithNewlineTest (line 29) | @Test
FILE: minidns-client/src/test/java/org/minidns/source/NetworkDataSourceTest.java
class NetworkDataSourceTest (line 24) | public class NetworkDataSourceTest {
method udpTruncatedTcpFallbackTest (line 26) | @Test
FILE: minidns-core/src/main/java/org/minidns/constants/DnsRootServer.java
class DnsRootServer (line 21) | public class DnsRootServer {
method rootServerInet4Address (line 56) | private static Inet4Address rootServerInet4Address(char rootServerId, ...
method rootServerInet6Address (line 71) | private static Inet6Address rootServerInet6Address(char rootServerId, ...
method getRandomIpv4RootServer (line 91) | public static Inet4Address getRandomIpv4RootServer(Random random) {
method getRandomIpv6RootServer (line 95) | public static Inet6Address getRandomIpv6RootServer(Random random) {
method getIpv4RootServerById (line 99) | public static Inet4Address getIpv4RootServerById(char id) {
method getIpv6RootServerById (line 103) | public static Inet6Address getIpv6RootServerById(char id) {
FILE: minidns-core/src/main/java/org/minidns/constants/DnssecConstants.java
class DnssecConstants (line 16) | public final class DnssecConstants {
method DnssecConstants (line 20) | private DnssecConstants() {
type SignatureAlgorithm (line 32) | public enum SignatureAlgorithm {
method SignatureAlgorithm (line 50) | SignatureAlgorithm(int number, String description) {
method forByte (line 62) | public static SignatureAlgorithm forByte(byte b) {
type DigestAlgorithm (line 76) | public enum DigestAlgorithm {
method DigestAlgorithm (line 83) | DigestAlgorithm(int value, String description) {
method forByte (line 95) | public static DigestAlgorithm forByte(byte b) {
FILE: minidns-core/src/main/java/org/minidns/dnslabel/ALabel.java
class ALabel (line 15) | public final class ALabel extends XnLabel {
method ALabel (line 17) | ALabel(String label) {
method getInternationalizedRepresentationInternal (line 21) | @Override
FILE: minidns-core/src/main/java/org/minidns/dnslabel/DnsLabel.java
class DnsLabel (line 34) | public abstract class DnsLabel extends SafeCharSequence implements Compa...
method DnsLabel (line 52) | protected DnsLabel(String label) {
method getInternationalizedRepresentation (line 67) | public final String getInternationalizedRepresentation() {
method getInternationalizedRepresentationInternal (line 74) | protected String getInternationalizedRepresentationInternal() {
method getLabelType (line 78) | public final String getLabelType() {
method toString (line 84) | @Override
method getRawLabel (line 102) | public final String getRawLabel() {
method equals (line 106) | @Override
method hashCode (line 115) | @Override
method asLowercaseVariant (line 122) | public final DnsLabel asLowercaseVariant() {
method setBytesIfRequired (line 132) | private void setBytesIfRequired() {
method writeToBoas (line 138) | public final void writeToBoas(ByteArrayOutputStream byteArrayOutputStr...
method compareTo (line 145) | @Override
method from (line 153) | public static DnsLabel from(String label) {
method from (line 165) | public static DnsLabel[] from(String[] labels) {
method isIdnAcePrefixed (line 175) | public static boolean isIdnAcePrefixed(String string) {
method toSafeRepesentation (line 179) | public static String toSafeRepesentation(String dnsLabel) {
method isLdhOrMaybeUnderscore (line 237) | private static boolean isLdhOrMaybeUnderscore(char c, boolean undersco...
method consistsOnlyOfLdhAndMaybeUnderscore (line 248) | private static boolean consistsOnlyOfLdhAndMaybeUnderscore(String stri...
method consistsOnlyOfLettersDigitsAndHypen (line 259) | public static boolean consistsOnlyOfLettersDigitsAndHypen(String strin...
method consistsOnlyOfLettersDigitsHypenAndUnderscore (line 263) | public static boolean consistsOnlyOfLettersDigitsHypenAndUnderscore(St...
class LabelToLongException (line 267) | public static class LabelToLongException extends IllegalArgumentExcept...
method LabelToLongException (line 276) | LabelToLongException(String label) {
FILE: minidns-core/src/main/java/org/minidns/dnslabel/FakeALabel.java
class FakeALabel (line 13) | public final class FakeALabel extends XnLabel {
method FakeALabel (line 15) | FakeALabel(String label) {
FILE: minidns-core/src/main/java/org/minidns/dnslabel/LdhLabel.java
class LdhLabel (line 49) | public abstract class LdhLabel extends DnsLabel {
method LdhLabel (line 51) | protected LdhLabel(String label) {
method isLdhLabel (line 55) | public static boolean isLdhLabel(String label) {
method fromInternal (line 67) | protected static LdhLabel fromInternal(String label) {
FILE: minidns-core/src/main/java/org/minidns/dnslabel/LeadingOrTrailingHyphenLabel.java
class LeadingOrTrailingHyphenLabel (line 16) | public final class LeadingOrTrailingHyphenLabel extends NonLdhLabel {
method LeadingOrTrailingHyphenLabel (line 18) | LeadingOrTrailingHyphenLabel(String label) {
method isLeadingOrTrailingHypenLabelInternal (line 22) | static boolean isLeadingOrTrailingHypenLabelInternal(String label) {
FILE: minidns-core/src/main/java/org/minidns/dnslabel/NonLdhLabel.java
class NonLdhLabel (line 17) | public abstract class NonLdhLabel extends DnsLabel {
method NonLdhLabel (line 19) | protected NonLdhLabel(String label) {
method fromInternal (line 23) | protected static DnsLabel fromInternal(String label) {
FILE: minidns-core/src/main/java/org/minidns/dnslabel/NonReservedLdhLabel.java
class NonReservedLdhLabel (line 17) | public final class NonReservedLdhLabel extends LdhLabel {
method NonReservedLdhLabel (line 19) | NonReservedLdhLabel(String label) {
method isNonReservedLdhLabel (line 24) | public static boolean isNonReservedLdhLabel(String label) {
method isNonReservedLdhLabelInternal (line 31) | static boolean isNonReservedLdhLabelInternal(String label) {
FILE: minidns-core/src/main/java/org/minidns/dnslabel/OtherNonLdhLabel.java
class OtherNonLdhLabel (line 17) | public final class OtherNonLdhLabel extends NonLdhLabel {
method OtherNonLdhLabel (line 19) | OtherNonLdhLabel(String label) {
FILE: minidns-core/src/main/java/org/minidns/dnslabel/ReservedLdhLabel.java
class ReservedLdhLabel (line 17) | public class ReservedLdhLabel extends LdhLabel {
method ReservedLdhLabel (line 19) | protected ReservedLdhLabel(String label) {
method isReservedLdhLabel (line 24) | public static boolean isReservedLdhLabel(String label) {
method isReservedLdhLabelInternal (line 31) | static boolean isReservedLdhLabelInternal(String label) {
FILE: minidns-core/src/main/java/org/minidns/dnslabel/UnderscoreLabel.java
class UnderscoreLabel (line 17) | public final class UnderscoreLabel extends NonLdhLabel {
method UnderscoreLabel (line 19) | UnderscoreLabel(String label) {
method isUnderscoreLabelInternal (line 23) | static boolean isUnderscoreLabelInternal(String label) {
FILE: minidns-core/src/main/java/org/minidns/dnslabel/XnLabel.java
class XnLabel (line 20) | public abstract class XnLabel extends ReservedLdhLabel {
method XnLabel (line 22) | protected XnLabel(String label) {
method fromInternal (line 26) | protected static LdhLabel fromInternal(String label) {
method isXnLabel (line 38) | public static boolean isXnLabel(String label) {
method isXnLabelInternal (line 45) | static boolean isXnLabelInternal(String label) {
FILE: minidns-core/src/main/java/org/minidns/dnsmessage/DnsMessage.java
class DnsMessage (line 50) | public class DnsMessage {
type RESPONSE_CODE (line 62) | public enum RESPONSE_CODE {
method RESPONSE_CODE (line 105) | RESPONSE_CODE(int value) {
method getValue (line 114) | public byte getValue() {
method getResponseCode (line 125) | public static RESPONSE_CODE getResponseCode(int value) throws Illega...
type OPCODE (line 141) | public enum OPCODE {
method OPCODE (line 173) | @SuppressWarnings("EnumOrdinal")
method getValue (line 183) | public byte getValue() {
method getOpcode (line 195) | public static OPCODE getOpcode(int value) throws IllegalArgumentExce...
method DnsMessage (line 311) | protected DnsMessage(Builder builder) {
method DnsMessage (line 390) | public DnsMessage(byte[] data) throws IOException {
method DnsMessage (line 433) | private DnsMessage(DnsMessage message) {
method getOptRrPosition (line 452) | private static int getOptRrPosition(List<Record<? extends Data>> addit...
method toArray (line 469) | public byte[] toArray() {
method asDatagram (line 473) | public DatagramPacket asDatagram(InetAddress address, int port) {
method writeTo (line 478) | public void writeTo(OutputStream outputStream) throws IOException {
method writeTo (line 482) | public void writeTo(OutputStream outputStream, boolean writeLength) th...
method getInByteBuffer (line 491) | public ByteBuffer getInByteBuffer() {
method serialize (line 498) | private byte[] serialize() {
method calculateHeaderBitmap (line 558) | int calculateHeaderBitmap() {
method getQuestion (line 590) | public Question getQuestion() {
method copyQuestions (line 600) | public List<Question> copyQuestions() {
method copyAnswers (line 612) | public List<Record<? extends Data>> copyAnswers() {
method copyAuthority (line 624) | public List<Record<? extends Data>> copyAuthority() {
method getEdns (line 630) | public Edns getEdns() {
method getOptPseudoRecord (line 639) | @SuppressWarnings("unchecked")
method isDnssecOk (line 650) | public boolean isDnssecOk() {
method toString (line 660) | @Override
method asTerminalOutput (line 679) | @SuppressWarnings("JavaUtilDate")
method getAnswersFor (line 744) | public <D extends Data> Set<D> getAnswersFor(Question q) {
method getAnswersMinTtl (line 772) | public long getAnswersMinTtl() {
method asBuilder (line 784) | public Builder asBuilder() {
method asNormalizedVersion (line 790) | public DnsMessage asNormalizedVersion() {
method getResponseBuilder (line 797) | public Builder getResponseBuilder(RESPONSE_CODE responseCode) {
method hashCode (line 812) | @Override
type SectionName (line 821) | private enum SectionName {
method filterSectionByType (line 827) | private <D extends Data> List<Record<D>> filterSectionByType(boolean s...
method filterSectionByType (line 858) | private <D extends Data> List<Record<D>> filterSectionByType(SectionNa...
method getFirstOfType (line 862) | private <D extends Data> Record<D> getFirstOfType(SectionName sectionN...
method filterAnswerSectionBy (line 871) | public <D extends Data> List<Record<D>> filterAnswerSectionBy(Class<D>...
method filterAuthoritySectionBy (line 875) | public <D extends Data> List<Record<D>> filterAuthoritySectionBy(Class...
method filterAdditionalSectionBy (line 879) | public <D extends Data> List<Record<D>> filterAdditionalSectionBy(Clas...
method getFirstOfTypeFromAnswerSection (line 883) | public <D extends Data> Record<D> getFirstOfTypeFromAnswerSection(Clas...
method getFirstOfTypeFromAuthoritySection (line 887) | public <D extends Data> Record<D> getFirstOfTypeFromAuthoritySection(C...
method getFirstOfTypeFromAdditionalSection (line 891) | public <D extends Data> Record<D> getFirstOfTypeFromAdditionalSection(...
method equals (line 895) | @Override
method builder (line 909) | public static Builder builder() {
class Builder (line 913) | public static final class Builder {
method Builder (line 915) | private Builder() {
method Builder (line 918) | private Builder(DnsMessage message) {
method setId (line 967) | public Builder setId(int id) {
method setOpcode (line 972) | public Builder setOpcode(OPCODE opcode) {
method setResponseCode (line 977) | public Builder setResponseCode(RESPONSE_CODE responseCode) {
method setQrFlag (line 989) | public Builder setQrFlag(boolean query) {
method setAuthoritativeAnswer (line 1000) | public Builder setAuthoritativeAnswer(boolean authoritativeAnswer) {
method setTruncated (line 1011) | public Builder setTruncated(boolean truncated) {
method setRecursionDesired (line 1022) | public Builder setRecursionDesired(boolean recursionDesired) {
method setRecursionAvailable (line 1033) | public Builder setRecursionAvailable(boolean recursionAvailable) {
method setAuthenticData (line 1044) | public Builder setAuthenticData(boolean authenticData) {
method setCheckDisabled (line 1055) | @Deprecated
method setCheckingDisabled (line 1067) | public Builder setCheckingDisabled(boolean checkingDisabled) {
method copyFlagsFrom (line 1072) | public void copyFlagsFrom(DnsMessage dnsMessage) {
method setReceiveTimestamp (line 1082) | public Builder setReceiveTimestamp(long receiveTimestamp) {
method addQuestion (line 1087) | public Builder addQuestion(Question question) {
method setQuestions (line 1101) | public Builder setQuestions(List<Question> questions) {
method setQuestion (line 1112) | public Builder setQuestion(Question question) {
method addAnswer (line 1118) | public Builder addAnswer(Record<? extends Data> answer) {
method addAnswers (line 1126) | public Builder addAnswers(Collection<Record<? extends Data>> records) {
method setAnswers (line 1134) | public Builder setAnswers(Collection<Record<? extends Data>> records) {
method getAnswers (line 1140) | public List<Record<? extends Data>> getAnswers() {
method addNameserverRecords (line 1147) | public Builder addNameserverRecords(Record<? extends Data> record) {
method setNameserverRecords (line 1155) | public Builder setNameserverRecords(Collection<Record<? extends Data...
method setAdditionalResourceRecords (line 1161) | public Builder setAdditionalResourceRecords(Collection<Record<? exte...
method addAdditionalResourceRecord (line 1167) | public Builder addAdditionalResourceRecord(Record<? extends Data> re...
method addAdditionalResourceRecords (line 1175) | public Builder addAdditionalResourceRecords(List<Record<? extends Da...
method getAdditionalResourceRecords (line 1183) | public List<Record<? extends Data>> getAdditionalResourceRecords() {
method getEdnsBuilder (line 1202) | public Edns.Builder getEdnsBuilder() {
method build (line 1209) | public DnsMessage build() {
method writeToStringBuilder (line 1213) | private void writeToStringBuilder(StringBuilder sb) {
method toString (line 1273) | @Override
FILE: minidns-core/src/main/java/org/minidns/dnsmessage/Question.java
class Question (line 26) | public class Question {
method Question (line 60) | public Question(CharSequence name, TYPE type, CLASS clazz, boolean uni...
method Question (line 64) | public Question(DnsName name, TYPE type, CLASS clazz, boolean unicastQ...
method Question (line 80) | public Question(DnsName name, TYPE type, CLASS clazz) {
method Question (line 89) | public Question(DnsName name, TYPE type) {
method Question (line 99) | public Question(CharSequence name, TYPE type, CLASS clazz) {
method Question (line 108) | public Question(CharSequence name, TYPE type) {
method Question (line 118) | public Question(DataInputStream dis, byte[] data) throws IOException {
method toByteArray (line 129) | public byte[] toByteArray() {
method hashCode (line 148) | @Override
method equals (line 153) | @Override
method toString (line 166) | @Override
method asMessageBuilder (line 171) | public DnsMessage.Builder asMessageBuilder() {
method asQueryMessage (line 177) | public DnsMessage asQueryMessage() {
FILE: minidns-core/src/main/java/org/minidns/dnsname/DnsName.java
class DnsName (line 51) | public final class DnsName extends SafeCharSequence implements Serializa...
method DnsName (line 113) | private DnsName(String name) {
method DnsName (line 117) | private DnsName(String name, boolean inAce) {
method DnsName (line 148) | private DnsName(DnsLabel[] rawLabels, boolean validateMaxDnsnameLength) {
method labelsToString (line 171) | private static String labelsToString(DnsLabel[] labels, int stringLeng...
method validateMaxDnsnameLengthInOctets (line 180) | private void validateMaxDnsnameLengthInOctets() {
method writeToStream (line 187) | public void writeToStream(OutputStream os) throws IOException {
method getBytes (line 197) | public byte[] getBytes() {
method getRawBytes (line 202) | public byte[] getRawBytes() {
method setBytesIfRequired (line 211) | private void setBytesIfRequired() {
method toBytes (line 219) | private static byte[] toBytes(DnsLabel[] labels) {
method setLabelsIfRequired (line 232) | private void setLabelsIfRequired() {
method getLabels (line 244) | private static DnsLabel[] getLabels(String ace) {
method getAce (line 272) | public String getAce() {
method getRawAce (line 287) | public String getRawAce() {
method asIdn (line 291) | public String asIdn() {
method getDomainpart (line 304) | public String getDomainpart() {
method getHostpart (line 314) | public String getHostpart() {
method getHostpartLabel (line 319) | public DnsLabel getHostpartLabel() {
method setHostnameAndDomainpartIfRequired (line 324) | private void setHostnameAndDomainpartIfRequired() {
method size (line 336) | public int size() {
method toString (line 349) | @Override
method from (line 374) | public static DnsName from(CharSequence name) {
method from (line 378) | public static DnsName from(String name) {
method from (line 394) | public static DnsName from(DnsName child, DnsName parent) {
method from (line 404) | public static DnsName from(CharSequence child, DnsName parent) {
method from (line 409) | public static DnsName from(DnsLabel child, DnsName parent) {
method from (line 418) | public static DnsName from(DnsLabel grandchild, DnsLabel child, DnsNam...
method from (line 428) | public static DnsName from(DnsName... nameComponents) {
method from (line 446) | public static DnsName from(String[] parts) {
method parse (line 461) | public static DnsName parse(DataInputStream dis, byte[] data)
method parse (line 492) | @SuppressWarnings("NonApiType")
method compareTo (line 515) | @Override
method equals (line 520) | @Override
method hashCode (line 534) | @Override
method isDirectChildOf (line 543) | public boolean isDirectChildOf(DnsName parent) {
method isChildOf (line 559) | public boolean isChildOf(DnsName parent) {
method getLabelCount (line 574) | public int getLabelCount() {
method getLabels (line 585) | public DnsLabel[] getLabels() {
method getLabel (line 591) | public DnsLabel getLabel(int labelNum) {
method getRawLabels (line 602) | public DnsLabel[] getRawLabels() {
method stripToLabels (line 607) | public DnsName stripToLabels(int labelCount) {
method getParent (line 638) | public DnsName getParent() {
method isRootLabel (line 643) | public boolean isRootLabel() {
FILE: minidns-core/src/main/java/org/minidns/dnsname/InvalidDnsNameException.java
class InvalidDnsNameException (line 15) | public abstract class InvalidDnsNameException extends IllegalStateExcept...
method InvalidDnsNameException (line 21) | protected InvalidDnsNameException(String ace) {
class LabelTooLongException (line 25) | public static class LabelTooLongException extends InvalidDnsNameExcept...
method LabelTooLongException (line 33) | public LabelTooLongException(String ace, String label) {
method getMessage (line 38) | @Override
class DNSNameTooLongException (line 46) | public static class DNSNameTooLongException extends InvalidDnsNameExce...
method DNSNameTooLongException (line 54) | public DNSNameTooLongException(String ace, byte[] bytes) {
method getMessage (line 59) | @Override
FILE: minidns-core/src/main/java/org/minidns/edns/Edns.java
class Edns (line 32) | public class Edns {
type OptionCode (line 44) | public enum OptionCode {
method OptionCode (line 60) | OptionCode(int optionCode, Class<? extends EdnsOption> clazz) {
method from (line 65) | public static OptionCode from(int optionCode) {
method Edns (line 101) | public Edns(Record<OPT> optRecord) {
method Edns (line 115) | public Edns(Builder builder) {
method getEdnsOption (line 132) | @SuppressWarnings({"unchecked", "TypeParameterUnusedInFormals"})
method asRecord (line 142) | public Record<OPT> asRecord() {
method asTerminalOutput (line 154) | public String asTerminalOutput() {
method toString (line 178) | @Override
method fromRecord (line 183) | public static Edns fromRecord(Record<? extends Data> record) {
method builder (line 191) | public static Builder builder() {
class Builder (line 195) | public static final class Builder {
method Builder (line 202) | private Builder() {
method setUdpPayloadSize (line 205) | public Builder setUdpPayloadSize(int udpPayloadSize) {
method setDnssecOk (line 213) | public Builder setDnssecOk(boolean dnssecOk) {
method setDnssecOk (line 218) | public Builder setDnssecOk() {
method addEdnsOption (line 223) | public Builder addEdnsOption(EdnsOption ednsOption) {
method build (line 231) | public Edns build() {
FILE: minidns-core/src/main/java/org/minidns/edns/EdnsOption.java
class EdnsOption (line 18) | public abstract class EdnsOption {
method EdnsOption (line 25) | protected EdnsOption(int optionCode, byte[] optionData) {
method EdnsOption (line 31) | @SuppressWarnings("this-escape")
method writeToDos (line 38) | public final void writeToDos(DataOutputStream dos) throws IOException {
method getOptionCode (line 44) | public abstract OptionCode getOptionCode();
method toString (line 48) | @Override
method toStringInternal (line 56) | protected abstract CharSequence toStringInternal();
method asTerminalOutput (line 60) | public final String asTerminalOutput() {
method asTerminalOutputInternal (line 67) | protected abstract CharSequence asTerminalOutputInternal();
method parse (line 69) | public static EdnsOption parse(int intOptionCode, byte[] optionData) {
FILE: minidns-core/src/main/java/org/minidns/edns/Nsid.java
class Nsid (line 18) | public class Nsid extends EdnsOption {
method Nsid (line 22) | private Nsid() {
method Nsid (line 26) | public Nsid(byte[] payload) {
method getOptionCode (line 30) | @Override
method toStringInternal (line 35) | @Override
method asTerminalOutputInternal (line 42) | @Override
FILE: minidns-core/src/main/java/org/minidns/edns/UnknownEdnsOption.java
class UnknownEdnsOption (line 16) | public class UnknownEdnsOption extends EdnsOption {
method UnknownEdnsOption (line 18) | protected UnknownEdnsOption(int optionCode, byte[] optionData) {
method getOptionCode (line 22) | @Override
method asTerminalOutputInternal (line 27) | @Override
method toStringInternal (line 32) | @Override
FILE: minidns-core/src/main/java/org/minidns/idna/DefaultIdnaTransformator.java
class DefaultIdnaTransformator (line 17) | public class DefaultIdnaTransformator implements IdnaTransformator {
method toASCII (line 19) | @Override
method toUnicode (line 31) | @Override
FILE: minidns-core/src/main/java/org/minidns/idna/IdnaTransformator.java
type IdnaTransformator (line 13) | public interface IdnaTransformator {
method toASCII (line 15) | String toASCII(String input);
method toUnicode (line 17) | String toUnicode(String input);
FILE: minidns-core/src/main/java/org/minidns/idna/MiniDnsIdna.java
class MiniDnsIdna (line 13) | public class MiniDnsIdna {
method toASCII (line 17) | public static String toASCII(String string) {
method toUnicode (line 21) | public static String toUnicode(String string) {
method setActiveTransformator (line 25) | public static void setActiveTransformator(IdnaTransformator idnaTransf...
FILE: minidns-core/src/main/java/org/minidns/record/A.java
class A (line 23) | public class A extends InternetAddressRR<Inet4Address> {
method getType (line 25) | @Override
method A (line 30) | public A(Inet4Address inet4Address) {
method A (line 35) | public A(int q1, int q2, int q3, int q4) {
method A (line 42) | public A(byte[] ip) {
method A (line 49) | public A(CharSequence ipv4CharSequence) {
method parse (line 53) | public static A parse(DataInputStream dis)
method toString (line 60) | @Override
FILE: minidns-core/src/main/java/org/minidns/record/AAAA.java
class AAAA (line 23) | public class AAAA extends InternetAddressRR<Inet6Address> {
method getType (line 25) | @Override
method AAAA (line 30) | public AAAA(Inet6Address inet6address) {
method AAAA (line 35) | public AAAA(byte[] ip) {
method AAAA (line 42) | public AAAA(CharSequence ipv6CharSequence) {
method parse (line 46) | public static AAAA parse(DataInputStream dis)
method toString (line 53) | @Override
FILE: minidns-core/src/main/java/org/minidns/record/CNAME.java
class CNAME (line 22) | public class CNAME extends RRWithTarget {
method parse (line 24) | public static CNAME parse(DataInputStream dis, byte[] data) throws IOE...
method CNAME (line 29) | public CNAME(String target) {
method CNAME (line 33) | public CNAME(DnsName target) {
method getType (line 37) | @Override
FILE: minidns-core/src/main/java/org/minidns/record/DLV.java
class DLV (line 24) | public class DLV extends DelegatingDnssecRR {
method parse (line 26) | public static DLV parse (DataInputStream dis, int length) throws IOExc...
method DLV (line 31) | public DLV(int keyTag, byte algorithm, byte digestType, byte[] digest) {
method DLV (line 35) | public DLV(int keyTag, SignatureAlgorithm algorithm, DigestAlgorithm d...
method getType (line 39) | @Override
FILE: minidns-core/src/main/java/org/minidns/record/DNAME.java
class DNAME (line 24) | public class DNAME extends RRWithTarget {
method parse (line 26) | public static DNAME parse(DataInputStream dis, byte[] data) throws IOE...
method DNAME (line 31) | public DNAME(String target) {
method DNAME (line 35) | public DNAME(DnsName target) {
method getType (line 39) | @Override
FILE: minidns-core/src/main/java/org/minidns/record/DNSKEY.java
class DNSKEY (line 27) | public class DNSKEY extends Data {
method parse (line 84) | public static DNSKEY parse(DataInputStream dis, int length) throws IOE...
method DNSKEY (line 93) | private DNSKEY(short flags, byte protocol, SignatureAlgorithm algorith...
method DNSKEY (line 104) | public DNSKEY(short flags, byte protocol, byte algorithm, byte[] key) {
method DNSKEY (line 108) | public DNSKEY(short flags, byte protocol, SignatureAlgorithm algorithm...
method getType (line 112) | @Override
method getKeyTag (line 125) | public /* unsigned short */ int getKeyTag() {
method serialize (line 139) | @Override
method toString (line 147) | @Override
method getKeyLength (line 157) | public int getKeyLength() {
method getKey (line 161) | public byte[] getKey() {
method getKeyAsDataInputStream (line 165) | public DataInputStream getKeyAsDataInputStream() {
method getKeyBase64 (line 171) | public String getKeyBase64() {
method getKeyBigInteger (line 180) | public BigInteger getKeyBigInteger() {
method keyEquals (line 187) | public boolean keyEquals(byte[] otherKey) {
method isSecureEntryPoint (line 191) | public boolean isSecureEntryPoint() {
FILE: minidns-core/src/main/java/org/minidns/record/DS.java
class DS (line 24) | public class DS extends DelegatingDnssecRR {
method parse (line 26) | public static DS parse(DataInputStream dis, int length) throws IOExcep...
method DS (line 31) | public DS(int keyTag, byte algorithm, byte digestType, byte[] digest) {
method DS (line 35) | public DS(int keyTag, SignatureAlgorithm algorithm, byte digestType, b...
method DS (line 39) | public DS(int keyTag, SignatureAlgorithm algorithm, DigestAlgorithm di...
method getType (line 43) | @Override
FILE: minidns-core/src/main/java/org/minidns/record/Data.java
class Data (line 24) | public abstract class Data {
method getType (line 30) | public abstract TYPE getType();
method serialize (line 38) | protected abstract void serialize(DataOutputStream dos) throws IOExcep...
method setBytes (line 42) | private void setBytes() {
method length (line 56) | public final int length() {
method toOutputStream (line 61) | public final void toOutputStream(OutputStream outputStream) throws IOE...
method toOutputStream (line 72) | public final void toOutputStream(DataOutputStream dos) throws IOExcept...
method toByteArray (line 77) | public final byte[] toByteArray() {
method hashCode (line 84) | @Override
method equals (line 93) | @Override
FILE: minidns-core/src/main/java/org/minidns/record/DelegatingDnssecRR.java
class DelegatingDnssecRR (line 28) | public abstract class DelegatingDnssecRR extends Data {
method parseSharedData (line 68) | protected static SharedData parseSharedData(DataInputStream dis, int l...
class SharedData (line 77) | protected static final class SharedData {
method SharedData (line 83) | private SharedData(int keyTag, byte algorithm, byte digestType, byte...
method DelegatingDnssecRR (line 91) | protected DelegatingDnssecRR(int keyTag, SignatureAlgorithm algorithm,...
method DelegatingDnssecRR (line 106) | protected DelegatingDnssecRR(int keyTag, byte algorithm, byte digestTy...
method DelegatingDnssecRR (line 110) | protected DelegatingDnssecRR(int keyTag, SignatureAlgorithm algorithm,...
method DelegatingDnssecRR (line 114) | protected DelegatingDnssecRR(int keyTag, SignatureAlgorithm algorithm,...
method serialize (line 118) | @Override
method toString (line 126) | @Override
method getDigestBigInteger (line 138) | public BigInteger getDigestBigInteger() {
method getDigestHex (line 147) | public String getDigestHex() {
method digestEquals (line 154) | public boolean digestEquals(byte[] otherDigest) {
FILE: minidns-core/src/main/java/org/minidns/record/InternetAddressRR.java
class InternetAddressRR (line 23) | public abstract class InternetAddressRR<IA extends InetAddress> extends ...
method InternetAddressRR (line 36) | protected InternetAddressRR(byte[] ip) {
method InternetAddressRR (line 40) | protected InternetAddressRR(IA inetAddress) {
method serialize (line 45) | @Override
method getIp (line 55) | public final byte[] getIp() {
method getInetAddress (line 59) | @SuppressWarnings("unchecked")
method from (line 71) | public static InternetAddressRR<? extends InetAddress> from(InetAddres...
FILE: minidns-core/src/main/java/org/minidns/record/MX.java
class MX (line 23) | public class MX extends Data {
method parse (line 43) | public static MX parse(DataInputStream dis, byte[] data)
method MX (line 50) | public MX(int priority, String name) {
method MX (line 54) | public MX(int priority, DnsName name) {
method serialize (line 60) | @Override
method toString (line 66) | @Override
method getType (line 71) | @Override
FILE: minidns-core/src/main/java/org/minidns/record/NS.java
class NS (line 22) | public class NS extends RRWithTarget {
method parse (line 24) | public static NS parse(DataInputStream dis, byte[] data) throws IOExce...
method NS (line 29) | public NS(DnsName name) {
method getType (line 33) | @Override
FILE: minidns-core/src/main/java/org/minidns/record/NSEC.java
class NSEC (line 30) | public class NSEC extends Data {
method parse (line 46) | public static NSEC parse(DataInputStream dis, byte[] data, int length)...
method NSEC (line 55) | public NSEC(String next, List<TYPE> types) {
method NSEC (line 59) | public NSEC(String next, TYPE... types) {
method NSEC (line 63) | public NSEC(DnsName next, List<TYPE> types) {
method getType (line 69) | @Override
method serialize (line 74) | @Override
method toString (line 80) | @Override
method createTypeBitMap (line 90) | @SuppressWarnings("NarrowingCompoundAssignment")
method writeOutBlock (line 124) | private static void writeOutBlock(byte[] values, DataOutputStream dos)...
method readTypeBitMap (line 136) | static List<TYPE> readTypeBitMap(byte[] typeBitmap) throws IOException {
FILE: minidns-core/src/main/java/org/minidns/record/NSEC3.java
class NSEC3 (line 30) | public class NSEC3 extends Data {
type HashAlgorithm (line 47) | public enum HashAlgorithm {
method HashAlgorithm (line 52) | HashAlgorithm(int value, String description) {
method forByte (line 64) | public static HashAlgorithm forByte(byte b) {
method parse (line 110) | public static NSEC3 parse(DataInputStream dis, int length) throws IOEx...
method NSEC3 (line 126) | private NSEC3(HashAlgorithm hashAlgorithm, byte hashAlgorithmByte, byt...
method NSEC3 (line 139) | public NSEC3(byte hashAlgorithm, byte flags, int iterations, byte[] sa...
method NSEC3 (line 143) | public NSEC3(byte hashAlgorithm, byte flags, int iterations, byte[] sa...
method getType (line 147) | @Override
method serialize (line 152) | @Override
method toString (line 164) | @Override
method getSalt (line 178) | public byte[] getSalt() {
method getSaltLength (line 182) | public int getSaltLength() {
method getNextHashed (line 186) | public byte[] getNextHashed() {
method getNextHashedBase32 (line 192) | public String getNextHashedBase32() {
method getNextHashedDnsLabel (line 201) | public DnsLabel getNextHashedDnsLabel() {
method copySaltInto (line 209) | public void copySaltInto(byte[] dest, int destPos) {
FILE: minidns-core/src/main/java/org/minidns/record/NSEC3PARAM.java
class NSEC3PARAM (line 25) | public class NSEC3PARAM extends Data {
method parse (line 51) | public static NSEC3PARAM parse(DataInputStream dis) throws IOException {
method NSEC3PARAM (line 61) | private NSEC3PARAM(HashAlgorithm hashAlgorithm, byte hashAlgorithmByte...
method NSEC3PARAM (line 71) | NSEC3PARAM(byte hashAlgorithm, byte flags, int iterations, byte[] salt) {
method getType (line 75) | @Override
method serialize (line 80) | @Override
method toString (line 89) | @Override
method getSaltLength (line 99) | public int getSaltLength() {
FILE: minidns-core/src/main/java/org/minidns/record/OPENPGPKEY.java
class OPENPGPKEY (line 19) | public class OPENPGPKEY extends Data {
method parse (line 23) | public static OPENPGPKEY parse(DataInputStream dis, int length) throws...
method OPENPGPKEY (line 29) | OPENPGPKEY(byte[] publicKeyPacket) {
method getType (line 33) | @Override
method serialize (line 38) | @Override
method toString (line 43) | @Override
method getPublicKeyPacketBase64 (line 50) | public String getPublicKeyPacketBase64() {
method getPublicKeyPacket (line 57) | public byte[] getPublicKeyPacket() {
FILE: minidns-core/src/main/java/org/minidns/record/OPT.java
class OPT (line 26) | public class OPT extends Data {
method OPT (line 30) | public OPT() {
method OPT (line 34) | public OPT(List<EdnsOption> variablePart) {
method parse (line 38) | public static OPT parse(DataInputStream dis, int payloadLength) throws...
method getType (line 60) | @Override
method serialize (line 65) | @Override
FILE: minidns-core/src/main/java/org/minidns/record/PTR.java
class PTR (line 22) | public class PTR extends RRWithTarget {
method parse (line 24) | public static PTR parse(DataInputStream dis, byte[] data) throws IOExc...
method PTR (line 29) | PTR(String name) {
method PTR (line 33) | PTR(DnsName name) {
method getType (line 37) | @Override
FILE: minidns-core/src/main/java/org/minidns/record/RRSIG.java
class RRSIG (line 29) | public class RRSIG extends Data {
method parse (line 81) | @SuppressWarnings("JavaUtilDate")
method RRSIG (line 98) | private RRSIG(TYPE typeCovered, SignatureAlgorithm algorithm, byte al...
method RRSIG (line 115) | public RRSIG(TYPE typeCovered, int algorithm, byte labels, long origin...
method RRSIG (line 120) | public RRSIG(TYPE typeCovered, int algorithm, byte labels, long origin...
method RRSIG (line 125) | public RRSIG(TYPE typeCovered, SignatureAlgorithm algorithm, byte labels,
method RRSIG (line 132) | public RRSIG(TYPE typeCovered, SignatureAlgorithm algorithm, byte labels,
method getSignature (line 139) | public byte[] getSignature() {
method getSignatureAsDataInputStream (line 143) | public DataInputStream getSignatureAsDataInputStream() {
method getSignatureLength (line 147) | public int getSignatureLength() {
method getSignatureBase64 (line 153) | public String getSignatureBase64() {
method getType (line 160) | @Override
method serialize (line 165) | @Override
method writePartialSignature (line 171) | @SuppressWarnings("JavaUtilDate")
method toString (line 183) | @Override
FILE: minidns-core/src/main/java/org/minidns/record/RRWithTarget.java
class RRWithTarget (line 21) | public abstract class RRWithTarget extends Data {
method serialize (line 32) | @Override
method RRWithTarget (line 37) | protected RRWithTarget(DnsName target) {
method toString (line 42) | @Override
method getTarget (line 47) | public final DnsName getTarget() {
FILE: minidns-core/src/main/java/org/minidns/record/Record.java
class Record (line 31) | public final class Record<D extends Data> {
type TYPE (line 40) | public enum TYPE {
method TYPE (line 155) | TYPE(int value) {
method TYPE (line 166) | <D extends Data> TYPE(int value, Class<D> dataClass) {
method getValue (line 175) | public int getValue() {
method getDataClass (line 185) | @SuppressWarnings("unchecked")
method getType (line 195) | public static TYPE getType(int value) {
method getType (line 208) | public static <D extends Data> TYPE getType(Class<D> dataClass) {
type CLASS (line 218) | public enum CLASS {
method CLASS (line 260) | CLASS(int value) {
method getValue (line 268) | public int getValue() {
method getClass (line 277) | public static CLASS getClass(int value) {
method parse (line 330) | public static Record<Data> parse(DataInputStream dis, byte[] data) thr...
method Record (line 410) | public Record(DnsName name, TYPE type, CLASS clazz, long ttl, D payloa...
method Record (line 414) | public Record(String name, TYPE type, CLASS clazz, long ttl, D payload...
method Record (line 418) | public Record(String name, TYPE type, int clazzValue, long ttl, D payl...
method Record (line 422) | public Record(DnsName name, TYPE type, int clazzValue, long ttl, D pay...
method Record (line 426) | private Record(DnsName name, TYPE type, CLASS clazz, int clazzValue, l...
method toOutputStream (line 436) | public void toOutputStream(OutputStream outputStream) throws IOExcepti...
method toByteArray (line 454) | public byte[] toByteArray() {
method toString (line 476) | @Override
method isAnswer (line 486) | public boolean isAnswer(Question q) {
method isUnicastQuery (line 496) | public boolean isUnicastQuery() {
method getPayload (line 504) | public D getPayload() {
method getTtl (line 512) | public long getTtl() {
method getQuestion (line 522) | public Question getQuestion() {
method getQuestionMessage (line 535) | public DnsMessage.Builder getQuestionMessage() {
method hashCode (line 545) | @Override
method equals (line 558) | @Override
method ifPossibleAs (line 586) | @SuppressWarnings("unchecked")
method as (line 603) | public <E extends Data> Record<E> as(Class<E> dataClass) {
method filter (line 611) | public static <E extends Data> void filter(Collection<Record<E>> resul...
method filter (line 622) | public static <E extends Data> List<Record<E>> filter(Class<E> dataClass,
FILE: minidns-core/src/main/java/org/minidns/record/SOA.java
class SOA (line 23) | public class SOA extends Data {
method parse (line 62) | public static SOA parse(DataInputStream dis, byte[] data)
method SOA (line 74) | public SOA(String mname, String rname, long serial, int refresh, int r...
method SOA (line 78) | public SOA(DnsName mname, DnsName rname, long serial, int refresh, int...
method getType (line 88) | @Override
method serialize (line 93) | @Override
method toString (line 104) | @Override
FILE: minidns-core/src/main/java/org/minidns/record/SRV.java
class SRV (line 23) | public class SRV extends RRWithTarget implements Comparable<SRV> {
method parse (line 41) | public static SRV parse(DataInputStream dis, byte[] data)
method SRV (line 50) | public SRV(int priority, int weight, int port, String target) {
method SRV (line 54) | public SRV(int priority, int weight, int port, DnsName target) {
method isServiceAvailable (line 70) | public boolean isServiceAvailable() {
method serialize (line 74) | @Override
method toString (line 82) | @Override
method getType (line 87) | @Override
method compareTo (line 92) | @Override
FILE: minidns-core/src/main/java/org/minidns/record/TLSA.java
class TLSA (line 21) | public class TLSA extends Data {
type CertUsage (line 31) | public enum CertUsage {
method CertUsage (line 79) | CertUsage(byte byteValue) {
type Selector (line 87) | public enum Selector {
method Selector (line 94) | Selector(byte byteValue) {
type MatchingType (line 102) | public enum MatchingType {
method MatchingType (line 110) | MatchingType(byte byteValue) {
method parse (line 151) | public static TLSA parse(DataInputStream dis, int length) throws IOExc...
method TLSA (line 160) | TLSA(byte certUsageByte, byte selectorByte, byte matchingTypeByte, byt...
method getType (line 173) | @Override
method serialize (line 178) | @Override
method toString (line 186) | @Override
method getCertificateAssociation (line 196) | public byte[] getCertificateAssociation() {
method certificateAssociationEquals (line 200) | public boolean certificateAssociationEquals(byte[] otherCertificateAss...
FILE: minidns-core/src/main/java/org/minidns/record/TXT.java
class TXT (line 30) | public class TXT extends Data {
method parse (line 34) | public static TXT parse(DataInputStream dis, int length) throws IOExce...
method TXT (line 40) | public TXT(byte[] blob) {
method getBlob (line 44) | public byte[] getBlob() {
method getText (line 50) | public String getText() {
method getCharacterStrings (line 67) | public List<String> getCharacterStrings() {
method getExtents (line 80) | public List<byte[]> getExtents() {
method serialize (line 92) | @Override
method getType (line 97) | @Override
method toString (line 102) | @Override
FILE: minidns-core/src/main/java/org/minidns/record/UNKNOWN.java
class UNKNOWN (line 19) | public final class UNKNOWN extends Data {
method UNKNOWN (line 24) | private UNKNOWN(DataInputStream dis, int payloadLength, TYPE type) thr...
method getType (line 30) | @Override
method serialize (line 35) | @Override
method parse (line 40) | public static UNKNOWN parse(DataInputStream dis, int payloadLength, TY...
FILE: minidns-core/src/main/java/org/minidns/util/Base32.java
class Base32 (line 16) | public final class Base32 {
method Base32 (line 23) | private Base32() {
method encodeToString (line 26) | public static String encodeToString(byte[] bytes) {
FILE: minidns-core/src/main/java/org/minidns/util/Base64.java
class Base64 (line 16) | public final class Base64 {
method Base64 (line 23) | private Base64() {
method encodeToString (line 26) | public static String encodeToString(byte[] bytes) {
FILE: minidns-core/src/main/java/org/minidns/util/CallbackRecipient.java
type CallbackRecipient (line 19) | public interface CallbackRecipient<V, E> {
method onSuccess (line 21) | CallbackRecipient<V, E> onSuccess(SuccessCallback<V> successCallback);
method onError (line 23) | CallbackRecipient<V, E> onError(ExceptionCallback<E> exceptionCallback);
FILE: minidns-core/src/main/java/org/minidns/util/CollectionsUtil.java
class CollectionsUtil (line 17) | public class CollectionsUtil {
method getRandomFrom (line 19) | public static <T> T getRandomFrom(Set<T> set, Random random) {
FILE: minidns-core/src/main/java/org/minidns/util/ExceptionCallback.java
type ExceptionCallback (line 13) | public interface ExceptionCallback<E> {
method processException (line 15) | void processException(E exception);
FILE: minidns-core/src/main/java/org/minidns/util/Hex.java
class Hex (line 13) | public class Hex {
method from (line 15) | public static StringBuilder from(byte[] bytes) {
FILE: minidns-core/src/main/java/org/minidns/util/InetAddressUtil.java
class InetAddressUtil (line 21) | public class InetAddressUtil {
method ipv4From (line 23) | public static Inet4Address ipv4From(CharSequence cs) {
method ipv6From (line 36) | public static Inet6Address ipv6From(CharSequence cs) {
method isIpV4Address (line 53) | public static boolean isIpV4Address(CharSequence address) {
method isIpV6Address (line 65) | public static boolean isIpV6Address(CharSequence address) {
method isIpAddress (line 72) | public static boolean isIpAddress(CharSequence address) {
method convertToInetAddressIfPossible (line 76) | public static InetAddress convertToInetAddressIfPossible(CharSequence ...
method reverseIpAddressOf (line 90) | public static DnsName reverseIpAddressOf(Inet6Address inet6Address) {
method reverseIpAddressOf (line 110) | public static DnsName reverseIpAddressOf(Inet4Address inet4Address) {
FILE: minidns-core/src/main/java/org/minidns/util/MultipleIoException.java
class MultipleIoException (line 19) | public final class MultipleIoException extends IOException {
method MultipleIoException (line 28) | private MultipleIoException(List<? extends IOException> ioExceptions) {
method getExceptions (line 34) | public List<IOException> getExceptions() {
method getMessage (line 38) | private static String getMessage(Collection<? extends Exception> excep...
method throwIfRequired (line 50) | public static void throwIfRequired(List<? extends IOException> ioExcep...
method toIOException (line 60) | public static IOException toIOException(List<? extends IOException> io...
FILE: minidns-core/src/main/java/org/minidns/util/NameUtil.java
class NameUtil (line 18) | public final class NameUtil {
method idnEquals (line 28) | @SuppressWarnings("ReferenceEquality")
FILE: minidns-core/src/main/java/org/minidns/util/PlatformDetection.java
class PlatformDetection (line 13) | public class PlatformDetection {
method isAndroid (line 17) | public static boolean isAndroid() {
FILE: minidns-core/src/main/java/org/minidns/util/SafeCharSequence.java
class SafeCharSequence (line 13) | public class SafeCharSequence implements CharSequence {
method length (line 15) | @Override
method charAt (line 20) | @Override
method subSequence (line 25) | @Override
method toSafeString (line 30) | public String toSafeString() {
FILE: minidns-core/src/main/java/org/minidns/util/SrvUtil.java
class SrvUtil (line 24) | public class SrvUtil {
method sortSrvRecords (line 37) | @SuppressWarnings({"MixedMutabilityReturnType", "JdkObsolete"})
method bisect (line 104) | private static int bisect(int[] array, double value) {
FILE: minidns-core/src/main/java/org/minidns/util/SuccessCallback.java
type SuccessCallback (line 13) | public interface SuccessCallback<T> {
method onSuccess (line 15) | void onSuccess(T result);
FILE: minidns-core/src/test/java/org/minidns/Assert.java
class Assert (line 21) | public class Assert {
method assertCsEquals (line 23) | public static void assertCsEquals(CharSequence expected, CharSequence ...
method assertCsEquals (line 27) | public static void assertCsEquals(String message, CharSequence expecte...
method assertArrayContentEquals (line 35) | public static <T> void assertArrayContentEquals(T[] expect, Collection...
FILE: minidns-core/src/test/java/org/minidns/dnslabel/DnsLabelTest.java
class DnsLabelTest (line 21) | public class DnsLabelTest {
method simpleNonReservedLdhLabelTest (line 23) | @Test
method aLabelTest (line 33) | @Test
method fakeALabelTest (line 45) | @Test
method underscoreLabelTest (line 55) | @Test
method leadingHyphenLabelTest (line 65) | @Test
method trailingHyphenLabelTest (line 75) | @Test
method otherNonLdhLabelTest (line 85) | @Test
method dnsLabelWildcardStringTest (line 95) | @Test
method escapeUnsafeCharactersTest (line 100) | @Test
FILE: minidns-core/src/test/java/org/minidns/dnsmessage/DnsMessageTest.java
class DnsMessageTest (line 58) | public class DnsMessageTest {
method getMessageFromResource (line 60) | DnsMessage getMessageFromResource(final String resourceFileName) throw...
method testALookup (line 77) | @Test
method testAAAALookup (line 99) | @Test
method testMXLookup (line 113) | @Test
method testSRVLookup (line 135) | @Test
method testTXTLookup (line 150) | @Test
method testTXTMultiCharacterStringLookup (line 170) | @Test
method testSoaLookup (line 195) | @Test
method testComNsLookup (line 214) | @Test
method testRootDnskeyLookup (line 238) | @Test
method testComDsAndRrsigLookup (line 283) | @Test
method testExampleNsecLookup (line 326) | @Test
method testComNsec3Lookup (line 346) | @Test
method testMessageSelfQuestionReconstruction (line 378) | @Test
method testMessageSelfEasyAnswersReconstruction (line 398) | @Test
method testMessageSelfComplexReconstruction (line 426) | @Test
method testMessageSelfTruncatedReconstruction (line 472) | @Test
method testMessageSelfOptRecordReconstructione (line 484) | @SuppressWarnings("unchecked")
method testEmptyMessageToString (line 499) | @Test
method testFilledMessageToString (line 506) | @Test
method testEmptyMessageTerminalOutput (line 522) | @Test
method testFilledMessageTerminalOutput (line 533) | @Test
method record (line 550) | public static Record<Data> record(String name, long ttl, Data data) {
method record (line 554) | public static Record<Data> record(DnsName name, long ttl, Data data) {
method record (line 558) | public static Record<Data> record(String name, Data data) {
method a (line 562) | public static A a(CharSequence ipv4CharSequence) {
method ns (line 566) | public static NS ns(String name) {
method ns (line 570) | public static NS ns(DnsName name) {
method aaaa (line 574) | public static AAAA aaaa(CharSequence ipv6CharSequence) {
FILE: minidns-core/src/test/java/org/minidns/dnsname/DnsNameTest.java
class DnsNameTest (line 26) | public class DnsNameTest {
method sizeTest (line 28) | @Test
method toByteArrayTest (line 36) | @Test
method parseTest (line 44) | @Test
method parseLabelWillNullByteTest (line 52) | @Test
method parse (line 67) | private static DnsName parse(byte[] bytes) throws IOException {
method constructInvalid (line 71) | @Test
method equalsTest (line 76) | @Test
method testStripToParts (line 81) | @Test
method testStripToPartsIllegal (line 89) | @Test
method testStripToPartsIllegalLong (line 96) | @Test
method testConcact (line 103) | @Test
method testFromVarargs (line 115) | @Test
method caseInsenstiveCompare (line 133) | @Test
method rawFieldsKeepCase (line 141) | @Test
method getLabelsTest (line 149) | @Test
method trailingDotDnsNameFromTest (line 163) | @Test
method fromWithChild (line 170) | @Test
method fromWithChildAndGrandchild (line 178) | @Test
method getHostpartLabel (line 187) | @Test
FILE: minidns-core/src/test/java/org/minidns/record/RecordsTest.java
class RecordsTest (line 41) | public class RecordsTest {
method testARecord (line 42) | @Test
method testARecordInvalidIp (line 52) | @Test
method testAAAARecord (line 59) | @Test
method testAAAARecordInvalidIp (line 70) | @Test
method testCnameRecord (line 77) | @Test
method testDlvRecord (line 87) | @Test
method testDnskeyRecord (line 100) | @SuppressWarnings("deprecation")
method testDnskeyRecordWithUnknownSignatureAlgorithm (line 115) | @Test
method testDsRecord (line 127) | @Test
method testMxRecord (line 140) | @Test
method testNsecRecord (line 151) | @Test
method testNsecTypeBitmapEmpty (line 162) | @Test
method testNsec3Record (line 168) | @Test
method testNsec3ParamRecord (line 185) | @Test
method testOpenpgpkeyRecord (line 201) | @Test
method testPtrRecord (line 211) | @Test
method testRrsigRecord (line 221) | @Test
method testSoaRecord (line 241) | @Test
method testSrvRecord (line 257) | @Test
method testTlsaRecord (line 270) | @Test
FILE: minidns-core/src/test/java/org/minidns/record/TLSATest.java
class TLSATest (line 18) | public class TLSATest {
method ensureTlsaLutsAreInitialized (line 20) | @Test
FILE: minidns-core/src/test/java/org/minidns/util/Base32Test.java
class Base32Test (line 17) | public class Base32Test {
method testEncodeToString (line 18) | @Test
FILE: minidns-core/src/test/java/org/minidns/util/Base64Test.java
class Base64Test (line 17) | public class Base64Test {
method testEncodeToString (line 18) | @Test
FILE: minidns-core/src/test/java/org/minidns/util/InetAddressUtilTest.java
class InetAddressUtilTest (line 21) | public class InetAddressUtilTest {
method testValidIpv6 (line 57) | @Test
method testInvalidIpv6 (line 63) | @Test
method testValidIpv4 (line 68) | @Test
method testInvalidIpv4 (line 73) | @Test
method assertAllValidIpv6 (line 78) | private static void assertAllValidIpv6(String... addresses) {
method assertAllValidIpv4 (line 86) | private static void assertAllValidIpv4(String... addresses) {
method assertAllInvalidIpv6 (line 94) | private static void assertAllInvalidIpv6(String... addresses) {
method assertAllInvalidIpv4 (line 103) | private static void assertAllInvalidIpv4(String... addresses) {
method testReverseInet6Address (line 112) | @Test
method testReverseInet4Address (line 119) | @Test
FILE: minidns-core/src/test/java/org/minidns/util/NameUtilTest.java
class NameUtilTest (line 18) | public class NameUtilTest {
method idnEqualsTest (line 20) | @Test
FILE: minidns-core/src/test/java/org/minidns/util/SrvUtilTest.java
class SrvUtilTest (line 23) | public class SrvUtilTest {
method sortSRVlowestPrioFirstTest (line 25) | @Test
method sortSRVdistributeOverWeights (line 31) | @Test
method sortSRVdistributeZeroWeights (line 55) | @Test
method createSRVRecords (line 77) | private static List<SRV> createSRVRecords() {
FILE: minidns-dane/src/main/java/org/minidns/dane/java7/DaneExtendedTrustManager.java
class DaneExtendedTrustManager (line 32) | public class DaneExtendedTrustManager extends X509ExtendedTrustManager {
method inject (line 38) | public static void inject() {
method inject (line 42) | public static void inject(DaneExtendedTrustManager trustManager) {
method DaneExtendedTrustManager (line 52) | public DaneExtendedTrustManager() {
method DaneExtendedTrustManager (line 56) | public DaneExtendedTrustManager(DnssecClient client) {
method DaneExtendedTrustManager (line 60) | public DaneExtendedTrustManager(X509TrustManager base) {
method DaneExtendedTrustManager (line 64) | public DaneExtendedTrustManager(DnssecClient client, X509TrustManager ...
method DaneExtendedTrustManager (line 68) | public DaneExtendedTrustManager(DaneVerifier verifier, X509TrustManage...
method checkClientTrusted (line 73) | @Override
method checkServerTrusted (line 88) | @Override
method checkClientTrusted (line 122) | @Override
method checkServerTrusted (line 137) | @Override
method checkClientTrusted (line 151) | @Override
method checkServerTrusted (line 162) | @Override
method getAcceptedIssuers (line 168) | @Override
FILE: minidns-dane/src/test/java/org/minidns/dane/java7/DaneJava7Test.java
class DaneJava7Test (line 15) | public class DaneJava7Test {
method emptyTest (line 19) | @Test
FILE: minidns-dnssec/src/main/java/org/minidns/dane/DaneCertificateException.java
class DaneCertificateException (line 19) | public abstract class DaneCertificateException extends CertificateExcept...
method DaneCertificateException (line 26) | protected DaneCertificateException() {
method DaneCertificateException (line 29) | protected DaneCertificateException(String message) {
class CertificateMismatch (line 33) | public static class CertificateMismatch extends DaneCertificateExcepti...
method CertificateMismatch (line 43) | public CertificateMismatch(TLSA tlsa, byte[] computed) {
class MultipleCertificateMismatchExceptions (line 50) | public static class MultipleCertificateMismatchExceptions extends Dane...
method MultipleCertificateMismatchExceptions (line 59) | public MultipleCertificateMismatchExceptions(List<CertificateMismatc...
FILE: minidns-dnssec/src/main/java/org/minidns/dane/DaneVerifier.java
class DaneVerifier (line 44) | public class DaneVerifier {
method DaneVerifier (line 49) | public DaneVerifier() {
method DaneVerifier (line 53) | public DaneVerifier(DnssecClient client) {
method verify (line 65) | public boolean verify(SSLSocket socket) throws CertificateException {
method verify (line 80) | public boolean verify(SSLSession session) throws CertificateException {
method verifyCertificateChain (line 98) | public boolean verifyCertificateChain(X509Certificate[] chain, String ...
method checkCertificateMatches (line 143) | private static boolean checkCertificateMatches(X509Certificate cert, T...
method verifiedConnect (line 227) | public HttpsURLConnection verifiedConnect(HttpsURLConnection conn) thr...
method verifiedConnect (line 243) | public HttpsURLConnection verifiedConnect(HttpsURLConnection conn, X50...
method convert (line 263) | private static X509Certificate[] convert(Certificate[] certificates) {
FILE: minidns-dnssec/src/main/java/org/minidns/dane/ExpectingTrustManager.java
class ExpectingTrustManager (line 17) | public class ExpectingTrustManager implements X509TrustManager {
method ExpectingTrustManager (line 27) | public ExpectingTrustManager(X509TrustManager trustManager) {
method hasException (line 31) | public boolean hasException() {
method getException (line 35) | public CertificateException getException() {
method checkClientTrusted (line 41) | @Override
method checkServerTrusted (line 50) | @Override
method getAcceptedIssuers (line 59) | @Override
FILE: minidns-dnssec/src/main/java/org/minidns/dane/X509TrustManagerUtil.java
class X509TrustManagerUtil (line 21) | public class X509TrustManagerUtil {
method getDefault (line 23) | public static X509TrustManager getDefault() {
method getDefault (line 27) | public static X509TrustManager getDefault(KeyStore keyStore) {
FILE: minidns-dnssec/src/main/java/org/minidns/dnssec/DigestCalculator.java
type DigestCalculator (line 13) | public interface DigestCalculator {
method digest (line 14) | byte[] digest(byte[] bytes);
FILE: minidns-dnssec/src/main/java/org/minidns/dnssec/DnssecClient.java
class DnssecClient (line 48) | public class DnssecClient extends ReliableDnsClient {
method DnssecClient (line 61) | public DnssecClient() {
method DnssecClient (line 70) | public DnssecClient(DnsCache cache) {
method query (line 87) | @Override
method queryDnssec (line 97) | public DnssecQueryResult queryDnssec(CharSequence name, TYPE type) thr...
method queryDnssec (line 102) | public DnssecQueryResult queryDnssec(Question q) throws IOException {
method performVerification (line 108) | private DnssecQueryResult performVerification(DnsQueryResult dnsQueryR...
method stripSignatureRecords (line 135) | private static List<Record<? extends Data>> stripSignatureRecords(List...
method verify (line 146) | private Set<DnssecUnverifiedReason> verify(DnsMessage dnsMessage) thro...
method verifyAnswer (line 154) | private Set<DnssecUnverifiedReason> verifyAnswer(DnsMessage dnsMessage...
method verifyNsec (line 202) | private Set<DnssecUnverifiedReason> verifyNsec(DnsMessage dnsMessage) ...
class VerifySignaturesResult (line 274) | private static final class VerifySignaturesResult {
method verifySignatures (line 280) | @SuppressWarnings("JavaUtilDate")
method isParentOrSelf (line 349) | private static boolean isParentOrSelf(String child, String parent) {
method verifySignedRecords (line 363) | private Set<DnssecUnverifiedReason> verifySignedRecords(Question q, RR...
method verifySecureEntryPoint (line 404) | private Set<DnssecUnverifiedReason> verifySecureEntryPoint(final Recor...
method newQuestion (line 471) | @Override
method isResponseAcceptable (line 478) | @Override
method addSecureEntryPoint (line 507) | public final void addSecureEntryPoint(DnsName name, byte[] key) {
method removeSecureEntryPoint (line 517) | public void removeSecureEntryPoint(DnsName name) {
method clearSecureEntryPoints (line 527) | public void clearSecureEntryPoints() {
method isStripSignatureRecords (line 538) | public boolean isStripSignatureRecords() {
method setStripSignatureRecords (line 546) | public void setStripSignatureRecords(boolean stripSignatureRecords) {
method enableLookasideValidation (line 553) | public void enableLookasideValidation() {
method disableLookasideValidation (line 561) | public void disableLookasideValidation() {
method configureLookasideValidation (line 570) | public void configureLookasideValidation(DnsName dlv) {
FILE: minidns-dnssec/src/main/java/org/minidns/dnssec/DnssecQueryResult.java
class DnssecQueryResult (line 21) | public class DnssecQueryResult {
method DnssecQueryResult (line 29) | DnssecQueryResult(DnsMessage synthesizedResponse, DnsQueryResult dnsQu...
method isAuthenticData (line 41) | public boolean isAuthenticData() {
method getSignatures (line 45) | public Set<Record<RRSIG>> getSignatures() {
method getUnverifiedReasons (line 49) | public Set<DnssecUnverifiedReason> getUnverifiedReasons() {
FILE: minidns-dnssec/src/main/java/org/minidns/dnssec/DnssecResultNotAuthenticException.java
class DnssecResultNotAuthenticException (line 18) | public final class DnssecResultNotAuthenticException extends MiniDnsExce...
method DnssecResultNotAuthenticException (line 27) | private DnssecResultNotAuthenticException(String message, Set<DnssecUn...
method from (line 35) | public static DnssecResultNotAuthenticException from(Set<DnssecUnverif...
method getUnverifiedReasons (line 45) | public Set<DnssecUnverifiedReason> getUnverifiedReasons() {
FILE: minidns-dnssec/src/main/java/org/minidns/dnssec/DnssecUnverifiedReason.java
class DnssecUnverifiedReason (line 25) | public abstract class DnssecUnverifiedReason {
method getReasonString (line 26) | public abstract String getReasonString();
method toString (line 28) | @Override
method hashCode (line 33) | @Override
method equals (line 38) | @Override
class AlgorithmNotSupportedReason (line 43) | public static class AlgorithmNotSupportedReason extends DnssecUnverifi...
method AlgorithmNotSupportedReason (line 48) | public AlgorithmNotSupportedReason(byte algorithm, TYPE type, Record...
method getReasonString (line 54) | @Override
class AlgorithmExceptionThrownReason (line 60) | public static class AlgorithmExceptionThrownReason extends DnssecUnver...
method AlgorithmExceptionThrownReason (line 66) | public AlgorithmExceptionThrownReason(DigestAlgorithm algorithm, Str...
method getReasonString (line 73) | @Override
class ConflictsWithSep (line 79) | public static class ConflictsWithSep extends DnssecUnverifiedReason {
method ConflictsWithSep (line 82) | public ConflictsWithSep(Record<DNSKEY> record) {
method getReasonString (line 86) | @Override
class NoTrustAnchorReason (line 92) | public static class NoTrustAnchorReason extends DnssecUnverifiedReason {
method NoTrustAnchorReason (line 95) | public NoTrustAnchorReason(DnsName zone) {
method getReasonString (line 99) | @Override
class NoSecureEntryPointReason (line 105) | public static class NoSecureEntryPointReason extends DnssecUnverifiedR...
method NoSecureEntryPointReason (line 108) | public NoSecureEntryPointReason(DnsName zone) {
method getReasonString (line 112) | @Override
class NoRootSecureEntryPointReason (line 118) | public static class NoRootSecureEntryPointReason extends DnssecUnverif...
method NoRootSecureEntryPointReason (line 119) | public NoRootSecureEntryPointReason() {
method getReasonString (line 122) | @Override
class NoSignaturesReason (line 128) | public static class NoSignaturesReason extends DnssecUnverifiedReason {
method NoSignaturesReason (line 131) | public NoSignaturesReason(Question question) {
method getReasonString (line 135) | @Override
class NoActiveSignaturesReason (line 141) | public static class NoActiveSignaturesReason extends DnssecUnverifiedR...
method NoActiveSignaturesReason (line 145) | public NoActiveSignaturesReason(Question question, List<RRSIG> outda...
method getReasonString (line 151) | @Override
method getOutdatedRrSigs (line 156) | public List<RRSIG> getOutdatedRrSigs() {
class NSECDoesNotMatchReason (line 161) | public static class NSECDoesNotMatchReason extends DnssecUnverifiedRea...
method NSECDoesNotMatchReason (line 165) | public NSECDoesNotMatchReason(Question question, Record<? extends Da...
method getReasonString (line 170) | @Override
FILE: minidns-dnssec/src/main/java/org/minidns/dnssec/DnssecValidationFailedException.java
class DnssecValidationFailedException (line 25) | public class DnssecValidationFailedException extends IOException {
method DnssecValidationFailedException (line 28) | public DnssecValidationFailedException(Question question, String reaso...
method DnssecValidationFailedException (line 32) | public DnssecValidationFailedException(String message) {
method DnssecValidationFailedException (line 36) | public DnssecValidationFailedException(String message, Throwable cause) {
method DnssecValidationFailedException (line 40) | public DnssecValidationFailedException(Record<? extends Data> record, ...
method DnssecValidationFailedException (line 44) | public DnssecValidationFailedException(List<Record<? extends Data>> re...
class DataMalformedException (line 48) | public static class DataMalformedException extends DnssecValidationFai...
method DataMalformedException (line 57) | public DataMalformedException(IOException exception, byte[] data) {
method DataMalformedException (line 62) | public DataMalformedException(String message, IOException exception,...
method getData (line 67) | public byte[] getData() {
class DnssecInvalidKeySpecException (line 72) | public static class DnssecInvalidKeySpecException extends DnssecValida...
method DnssecInvalidKeySpecException (line 79) | public DnssecInvalidKeySpecException(InvalidKeySpecException excepti...
method DnssecInvalidKeySpecException (line 83) | public DnssecInvalidKeySpecException(String message, InvalidKeySpecE...
class AuthorityDoesNotContainSoa (line 89) | public static class AuthorityDoesNotContainSoa extends DnssecValidatio...
method AuthorityDoesNotContainSoa (line 98) | public AuthorityDoesNotContainSoa(DnsMessage response) {
method getResponse (line 103) | public DnsMessage getResponse() {
class DigestComparisonFailedException (line 108) | public static final class DigestComparisonFailedException extends Dnss...
method DigestComparisonFailedException (line 120) | private DigestComparisonFailedException(String message, Record<? ext...
method getRecord (line 128) | public Record<? extends Data> getRecord() {
method getDelegaticDnssecRr (line 132) | public DelegatingDnssecRR getDelegaticDnssecRr() {
method getDigest (line 136) | public byte[] getDigest() {
method getDigestHex (line 140) | public String getDigestHex() {
method from (line 144) | public static DigestComparisonFailedException from(Record<? extends ...
FILE: minidns-dnssec/src/main/java/org/minidns/dnssec/DnssecValidatorInitializationException.java
class DnssecValidatorInitializationException (line 13) | public class DnssecValidatorInitializationException extends RuntimeExcep...
method DnssecValidatorInitializationException (line 16) | public DnssecValidatorInitializationException(String message, Throwabl...
FILE: minidns-dnssec/src/main/java/org/minidns/dnssec/SignatureVerifier.java
type SignatureVerifier (line 16) | public interface SignatureVerifier {
method verify (line 17) | boolean verify(byte[] content, RRSIG rrsig, DNSKEY key) throws DnssecV...
FILE: minidns-dnssec/src/main/java/org/minidns/dnssec/Verifier.java
class Verifier (line 38) | class Verifier {
method verify (line 41) | public static DnssecUnverifiedReason verify(Record<DNSKEY> dnskeyRecor...
method verify (line 66) | public static DnssecUnverifiedReason verify(List<Record<? extends Data...
method verifyNsec (line 80) | public static DnssecUnverifiedReason verifyNsec(Record<NSEC> nsecRecor...
method verifyNsec3 (line 91) | public static DnssecUnverifiedReason verifyNsec3(DnsName zone, Record<...
method combine (line 114) | static byte[] combine(RRSIG rrsig, List<Record<? extends Data>> record...
method nsecMatches (line 167) | static boolean nsecMatches(String test, String lowerBound, String uppe...
method nsecMatches (line 179) | static boolean nsecMatches(DnsName test, DnsName lowerBound, DnsName u...
method nsec3hash (line 197) | static byte[] nsec3hash(DigestCalculator digestCalculator, NSEC3 nsec3...
method nsec3hash (line 210) | static byte[] nsec3hash(DigestCalculator digestCalculator, byte[] salt...
FILE: minidns-dnssec/src/main/java/org/minidns/dnssec/algorithms/AlgorithmMap.java
class AlgorithmMap (line 26) | public final class AlgorithmMap {
method AlgorithmMap (line 35) | @SuppressWarnings("deprecation")
method getDsDigestCalculator (line 111) | public DigestCalculator getDsDigestCalculator(DigestAlgorithm algorith...
method getSignatureVerifier (line 115) | public SignatureVerifier getSignatureVerifier(SignatureAlgorithm algor...
method getNsecDigestCalculator (line 119) | public DigestCalculator getNsecDigestCalculator(HashAlgorithm algorith...
FILE: minidns-dnssec/src/main/java/org/minidns/dnssec/algorithms/DsaSignatureVerifier.java
class DsaSignatureVerifier (line 28) | class DsaSignatureVerifier extends JavaSecSignatureVerifier {
method DsaSignatureVerifier (line 31) | DsaSignatureVerifier(String algorithm) throws NoSuchAlgorithmException {
method getSignature (line 35) | @Override
method getPublicKey (line 99) | @Override
FILE: minidns-dnssec/src/main/java/org/minidns/dnssec/algorithms/EcdsaSignatureVerifier.java
class EcdsaSignatureVerifier (line 32) | abstract class EcdsaSignatureVerifier extends JavaSecSignatureVerifier {
method EcdsaSignatureVerifier (line 36) | EcdsaSignatureVerifier(BigInteger[] spec, int length, String algorithm...
method EcdsaSignatureVerifier (line 40) | EcdsaSignatureVerifier(ECParameterSpec spec, int length, String algori...
method getSignature (line 46) | @Override
method getPublicKey (line 80) | @Override
class P256SHA256 (line 104) | public static class P256SHA256 extends EcdsaSignatureVerifier {
method P256SHA256 (line 114) | P256SHA256() throws NoSuchAlgorithmException {
class P384SHA284 (line 119) | public static class P384SHA284 extends EcdsaSignatureVerifier {
method P384SHA284 (line 129) | P384SHA284() throws NoSuchAlgorithmException {
FILE: minidns-dnssec/src/main/java/org/minidns/dnssec/algorithms/EcgostSignatureVerifier.java
class EcgostSignatureVerifier (line 30) | class EcgostSignatureVerifier extends JavaSecSignatureVerifier {
method EcgostSignatureVerifier (line 43) | EcgostSignatureVerifier() throws NoSuchAlgorithmException {
method getSignature (line 47) | @Override
method getPublicKey (line 52) | @Override
method reverse (line 78) | private static void reverse(byte[] array) {
FILE: minidns-dnssec/src/main/java/org/minidns/dnssec/algorithms/JavaSecDigestCalculator.java
class JavaSecDigestCalculator (line 18) | public class JavaSecDigestCalculator implements DigestCalculator {
method JavaSecDigestCalculator (line 21) | public JavaSecDigestCalculator(String algorithm) throws NoSuchAlgorith...
method digest (line 25) | @Override
FILE: minidns-dnssec/src/main/java/org/minidns/dnssec/algorithms/JavaSecSignatureVerifier.java
class JavaSecSignatureVerifier (line 27) | public abstract class JavaSecSignatureVerifier implements SignatureVerif...
method JavaSecSignatureVerifier (line 31) | public JavaSecSignatureVerifier(String keyAlgorithm, String signatureA...
method getKeyFactory (line 39) | public KeyFactory getKeyFactory() {
method verify (line 43) | @Override
method getSignature (line 59) | protected abstract byte[] getSignature(RRSIG rrsig) throws DataMalform...
method getPublicKey (line 61) | protected abstract PublicKey getPublicKey(DNSKEY key) throws DataMalfo...
FILE: minidns-dnssec/src/main/java/org/minidns/dnssec/algorithms/RsaSignatureVerifier.java
class RsaSignatureVerifier (line 26) | class RsaSignatureVerifier extends JavaSecSignatureVerifier {
method RsaSignatureVerifier (line 27) | RsaSignatureVerifier(String algorithm) throws NoSuchAlgorithmException {
method getPublicKey (line 31) | @Override
method getSignature (line 63) | @Override
FILE: minidns-dnssec/src/test/java/org/minidns/dnssec/DnssecClientTest.java
class DnssecClientTest (line 64) | public class DnssecClientTest {
method constructDnssecClient (line 90) | public static DnssecClient constructDnssecClient() {
method checkCorrectExampleMessage (line 97) | void checkCorrectExampleMessage(DnsMessage message) {
method testBasicValid (line 104) | @Test
method testNoSEPAtKSK (line 132) | @SuppressWarnings("unchecked")
method testSingleZSK (line 162) | @SuppressWarnings("unchecked")
method testMissingDelegation (line 190) | @SuppressWarnings("unchecked")
method testUnsignedRoot (line 217) | @SuppressWarnings("unchecked")
method testNoRootSecureEntryPoint (line 240) | @SuppressWarnings("unchecked")
method testUnsignedZone (line 272) | @SuppressWarnings("unchecked")
method testInvalidDNSKEY (line 297) | @SuppressWarnings("unchecked")
method testNoDNSKEY (line 325) | @SuppressWarnings("unchecked")
method testInvalidRRSIG (line 351) | @SuppressWarnings("unchecked")
method testUnknownAlgorithm (line 388) | @SuppressWarnings({"unchecked", "JavaUtilDate"})
method testInvalidDelegation (line 419) | @SuppressWarnings("unchecked")
method testUnknownDelegationDigestType (line 448) | @SuppressWarnings("unchecked")
method testSignatureOutOfDate (line 477) | @SuppressWarnings({"unchecked", "JavaUtilDate"})
method testSignatureInFuture (line 509) | @SuppressWarnings({"unchecked", "JavaUtilDate"})
method testValidNSEC (line 541) | @SuppressWarnings("unchecked")
method testValidDLV (line 587) | @Test
FILE: minidns-dnssec/src/test/java/org/minidns/dnssec/DnssecWorld.java
class DnssecWorld (line 57) | public class DnssecWorld extends DnsWorld {
class DnssecData (line 64) | public static final class DnssecData {
method DnssecData (line 72) | private DnssecData(DnsName zone, DNSKEY ksk, PrivateKey privateKsk, ...
method getDnssecDataFor (line 83) | public static DnssecData getDnssecDataFor(CharSequence zone) {
method getDnssecDataFor (line 87) | public static DnssecData getDnssecDataFor(DnsName zone) {
method signedRootZone (line 105) | public static Zone signedRootZone(SignedRRSet... rrSets) {
method signedZone (line 109) | public static Zone signedZone(String zoneName, String nsName, String n...
method signedZone (line 119) | public static Zone signedZone(String zoneName, InetAddress address, Si...
method merge (line 123) | public static List<Record<? extends Data>> merge(SignedRRSet... rrSets) {
method sign (line 132) | @SuppressWarnings("varargs")
method sign (line 138) | @SuppressWarnings("varargs")
method sign (line 144) | @SuppressWarnings("varargs")
method sign (line 150) | @SafeVarargs
method sign (line 155) | @SuppressWarnings("varargs")
method selfSignDnskeyRrSet (line 179) | public static SignedRRSet selfSignDnskeyRrSet(CharSequence zone) {
method selfSignDnskeyRrSet (line 183) | public static SignedRRSet selfSignDnskeyRrSet(DnsName zone) {
class SignedRRSet (line 190) | public static class SignedRRSet {
method SignedRRSet (line 194) | public SignedRRSet(Record<? extends Data>[] records, Record<RRSIG> s...
method rrsigRecord (line 201) | @SafeVarargs
method rrsigRecord (line 206) | @SuppressWarnings({"unchecked", "JavaUtilDate"})
method rrsigRecord (line 218) | @SuppressWarnings("unchecked")
method ds (line 226) | public static Record<DS> ds(CharSequence zone) {
method ds (line 230) | public static Record<DS> ds(DnsName zone) {
method ds (line 235) | public static DS ds(String name, DigestAlgorithm digestType, DNSKEY dn...
method ds (line 239) | public static DS ds(DnsName name, DigestAlgorithm digestType, DNSKEY d...
method dlv (line 243) | public static DLV dlv(String name, DigestAlgorithm digestType, DNSKEY ...
method dlv (line 247) | public static DLV dlv(DnsName name, DigestAlgorithm digestType, DNSKEY...
method calculateDsDigest (line 251) | public static byte[] calculateDsDigest(DnsName name, DigestAlgorithm d...
method sign (line 262) | @SuppressWarnings("deprecation")
method convertAsn1ToRFC (line 316) | public static byte[] convertAsn1ToRFC(DSAPrivateKey privateKey, byte[]...
method streamAsn1Int (line 327) | public static void streamAsn1Int(DataInputStream dis, DataOutputStream...
method generatePrivateKey (line 348) | @SuppressWarnings("deprecation")
method generateRSAPrivateKey (line 365) | public static PrivateKey generateRSAPrivateKey(int length, BigInteger ...
method generateDSAPrivateKey (line 376) | public static PrivateKey generateDSAPrivateKey(int length) {
method publicKey (line 387) | @SuppressWarnings("deprecation")
method getDSAPublicKey (line 404) | private static byte[] getDSAPublicKey(DSAPrivateKey privateKey) {
method getRSAPublicKey (line 428) | public static byte[] getRSAPublicKey(RSAPrivateCrtKey privateKey) {
method toUnsignedByteArray (line 447) | private static byte[] toUnsignedByteArray(BigInteger bigInteger) {
method toUnsignedByteArray (line 457) | private static byte[] toUnsignedByteArray(BigInteger bigInteger, int l...
class AddressedNsecResponse (line 473) | public static class AddressedNsecResponse implements PreparedResponse {
method AddressedNsecResponse (line 481) | public AddressedNsecResponse(InetAddress address, DnsMessage nsecMes...
method isResponse (line 488) | @Override
method getResponse (line 501) | @Override
method toString (line 506) | @Override
method addNsec (line 513) | public static void addNsec(DnsWorld dnsWorld, CharSequence zone, CharS...
method addNsec (line 519) | public static void addNsec(DnsWorld dnsWorld, DnsName zone, DnsName zo...
FILE: minidns-dnssec/src/test/java/org/minidns/dnssec/VerifierTest.java
class VerifierTest (line 33) | public class VerifierTest {
method testNsecMatches (line 35) | @Test
method testVerifyNsec (line 53) | @Test
method testVerifyNsec3 (line 62) | @Test
method testNsec3hash (line 71) | @Test
FILE: minidns-dnssec/src/test/java/org/minidns/dnssec/algorithms/AlgorithmTest.java
class AlgorithmTest (line 13) | public class AlgorithmTest {
FILE: minidns-dnssec/src/test/java/org/minidns/dnssec/algorithms/DigestTest.java
class DigestTest (line 24) | public class DigestTest extends AlgorithmTest {
method testSha1DsDigest (line 26) | @Test
method testSha256DsDigest (line 34) | @Test
method testSha1nsec3Digest (line 42) | @Test
method digestHexString (line 50) | private static String digestHexString(DigestCalculator digestCalculato...
FILE: minidns-dnssec/src/test/java/org/minidns/dnssec/algorithms/DsaSingatureVerifierTest.java
class DsaSingatureVerifierTest (line 23) | public class DsaSingatureVerifierTest extends SignatureVerifierTest {
method testDSA1024Valid (line 26) | @Test
method testDSA512Valid (line 31) | @Test
method testDSAIllegalSignature (line 36) | @Test
method testDSAIllegalPublicKey (line 44) | @Test
method testDSAWrongSignature (line 53) | @Test
FILE: minidns-dnssec/src/test/java/org/minidns/dnssec/algorithms/RsaSignatureVerifierTest.java
class RsaSignatureVerifierTest (line 26) | public class RsaSignatureVerifierTest extends SignatureVerifierTest {
method testShortExponentSHA1RSAValid (line 27) | @Test
method testLongExponentSHA1RSAValid (line 32) | @Test
method testSHA1RSAIllegalSignature (line 37) | @Test
method testSHA1RSAIllegalPublicKey (line 47) | @Test
method testSHA1RSAWrongSignature (line 57) | @Test
method testMD5RSAValid (line 68) | @SuppressWarnings("deprecation")
method testSHA256RSAValid (line 74) | @Test
method testSHA512RSAValid (line 79) | @Test
FILE: minidns-dnssec/src/test/java/org/minidns/dnssec/algorithms/SignatureVerifierTest.java
class SignatureVerifierTest (line 28) | public class SignatureVerifierTest extends AlgorithmTest {
method verifierTest (line 30) | protected void verifierTest(int length, SignatureAlgorithm algorithm) ...
method verifierTest (line 34) | protected void verifierTest(PrivateKey privateKey, SignatureAlgorithm ...
method assertSignatureValid (line 39) | protected static void assertSignatureValid(byte[] publicKey, Signature...
method assertSignatureInvalid (line 44) | protected static void assertSignatureInvalid(byte[] publicKey, Signatu...
method verify (line 49) | private static boolean verify(byte[] publicKey, SignatureAlgorithm alg...
method getRandomBytes (line 58) | protected static byte[] getRandomBytes() {
FILE: minidns-hla/src/main/java/org/minidns/hla/DnssecResolverApi.java
class DnssecResolverApi (line 29) | public class DnssecResolverApi extends ResolverApi {
method DnssecResolverApi (line 37) | public DnssecResolverApi() {
method DnssecResolverApi (line 46) | public DnssecResolverApi(MiniDnsCacheFactory cacheFactory) {
method DnssecResolverApi (line 50) | private DnssecResolverApi(DnssecClient dnssecClient, MiniDnsCacheFacto...
method resolve (line 63) | @Override
method resolveDnssecReliable (line 79) | public <D extends Data> ResolverResult<D> resolveDnssecReliable(String...
method resolveDnssecReliable (line 93) | public <D extends Data> ResolverResult<D> resolveDnssecReliable(DnsNam...
method resolveDnssecReliable (line 107) | public <D extends Data> ResolverResult<D> resolveDnssecReliable(Questi...
method getDnssecClient (line 115) | public DnssecClient getDnssecClient() {
method toResolverResult (line 119) | private static <D extends Data> ResolverResult<D> toResolverResult(Que...
FILE: minidns-hla/src/main/java/org/minidns/hla/ResolutionUnsuccessfulException.java
class ResolutionUnsuccessfulException (line 17) | public class ResolutionUnsuccessfulException extends MiniDnsException {
method ResolutionUnsuccessfulException (line 27) | public ResolutionUnsuccessfulException(Question question, RESPONSE_COD...
FILE: minidns-hla/src/main/java/org/minidns/hla/ResolverApi.java
class ResolverApi (line 97) | public class ResolverApi {
method ResolverApi (line 103) | public ResolverApi(AbstractDnsClient dnsClient) {
method resolve (line 107) | public final <D extends Data> ResolverResult<D> resolve(String name, C...
method resolve (line 111) | public final <D extends Data> ResolverResult<D> resolve(DnsName name, ...
method resolve (line 117) | public <D extends Data> ResolverResult<D> resolve(Question question) t...
method resolveSrv (line 123) | public SrvResolverResult resolveSrv(SrvType type, String serviceName) ...
method resolveSrv (line 127) | public SrvResolverResult resolveSrv(SrvType type, DnsName serviceName)...
method resolveSrv (line 131) | public SrvResolverResult resolveSrv(SrvService service, SrvProto proto...
method resolveSrv (line 135) | public SrvResolverResult resolveSrv(SrvService service, SrvProto proto...
method resolveSrv (line 139) | public SrvResolverResult resolveSrv(DnsLabel service, DnsLabel proto, ...
method resolveSrv (line 144) | public SrvResolverResult resolveSrv(String name) throws IOException {
method reverseLookup (line 148) | public ResolverResult<PTR> reverseLookup(CharSequence inetAddressCs) t...
method reverseLookup (line 153) | public ResolverResult<PTR> reverseLookup(InetAddress inetAddress) thro...
method reverseLookup (line 163) | public ResolverResult<PTR> reverseLookup(Inet4Address inet4Address) th...
method reverseLookup (line 168) | public ResolverResult<PTR> reverseLookup(Inet6Address inet6Address) th...
method resolveSrv (line 186) | public SrvResolverResult resolveSrv(DnsName srvDnsName) throws IOExcep...
method resolveSrv (line 212) | public SrvResolverResult resolveSrv(DnsName name, SrvServiceProto srvS...
method getClient (line 219) | public final AbstractDnsClient getClient() {
FILE: minidns-hla/src/main/java/org/minidns/hla/ResolverResult.java
class ResolverResult (line 26) | public class ResolverResult<D extends Data> {
method ResolverResult (line 36) | ResolverResult(Question question, DnsQueryResult result, Set<DnssecUnv...
method wasSuccessful (line 65) | public boolean wasSuccessful() {
method getAnswers (line 69) | public Set<D> getAnswers() {
method getAnswersOrEmptySet (line 74) | public Set<D> getAnswersOrEmptySet() {
method getResponseCode (line 78) | public RESPONSE_CODE getResponseCode() {
method isAuthenticData (line 82) | public boolean isAuthenticData() {
method getUnverifiedReasons (line 92) | public Set<DnssecUnverifiedReason> getUnverifiedReasons() {
method getQuestion (line 97) | public Question getQuestion() {
method throwIfErrorResponse (line 101) | public void throwIfErrorResponse() throws ResolutionUnsuccessfulExcept...
method getResolutionUnsuccessfulException (line 108) | public ResolutionUnsuccessfulException getResolutionUnsuccessfulExcept...
method getDnssecResultNotAuthenticException (line 120) | public DnssecResultNotAuthenticException getDnssecResultNotAuthenticEx...
method getRawAnswer (line 139) | public DnsMessage getRawAnswer() {
method getDnsQueryResult (line 143) | public DnsQueryResult getDnsQueryResult() {
method toString (line 147) | @Override
method hasUnverifiedReasons (line 168) | boolean hasUnverifiedReasons() {
method throwIseIfErrorResponse (line 172) | protected void throwIseIfErrorResponse() {
FILE: minidns-hla/src/main/java/org/minidns/hla/SrvResolverResult.java
class SrvResolverResult (line 32) | public class SrvResolverResult extends ResolverResult<SRV> {
method SrvResolverResult (line 40) | SrvResolverResult(ResolverResult<SRV> srvResult, SrvServiceProto srvSe...
method getSortedSrvResolvedAddresses (line 55) | public List<ResolvedSrvRecord> getSortedSrvResolvedAddresses() throws ...
method isServiceDecidedlyNotAvailableAtThisDomain (line 127) | public boolean isServiceDecidedlyNotAvailableAtThisDomain() {
class ResolvedSrvRecord (line 137) | public static final class ResolvedSrvRecord {
method ResolvedSrvRecord (line 150) | private ResolvedSrvRecord(DnsName name, SrvServiceProto srvServicePr...
method sortMultiple (line 171) | @SafeVarargs
FILE: minidns-hla/src/main/java/org/minidns/hla/srv/SrvProto.java
type SrvProto (line 15) | public enum SrvProto {
method SrvProto (line 26) | SrvProto() {
FILE: minidns-hla/src/main/java/org/minidns/hla/srv/SrvService.java
type SrvService (line 15) | public enum SrvService {
method SrvService (line 40) | SrvService() {
FILE: minidns-hla/src/main/java/org/minidns/hla/srv/SrvServiceProto.java
class SrvServiceProto (line 18) | public class SrvServiceProto {
method SrvServiceProto (line 23) | public SrvServiceProto(DnsLabel service, DnsLabel proto) {
FILE: minidns-hla/src/main/java/org/minidns/hla/srv/SrvType.java
type SrvType (line 13) | public enum SrvType {
method SrvType (line 24) | SrvType(SrvService service, SrvProto proto) {
FILE: minidns-hla/src/test/java/org/minidns/hla/MiniDnsHlaTest.java
class MiniDnsHlaTest (line 15) | public class MiniDnsHlaTest {
method nopTest (line 20) | @Test
FILE: minidns-integration-test/src/main/java/org/minidns/integrationtest/AsyncApiTest.java
class AsyncApiTest (line 26) | public class AsyncApiTest {
method main (line 28) | public static void main(String[] args) throws IOException {
method simpleAsyncApiTest (line 32) | public static void simpleAsyncApiTest() throws IOException {
method tcpAsyncApiTest (line 42) | public static void tcpAsyncApiTest() throws IOException {
FILE: minidns-integration-test/src/main/java/org/minidns/integrationtest/CoreTest.java
class CoreTest (line 28) | public class CoreTest {
method testExampleCom (line 29) | @IntegrationTest
method testTcpAnswer (line 49) | @IntegrationTest
FILE: minidns-integration-test/src/main/java/org/minidns/integrationtest/DaneTest.java
class DaneTest (line 23) | public class DaneTest {
method testOarcDaneGood (line 25) | @Ignore
method testOarcDaneBadHash (line 32) | @Ignore
method testOarcDaneBadParams (line 39) | @Ignore
FILE: minidns-integration-test/src/main/java/org/minidns/integrationtest/DnssecTest.java
class DnssecTest (line 26) | public class DnssecTest {
method testOarcDaneBadSig (line 28) | @Ignore
method testUniDueSigOk (line 35) | @IntegrationTest
method testUniDueSigFail (line 41) | @IntegrationTest(expected = DnssecValidationFailedException.class)
method testCloudFlare (line 47) | @IntegrationTest
method assertAuthentic (line 53) | private static void assertAuthentic(DnssecQueryResult dnssecMessage) {
FILE: minidns-integration-test/src/main/java/org/minidns/integrationtest/HlaTest.java
class HlaTest (line 27) | public class HlaTest {
method resolverTest (line 29) | @IntegrationTest
method idnSrvTest (line 38) | @IntegrationTest
method resolveSrvTest (line 51) | @IntegrationTest
FILE: minidns-integration-test/src/main/java/org/minidns/integrationtest/IntegrationTestHelper.java
class IntegrationTestHelper (line 28) | public class IntegrationTestHelper {
type TestResult (line 36) | enum TestResult {
method main (line 52) | public static void main(String[] args) {
method invokeTest (line 102) | public static TestResult invokeTest(Method method, Class<?> aClass) {
FILE: minidns-integration-test/src/main/java/org/minidns/integrationtest/IntegrationTestTools.java
class IntegrationTestTools (line 20) | public class IntegrationTestTools {
type CacheConfig (line 22) | public enum CacheConfig {
method getClient (line 29) | public static DnssecClient getClient(CacheConfig cacheConfig) {
FILE: minidns-integration-test/src/main/java/org/minidns/integrationtest/IterativeDnssecTest.java
class IterativeDnssecTest (line 25) | public class IterativeDnssecTest {
method shouldRequireLessQueries (line 30) | @IntegrationTest
method getClient (line 50) | private static DnssecClient getClient(CacheConfig cacheConfig) {
FILE: minidns-integration-test/src/main/java/org/minidns/integrationtest/NsidTest.java
class NsidTest (line 27) | public class NsidTest {
method testNsidLRoot (line 29) | @IntegrationTest
FILE: minidns-integration-test/src/main/java/org/minidns/jul/MiniDnsJul.java
class MiniDnsJul (line 29) | @SuppressWarnings("DateFormatConstant")
method format (line 58) | @Override
method enableMiniDnsTrace (line 109) | public static void enableMiniDnsTrace() {
method enableMiniDnsTrace (line 113) | public static void enableMiniDnsTrace(boolean shortLog) {
method disableMiniDnsTrace (line 118) | public static void disableMiniDnsTrace() {
FILE: minidns-integration-test/src/test/java/org/minidns/integrationtest/IntegrationTestTest.java
class IntegrationTestTest (line 15) | public class IntegrationTestTest {
method emptyTest (line 19) | @Test
FILE: minidns-iterative-resolver/src/main/java/org/minidns/iterative/IterativeClientException.java
class IterativeClientException (line 21) | public abstract class IterativeClientException extends MiniDnsException {
method IterativeClientException (line 28) | protected IterativeClientException(String message) {
class LoopDetected (line 32) | public static class LoopDetected extends IterativeClientException {
method LoopDetected (line 42) | public LoopDetected(InetAddress address, Question question) {
class MaxIterativeStepsReached (line 50) | public static class MaxIterativeStepsReached extends IterativeClientEx...
method MaxIterativeStepsReached (line 57) | public MaxIterativeStepsReached() {
class NotAuthoritativeNorGlueRrFound (line 63) | public static class NotAuthoritativeNorGlueRrFound extends IterativeCl...
method NotAuthoritativeNorGlueRrFound (line 74) | public NotAuthoritativeNorGlueRrFound(DnsMessage request, DnsQueryRe...
method getRequest (line 81) | public DnsMessage getRequest() {
method getResult (line 85) | public DnsQueryResult getResult() {
method getAuthoritativeZone (line 89) | public DnsName getAuthoritativeZone() {
FILE: minidns-iterative-resolver/src/main/java/org/minidns/iterative/IterativeDnsClient.java
class IterativeDnsClient (line 49) | public class IterativeDnsClient extends AbstractDnsClient {
method IterativeDnsClient (line 56) | public IterativeDnsClient() {
method IterativeDnsClient (line 65) | public IterativeDnsClient(DnsCache cache) {
method query (line 76) | @Override
method getTargets (line 84) | private static InetAddress[] getTargets(Collection<? extends InternetA...
method queryRecursive (line 116) | private DnsQueryResult queryRecursive(ResolutionState resolutionState,...
method queryRecursive (line 199) | private DnsQueryResult queryRecursive(ResolutionState resolutionState,...
method resolveIpRecursive (line 286) | private IpResultSet resolveIpRecursive(ResolutionState resolutionState...
method searchAdditional (line 330) | @SuppressWarnings("incomplete-switch")
method inetAddressFromRecord (line 351) | private static InetAddress inetAddressFromRecord(String name, A record...
method inetAddressFromRecord (line 360) | private static InetAddress inetAddressFromRecord(String name, AAAA rec...
method getRootServer (line 369) | public static List<InetAddress> getRootServer(char rootServerId) {
method getRootServer (line 373) | public static List<InetAddress> getRootServer(char rootServerId, IpVer...
method isResponseCacheable (line 408) | @Override
method newQuestion (line 413) | @Override
method newIpResultSetBuilder (line 420) | private IpResultSet.Builder newIpResultSetBuilder() {
class IpResultSet (line 424) | private static final class IpResultSet {
method IpResultSet (line 428) | private IpResultSet(List<InetAddress> ipv4Addresses, List<InetAddres...
class Builder (line 481) | private static final class Builder {
method Builder (line 486) | private Builder(Random random) {
method build (line 490) | public IpResultSet build() {
method abortIfFatal (line 496) | protected static void abortIfFatal(IOException ioException) throws IOE...
FILE: minidns-iterative-resolver/src/main/java/org/minidns/iterative/ReliableDnsClient.java
class ReliableDnsClient (line 32) | public class ReliableDnsClient extends AbstractDnsClient {
type Mode (line 34) | public enum Mode {
method ReliableDnsClient (line 56) | public ReliableDnsClient(DnsCache dnsCache) {
method ReliableDnsClient (line 86) | public ReliableDnsClient() {
method query (line 90) | @Override
method newQuestion (line 145) | @Override
method isResponseCacheable (line 150) | @Override
method isResponseAcceptable (line 163) | protected String isResponseAcceptable(DnsMessage response) {
method setDataSource (line 167) | @Override
method setMode (line 179) | public void setMode(Mode mode) {
method setUseHardcodedDnsServers (line 186) | public void setUseHardcodedDnsServers(boolean useHardcodedDnsServers) {
FILE: minidns-iterative-resolver/src/main/java/org/minidns/iterative/ResolutionState.java
class ResolutionState (line 23) | public class ResolutionState {
method ResolutionState (line 29) | ResolutionState(IterativeDnsClient recursiveDnsClient) {
method recurse (line 33) | void recurse(InetAddress address, DnsMessage query) throws LoopDetecte...
method decrementSteps (line 49) | void decrementSteps() {
FILE: minidns-iterative-resolver/src/test/java/org/minidns/iterative/IterativeDnsClientTest.java
class IterativeDnsClientTest (line 35) | public class IterativeDnsClientTest {
method basicIterativeTest (line 37) | @Test
method loopIterativeTest (line 59) | @Test
method notGluedNsTest (line 80) | @Test
FILE: minidns-repl/src/main/java/org/minidns/minidnsrepl/DnssecStats.java
class DnssecStats (line 25) | public class DnssecStats {
method iterativeDnssecLookupNormalVsExtendedCache (line 30) | public static void iterativeDnssecLookupNormalVsExtendedCache() throws...
method iterativeDnssecLookup (line 35) | private static void iterativeDnssecLookup(CacheConfig cacheConfig) thr...
method iterativeDnsssecTest (line 53) | public static void iterativeDnsssecTest() throws SecurityException, Il...
FILE: minidns-repl/src/main/java/org/minidns/minidnsrepl/MiniDnsRepl.java
class MiniDnsRepl (line 28) | public class MiniDnsRepl {
method init (line 48) | public static void init() {
method clearCache (line 54) | public static void clearCache() throws SecurityException, IllegalArgum...
method main (line 58) | public static void main(String[] args) throws IOException, SecurityExc...
method writeToFile (line 81) | public static void writeToFile(DnsMessage dnsMessage, String path) thr...
FILE: minidns-repl/src/main/java/org/minidns/minidnsrepl/MiniDnsStats.java
class MiniDnsStats (line 27) | public class MiniDnsStats {
method main (line 29) | public static void main(String[] args) throws IOException {
method showDnssecStats (line 33) | public static void showDnssecStats() throws IOException {
method showDnssecStats (line 37) | public static void showDnssecStats(String name, TYPE type) throws IOEx...
method gatherStatsFor (line 61) | public static StringBuilder gatherStatsFor(DnssecClient client, String...
method getClient (line 82) | public static DnssecClient getClient(CacheConfig cacheConfig) {
method getStats (line 86) | public static StringBuilder getStats(AbstractDnsClient client) {
FILE: minidns-repl/src/test/java/org/minidns/minidnsrepl/ReplTest.java
class ReplTest (line 15) | public class ReplTest {
method emptyTest (line 19) | @Test
Condensed preview — 231 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (889K chars).
[
{
"path": ".github/workflows/ci.yml",
"chars": 2589,
"preview": "name: CI\n\non: [push, pull_request]\n\njobs:\n build:\n name: Build MiniDNS\n\n runs-on: ubuntu-24.04\n strategy:\n "
},
{
"path": ".gitignore",
"chars": 1383,
"preview": "# From https://github.com/github/gitignore\n\n# # # # # # # # # # # #\n# Android gitignore #\n# # # # # # # # # # # #\n\n# B"
},
{
"path": "LICENCE",
"chars": 223,
"preview": "This software may be used under the terms of (at your choice)\n- LGPL version 2 (or later) (see LICENCE_LGPL2.1 for detai"
},
{
"path": "LICENCE_APACHE",
"chars": 10175,
"preview": "\n Apache License\n Version 2.0, January 2004\n "
},
{
"path": "LICENCE_LGPL2.1",
"chars": 26524,
"preview": " GNU LESSER GENERAL PUBLIC LICENSE\n Version 2.1, February 1999\n\n Copyright (C) 19"
},
{
"path": "LICENCE_WTFPL",
"chars": 497,
"preview": " DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE \n Version 2, December 2004 \n\n Copyright (C) 2014 "
},
{
"path": "Makefile",
"chars": 495,
"preview": "GRADLE ?= ./gradlew\n\n.PHONY: all\nall: check codecov eclipse javadocAll inttest\n\n.PHONY: codecov\ncodecov:\n\t$(GRADLE) mini"
},
{
"path": "README.md",
"chars": 4117,
"preview": "MiniDNS - A DNSSEC enabled DNS library\n======================================\n\n[\n}\n\ndependencies {\n\timplementation \"biz.aQut"
},
{
"path": "build-logic/settings.gradle",
"chars": 41,
"preview": "rootProject.name = 'minidns-build-logic'\n"
},
{
"path": "build-logic/src/main/groovy/org.minidns.android-boot-classpath-conventions.gradle",
"chars": 128,
"preview": "compileJava {\n\toptions.bootstrapClasspath = files(androidBootClasspath)\n}\njavadoc {\n\tclasspath += files(androidBootClass"
},
{
"path": "build-logic/src/main/groovy/org.minidns.android-conventions.gradle",
"chars": 244,
"preview": "plugins {\n\tid 'ru.vyarus.animalsniffer'\n\tid 'org.minidns.common-conventions'\n}\ndependencies {\n\tsignature \"net.sf.android"
},
{
"path": "build-logic/src/main/groovy/org.minidns.application-conventions.gradle",
"chars": 209,
"preview": "plugins {\n\tid 'application'\n}\n\napplication {\n\tapplicationDefaultJvmArgs = [\"-enableassertions\"]\n}\n\nrun {\n\t// Pass all sy"
},
{
"path": "build-logic/src/main/groovy/org.minidns.common-conventions.gradle",
"chars": 1107,
"preview": "ext {\n\tjavaVersion = JavaVersion.VERSION_11\n\tjavaMajor = javaVersion.getMajorVersion()\n\tminAndroidSdk = 19\n\n\tandroidBoot"
},
{
"path": "build-logic/src/main/groovy/org.minidns.java-conventions.gradle",
"chars": 7442,
"preview": "plugins {\n\tid 'biz.aQute.bnd.builder'\n\tid 'checkstyle'\n\tid 'eclipse'\n\tid 'idea'\n\tid 'jacoco'\n\tid 'java'\n\tid 'java-librar"
},
{
"path": "build-logic/src/main/groovy/org.minidns.javadoc-conventions.gradle",
"chars": 832,
"preview": "plugins {\n\t// Javadoc linking requires repositories to bet configured. And\n\t// those are declared in common-conventions,"
},
{
"path": "build.gradle",
"chars": 1895,
"preview": "plugins {\n\t// The scalastyle plugin of smack-repl wants the root project to\n\t// have a ideaProject task, so let's add on"
},
{
"path": "config/checkstyle/checkstyle.xml",
"chars": 6118,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE module PUBLIC\n \"-//Puppy Crawl//DTD Check Configuration 1.3//EN\"\n "
},
{
"path": "config/checkstyle/header.txt",
"chars": 413,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "config/checkstyle/suppressions.xml",
"chars": 304,
"preview": "<?xml version=\"1.0\"?>\n<!DOCTYPE suppressions PUBLIC\n \"-//Puppy Crawl//DTD Suppressions 1.1//EN\"\n \"http://www.puppy"
},
{
"path": "config/scalaStyle.xml",
"chars": 7414,
"preview": "<scalastyle commentFilter=\"enabled\">\n <name>Scalastyle standard configuration</name>\n <check level=\"error\" class=\"org.sc"
},
{
"path": "gradle/wrapper/gradle-wrapper.properties",
"chars": 253,
"preview": "distributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributi"
},
{
"path": "gradle.properties.example",
"chars": 559,
"preview": "# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #\n#\n# GPG settings\n#\n\n# gpg key id\n#signing."
},
{
"path": "gradlew",
"chars": 8739,
"preview": "#!/bin/sh\n\n#\n# Copyright © 2015-2021 the original authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "gradlew.bat",
"chars": 2966,
"preview": "@rem\r\n@rem Copyright 2015 the original author or authors.\r\n@rem\r\n@rem Licensed under the Apache License, Version 2.0 (th"
},
{
"path": "minidns-android23/build.gradle",
"chars": 629,
"preview": "plugins {\n\tid 'org.minidns.java-conventions'\n\tid 'org.minidns.android-conventions'\n}\n\next {\n\tmyAndroidSdkApi = 23\n\tandro"
},
{
"path": "minidns-android23/src/main/java/org/minidns/dnsserverlookup/android21/AndroidUsingLinkProperties.java",
"chars": 4545,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-android23/src/test/java/org/minidns/dnsserverlookup/android21/AndroidUsingLinkPropertiesTest.java",
"chars": 657,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-async/build.gradle",
"chars": 281,
"preview": "plugins {\n\tid 'org.minidns.java-conventions'\n\tid 'org.minidns.android-conventions'\n}\n\ndescription = \"Asynchronous DNS lo"
},
{
"path": "minidns-async/src/main/java/org/minidns/source/async/AsyncDnsRequest.java",
"chars": 19479,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-async/src/main/java/org/minidns/source/async/AsyncNetworkDataSource.java",
"chars": 12355,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-async/src/main/java/org/minidns/source/async/ChannelSelectedHandler.java",
"chars": 1440,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-async/src/test/java/org/minidns/source/async/AsyncNetworkDataSourceTest.java",
"chars": 640,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-client/build.gradle",
"chars": 597,
"preview": "plugins {\n\tid 'org.minidns.java-conventions'\n\tid 'org.minidns.android-conventions'\n}\n\ndescription = \"A small non-recursi"
},
{
"path": "minidns-client/src/main/java/org/minidns/AbstractDnsClient.java",
"chars": 16982,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-client/src/main/java/org/minidns/DnsCache.java",
"chars": 1725,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-client/src/main/java/org/minidns/DnsClient.java",
"chars": 20259,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-client/src/main/java/org/minidns/MiniDnsConfiguration.java",
"chars": 567,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-client/src/main/java/org/minidns/MiniDnsException.java",
"chars": 3274,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-client/src/main/java/org/minidns/MiniDnsFuture.java",
"chars": 9209,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-client/src/main/java/org/minidns/MiniDnsInitialization.java",
"chars": 1658,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-client/src/main/java/org/minidns/RrSet.java",
"chars": 3023,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-client/src/main/java/org/minidns/cache/ExtendedLruCache.java",
"chars": 5370,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-client/src/main/java/org/minidns/cache/FullLruCache.java",
"chars": 1152,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-client/src/main/java/org/minidns/cache/LruCache.java",
"chars": 4830,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-client/src/main/java/org/minidns/cache/MiniDnsCacheFactory.java",
"chars": 539,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-client/src/main/java/org/minidns/dnsqueryresult/CachedDnsQueryResult.java",
"chars": 1110,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-client/src/main/java/org/minidns/dnsqueryresult/DirectCachedDnsQueryResult.java",
"chars": 713,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-client/src/main/java/org/minidns/dnsqueryresult/DnsQueryResult.java",
"chars": 1375,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-client/src/main/java/org/minidns/dnsqueryresult/StandardDnsQueryResult.java",
"chars": 939,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-client/src/main/java/org/minidns/dnsqueryresult/SynthesizedCachedDnsQueryResult.java",
"chars": 766,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-client/src/main/java/org/minidns/dnsserverlookup/AbstractDnsServerLookupMechanism.java",
"chars": 1836,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-client/src/main/java/org/minidns/dnsserverlookup/AndroidUsingExec.java",
"chars": 3817,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-client/src/main/java/org/minidns/dnsserverlookup/AndroidUsingReflection.java",
"chars": 3355,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-client/src/main/java/org/minidns/dnsserverlookup/DnsServerLookupMechanism.java",
"chars": 1091,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-client/src/main/java/org/minidns/dnsserverlookup/UnixUsingEtcResolvConf.java",
"chars": 3624,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-client/src/main/java/org/minidns/source/AbstractDnsDataSource.java",
"chars": 3217,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-client/src/main/java/org/minidns/source/DnsDataSource.java",
"chars": 1455,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-client/src/main/java/org/minidns/source/NetworkDataSource.java",
"chars": 5807,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-client/src/main/java/org/minidns/source/NetworkDataSourceWithAccounting.java",
"chars": 6248,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-client/src/main/resources/de.measite.minidns/.keep",
"chars": 0,
"preview": ""
},
{
"path": "minidns-client/src/test/java/org/minidns/DnsClientTest.java",
"chars": 4737,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-client/src/test/java/org/minidns/DnsWorld.java",
"chars": 23080,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-client/src/test/java/org/minidns/LruCacheTest.java",
"chars": 3488,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-client/src/test/java/org/minidns/dnsqueryresult/TestWorldDnsQueryResult.java",
"chars": 1000,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-client/src/test/java/org/minidns/dnsserverlookup/AndroidUsingExecTest.java",
"chars": 1212,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-client/src/test/java/org/minidns/source/NetworkDataSourceTest.java",
"chars": 2012,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/build.gradle",
"chars": 546,
"preview": "plugins {\n\tid 'org.minidns.java-conventions'\n\tid 'org.minidns.android-conventions'\n}\n\ndescription = \"MiniDNS' core class"
},
{
"path": "minidns-core/src/main/java/org/minidns/constants/DnsRootServer.java",
"chars": 5425,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/main/java/org/minidns/constants/DnssecConstants.java",
"chars": 3173,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/main/java/org/minidns/dnslabel/ALabel.java",
"chars": 718,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/main/java/org/minidns/dnslabel/DnsLabel.java",
"chars": 9097,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/main/java/org/minidns/dnslabel/FakeALabel.java",
"chars": 555,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/main/java/org/minidns/dnslabel/LdhLabel.java",
"chars": 2939,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/main/java/org/minidns/dnslabel/LeadingOrTrailingHyphenLabel.java",
"chars": 993,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/main/java/org/minidns/dnslabel/NonLdhLabel.java",
"chars": 1049,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/main/java/org/minidns/dnslabel/NonReservedLdhLabel.java",
"chars": 1081,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/main/java/org/minidns/dnslabel/OtherNonLdhLabel.java",
"chars": 694,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/main/java/org/minidns/dnslabel/ReservedLdhLabel.java",
"chars": 1131,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/main/java/org/minidns/dnslabel/UnderscoreLabel.java",
"chars": 740,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/main/java/org/minidns/dnslabel/XnLabel.java",
"chars": 1540,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/main/java/org/minidns/dnsmessage/DnsMessage.java",
"chars": 42671,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/main/java/org/minidns/dnsmessage/Question.java",
"chars": 5257,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/main/java/org/minidns/dnsname/DnsName.java",
"chars": 20302,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/main/java/org/minidns/dnsname/InvalidDnsNameException.java",
"chars": 2106,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/main/java/org/minidns/edns/Edns.java",
"chars": 6826,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/main/java/org/minidns/edns/EdnsOption.java",
"chars": 2363,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/main/java/org/minidns/edns/Nsid.java",
"chars": 1175,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/main/java/org/minidns/edns/UnknownEdnsOption.java",
"chars": 1003,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/main/java/org/minidns/idna/DefaultIdnaTransformator.java",
"chars": 1186,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/main/java/org/minidns/idna/IdnaTransformator.java",
"chars": 552,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/main/java/org/minidns/idna/MiniDnsIdna.java",
"chars": 1029,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/main/java/org/minidns/record/A.java",
"chars": 1915,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/main/java/org/minidns/record/AAAA.java",
"chars": 1774,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/main/java/org/minidns/record/CNAME.java",
"chars": 1083,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/main/java/org/minidns/record/DLV.java",
"chars": 1452,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/main/java/org/minidns/record/DNAME.java",
"chars": 1156,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/main/java/org/minidns/record/DNSKEY.java",
"chars": 5668,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/main/java/org/minidns/record/DS.java",
"chars": 1649,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/main/java/org/minidns/record/Data.java",
"chars": 2865,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/main/java/org/minidns/record/DelegatingDnssecRR.java",
"chars": 5305,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/main/java/org/minidns/record/InternetAddressRR.java",
"chars": 2222,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/main/java/org/minidns/record/MX.java",
"chars": 1862,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/main/java/org/minidns/record/NS.java",
"chars": 953,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/main/java/org/minidns/record/NSEC.java",
"chars": 5301,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/main/java/org/minidns/record/NSEC3.java",
"chars": 6764,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/main/java/org/minidns/record/NSEC3PARAM.java",
"chars": 3151,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/main/java/org/minidns/record/OPENPGPKEY.java",
"chars": 1684,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/main/java/org/minidns/record/OPT.java",
"chars": 2236,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/main/java/org/minidns/record/PTR.java",
"chars": 1034,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/main/java/org/minidns/record/RRSIG.java",
"chars": 7396,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/main/java/org/minidns/record/RRWithTarget.java",
"chars": 1214,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/main/java/org/minidns/record/Record.java",
"chars": 18947,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/main/java/org/minidns/record/SOA.java",
"chars": 3709,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/main/java/org/minidns/record/SRV.java",
"chars": 2918,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/main/java/org/minidns/record/TLSA.java",
"chars": 5977,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/main/java/org/minidns/record/TXT.java",
"chars": 3094,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/main/java/org/minidns/record/UNKNOWN.java",
"chars": 1243,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/main/java/org/minidns/util/Base32.java",
"chars": 1868,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/main/java/org/minidns/util/Base64.java",
"chars": 1509,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/main/java/org/minidns/util/CallbackRecipient.java",
"chars": 789,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/main/java/org/minidns/util/CollectionsUtil.java",
"chars": 886,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/main/java/org/minidns/util/ExceptionCallback.java",
"chars": 524,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/main/java/org/minidns/util/Hex.java",
"chars": 695,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/main/java/org/minidns/util/InetAddressUtil.java",
"chars": 4766,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/main/java/org/minidns/util/MultipleIoException.java",
"chars": 2172,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/main/java/org/minidns/util/NameUtil.java",
"chars": 1265,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/main/java/org/minidns/util/PlatformDetection.java",
"chars": 848,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/main/java/org/minidns/util/SafeCharSequence.java",
"chars": 1095,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/main/java/org/minidns/util/SrvUtil.java",
"chars": 4563,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/main/java/org/minidns/util/SuccessCallback.java",
"chars": 512,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/test/java/org/minidns/Assert.java",
"chars": 1480,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/test/java/org/minidns/dnslabel/DnsLabelTest.java",
"chars": 3650,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/test/java/org/minidns/dnsmessage/DnsMessageTest.java",
"chars": 26058,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/test/java/org/minidns/dnsname/DnsNameTest.java",
"chars": 7261,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/test/java/org/minidns/record/RecordsTest.java",
"chars": 13030,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/test/java/org/minidns/record/TLSATest.java",
"chars": 1040,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/test/java/org/minidns/util/Base32Test.java",
"chars": 967,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/test/java/org/minidns/util/Base64Test.java",
"chars": 932,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/test/java/org/minidns/util/InetAddressUtilTest.java",
"chars": 3971,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/test/java/org/minidns/util/NameUtilTest.java",
"chars": 1281,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-core/src/test/java/org/minidns/util/SrvUtilTest.java",
"chars": 3831,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-dane/build.gradle",
"chars": 339,
"preview": "plugins {\n\tid 'org.minidns.java-conventions'\n}\n\ndescription = \"Support for DANE using APIs of Java 7 (or higher)\"\n\ndepen"
},
{
"path": "minidns-dane/src/main/java/org/minidns/dane/java7/DaneExtendedTrustManager.java",
"chars": 6896,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-dane/src/test/java/org/minidns/dane/java7/DaneJava7Test.java",
"chars": 629,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-dnssec/build.gradle",
"chars": 328,
"preview": "plugins {\n\tid 'org.minidns.java-conventions'\n\tid 'org.minidns.android-conventions'\n}\n\ndescription = \"MiniDNS' client wit"
},
{
"path": "minidns-dnssec/src/main/java/org/minidns/dane/DaneCertificateException.java",
"chars": 2031,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-dnssec/src/main/java/org/minidns/dane/DaneVerifier.java",
"chars": 12499,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-dnssec/src/main/java/org/minidns/dane/ExpectingTrustManager.java",
"chars": 2048,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-dnssec/src/main/java/org/minidns/dane/X509TrustManagerUtil.java",
"chars": 1604,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-dnssec/src/main/java/org/minidns/dnssec/DigestCalculator.java",
"chars": 513,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-dnssec/src/main/java/org/minidns/dnssec/DnssecClient.java",
"chars": 24449,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-dnssec/src/main/java/org/minidns/dnssec/DnssecQueryResult.java",
"chars": 1796,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-dnssec/src/main/java/org/minidns/dnssec/DnssecResultNotAuthenticException.java",
"chars": 1620,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-dnssec/src/main/java/org/minidns/dnssec/DnssecUnverifiedReason.java",
"chars": 5905,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-dnssec/src/main/java/org/minidns/dnssec/DnssecValidationFailedException.java",
"chars": 4967,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-dnssec/src/main/java/org/minidns/dnssec/DnssecValidatorInitializationException.java",
"chars": 718,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-dnssec/src/main/java/org/minidns/dnssec/SignatureVerifier.java",
"chars": 649,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-dnssec/src/main/java/org/minidns/dnssec/Verifier.java",
"chars": 9358,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-dnssec/src/main/java/org/minidns/dnssec/algorithms/AlgorithmMap.java",
"chars": 5406,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-dnssec/src/main/java/org/minidns/dnssec/algorithms/DsaSignatureVerifier.java",
"chars": 4366,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-dnssec/src/main/java/org/minidns/dnssec/algorithms/EcdsaSignatureVerifier.java",
"chars": 5608,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-dnssec/src/main/java/org/minidns/dnssec/algorithms/EcgostSignatureVerifier.java",
"chars": 3208,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-dnssec/src/main/java/org/minidns/dnssec/algorithms/JavaSecDigestCalculator.java",
"chars": 921,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-dnssec/src/main/java/org/minidns/dnssec/algorithms/JavaSecSignatureVerifier.java",
"chars": 2571,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-dnssec/src/main/java/org/minidns/dnssec/algorithms/RsaSignatureVerifier.java",
"chars": 2410,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-dnssec/src/main/resources/.keep-minidns-dnssec-main-resources",
"chars": 0,
"preview": ""
},
{
"path": "minidns-dnssec/src/test/java/org/minidns/dnssec/DnssecClientTest.java",
"chars": 30758,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-dnssec/src/test/java/org/minidns/dnssec/DnssecWorld.java",
"chars": 22461,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-dnssec/src/test/java/org/minidns/dnssec/VerifierTest.java",
"chars": 4196,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-dnssec/src/test/java/org/minidns/dnssec/algorithms/AlgorithmTest.java",
"chars": 598,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-dnssec/src/test/java/org/minidns/dnssec/algorithms/DigestTest.java",
"chars": 2581,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-dnssec/src/test/java/org/minidns/dnssec/algorithms/DsaSingatureVerifierTest.java",
"chars": 2268,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-dnssec/src/test/java/org/minidns/dnssec/algorithms/RsaSignatureVerifierTest.java",
"chars": 3347,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-dnssec/src/test/java/org/minidns/dnssec/algorithms/SignatureVerifierTest.java",
"chars": 2815,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-dnssec/src/test/resources/.keep-minidns-dnssec-test-resources",
"chars": 0,
"preview": ""
},
{
"path": "minidns-hla/build.gradle",
"chars": 382,
"preview": "plugins {\n\tid 'org.minidns.java-conventions'\n\tid 'org.minidns.android-conventions'\n}\n\ndescription = \"An easy to use high"
},
{
"path": "minidns-hla/src/main/java/org/minidns/hla/DnssecResolverApi.java",
"chars": 5017,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-hla/src/main/java/org/minidns/hla/ResolutionUnsuccessfulException.java",
"chars": 1070,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-hla/src/main/java/org/minidns/hla/ResolverApi.java",
"chars": 8732,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-hla/src/main/java/org/minidns/hla/ResolverResult.java",
"chars": 5926,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-hla/src/main/java/org/minidns/hla/SrvResolverResult.java",
"chars": 8202,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-hla/src/main/java/org/minidns/hla/srv/SrvProto.java",
"chars": 730,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-hla/src/main/java/org/minidns/hla/srv/SrvService.java",
"chars": 1299,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-hla/src/main/java/org/minidns/hla/srv/SrvServiceProto.java",
"chars": 835,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-hla/src/main/java/org/minidns/hla/srv/SrvType.java",
"chars": 815,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-hla/src/test/java/org/minidns/hla/MiniDnsHlaTest.java",
"chars": 619,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-integration-test/build.gradle",
"chars": 1274,
"preview": "/*\n * Copyright 2015 the original author or authors\n *\n * This software is licensed under the Apache License, Version 2."
},
{
"path": "minidns-integration-test/src/main/java/org/minidns/integrationtest/AsyncApiTest.java",
"chars": 2160,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-integration-test/src/main/java/org/minidns/integrationtest/CoreTest.java",
"chars": 2610,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-integration-test/src/main/java/org/minidns/integrationtest/DaneTest.java",
"chars": 1605,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-integration-test/src/main/java/org/minidns/integrationtest/DnssecTest.java",
"chars": 2553,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-integration-test/src/main/java/org/minidns/integrationtest/HlaTest.java",
"chars": 2110,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-integration-test/src/main/java/org/minidns/integrationtest/IntegrationTest.java",
"chars": 760,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-integration-test/src/main/java/org/minidns/integrationtest/IntegrationTestHelper.java",
"chars": 5253,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-integration-test/src/main/java/org/minidns/integrationtest/IntegrationTestTools.java",
"chars": 1497,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-integration-test/src/main/java/org/minidns/integrationtest/IterativeDnssecTest.java",
"chars": 2593,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-integration-test/src/main/java/org/minidns/integrationtest/NsidTest.java",
"chars": 1753,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-integration-test/src/main/java/org/minidns/jul/MiniDnsJul.java",
"chars": 4203,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
},
{
"path": "minidns-integration-test/src/test/java/org/minidns/integrationtest/IntegrationTestTest.java",
"chars": 640,
"preview": "/*\n * Copyright 2015-2024 the original author or authors\n *\n * This software is licensed under the Apache License, Versi"
}
]
// ... and 31 more files (download for full content)
About this extraction
This page contains the full source code of the MiniDNS/minidns GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 231 files (820.3 KB), approximately 202.4k tokens, and a symbol index with 1512 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.