firewall

package
v2.21.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2019 License: GPL-3.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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