From 4b632fb6f27d8748c42f137f87026e49c28d7900 Mon Sep 17 00:00:00 2001 From: xSmurf Date: Fri, 25 Nov 2016 16:31:17 +0000 Subject: [PATCH] Moved fw-daemon to command/lib --- cmd/fw-daemon/main.go | 9 +++++++++ sgfw/config.go | 2 +- sgfw/dbus.go | 2 +- sgfw/dns.go | 2 +- sgfw/dnsmsg.go | 2 +- sgfw/icons.go | 2 +- sgfw/iptables.go | 2 +- sgfw/policy.go | 2 +- sgfw/prompt.go | 2 +- sgfw/rules.go | 2 +- sgfw/sgfw.go | 4 ++-- 11 files changed, 20 insertions(+), 11 deletions(-) create mode 100644 cmd/fw-daemon/main.go diff --git a/cmd/fw-daemon/main.go b/cmd/fw-daemon/main.go new file mode 100644 index 0000000..eb37320 --- /dev/null +++ b/cmd/fw-daemon/main.go @@ -0,0 +1,9 @@ +package main + +import ( + "github.com/subgraph/fw-daemon/sgfw" +) + +func main() { + sgfw.Main() +} diff --git a/sgfw/config.go b/sgfw/config.go index 57eef5f..1ac9a0d 100644 --- a/sgfw/config.go +++ b/sgfw/config.go @@ -1,4 +1,4 @@ -package main +package sgfw import ( "bufio" diff --git a/sgfw/dbus.go b/sgfw/dbus.go index 5af7b6c..33f5002 100644 --- a/sgfw/dbus.go +++ b/sgfw/dbus.go @@ -1,4 +1,4 @@ -package main +package sgfw import ( "errors" diff --git a/sgfw/dns.go b/sgfw/dns.go index 7c16efb..b963ab4 100644 --- a/sgfw/dns.go +++ b/sgfw/dns.go @@ -1,4 +1,4 @@ -package main +package sgfw import ( "net" diff --git a/sgfw/dnsmsg.go b/sgfw/dnsmsg.go index d0e5e97..c09ea46 100644 --- a/sgfw/dnsmsg.go +++ b/sgfw/dnsmsg.go @@ -20,7 +20,7 @@ // TODO(rsc): There are enough names defined in this file that they're all // prefixed with dns. Perhaps put this in its own package later. -package main +package sgfw import "net" diff --git a/sgfw/icons.go b/sgfw/icons.go index 55a0fdc..0366e7a 100644 --- a/sgfw/icons.go +++ b/sgfw/icons.go @@ -1,4 +1,4 @@ -package main +package sgfw import ( "fmt" diff --git a/sgfw/iptables.go b/sgfw/iptables.go index 3f8f559..f61542d 100644 --- a/sgfw/iptables.go +++ b/sgfw/iptables.go @@ -1,4 +1,4 @@ -package main +package sgfw import ( "fmt" diff --git a/sgfw/policy.go b/sgfw/policy.go index 5e4c8f9..7ce9e99 100644 --- a/sgfw/policy.go +++ b/sgfw/policy.go @@ -1,4 +1,4 @@ -package main +package sgfw import ( "fmt" diff --git a/sgfw/prompt.go b/sgfw/prompt.go index c2f2c54..2891b6a 100644 --- a/sgfw/prompt.go +++ b/sgfw/prompt.go @@ -1,4 +1,4 @@ -package main +package sgfw import ( "fmt" diff --git a/sgfw/rules.go b/sgfw/rules.go index 498020c..162bde5 100644 --- a/sgfw/rules.go +++ b/sgfw/rules.go @@ -1,4 +1,4 @@ -package main +package sgfw import ( "encoding/binary" diff --git a/sgfw/sgfw.go b/sgfw/sgfw.go index d1ac126..e204268 100644 --- a/sgfw/sgfw.go +++ b/sgfw/sgfw.go @@ -1,4 +1,4 @@ -package main +package sgfw import ( "os" @@ -139,7 +139,7 @@ func (fw *Firewall) runFilter() { var commentRegexp = regexp.MustCompile("^[ \t]*#") -func main() { +func Main() { readConfig() logBackend := setupLoggerBackend(FirewallConfig.LoggingLevel) log.SetBackend(logBackend)