firewall

package
v0.0.0-...-410f0c4 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action int

consts taken from here: https://msdn.microsoft.com/en-us/library/windows/desktop/aa366327(v=vs.85).aspx

const (
	NET_FW_ACTION_BLOCK Action = 0
	NET_FW_ACTION_ALLOW Action = 1
)

type Direction

type Direction int
const (
	NET_FW_RULE_DIR_IN  Direction = 1
	NET_FW_RULE_DIR_OUT Direction = 2
)

type Firewall

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

func NewFirewall

func NewFirewall(firewallDLL string) (*Firewall, error)

func (*Firewall) Close

func (f *Firewall) Close() error

func (*Firewall) CreateRule

func (f *Firewall) CreateRule(rule Rule) error

func (*Firewall) DeleteRule

func (f *Firewall) DeleteRule(name string) error

func (*Firewall) RuleExists

func (f *Firewall) RuleExists(name string) (bool, error)

type Protocol

type Protocol int
const (
	NET_FW_IP_PROTOCOL_ICMP Protocol = 1
	NET_FW_IP_PROTOCOL_TCP  Protocol = 6
	NET_FW_IP_PROTOCOL_UDP  Protocol = 17
	NET_FW_IP_PROTOCOL_ANY  Protocol = 256
)

type Rule

type Rule struct {
	Name            string
	Action          Action
	Direction       Direction
	Protocol        Protocol
	LocalAddresses  string
	LocalPorts      string
	RemoteAddresses string
	RemotePorts     string
}

Jump to

Keyboard shortcuts

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