portmaster: github.com/safing/portmaster/firewall/interception/windowskext Index | Files | Directories

package windowskext

import "github.com/safing/portmaster/firewall/interception/windowskext"

Index

Package Files

handler.go kext.go packet.go

Variables

var (
    ErrKextNotReady = errors.New("the windows kernel extension (driver) is not ready to accept commands")
)

Package errors

func GetPayload Uses

func GetPayload(packetID uint32, packetSize uint32) ([]byte, error)

GetPayload returns the payload of a packet.

func Handler Uses

func Handler(packets chan packet.Packet)

Handler transforms received packets to the Packet interface.

func Init Uses

func Init(dllPath, driverPath string) error

Init initializes the DLL and the Kext (Kernel Driver).

func SetVerdict Uses

func SetVerdict(packetID uint32, verdict network.Verdict) error

SetVerdict sets the verdict for a packet and/or connection.

func Start Uses

func Start() error

Start intercepting.

func Stop Uses

func Stop() error

Stop intercepting.

type Packet Uses

type Packet struct {
    packet.Base
    // contains filtered or unexported fields
}

Packet represents an IP packet.

func (*Packet) Accept Uses

func (pkt *Packet) Accept() error

Accept accepts the packet.

func (*Packet) Block Uses

func (pkt *Packet) Block() error

Block blocks the packet.

func (*Packet) Drop Uses

func (pkt *Packet) Drop() error

Drop drops the packet.

func (*Packet) GetPayload Uses

func (pkt *Packet) GetPayload() ([]byte, error)

GetPayload returns the full raw packet.

func (*Packet) PermanentAccept Uses

func (pkt *Packet) PermanentAccept() error

PermanentAccept permanently accepts connection (and the current packet).

func (*Packet) PermanentBlock Uses

func (pkt *Packet) PermanentBlock() error

PermanentBlock permanently blocks connection (and the current packet).

func (*Packet) PermanentDrop Uses

func (pkt *Packet) PermanentDrop() error

PermanentDrop permanently drops connection (and the current packet).

func (*Packet) RerouteToNameserver Uses

func (pkt *Packet) RerouteToNameserver() error

RerouteToNameserver permanently reroutes the connection to the local nameserver (and the current packet).

func (*Packet) RerouteToTunnel Uses

func (pkt *Packet) RerouteToTunnel() error

RerouteToTunnel permanently reroutes the connection to the local tunnel entrypoint (and the current packet).

type VerdictRequest Uses

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

VerdictRequest is the request structure from the Kext.

func RecvVerdictRequest Uses

func RecvVerdictRequest() (*VerdictRequest, error)

RecvVerdictRequest waits for the next verdict request from the kext. If a timeout is reached, both *VerdictRequest and error will be nil.

type WinKext Uses

type WinKext struct {
    sync.RWMutex
    // contains filtered or unexported fields
}

WinKext holds the DLL handle.

Directories

PathSynopsis
test
test/endian

Package windowskext imports 14 packages (graph) and is imported by 1 packages. Updated 2019-10-10. Refresh now. Tools for package owners.