iproute 1.7.9 → 1.7.10
raw patch · 2 files changed
+24/−41 lines, 2 filesdep ~basedep ~bytestring
Dependency ranges changed: base, bytestring
Files
- Data/IP/Builder.hs +23/−40
- iproute.cabal +1/−1
Data/IP/Builder.hs view
@@ -1,6 +1,8 @@ {-# LANGUAGE BangPatterns #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE MagicHash #-}+{-# LANGUAGE StrictData #-}+{-# LANGUAGE NoStrict #-} {-# LANGUAGE TupleSections #-} module Data.IP.Builder@@ -43,7 +45,6 @@ toB = P.liftFixedToBounded {-# INLINE toB #-} -{-# INLINE ipv4Bounded #-} ipv4Bounded :: P.BoundedPrim Word32 ipv4Bounded = quads >$< ((P.word8Dec >*< dotsep) >*< (P.word8Dec >*< dotsep))@@ -57,24 +58,23 @@ {-# INLINE qfin #-} dotsep = const 0x2e >$< toB P.word8 --- | For each of the 32-bit chunks of an IPv6 address, encode how it should be--- displayed in the presentation form of the address, based its location--- relative to the "best gap", i.e. the left-most longest run of zeros. The--- "hi" and, or "lo" parts are accompanied by occasional units mapped to colons.+-- | For each 32-bit chunk of an IPv6 address, encode its display format in the+-- presentation form of the address, based on its location relative to the+-- "best gap", i.e. the left-most longest run of zeros. The "hi" (H) and/or+-- "lo" (L) 16 bits may be accompanied by colons (C) on the left and/or right. ---data FF = CHL {-# UNPACK #-} ! Word32 -- ^ :<h>:<l>- | HL {-# UNPACK #-} ! Word32 -- ^ <h>:<l>- | NOP -- ^ nop- | COL -- ^ :- | CLO {-# UNPACK #-} ! Word32 -- ^ :<l>- | CC -- ^ : :- | CHC {-# UNPACK #-} ! Word32 -- ^ :<h>:- | HC {-# UNPACK #-} ! Word32 -- ^ <h>:+data FF = CHL Word32 -- ^ :<h>:<l>+ | HL Word32 -- ^ <h>:<l>+ | NOP -- ^ nop+ | COL -- ^ :+ | CC -- ^ : :+ | CLO Word32 -- ^ :<l>+ | CHC Word32 -- ^ :<h>:+ | HC Word32 -- ^ <h>: -- Build an IPv6 address in conformance with -- [RFC5952](http://tools.ietf.org/html/rfc5952 RFC 5952). ---{-# INLINE ipv6Bounded #-} ipv6Bounded :: P.BoundedPrim (Word32, Word32, Word32, Word32) ipv6Bounded = P.condB generalCase@@ -113,33 +113,16 @@ -- output32 :: P.BoundedPrim FF output32 =- P.condB ffCond03- ( P.condB ffCond01- ( P.condB ffCond0- build_CHL -- :<h>:<l>- build_HL ) -- <h>:<l>- ( P.condB ffCond2- build_NOP -- nop- build_COL ) ) -- :- ( P.condB ffCond45- ( P.condB ffCond4- build_CLO -- :<l>- build_CC ) -- : :- ( P.condB ffCond6- build_CHC -- :<h>:- build_HC ) ) -- <h>:-- -- Branch selection predicates- ffCond03 = \case { CHL _ -> True; HL _ -> True;- NOP -> True; COL -> True; _ -> False }- ffCond01 = \case { CHL _ -> True; HL _ -> True; _ -> False }- ffCond45 = \case { CC -> True; CLO _ -> True; _ -> False }- ffCond0 = \case { CHL _ -> True; _ -> False }- ffCond2 = \case { NOP -> True; _ -> False }- ffCond4 = \case { CLO _ -> True; _ -> False }- ffCond6 = \case { CHC _ -> True; _ -> False }+ P.condB (\case { CHL _ -> True; _ -> False }) build_CHL $ -- :hi:lo+ P.condB (\case { HL _ -> True; _ -> False }) build_HL $ -- hi:lo+ P.condB (\case { NOP -> True; _ -> False }) build_NOP $ --+ P.condB (\case { COL -> True; _ -> False }) build_COL $ -- :+ P.condB (\case { CC -> True; _ -> False }) build_CC $ -- : :+ P.condB (\case { CLO _ -> True; _ -> False }) build_CLO $ -- :lo+ P.condB (\case { CHC _ -> True; _ -> False }) build_CHC $ -- :hi:+ build_HC -- hi: - -- encoders for the seven field format (FF) cases.+ -- encoders for the eight field format (FF) cases. -- build_CHL = (\ (CHL w) -> ( fstUnit (hi16 w), fstUnit (lo16 w) ) ) >$< (colsep >*< P.word16Hex)
iproute.cabal view
@@ -1,5 +1,5 @@ Name: iproute-Version: 1.7.9+Version: 1.7.10 Author: Kazu Yamamoto <kazu@iij.ad.jp> Maintainer: Kazu Yamamoto <kazu@iij.ad.jp> License: BSD3