diff options
| author | Linus Färnstrand <linus@mullvad.net> | 2017-11-30 10:15:47 +0100 |
|---|---|---|
| committer | Linus Färnstrand <linus@mullvad.net> | 2017-12-04 10:26:49 +0100 |
| commit | 5b065ed97f89cb79be29eef8de9625959e739355 (patch) | |
| tree | 7acfcfe986152ab047c7c7febb175887008c32f2 | |
| parent | 2650f1cf272da4b1802704b34a12264dcf1009ea (diff) | |
| download | mullvadvpn-5b065ed97f89cb79be29eef8de9625959e739355.tar.xz mullvadvpn-5b065ed97f89cb79be29eef8de9625959e739355.zip | |
Add documentation to firewall module types
| -rw-r--r-- | talpid-core/src/firewall/macos/mod.rs | 8 | ||||
| -rw-r--r-- | talpid-core/src/firewall/mod.rs | 3 | ||||
| -rw-r--r-- | talpid-core/src/firewall/unix.rs | 3 | ||||
| -rw-r--r-- | talpid-core/src/firewall/windows.rs | 3 |
4 files changed, 12 insertions, 5 deletions
diff --git a/talpid-core/src/firewall/macos/mod.rs b/talpid-core/src/firewall/macos/mod.rs index c4fbc6a76c..d92c66fe08 100644 --- a/talpid-core/src/firewall/macos/mod.rs +++ b/talpid-core/src/firewall/macos/mod.rs @@ -13,16 +13,18 @@ use self::dns::DnsMonitor; error_chain! { links { - PfCtl(self::pfctl::Error, self::pfctl::ErrorKind); - DnsMonitor(self::dns::Error, self::dns::ErrorKind); + PfCtl(self::pfctl::Error, self::pfctl::ErrorKind) #[doc = "PF error"]; + DnsMonitor(self::dns::Error, self::dns::ErrorKind) #[doc = "DNS error"]; } } -// alias used to instantiate firewall implementation +/// alias used to instantiate firewall implementation pub type ConcreteFirewall = PacketFilter; const ANCHOR_NAME: &'static str = "mullvad"; +/// The macOS firewall implementation. Acting as converter between the `Firewall` trait API +/// and actual PF firewall rules and other protective measures to keep the `SecurityPolicy`. pub struct PacketFilter { pf: pfctl::PfCtl, pf_was_enabled: Option<bool>, diff --git a/talpid-core/src/firewall/mod.rs b/talpid-core/src/firewall/mod.rs index 4e6d1611de..17ba65b88d 100644 --- a/talpid-core/src/firewall/mod.rs +++ b/talpid-core/src/firewall/mod.rs @@ -1,15 +1,18 @@ use talpid_types::net::Endpoint; +/// macOS implementation of the firewall/security policy enforcer. #[cfg(target_os = "macos")] pub mod macos; #[cfg(target_os = "macos")] use self::macos as imp; +/// Linux implementation of the firewall/security policy enforcer. #[cfg(all(unix, not(target_os = "macos")))] pub mod unix; #[cfg(all(unix, not(target_os = "macos")))] use self::unix as imp; +/// Windows implementation of the firewall/security policy enforcer. #[cfg(windows)] pub mod windows; #[cfg(windows)] diff --git a/talpid-core/src/firewall/unix.rs b/talpid-core/src/firewall/unix.rs index 7550c3c051..b39013e3c0 100644 --- a/talpid-core/src/firewall/unix.rs +++ b/talpid-core/src/firewall/unix.rs @@ -1,10 +1,11 @@ use super::{Firewall, SecurityPolicy}; -// alias used to instantiate firewall implementation +/// alias used to instantiate firewall implementation pub type ConcreteFirewall = Netfilter; error_chain!{} +/// The Linux implementation for the `Firewall` trait. pub struct Netfilter; impl Firewall<Error> for Netfilter { fn new() -> Result<Self> { diff --git a/talpid-core/src/firewall/windows.rs b/talpid-core/src/firewall/windows.rs index 3405ba12c0..bae506fdc5 100644 --- a/talpid-core/src/firewall/windows.rs +++ b/talpid-core/src/firewall/windows.rs @@ -1,10 +1,11 @@ use super::{Firewall, SecurityPolicy}; -// alias used to instantiate firewall implementation +/// alias used to instantiate firewall implementation pub type ConcreteFirewall = WindowsFirewall; error_chain!{} +/// The Windows implementation for the `Firewall` trait. pub struct WindowsFirewall; impl Firewall<Error> for WindowsFirewall { fn new() -> Result<Self> { |
