intercept

package
v0.31.0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2023 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	A   = 1
	MX  = 15
	TXT = 16
	SRV = 33
)

record type

View Source
const (
	NOERROR  = 0
	FORMERR  = 1
	SERVFAIL = 2
	NXDOMAIN = 3
	NOTIMP   = 4
	REFUSED  = 5
)

response code

Variables

This section is empty.

Functions

func GetInterceptAddresses

func GetInterceptAddresses(service *entities.Service, protocols []string, resolver dns.Resolver, addressCB InterceptAddrCB) error

func SetDnsInterceptIpRange

func SetDnsInterceptIpRange(cidr string) error

Types

type AddressTracker

type AddressTracker interface {
	AddAddress(addr string)
	RemoveAddress(addr string) bool
}

type DnsAnswer

type DnsAnswer struct {
	Name     string `json:"name"`
	Type     int    `json:"type"`
	TTL      int    `json:"ttl"`
	Data     string `json:"data"`
	Port     uint16 `json:"port,omitempty"`
	Priority uint16 `json:"priority,omitempty"`
	Weight   uint16 `json:"weight,omitempty"`
}

type DnsMessage

type DnsMessage struct {
	Id       int            `json:"id"`
	Status   int            `json:"status"`
	Question []*DnsQuestion `json:"question"`
	Answer   []*DnsAnswer   `json:"answer"`
	Comment  string         `json:"comment,omitempty"`
}

type DnsQuestion

type DnsQuestion struct {
	Name string `json:"name"`
	Type int    `json:"type"`
}

type InterceptAddrCB

type InterceptAddrCB interface {
	Apply(*InterceptAddress)
}

type InterceptAddress

type InterceptAddress struct {
	TproxySpec []string
	AcceptSpec []string
	// contains filtered or unexported fields
}

func (*InterceptAddress) Contains

func (addr *InterceptAddress) Contains(ip net.IP, port uint16) bool

func (*InterceptAddress) HighPort

func (addr *InterceptAddress) HighPort() uint16

func (*InterceptAddress) IpNet

func (addr *InterceptAddress) IpNet() *net.IPNet

func (*InterceptAddress) LowPort

func (addr *InterceptAddress) LowPort() uint16

func (*InterceptAddress) Proto

func (addr *InterceptAddress) Proto() string

func (*InterceptAddress) String

func (addr *InterceptAddress) String() string

type Interceptor

type Interceptor interface {
	Stop()
	Intercept(service *entities.Service, resolver dns.Resolver, tracker AddressTracker) error
	StopIntercepting(serviceName string, tracker AddressTracker) error
}

type Protocol

type Protocol int
const (
	TCP Protocol = 2
	UDP Protocol = 17
)

type ServiceListener

type ServiceListener struct {
	*sync.Mutex
	// contains filtered or unexported fields
}

func NewServiceListener

func NewServiceListener(interceptor Interceptor, resolver dns.Resolver) *ServiceListener

func (*ServiceListener) HandleProviderReady

func (self *ServiceListener) HandleProviderReady(provider tunnel.FabricProvider)

func (*ServiceListener) HandleServicesChange

func (self *ServiceListener) HandleServicesChange(eventType ziti.ServiceEventType, service *rest_model.ServiceDetail)

func (*ServiceListener) WaitForShutdown

func (self *ServiceListener) WaitForShutdown()

type ServiceListenerGroup

type ServiceListenerGroup struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewServiceListenerGroup

func NewServiceListenerGroup(interceptor Interceptor, resolver dns.Resolver) *ServiceListenerGroup

func (*ServiceListenerGroup) NewServiceListener

func (self *ServiceListenerGroup) NewServiceListener() *ServiceListener

func (*ServiceListenerGroup) WaitForShutdown

func (self *ServiceListenerGroup) WaitForShutdown()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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