iptables

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package iptables implements helpers for manipulating the iptables. Requires the iptables command to be installed. Requires 'NET_ADMIN' capabilities for manipulating the iptables.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TrafficRedirectionSpec

type TrafficRedirectionSpec struct {
	// Interface on which the traffic will be intercepted
	Iface string
	// Destination port of the traffic to be redirected
	DestinationPort uint
	// Port the traffic will be redirected to
	RedirectPort uint
}

TrafficRedirectionSpec specifies the redirection of traffic to a destination

type TrafficRedirector

type TrafficRedirector interface {
	// Start initiates the redirection of traffic and resets existing connections
	Start() error
	// Stop restores the traffic to the original target and resets existing connections
	// to the redirection target
	Stop() error
}

TrafficRedirector defines the interface for a traffic redirector

func NewTrafficRedirector

func NewTrafficRedirector(tf *TrafficRedirectionSpec) (TrafficRedirector, error)

NewTrafficRedirector creates an instance of a TrafficRedirector with default configuration

type TrafficRedirectorConfig

type TrafficRedirectorConfig struct {
	Executor process.Executor
}

TrafficRedirectorConfig defines the options for creating a TrafficRedirector

Jump to

Keyboard shortcuts

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