settings

package
v0.0.0-...-5849f3d Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Copyright (c) 2020 RethinkDNS and its authors.

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

Index

Constants

View Source
const BlockModeFilter int = 1

BlockModeFilter filters packets on connection establishment.

View Source
const BlockModeFilterProc int = 3

BlockModeFilterProc determines owner-uid of a tcp/udp connection from procfs before filtering

View Source
const BlockModeNone int = 0

BlockModeNone filters no packet.

View Source
const BlockModeSink int = 2

BlockModeSink blackholes all packets.

View Source
const DNSModeIP int = 1

DNSModeIP redirects DNS requests sent to the IP endpoint set by VPN.

View Source
const DNSModeNone = 0

DNSModeNone does not redirect DNS queries sent to the tunnel.

View Source
const DNSModePort int = 2

DNSModePort redirects all DNS requests on port 53.

View Source
const IP4 = "4"
View Source
const IP46 = "46"
View Source
const IP6 = "6"
View Source
const NICID = 0x01
View Source
const Ns4 = 0b010 // 2

msb to lsb: ipv6, ipv4, lwip(1) or netstack(0)

View Source
const Ns46 = 0b110 // 6
View Source
const Ns6 = 0b100 // 4
View Source
const PtModeAuto int = 0

PtModeAuto does not enforce (but may still use) 6to4 protocol translation.

View Source
const PtModeForce64 int = 1

PtModeForce64 enforces 6to4 protocol translation.

View Source
const PtModeNo46 int = 2

Android implements 464Xlat out-of-the-box, so this zero userspace impl

Variables

View Source
var Debug bool = false

Functions

func L3

func L3(engine int) string

Types

type DNSOptions

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

DNSOptions define https or socks5 proxy options

func NewDNSOptions

func NewDNSOptions(ipport string) (*DNSOptions, error)

NewDNSOptions returns a new DNSOpitons object.

func NewDNSOptionsFromHostname

func NewDNSOptionsFromHostname(hostname, ipcsv string) (*DNSOptions, error)

func NewDNSOptionsFromNetIp

func NewDNSOptionsFromNetIp(ipp netip.AddrPort) (*DNSOptions, error)

func (*DNSOptions) AddrPort

func (d *DNSOptions) AddrPort() string

func (*DNSOptions) ResolvedAddrs

func (d *DNSOptions) ResolvedAddrs() string

func (*DNSOptions) String

func (d *DNSOptions) String() string

type ProxyOptions

type ProxyOptions struct {
	Auth   *proxy.Auth
	IP     string   // just the ip
	Host   string   // just the hostname (no port)
	Port   string   // just the port number
	IPPort string   // may be a url or ip:port
	Scheme string   // http, https, socks5, pip
	Addrs  []string // list of ips if ipport is a url; may be nil
}

ProxyOptions define https or socks5 proxy options

func NewAuthProxyOptions

func NewAuthProxyOptions(scheme, username, password, ip, port string, addrs []string) *ProxyOptions

NewAuthProxyOptions returns a new ProxyOptions object with authentication object.

func NewProxyOptions

func NewProxyOptions(ip string, port string) *ProxyOptions

NewProxyOptions returns a new ProxyOptions object.

func (*ProxyOptions) FullUrl

func (p *ProxyOptions) FullUrl() string

func (*ProxyOptions) HasAuth

func (p *ProxyOptions) HasAuth() bool

func (*ProxyOptions) String

func (p *ProxyOptions) String() string

func (*ProxyOptions) Url

func (p *ProxyOptions) Url() string

type TunMode

type TunMode struct {
	// DNSMode specifies the kind of DNS traffic to be trapped and routed to DoH servers
	DNSMode int
	// BlockMode instructs change in firewall behaviour.
	BlockMode int
	// PtMode determines 6to4 translation heuristics.
	PtMode int
}

TunMode specifies dns, firewall, xlat, and ip modes

func DefaultTunMode

func DefaultTunMode() *TunMode

DefaultTunMode returns a new default TunMode with IP-only DNS capture and replay (not all DNS traffic but only the DNS traffic sent to [tcp/udp]handler.fakedns is captured and replayed to the remote DoH server) and with firewall disabled.

func NewTunMode

func NewTunMode(d, b, pt int) *TunMode

NewTunMode returns a new TunMode object. `d` sets dns-mode. `b` sets block-mode. `pt` sets natpt-mode.

func (*TunMode) SetMode

func (t *TunMode) SetMode(d, b, pt int)

SetMode re-assigns d to DNSMode, b to BlockMode, pt to NatPtMode.

Jump to

Keyboard shortcuts

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