4 author: Michael Orlitzky
5 maintainer: Michael Orlitzky <michael@orlitzky.com>
8 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 * Find their associated PTR records.
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.
57 Perform reverse DNS (PTR) lookups on the IP addresses contained
58 within the given CIDRs.
62 Compute a (Perl-compatible) regular expression matching
63 the input CIDR blocks. It's the default mode of operation.
66 $ hath <<< \"10.0.0.0\/29 10.0.0.8\/29\"
67 ((10)\.(0)\.(0)\.(0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15))
70 Combine two \/24s into a \/23:
73 $ hath reduced <<< \"10.0.0.0\/24 10.0.1.0\/24\"
77 List the addresses in 192.168.0.240\/29:
80 $ hath listed <<< \"192.168.0.240\/29\"
91 Perform PTR lookups on all of 198.41.0.4\/30:
94 $ hath reversed <<< \"198.41.0.4\/30\"
95 198.41.0.4: a.root-servers.net.
97 198.41.0.6: rs.internic.net.
101 The DNS lookups are usually the bottleneck for this mode, but we can
102 perform them in parallel. Simply pass the number of threads to the
103 GHC runtime on the command line; for example, the following will
104 perform 25 lookups in parallel:
107 $ hath reversed +RTS -N25 <<< \"198.41.0.4\/24\"
108 198.41.0.4: a.root-servers.net.
110 198.41.0.6: rs.internic.net.
114 The command-line syntax and complete set of options are documented in
138 base >= 4.6 && < 4.7,
139 bytestring == 0.10.*,
145 parallel-io == 0.3.*,
147 test-framework == 0.8.*,
148 test-framework-hunit == 0.3.*,
149 test-framework-quickcheck2 == 0.3.*
154 -fwarn-missing-signatures
155 -fwarn-name-shadowing
159 -fwarn-incomplete-record-updates
160 -fwarn-monomorphism-restriction
161 -fwarn-unused-do-bind
175 type: exitcode-stdio-1.0
176 hs-source-dirs: src test
177 main-is: TestSuite.hs
180 base >= 4.6 && < 4.7,
181 bytestring == 0.10.*,
187 parallel-io == 0.3.*,
189 test-framework == 0.8.*,
190 test-framework-hunit == 0.3.*,
191 test-framework-quickcheck2 == 0.3.*
193 -- It's not entirely clear to me why I have to reproduce all of this.
197 -fwarn-missing-signatures
198 -fwarn-name-shadowing
202 -fwarn-incomplete-record-updates
203 -fwarn-monomorphism-restriction
204 -fwarn-unused-do-bind
212 -- These won't work without shelltestrunner installed in your
213 -- $PATH. Maybe there is some way to tell Cabal that.
214 test-suite shelltests
215 type: exitcode-stdio-1.0
217 main-is: ShellTests.hs
220 base >= 4.6 && < 4.7,
221 bytestring == 0.10.*,
227 parallel-io == 0.3.*,
230 test-framework == 0.8.*,
231 test-framework-hunit == 0.3.*,
232 test-framework-quickcheck2 == 0.3.*
234 -- It's not entirely clear to me why I have to reproduce all of this.
238 -fwarn-missing-signatures
239 -fwarn-name-shadowing
243 -fwarn-incomplete-record-updates
244 -fwarn-monomorphism-restriction
245 -fwarn-unused-do-bind
253 test-suite shelltests-net
254 type: exitcode-stdio-1.0
256 main-is: ShellTestsNet.hs
259 base >= 4.6 && < 4.7,
260 bytestring == 0.10.*,
266 parallel-io == 0.3.*,
269 test-framework == 0.8.*,
270 test-framework-hunit == 0.3.*,
271 test-framework-quickcheck2 == 0.3.*
273 -- It's not entirely clear to me why I have to reproduce all of this.
277 -fwarn-missing-signatures
278 -fwarn-name-shadowing
282 -fwarn-incomplete-record-updates
283 -fwarn-monomorphism-restriction
284 -fwarn-unused-do-bind
292 source-repository head
294 location: http://michael.orlitzky.com/git/hath.git