From 716940576443004c2a6dd14276bc28b438a371e0 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Fri, 2 Oct 2015 10:34:11 -0700 Subject: [PATCH] pimd: Add code to get RP(G) Add code to figure out who the RP is for group G. Signed-off-by: Donald Sharp --- pimd/pim_rp.c | 14 ++++++++++++++ pimd/pim_rp.h | 3 +++ 2 files changed, 17 insertions(+) diff --git a/pimd/pim_rp.c b/pimd/pim_rp.c index 506b60eabb..eaafa46ae8 100644 --- a/pimd/pim_rp.c +++ b/pimd/pim_rp.c @@ -73,6 +73,20 @@ pim_rp_i_am_rp (struct in_addr group) return i_am_rp; } +/* + * RP(G) + * + * Return the RP that the Group belongs too. + */ +struct in_addr +pim_rp_g (struct in_addr group) +{ + /* + * For staticly configured RP, it is always the qpim_rp + */ + return(qpim_rp); +} + /* * Set the upstream IP address we want to talk to based upon * the rp configured and the source address diff --git a/pimd/pim_rp.h b/pimd/pim_rp.h index 4639e7cebf..3938e7251c 100644 --- a/pimd/pim_rp.h +++ b/pimd/pim_rp.h @@ -24,5 +24,8 @@ void pim_rp_check_rp (struct in_addr old, struct in_addr new); int pim_rp_i_am_rp (struct in_addr group); int pim_rp_set_upstream_addr (struct in_addr *up, struct in_addr source); +struct in_addr pim_rp_g (struct in_addr group); +#define I_am_RP(G) pim_rp_i_am_rp ((G)) +#define RP(G) pim_rp_g ((G)) #endif -- 2.39.5