firewall

package
v0.0.0-...-626b81c Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2018 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IPV4ForwardingFile    = "/proc/sys/net/ipv4/ip_forward"
	IPV4ICMPBcastFile     = "/proc/sys/net/ipv4/icmp_echo_ignore_broadcasts"
	IPV4SendRedirectsFile = "/proc/sys/net/ipv4/conf/all/send_redirects"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FirewallManager

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

func Make

func Make() FirewallManager

type LinuxFirewall

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

func (LinuxFirewall) EnableForwarding

func (f LinuxFirewall) EnableForwarding(enabled bool) error

func (LinuxFirewall) EnableIcmpBcast

func (f LinuxFirewall) EnableIcmpBcast(enabled bool) error

func (*LinuxFirewall) EnableRedirection

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

func (LinuxFirewall) EnableSendRedirects

func (f LinuxFirewall) EnableSendRedirects(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