I... think that might be a VPN tunnel option.

This commit is contained in:
idk
2018-12-03 13:53:48 -05:00
parent fa675eadad
commit 1112123584
10 changed files with 207 additions and 28 deletions

View File

@ -58,6 +58,7 @@ type Conf struct {
AccessList []string
MessageReliability string
exists bool
VPN bool
}
// Print returns and prints a formatted list of configured tunnel settings.

View File

@ -1,6 +1,9 @@
package i2ptunconf
import "strings"
import (
"fmt"
"strings"
)
// GetType takes an argument and a default. If the argument differs from the
// default, the argument is always returned. If the argument and default are
@ -39,6 +42,9 @@ func (c *Conf) SetType(label ...string) {
if strings.Contains(v, "client") {
c.Client = true
}
if strings.Contains(v, "vpn") {
c.VPN = true
}
if c.Type == "server" || c.Type == "http" || c.Type == "client" || c.Type == "udpserver" || c.Type == "udpclient" {
c.Type = v
}
@ -46,3 +52,10 @@ func (c *Conf) SetType(label ...string) {
c.Type = "server"
}
}
func (c *Conf) VPNServerMode() (bool, error) {
if c.VPN == true {
return !c.Client, nil
}
return false, fmt.Errorf("VPN mode not detected.")
}