Version and update verdict kernel functions

This commit is contained in:
Vladimir
2022-11-04 11:21:53 +01:00
parent 9bc2da90a8
commit ad8bb2059d
5 changed files with 115 additions and 3 deletions

View File

@@ -6,6 +6,7 @@ package windowskext
import (
"encoding/binary"
"errors"
"fmt"
"net"
"github.com/tevino/abool"
@@ -50,6 +51,23 @@ type VerdictInfo struct {
verdict network.Verdict // verdict for the connection
}
type VerdictUpdateInfo struct {
ipV6 uint8 //True: IPv6, False: IPv4
protocol uint8 //Protocol (UDP, TCP, ...)
localIP [4]uint32 //Source Address, only srcIP[0] if IPv4
remoteIP [4]uint32 //Destination Address
localPort uint16 //Source Port
remotePort uint16 //Destination port
verdict uint8 //New verdict
}
type VersionInfo struct {
major uint8
minor uint8
revision uint8
build uint8
}
// Handler transforms received packets to the Packet interface.
func Handler(packets chan packet.Packet) {
if !ready.IsSet() {
@@ -152,3 +170,7 @@ func convertIPv6(input [4]uint32) net.IP {
}
return net.IP(addressBuf)
}
func (v *VersionInfo) String() string {
return fmt.Sprintf("%d.%d.%d.%d", v.major, v.minor, v.revision, v.build)
}