-/* $OpenBSD: bgpctl.c,v 1.279 2022/06/27 13:27:38 claudio Exp $ */
+/* $OpenBSD: bgpctl.c,v 1.280 2022/07/07 12:17:57 claudio Exp $ */
/*
* Copyright (c) 2003 Henning Brauer <henning@openbsd.org>
}
const char *
-fmt_flags(uint8_t flags, int sum)
+fmt_flags(uint32_t flags, int sum)
{
static char buf[80];
char flagstr[5];
*p++ = '*';
if (flags & F_PREF_BEST)
*p++ = '>';
+ if (flags & F_PREF_ECMP)
+ *p++ = 'm';
+ if (flags & F_PREF_AS_WIDE)
+ *p++ = 'w';
*p = '\0';
snprintf(buf, sizeof(buf), "%-5s", flagstr);
} else {
strlcat(buf, ", valid", sizeof(buf));
if (flags & F_PREF_BEST)
strlcat(buf, ", best", sizeof(buf));
+ if (flags & F_PREF_ECMP)
+ strlcat(buf, ", ecmp", sizeof(buf));
+ if (flags & F_PREF_AS_WIDE)
+ strlcat(buf, ", as-wide", sizeof(buf));
if (flags & F_PREF_ANNOUNCE)
strlcat(buf, ", announced", sizeof(buf));
if (strlen(buf) >= sizeof(buf) - 1)
const char *fmt_monotime(time_t);
const char *fmt_fib_flags(uint16_t);
const char *fmt_origin(uint8_t, int);
-const char *fmt_flags(uint8_t, int);
+const char *fmt_flags(uint32_t, int);
const char *fmt_ovs(uint8_t, int);
const char *fmt_auth_method(enum auth_method);
const char *fmt_mem(long long);
-/* $OpenBSD: output_json.c,v 1.17 2022/06/27 13:27:38 claudio Exp $ */
+/* $OpenBSD: output_json.c,v 1.18 2022/07/07 12:17:57 claudio Exp $ */
/*
* Copyright (c) 2020 Claudio Jeker <claudio@openbsd.org>
json_do_bool("valid", r->flags & F_PREF_ELIGIBLE);
if (r->flags & F_PREF_BEST)
json_do_bool("best", 1);
+ if (r->flags & F_PREF_ECMP)
+ json_do_bool("ecmp", 1);
+ if (r->flags & F_PREF_AS_WIDE)
+ json_do_bool("as-wide", 1);
if (r->flags & F_PREF_INTERNAL)
json_do_printf("source", "%s", "internal");
else
json_do_uint("metric", r->med);
json_do_uint("localpref", r->local_pref);
json_do_uint("weight", r->weight);
+ json_do_int("dmetric", r->dmetric);
json_do_printf("last_update", "%s", fmt_timeframe(r->age));
json_do_int("last_update_sec", r->age);