From 5c8702f0be60474482c587ba353e01ddf24f79cc Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Mon, 13 Jul 2015 15:42:50 -0400 Subject: [PATCH 1/1] Finish moving all of the DNS name components under Network.DNS.RBL.Domain. --- harbl.cabal | 5 +- harbl/src/Network/DNS/RBL/Domain.hs | 536 ------------------ harbl/src/Network/DNS/RBL/Domain/Domain.hs | 180 ++++++ harbl/src/Network/DNS/RBL/Domain/Label.hs | 145 +++++ .../Network/DNS/RBL/Domain/LdhStrLetDig.hs | 127 +++++ harbl/src/Network/DNS/RBL/Domain/Letter.hs | 1 - harbl/src/Network/DNS/RBL/Domain/Subdomain.hs | 230 ++++++++ harbl/src/Network/DNS/RBL/Host.hs | 2 +- 8 files changed, 687 insertions(+), 539 deletions(-) delete mode 100644 harbl/src/Network/DNS/RBL/Domain.hs create mode 100644 harbl/src/Network/DNS/RBL/Domain/Domain.hs create mode 100644 harbl/src/Network/DNS/RBL/Domain/Label.hs create mode 100644 harbl/src/Network/DNS/RBL/Domain/LdhStrLetDig.hs create mode 100644 harbl/src/Network/DNS/RBL/Domain/Subdomain.hs diff --git a/harbl.cabal b/harbl.cabal index 1753ed3..91ae360 100644 --- a/harbl.cabal +++ b/harbl.cabal @@ -28,13 +28,16 @@ library Network.DNS.RBL.Tests other-modules: - Network.DNS.RBL.Domain Network.DNS.RBL.Domain.Digit + Network.DNS.RBL.Domain.Domain Network.DNS.RBL.Domain.Hyphen + Network.DNS.RBL.Domain.Label Network.DNS.RBL.Domain.LdhStr + Network.DNS.RBL.Domain.LdhStrLetDig Network.DNS.RBL.Domain.LetDig Network.DNS.RBL.Domain.LetDigHyp Network.DNS.RBL.Domain.Letter + Network.DNS.RBL.Domain.Subdomain Network.DNS.RBL.Host Network.DNS.RBL.IPv4Pattern Network.DNS.RBL.Pretty diff --git a/harbl/src/Network/DNS/RBL/Domain.hs b/harbl/src/Network/DNS/RBL/Domain.hs deleted file mode 100644 index 7adc1a9..0000000 --- a/harbl/src/Network/DNS/RBL/Domain.hs +++ /dev/null @@ -1,536 +0,0 @@ -{-# LANGUAGE DoAndIfThenElse #-} - --- | The 'Domain' data type and its parser. A 'Domain' represents a --- name in the domain name system (DNS) as described by --- RFC1035. In particular, we enforce the restrictions from Section --- 2.3.1 \"Preferred name syntax\". See for example, --- --- --- --- We basically work with strings and characters everywhere, even --- though this isn't really correct. The length specifications in --- the RFCs are all in terms of octets, so really a ByteString.Char8 --- would be more appropriate. With strings, for example, we could --- have a unicode mumbo jumbo character that takes up two bytes --- (octets). --- -module Network.DNS.RBL.Domain ( - Domain(..), - domain ) -where - -import Text.Parsec ( - (<|>), - char, - optionMaybe, - string, - try ) -import Text.Parsec.String ( Parser ) - -import Network.DNS.RBL.Domain.LdhStr ( - LdhStr(..), - ldh_str, - ldh_str_length ) -import Network.DNS.RBL.Domain.LetDig ( LetDig, let_dig ) -import Network.DNS.RBL.Domain.LetDigHyp ( LetDigHyp(..) ) -import Network.DNS.RBL.Pretty ( Pretty(..) ) -import Network.DNS.RBL.Reversible ( Reversible(..) ) - - --- * Letter/Digit/Hyphen string followed by a trailing Letter/Digit - --- | This type isn't explicitly part of the grammar, but it's what --- shows up in the square brackets of, --- ---