From 3bc5efd0d4f55fab88e996782da947b033ea9783 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Sat, 28 Aug 2010 00:45:56 -0400 Subject: [PATCH] Added LICENSE and README files. --- doc/LICENSE | 14 +++++++++ doc/README | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 95 insertions(+) create mode 100644 doc/LICENSE create mode 100644 doc/README diff --git a/doc/LICENSE b/doc/LICENSE new file mode 100644 index 0000000..5a8e332 --- /dev/null +++ b/doc/LICENSE @@ -0,0 +1,14 @@ + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + Version 2, December 2004 + + Copyright (C) 2004 Sam Hocevar + + Everyone is permitted to copy and distribute verbatim or modified + copies of this license document, and changing it is allowed as long + as the name is changed. + + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. You just DO WHAT THE FUCK YOU WANT TO. + diff --git a/doc/README b/doc/README new file mode 100644 index 0000000..5ad9154 --- /dev/null +++ b/doc/README @@ -0,0 +1,81 @@ + +Overview +-------- + +Hath is a Haskell program for working with network blocks in CIDR[1] +notation. When dealing with blocks of network addresses, there are a +few things that you (i.e. I) want to do with them: + + * Create a regular expression matching the CIDR block(s). This is + because grep will throw up if you feed it CIDR. + + * Combine small blocks into larger ones. For example, if you have two + consecutive /24s, they might combine into a larger /23. + + * View the result of block combination in a useful way. + +Hath does just that. It takes as its input (via stdin, or a file with +the -i parameter) a list of CIDR blocks. From now on, assume we have +the following in cidrs.txt: + + 10.0.0.0/24 + 10.0.1.0/24 + + +Modes +----- + +Hath has the following modes: + + * Regexed + + This computes a (Perl-compatible) regular expression matching + the input CIDR blocks. It's the default mode of operation. + + $ hath -i cidrs.txt + ([^\.0-9](10)\.(0)\.(0)\.(0)[^\.0-9]|[^\.0-9](10)\.(0)\.(1) + \.(0)[^\.0-9]) + + * Reduced + + This combines small blocks into larger ones where possible, and + eliminates redundant blocks. The output should be equivalent to + the input, though. + + $ hath reduced -i cidrs.txt + 10.0.0.0/23 + + * Duped + + Shows only the blocks that would be removed by reduce; that is, it + shows the ones that would get combined into larger blocks or are + simply redundant. + + $ hath duped -i cidrs.txt + 10.0.0.0/24 + 10.0.1.0/24 + + * Diffed + + Shows what would change if you used reduce. Uses diff-like + notation. + + $ hath diffed -i cidrs.txt + -10.0.0.0/24 + -10.0.1.0/24 + +10.0.0.0/23 + +Each of the modes also supports a present-tense flavor; the following +are equivalent to their counterparts: regex, reduce, dupe, diff. + + +Bugs +---- + +Send bugs to the moon[2]. + + + +[1] http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing + +[2] michael@orlitzky.com -- 2.43.2