-/* $OpenBSD: bgpctl.h,v 1.17 2022/10/17 12:01:19 claudio Exp $ */
+/* $OpenBSD: bgpctl.h,v 1.18 2022/11/09 14:20:11 claudio Exp $ */
/*
* Copyright (c) 2019 Claudio Jeker <claudio@openbsd.org>
const char *fmt_large_community(uint32_t, uint32_t, uint32_t);
const char *fmt_ext_community(uint8_t *);
const char *fmt_set_type(struct ctl_show_set *);
+
+#define MPLS_LABEL_OFFSET 12
-/* $OpenBSD: output.c,v 1.31 2022/11/07 11:33:24 mbuhl Exp $ */
+/* $OpenBSD: output.c,v 1.32 2022/11/09 14:20:11 claudio Exp $ */
/*
* Copyright (c) 2003 Henning Brauer <henning@openbsd.org>
printf("link#%u", kf->ifindex);
else
printf("%s", log_addr(&kf->nexthop));
+ if (kf->flags & F_MPLS)
+ printf(" mpls %d", ntohl(kf->mplslabel) >> MPLS_LABEL_OFFSET);
printf("\n");
}
-/* $OpenBSD: output_json.c,v 1.25 2022/11/07 11:33:24 mbuhl Exp $ */
+/* $OpenBSD: output_json.c,v 1.26 2022/11/09 14:20:11 claudio Exp $ */
/*
* Copyright (c) 2020 Claudio Jeker <claudio@openbsd.org>
else
json_do_printf("nexthop", "%s", log_addr(&kf->nexthop));
+ if (kf->flags & F_MPLS) {
+ json_do_array("mplslabel");
+ json_do_uint("mplslabel",
+ ntohl(kf->mplslabel) >> MPLS_LABEL_OFFSET);
+ json_do_end();
+ }
json_do_end();
}