]> gitweb.michael.orlitzky.com - hath.git/blob - hath.cabal
Simplify Read instance code.
[hath.git] / hath.cabal
1 name: hath
2 version: 0.0.4
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 Hath has several modes to perform these functions:
28 .
29 [@Regexed@]
30 This computes a (Perl-compatible) regular expression matching
31 the input CIDR blocks. It's the default mode of operation.
32 .
33 [@Reduced@]
34 This combines small blocks into larger ones where possible, and
35 eliminates redundant blocks. The output should be equivalent to
36 the input, though.
37 .
38 [@Duped@]
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
41 simply redundant.
42 .
43 [@Diffed@]
44 Shows what would change if you used reduce. Uses diff-like
45 notation.
46 .
47 [@Listed@]
48 List the IP addresses contained within the given CIDRs.
49 .
50 [@Reversed@]
51 Perform reverse DNS (PTR) lookups on the IP addresses contained
52 within the given CIDRs.
53 .
54 /Examples/:
55 .
56 Combine two \/24s into a \/23:
57 .
58 @
59 $ hath reduced <<< \"10.0.0.0\/24 10.0.1.0\/24\"
60 10.0.0.0/23
61 @
62 .
63 Create a perl-compatible regex to be fed to grep:
64 .
65 @
66 $ grep -P `hath regexed -i cidrs.txt` mail.log
67 @
68 .
69 List the addresses in 192.168.0.240\/29:
70 .
71 @
72 $ hath listed <<< \"192.168.0.240\/29\"
73 192.168.0.240
74 192.168.0.241
75 192.168.0.242
76 192.168.0.243
77 192.168.0.244
78 192.168.0.245
79 192.168.0.246
80 192.168.0.247
81 @
82 .
83 Perform PTR lookups on all of 198.41.0.4\/30:
84 .
85 @
86 hath reversed <<< \"198.41.0.4\/30\"
87 198.41.0.4: a.root-servers.net.
88 198.41.0.5:
89 198.41.0.6: rs.internic.net.
90 198.41.0.7:
91 @
92
93 executable hath
94 build-depends:
95 base >= 4.6.0,
96 bytestring == 0.10.*,
97 dns == 0.3.*,
98 HUnit == 1.2.*,
99 QuickCheck == 2.6.*,
100 MissingH == 1.2.*,
101 parallel-io == 0.3.*,
102 split == 0.2.*,
103 test-framework == 0.8.*,
104 test-framework-hunit == 0.3.*,
105 test-framework-quickcheck2 == 0.3.*
106
107 main-is:
108 Main.hs
109
110 hs-source-dirs:
111 src/
112
113 other-modules:
114 Bit
115 Cidr
116 CommandLine
117 DNS
118 ExitCodes
119 IPv4Address
120 Maskable
121 Maskbits
122 Octet
123
124 ghc-options:
125 -Wall
126 -fwarn-hi-shadowing
127 -fwarn-missing-signatures
128 -fwarn-name-shadowing
129 -fwarn-orphans
130 -fwarn-type-defaults
131 -fwarn-tabs
132 -fwarn-incomplete-record-updates
133 -fwarn-monomorphism-restriction
134 -fwarn-unused-do-bind
135 -rtsopts
136 -threaded
137 -optc-O3
138 -optc-march=native
139 -O2
140
141 ghc-prof-options:
142 -prof
143 -auto-all
144 -caf-all
145
146
147 test-suite testsuite
148 type: exitcode-stdio-1.0
149 hs-source-dirs: src test
150 main-is: TestSuite.hs
151 build-depends:
152 base >= 4.6.0,
153 bytestring == 0.10.*,
154 dns == 0.3.*,
155 HUnit == 1.2.*,
156 QuickCheck == 2.6.*,
157 MissingH == 1.2.*,
158 parallel-io == 0.3.*,
159 split == 0.2.*,
160 test-framework == 0.8.*,
161 test-framework-hunit == 0.3.*,
162 test-framework-quickcheck2 == 0.3.*
163
164 -- It's not entirely clear to me why I have to reproduce all of this.
165 ghc-options:
166 -Wall
167 -fwarn-hi-shadowing
168 -fwarn-missing-signatures
169 -fwarn-name-shadowing
170 -fwarn-orphans
171 -fwarn-type-defaults
172 -fwarn-tabs
173 -fwarn-incomplete-record-updates
174 -fwarn-monomorphism-restriction
175 -fwarn-unused-do-bind
176 -rtsopts
177 -threaded
178 -optc-O3
179 -optc-march=native
180 -O2
181
182 source-repository head
183 type: git
184 location: http://michael.orlitzky.com/git/hath.git
185 branch: master