2022-09-05 09:06:35 +02:00
|
|
|
//go:build !linux
|
|
|
|
// +build !linux
|
|
|
|
|
|
|
|
package routemanager
|
|
|
|
|
|
|
|
import (
|
|
|
|
log "github.com/sirupsen/logrus"
|
|
|
|
"net/netip"
|
|
|
|
"os/exec"
|
|
|
|
"runtime"
|
|
|
|
)
|
|
|
|
|
|
|
|
func addToRouteTable(prefix netip.Prefix, addr string) error {
|
|
|
|
cmd := exec.Command("route", "add", prefix.String(), addr)
|
|
|
|
out, err := cmd.Output()
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
log.Debugf(string(out))
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func removeFromRouteTable(prefix netip.Prefix) error {
|
|
|
|
cmd := exec.Command("route", "delete", prefix.String())
|
|
|
|
out, err := cmd.Output()
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
log.Debugf(string(out))
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func enableIPForwarding() error {
|
|
|
|
log.Infof("enable IP forwarding is not implemented on %s", runtime.GOOS)
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func isNetForwardHistoryEnabled() bool {
|
2023-01-08 23:51:08 +01:00
|
|
|
log.Infof("check netforward history is not implemented on %s", runtime.GOOS)
|
2022-09-05 09:06:35 +02:00
|
|
|
return false
|
|
|
|
}
|