aboutsummaryrefslogtreecommitdiff
path: root/src/diplonat.rs
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2020-05-21 15:22:45 +0200
committerQuentin Dufour <quentin@deuxfleurs.fr>2020-05-21 15:22:45 +0200
commitfeadc844c060ff0879d8d547807147ae2213fd13 (patch)
treebcae4c29092586a442ffb8eb7ed48ab3f9875f69 /src/diplonat.rs
parent32d62d13496bd0ea6fd548cddb38dfdc72f4d41e (diff)
downloaddiplonat-feadc844c060ff0879d8d547807147ae2213fd13.tar.gz
diplonat-feadc844c060ff0879d8d547807147ae2213fd13.zip
WIP loops
Diffstat (limited to 'src/diplonat.rs')
-rw-r--r--src/diplonat.rs27
1 files changed, 25 insertions, 2 deletions
diff --git a/src/diplonat.rs b/src/diplonat.rs
index 3dd4e91..9062dd7 100644
--- a/src/diplonat.rs
+++ b/src/diplonat.rs
@@ -1,4 +1,5 @@
use anyhow::{Result, Context};
+use tokio::try_join;
use crate::*;
pub struct Diplonat {
@@ -16,7 +17,29 @@ impl Diplonat {
return Ok(ctx);
}
- pub fn listen(&self) -> bool {
- return true;
+ // Action sinks
+ pub async fn consul_catalog(&self) -> Result<()> {
+ info!("Consul catalog loop started");
+ return Ok(());
+ }
+ pub async fn control_loop(&self) -> Result<()> {
+ info!("Control loop started");
+ return Ok(());
+ }
+
+ // Action taps
+ pub async fn igd(&self) -> Result<()> {
+ info!("IGD loop started");
+ return Ok(());
+ }
+ // @TODO: implement netfilter, dns
+
+ pub async fn listen(&self) -> Result<()> {
+ try_join!(
+ self.consul_catalog(),
+ self.control_loop(),
+ self.igd()
+ )?;
+ return Ok(());
}
}