<client> is the client's virtual address.
<servername> must be a valid DNS hostname and not look like an address.
+
+Both client and server read all files
+ /etc/hippotat/main.cfg
+ /etc/hippotat/config.d
+ /etc/hippotat/server.d
+and in each case if it's a directory, all contained files whose
+names consists of only ascii alphanumerics plus '-' and '_'.
+The ini file format sections from these files are all unioned.
+
+(If main.cfg does not exist, master.cfg will be tried for backward
+compatibility reasons.)
+
+
Exceptional settings:
server
--- /dev/null
+// Copyright 2021 Ian Jackson and contributors to Hippotat
+// SPDX-License-Identifier: AGPL-3.0-or-later
+// There is NO WARRANTY.
+
+use crate::prelude::*;
+
+#[derive(StructOpt,Debug)]
+pub struct Opts {
+ /// Default config file or directory
+ ///
+ /// Look for `main.cfg`, `config.d` and `secrets.d` here.
+ ///
+ /// Or if this is a file, just read that file.
+ #[structopt(long, default_value="/etc/hippotat")]
+ pub config: PathBuf,
+
+ /// Read this in addition, after the other config files
+ #[structopt(long, multiple=true, number_of_values=1)]
+ pub extra_config: Vec<PathBuf>,
+}
+
+pub struct CidrString(pub String);
+
+pub struct InstanceConfig {
+ // Exceptional settings
+ pub server: String,
+ pub secret: String,
+ pub ipif: String,
+
+ // Capped settings:
+ pub max_batch_down: u32,
+ pub max_queue_time: Duration,
+ pub http_timeout: Duration,
+
+ // Ordinary settings:
+ pub target_requests_outstanding: u32,
+ pub addrs: Vec<IpAddr>,
+ pub vnetwork: Vec<CidrString>,
+ pub vaddr: Vec<IpAddr>,
+ pub vrelay: IpAddr,
+ pub port: u16,
+ pub mtu: u32,
+ pub ifname_server: String,
+ pub ifname_client: String,
+
+ // Ordinary settings, used by server only:
+ pub max_clock_skew: Duration,
+
+ // Ordinary settings, used by client only:
+ pub http_timeout_grace: Duration,
+ pub max_requests_outstanding: u32,
+ pub max_batch_up: u32,
+ pub http_retry: Duration,
+ pub url: Uri,
+ pub vroutes: Vec<CidrString>,
+}
--- /dev/null
+// Copyright 2021 Ian Jackson and contributors to Hippotat
+// SPDX-License-Identifier: AGPL-3.0-or-later
+// There is NO WARRANTY.
+
+pub use hyper::Uri;
+pub use structopt::StructOpt;
+pub use tokio::time::Duration;
+
+pub use std::net::IpAddr;
+pub use std::path::PathBuf;
+
+pub use crate::config;