From 07c0eced7bc0b9af7fa93d0ffba5016c9b825d76 Mon Sep 17 00:00:00 2001 From: fmazullo Date: Fri, 2 Jun 2017 15:30:58 +0900 Subject: [PATCH] Add AS number to json output --- ui/report.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ui/report.c b/ui/report.c index 29d7bd6..6c39686 100644 --- a/ui/report.c +++ b/ui/report.c @@ -3,7 +3,7 @@ Copyright (C) 1997,1998 Matt Kimball This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License version 2 as + it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, @@ -319,6 +319,13 @@ void json_close( } printf(" \"count\": \"%d\",\n", at + 1); printf(" \"host\": \"%s\",\n", name); +#ifdef HAVE_IPINFO + if(!ctl->ipinfo_no) { + char* fmtinfo = fmt_ipinfo(addr); + if (fmtinfo != NULL) fmtinfo = trim(fmtinfo); + printf(" \"ASN\": \"%s\",\n", fmtinfo); + } +#endif for (i = 0; i < MAXFLD; i++) { const char *format; -- 2.47.2