summaryrefslogtreecommitdiff
path: root/usr.sbin/ripd/ripe.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/ripd/ripe.c')
-rw-r--r--usr.sbin/ripd/ripe.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/usr.sbin/ripd/ripe.c b/usr.sbin/ripd/ripe.c
index 93c594aced6..7b30822b3b7 100644
--- a/usr.sbin/ripd/ripe.c
+++ b/usr.sbin/ripd/ripe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ripe.c,v 1.7 2008/11/23 13:09:31 michele Exp $ */
+/* $OpenBSD: ripe.c,v 1.8 2008/12/17 14:19:39 michele Exp $ */
/*
* Copyright (c) 2006 Michele Marchetto <mydecay@openbeer.it>
@@ -525,3 +525,23 @@ ripe_nbr_ctl(struct ctl_conn *c)
imsg_compose(&c->ibuf, IMSG_CTL_END, 0, 0, NULL, 0);
}
+
+void
+ripe_demote_iface(struct iface *iface, int active)
+{
+ struct demote_msg dmsg;
+
+ if (ripd_process != PROC_RIP_ENGINE ||
+ iface->demote_group[0] == '\0')
+ return;
+
+ bzero(&dmsg, sizeof(dmsg));
+ strlcpy(dmsg.demote_group, iface->demote_group,
+ sizeof(dmsg.demote_group));
+ if (active)
+ dmsg.level = -1;
+ else
+ dmsg.level = 1;
+
+ ripe_imsg_compose_parent(IMSG_DEMOTE, 0, &dmsg, sizeof(dmsg));
+}