diff options
Diffstat (limited to 'src/diplonat.rs')
-rw-r--r-- | src/diplonat.rs | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/diplonat.rs b/src/diplonat.rs index 1be00f7..7b7bbb8 100644 --- a/src/diplonat.rs +++ b/src/diplonat.rs @@ -4,10 +4,12 @@ use tokio::try_join; use crate::consul_actor::ConsulActor; use crate::igd_actor::IgdActor; use crate::environment::Environment; +use crate::fw_actor::FirewallActor; pub struct Diplonat { consul: ConsulActor, - igd: IgdActor + igd: IgdActor, + firewall: FirewallActor } impl Diplonat { @@ -21,9 +23,15 @@ impl Diplonat { &ca.rx_open_ports ).await?; + let fw = FirewallActor::new( + env.refresh_time, + &ca.rx_open_ports + ).await?; + let ctx = Self { consul: ca, - igd: ia + igd: ia, + firewall: fw }; return Ok(ctx); @@ -32,7 +40,8 @@ impl Diplonat { pub async fn listen(&mut self) -> Result<()> { try_join!( self.consul.listen(), - self.igd.listen() + self.igd.listen(), + self.firewall.listen() )?; return Ok(()); |