summaryrefslogtreecommitdiffstats
path: root/pimd/pim_rpf.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2017-05-19 00:51:31 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2017-07-24 19:51:35 +0200
commitc2cf4b0230faec3e0c478cb7ab14030a6ffe0593 (patch)
treeecd191d414d3ad8101f3537af7d88d835c417f02 /pimd/pim_rpf.c
parentpimd: Set c_oil->pim for static routes (diff)
downloadfrr-c2cf4b0230faec3e0c478cb7ab14030a6ffe0593.tar.xz
frr-c2cf4b0230faec3e0c478cb7ab14030a6ffe0593.zip
pimd: Refactor code to be in better spots
1) Create pim_instance.[ch] to allow us to handle the instance information there 2) Refactor some pim_rpf_ and some pim_rp commands into appropriate files and appropriate includes. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'pimd/pim_rpf.c')
-rw-r--r--pimd/pim_rpf.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/pimd/pim_rpf.c b/pimd/pim_rpf.c
index 4c77dd4a4..e53c5392c 100644
--- a/pimd/pim_rpf.c
+++ b/pimd/pim_rpf.c
@@ -24,6 +24,7 @@
#include "log.h"
#include "prefix.h"
#include "memory.h"
+#include "jhash.h"
#include "pimd.h"
#include "pim_rpf.h"
@@ -396,3 +397,20 @@ int pim_rpf_is_same(struct pim_rpf *rpf1, struct pim_rpf *rpf2)
return 0;
}
+
+unsigned int pim_rpf_hash_key(void *arg)
+{
+ struct pim_nexthop_cache *r = (struct pim_nexthop_cache *)arg;
+
+ return jhash_1word(r->rpf.rpf_addr.u.prefix4.s_addr, 0);
+}
+
+int pim_rpf_equal(const void *arg1, const void *arg2)
+{
+ const struct pim_nexthop_cache *r1 =
+ (const struct pim_nexthop_cache *)arg1;
+ const struct pim_nexthop_cache *r2 =
+ (const struct pim_nexthop_cache *)arg2;
+
+ return prefix_same(&r1->rpf.rpf_addr, &r2->rpf.rpf_addr);
+}