From: Ian Jackson Date: Sat, 7 Aug 2021 16:12:32 +0000 (+0100) Subject: config: ifnames in right sections X-Git-Tag: hippotat/1.0.0~282 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=b4c9493a937c6958416596e09b4c9c2367162e81;p=hippotat.git config: ifnames in right sections Signed-off-by: Ian Jackson --- diff --git a/docs/settings.rst b/docs/settings.rst index e4cef04..1f4282b 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -142,14 +142,6 @@ These are not looked up in the client-specific config sections. Must match exactly at each end - *this is not checked*. [``1500`` (bytes)] -``ifname_server`` - | Virtual interface name on the server. [``shippo%d``] - | Any ``%d`` is interpolated (by the kernel). - -``ifname_client`` - | Virtual interface name on the client. [``hippo%d``] - | Any ``%d`` is interpolated (by the kernel). - Ordinary settings, used by server only -------------------------------------- @@ -162,6 +154,10 @@ Ordinary settings, used by server only this period after the client leaves the first network. [``300`` (s)] +``ifname_server`` + | Virtual interface name on the server. [``shippo%d``] + | Any ``%d`` is interpolated (by the kernel). + Ordinary settings, used by client only -------------------------------------- @@ -194,3 +190,7 @@ Ordinary settings, used by client only end, space-separated. Routes to those will be created on the client. ``vrelay`` is included implicitly. [CIDR syntax, space separated; default: none] + +``ifname_client`` + | Virtual interface name on the client. [``hippo%d``] + | Any ``%d`` is interpolated (by the kernel). diff --git a/src/config.rs b/src/config.rs index 16225b1..92fef75 100644 --- a/src/config.rs +++ b/src/config.rs @@ -27,11 +27,10 @@ pub struct InstanceConfig { pub vrelay: IpAddr, pub port: u16, pub mtu: u32, - pub ifname_server: String, - pub ifname_client: String, // Ordinary settings, used by server only: #[server] pub max_clock_skew: Duration, + #[server] pub ifname_server: String, // Ordinary settings, used by client only: #[client] pub http_timeout_grace: Duration, @@ -41,6 +40,7 @@ pub struct InstanceConfig { #[client] pub success_report_interval: Duration, #[client] pub url: Uri, #[client] pub vroutes: Vec, + #[client] pub ifname_client: String, // Computed, rather than looked up. Client only: #[computed] pub effective_http_timeout: Duration,