firewall

package
v0.0.0-...-e749f68 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2023 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DestinationNATRule

type DestinationNATRule struct {
	Rule
	Address *string `json:"address,omitempty"`
	Service *string `json:"service,omitempty"`
}

type Firewall

type Firewall struct {
	ForwardRules        []ForwardRule        `json:"forward_rules"`
	DestinationNATRules []DestinationNATRule `json:"destination_nat_rules"`
	SourceNATRules      []SourceNATRule      `json:"source_nat_rules"`
}

type ForwardRule

type ForwardRule struct {
	Rule
	Verdict Verdict `json:"verdict"`
}

type Match

type Match struct {
	Services             []string `json:"services,omitempty"`
	SourceAddresses      []string `json:"source_addresses,omitempty"`
	DestinationAddresses []string `json:"destination_addresses,omitempty"`
}

type Rule

type Rule struct {
	Name    string `json:"name"`
	Match   Match  `json:"match"`
	Comment string `json:"comment,omitempty"`
	Counter bool   `json:"counter,omitempty"`
}

type SnatType

type SnatType int
const (
	Snat SnatType = iota
	Masquerade
)

func (*SnatType) FromString

func (t *SnatType) FromString(input string) SnatType

func (SnatType) MarshalJSON

func (t SnatType) MarshalJSON() ([]byte, error)

func (SnatType) String

func (t SnatType) String() string

func (*SnatType) UnmarshalJSON

func (t *SnatType) UnmarshalJSON(b []byte) error

type SourceNATRule

type SourceNATRule struct {
	Rule
	Type    SnatType `json:"type"`
	Address *string  `json:"address,omitempty"`
	Service *string  `json:"service,omitempty"`
}

type Verdict

type Verdict int
const (
	Accept Verdict = iota
	Drop
	Continue
)

func (*Verdict) FromString

func (t *Verdict) FromString(input string) Verdict

func (Verdict) MarshalJSON

func (t Verdict) MarshalJSON() ([]byte, error)

func (Verdict) String

func (t Verdict) String() string

func (*Verdict) UnmarshalJSON

func (t *Verdict) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

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