File: gateway_darwin.go

package info (click to toggle)
golang-github-jackpal-gateway 1.0.7-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, bullseye-backports, forky, sid, trixie
  • size: 128 kB
  • sloc: makefile: 2
file content (22 lines) | stat: -rw-r--r-- 401 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// +build darwin

package gateway

import (
	"net"
	"os/exec"
)

func discoverGatewayOSSpecific() (net.IP, error) {
	routeCmd := exec.Command("/sbin/route", "-n", "get", "0.0.0.0")
	output, err := routeCmd.CombinedOutput()
	if err != nil {
		return nil, err
	}

	return parseDarwinRouteGet(output)
}

func discoverGatewayInterfaceOSSpecific() (ip net.IP, err error) {
	return nil, errNotImplemented
}