net_fallback.go 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. // +build !aix,!darwin,!linux,!freebsd,!openbsd,!windows
  2. package net
  3. import (
  4. "context"
  5. "github.com/shirou/gopsutil/internal/common"
  6. )
  7. func IOCounters(pernic bool) ([]IOCountersStat, error) {
  8. return IOCountersWithContext(context.Background(), pernic)
  9. }
  10. func IOCountersWithContext(ctx context.Context, pernic bool) ([]IOCountersStat, error) {
  11. return []IOCountersStat{}, common.ErrNotImplementedError
  12. }
  13. func FilterCounters() ([]FilterStat, error) {
  14. return FilterCountersWithContext(context.Background())
  15. }
  16. func FilterCountersWithContext(ctx context.Context) ([]FilterStat, error) {
  17. return []FilterStat{}, common.ErrNotImplementedError
  18. }
  19. func ConntrackStats(percpu bool) ([]ConntrackStat, error) {
  20. return ConntrackStatsWithContext(context.Background(), percpu)
  21. }
  22. func ConntrackStatsWithContext(ctx context.Context, percpu bool) ([]ConntrackStat, error) {
  23. return nil, common.ErrNotImplementedError
  24. }
  25. func ProtoCounters(protocols []string) ([]ProtoCountersStat, error) {
  26. return ProtoCountersWithContext(context.Background(), protocols)
  27. }
  28. func ProtoCountersWithContext(ctx context.Context, protocols []string) ([]ProtoCountersStat, error) {
  29. return []ProtoCountersStat{}, common.ErrNotImplementedError
  30. }
  31. func Connections(kind string) ([]ConnectionStat, error) {
  32. return ConnectionsWithContext(context.Background(), kind)
  33. }
  34. func ConnectionsWithContext(ctx context.Context, kind string) ([]ConnectionStat, error) {
  35. return []ConnectionStat{}, common.ErrNotImplementedError
  36. }
  37. func ConnectionsMax(kind string, max int) ([]ConnectionStat, error) {
  38. return ConnectionsMaxWithContext(context.Background(), kind, max)
  39. }
  40. func ConnectionsMaxWithContext(ctx context.Context, kind string, max int) ([]ConnectionStat, error) {
  41. return []ConnectionStat{}, common.ErrNotImplementedError
  42. }
  43. // Return a list of network connections opened, omitting `Uids`.
  44. // WithoutUids functions are reliant on implementation details. They may be altered to be an alias for Connections or be
  45. // removed from the API in the future.
  46. func ConnectionsWithoutUids(kind string) ([]ConnectionStat, error) {
  47. return ConnectionsWithoutUidsWithContext(context.Background(), kind)
  48. }
  49. func ConnectionsWithoutUidsWithContext(ctx context.Context, kind string) ([]ConnectionStat, error) {
  50. return ConnectionsMaxWithoutUidsWithContext(ctx, kind, 0)
  51. }
  52. func ConnectionsMaxWithoutUidsWithContext(ctx context.Context, kind string, max int) ([]ConnectionStat, error) {
  53. return ConnectionsPidMaxWithoutUidsWithContext(ctx, kind, 0, max)
  54. }
  55. func ConnectionsPidWithoutUids(kind string, pid int32) ([]ConnectionStat, error) {
  56. return ConnectionsPidWithoutUidsWithContext(context.Background(), kind, pid)
  57. }
  58. func ConnectionsPidWithoutUidsWithContext(ctx context.Context, kind string, pid int32) ([]ConnectionStat, error) {
  59. return ConnectionsPidMaxWithoutUidsWithContext(ctx, kind, pid, 0)
  60. }
  61. func ConnectionsPidMaxWithoutUids(kind string, pid int32, max int) ([]ConnectionStat, error) {
  62. return ConnectionsPidMaxWithoutUidsWithContext(context.Background(), kind, pid, max)
  63. }
  64. func ConnectionsPidMaxWithoutUidsWithContext(ctx context.Context, kind string, pid int32, max int) ([]ConnectionStat, error) {
  65. return connectionsPidMaxWithoutUidsWithContext(ctx, kind, pid, max)
  66. }
  67. func connectionsPidMaxWithoutUidsWithContext(ctx context.Context, kind string, pid int32, max int) ([]ConnectionStat, error) {
  68. return []ConnectionStat{}, common.ErrNotImplementedError
  69. }