diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2024-01-11 13:08:40 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2024-01-11 13:08:40 +0000 |
commit | 57105505bbad5c46d1dd73df0b83ed182e186318 (patch) | |
tree | 24693ed4081c977ba5578001d9366b4497368741 /usr.sbin/bgpd | |
parent | b7edebdc786f107dcc4ce8faeb58c0e855e034bf (diff) |
Export the rtr session state as string.
OK tb@
Diffstat (limited to 'usr.sbin/bgpd')
-rw-r--r-- | usr.sbin/bgpd/bgpd.h | 3 | ||||
-rw-r--r-- | usr.sbin/bgpd/rtr_proto.c | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/bgpd/bgpd.h b/usr.sbin/bgpd/bgpd.h index 0c05c831032..a9792097894 100644 --- a/usr.sbin/bgpd/bgpd.h +++ b/usr.sbin/bgpd/bgpd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bgpd.h,v 1.480 2024/01/10 13:31:09 claudio Exp $ */ +/* $OpenBSD: bgpd.h,v 1.481 2024/01/11 13:08:39 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -562,6 +562,7 @@ struct rtr_config { struct ctl_show_rtr { char descr[PEER_DESCR_LEN]; + char state[PEER_DESCR_LEN]; struct bgpd_addr remote_addr; struct bgpd_addr local_addr; uint32_t serial; diff --git a/usr.sbin/bgpd/rtr_proto.c b/usr.sbin/bgpd/rtr_proto.c index 2d9e9465d21..de813fb0bd0 100644 --- a/usr.sbin/bgpd/rtr_proto.c +++ b/usr.sbin/bgpd/rtr_proto.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtr_proto.c,v 1.29 2024/01/11 11:43:07 claudio Exp $ */ +/* $OpenBSD: rtr_proto.c,v 1.30 2024/01/11 13:08:39 claudio Exp $ */ /* * Copyright (c) 2020 Claudio Jeker <claudio@openbsd.org> @@ -1509,6 +1509,7 @@ rtr_show(struct rtr_session *rs, pid_t pid) msg.session_id = rs->session_id; msg.last_sent_error = rs->last_sent_error; msg.last_recv_error = rs->last_recv_error; + strlcpy(msg.state, rtr_statenames[rs->state], sizeof(msg.state)); strlcpy(msg.last_sent_msg, rs->last_sent_msg, sizeof(msg.last_sent_msg)); strlcpy(msg.last_recv_msg, rs->last_recv_msg, |