diff options
author | Rob Austein <sra@hactrn.net> | 2006-10-30 23:28:52 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2006-10-30 23:28:52 +0000 |
commit | 1bb1bfd77ed5c0d15c4d98e2e46008bf89837c53 (patch) | |
tree | 114dd2ef26b5562b129cf44ca6096190e74148f1 | |
parent | d5e86cdf9029e5918bc77f622a03a56277fcfd34 (diff) |
checkpoint
svn path=/tests/uri/dot.awk; revision=461
-rw-r--r-- | tests/uri/dot.awk | 34 | ||||
-rw-r--r-- | tests/uri/table.awk (renamed from tests/uri/uri-table.awk) | 4 |
2 files changed, 38 insertions, 0 deletions
diff --git a/tests/uri/dot.awk b/tests/uri/dot.awk new file mode 100644 index 00000000..ca1b490b --- /dev/null +++ b/tests/uri/dot.awk @@ -0,0 +1,34 @@ +#!/usr/bin/awk -f +# $Id$ +# +# This doesn't really work right yet, and even if it did, the graph +# it would generate would be hopelessly large. + +BEGIN { + cmd = "find /var/rcynic/data/unauthenticated -type f -name '*.cer' -print0 | xargs -0 ./uri -d"; + while ((cmd | getline) == 1) { + if ($1 == "File") { + sub("/var/rcynic/data/unauthenticated/", "rsync://"); + u = $2; + uri[u] = ++n; + continue; + } + if ($1 == "SIA:") { + sia[u] = $2; + continue; + } + if ($1 == "AIA:") { + aia[u] = $2; + continue; + } + } + print "digraph rpki {"; + for (u in uri) { + printf "n%06d\t[ label=\"%s\" ];\n", uri[u], u; + if (sia[u]) + printf "n%06d -> n%06d\t [ color=blue ];\n", uri[u], uri[sia[u]]; + if (aia[u]) + printf "n%06d -> n%06d\t [ color=green ];\n", uri[u], uri[aia[u]]; + } + print "}"; +} diff --git a/tests/uri/uri-table.awk b/tests/uri/table.awk index ea9fafb3..d8627f67 100644 --- a/tests/uri/uri-table.awk +++ b/tests/uri/table.awk @@ -1,5 +1,9 @@ #!/usr/bin/awk -f # $Id$ +# +# Reformat uri.c's output in a way that's more useful +# for some kinds of scripting. Perhaps this functionality should be +# part of uri.c itself, but for now this script will do. BEGIN { cmd = "find /var/rcynic/data/unauthenticated -type f -name '*.cer' -print0 | xargs -0 ./uri -d"; |