aboutsummaryrefslogtreecommitdiff
path: root/src/diplonat.rs
diff options
context:
space:
mode:
authordarkgallium <florian+git@aloneinthedark.xyz>2020-05-24 20:40:49 +0200
committerdarkgallium <florian+git@aloneinthedark.xyz>2020-05-24 20:40:49 +0200
commitd2ae084fc1be2671c2a301e689c8632576922785 (patch)
treefb340afde570ffacf42f9349df135624fcb4178f /src/diplonat.rs
parenta2d25820985b04f15f3c0f38cabfd7130124d943 (diff)
downloaddiplonat-d2ae084fc1be2671c2a301e689c8632576922785.tar.gz
diplonat-d2ae084fc1be2671c2a301e689c8632576922785.zip
add actor for firewall & massive refactor
Diffstat (limited to 'src/diplonat.rs')
-rw-r--r--src/diplonat.rs15
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(());