Rename everything under the Network.DNS.RBL hierarchy.
authorMichael Orlitzky <michael@orlitzky.com>
Thu, 9 Jul 2015 13:37:57 +0000 (09:37 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Thu, 9 Jul 2015 13:37:57 +0000 (09:37 -0400)
Add a dummy Network.DNS.RBL module.

harbl.cabal
src/Network/DNS/RBL.hs [new file with mode: 0644]
src/Network/DNS/RBL/DnsblSite.hs [moved from src/DnsblSite.hs with 97% similarity]
src/Network/DNS/RBL/Domain.hs [moved from src/Domain.hs with 99% similarity]
src/Network/DNS/RBL/IPv4Pattern.hs [moved from src/IPv4Pattern.hs with 99% similarity]
src/Network/DNS/RBL/Pretty.hs [moved from src/Pretty.hs with 97% similarity]
test/TestSuite.hs

index 60965dd717eb964fe363e482630652393f663f8a..b86a4bec99aeba7a1216b8eebe69937cf03bb1be 100644 (file)
@@ -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 (file)
index 0000000..5775c47
--- /dev/null
@@ -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
similarity index 97%
rename from src/DnsblSite.hs
rename to src/Network/DNS/RBL/DnsblSite.hs
index 46a872ba4e545695cca2ee7a4558ffa76a38a4ac..d23dfb1c2c73a035e61c144501f59b4b8c29bc5b 100644 (file)
@@ -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)
similarity index 99%
rename from src/Domain.hs
rename to src/Network/DNS/RBL/Domain.hs
index 87a63d9757f8bb2c6cfda6bac49651101a3153ab..a405ff1bf6f20f2eec3165bb3a82b9bd68b37b93 100644 (file)
@@ -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
 
similarity index 99%
rename from src/IPv4Pattern.hs
rename to src/Network/DNS/RBL/IPv4Pattern.hs
index 8c605ff97cbfb8881301298897da51b88bb8edae..6e407192c03417b36d7f8d044fa0f484c9418f27 100644 (file)
@@ -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
similarity index 97%
rename from src/Pretty.hs
rename to src/Network/DNS/RBL/Pretty.hs
index 14911246c8cd801a7f38b16aaef7a672e4c30bba..23a285c60a05a9a7ba371d30c8bc3e37bd8a8a85 100644 (file)
@@ -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 )
index cb79fd0fc2b7c0a06a658bdec0b07f8fc066ed05..c6298e4b55b1e35297ada143dd4f93a5222c3491 100644 (file)
@@ -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 ]