From 2c1c130e7b406ac9e3c93ff842328516110396b6 Mon Sep 17 00:00:00 2001 From: benno Date: Thu, 12 Jul 2018 21:45:37 +0000 Subject: [PATCH] store and print the rdomain of the interfaces we see. ok phessler@ henning@ --- usr.sbin/bgpctl/bgpctl.c | 9 +++++---- usr.sbin/bgpd/bgpd.h | 3 ++- usr.sbin/bgpd/kroute.c | 4 +++- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/usr.sbin/bgpctl/bgpctl.c b/usr.sbin/bgpctl/bgpctl.c index f8d4a5adcc9..ee3594b9133 100644 --- a/usr.sbin/bgpctl/bgpctl.c +++ b/usr.sbin/bgpctl/bgpctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bgpctl.c,v 1.204 2018/07/11 16:35:37 claudio Exp $ */ +/* $OpenBSD: bgpctl.c,v 1.205 2018/07/12 21:45:37 benno Exp $ */ /* * Copyright (c) 2003 Henning Brauer @@ -1140,7 +1140,7 @@ show_nexthop_msg(struct imsg *imsg) void show_interface_head(void) { - printf("%-15s%-15s%-15s%s\n", "Interface", "Nexthop state", "Flags", + printf("%-15s%-9s%-9s%-7s%s\n", "Interface", "rdomain", "Nexthop", "Flags", "Link state"); } @@ -1223,8 +1223,9 @@ show_interface_msg(struct imsg *imsg) case IMSG_CTL_SHOW_INTERFACE: k = imsg->data; printf("%-15s", k->ifname); - printf("%-15s", k->nh_reachable ? "ok" : "invalid"); - printf("%-15s", k->flags & IFF_UP ? "UP" : ""); + printf("%-9u", k->rdomain); + printf("%-9s", k->nh_reachable ? "ok" : "invalid"); + printf("%-7s", k->flags & IFF_UP ? "UP" : ""); if ((ifms_type = ift2ifm(k->if_type)) != 0) printf("%s, ", get_media_descr(ifms_type)); diff --git a/usr.sbin/bgpd/bgpd.h b/usr.sbin/bgpd/bgpd.h index c5a00e7b83f..5e6a4eaae26 100644 --- a/usr.sbin/bgpd/bgpd.h +++ b/usr.sbin/bgpd/bgpd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bgpd.h,v 1.324 2018/07/11 16:34:36 claudio Exp $ */ +/* $OpenBSD: bgpd.h,v 1.325 2018/07/12 21:45:37 benno Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer @@ -567,6 +567,7 @@ struct kroute_nexthop { struct kif { char ifname[IFNAMSIZ]; u_int64_t baudrate; + u_int rdomain; int flags; u_short ifindex; u_int8_t if_type; diff --git a/usr.sbin/bgpd/kroute.c b/usr.sbin/bgpd/kroute.c index ed5405db314..5907f0cef67 100644 --- a/usr.sbin/bgpd/kroute.c +++ b/usr.sbin/bgpd/kroute.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kroute.c,v 1.219 2018/07/11 14:08:46 benno Exp $ */ +/* $OpenBSD: kroute.c,v 1.220 2018/07/12 21:45:37 benno Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer @@ -2491,6 +2491,7 @@ if_change(u_short ifindex, int flags, struct if_data *ifd) kif->k.flags = flags; kif->k.link_state = ifd->ifi_link_state; kif->k.if_type = ifd->ifi_type; + kif->k.rdomain = ifd->ifi_rdomain; kif->k.baudrate = ifd->ifi_baudrate; send_imsg_session(IMSG_IFINFO, 0, &kif->k, sizeof(kif->k)); @@ -3057,6 +3058,7 @@ fetchifs(int ifindex) kif->k.flags = ifm.ifm_flags; kif->k.link_state = ifm.ifm_data.ifi_link_state; kif->k.if_type = ifm.ifm_data.ifi_type; + kif->k.rdomain = ifm.ifm_data.ifi_rdomain; kif->k.baudrate = ifm.ifm_data.ifi_baudrate; kif->k.nh_reachable = kif_validate(&kif->k); -- 2.20.1