firewall

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

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) GetOptions

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

GetOptions Get VM firewall options.

func (*Client) Index

func (c *Client) Index(ctx context.Context, req *IndexRequest) (*IndexResponse, error)

Index Directory index.

func (*Client) Log

func (c *Client) Log(ctx context.Context, req *LogRequest) (*LogResponse, error)

Log Read firewall log

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) (*SetOptionsResponse, error)

SetOptions Set Firewall options.

type GetOptionsRequest

type GetOptionsRequest struct {
	Node string `url:"node",json:"node"` // The cluster node name.
	Vmid int    `url:"vmid",json:"vmid"` // The (unique) ID of the VM.

}

type GetOptionsResponse

type GetOptionsResponse struct {

	// The following parameters are optional
	Dhcp        *util.SpecialBool `url:"dhcp,omitempty",json:"dhcp,omitempty"`                   // Enable DHCP.
	Enable      *util.SpecialBool `url:"enable,omitempty",json:"enable,omitempty"`               // Enable/disable firewall rules.
	Ipfilter    *util.SpecialBool `url:"ipfilter,omitempty",json:"ipfilter,omitempty"`           // Enable default IP filters. This is equivalent to adding an empty ipfilter-net<id> ipset for every interface. Such ipsets implicitly contain sane default restrictions such as restricting IPv6 link local addresses to the one derived from the interface's MAC address. For containers the configured IP addresses will be implicitly added.
	LogLevelIn  *string           `url:"log_level_in,omitempty",json:"log_level_in,omitempty"`   // Log level for incoming traffic.
	LogLevelOut *string           `url:"log_level_out,omitempty",json:"log_level_out,omitempty"` // Log level for outgoing traffic.
	Macfilter   *util.SpecialBool `url:"macfilter,omitempty",json:"macfilter,omitempty"`         // Enable/disable MAC address filter.
	Ndp         *util.SpecialBool `url:"ndp,omitempty",json:"ndp,omitempty"`                     // Enable NDP (Neighbor Discovery Protocol).
	PolicyIn    *string           `url:"policy_in,omitempty",json:"policy_in,omitempty"`         // Input policy.
	PolicyOut   *string           `url:"policy_out,omitempty",json:"policy_out,omitempty"`       // Output policy.
	Radv        *util.SpecialBool `url:"radv,omitempty",json:"radv,omitempty"`                   // Allow sending Router Advertisement.
}

type HTTPClient

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

type IndexRequest

type IndexRequest struct {
	Node string `url:"node",json:"node"` // The cluster node name.
	Vmid int    `url:"vmid",json:"vmid"` // The (unique) ID of the VM.

}

type IndexResponse

type IndexResponse []*map[string]interface{}

type LogRequest

type LogRequest struct {
	Node string `url:"node",json:"node"` // The cluster node name.
	Vmid int    `url:"vmid",json:"vmid"` // The (unique) ID of the VM.

	// The following parameters are optional
	Limit *int `url:"limit,omitempty",json:"limit,omitempty"`
	Start *int `url:"start,omitempty",json:"start,omitempty"`
}

type LogResponse

type LogResponse []*struct {
	N int    `url:"n",json:"n"` // Line number
	T string `url:"t",json:"t"` // Line text

}

type RefsRequest

type RefsRequest struct {
	Node string `url:"node",json:"node"` // The cluster node name.
	Vmid int    `url:"vmid",json:"vmid"` // The (unique) ID of the VM.

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

type RefsResponse

type RefsResponse []*struct {
	Name string `url:"name",json:"name"`
	Type string `url:"type",json:"type"`

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

type SetOptionsRequest

type SetOptionsRequest struct {
	Node string `url:"node",json:"node"` // The cluster node name.
	Vmid int    `url:"vmid",json:"vmid"` // The (unique) ID of the VM.

	// The following parameters are optional
	Delete      *string           `url:"delete,omitempty",json:"delete,omitempty"`               // A list of settings you want to delete.
	Dhcp        *util.SpecialBool `url:"dhcp,omitempty",json:"dhcp,omitempty"`                   // Enable DHCP.
	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.
	Enable      *util.SpecialBool `url:"enable,omitempty",json:"enable,omitempty"`               // Enable/disable firewall rules.
	Ipfilter    *util.SpecialBool `url:"ipfilter,omitempty",json:"ipfilter,omitempty"`           // Enable default IP filters. This is equivalent to adding an empty ipfilter-net<id> ipset for every interface. Such ipsets implicitly contain sane default restrictions such as restricting IPv6 link local addresses to the one derived from the interface's MAC address. For containers the configured IP addresses will be implicitly added.
	LogLevelIn  *string           `url:"log_level_in,omitempty",json:"log_level_in,omitempty"`   // Log level for incoming traffic.
	LogLevelOut *string           `url:"log_level_out,omitempty",json:"log_level_out,omitempty"` // Log level for outgoing traffic.
	Macfilter   *util.SpecialBool `url:"macfilter,omitempty",json:"macfilter,omitempty"`         // Enable/disable MAC address filter.
	Ndp         *util.SpecialBool `url:"ndp,omitempty",json:"ndp,omitempty"`                     // Enable NDP (Neighbor Discovery Protocol).
	PolicyIn    *string           `url:"policy_in,omitempty",json:"policy_in,omitempty"`         // Input policy.
	PolicyOut   *string           `url:"policy_out,omitempty",json:"policy_out,omitempty"`       // Output policy.
	Radv        *util.SpecialBool `url:"radv,omitempty",json:"radv,omitempty"`                   // Allow sending Router Advertisement.
}

type SetOptionsResponse

type SetOptionsResponse map[string]interface{}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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