From: job Date: Wed, 5 May 2021 17:25:44 +0000 (+0000) Subject: Emit an integer instead of a string in JSON output X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=8828c1b7c6b0fb2f84feb4c77ed07bb175fb69c5;p=openbsd Emit an integer instead of a string in JSON output We added the "AS123" format because this is what the other tools did and there was the goal to have equal output. However, many in the community have voiced complaints about having to do string conversions. OK deraadt@ claudio@ --- diff --git a/usr.sbin/rpki-client/output-json.c b/usr.sbin/rpki-client/output-json.c index fd2faa8548f..8ca411ae245 100644 --- a/usr.sbin/rpki-client/output-json.c +++ b/usr.sbin/rpki-client/output-json.c @@ -1,4 +1,4 @@ -/* $OpenBSD: output-json.c,v 1.15 2021/04/08 19:49:27 job Exp $ */ +/* $OpenBSD: output-json.c,v 1.16 2021/05/05 17:25:44 job Exp $ */ /* * Copyright (c) 2019 Claudio Jeker * @@ -100,7 +100,7 @@ output_json(FILE *out, struct vrp_tree *vrps, struct stats *st) ip_addr_print(&v->addr, v->afi, buf, sizeof(buf)); - if (fprintf(out, "\t\t{ \"asn\": \"AS%u\", \"prefix\": \"%s\", " + if (fprintf(out, "\t\t{ \"asn\": %u, \"prefix\": \"%s\", " "\"maxLength\": %u, \"ta\": \"%s\" }", v->asid, buf, v->maxlength, v->tal) < 0) return -1;