1 // Copyright 2021 Ian Jackson and contributors to Hippotat
2 // SPDX-License-Identifier: AGPL-3.0-or-later
3 // There is NO WARRANTY.
7 #[derive(StructOpt,Debug)]
9 /// Default config file or directory
11 /// Look for `main.cfg`, `config.d` and `secrets.d` here.
13 /// Or if this is a file, just read that file.
14 #[structopt(long, default_value="/etc/hippotat")]
17 /// Read this in addition, after the other config files
18 #[structopt(long, multiple=true, number_of_values=1)]
19 pub extra_config: Vec<PathBuf>,
22 pub struct CidrString(pub String);
24 pub struct InstanceConfig {
25 // Exceptional settings
31 pub max_batch_down: u32,
32 pub max_queue_time: Duration,
33 pub http_timeout: Duration,
36 pub target_requests_outstanding: u32,
37 pub addrs: Vec<IpAddr>,
38 pub vnetwork: Vec<CidrString>,
39 pub vaddr: Vec<IpAddr>,
43 pub ifname_server: String,
44 pub ifname_client: String,
46 // Ordinary settings, used by server only:
47 pub max_clock_skew: Duration,
49 // Ordinary settings, used by client only:
50 pub http_timeout_grace: Duration,
51 pub max_requests_outstanding: u32,
52 pub max_batch_up: u32,
53 pub http_retry: Duration,
55 pub vroutes: Vec<CidrString>,