I... think that might be a VPN tunnel option.
This commit is contained in:
@ -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.
|
||||
|
@ -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.")
|
||||
}
|
||||
|
Reference in New Issue
Block a user