Documentation ¶
Index ¶
- func AddRoute(addr, viaAddr net.IP, iName string, debug bool) error
- func DelRoute(addr, viaAddr net.IP, iName string, debug bool) error
- func GetNetGateway() (gw, dev string, err error)
- func SetDefaultGateway(gw, iName string, debug bool) error
- func SetDevIP(iName string, localAddr net.IP, addr *net.IPNet, debug bool) error
- func SetInterfaceStatus(iName string, up bool, debug bool) error
- type Client
- type IPPacket
- type Reverser
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetNetGateway ¶
GetNetGateway return net gateway (default route) and nic. Credit: https://github.com/bigeagle/gohop/blob/master/hop/iface.go
func SetDefaultGateway ¶
SetDefaultGateway sets the systems gateway to the IP / device specified.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents a connection to a subnet server.
func NewClient ¶
func NewClient(servAddr, port, network, iName string, newGateway string, certPemPath, keyPemPath, caCertPath string, additionalAddresses []net.IP) (*Client, error)
NewClient constructs a Client object.
type IPPacket ¶
type IPPacket struct { Raw []byte Dest net.IP Protocol waterutil.IPProtocol }
IPPacket represents a packet in transit over the VPN.
type Reverser ¶
type Reverser struct { RouteDeletions []routeEntries // contains filtered or unexported fields }
Reverser contains a sequence of functions that need to be called on exit - to unwind changes made to global configuration.
func (*Reverser) AddRouteEntry ¶
AddRouteEntry adds a route to the deletion set so it is deleted from the routing table when Reverse() is called.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server represents a service providing a VPN service to subnet clients.
func NewServer ¶
func NewServer(servHost, port, network, iName string, certPemPath, keyPemPath, caCertPath string) (*Server, error)
NewServer returns a new server object representing a VPN service.