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.
29 * Find their associated PTR records.
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.
55 Perform reverse DNS (PTR) lookups on the IP addresses contained
56 within the given CIDRs.
60 Combine two \/24s into a \/23:
63 $ hath reduced <<< \"10.0.0.0\/24 10.0.1.0\/24\"
67 Create a perl-compatible regex to be fed to grep:
70 $ grep -P `hath regexed -i cidrs.txt` mail.log
73 List the addresses in 192.168.0.240\/29:
76 $ hath listed <<< \"192.168.0.240\/29\"
87 Perform PTR lookups on all of 198.41.0.4\/30:
90 hath reversed <<< \"198.41.0.4\/30\"
91 198.41.0.4: a.root-servers.net.
93 198.41.0.6: rs.internic.net.
100 bytestring == 0.10.*,
105 parallel-io == 0.3.*,
107 test-framework == 0.8.*,
108 test-framework-hunit == 0.3.*,
109 test-framework-quickcheck2 == 0.3.*
131 -fwarn-missing-signatures
132 -fwarn-name-shadowing
136 -fwarn-incomplete-record-updates
137 -fwarn-monomorphism-restriction
138 -fwarn-unused-do-bind
152 type: exitcode-stdio-1.0
153 hs-source-dirs: src test
154 main-is: TestSuite.hs
156 base >= 4.6 && < 4.7,
157 bytestring == 0.10.*,
162 parallel-io == 0.3.*,
164 test-framework == 0.8.*,
165 test-framework-hunit == 0.3.*,
166 test-framework-quickcheck2 == 0.3.*
168 -- It's not entirely clear to me why I have to reproduce all of this.
172 -fwarn-missing-signatures
173 -fwarn-name-shadowing
177 -fwarn-incomplete-record-updates
178 -fwarn-monomorphism-restriction
179 -fwarn-unused-do-bind
186 source-repository head
188 location: http://michael.orlitzky.com/git/hath.git