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
114 tasty-quickcheck >= 0.8.1
118 -Wno-implicit-prelude
121 -Wno-all-missed-specialisations
135 type: exitcode-stdio-1.0
136 hs-source-dirs: src test
137 main-is: TestSuite.hs
146 tasty-quickcheck >= 0.8.1
149 -- It's not entirely clear to me why I have to reproduce all of this.
152 -Wno-implicit-prelude
155 -Wno-all-missed-specialisations
163 -- These won't work without shelltestrunner installed in your
164 -- $PATH. Maybe there is some way to tell Cabal that.
165 test-suite shelltests
166 type: exitcode-stdio-1.0
168 main-is: ShellTests.hs
178 tasty-quickcheck >= 0.8.1
180 -- It's not entirely clear to me why I have to reproduce all of this.
184 -fwarn-missing-signatures
185 -fwarn-name-shadowing
189 -fwarn-incomplete-record-updates
190 -fwarn-monomorphism-restriction
191 -fwarn-unused-do-bind
198 source-repository head
200 location: http://gitweb.michael.orlitzky.com/hath.git