firewall

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PolicyIn_ACCEPT PolicyIn = "ACCEPT"
	PolicyIn_REJECT PolicyIn = "REJECT"
	PolicyIn_DROP   PolicyIn = "DROP"

	PolicyOut_ACCEPT PolicyOut = "ACCEPT"
	PolicyOut_REJECT PolicyOut = "REJECT"
	PolicyOut_DROP   PolicyOut = "DROP"

	Type_ALIAS Type = "alias"
	Type_IPSET Type = "ipset"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func New

func New(c HTTPClient) *Client

func (*Client) GetMacros

func (c *Client) GetMacros(ctx context.Context) ([]GetMacrosResponse, error)

GetMacros List available macros

func (*Client) GetOptions

func (c *Client) GetOptions(ctx context.Context) (GetOptionsResponse, error)

GetOptions Get Firewall options.

func (*Client) Index

func (c *Client) Index(ctx context.Context) ([]map[string]interface{}, error)

Index Directory index.

func (*Client) Refs

func (c *Client) Refs(ctx context.Context, req RefsRequest) ([]RefsResponse, error)

Refs Lists possible IPSet/Alias reference which are allowed in source/dest properties.

func (*Client) SetOptions

func (c *Client) SetOptions(ctx context.Context, req SetOptionsRequest) error

SetOptions Set Firewall options.

type GetMacrosResponse

type GetMacrosResponse struct {
	Descr string `url:"descr" json:"descr"` // More verbose description (if available).
	Macro string `url:"macro" json:"macro"` // Macro name.

}

type GetOptionsResponse

type GetOptionsResponse struct {

	// The following parameters are optional
	Ebtables     *util.PVEBool `url:"ebtables,omitempty" json:"ebtables,omitempty"`           // Enable ebtables rules cluster wide.
	Enable       *int          `url:"enable,omitempty" json:"enable,omitempty"`               // Enable or disable the firewall cluster wide.
	LogRatelimit *LogRatelimit `url:"log_ratelimit,omitempty" json:"log_ratelimit,omitempty"` // Log ratelimiting settings
	PolicyIn     *PolicyIn     `url:"policy_in,omitempty" json:"policy_in,omitempty"`         // Input policy.
	PolicyOut    *PolicyOut    `url:"policy_out,omitempty" json:"policy_out,omitempty"`       // Output policy.
}

type HTTPClient

type HTTPClient interface {
	Do(context.Context, string, string, interface{}, interface{}) error
}

type LogRatelimit added in v0.0.10

type LogRatelimit struct {
	Enable util.PVEBool `url:"enable" json:"enable"` // Enable or disable log rate limiting

	// The following parameters are optional
	Burst *int    `url:"burst,omitempty" json:"burst,omitempty"` // Initial burst of packages which will always get logged before the rate is applied
	Rate  *string `url:"rate,omitempty" json:"rate,omitempty"`   // Frequency with which the burst bucket gets refilled
}

Log ratelimiting settings

func (LogRatelimit) EncodeValues added in v0.0.10

func (t LogRatelimit) EncodeValues(key string, v *url.Values) error

func (*LogRatelimit) UnmarshalJSON added in v0.0.19

func (t *LogRatelimit) UnmarshalJSON(d []byte) error

type PolicyIn added in v0.0.15

type PolicyIn string

func PtrPolicyIn added in v0.0.15

func PtrPolicyIn(i PolicyIn) *PolicyIn

type PolicyOut added in v0.0.15

type PolicyOut string

func PtrPolicyOut added in v0.0.15

func PtrPolicyOut(i PolicyOut) *PolicyOut

type RefsRequest

type RefsRequest struct {

	// The following parameters are optional
	Type *Type `url:"type,omitempty" json:"type,omitempty"` // Only list references of specified type.
}

type RefsResponse

type RefsResponse struct {
	Name string `url:"name" json:"name"`
	Ref  string `url:"ref" json:"ref"`
	Type Type   `url:"type" json:"type"`

	// The following parameters are optional
	Comment *string `url:"comment,omitempty" json:"comment,omitempty"`
}

type SetOptionsRequest

type SetOptionsRequest struct {

	// The following parameters are optional
	Delete       *string       `url:"delete,omitempty" json:"delete,omitempty"`               // A list of settings you want to delete.
	Digest       *string       `url:"digest,omitempty" json:"digest,omitempty"`               // Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications.
	Ebtables     *util.PVEBool `url:"ebtables,omitempty" json:"ebtables,omitempty"`           // Enable ebtables rules cluster wide.
	Enable       *int          `url:"enable,omitempty" json:"enable,omitempty"`               // Enable or disable the firewall cluster wide.
	LogRatelimit *LogRatelimit `url:"log_ratelimit,omitempty" json:"log_ratelimit,omitempty"` // Log ratelimiting settings
	PolicyIn     *PolicyIn     `url:"policy_in,omitempty" json:"policy_in,omitempty"`         // Input policy.
	PolicyOut    *PolicyOut    `url:"policy_out,omitempty" json:"policy_out,omitempty"`       // Output policy.
}

type Type added in v0.0.15

type Type string

func PtrType added in v0.0.15

func PtrType(i Type) *Type

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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