Improve status module
This commit is contained in:
@@ -5,32 +5,29 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
currentSecurityLevel *uint32
|
||||
activeSecurityLevel *uint32
|
||||
selectedSecurityLevel *uint32
|
||||
threatLevel *uint32
|
||||
portmasterStatus *uint32
|
||||
gate17Status *uint32
|
||||
)
|
||||
|
||||
func init() {
|
||||
var (
|
||||
currentSecurityLevelValue uint32
|
||||
activeSecurityLevelValue uint32
|
||||
selectedSecurityLevelValue uint32
|
||||
threatLevelValue uint32
|
||||
portmasterStatusValue uint32
|
||||
gate17StatusValue uint32
|
||||
)
|
||||
|
||||
currentSecurityLevel = ¤tSecurityLevelValue
|
||||
activeSecurityLevel = &activeSecurityLevelValue
|
||||
selectedSecurityLevel = &selectedSecurityLevelValue
|
||||
threatLevel = &threatLevelValue
|
||||
portmasterStatus = &portmasterStatusValue
|
||||
gate17Status = &gate17StatusValue
|
||||
}
|
||||
|
||||
// CurrentSecurityLevel returns the current security level.
|
||||
func CurrentSecurityLevel() uint8 {
|
||||
return uint8(atomic.LoadUint32(currentSecurityLevel))
|
||||
// ActiveSecurityLevel returns the current security level.
|
||||
func ActiveSecurityLevel() uint8 {
|
||||
return uint8(atomic.LoadUint32(activeSecurityLevel))
|
||||
}
|
||||
|
||||
// SelectedSecurityLevel returns the selected security level.
|
||||
@@ -38,11 +35,6 @@ func SelectedSecurityLevel() uint8 {
|
||||
return uint8(atomic.LoadUint32(selectedSecurityLevel))
|
||||
}
|
||||
|
||||
// ThreatLevel returns the current threat level.
|
||||
func ThreatLevel() uint8 {
|
||||
return uint8(atomic.LoadUint32(threatLevel))
|
||||
}
|
||||
|
||||
// PortmasterStatus returns the current Portmaster status.
|
||||
func PortmasterStatus() uint8 {
|
||||
return uint8(atomic.LoadUint32(portmasterStatus))
|
||||
|
||||
Reference in New Issue
Block a user