firewalld

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2022 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chain

type Chain struct {
	// required, ip family: "ipv4", "ipv6", "eb"
	IPv string `xml:"ipv,attr"`

	// required, netfilter table: "nat", "mangle", etc.
	Table string `xml:"table,attr"`

	// required, netfilter chain: "FORWARD", custom chain names
	Chain string `xml:"chain,attr"`

	XMLName struct{} `xml:"chain"`
}

func NewIP4Chain

func NewIP4Chain(table, chain string) *Chain

func (*Chain) String

func (c *Chain) String() string

type Direct

type Direct struct {
	Chains []*Chain
	Rules  []*Rule

	XMLName struct{} `xml:"direct"`
}

func NewDirect

func NewDirect(rules ...*Rule) *Direct

func (*Direct) AddChain

func (d *Direct) AddChain(chain *Chain)

func (*Direct) AddRule

func (d *Direct) AddRule(rule *Rule)

func (*Direct) Bytes

func (d *Direct) Bytes() []byte

func (*Direct) String

func (d *Direct) String() string

type IptablesRule

type IptablesRule struct {
	Mode          string
	Chain         string
	Rulenum       int
	Specification string
}

type IptablesTranslator

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

func NewIptablesTranslator

func NewIptablesTranslator() *IptablesTranslator

func (*IptablesTranslator) StoreRules

func (t *IptablesTranslator) StoreRules(rawIptables string) (string, error)

func (*IptablesTranslator) WithDirectFilePath

func (t *IptablesTranslator) WithDirectFilePath(filePath string) *IptablesTranslator

func (*IptablesTranslator) WithDryRun

func (t *IptablesTranslator) WithDryRun(dryRun bool) *IptablesTranslator

func (*IptablesTranslator) WithOutput

func (t *IptablesTranslator) WithOutput(output io.Writer) *IptablesTranslator

type Rule

type Rule struct {
	// required, ip family: "ipv4", "ipv6", "eb"
	IPv string `xml:"ipv,attr"`

	// required, netfilter table: "nat", "mangle", etc.
	Table string `xml:"table,attr"`

	// required, netfilter chain: "FORWARD", custom chain names
	Chain string `xml:"chain,attr"`

	// required, smaller the number more front the rule in chain
	Priority int `xml:"priority,attr"`

	// match and action command line options for {ip,ip6,eb}tables
	Body string `xml:",chardata"`

	XMLName struct{} `xml:"rule"`
}

func NewIP4Rule

func NewIP4Rule(table string, priority int, chain, body string) *Rule

func (*Rule) String

func (r *Rule) String() string

Jump to

Keyboard shortcuts

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