File: gateway_solaris.go

package info (click to toggle)
golang-github-jackpal-gateway 1.0.4-4
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 96 kB
  • sloc: makefile: 2
file content (16 lines) | stat: -rw-r--r-- 261 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
package gateway

import (
	"net"
	"os/exec"
)

func DiscoverGateway() (ip net.IP, err error) {
	routeCmd := exec.Command("netstat", "-rn")
	output, err := routeCmd.CombinedOutput()
	if err != nil {
		return nil, err
	}

	return parseBSDSolarisNetstat(output)
}