libbox

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2023 License: GPL-2.0 Imports: 20 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatBytes

func FormatBytes(length int64) string

func SetBasePath

func SetBasePath(path string)

func Version

func Version() string

Types

type BoxService

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

func NewService

func NewService(configContent string, platformInterface PlatformInterface) (*BoxService, error)

func (*BoxService) Close

func (s *BoxService) Close() error

func (*BoxService) Start

func (s *BoxService) Start() error

type OnDemandRule

type OnDemandRule interface {
	Target() int32
	DNSSearchDomainMatch() StringIterator
	DNSServerAddressMatch() StringIterator
	InterfaceTypeMatch() int32
	SSIDMatch() StringIterator
	ProbeURL() string
}

type OnDemandRuleIterator

type OnDemandRuleIterator interface {
	Next() OnDemandRule
	HasNext() bool
}

type PProfServer

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

func NewPProfServer

func NewPProfServer(port int) *PProfServer

func (*PProfServer) Close

func (s *PProfServer) Close() error

func (*PProfServer) Start

func (s *PProfServer) Start() error

type PlatformInterface

type PlatformInterface interface {
	AutoDetectInterfaceControl(fd int32) error
	OpenTun(options TunOptions) (int32, error)
	WriteLog(message string)
	UseProcFS() bool
	FindConnectionOwner(ipProtocol int32, sourceAddress string, sourcePort int32, destinationAddress string, destinationPort int32) (int32, error)
	PackageNameByUid(uid int32) (string, error)
	UIDByPackageName(packageName string) (int32, error)
}

type RoutePrefix

type RoutePrefix struct {
	Address string
	Prefix  int32
}

func (*RoutePrefix) Mask

func (p *RoutePrefix) Mask() string

type RoutePrefixIterator

type RoutePrefixIterator interface {
	Next() *RoutePrefix
	HasNext() bool
}

type StringIterator

type StringIterator interface {
	Next() string
	HasNext() bool
}

type TunInterface

type TunInterface interface {
	FileDescriptor() int32
	Close() error
}

type TunOptions

type TunOptions interface {
	GetInet4Address() RoutePrefixIterator
	GetInet6Address() RoutePrefixIterator
	GetDNSServerAddress() (string, error)
	GetMTU() int32
	GetAutoRoute() bool
	GetStrictRoute() bool
	GetInet4RouteAddress() RoutePrefixIterator
	GetInet6RouteAddress() RoutePrefixIterator
	GetIncludePackage() StringIterator
	GetExcludePackage() StringIterator
	IsHTTPProxyEnabled() bool
	GetHTTPProxyServer() string
	GetHTTPProxyServerPort() int32
}

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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