summaryrefslogtreecommitdiffstats
path: root/pimd/pim_br.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetwroks.com>2016-07-23 06:35:35 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2016-12-22 02:26:03 +0100
commit65e1fcd766040fea4453effbbf09b31059d29e98 (patch)
treefc688cab0c1c9e1c099d5185bf754ef844d3a3f2 /pimd/pim_br.c
parentpimd: SwitchToSptDesired now uses struct prefix *sg. (diff)
downloadfrr-65e1fcd766040fea4453effbbf09b31059d29e98.tar.xz
frr-65e1fcd766040fea4453effbbf09b31059d29e98.zip
pimd: pim_br switch to struct prefix
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'pimd/pim_br.c')
-rw-r--r--pimd/pim_br.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/pimd/pim_br.c b/pimd/pim_br.c
index 121a45fd1..ceee40e71 100644
--- a/pimd/pim_br.c
+++ b/pimd/pim_br.c
@@ -30,8 +30,7 @@
#include "linklist.h"
struct pim_br {
- struct in_addr source;
- struct in_addr group;
+ struct prefix sg;
struct in_addr pmbr;
};
@@ -40,14 +39,14 @@ struct in_addr pim_br_unknown = { .s_addr = 0 };
static struct list *pim_br_list = NULL;
struct in_addr
-pim_br_get_pmbr (struct in_addr source, struct in_addr group)
+pim_br_get_pmbr (struct prefix *sg)
{
struct listnode *node;
struct pim_br *pim_br;
for (ALL_LIST_ELEMENTS_RO (pim_br_list, node, pim_br)) {
- if (source.s_addr == pim_br->source.s_addr &&
- group.s_addr == pim_br->group.s_addr)
+ if (sg->u.sg.src.s_addr == pim_br->sg.u.sg.src.s_addr &&
+ sg->u.sg.grp.s_addr == pim_br->sg.u.sg.grp.s_addr)
return pim_br->pmbr;
}
@@ -55,14 +54,14 @@ pim_br_get_pmbr (struct in_addr source, struct in_addr group)
}
void
-pim_br_set_pmbr (struct in_addr source, struct in_addr group, struct in_addr br)
+pim_br_set_pmbr (struct prefix *sg, struct in_addr br)
{
struct listnode *node, *next;
struct pim_br *pim_br;
for (ALL_LIST_ELEMENTS (pim_br_list, node, next, pim_br)) {
- if (source.s_addr == pim_br->source.s_addr &&
- group.s_addr == pim_br->group.s_addr)
+ if (sg->u.sg.src.s_addr == pim_br->sg.u.sg.src.s_addr &&
+ sg->u.sg.grp.s_addr == pim_br->sg.u.sg.grp.s_addr)
break;
}
@@ -73,8 +72,7 @@ pim_br_set_pmbr (struct in_addr source, struct in_addr group, struct in_addr br)
return;
}
- pim_br->source = source;
- pim_br->group = group;
+ pim_br->sg = *sg;
listnode_add(pim_br_list, pim_br);
}
@@ -86,14 +84,14 @@ pim_br_set_pmbr (struct in_addr source, struct in_addr group, struct in_addr br)
* Remove the (S,G) from the stored values
*/
void
-pim_br_clear_pmbr (struct in_addr source, struct in_addr group)
+pim_br_clear_pmbr (struct prefix *sg)
{
struct listnode *node, *next;
struct pim_br *pim_br;
for (ALL_LIST_ELEMENTS (pim_br_list, node, next, pim_br)) {
- if (source.s_addr == pim_br->source.s_addr &&
- group.s_addr == pim_br->group.s_addr)
+ if (sg->u.sg.src.s_addr == pim_br->sg.u.sg.src.s_addr &&
+ sg->u.sg.grp.s_addr == pim_br->sg.u.sg.grp.s_addr)
break;
}