2020-02-05 22:16:58 +00:00
|
|
|
// Copyright (c) 2020 Tailscale Inc & AUTHORS All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
2021-10-20 16:41:36 +00:00
|
|
|
//go:build !linux && !windows && !darwin && !js
|
|
|
|
// +build !linux,!windows,!darwin,!js
|
2020-02-05 22:16:58 +00:00
|
|
|
|
|
|
|
package portlist
|
|
|
|
|
2020-03-14 03:53:58 +00:00
|
|
|
import "time"
|
|
|
|
|
2020-02-05 22:16:58 +00:00
|
|
|
// We have to run netstat, which is a bit expensive, so don't do it too often.
|
2020-03-14 03:53:58 +00:00
|
|
|
const pollInterval = 5 * time.Second
|
2020-02-05 22:16:58 +00:00
|
|
|
|
2022-10-22 04:30:40 +00:00
|
|
|
func appendListeningPorts(base []Port) ([]Port, error) {
|
|
|
|
return appendListeningPortsNetstat(base, "-na")
|
2020-02-05 22:16:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func addProcesses(pl []Port) ([]Port, error) {
|
|
|
|
// Generic version has no way to get process mappings.
|
|
|
|
// This has to be OS-specific.
|
|
|
|
return pl, nil
|
|
|
|
}
|