Documentation
¶
Index ¶
- Constants
- Variables
- func ReadVersion(file *KextFile) ([]uint8, error)
- func SendCleanEndedConnectionsCommand(writer io.Writer) error
- func SendClearCacheCommand(writer io.Writer) error
- func SendGetBandwidthStatsCommand(writer io.Writer) error
- func SendGetLogsCommand(writer io.Writer) error
- func SendPrintMemoryStatsCommand(writer io.Writer) error
- func SendShutdownCommand(writer io.Writer) error
- func SendUpdateV4Command(writer io.Writer, update UpdateV4) error
- func SendUpdateV6Command(writer io.Writer, update UpdateV6) error
- func SendVerdictCommand(writer io.Writer, verdict Verdict) error
- type BandwidthStatsArray
- type BandwidthValueV4
- type BandwidthValueV6
- type ConnectionEndV4
- type ConnectionEndV6
- type ConnectionV4
- type ConnectionV6
- type Info
- type KextFile
- type KextService
- func (s *KextService) Delete() error
- func (s *KextService) GetHandle() windows.Handle
- func (s *KextService) OpenFile(readBufferSize int) (*KextFile, error)
- func (s *KextService) Start(wait bool) error
- func (s *KextService) Stop(wait bool) error
- func (s *KextService) WaitUntilDeleted(serviceManager windows.Handle) error
- type KextVerdict
- type LogLine
- type UpdateV4
- type UpdateV6
- type Verdict
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 )
View Source
const ( METHOD_BUFFERED = 0 METHOD_IN_DIRECT = 1 METHOD_OUT_DIRECT = 2 METHOD_NEITHER = 3 SIOCTL_TYPE = 40000 )
Variables ¶
View Source
var ( ErrUnknownInfoType = errors.New("unknown info type") ErrUnexpectedReadError = errors.New("unexpected read error") )
View Source
var ( IOCTL_VERSION = ctlCode(SIOCTL_TYPE, 0x800, METHOD_BUFFERED, windows.FILE_READ_DATA|windows.FILE_WRITE_DATA) IOCTL_SHUTDOWN_REQUEST = ctlCode(SIOCTL_TYPE, 0x801, METHOD_BUFFERED, windows.FILE_READ_DATA|windows.FILE_WRITE_DATA) )
View Source
var ( // 4 byte version of the Kext interface InterfaceVersion = func() (v [4]byte) { s := strings.TrimSpace(versionTxt) s = strings.TrimPrefix(s, "[") s = strings.TrimSuffix(s, "]") str_ver := strings.Split(s, ",") for i := range v { n, err := strconv.Atoi(strings.TrimSpace(str_ver[i])) if err != nil { panic(err) } v[i] = byte(n) } return }() )
Functions ¶
func ReadVersion ¶
func SendCleanEndedConnectionsCommand ¶
SendCleanEndedConnectionsCommand sends a CleanEndedConnections command to the kext.
func SendClearCacheCommand ¶
SendClearCacheCommand sends a ClearCache command to the kext.
func SendGetBandwidthStatsCommand ¶
SendGetBandwidthStatsCommand sends a GetBandwidthStats command to the kext.
func SendGetLogsCommand ¶
SendGetLogsCommand sends a GetLogs command to the kext.
func SendPrintMemoryStatsCommand ¶
SendPrintMemoryStatsCommand sends a PrintMemoryStats command to the kext.
func SendShutdownCommand ¶
SendShutdownCommand sends a Shutdown command to the kext.
func SendUpdateV4Command ¶
SendUpdateV4Command sends a UpdateV4 command to the kext.
func SendUpdateV6Command ¶
SendUpdateV6Command sends a UpdateV6 command to the kext.
Types ¶
type BandwidthStatsArray ¶
type BandwidthStatsArray struct { Protocol uint8 ValuesV4 []BandwidthValueV4 ValuesV6 []BandwidthValueV6 }
type BandwidthValueV4 ¶
type BandwidthValueV6 ¶
type ConnectionEndV4 ¶
type ConnectionEndV6 ¶
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 }
type KextService ¶
type KextService struct {
// contains filtered or unexported fields
}
func CreateKextService ¶
func CreateKextService(driverName string, driverPath string) (*KextService, error)
func (*KextService) Delete ¶
func (s *KextService) Delete() error
func (*KextService) GetHandle ¶
func (s *KextService) GetHandle() windows.Handle
func (*KextService) OpenFile ¶
func (s *KextService) OpenFile(readBufferSize int) (*KextFile, error)
func (*KextService) Start ¶
func (s *KextService) Start(wait bool) error
func (*KextService) Stop ¶
func (s *KextService) Stop(wait bool) error
func (*KextService) WaitUntilDeleted ¶
func (s *KextService) WaitUntilDeleted(serviceManager windows.Handle) 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.
Click to show internal directories.
Click to hide internal directories.