]> gitweb.michael.orlitzky.com - hath.git/blob - hath.cabal
Loosen all dependencies eternally and bump to v0.2.2.
[hath.git] / hath.cabal
1 name: hath
2 version: 0.2.2
3 cabal-version: >= 1.8
4 author: Michael Orlitzky
5 maintainer: Michael Orlitzky <michael@orlitzky.com>
6 category: Utils
7 license: GPL-3
8 license-file: doc/LICENSE
9 build-type: Simple
10 extra-source-files:
11 doc/man1/hath.1
12 test/shell/*.test
13 test/shell-net/*.test
14 synopsis:
15 Hath manipulates network blocks in CIDR notation.
16 description:
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:
20 .
21 * Create a regular expression matching the CIDR block(s). This is
22 because grep will throw up if you feed it CIDR.
23 .
24 * Combine small blocks into larger ones. For example, if you have two
25 consecutive \/24s, they might combine into a larger \/23.
26 .
27 * View the result of block combination in a useful way.
28 .
29 * List them.
30 .
31 * Find their associated PTR records.
32 .
33 Hath has several modes to perform these functions:
34 .
35 [@Regexed@]
36 This computes a (Perl-compatible) regular expression matching
37 the input CIDR blocks. It's the default mode of operation.
38 .
39 [@Reduced@]
40 This combines small blocks into larger ones where possible, and
41 eliminates redundant blocks. The output should be equivalent to
42 the input, though.
43 .
44 [@Duped@]
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
47 simply redundant.
48 .
49 [@Diffed@]
50 Shows what would change if you used reduce. Uses diff-like
51 notation.
52 .
53 [@Listed@]
54 List the IP addresses contained within the given CIDRs.
55 .
56 [@Reversed@]
57 Perform reverse DNS (PTR) lookups on the IP addresses contained
58 within the given CIDRs.
59 .
60 /Examples/:
61 .
62 Compute a (Perl-compatible) regular expression matching
63 the input CIDR blocks. It's the default mode of operation.
64 .
65 @
66 $ hath <<< \"10.0.0.0\/29 10.0.0.8\/29\"
67 ((10)\.(0)\.(0)\.(15|14|13|12|11|10|9|8|7|6|5|4|3|2|1|0))
68 @
69 .
70 Combine two \/24s into a \/23:
71 .
72 @
73 $ hath reduced <<< \"10.0.0.0\/24 10.0.1.0\/24\"
74 10.0.0.0/23
75 @
76 .
77 List the addresses in 192.168.0.240\/29:
78 .
79 @
80 $ hath listed <<< 192.168.0.240\/29
81 192.168.0.240
82 192.168.0.241
83 192.168.0.242
84 192.168.0.243
85 192.168.0.244
86 192.168.0.245
87 192.168.0.246
88 192.168.0.247
89 @
90 .
91 Perform PTR lookups on all of 198.41.0.4\/30:
92 .
93 @
94 $ hath reversed <<< 198.41.0.4\/30
95 198.41.0.4: a.root-servers.net.
96 198.41.0.5:
97 198.41.0.6: rs.internic.net.
98 198.41.0.7:
99 @
100 .
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:
105 .
106 @
107 $ hath reversed +RTS -N25 <<< 198.41.0.4\/24
108 198.41.0.4: a.root-servers.net.
109 198.41.0.5:
110 198.41.0.6: rs.internic.net.
111 ...
112 @
113 .
114 The command-line syntax and complete set of options are documented in
115 the man page.
116
117
118 executable hath
119
120 main-is:
121 Main.hs
122
123 hs-source-dirs:
124 src/
125
126 other-modules:
127 Bit
128 Cidr
129 CommandLine
130 DNS
131 ExitCodes
132 IPv4Address
133 Maskable
134 Maskbits
135 Octet
136
137 build-depends:
138 base == 4.*,
139 bytestring >= 0.10,
140 cmdargs >= 0.10,
141 dns >= 1.2,
142 MissingH >= 1.2,
143 parallel-io >= 0.3,
144 split >= 0.2,
145 tasty >= 0.8,
146 tasty-hunit >= 0.8,
147 tasty-quickcheck >= 0.8.1
148
149 ghc-options:
150 -Wall
151 -fwarn-hi-shadowing
152 -fwarn-missing-signatures
153 -fwarn-name-shadowing
154 -fwarn-orphans
155 -fwarn-type-defaults
156 -fwarn-tabs
157 -fwarn-incomplete-record-updates
158 -fwarn-monomorphism-restriction
159 -fwarn-unused-do-bind
160 -rtsopts
161 -threaded
162 -optc-O3
163 -optc-march=native
164 -O2
165
166 ghc-prof-options:
167 -prof
168 -auto-all
169 -caf-all
170
171
172 test-suite testsuite
173 type: exitcode-stdio-1.0
174 hs-source-dirs: src test
175 main-is: TestSuite.hs
176
177 build-depends:
178 base == 4.*,
179 bytestring >= 0.10,
180 cmdargs >= 0.10,
181 dns >= 1.2,
182 MissingH >= 1.2,
183 parallel-io >= 0.3,
184 split >= 0.2,
185 tasty >= 0.8,
186 tasty-hunit >= 0.8,
187 tasty-quickcheck >= 0.8.1
188
189
190 -- It's not entirely clear to me why I have to reproduce all of this.
191 ghc-options:
192 -Wall
193 -fwarn-hi-shadowing
194 -fwarn-missing-signatures
195 -fwarn-name-shadowing
196 -fwarn-orphans
197 -fwarn-type-defaults
198 -fwarn-tabs
199 -fwarn-incomplete-record-updates
200 -fwarn-monomorphism-restriction
201 -fwarn-unused-do-bind
202 -rtsopts
203 -threaded
204 -optc-O3
205 -optc-march=native
206 -O2
207
208
209 -- These won't work without shelltestrunner installed in your
210 -- $PATH. Maybe there is some way to tell Cabal that.
211 test-suite shelltests
212 type: exitcode-stdio-1.0
213 hs-source-dirs: test
214 main-is: ShellTests.hs
215
216 build-depends:
217 base == 4.*,
218 bytestring >= 0.10,
219 cmdargs >= 0.10,
220 dns >= 1.2,
221 MissingH >= 1.2,
222 parallel-io >= 0.3,
223 process >= 1.1,
224 split >= 0.2,
225 tasty >= 0.8,
226 tasty-hunit >= 0.8,
227 tasty-quickcheck >= 0.8.1
228
229 -- It's not entirely clear to me why I have to reproduce all of this.
230 ghc-options:
231 -Wall
232 -fwarn-hi-shadowing
233 -fwarn-missing-signatures
234 -fwarn-name-shadowing
235 -fwarn-orphans
236 -fwarn-type-defaults
237 -fwarn-tabs
238 -fwarn-incomplete-record-updates
239 -fwarn-monomorphism-restriction
240 -fwarn-unused-do-bind
241 -rtsopts
242 -threaded
243 -optc-O3
244 -optc-march=native
245 -O2
246
247
248 test-suite shelltests-net
249 type: exitcode-stdio-1.0
250 hs-source-dirs: test
251 main-is: ShellTestsNet.hs
252
253 build-depends:
254 base == 4.*,
255 bytestring >= 0.10,
256 cmdargs >= 0.10,
257 dns >= 1.2,
258 MissingH >= 1.2,
259 parallel-io >= 0.3,
260 process >= 1.1,
261 split >= 0.2,
262 tasty >= 0.8,
263 tasty-hunit >= 0.8,
264 tasty-quickcheck >= 0.8.1
265
266 -- It's not entirely clear to me why I have to reproduce all of this.
267 ghc-options:
268 -Wall
269 -fwarn-hi-shadowing
270 -fwarn-missing-signatures
271 -fwarn-name-shadowing
272 -fwarn-orphans
273 -fwarn-type-defaults
274 -fwarn-tabs
275 -fwarn-incomplete-record-updates
276 -fwarn-monomorphism-restriction
277 -fwarn-unused-do-bind
278 -rtsopts
279 -threaded
280 -optc-O3
281 -optc-march=native
282 -O2
283
284
285 source-repository head
286 type: git
287 location: http://michael.orlitzky.com/git/hath.git
288 branch: master