2023-09-23 11:46:14 +00:00
|
|
|
package utils
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"net/http"
|
|
|
|
|
"net/netip"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// PortForwardObjects contains fields that may or may not need to be set
|
|
|
|
|
// depending on the port forwarding provider code.
|
|
|
|
|
type PortForwardObjects struct {
|
|
|
|
|
// Logger is a logger, used by both Private Internet Access and ProtonVPN.
|
|
|
|
|
Logger Logger
|
|
|
|
|
// Gateway is the VPN gateway IP address, used by Private Internet Access
|
|
|
|
|
// and ProtonVPN.
|
|
|
|
|
Gateway netip.Addr
|
2024-07-30 22:00:26 +02:00
|
|
|
// InternalIP is the VPN internal IP address assigned, used by Perfect Privacy.
|
|
|
|
|
InternalIP netip.Addr
|
2023-09-23 11:46:14 +00:00
|
|
|
// Client is used to query the VPN gateway for Private Internet Access.
|
|
|
|
|
Client *http.Client
|
2024-05-02 09:17:30 +00:00
|
|
|
// ServerName is used by Private Internet Access for port forwarding.
|
2023-09-23 11:46:14 +00:00
|
|
|
ServerName string
|
2024-05-02 09:17:30 +00:00
|
|
|
// CanPortForward is used by Private Internet Access for port forwarding.
|
|
|
|
|
CanPortForward bool
|
2024-07-09 14:44:46 +00:00
|
|
|
// Username is used by Private Internet Access for port forwarding.
|
|
|
|
|
Username string
|
|
|
|
|
// Password is used by Private Internet Access for port forwarding.
|
|
|
|
|
Password string
|
2023-09-23 11:46:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Routing interface {
|
|
|
|
|
VPNLocalGatewayIP(vpnInterface string) (gateway netip.Addr, err error)
|
|
|
|
|
}
|