]> gitweb.michael.orlitzky.com - hath.git/blob - hath.cabal
e6f53955df5171fc884c5f847d921f11e1ba2164
[hath.git] / hath.cabal
1 name: hath
2 version: 0.0.5
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 Combine two \/24s into a \/23:
61 .
62 @
63 $ hath reduced <<< \"10.0.0.0\/24 10.0.1.0\/24\"
64 10.0.0.0/23
65 @
66 .
67 Create a perl-compatible regex to be fed to grep:
68 .
69 @
70 $ grep -P `hath regexed -i cidrs.txt` mail.log
71 @
72 .
73 List the addresses in 192.168.0.240\/29:
74 .
75 @
76 $ hath listed <<< \"192.168.0.240\/29\"
77 192.168.0.240
78 192.168.0.241
79 192.168.0.242
80 192.168.0.243
81 192.168.0.244
82 192.168.0.245
83 192.168.0.246
84 192.168.0.247
85 @
86 .
87 Perform PTR lookups on all of 198.41.0.4\/30:
88 .
89 @
90 hath reversed <<< \"198.41.0.4\/30\"
91 198.41.0.4: a.root-servers.net.
92 198.41.0.5:
93 198.41.0.6: rs.internic.net.
94 198.41.0.7:
95 @
96
97 executable hath
98 build-depends:
99 base >= 4.6 && < 4.7,
100 bytestring == 0.10.*,
101 dns == 1.*,
102 HUnit == 1.2.*,
103 QuickCheck == 2.6.*,
104 MissingH == 1.2.*,
105 parallel-io == 0.3.*,
106 split == 0.2.*,
107 test-framework == 0.8.*,
108 test-framework-hunit == 0.3.*,
109 test-framework-quickcheck2 == 0.3.*
110
111 main-is:
112 Main.hs
113
114 hs-source-dirs:
115 src/
116
117 other-modules:
118 Bit
119 Cidr
120 CommandLine
121 DNS
122 ExitCodes
123 IPv4Address
124 Maskable
125 Maskbits
126 Octet
127
128 ghc-options:
129 -Wall
130 -fwarn-hi-shadowing
131 -fwarn-missing-signatures
132 -fwarn-name-shadowing
133 -fwarn-orphans
134 -fwarn-type-defaults
135 -fwarn-tabs
136 -fwarn-incomplete-record-updates
137 -fwarn-monomorphism-restriction
138 -fwarn-unused-do-bind
139 -rtsopts
140 -threaded
141 -optc-O3
142 -optc-march=native
143 -O2
144
145 ghc-prof-options:
146 -prof
147 -auto-all
148 -caf-all
149
150
151 test-suite testsuite
152 type: exitcode-stdio-1.0
153 hs-source-dirs: src test
154 main-is: TestSuite.hs
155 build-depends:
156 base >= 4.6 && < 4.7,
157 bytestring == 0.10.*,
158 dns == 1.*,
159 HUnit == 1.2.*,
160 QuickCheck == 2.6.*,
161 MissingH == 1.2.*,
162 parallel-io == 0.3.*,
163 split == 0.2.*,
164 test-framework == 0.8.*,
165 test-framework-hunit == 0.3.*,
166 test-framework-quickcheck2 == 0.3.*
167
168 -- It's not entirely clear to me why I have to reproduce all of this.
169 ghc-options:
170 -Wall
171 -fwarn-hi-shadowing
172 -fwarn-missing-signatures
173 -fwarn-name-shadowing
174 -fwarn-orphans
175 -fwarn-type-defaults
176 -fwarn-tabs
177 -fwarn-incomplete-record-updates
178 -fwarn-monomorphism-restriction
179 -fwarn-unused-do-bind
180 -rtsopts
181 -threaded
182 -optc-O3
183 -optc-march=native
184 -O2
185
186 source-repository head
187 type: git
188 location: http://michael.orlitzky.com/git/hath.git
189 branch: master