config

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateAddrs

func GenerateAddrs(addrRange string) []net.IP

GenerateAddrs returns a list of all IPs in addrRange

func GetInterfaceAddr added in v0.17.1

func GetInterfaceAddr(ifName string) (net.IP, error)

GetInterfaceAddr gets an interface first IPv4 address

Types

type Class

type Class struct {
	Name string `yaml:"name"`
	TOS  uint8  `yaml:"tos"`
}

Class reperesnets a traffic class in the config file

type Config

type Config struct {
	Version       string
	MetricsPath   *string   `yaml:"metrcis_path"`
	ListenAddress *string   `yaml:"listen_address"`
	BasePort      *uint16   `yaml:"base_port"`
	Defaults      *Defaults `yaml:"defaults"`
	SrcRange      *string   `yaml:"src_range"`
	Classes       []Class   `yaml:"classes"`
	Paths         []Path    `yaml:"paths"`
	Routers       []Router  `yaml:"routers"`
}

Config represents the configuration of matroschka-prober

func (*Config) ApplyDefaults

func (c *Config) ApplyDefaults()

ApplyDefaults applies default settings if they are missing from loaded config.

func (*Config) GetConfiguredSrcAddr

func (c *Config) GetConfiguredSrcAddr() (net.IP, error)

GetConfiguredSrcAddr gets an IPv4 address of the configured src interface

func (*Config) PathToProberHops

func (c *Config) PathToProberHops(pathCfg Path) []prober.Hop

PathToProberHops generates prober hops

func (*Config) Validate

func (c *Config) Validate() error

Validate validates a configuration

type Defaults

type Defaults struct {
	MeasurementLengthMS *uint64 `yaml:"measurement_length_ms"`
	PayloadSizeBytes    *uint64 `yaml:"payload_size_bytes"`
	PPS                 *uint64 `yaml:"pps"`
	SrcRange            *string `yaml:"src_range"`
	TimeoutMS           *uint64 `yaml:"timeout"`
	SrcInterface        *string `yaml:"src_interface"`
}

Defaults represents the default section of the config

type Path

type Path struct {
	Name                string   `yaml:"name"`
	Hops                []string `yaml:"hops"`
	MeasurementLengthMS *uint64  `yaml:"measurement_length_ms"`
	PayloadSizeBytes    *uint64  `yaml:"payload_size_bytes"`
	PPS                 *uint64  `yaml:"pps"`
	TimeoutMS           *uint64  `yaml:"timeout"`
}

Path represents a path to be probed

type Router

type Router struct {
	Name     string `yaml:"name"`
	DstRange string `yaml:"dst_range"`
	SrcRange string `yaml:"src_range"`
}

Router represents a router used a an explicit hop in a path

Jump to

Keyboard shortcuts

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