diff --git a/net/net_fallback.go b/net/net_fallback.go index f4addb0e..653bd47e 100644 --- a/net/net_fallback.go +++ b/net/net_fallback.go @@ -19,3 +19,7 @@ func ProtoCounters(protocols []string) ([]ProtoCountersStat, error) { func Connections(kind string) ([]ConnectionStat, error) { return []ConnectionStat{}, common.ErrNotImplementedError } + +func ConnectionsMax(kind string, max int) ([]ConnectionStat, error) { + return []ConnectionStat{}, common.ErrNotImplementedError +} diff --git a/net/net_unix.go b/net/net_unix.go index 45de6b17..1224128a 100644 --- a/net/net_unix.go +++ b/net/net_unix.go @@ -13,6 +13,12 @@ func Connections(kind string) ([]ConnectionStat, error) { return ConnectionsPid(kind, 0) } +// Return a list of network connections opened returning at most `max` +// connections for each running process. +func ConnectionsMax(kind string, max int) ([]ConnectionStat, error) { + return []ConnectionStat{}, common.ErrNotImplementedError +} + // Return a list of network connections opened by a process. func ConnectionsPid(kind string, pid int32) ([]ConnectionStat, error) { var ret []ConnectionStat @@ -66,3 +72,8 @@ func ConnectionsPid(kind string, pid int32) ([]ConnectionStat, error) { return ret, nil } + +// Return up to `max` network connections opened by a process. +func ConnectionsPidMax(kind string, pid int32, max int) ([]ConnectionStat, error) { + return []ConnectionStat{}, common.ErrNotImplementedError +} diff --git a/net/net_windows.go b/net/net_windows.go index 4d97c6e4..996e8322 100644 --- a/net/net_windows.go +++ b/net/net_windows.go @@ -76,6 +76,12 @@ func Connections(kind string) ([]ConnectionStat, error) { return ret, common.ErrNotImplementedError } +// Return a list of network connections opened returning at most `max` +// connections for each running process. +func ConnectionsMax(kind string, max int) ([]ConnectionStat, error) { + return []ConnectionStat{}, common.ErrNotImplementedError +} + func FilterCounters() ([]FilterStat, error) { return nil, errors.New("NetFilterCounters not implemented for windows") }