kextinterface

package
v1.6.29 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2025 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CommandShutdown              = 0
	CommandVerdict               = 1
	CommandUpdateV4              = 2
	CommandUpdateV6              = 3
	CommandClearCache            = 4
	CommandGetLogs               = 5
	CommandBandwidthStats        = 6
	CommandPrintMemoryStats      = 7
	CommandCleanEndedConnections = 8
)

Command IDs.

View Source
const (
	InfoLogLine              = 0
	InfoConnectionIpv4       = 1
	InfoConnectionIpv6       = 2
	InfoConnectionEndEventV4 = 3
	InfoConnectionEndEventV6 = 4
	InfoBandwidthStatsV4     = 5
	InfoBandwidthStatsV6     = 6
)

Variables

View Source
var (
	ErrUnknownInfoType     = errors.New("unknown info type")
	ErrUnexpectedInfoSize  = errors.New("unexpected info size")
	ErrUnexpectedReadError = errors.New("unexpected read error")
)

Functions

func SendCleanEndedConnectionsCommand

func SendCleanEndedConnectionsCommand(writer io.Writer) error

SendCleanEndedConnectionsCommand sends a CleanEndedConnections command to the kext.

func SendClearCacheCommand

func SendClearCacheCommand(writer io.Writer) error

SendClearCacheCommand sends a ClearCache command to the kext.

func SendGetBandwidthStatsCommand

func SendGetBandwidthStatsCommand(writer io.Writer) error

SendGetBandwidthStatsCommand sends a GetBandwidthStats command to the kext.

func SendGetLogsCommand

func SendGetLogsCommand(writer io.Writer) error

SendGetLogsCommand sends a GetLogs command to the kext.

func SendPrintMemoryStatsCommand

func SendPrintMemoryStatsCommand(writer io.Writer) error

SendPrintMemoryStatsCommand sends a PrintMemoryStats command to the kext.

func SendShutdownCommand

func SendShutdownCommand(writer io.Writer) error

SendShutdownCommand sends a Shutdown command to the kext.

func SendUpdateV4Command

func SendUpdateV4Command(writer io.Writer, update UpdateV4) error

SendUpdateV4Command sends a UpdateV4 command to the kext.

func SendUpdateV6Command

func SendUpdateV6Command(writer io.Writer, update UpdateV6) error

SendUpdateV6Command sends a UpdateV6 command to the kext.

func SendVerdictCommand

func SendVerdictCommand(writer io.Writer, verdict Verdict) error

SendVerdictCommand sends a Verdict command to the kext.

Types

type BandwidthStatsArray

type BandwidthStatsArray struct {
	Protocol uint8
	ValuesV4 []BandwidthValueV4
	ValuesV6 []BandwidthValueV6
}

type BandwidthValueV4

type BandwidthValueV4 struct {
	LocalIP          [4]byte
	LocalPort        uint16
	RemoteIP         [4]byte
	RemotePort       uint16
	TransmittedBytes uint64
	ReceivedBytes    uint64
}

type BandwidthValueV6

type BandwidthValueV6 struct {
	LocalIP          [16]byte
	LocalPort        uint16
	RemoteIP         [16]byte
	RemotePort       uint16
	TransmittedBytes uint64
	ReceivedBytes    uint64
}

type ConnectionEndV4

type ConnectionEndV4 struct {
	ProcessID  uint64
	Direction  byte
	Protocol   byte
	LocalIP    [4]byte
	RemoteIP   [4]byte
	LocalPort  uint16
	RemotePort uint16
}

type ConnectionEndV6

type ConnectionEndV6 struct {
	ProcessID  uint64
	Direction  byte
	Protocol   byte
	LocalIP    [16]byte
	RemoteIP   [16]byte
	LocalPort  uint16
	RemotePort uint16
}

type ConnectionV4

type ConnectionV4 struct {
	Payload []byte
	// contains filtered or unexported fields
}

func (*ConnectionV4) Compare

func (c *ConnectionV4) Compare(other *ConnectionV4) bool

type ConnectionV6

type ConnectionV6 struct {
	Payload []byte
	// contains filtered or unexported fields
}

func (ConnectionV6) Compare

func (c ConnectionV6) Compare(other *ConnectionV6) bool

type Info

type Info struct {
	ConnectionV4    *ConnectionV4
	ConnectionV6    *ConnectionV6
	ConnectionEndV4 *ConnectionEndV4
	ConnectionEndV6 *ConnectionEndV6
	LogLine         *LogLine
	BandwidthStats  *BandwidthStatsArray
}

func RecvInfo

func RecvInfo(reader io.Reader) (*Info, error)

type KextVerdict

type KextVerdict uint8

KextVerdict is the verdict ID used to with the kext.

const (
	// VerdictUndecided is the default status of new connections.
	VerdictUndecided           KextVerdict = 0
	VerdictUndeterminable      KextVerdict = 1
	VerdictAccept              KextVerdict = 2
	VerdictPermanentAccept     KextVerdict = 3
	VerdictBlock               KextVerdict = 4
	VerdictPermanentBlock      KextVerdict = 5
	VerdictDrop                KextVerdict = 6
	VerdictPermanentDrop       KextVerdict = 7
	VerdictRerouteToNameserver KextVerdict = 8
	VerdictRerouteToTunnel     KextVerdict = 9
	VerdictFailed              KextVerdict = 10
)

Kext Verdicts. Make sure this is in sync with the Rust version.

type LogLine

type LogLine struct {
	Severity byte
	Line     string
}

type UpdateV4

type UpdateV4 struct {
	Protocol      uint8
	LocalAddress  [4]byte
	LocalPort     uint16
	RemoteAddress [4]byte
	RemotePort    uint16
	Verdict       uint8
	// contains filtered or unexported fields
}

type UpdateV6

type UpdateV6 struct {
	Protocol      uint8
	LocalAddress  [16]byte
	LocalPort     uint16
	RemoteAddress [16]byte
	RemotePort    uint16
	Verdict       uint8
	// contains filtered or unexported fields
}

type Verdict

type Verdict struct {
	ID      uint64
	Verdict uint8
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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