32 lines
773 B
Go
32 lines
773 B
Go
//go:build !linux
|
|
|
|
package vpnruntime
|
|
|
|
import "fmt"
|
|
|
|
type tunDevice struct{}
|
|
|
|
func openGatewayTun(name, addressCIDR, routeCIDR string) (*tunDevice, error) {
|
|
return nil, fmt.Errorf("vpn gateway runtime is currently supported only on linux")
|
|
}
|
|
|
|
func (d *tunDevice) Read(packet []byte) (int, error) {
|
|
return 0, fmt.Errorf("vpn gateway runtime is currently supported only on linux")
|
|
}
|
|
|
|
func (d *tunDevice) Write(packet []byte) (int, error) {
|
|
return 0, fmt.Errorf("vpn gateway runtime is currently supported only on linux")
|
|
}
|
|
|
|
func (d *tunDevice) Close() error {
|
|
return nil
|
|
}
|
|
|
|
func gatewayPlatformSnapshot(interfaceName, routeCIDR string) map[string]any {
|
|
return map[string]any{
|
|
"os": "unsupported",
|
|
"interface": interfaceName,
|
|
"route_cidr": routeCIDR,
|
|
}
|
|
}
|