print "depend on" information when available in "ospfctl sh int" output.

ok remi@
This commit is contained in:
dlg 2020-11-02 00:30:56 +00:00
parent e153091c39
commit 27198fece9
3 changed files with 13 additions and 3 deletions

View File

@ -170,10 +170,15 @@ show_interface(struct ctl_iface *iface, int detail)
printf(" Router ID %s, network type %s, cost: %d\n",
inet_ntoa(iface->rtr_id),
if_type_name(iface->type), iface->metric);
if (iface->dependon[0] != '\0') {
printf(" Depends on %s, %s\n", iface->dependon,
iface->depend_ok ? "up" : "down");
}
printf(" Transmit delay is %d sec(s), state %s, priority %d\n",
iface->transmit_delay, if_state_name(iface->state),
iface->priority);
printf(" Designated Router (ID) %s, ", inet_ntoa(iface->dr_id));
printf(" Designated Router (ID) %s, ",
inet_ntoa(iface->dr_id));
printf("interface address %s\n", inet_ntoa(iface->dr_addr));
printf(" Backup Designated Router (ID) %s, ",
inet_ntoa(iface->bdr_id));

View File

@ -1,4 +1,4 @@
/* $OpenBSD: interface.c,v 1.83 2019/06/28 13:32:49 deraadt Exp $ */
/* $OpenBSD: interface.c,v 1.84 2020/11/02 00:30:56 dlg Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@ -633,6 +633,9 @@ if_to_ctl(struct iface *iface)
ictl.auth_type = iface->auth_type;
ictl.auth_keyid = iface->auth_keyid;
memcpy(ictl.dependon, iface->dependon, sizeof(ictl.dependon));
ictl.depend_ok = iface->depend_ok;
gettimeofday(&now, NULL);
if (evtimer_pending(&iface->hello_timer, &tv)) {
timersub(&tv, &now, &res);

View File

@ -1,4 +1,4 @@
/* $OpenBSD: ospfd.h,v 1.106 2020/01/21 20:38:52 remi Exp $ */
/* $OpenBSD: ospfd.h,v 1.107 2020/11/02 00:30:56 dlg Exp $ */
/*
* Copyright (c) 2004 Esben Norby <norby@openbsd.org>
@ -485,6 +485,8 @@ struct ctl_iface {
u_int8_t passive;
enum auth_type auth_type;
u_int8_t auth_keyid;
char dependon[IF_NAMESIZE];
int depend_ok;
};
struct ctl_nbr {