netlink

package
v0.0.0-...-b78484e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 18, 2022 License: BSD-2-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ReadBufSize         int           // size of userspace read buffer (>32K no benefit in kernels 4.9-5.2, at least)
	ReceiveBufSize      int           // socket receive buffer size
	ReceiveBufSizeForce int           // force socket receive buffer size (requires CAP_NET_ADMIN or root)
	SrcPorts            []uint16      // source (local) ports for kernel to filter by
	DstPorts            []uint16      // dest (remote) ports for kernel to filter by
	ReceiveTimeout      time.Duration // socket receive timeout
	Log                 bool          // if true enable logging
}

Config contains the netlink client configuration.

type Metrics

type Metrics struct {
	SampleTimes  metrics.DurationStats
	ConvertTimes metrics.DurationStats
	sync.RWMutex
}

type Result

type Result struct {
	// contains filtered or unexported fields
}

Result holds the results from a one netlink inet_diag call.

func (*Result) Samples

func (r *Result) Samples() (ss []sampler.Sample)

type Sampler

type Sampler struct {
	Config

	sync.Mutex
	// contains filtered or unexported fields
}

func NewSampler

func NewSampler(cfg Config) *Sampler

func (*Sampler) Close

func (s *Sampler) Close() error

func (*Sampler) Metrics

func (s *Sampler) Metrics() (m Metrics)

func (*Sampler) RecycleResult

func (s *Sampler) RecycleResult(r sampler.Result)

func (*Sampler) RecycleSamples

func (s *Sampler) RecycleSamples(ss []sampler.Sample)

func (*Sampler) Sample

func (s *Sampler) Sample() (r sampler.Result, err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL