nat

package
v0.0.0-...-365054f Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: GPL-3.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var HumanReadableTypes = map[NATType]string{
	NATTypeNone:               "None",
	NATTypeFullCone:           "Full Cone",
	NATTypeRestrictedCone:     "Restricted Cone",
	NATTypePortRestrictedCone: "Port Restricted Cone",
	NATTypeSymmetric:          "Symmetric",
}

HumanReadableTypes is a map of enum values to human readable strings

Functions

This section is empty.

Types

type Command

type Command interface {
	CombinedOutput() ([]byte, error)
	Output() ([]byte, error)
}

Command allows us to run commands

type CommandFactory

type CommandFactory func(name string, arg ...string) Command

CommandFactory is responsible for creating new instances of command

type NATService

type NATService interface {
	Enable() error
	Setup(opts Options) (rules []interface{}, err error)
	Del(rules []interface{}) error
	Disable() error
}

NATService routes internet traffic through provider and sets up firewall rules for security

func NewService

func NewService() NATService

NewService returns linux os specific nat service based on ip tables

type NATType

type NATType string

NATType represents nat type

const (
	NATTypeNone               NATType = "none"
	NATTypeFullCone           NATType = "fullcone"
	NATTypeRestrictedCone     NATType = "rcone"
	NATTypePortRestrictedCone NATType = "prcone"
	NATTypeSymmetric          NATType = "symmetric"
)

Enum of DiscoverNATBehavior return values

type Options

type Options struct {
	VPNNetwork    net.IPNet
	ProviderExtIP net.IP
	DNSIP         net.IP
}

Options params to setup firewall/NAT rules.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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