Bernie Innocenti | 318ed2d | 2018-08-30 04:05:20 +0900 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2016 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 | |
Ken Chen | 99c0b32 | 2019-11-20 14:24:09 +0800 | [diff] [blame] | 17 | #pragma once |
Bernie Innocenti | 318ed2d | 2018-08-30 04:05:20 +0900 | [diff] [blame] | 18 | |
| 19 | #include <stdint.h> |
| 20 | |
Bernie Innocenti | 758005f | 2019-02-19 18:08:36 +0900 | [diff] [blame] | 21 | #define MAXNS 4 // max # name servers we'll track |
| 22 | #define MAXDNSRCH 6 // max # domains in search path |
| 23 | #define MAXDNSRCHPATH 256 // max length of domain search paths |
| 24 | #define MAXNSSAMPLES 64 // max # samples to store per server |
Bernie Innocenti | 318ed2d | 2018-08-30 04:05:20 +0900 | [diff] [blame] | 25 | |
Bernie Innocenti | ac18b12 | 2018-10-01 23:10:18 +0900 | [diff] [blame] | 26 | // Per-netid configuration parameters passed from netd to the resolver |
Bernie Innocenti | 758005f | 2019-02-19 18:08:36 +0900 | [diff] [blame] | 27 | struct res_params { |
Bernie Innocenti | 8ad893f | 2018-08-31 14:09:46 +0900 | [diff] [blame] | 28 | uint16_t sample_validity; // sample lifetime in s |
Bernie Innocenti | 318ed2d | 2018-08-30 04:05:20 +0900 | [diff] [blame] | 29 | // threshold of success / total samples below which a server is considered broken |
Bernie Innocenti | 8ad893f | 2018-08-31 14:09:46 +0900 | [diff] [blame] | 30 | uint8_t success_threshold; // 0: disable, value / 100 otherwise |
| 31 | uint8_t min_samples; // min # samples needed for statistics to be considered meaningful |
| 32 | uint8_t max_samples; // max # samples taken into account for statistics |
| 33 | int base_timeout_msec; // base query retry timeout (if 0, use RES_TIMEOUT) |
waynema | 0161acd | 2019-02-18 17:47:59 +0800 | [diff] [blame] | 34 | int retry_count; // number of retries |
Bernie Innocenti | 318ed2d | 2018-08-30 04:05:20 +0900 | [diff] [blame] | 35 | }; |