4 author: Michael Orlitzky
5 maintainer: Michael Orlitzky <michael@orlitzky.com>
6 homepage: https://michael.orlitzky.com/code/hath.xhtml
7 bug-reports: mailto:michael@orlitzky.com
10 license-file: doc/LICENSE
16 Hath manipulates network blocks in CIDR notation.
18 Hath is a Haskell program for working with network blocks in CIDR
19 notation. When dealing with blocks of network addresses, there are a
20 few things that one usually wants to do with them:
22 * Create a regular expression matching the CIDR block(s). This is
23 because grep will throw up if you feed it CIDR.
25 * Combine small blocks into larger ones. For example, if you have two
26 consecutive \/24s, they might combine into a larger \/23.
28 * View the result of block combination in a useful way.
32 Hath has several modes to perform these functions:
35 This computes a (Perl-compatible) regular expression matching
36 the input CIDR blocks. It's the default mode of operation.
39 This combines small blocks into larger ones where possible, and
40 eliminates redundant blocks. The output should be equivalent to
44 Shows only the blocks that would be removed by reduce; that is, it
45 shows the ones that would get combined into larger blocks or are
49 Shows what would change if you used reduce. Uses diff-like
53 List the IP addresses contained within the given CIDRs.
57 Compute a (Perl-compatible) regular expression matching
58 the input CIDR blocks. It's the default mode of operation.
61 $ echo \"10.0.0.0\/29 10.0.0.8\/29\" | hath
62 ((10)\.(0)\.(0)\.(15|14|13|12|11|10|9|8|7|6|5|4|3|2|1|0))
65 Combine two \/24s into a \/23:
68 $ echo \"10.0.0.0\/24 10.0.1.0\/24\" | hath reduced
72 List the addresses in 192.168.0.240\/29:
75 $ echo 192.168.0.240\/29 | hath listed
86 The command-line syntax and complete set of options are documented in
115 base >= 4.15 && < 5.0,
120 tasty-quickcheck >= 0.8.1
124 type: exitcode-stdio-1.0
125 hs-source-dirs: src test
126 default-language: Haskell2010
127 main-is: TestSuite.hs
138 base >= 4.15 && < 5.0,
142 tasty-quickcheck >= 0.8.1
145 -- These won't work without shelltestrunner installed in your
146 -- $PATH. Maybe there is some way to tell Cabal that.
147 test-suite shelltests
148 type: exitcode-stdio-1.0
150 default-language: Haskell2010
151 main-is: ShellTests.hs
154 base >= 4.15 && < 5.0,
158 source-repository head
160 location: https://gitweb.michael.orlitzky.com/hath.git