aboutsummaryrefslogtreecommitdiff
path: root/src/tunnel.rs
diff options
context:
space:
mode:
authorHimbeerserverDE <himbeerserverde@gmail.com>2023-11-14 19:26:51 +0100
committerHimbeerserverDE <himbeerserverde@gmail.com>2023-11-14 19:33:03 +0100
commitd8f38a82885a42a7af2c0ea9de542251762f7970 (patch)
tree819c96084c4ff1d67a9014e4e786b4182e618f8a /src/tunnel.rs
parentec284b5f1543e54c64ac4c812370c35c1ce345d5 (diff)
add documentation
Diffstat (limited to 'src/tunnel.rs')
-rw-r--r--src/tunnel.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/tunnel.rs b/src/tunnel.rs
index cfab916..df172c0 100644
--- a/src/tunnel.rs
+++ b/src/tunnel.rs
@@ -20,6 +20,15 @@ impl Drop for Sit {
}
impl Sit {
+ /// Creates a new 6in4 tunnel on a parent device.
+ ///
+ /// # Arguments
+ ///
+ /// * `name` - The name of the tunnel to be created.
+ /// * `master` - The name of the parent interface for actual traffic.
+ /// * `laddr` - The address of the local tunnel endpoint,
+ /// e.g. the WAN IPv4 address of a router.
+ /// * `raddr` - The address of the remote tunnel endpoint, e.g. a tunnel server.
pub fn new(name: String, master: String, laddr: Ipv4Addr, raddr: Ipv4Addr) -> Result<Self> {
let tnlname = CString::new(&*name)?;
let ifmaster = CString::new(&*master)?;
@@ -108,6 +117,14 @@ impl Drop for IpIp6 {
}
impl IpIp6 {
+ /// Creates a new 4in6 tunnel on a parent device.
+ ///
+ /// # Arguments
+ ///
+ /// * `name` - The name of the tunnel to be created.
+ /// * `master` - The name of the parent interface for actual traffic.
+ /// * `laddr` - The address of the local tunnel endpoint, e.g. the IPv6 GUA of a DS-Lite B4.
+ /// * `raddr` - The address of the remote tunnel endpoint, e.g. a DS-Lite AFTR.
pub fn new(name: String, master: String, laddr: Ipv6Addr, raddr: Ipv6Addr) -> Result<Self> {
let tnlname = CString::new(&*name)?;
let ifmaster = CString::new(&*master)?;