bettercap: Index | Files

package firewall

import ""

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


Package Files

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


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

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 11 packages. Updated 2019-04-25. Refresh now. Tools for package owners.