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
9 license: AGPL-3.0-or-later
10 license-file: doc/LICENSE
17 Hath manipulates network blocks in CIDR notation.
19 Hath is a Haskell program for working with network blocks in CIDR
20 notation. When dealing with blocks of network addresses, there are a
21 few things that one usually wants to do with them:
23 * Create a regular expression matching the CIDR block(s). This is
24 because grep will throw up if you feed it CIDR.
26 * Combine small blocks into larger ones. For example, if you have two
27 consecutive \/24s, they might combine into a larger \/23.
29 * View the result of block combination in a useful way.
33 Hath has several modes to perform these functions:
36 This computes a (Perl-compatible) regular expression matching
37 the input CIDR blocks. It's the default mode of operation.
40 This combines small blocks into larger ones where possible, and
41 eliminates redundant blocks. The output should be equivalent to
45 Shows only the blocks that would be removed by reduce; that is, it
46 shows the ones that would get combined into larger blocks or are
50 Shows what would change if you used reduce. Uses diff-like
54 List the IP addresses contained within the given CIDRs.
58 Compute a (Perl-compatible) regular expression matching
59 the input CIDR blocks. It's the default mode of operation.
62 $ echo \"10.0.0.0\/29 10.0.0.8\/29\" | hath
63 ((10)\.(0)\.(0)\.(15|14|13|12|11|10|9|8|7|6|5|4|3|2|1|0))
66 Combine two \/24s into a \/23:
69 $ echo \"10.0.0.0\/24 10.0.1.0\/24\" | hath reduced
73 List the addresses in 192.168.0.240\/29:
76 $ echo 192.168.0.240\/29 | hath listed
87 The command-line syntax and complete set of options are documented in
116 base >= 4.15 && < 5.0,
121 tasty-quickcheck >= 0.8.1
125 type: exitcode-stdio-1.0
126 hs-source-dirs: src test
127 default-language: Haskell2010
128 main-is: TestSuite.hs
139 base >= 4.15 && < 5.0,
143 tasty-quickcheck >= 0.8.1
146 -- These won't work without shelltestrunner installed in your
147 -- $PATH. Maybe there is some way to tell Cabal that.
148 test-suite shelltests
149 type: exitcode-stdio-1.0
151 default-language: Haskell2010
152 main-is: ShellTests.hs
155 base >= 4.15 && < 5.0,
159 source-repository head
161 location: https://gitweb.michael.orlitzky.com/hath.git