pull/41/head
xSmurf 8 years ago
parent f750840b23
commit 2e6f98e410

@ -28,7 +28,7 @@ func (ob *dbusObject) isEnabled() (bool, error) {
func (ob *dbusObject) listRules() ([]sgfw.DbusRule, error) { func (ob *dbusObject) listRules() ([]sgfw.DbusRule, error) {
rules := []sgfw.DbusRule{} rules := []sgfw.DbusRule{}
err := ob.Call("com.subgraph.Firewall.ListRules", 0).Store(&rules); err := ob.Call("com.subgraph.Firewall.ListRules", 0).Store(&rules)
if err != nil { if err != nil {
return nil, err return nil, err
} }

@ -46,8 +46,8 @@ var RuleModeValue = map[string]RuleMode {
"SYSTEM": RULE_MODE_SYSTEM, "SYSTEM": RULE_MODE_SYSTEM,
} }
type FilterScope uint16 type FilterScope uint16
const ( const (
APPLY_ONCE FilterScope = iota APPLY_ONCE FilterScope = iota
APPLY_SESSION APPLY_SESSION
@ -66,7 +66,6 @@ var FilterScopeValue = map[string]FilterScope {
"FOREVER": APPLY_FOREVER, "FOREVER": APPLY_FOREVER,
} }
func GetFilterScopeString(scope FilterScope) string { func GetFilterScopeString(scope FilterScope) string {
if val, ok := FilterScopeString[scope]; ok { if val, ok := FilterScopeString[scope]; ok {
return val return val

@ -247,7 +247,7 @@ func printPacket(pkt *nfqueue.Packet, hostname string, pinfo *procsnitch.Info) s
if name == "" { if name == "" {
name = pkt.Dst.String() name = pkt.Dst.String()
} }
if (pinfo == nil) { if pinfo == nil {
return fmt.Sprintf("(%s %s:%d -> %s:%d)", proto, pkt.Src, pkt.SrcPort, name, pkt.DstPort) return fmt.Sprintf("(%s %s:%d -> %s:%d)", proto, pkt.Src, pkt.SrcPort, name, pkt.DstPort)
} else { } else {
return fmt.Sprintf("%s %s %s:%d -> %s:%d", pinfo.ExePath, proto, pkt.Src, pkt.SrcPort, name, pkt.DstPort) return fmt.Sprintf("%s %s %s:%d -> %s:%d", pinfo.ExePath, proto, pkt.Src, pkt.SrcPort, name, pkt.DstPort)

Loading…
Cancel
Save