chiark / gitweb /
config: Apply per_client and global attrs
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 7 Aug 2021 17:46:08 +0000 (18:46 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 7 Aug 2021 18:50:35 +0000 (19:50 +0100)
Now everything has an attribute which implyies (well, ought to appply)
an SKL setting.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/config.rs

index c45098f1914e3fb3e05af69ce28b840a20bd0ff1..557602efd530541905024c6e1edc23348ce08311 100644 (file)
@@ -11,7 +11,7 @@ use configparser::ini::Ini; // xxx ignores empty sections, fix or replace
 pub struct InstanceConfig {
   // Exceptional settings
   #[special(special_link, SKL::None)]      pub    link:   LinkName,
-  pub                                             secret: Secret,
+  #[per_client]                            pub    secret: Secret,
   #[special(special_ipif, SKL::PerClient)] pub    ipif:   String,
 
   // Capped settings:
@@ -20,17 +20,17 @@ pub struct InstanceConfig {
   #[limited]    pub http_timeout:                 Duration,
   #[limited]    pub target_requests_outstanding:  u32,
 
-  // Ordinary settings:
-  pub addrs:                        Vec<IpAddr>,
-  pub vnetwork:                     Vec<IpNet>,
-  pub vaddr:                        IpAddr,
-  pub vrelay:                       IpAddr,
-  pub port:                         u16,
-  pub mtu:                          u32,
+  // Ordinary settings, used by both, not client-specifi:
+  #[global]  pub addrs:                        Vec<IpAddr>,
+  #[global]  pub vnetwork:                     Vec<IpNet>,
+  #[global]  pub vaddr:                        IpAddr,
+  #[global]  pub vrelay:                       IpAddr,
+  #[global]  pub port:                         u16,
+  #[global]  pub mtu:                          u32,
 
   // Ordinary settings, used by server only:
-  #[server]  pub max_clock_skew:               Duration,
-  #[server]  pub ifname_server:                String,
+  #[server] #[per_client] pub max_clock_skew:               Duration,
+  #[server] #[global]     pub ifname_server:                String,
 
   // Ordinary settings, used by client only:
   #[client]  pub http_timeout_grace:           Duration,