4 author: Michael Orlitzky
5 maintainer: Michael Orlitzky <michael@orlitzky.com>
6 homepage: http://michael.orlitzky.com/code/hath.php
9 license-file: doc/LICENSE
15 Hath manipulates network blocks in CIDR notation.
17 Hath is a Haskell program for working with network blocks in CIDR
18 notation. When dealing with blocks of network addresses, there are a
19 few things that one usually wants to do with them:
21 * Create a regular expression matching the CIDR block(s). This is
22 because grep will throw up if you feed it CIDR.
24 * Combine small blocks into larger ones. For example, if you have two
25 consecutive \/24s, they might combine into a larger \/23.
27 * View the result of block combination in a useful way.
31 Hath has several modes to perform these functions:
34 This computes a (Perl-compatible) regular expression matching
35 the input CIDR blocks. It's the default mode of operation.
38 This combines small blocks into larger ones where possible, and
39 eliminates redundant blocks. The output should be equivalent to
43 Shows only the blocks that would be removed by reduce; that is, it
44 shows the ones that would get combined into larger blocks or are
48 Shows what would change if you used reduce. Uses diff-like
52 List the IP addresses contained within the given CIDRs.
56 Compute a (Perl-compatible) regular expression matching
57 the input CIDR blocks. It's the default mode of operation.
60 $ echo \"10.0.0.0\/29 10.0.0.8\/29\" | hath
61 ((10)\.(0)\.(0)\.(15|14|13|12|11|10|9|8|7|6|5|4|3|2|1|0))
64 Combine two \/24s into a \/23:
67 $ echo \"10.0.0.0\/24 10.0.1.0\/24\" | hath reduced
71 List the addresses in 192.168.0.240\/29:
74 $ echo 192.168.0.240\/29 | hath listed
85 The command-line syntax and complete set of options are documented in
114 tasty-quickcheck >= 0.8.1
119 -fwarn-missing-signatures
120 -fwarn-name-shadowing
124 -fwarn-incomplete-record-updates
125 -fwarn-monomorphism-restriction
126 -fwarn-unused-do-bind
140 type: exitcode-stdio-1.0
141 hs-source-dirs: src test
142 main-is: TestSuite.hs
151 tasty-quickcheck >= 0.8.1
154 -- It's not entirely clear to me why I have to reproduce all of this.
158 -fwarn-missing-signatures
159 -fwarn-name-shadowing
163 -fwarn-incomplete-record-updates
164 -fwarn-monomorphism-restriction
165 -fwarn-unused-do-bind
173 -- These won't work without shelltestrunner installed in your
174 -- $PATH. Maybe there is some way to tell Cabal that.
175 test-suite shelltests
176 type: exitcode-stdio-1.0
178 main-is: ShellTests.hs
188 tasty-quickcheck >= 0.8.1
190 -- It's not entirely clear to me why I have to reproduce all of this.
194 -fwarn-missing-signatures
195 -fwarn-name-shadowing
199 -fwarn-incomplete-record-updates
200 -fwarn-monomorphism-restriction
201 -fwarn-unused-do-bind
208 source-repository head
210 location: http://michael.orlitzky.com/git/hath.git