1-- -----------------------------------------------------------------------------
2
3-- |
4-- Module      :  Text.IPv6Addr
5-- Copyright   :  Copyright © Michel Boucey 2011-2015
6-- License     :  BSD-Style
7-- Maintainer  :  michel.boucey@gmail.com
8--
9-- Dealing with IPv6 address text representations, canonization and manipulations.
10--
11
12-- -----------------------------------------------------------------------------
13
14module QC.IPv6.Types where
15
16import qualified Data.Text as T
17
18data IPv6Addr = IPv6Addr T.Text
19
20instance Show IPv6Addr where
21    show (IPv6Addr addr) = T.unpack addr
22
23data IPv6AddrToken
24    = SixteenBit T.Text  -- ^ A four hexadecimal digits group representing a 16-Bit chunk
25    | AllZeros           -- ^ An all zeros 16-Bit chunk
26    | Colon              -- ^ A separator between 16-Bit chunks
27    | DoubleColon        -- ^ A double-colon stands for a unique compression of many consecutive 16-Bit chunks
28    | IPv4Addr T.Text    -- ^ An embedded IPv4 address as representation of the last 32-Bit
29    deriving (Eq,Show)
30