summaryrefslogtreecommitdiffstats
path: root/pimd/pim_rp.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2015-09-30 14:41:18 +0200
committerDonald Sharp <sharpd@cumulusnetwroks.com>2016-05-26 02:38:34 +0200
commit8f5f5e91b6d2eedf13611567d3a1035c910d6894 (patch)
treed5020e950ba7791bb64e0a0ae3344f9f414055cb /pimd/pim_rp.c
parentpimd: Fix test_igmp_join code to handle thread_master * changes (diff)
downloadfrr-8f5f5e91b6d2eedf13611567d3a1035c910d6894.tar.xz
frr-8f5f5e91b6d2eedf13611567d3a1035c910d6894.zip
pimd: Receive and transmit (*,G) to the RP
Receive a (*,G) route and send it upstream to the RP. The RP at this time does not properly handle the route. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'pimd/pim_rp.c')
-rw-r--r--pimd/pim_rp.c49
1 files changed, 49 insertions, 0 deletions
diff --git a/pimd/pim_rp.c b/pimd/pim_rp.c
new file mode 100644
index 000000000..757c770c1
--- /dev/null
+++ b/pimd/pim_rp.c
@@ -0,0 +1,49 @@
+/*
+ * PIM for Quagga
+ * Copyright (C) 2015 Cumulus Networks, Inc.
+ * Donald Sharp
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; see the file COPYING; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ * MA 02110-1301 USA
+ */
+#include <zebra.h>
+
+#include "network.h"
+
+#include "pimd.h"
+#include "pim_rp.h"
+
+/*
+ * Set the upstream IP address we want to talk to based upon
+ * the rp configured and the source address
+ *
+ * If we have don't have a RP configured and the source address is *
+ * then return failure.
+ *
+ */
+int
+pim_rp_set_upstream_addr (struct in_addr *up, struct in_addr source)
+{
+ if ((qpim_rp.s_addr == 0) && (source.s_addr == 0xFFFFFFFF))
+ {
+ if (PIM_DEBUG_PIM_TRACE)
+ zlog_debug("%s: Received a (*,G) with no RP configured", __PRETTY_FUNCTION__);
+ return 0;
+ }
+
+ *up = (source.s_addr == 0xFFFFFFFF) ? qpim_rp : source;
+
+ return 1;
+}