From: Michael Orlitzky Date: Thu, 9 Jul 2015 13:37:57 +0000 (-0400) Subject: Rename everything under the Network.DNS.RBL hierarchy. X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=bc28c407970d9ff1bfeacc88363fd6d23c0af440;p=dead%2Fharbl.git Rename everything under the Network.DNS.RBL hierarchy. Add a dummy Network.DNS.RBL module. --- diff --git a/harbl.cabal b/harbl.cabal index 60965dd..b86a4be 100644 --- a/harbl.cabal +++ b/harbl.cabal @@ -24,10 +24,11 @@ executable harbl Main.hs other-modules: - Domain - DnsblSite - IPv4Pattern - Pretty + Network.DNS.RBL.Domain + Network.DNS.RBL.DnsblSite + Network.DNS.RBL.IPv4Pattern + Network.DNS.RBL.Pretty + Network.DNS.RBL hs-source-dirs: src/ diff --git a/src/Network/DNS/RBL.hs b/src/Network/DNS/RBL.hs new file mode 100644 index 0000000..5775c47 --- /dev/null +++ b/src/Network/DNS/RBL.hs @@ -0,0 +1,10 @@ +module Network.DNS.RBL ( lookup_simple ) +where + +-- | Look up the given @host@ on all of the white/blacklists contained +-- in @rbls@. If the results, multiplied by their weights, add up to +-- (at least) @threshold@, then @True@ is returned; that is, the +-- @host@ is \"listed\". Otherwise, @False@ is returned. +-- +lookup_simple :: String -> Int -> String -> Bool +lookup_simple rbls threshold host = undefined diff --git a/src/DnsblSite.hs b/src/Network/DNS/RBL/DnsblSite.hs similarity index 97% rename from src/DnsblSite.hs rename to src/Network/DNS/RBL/DnsblSite.hs index 46a872b..d23dfb1 100644 --- a/src/DnsblSite.hs +++ b/src/Network/DNS/RBL/DnsblSite.hs @@ -8,7 +8,7 @@ -- return code pattern is \"127.0.0.[2;10;11]\", and the weight is -- \"2". -- -module DnsblSite ( +module Network.DNS.RBL.DnsblSite ( dnsbl_site_tests, dnsbl_sites ) where @@ -32,9 +32,9 @@ import Text.Parsec ( import Text.Parsec.String ( Parser ) import Text.Read ( readMaybe ) -import Domain ( UserDomain, user_domain ) -import IPv4Pattern ( IPv4Pattern, v4pattern ) -import Pretty ( Pretty(..) ) +import Network.DNS.RBL.Domain ( UserDomain, user_domain ) +import Network.DNS.RBL.IPv4Pattern ( IPv4Pattern, v4pattern ) +import Network.DNS.RBL.Pretty ( Pretty(..) ) newtype Weight = Weight Int deriving (Eq, Show) diff --git a/src/Domain.hs b/src/Network/DNS/RBL/Domain.hs similarity index 99% rename from src/Domain.hs rename to src/Network/DNS/RBL/Domain.hs index 87a63d9..a405ff1 100644 --- a/src/Domain.hs +++ b/src/Network/DNS/RBL/Domain.hs @@ -14,7 +14,7 @@ -- have a unicode mumbo jumbo character that takes up two bytes -- (octets). -- -module Domain ( +module Network.DNS.RBL.Domain ( UserDomain, user_domain ) where @@ -29,7 +29,7 @@ import Text.Parsec ( import qualified Text.Parsec as Parsec ( digit, letter) import Text.Parsec.String ( Parser ) -import Pretty ( Pretty(..) ) +import Network.DNS.RBL.Pretty ( Pretty(..) ) -- * Digits diff --git a/src/IPv4Pattern.hs b/src/Network/DNS/RBL/IPv4Pattern.hs similarity index 99% rename from src/IPv4Pattern.hs rename to src/Network/DNS/RBL/IPv4Pattern.hs index 8c605ff..6e40719 100644 --- a/src/IPv4Pattern.hs +++ b/src/Network/DNS/RBL/IPv4Pattern.hs @@ -21,7 +21,7 @@ -- v4sequence = v4seq_member | v4sequence ";" v4seq_member -- v4seq_member = v4octet | v4octet ".." v4octet -- -module IPv4Pattern ( +module Network.DNS.RBL.IPv4Pattern ( IPv4Pattern, addresses, ipv4pattern_tests, @@ -43,7 +43,7 @@ import Text.Parsec ( import Text.Parsec.String ( Parser ) import Text.Read ( readMaybe ) -import Pretty ( Pretty(..) ) +import Network.DNS.RBL.Pretty ( Pretty(..) ) -- * Octets diff --git a/src/Pretty.hs b/src/Network/DNS/RBL/Pretty.hs similarity index 97% rename from src/Pretty.hs rename to src/Network/DNS/RBL/Pretty.hs index 1491124..23a285c 100644 --- a/src/Pretty.hs +++ b/src/Network/DNS/RBL/Pretty.hs @@ -7,7 +7,7 @@ -- way. The 'pretty_print' function then prints the result of -- 'pretty_show' by default. -- -module Pretty ( Pretty(..) ) +module Network.DNS.RBL.Pretty ( Pretty(..) ) where import Text.Parsec ( ParseError ) diff --git a/test/TestSuite.hs b/test/TestSuite.hs index cb79fd0..c6298e4 100644 --- a/test/TestSuite.hs +++ b/test/TestSuite.hs @@ -1,6 +1,6 @@ import Test.Tasty ( TestTree, defaultMain, testGroup ) -import DnsblSite ( dnsbl_site_tests ) -import IPv4Pattern ( ipv4pattern_tests ) +import Network.DNS.RBL.DnsblSite ( dnsbl_site_tests ) +import Network.DNS.RBL.IPv4Pattern ( ipv4pattern_tests ) tests :: TestTree tests = testGroup "All Tests" [ dnsbl_site_tests, ipv4pattern_tests ]