driver

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2022 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnsupported = errors.New(`unsupported`)

Functions

func RunCmd

func RunCmd(path string, args []string, stdout io.Writer) error

Types

type Driver added in v1.1.0

type Driver interface {
	RuleFrom(rule *Rule) []string
	Enabled(on bool) error
	Reset() error
	Import(wfwFile string) error
	Export(wfwFile string) error
	Insert(pos int, rule *Rule) error
	Append(rule *Rule) error
	Update(pos int, rule *Rule) error
	Delete(rule *Rule) error
	Exists(rule *Rule) (bool, error)
	List(table, chain string) ([]*Rule, error)
}

type Rule

type Rule struct {
	Type      string `json:"type" xml:"type"` // filter / nat / etc.
	Name      string `json:"name" xml:"name"`
	Direction string `json:"direction" xml:"direction"` // INPUT / OUTPUT / etc.
	Action    string `json:"action" xml:"action"`       // ACCEPT / DROP / etc.
	Protocol  string `json:"protocol" xml:"protocol"`   // tcp / udp / etc.

	// IP or Port
	RemoteIP   string `json:"remoteIP" xml:"remoteIP"`
	LocalIP    string `json:"localIP" xml:"localIP"`
	RemotePort string `json:"remotePort" xml:"remotePort"`
	LocalPort  string `json:"localPort" xml:"localPort"`
}

Directories

Path Synopsis
Package netsh for windows
Package netsh for windows

Jump to

Keyboard shortcuts

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