diff -Nru haskell-iproute-1.7.5/Data/IP/Addr.hs haskell-iproute-1.7.7/Data/IP/Addr.hs --- haskell-iproute-1.7.5/Data/IP/Addr.hs 2018-05-15 00:38:07.000000000 +0000 +++ haskell-iproute-1.7.7/Data/IP/Addr.hs 2018-12-11 05:31:01.000000000 +0000 @@ -405,7 +405,7 @@ where test errmsg adr = when (adr < 0 || 255 < adr) (fail errmsg) check as = do - let errmsg = "IPv4 adddress" + let errmsg = "IPv4 address" when (length as /= 4) (fail errmsg) mapM_ (test errmsg) as diff -Nru haskell-iproute-1.7.5/Data/IP/Internal.hs haskell-iproute-1.7.7/Data/IP/Internal.hs --- haskell-iproute-1.7.5/Data/IP/Internal.hs 2018-05-15 00:38:07.000000000 +0000 +++ haskell-iproute-1.7.7/Data/IP/Internal.hs 2018-12-11 05:31:01.000000000 +0000 @@ -1,6 +1,8 @@ module Data.IP.Internal ( IPv4(..) , IPv6(..) , AddrRange(..) + , IPv4Addr + , IPv6Addr ) where import Data.IP.Addr diff -Nru haskell-iproute-1.7.5/Data/IP/RouteTable/Internal.hs haskell-iproute-1.7.7/Data/IP/RouteTable/Internal.hs --- haskell-iproute-1.7.5/Data/IP/RouteTable/Internal.hs 2018-05-15 00:38:07.000000000 +0000 +++ haskell-iproute-1.7.7/Data/IP/RouteTable/Internal.hs 2018-12-11 05:31:01.000000000 +0000 @@ -266,6 +266,34 @@ search k1 r $ Just (k2, vl) | otherwise = res +{-| + 'lookupAll' is a version of 'lookup' that returns all entries matching the + given key, not just the longest match. + +>>> :set -XOverloadedStrings +>>> let rt = fromList ([("192.168.0.0/24", 1), ("10.10.0.0/16", 2), ("10.0.0.0/8", 3)] :: [(AddrRange IPv4, Int)]) +>>> lookupAll "127.0.0.1" rt +[] +>>> lookupAll "192.168.0.1" rt +[(192.168.0.0/24,1)] +>>> lookupAll "10.10.0.1" rt +[(10.10.0.0/16,2),(10.0.0.0/8,3)] +-} + +lookupAll :: Routable k => AddrRange k -> IPRTable k a -> [(AddrRange k, a)] +lookupAll range = go [] + where + go acc Nil = acc + go acc (Node k tb Nothing l r) + | k == range = acc + | k >:> range = go acc $ if isLeft range tb then l else r + | otherwise = acc + go acc (Node k tb (Just v) l r) + | k == range = (k,v):acc + | k >:> range = go ((k,v):acc) $ if isLeft range tb then l else r + | otherwise = acc + + ---------------------------------------------------------------- {-| diff -Nru haskell-iproute-1.7.5/Data/IP/RouteTable.hs haskell-iproute-1.7.7/Data/IP/RouteTable.hs --- haskell-iproute-1.7.5/Data/IP/RouteTable.hs 2018-05-15 00:38:07.000000000 +0000 +++ haskell-iproute-1.7.7/Data/IP/RouteTable.hs 2018-12-11 05:31:01.000000000 +0000 @@ -18,6 +18,7 @@ , empty, insert, delete , I.lookup , I.lookupKeyValue + , I.lookupAll , findMatch , fromList, toList , foldlWithKey diff -Nru haskell-iproute-1.7.5/debian/changelog haskell-iproute-1.7.7/debian/changelog --- haskell-iproute-1.7.5/debian/changelog 2018-09-30 18:12:58.000000000 +0000 +++ haskell-iproute-1.7.7/debian/changelog 2019-08-03 12:48:46.000000000 +0000 @@ -1,3 +1,15 @@ +haskell-iproute (1.7.7-1build1) eoan; urgency=medium + + * Rebuild against new GHC abi. + + -- Gianfranco Costamagna Sat, 03 Aug 2019 14:48:46 +0200 + +haskell-iproute (1.7.7-1) unstable; urgency=medium + + * New upstream release + + -- Clint Adams Mon, 29 Jul 2019 16:34:00 -0400 + haskell-iproute (1.7.5-2) unstable; urgency=medium * Bump debhelper compat level to 10 diff -Nru haskell-iproute-1.7.5/iproute.cabal haskell-iproute-1.7.7/iproute.cabal --- haskell-iproute-1.7.5/iproute.cabal 2018-05-15 00:38:07.000000000 +0000 +++ haskell-iproute-1.7.7/iproute.cabal 2018-12-11 05:31:01.000000000 +0000 @@ -1,5 +1,5 @@ Name: iproute -Version: 1.7.5 +Version: 1.7.7 Author: Kazu Yamamoto Maintainer: Kazu Yamamoto License: BSD3 @@ -21,11 +21,11 @@ Exposed-Modules: Data.IP Data.IP.Internal Data.IP.RouteTable + Data.IP.RouteTable.Internal Other-Modules: Data.IP.Addr Data.IP.Mask Data.IP.Op Data.IP.Range - Data.IP.RouteTable.Internal Build-Depends: base >= 4.6 && < 5 , appar , byteorder @@ -46,7 +46,7 @@ Test-Suite spec Type: exitcode-stdio-1.0 Default-Language: Haskell2010 - Hs-Source-Dirs: ., test + Hs-Source-Dirs: test Ghc-Options: -Wall Main-Is: Spec.hs Other-Modules: RouteTableSpec @@ -59,6 +59,7 @@ , containers , network , safe + , iproute if impl(ghc < 8.0) Build-Depends: semigroups >= 0.17