]> gitweb.michael.orlitzky.com - hath.git/blob - doc/man/hath.1
Add more Haddock comments.
[hath.git] / doc / man / hath.1
1 .TH hath 1
2
3 .SH NAME
4 hath \- Manipulate network blocks in CIDR notation
5
6 .SH SYNOPSIS
7
8 \fBhath\fR [\fBregexed|reduced|duped|diffed\fR] [\fB\-h\fR] [\fB-i \fIFILE\fR] \fI<input>\fR
9
10 .SH INPUT
11
12 .P
13 The \fIinput\fR (default: stdin) should be a list of CIDR blocks,
14 separated by whitespace. Empty lines will be ignored, but otherwise,
15 malformed entries will cause an error to be displayed.
16
17 .SH DESCRIPTION
18
19 .P
20 Hath is a Haskell program for working with network blocks in CIDR
21 notation. When dealing with blocks of network addresses, there are a
22 few things that one usually wants to do with them:
23
24 .IP \[bu] 2
25 Create a regular expression matching the CIDR block(s). This is
26 because grep will throw up if you feed it CIDR.
27
28 .IP \[bu]
29 Combine small blocks into larger ones. For example, if you have two
30 consecutive /24s, they might combine into a larger /23.
31
32 .IP \[bu]
33 View the result of block combination in a useful way.
34
35 .P
36 Hath does just that. It takes as its input (via stdin, or a file with
37 the -i parameter) a list of CIDR blocks.
38
39 .SH MODES
40
41 .P
42 Hath currently has four modes:
43
44 .IP \[bu] 2
45 \fBRegexed\fR
46
47 This computes a (Perl-compatible) regular expression matching
48 the input CIDR blocks. It's the default mode of operation.
49
50 .nf
51 .B $ hath <<< \(dq10.0.0.0/24 10.0.1.0/24\(dq
52 ([^\.0-9](10)\.(0)\.(0)\.(0)[^\.0-9]|[^\.0-9](10)\.(0)\.(1)
53 \.(0)[^\.0-9])
54
55 .IP \[bu]
56 \fBReduced\fR
57
58 This combines small blocks into larger ones where possible, and
59 eliminates redundant blocks. The output should be equivalent to
60 the input, though.
61
62 .nf
63 .B $ hath reduced <<< \(dq10.0.0.0/24 10.0.1.0/24\(dq
64 10.0.0.0/23
65
66 .IP \[bu]
67 \fBDuped\fR
68
69 Shows only the blocks that would be removed by reduce; that is, it
70 shows the ones that would get combined into larger blocks or are
71 simply redundant.
72
73 .nf
74 .B $ hath duped <<< \(dq10.0.0.0/24 10.0.1.0/24\(dq
75 10.0.0.0/24
76 10.0.1.0/24
77
78 .IP \[bu]
79 \fBDiffed\fR
80
81 Shows what would change if you used reduce. Uses diff-like
82 notation.
83
84 .nf
85 .B $ hath diffed <<< \(dq10.0.0.0/24 10.0.1.0/24\(dq
86 -10.0.0.0/24
87 -10.0.1.0/24
88 +10.0.0.0/23
89
90 .P
91 Each of the modes also supports a present-tense flavor; the following
92 are equivalent to their counterparts: \fBregex\fR, \fBreduce\fR,
93 \fBdupe\fR, \fBdiff\fR.
94
95 .SH OPTIONS
96
97 .IP \fB\-\-input\fR,\ \fB\-i\fR
98 Specify the input file containing a list of CIDRs, rather than using
99 stdin (the default).