bettercap: github.com/bettercap/bettercap/firewall Index | Files

package firewall

import "github.com/bettercap/bettercap/firewall"

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

Index

Package Files

doc.go firewall.go firewall_linux.go redirection.go

Constants

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

type FirewallManager Uses

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

func Make Uses

func Make(iface *network.Endpoint) FirewallManager

type LinuxFirewall Uses

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

func (LinuxFirewall) EnableForwarding Uses

func (f LinuxFirewall) EnableForwarding(enabled bool) error

func (*LinuxFirewall) EnableRedirection Uses

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

func (LinuxFirewall) IsForwardingEnabled Uses

func (f LinuxFirewall) IsForwardingEnabled() bool

func (LinuxFirewall) Restore Uses

func (f LinuxFirewall) Restore()

type Redirection Uses

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

func NewRedirection Uses

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

func (Redirection) String Uses

func (r Redirection) String() string

Package firewall imports 6 packages (graph) and is imported by 6 packages. Updated 2018-10-24. Refresh now. Tools for package owners.