4 author: Michael Orlitzky
5 maintainer: Michael Orlitzky <michael@orlitzky.com>
6 homepage: http://michael.orlitzky.com/code/hath.xhtml
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
113 tasty-quickcheck >= 0.8.1
117 -Wno-implicit-prelude
120 -Wno-all-missed-specialisations
129 type: exitcode-stdio-1.0
130 hs-source-dirs: src test
131 main-is: TestSuite.hs
139 tasty-quickcheck >= 0.8.1
142 -- It's not entirely clear to me why I have to reproduce all of this.
145 -Wno-implicit-prelude
148 -Wno-all-missed-specialisations
156 -- These won't work without shelltestrunner installed in your
157 -- $PATH. Maybe there is some way to tell Cabal that.
158 test-suite shelltests
159 type: exitcode-stdio-1.0
161 main-is: ShellTests.hs
170 tasty-quickcheck >= 0.8.1
172 -- It's not entirely clear to me why I have to reproduce all of this.
176 -fwarn-missing-signatures
177 -fwarn-name-shadowing
181 -fwarn-incomplete-record-updates
182 -fwarn-monomorphism-restriction
183 -fwarn-unused-do-bind
190 source-repository head
192 location: http://gitweb.michael.orlitzky.com/hath.git