config

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: May 23, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chain

type Chain struct {
	Name string
}

func (Chain) GetFullName

func (c Chain) GetFullName(prefix string) string

type Config

type Config struct {
	Owner    Owner
	Redirect Redirect
	// DropInvalidPackets when set will enable configuration which should drop
	// packets in invalid states
	DropInvalidPackets bool
	// IPv6 when set will be used to configure iptables as well as ip6tables
	IPv6 bool
	// RuntimeOutput is the place where Any debugging, runtime information
	// will be placed (os.Stdout by default)
	RuntimeOutput io.Writer
	// Verbose when set will generate iptables configuration with longer
	// argument/flag names, additional comments etc.
	Verbose bool
}

func MergeConfigWithDefaults added in v0.2.0

func MergeConfigWithDefaults(cfg Config) Config

func (Config) ShouldDropInvalidPackets added in v0.2.0

func (c Config) ShouldDropInvalidPackets() bool

ShouldDropInvalidPackets is just a convenience function which can be used in iptables conditional command generations instead of inlining anonymous functions i.e. AppendIf(ShouldDropInvalidPackets, Match(...), Jump(Drop()))

func (Config) ShouldRedirectDNS added in v0.2.0

func (c Config) ShouldRedirectDNS() bool

ShouldRedirectDNS is just a convenience function which can be used in iptables conditional command generations instead of inlining anonymous functions i.e. AppendIf(ShouldRedirectDNS, Match(...), Jump(Drop()))

type DNS

type DNS struct {
	Enabled            bool
	Port               uint16
	ConntrackZoneSplit bool
}

type Owner

type Owner struct {
	UID string
}

type Redirect

type Redirect struct {
	// NamePrefix is a prefix which will be used go generate chains name
	NamePrefix string
	Inbound    TrafficFlow
	Outbound   TrafficFlow
	DNS        DNS
}

type TrafficFlow

type TrafficFlow struct {
	Port          uint16
	Chain         Chain
	RedirectChain Chain
	ExcludePorts  []uint16
}

TrafficFlow is a struct for Inbound/Outbound configuration

Jump to

Keyboard shortcuts

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