]> git.ipfire.org Git - thirdparty/mtr.git/commitdiff
Add AS number to json output 197/head
authorfmazullo <fmazullo@iij.ad.jp>
Fri, 2 Jun 2017 06:30:58 +0000 (15:30 +0900)
committerfmazullo <fmazullo@iij.ad.jp>
Fri, 2 Jun 2017 06:30:58 +0000 (15:30 +0900)
ui/report.c

index 29d7bd6d8d49854c4e25d4d8303b3e99f6eebb98..6c39686cca07e38a2ecb2c34d5b92d244a8c2dad 100644 (file)
@@ -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;