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