netfault

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2026 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apply

func Apply(ctx context.Context, runner CommandRunner, opts Opts) error

func CondenseNetWithPortRange

func CondenseNetWithPortRange(nwps []network.NetWithPortRange, limit int) []network.NetWithPortRange

CondenseNetWithPortRange condenses a list of NetWithPortRange The way this algorithm works: 1. Sort the nwp list ascending by BaseIP and port 2. For each nwp in the list create a new nwp with the next neighbor if port-ranges are compatible 3. From the new list choose the nwp with the longest prefix length, remove all nwp witch are included in the chosen and add the chosen nwp to the result list 4. Repeat 3. until either the list is shorter than limit or no more compatible nwp are found

func HasCiliumIpRoutes

func HasCiliumIpRoutes(ctx context.Context, r CommandRunner) (bool, error)

func HasIstioRedirect added in v1.6.1

func HasIstioRedirect(ctx context.Context, r CommandRunner) (bool, error)

func ListNonLoopbackInterfaceNames

func ListNonLoopbackInterfaceNames(ctx context.Context, r CommandRunner) ([]string, error)

func Revert

func Revert(ctx context.Context, runner CommandRunner, opts Opts) error

Types

type BlackholeOpts

type BlackholeOpts struct {
	Filter
	ExecutionContext
	IpProto IpProto
}

func (*BlackholeOpts) String

func (o *BlackholeOpts) String() string

type CommandRunner

type CommandRunner interface {
	// contains filtered or unexported methods
}

func NewProcessRunner

func NewProcessRunner() CommandRunner

func NewRuncRunner

func NewRuncRunner(r ociruntime.OciRuntime, sidecar SidecarOpts) CommandRunner

type CorruptPackagesOpts

type CorruptPackagesOpts struct {
	Filter
	ExecutionContext
	Corruption uint
	Interfaces []string
}

func (*CorruptPackagesOpts) String

func (o *CorruptPackagesOpts) String() string

type DelayOpts

type DelayOpts struct {
	Filter
	ExecutionContext
	Delay      time.Duration
	Jitter     time.Duration
	Interfaces []string
	// When true, only delay TCP packets with PSH flag set. Uses iptables marks + tc fw filter.
	TcpPshOnly bool
}

func (*DelayOpts) String

func (o *DelayOpts) String() string

type ErrTooManyTcCommands

type ErrTooManyTcCommands struct {
	Count int
}

func (*ErrTooManyTcCommands) Error

func (e *ErrTooManyTcCommands) Error() string

type ExecutionContext

type ExecutionContext struct {
	ExperimentKey         string
	ExperimentExecutionId int
	TargetExecutionId     string
}

type Filter

type Filter struct {
	Include []network.NetWithPortRange
	Exclude []network.NetWithPortRange
}

type IpProto

type IpProto string
const IpProtoTcp IpProto = "tcp"
const IpProtoUdp IpProto = "udp"

type LimitBandwidthOpts

type LimitBandwidthOpts struct {
	Filter
	ExecutionContext
	Bandwidth  string
	Interfaces []string
}

func (*LimitBandwidthOpts) String

func (o *LimitBandwidthOpts) String() string

type Opts

type Opts interface {
	String() string
	// contains filtered or unexported methods
}

type PackageLossOpts

type PackageLossOpts struct {
	Filter
	ExecutionContext
	Loss       uint
	Interfaces []string
}

func (*PackageLossOpts) String

func (o *PackageLossOpts) String() string

type SidecarOpts

type SidecarOpts struct {
	TargetProcess ociruntime.LinuxProcessInfo
	Id            string
}

type TcpResetOpts

type TcpResetOpts struct {
	Filter
	ExecutionContext
	Interfaces     []string
	Prepend        bool
	UseMangleChain bool
}

func (*TcpResetOpts) String

func (o *TcpResetOpts) String() string

Jump to

Keyboard shortcuts

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