firewall

package
v2.24.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2019 License: GPL-3.0 Imports: 6 Imported by: 122

Documentation

Overview

Package firewall contains the OS specific implementation of the FirewallManager interface.

Index

Constants

View Source
const (
	IPV4ForwardingFile = "/proc/sys/net/ipv4/ip_forward"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FirewallManager

type FirewallManager interface {
	IsForwardingEnabled() bool
	EnableForwarding(enabled bool) error
	EnableRedirection(r *Redirection, enabled bool) error
	Restore()
}

func Make

func Make(iface *network.Endpoint) FirewallManager

type LinuxFirewall

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

func (LinuxFirewall) EnableForwarding

func (f LinuxFirewall) EnableForwarding(enabled bool) error

func (*LinuxFirewall) EnableRedirection

func (f *LinuxFirewall) EnableRedirection(r *Redirection, enabled bool) error

func (LinuxFirewall) IsForwardingEnabled

func (f LinuxFirewall) IsForwardingEnabled() bool

func (LinuxFirewall) Restore

func (f LinuxFirewall) Restore()

type Redirection

type Redirection struct {
	Interface  string
	Protocol   string
	SrcAddress string
	SrcPort    int
	DstAddress string
	DstPort    int
}

func NewRedirection

func NewRedirection(iface string, proto string, port_from int, addr_to string, port_to int) *Redirection

func (Redirection) String

func (r Redirection) String() string

Jump to

Keyboard shortcuts

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