diff options
-rw-r--r-- | rcynic/rcynic.c | 37 | ||||
-rwxr-xr-x | rcynic/validation_status.awk | 32 | ||||
-rw-r--r-- | scripts/analyze-rcynic-history.py | 17 |
3 files changed, 58 insertions, 28 deletions
diff --git a/rcynic/rcynic.c b/rcynic/rcynic.c index 3c7df816..64f44096 100644 --- a/rcynic/rcynic.c +++ b/rcynic/rcynic.c @@ -1554,6 +1554,17 @@ static walk_ctx_t *walk_ctx_stack_head(STACK_OF(walk_ctx_t) *wsk) } /** + * Whether we're done iterating over a walk context. Think of this as + * the thing you call (negated) in the second clause of a conceptual + * "for" loop. + */ +static int walk_ctx_loop_done(STACK_OF(walk_ctx_t) *wsk) +{ + walk_ctx_t *w = walk_ctx_stack_head(wsk); + return wsk == NULL || w == NULL || w->state >= walk_state_done; +} + +/** * Walk context iterator. Think of this as the thing you call in the * third clause of a conceptual "for" loop: this reinitializes as * necessary for the next pass through the loop. @@ -1579,26 +1590,17 @@ static void walk_ctx_loop_next(const rcynic_ctx_t *rc, STACK_OF(walk_ctx_t) *wsk return; } - if (w->state < walk_state_done) { + while (!walk_ctx_loop_done(wsk)) { w->state++; w->manifest_iteration = 0; w->filename_iteration = 0; sk_OPENSSL_STRING_pop_free(w->filenames, OPENSSL_STRING_free); w->filenames = directory_filenames(rc, w->state, &w->certinfo.sia); + if (w->manifest != NULL || w->filenames != NULL) + return; } } -/** - * Whether we're done iterating over a walk context. Think of this as - * the thing you call (negated) in the second clause of a conceptual - * "for" loop. - */ -static int walk_ctx_loop_done(STACK_OF(walk_ctx_t) *wsk) -{ - walk_ctx_t *w = walk_ctx_stack_head(wsk); - return wsk == NULL || w == NULL || w->state >= walk_state_done; -} - static int check_manifest(rcynic_ctx_t *rc, STACK_OF(walk_ctx_t) *wsk); /** @@ -1626,17 +1628,16 @@ static void walk_ctx_loop_init(rcynic_ctx_t *rc, STACK_OF(walk_ctx_t) *wsk) if (!w->manifest) logmsg(rc, log_telemetry, "Couldn't get manifest %s, blundering onward", w->certinfo.manifest.s); - assert(w->filenames == NULL); - w->filenames = directory_filenames(rc, w->state, &w->certinfo.sia); - - w->stale_manifest = w->manifest != NULL && X509_cmp_current_time(w->manifest->nextUpdate) < 0; - w->manifest_iteration = 0; w->filename_iteration = 0; w->state++; - assert(w->state == walk_state_current); + assert(w->filenames == NULL); + w->filenames = directory_filenames(rc, w->state, &w->certinfo.sia); + + w->stale_manifest = w->manifest != NULL && X509_cmp_current_time(w->manifest->nextUpdate) < 0; + while (!walk_ctx_loop_done(wsk) && (w->manifest == NULL || w->manifest_iteration >= sk_FileAndHash_num(w->manifest->fileList)) && (w->filenames == NULL || w->filename_iteration >= sk_OPENSSL_STRING_num(w->filenames))) diff --git a/rcynic/validation_status.awk b/rcynic/validation_status.awk new file mode 100755 index 00000000..92012595 --- /dev/null +++ b/rcynic/validation_status.awk @@ -0,0 +1,32 @@ +#!/usr/bin/awk -f + +# $Id$ +# +# Copyright (C) 2011 Internet Systems Consortium, Inc. ("ISC") +# +# Permission to use, copy, modify, and/or distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH +# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, +# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +# PERFORMANCE OF THIS SOFTWARE. + +# Prettyprint output of validation_status.xsl + +BEGIN { + FS = "\t"; + cmd = "xsltproc validation_status.xsl"; + if (ARGC == 1) + cmd = cmd " -"; + else + for (i = 1; i < ARGC; ++i) + cmd = cmd " " ARGV[i]; + while ((cmd | getline) > 0) + printf "%s %8s %-40s %s\n", $1, $4, $2, $3; + close(cmd); +} diff --git a/scripts/analyze-rcynic-history.py b/scripts/analyze-rcynic-history.py index c3c8df2f..12c2d8ea 100644 --- a/scripts/analyze-rcynic-history.py +++ b/scripts/analyze-rcynic-history.py @@ -116,7 +116,9 @@ class Host(object): @property def average_connection_time(self): - return float(sum(c.elapsed.total_seconds() for c in self.connections)) / float(self.connection_count) + return (float(sum(((c.elapsed.days * 24 * 3600 + c.elapsed.seconds) * 10**6 + c.elapsed.microseconds) + for c in self.connections)) / + float(self.connection_count * 10**6)) class Format(object): @@ -241,13 +243,9 @@ def plotter(f, hostnames, field, logscale = False): f.write(""" set xdata time set timefmt '%Y-%m-%dT%H:%M:%SZ' - #set format x '%H:%M:%S' - #set format x '%m-%d' - #set format x '%a%H' - #set format x '%H:%M' - #set format x '%a%H:%M' - set format x "%a\\n%H:%M" - set title '""" + title + """' + #set format x '%m/%d' + set format x '%b%d' + #set title '""" + title + """' plot""" + ",".join(" '-' using 1:2 with lines title '%s'" % h for h in hostnames) + "\n") for i in xrange(1, n): for plotline in plotlines: @@ -280,8 +278,7 @@ if show_plot: hostnames = sorted(summary.hostnames) else: hostnames = ("rpki.apnic.net", "rpki.ripe.net", "repository.lacnic.net", "rpki.afrinic.net", - "arin.rpki.net", "rgnet.rpki.net", - "rpki.surfnet.nl", "rpki.antd.nist.gov") + "arin.rpki.net", "rgnet.rpki.net", "rpki.antd.nist.gov") fields = [fmt.attr for fmt in Host.format if fmt.attr not in ("scaled_elapsed", "hostname")] if plot_to_one: plot_one(hostnames, fields) |