diff --git a/firewall/interception/interception_windows.go b/firewall/interception/interception_windows.go index 921f333e..6a1c28b3 100644 --- a/firewall/interception/interception_windows.go +++ b/firewall/interception/interception_windows.go @@ -38,7 +38,7 @@ func startInterception(packets chan packet.Packet) error { } log.Debugf("Kext version: %s", version.String()) - if version.Minor < 2 { + if version.Major < 2 { useOldKext = true // Transfer ownership. @@ -104,6 +104,27 @@ func startInterception(packets chan packet.Packet) error { } }) + + // Start kext logging. The worker will periodically send request to the kext to print memory stats. + // module.StartServiceWorker("kext memory stats request worker", 0, func(ctx context.Context) error { + // timer := time.NewTicker(20 * time.Second) + // for { + // select { + // case <-timer.C: + // { + // err := kext2.SendPrintMemoryStatsCommand() + // if err != nil { + // return err + // } + // } + // case <-ctx.Done(): + // { + // return nil + // } + // } + + // } + // }) } return nil diff --git a/firewall/interception/windowskext2/kext.go b/firewall/interception/windowskext2/kext.go index 461a6fe7..467ea26e 100644 --- a/firewall/interception/windowskext2/kext.go +++ b/firewall/interception/windowskext2/kext.go @@ -98,6 +98,10 @@ func SendBandwidthStatsRequest() error { return kext_interface.SendGetBandwidthStatsCommand(kextFile) } +func SendPrintMemoryStatsCommand() error { + return kext_interface.SendPrintMemoryStatsCommand(kextFile) +} + // RecvVerdictRequest waits for the next verdict request from the kext. If a timeout is reached, both *VerdictRequest and error will be nil. func RecvVerdictRequest() (*kext_interface.Info, error) { return kext_interface.RecvInfo(kextFile)