diverter

package
v0.0.0-...-0092326 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultDLLPath = "WinDivert.dll"
View Source
const DefaultFilter = ffi2.Filter("true")

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	DLLPath string

	Filter   ffi2.Filter
	Layer    ffi2.Layer
	Priority ffi2.Priority
	Flag     ffi2.Flag

	SendChanSize      uint
	RecvChanSize      uint
	ReceiveBufferSize uint
}

func NewDefaultDiverterConfig

func NewDefaultDiverterConfig(dllPath string, filter string) (ret *Config)

func (*Config) Defaults

func (c *Config) Defaults()

type Diverter

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

func New

func New(config *Config) (ret *Diverter, err error)

func (*Diverter) GetParam

func (d *Diverter) GetParam(param ffi.Param) (value uint64, err error)

func (*Diverter) Handle

func (d *Diverter) Handle() uintptr

func (*Diverter) LibraryReference

func (d *Diverter) LibraryReference() *ffi.LibraryReference

func (*Diverter) RecvChan

func (d *Diverter) RecvChan() <-chan *ffi.Packet

func (*Diverter) SendChan

func (d *Diverter) SendChan() chan<- *ffi.Packet

func (*Diverter) SetParam

func (d *Diverter) SetParam(param ffi.Param, value uint64) (err error)

func (*Diverter) Start

func (d *Diverter) Start() (err error)

Start executes the event loop in a new goroutine and returns immediately

func (*Diverter) Stop

func (d *Diverter) Stop() (err error)

Stop gracefully stops the WinDivert session, giving the program time to drain the queue.

func (*Diverter) Terminate

func (d *Diverter) Terminate() (err error)

Terminate stops the WinDivert session abruptly, causing all packets in the queue to be discarded immediately.

Jump to

Keyboard shortcuts

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