From: claudio Date: Tue, 19 Dec 2023 10:32:20 +0000 (+0000) Subject: Show the RTR protocol version in the `bgpctl show rtr` output. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=bf4f3ceaa8de60797454a19ead40d13db23a9ca0;p=openbsd Show the RTR protocol version in the `bgpctl show rtr` output. Knowing the version is essential to understand if ASPA PDUs are included or not. OK tb@ --- diff --git a/usr.sbin/bgpctl/output.c b/usr.sbin/bgpctl/output.c index d9a5e52793c..9c8ba257d02 100644 --- a/usr.sbin/bgpctl/output.c +++ b/usr.sbin/bgpctl/output.c @@ -1,4 +1,4 @@ -/* $OpenBSD: output.c,v 1.42 2023/11/20 14:18:21 claudio Exp $ */ +/* $OpenBSD: output.c,v 1.43 2023/12/19 10:32:20 claudio Exp $ */ /* * Copyright (c) 2003 Henning Brauer @@ -1176,8 +1176,8 @@ show_rtr(struct ctl_show_rtr *rtr) if (rtr->local_addr.aid != AID_UNSPEC) printf(" Local Address: %s\n", log_addr(&rtr->local_addr)); if (rtr->session_id != -1) - printf(" Session ID: %d Serial #: %u\n", - rtr->session_id, rtr->serial); + printf("Version: %u Session ID: %d Serial #: %u\n", + rtr->version, rtr->session_id, rtr->serial); printf(" Refresh: %u, Retry: %u, Expire: %u\n", rtr->refresh, rtr->retry, rtr->expire); diff --git a/usr.sbin/bgpctl/output_json.c b/usr.sbin/bgpctl/output_json.c index cf0a476fe0b..eb049b09e5b 100644 --- a/usr.sbin/bgpctl/output_json.c +++ b/usr.sbin/bgpctl/output_json.c @@ -1,4 +1,4 @@ -/* $OpenBSD: output_json.c,v 1.36 2023/11/20 14:18:21 claudio Exp $ */ +/* $OpenBSD: output_json.c,v 1.37 2023/12/19 10:32:20 claudio Exp $ */ /* * Copyright (c) 2020 Claudio Jeker @@ -1009,6 +1009,7 @@ json_rtr(struct ctl_show_rtr *rtr) json_do_string("local_addr", log_addr(&rtr->local_addr)); if (rtr->session_id != -1) { + json_do_uint("version", rtr->version); json_do_uint("session_id", rtr->session_id); json_do_uint("serial", rtr->serial); }