2020-07-01 12:47:56 +00:00
|
|
|
// +build !aix,!darwin,!linux,!freebsd,!openbsd,!windows
|
2017-02-01 18:26:00 +00:00
|
|
|
|
|
|
|
package net
|
|
|
|
|
2018-10-19 18:33:23 +00:00
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
2020-11-07 01:48:38 +00:00
|
|
|
"github.com/shirou/gopsutil/v3/internal/common"
|
2018-10-19 18:33:23 +00:00
|
|
|
)
|
2017-02-01 18:26:00 +00:00
|
|
|
|
|
|
|
func IOCounters(pernic bool) ([]IOCountersStat, error) {
|
2018-10-19 18:33:23 +00:00
|
|
|
return IOCountersWithContext(context.Background(), pernic)
|
|
|
|
}
|
|
|
|
|
|
|
|
func IOCountersWithContext(ctx context.Context, pernic bool) ([]IOCountersStat, error) {
|
2017-02-01 18:26:00 +00:00
|
|
|
return []IOCountersStat{}, common.ErrNotImplementedError
|
|
|
|
}
|
|
|
|
|
|
|
|
func FilterCounters() ([]FilterStat, error) {
|
2018-10-19 18:33:23 +00:00
|
|
|
return FilterCountersWithContext(context.Background())
|
|
|
|
}
|
|
|
|
|
|
|
|
func FilterCountersWithContext(ctx context.Context) ([]FilterStat, error) {
|
2017-02-01 18:26:00 +00:00
|
|
|
return []FilterStat{}, common.ErrNotImplementedError
|
|
|
|
}
|
|
|
|
|
2020-07-01 12:47:56 +00:00
|
|
|
func ConntrackStats(percpu bool) ([]ConntrackStat, error) {
|
|
|
|
return ConntrackStatsWithContext(context.Background(), percpu)
|
|
|
|
}
|
|
|
|
|
|
|
|
func ConntrackStatsWithContext(ctx context.Context, percpu bool) ([]ConntrackStat, error) {
|
|
|
|
return nil, common.ErrNotImplementedError
|
|
|
|
}
|
|
|
|
|
2017-02-01 18:26:00 +00:00
|
|
|
func ProtoCounters(protocols []string) ([]ProtoCountersStat, error) {
|
2018-10-19 18:33:23 +00:00
|
|
|
return ProtoCountersWithContext(context.Background(), protocols)
|
|
|
|
}
|
|
|
|
|
|
|
|
func ProtoCountersWithContext(ctx context.Context, protocols []string) ([]ProtoCountersStat, error) {
|
2017-02-01 18:26:00 +00:00
|
|
|
return []ProtoCountersStat{}, common.ErrNotImplementedError
|
|
|
|
}
|
|
|
|
|
|
|
|
func Connections(kind string) ([]ConnectionStat, error) {
|
2018-10-19 18:33:23 +00:00
|
|
|
return ConnectionsWithContext(context.Background(), kind)
|
|
|
|
}
|
|
|
|
|
|
|
|
func ConnectionsWithContext(ctx context.Context, kind string) ([]ConnectionStat, error) {
|
2017-02-01 18:26:00 +00:00
|
|
|
return []ConnectionStat{}, common.ErrNotImplementedError
|
|
|
|
}
|
|
|
|
|
|
|
|
func ConnectionsMax(kind string, max int) ([]ConnectionStat, error) {
|
2018-10-19 18:33:23 +00:00
|
|
|
return ConnectionsMaxWithContext(context.Background(), kind, max)
|
|
|
|
}
|
|
|
|
|
|
|
|
func ConnectionsMaxWithContext(ctx context.Context, kind string, max int) ([]ConnectionStat, error) {
|
2017-02-01 18:26:00 +00:00
|
|
|
return []ConnectionStat{}, common.ErrNotImplementedError
|
|
|
|
}
|
2020-07-01 12:47:56 +00:00
|
|
|
|
|
|
|
// Return a list of network connections opened, omitting `Uids`.
|
|
|
|
// WithoutUids functions are reliant on implementation details. They may be altered to be an alias for Connections or be
|
|
|
|
// removed from the API in the future.
|
|
|
|
func ConnectionsWithoutUids(kind string) ([]ConnectionStat, error) {
|
|
|
|
return ConnectionsWithoutUidsWithContext(context.Background(), kind)
|
|
|
|
}
|
|
|
|
|
|
|
|
func ConnectionsWithoutUidsWithContext(ctx context.Context, kind string) ([]ConnectionStat, error) {
|
|
|
|
return ConnectionsMaxWithoutUidsWithContext(ctx, kind, 0)
|
|
|
|
}
|
|
|
|
|
|
|
|
func ConnectionsMaxWithoutUidsWithContext(ctx context.Context, kind string, max int) ([]ConnectionStat, error) {
|
|
|
|
return ConnectionsPidMaxWithoutUidsWithContext(ctx, kind, 0, max)
|
|
|
|
}
|
|
|
|
|
|
|
|
func ConnectionsPidWithoutUids(kind string, pid int32) ([]ConnectionStat, error) {
|
|
|
|
return ConnectionsPidWithoutUidsWithContext(context.Background(), kind, pid)
|
|
|
|
}
|
|
|
|
|
|
|
|
func ConnectionsPidWithoutUidsWithContext(ctx context.Context, kind string, pid int32) ([]ConnectionStat, error) {
|
|
|
|
return ConnectionsPidMaxWithoutUidsWithContext(ctx, kind, pid, 0)
|
|
|
|
}
|
|
|
|
|
|
|
|
func ConnectionsPidMaxWithoutUids(kind string, pid int32, max int) ([]ConnectionStat, error) {
|
|
|
|
return ConnectionsPidMaxWithoutUidsWithContext(context.Background(), kind, pid, max)
|
|
|
|
}
|
|
|
|
|
|
|
|
func ConnectionsPidMaxWithoutUidsWithContext(ctx context.Context, kind string, pid int32, max int) ([]ConnectionStat, error) {
|
|
|
|
return connectionsPidMaxWithoutUidsWithContext(ctx, kind, pid, max)
|
|
|
|
}
|
|
|
|
|
|
|
|
func connectionsPidMaxWithoutUidsWithContext(ctx context.Context, kind string, pid int32, max int) ([]ConnectionStat, error) {
|
|
|
|
return []ConnectionStat{}, common.ErrNotImplementedError
|
|
|
|
}
|