diff options
-rw-r--r-- | usr.sbin/bgpd/session.c | 7 | ||||
-rw-r--r-- | usr.sbin/bgpd/session.h | 8 |
2 files changed, 13 insertions, 2 deletions
diff --git a/usr.sbin/bgpd/session.c b/usr.sbin/bgpd/session.c index 077bed74238..37167c3b4ea 100644 --- a/usr.sbin/bgpd/session.c +++ b/usr.sbin/bgpd/session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: session.c,v 1.56 2004/01/03 20:22:07 henning Exp $ */ +/* $OpenBSD: session.c,v 1.57 2004/01/03 22:18:58 henning Exp $ */ /* * Copyright (c) 2003 Henning Brauer <henning@openbsd.org> @@ -838,6 +838,8 @@ session_open(struct peer *peer) buf_free(buf); bgp_fsm(peer, EVNT_CON_FATAL); } + + peer->stats.msg_send++; } void @@ -879,6 +881,7 @@ session_keepalive(struct peer *peer) } start_timer_keepalive(peer); + peer->stats.msg_send++; } void @@ -929,6 +932,7 @@ session_notification(struct peer *peer, u_int8_t errcode, u_int8_t subcode, buf_free(buf); bgp_fsm(peer, EVNT_CON_FATAL); } + peer->stats.msg_send++; } int @@ -1038,6 +1042,7 @@ session_dispatch_msg(struct pollfd *pfd, struct peer *peer) " %u", msgtype); } rpos += msglen; + peer->stats.msg_rcvd++; } if (rpos < av) { left = av - rpos; diff --git a/usr.sbin/bgpd/session.h b/usr.sbin/bgpd/session.h index 106add0eeff..d74f94c82ef 100644 --- a/usr.sbin/bgpd/session.h +++ b/usr.sbin/bgpd/session.h @@ -1,4 +1,4 @@ -/* $OpenBSD: session.h,v 1.5 2004/01/03 20:37:34 henning Exp $ */ +/* $OpenBSD: session.h,v 1.6 2004/01/03 22:18:58 henning Exp $ */ /* * Copyright (c) 2003 Henning Brauer <henning@openbsd.org> @@ -115,8 +115,14 @@ struct ctl_conn { TAILQ_HEAD(ctl_conns, ctl_conn) ctl_conns; +struct peer_stats { + u_int64_t msg_rcvd; + u_int64_t msg_send; +}; + struct peer { struct peer_config conf; + struct peer_stats stats; u_int32_t remote_bgpid; u_int16_t holdtime; enum session_state state; |