From 3a5552509439612accf579becc7cb85a596bd466 Mon Sep 17 00:00:00 2001 From: Hristo Venev Date: Sat, 28 Sep 2019 16:20:06 +0000 Subject: PeerConfig -> GlobalConfig --- src/manager/builder.rs | 10 +++++----- src/manager/mod.rs | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src/manager') diff --git a/src/manager/builder.rs b/src/manager/builder.rs index 9fc2291..3f3e227 100644 --- a/src/manager/builder.rs +++ b/src/manager/builder.rs @@ -47,17 +47,17 @@ pub struct ConfigBuilder<'a> { c: model::Config, err: Vec, public_key: model::Key, - pc: &'a config::PeerConfig, + gc: &'a config::GlobalConfig, } impl<'a> ConfigBuilder<'a> { #[inline] - pub fn new(public_key: model::Key, pc: &'a config::PeerConfig) -> Self { + pub fn new(public_key: model::Key, gc: &'a config::GlobalConfig) -> Self { Self { c: model::Config::default(), err: vec![], public_key, - pc, + gc, } } @@ -72,11 +72,11 @@ impl<'a> ConfigBuilder<'a> { return; } - let pc = self.pc; + let gc = self.gc; let ent = insert_peer(&mut self.c, &mut self.err, s, &p.peer, |ent| { ent.psk = s.psk.clone(); ent.endpoint = Some(p.endpoint.clone()); - ent.keepalive = pc.fix_keepalive(p.keepalive); + ent.keepalive = gc.fix_keepalive(p.keepalive); }); add_peer(&mut self.err, ent, s, &p.peer) diff --git a/src/manager/mod.rs b/src/manager/mod.rs index 2efa370..680cbad 100644 --- a/src/manager/mod.rs +++ b/src/manager/mod.rs @@ -67,7 +67,7 @@ fn load_file(path: &Path) -> io::Result>> { pub struct Manager { dev: wg::Device, - peer_config: config::PeerConfig, + global_config: config::GlobalConfig, sources: Vec, current: model::Config, runtime_directory: Option, @@ -78,7 +78,7 @@ impl Manager { pub fn new(ifname: OsString, c: config::Config) -> io::Result { let mut m = Self { dev: wg::Device::new(ifname)?, - peer_config: c.peer_config, + global_config: c.global, sources: vec![], current: model::Config::default(), runtime_directory: c.runtime_directory, @@ -211,7 +211,7 @@ impl Manager { sources.push((src, sc)); } - let mut cfg = builder::ConfigBuilder::new(public_key, &self.peer_config); + let mut cfg = builder::ConfigBuilder::new(public_key, &self.global_config); for (src, sc) in &sources { for peer in &sc.servers { -- cgit