summaryrefslogtreecommitdiff
path: root/usr.sbin/eigrpd/eigrpe.c
diff options
context:
space:
mode:
authorRenato Westphal <renato@cvs.openbsd.org>2015-12-13 18:55:54 +0000
committerRenato Westphal <renato@cvs.openbsd.org>2015-12-13 18:55:54 +0000
commit8973b60b6258d05daf3d1c82142278ff48c0bacc (patch)
tree1ded0466794dec884d627b973bc1572be423d240 /usr.sbin/eigrpd/eigrpe.c
parent129dac3561173374929e418c4918f05d90860a45 (diff)
Introduce new command to show traffic statistics.
Can be useful as a troubleshooting tool.
Diffstat (limited to 'usr.sbin/eigrpd/eigrpe.c')
-rw-r--r--usr.sbin/eigrpd/eigrpe.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/usr.sbin/eigrpd/eigrpe.c b/usr.sbin/eigrpd/eigrpe.c
index f40dcd65267..df9f1d61536 100644
--- a/usr.sbin/eigrpd/eigrpe.c
+++ b/usr.sbin/eigrpd/eigrpe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: eigrpe.c,v 1.9 2015/12/05 15:49:01 claudio Exp $ */
+/* $OpenBSD: eigrpe.c,v 1.10 2015/12/13 18:55:53 renato Exp $ */
/*
* Copyright (c) 2015 Renato Westphal <renato@openbsd.org>
@@ -690,3 +690,20 @@ eigrpe_nbr_ctl(struct ctl_conn *c)
imsg_compose_event(&c->iev, IMSG_CTL_END, 0, 0, -1, NULL, 0);
}
+
+void
+eigrpe_stats_ctl(struct ctl_conn *c)
+{
+ struct eigrp *eigrp;
+ struct ctl_stats sctl;
+
+ TAILQ_FOREACH(eigrp, &econf->instances, entry) {
+ sctl.af = eigrp->af;
+ sctl.as = eigrp->as;
+ memcpy(&sctl.stats, &eigrp->stats, sizeof(sctl.stats));
+ imsg_compose_event(&c->iev, IMSG_CTL_SHOW_STATS, 0,
+ 0, -1, &sctl, sizeof(struct ctl_stats));
+ }
+
+ imsg_compose_event(&c->iev, IMSG_CTL_END, 0, 0, -1, NULL, 0);
+}