]> gitweb.michael.orlitzky.com - hath.git/blob - hath.cabal
482daede9cf92b2b1fa4201f7f7c06c4bb67c96e
[hath.git] / hath.cabal
1 cabal-version: 3.0
2 name: hath
3 version: 0.5.5
4 author: Michael Orlitzky
5 maintainer: Michael Orlitzky <michael@orlitzky.com>
6 homepage: http://michael.orlitzky.com/code/hath.xhtml
7 category: Utils
8 license: AGPL-3.0-only
9 license-file: doc/LICENSE
10 build-type: Simple
11 extra-source-files:
12 doc/man1/hath.1
13 test/shell/*.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 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 /Examples/:
55
56 Compute a (Perl-compatible) regular expression matching
57 the input CIDR blocks. It's the default mode of operation.
58
59 @
60 $ echo \"10.0.0.0\/29 10.0.0.8\/29\" | hath
61 ((10)\.(0)\.(0)\.(15|14|13|12|11|10|9|8|7|6|5|4|3|2|1|0))
62 @
63
64 Combine two \/24s into a \/23:
65
66 @
67 $ echo \"10.0.0.0\/24 10.0.1.0\/24\" | hath reduced
68 10.0.0.0/23
69 @
70
71 List the addresses in 192.168.0.240\/29:
72
73 @
74 $ echo 192.168.0.240\/29 | hath listed
75 192.168.0.240
76 192.168.0.241
77 192.168.0.242
78 192.168.0.243
79 192.168.0.244
80 192.168.0.245
81 192.168.0.246
82 192.168.0.247
83 @
84
85 The command-line syntax and complete set of options are documented in
86 the man page.
87
88
89 executable hath
90 default-language:
91 Haskell2010
92
93 main-is:
94 Main.hs
95
96 hs-source-dirs:
97 src/
98
99 other-modules:
100 Bit
101 Cidr
102 CommandLine
103 ExitCodes
104 IPv4Address
105 Maskable
106 Maskbits
107 Octet
108 Paths_hath
109
110 autogen-modules:
111 Paths_hath
112
113 build-depends:
114 base >= 4.15,
115 cmdargs >= 0.10,
116 split >= 0.2,
117 tasty >= 0.8,
118 tasty-hunit >= 0.8,
119 tasty-quickcheck >= 0.8.1
120
121
122 test-suite testsuite
123 type: exitcode-stdio-1.0
124 hs-source-dirs: src test
125 default-language: Haskell2010
126 main-is: TestSuite.hs
127
128 other-modules:
129 Bit
130 Cidr
131 IPv4Address
132 Maskable
133 Maskbits
134 Octet
135
136 build-depends:
137 base >= 4.15,
138 split >= 0.2,
139 tasty >= 0.8,
140 tasty-hunit >= 0.8,
141 tasty-quickcheck >= 0.8.1
142
143
144 -- These won't work without shelltestrunner installed in your
145 -- $PATH. Maybe there is some way to tell Cabal that.
146 test-suite shelltests
147 type: exitcode-stdio-1.0
148 hs-source-dirs: test
149 default-language: Haskell2010
150 main-is: ShellTests.hs
151
152 build-depends:
153 base >= 4.15,
154 process >= 1.1
155
156
157 source-repository head
158 type: git
159 location: http://gitweb.michael.orlitzky.com/hath.git
160 branch: master