4 author: Michael Orlitzky
5 maintainer: Michael Orlitzky <michael@orlitzky.com>
8 license-file: doc/LICENSE
13 Hath manipulates network blocks in CIDR notation.
15 Hath is a Haskell program for working with network blocks in CIDR
16 notation. When dealing with blocks of network addresses, there are a
17 few things that one usually wants to do with them:
19 * Create a regular expression matching the CIDR block(s). This is
20 because grep will throw up if you feed it CIDR.
22 * Combine small blocks into larger ones. For example, if you have two
23 consecutive \/24s, they might combine into a larger \/23.
25 * View the result of block combination in a useful way.
27 Hath has several modes to perform these functions:
30 This computes a (Perl-compatible) regular expression matching
31 the input CIDR blocks. It's the default mode of operation.
34 This combines small blocks into larger ones where possible, and
35 eliminates redundant blocks. The output should be equivalent to
39 Shows only the blocks that would be removed by reduce; that is, it
40 shows the ones that would get combined into larger blocks or are
44 Shows what would change if you used reduce. Uses diff-like
48 List the IP addresses contained within the given CIDRs.
51 Perform reverse DNS (PTR) lookups on the IP addresses contained
52 within the given CIDRs.
56 Combine two \/24s into a \/23:
59 $ hath reduced <<< \"10.0.0.0\/24 10.0.1.0\/24\"
63 Create a perl-compatible regex to be fed to grep:
66 $ grep -P `hath regexed -i cidrs.txt` mail.log
69 List the addresses in 192.168.0.240\/29:
72 $ hath listed <<< \"192.168.0.240\/29\"
83 Perform PTR lookups on all of 198.41.0.4\/30:
86 hath reversed <<< \"198.41.0.4\/30\"
87 198.41.0.4: a.root-servers.net.
89 198.41.0.6: rs.internic.net.
101 parallel-io == 0.3.*,
103 test-framework == 0.8.*,
104 test-framework-hunit == 0.3.*,
105 test-framework-quickcheck2 == 0.3.*
127 -fwarn-missing-signatures
128 -fwarn-name-shadowing
132 -fwarn-incomplete-record-updates
133 -fwarn-monomorphism-restriction
134 -fwarn-unused-do-bind
148 type: exitcode-stdio-1.0
149 hs-source-dirs: src test
150 main-is: TestSuite.hs
152 base >= 4.6 && < 4.7,
153 bytestring == 0.10.*,
158 parallel-io == 0.3.*,
160 test-framework == 0.8.*,
161 test-framework-hunit == 0.3.*,
162 test-framework-quickcheck2 == 0.3.*
164 -- It's not entirely clear to me why I have to reproduce all of this.
168 -fwarn-missing-signatures
169 -fwarn-name-shadowing
173 -fwarn-incomplete-record-updates
174 -fwarn-monomorphism-restriction
175 -fwarn-unused-do-bind
182 source-repository head
184 location: http://michael.orlitzky.com/git/hath.git