diff options
author | Rob Austein <sra@hactrn.net> | 2014-04-10 22:56:47 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2014-04-10 22:56:47 +0000 |
commit | 45b95aaadc861b0e682373164fe18fa0c5ed2b2e (patch) | |
tree | 6e415c4dd6b78e84a58ae0038ab9847fb69feafc /rp/utils/dot.awk | |
parent | 5e0d1807ca7b049bde262a529443924adfd903e6 (diff) | |
parent | b7459d825cfadb9db265ed1b3bd0c10682464767 (diff) |
Merge tk685 branch back to trunk. This completes the move of the rpki
libraries and rpki.POW module from the rpki-ca package to the rpki-rp
package. Closes #685, closes #633.
svn path=/trunk/; revision=5784
Diffstat (limited to 'rp/utils/dot.awk')
-rw-r--r-- | rp/utils/dot.awk | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/rp/utils/dot.awk b/rp/utils/dot.awk new file mode 100644 index 00000000..ca1b490b --- /dev/null +++ b/rp/utils/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 "}"; +} |