divert

package
v0.0.0-...-8e6527b Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2022 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Rendered for windows/amd64

Index

Constants

View Source
const (
	// ProtoTCP is ...
	ProtoTCP = 6
	// ProtoUDP is ...
	ProtoUDP = 17
)
View Source
const (
	// FIN is ...
	FIN = 1 << 0
	// SYN is ...
	SYN = 1 << 1
)

Variables

View Source
var (
	// SysFilePath is ...
	SysFilePath = ""
	// DllFilePath is ...
	DllFilePath = ""
)

Functions

func GetDriverFileName

func GetDriverFileName() (string, error)

GetDriverFileName is ...

func GetInterfaceIndex

func GetInterfaceIndex() (uint32, uint32, error)

GetInterfaceIndex is ...

func InstallDriver

func InstallDriver() error

InstallDriver is ...

func RegisterEventSource

func RegisterEventSource(sys string) error

RegisterEventSource is ...

func RemoveDriver

func RemoveDriver() error

RemoveDriver is ...

Types

type Device

type Device struct {
	// Address is ...
	Address *divert.Address
	// Handle is ...
	Handle *divert.Handle
	// Filter is ...
	Filter *PacketFilter
	// Pipe is ...
	Pipe struct {
		// PipeReader is ...
		*io.PipeReader
		// PipeWriter is ...
		*io.PipeWriter
		// Event is ...
		Event chan struct{}
	}
	// contains filtered or unexported fields
}

Device is ...

func NewDevice

func NewDevice(filter string, appFilter *filter.AppFilter, ipFilter *filter.IPFilter, hijack bool) (dev *Device, err error)

NewDevice is ...

func (*Device) Close

func (d *Device) Close() error

Close is ...

func (*Device) DeviceType

func (d *Device) DeviceType() string

DeviceType is ...

func (*Device) Write

func (d *Device) Write(b []byte) (int, error)

Write is ...

func (*Device) WriteTo

func (d *Device) WriteTo(w io.Writer) (n int64, err error)

WriteTo is ...

type PacketFilter

type PacketFilter struct {
	// AppFilter is ...
	AppFilter *filter.AppFilter
	// IPFilter is ...
	IPFilter *filter.IPFilter
	// Hijack is ...
	Hijack bool

	// TCP4Table is ...
	TCP4Table []uint8
	// UDP4Table is ...
	UDP4Table []uint8
	// TCP6Table is ...
	TCP6Table []uint8
	// UDP6Table is ...
	UDP6Table []uint8
	// contains filtered or unexported fields
}

PacketFilter is ...

func (*PacketFilter) CheckIPv4

func (d *PacketFilter) CheckIPv4(b []byte) bool

CheckIPv4 is ...

func (*PacketFilter) CheckIPv6

func (d *PacketFilter) CheckIPv6(b []byte) bool

CheckIPv6 is ...

func (*PacketFilter) CheckTCP4ByPID

func (d *PacketFilter) CheckTCP4ByPID(b []byte) bool

CheckTCP4ByPID is ...

func (*PacketFilter) CheckTCP6ByPID

func (d *PacketFilter) CheckTCP6ByPID(b []byte) bool

CheckTCP6ByPID is ...

func (*PacketFilter) CheckUDP4ByPID

func (d *PacketFilter) CheckUDP4ByPID(b []byte) bool

CheckUDP4ByPID is ...

func (*PacketFilter) CheckUDP6ByPID

func (d *PacketFilter) CheckUDP6ByPID(b []byte) bool

CheckUDP6ByPID is ...

Directories

Path Synopsis
iptree
Package iptree implements radix tree data structure for IPv4 and IPv6 networks.
Package iptree implements radix tree data structure for IPv4 and IPv6 networks.

Jump to

Keyboard shortcuts

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