1 /* 2 * Copyright (C) 2019 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package android.net; 18 19 import android.net.ResolverOptionsParcel; 20 21 /** 22 * Configuration for a resolver parameters. 23 * 24 * {@hide} 25 */ 26 parcelable ResolverParamsParcel { 27 /** 28 * The network ID of the network for which information should be configured. 29 */ 30 int netId; 31 32 /** 33 * Sample lifetime in seconds. 34 */ 35 int sampleValiditySeconds; 36 37 /** 38 * Use to judge if the server is considered broken. 39 */ 40 int successThreshold; 41 42 /** 43 * Min. # samples. 44 */ 45 int minSamples; 46 47 /** 48 * Max # samples. 49 */ 50 int maxSamples; 51 52 /** 53 * Retransmission interval in milliseconds. 54 */ 55 int baseTimeoutMsec; 56 57 /** 58 * Number of retries. 59 */ 60 int retryCount; 61 62 /** 63 * The DNS servers to configure for the network. 64 */ 65 @utf8InCpp String[] servers; 66 67 /** 68 * The search domains to configure. 69 */ 70 @utf8InCpp String[] domains; 71 72 /** 73 * The TLS subject name to require for all servers, or empty if there is none. 74 */ 75 @utf8InCpp String tlsName; 76 77 /** 78 * The DNS servers to configure for strict mode Private DNS. 79 */ 80 @utf8InCpp String[] tlsServers; 81 82 /** 83 * An array containing TLS public key fingerprints (pins) of which each server must match 84 * at least one, or empty if there are no pinned keys. 85 */ 86 // DEPRECATED:Superseded by caCertificate below. 87 @utf8InCpp String[] tlsFingerprints = {}; 88 89 /** 90 * Certificate authority that signed the certificate; only used by DNS-over-TLS tests. 91 * 92 */ 93 @utf8InCpp String caCertificate = ""; 94 95 /** 96 * The timeout for the connection attempt to a Private DNS server. 97 * It's initialized to 0 to use the predefined default value. 98 * Setting a non-zero value to it takes no effect anymore. The timeout is configurable only 99 * by the experiement flag. 100 */ 101 int tlsConnectTimeoutMs = 0; 102 103 /** 104 * Knobs for OEM to control alternative behavior. 105 */ 106 ResolverOptionsParcel resolverOptions; 107 108 /** 109 * The transport types associated to a given network. 110 * The valid value is defined in one of the IDnsResolver.TRANSPORT_* constants. 111 * If there are multiple transport types but can't be identified to a 112 * reasonable network type by DnsResolver, it would be considered as unknown. 113 */ 114 int[] transportTypes = {}; 115 } 116