On 2021/12/12 14:13, Denis Fondras wrote:
> Number of received prefixes appear in `bgpctl sh` but not in `bgpctl -j sh`.
> 
> Here is a diff to add this piece of information.
> 
> OK ?

Makes sense, but if prefix_cnt is added, max_prefix probably should be too

> Index: output_json.c
> ===================================================================
> RCS file: /cvs/src/usr.sbin/bgpctl/output_json.c,v
> retrieving revision 1.12
> diff -u -p -r1.12 output_json.c
> --- output_json.c     27 Jul 2021 07:42:37 -0000      1.12
> +++ output_json.c     12 Dec 2021 13:10:18 -0000
> @@ -315,6 +315,8 @@ json_neighbor(struct peer *p, struct par
>       json_do_printf("state", "%s", statenames[p->state]);
>       json_do_printf("last_updown", "%s", fmt_monotime(p->stats.last_updown));
>       json_do_int("last_updown_sec", get_monotime(p->stats.last_updown));
> +     if (p->state == STATE_ESTABLISHED)
> +             json_do_uint("received_prefixes", p->stats.prefix_cnt);
>  
>       switch (res->action) {
>       case SHOW:
> 

Reply via email to