network

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ModeAdd    = akn.ModeAdd
	ModeDelete = akn.ModeDelete
)
View Source
var (
	FamilyV4 = akn.FamilyV4
	FamilyV6 = akn.FamilyV6
)

Functions

func Apply

func Apply(ctx context.Context, opts WinOpts) error

func CleanupQosPolicies

func CleanupQosPolicies()

func Revert

func Revert(ctx context.Context, opts WinOpts) error

Types

type BlackholeOpts

type BlackholeOpts struct {
	Filter
	Duration   time.Duration
	FilterFile string
}

func (*BlackholeOpts) QoSCommands

func (o *BlackholeOpts) QoSCommands(_ Mode) ([]string, error)

func (*BlackholeOpts) String

func (o *BlackholeOpts) String() string

func (*BlackholeOpts) WinDivertCommands

func (o *BlackholeOpts) WinDivertCommands(mode Mode) ([]string, error)

type CorruptPackagesOpts

type CorruptPackagesOpts struct {
	Filter
	Corruption uint
	Duration   time.Duration
	FilterFile string
}

func (*CorruptPackagesOpts) QoSCommands

func (o *CorruptPackagesOpts) QoSCommands(_ Mode) ([]string, error)

func (*CorruptPackagesOpts) String

func (o *CorruptPackagesOpts) String() string

func (*CorruptPackagesOpts) WinDivertCommands

func (o *CorruptPackagesOpts) WinDivertCommands(mode Mode) ([]string, error)

type DelayOpts

type DelayOpts struct {
	Filter
	Delay      time.Duration
	Duration   time.Duration
	Jitter     bool
	FilterFile string
}

func (*DelayOpts) QoSCommands

func (o *DelayOpts) QoSCommands(_ Mode) ([]string, error)

func (*DelayOpts) String

func (o *DelayOpts) String() string

func (*DelayOpts) WinDivertCommands

func (o *DelayOpts) WinDivertCommands(mode Mode) ([]string, error)

type Direction

type Direction string
var (
	DirectionIncoming Direction = "Incoming"
	DirectionOutgoing Direction = "Outgoing"
	DirectionAll      Direction = "All"
)

type Family

type Family = akn.Family

type Filter

type Filter struct {
	Filter           akn.Filter
	InterfaceIndexes []int
	Direction        Direction
}

type LimitBandwidthOpts

type LimitBandwidthOpts struct {
	Bandwidth    string
	IncludeCidrs []net.IPNet
	PortRange    network.PortRange
}

func (*LimitBandwidthOpts) QoSCommands

func (o *LimitBandwidthOpts) QoSCommands(mode Mode) ([]string, error)

func (*LimitBandwidthOpts) String

func (o *LimitBandwidthOpts) String() string

func (*LimitBandwidthOpts) WinDivertCommands

func (o *LimitBandwidthOpts) WinDivertCommands(_ Mode) ([]string, error)

type Mode

type Mode = akn.Mode

type PackageLossOpts

type PackageLossOpts struct {
	Filter
	Loss     uint
	Duration time.Duration
	// contains filtered or unexported fields
}

func (*PackageLossOpts) QoSCommands

func (o *PackageLossOpts) QoSCommands(_ Mode) ([]string, error)

func (*PackageLossOpts) String

func (o *PackageLossOpts) String() string

func (*PackageLossOpts) WinDivertCommands

func (o *PackageLossOpts) WinDivertCommands(mode Mode) ([]string, error)

type WinOpts

type WinOpts interface {
	QoSCommands(mode Mode) ([]string, error)
	WinDivertCommands(mode Mode) ([]string, error)
	String() string
}

Jump to

Keyboard shortcuts

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