summaryrefslogtreecommitdiffstats
path: root/pimd/pim_static.c
diff options
context:
space:
mode:
Diffstat (limited to 'pimd/pim_static.c')
-rw-r--r--pimd/pim_static.c32
1 files changed, 14 insertions, 18 deletions
diff --git a/pimd/pim_static.c b/pimd/pim_static.c
index 5b3894f1f..981335ea1 100644
--- a/pimd/pim_static.c
+++ b/pimd/pim_static.c
@@ -74,11 +74,10 @@ static struct static_route *static_route_new(unsigned int iif, unsigned int oif,
}
-int pim_static_add(struct interface *iif, struct interface *oif,
- struct in_addr group, struct in_addr source)
+int pim_static_add(struct pim_instance *pim, struct interface *iif,
+ struct interface *oif, struct in_addr group,
+ struct in_addr source)
{
- struct pim_instance *pim;
- struct pim_interface *pim_ifp;
struct listnode *node = NULL;
struct static_route *s_route = NULL;
struct static_route *original_s_route = NULL;
@@ -107,10 +106,7 @@ int pim_static_add(struct interface *iif, struct interface *oif,
return -3;
}
- pim_ifp = iif->info;
- pim = pim_ifp->pim;
-
- for (ALL_LIST_ELEMENTS_RO(qpim_static_route_list, node, s_route)) {
+ for (ALL_LIST_ELEMENTS_RO(pim->static_routes, node, s_route)) {
if (s_route->group.s_addr == group.s_addr
&& s_route->source.s_addr == source.s_addr) {
if (s_route->iif == iif_index
@@ -189,7 +185,7 @@ int pim_static_add(struct interface *iif, struct interface *oif,
* match */
if (!node) {
s_route = static_route_new(iif_index, oif_index, group, source);
- listnode_add(qpim_static_route_list, s_route);
+ listnode_add(pim->static_routes, s_route);
}
s_route->c_oil.pim = pim;
@@ -213,7 +209,7 @@ int pim_static_add(struct interface *iif, struct interface *oif,
} else {
/* we never stored off a copy, so it must have been a
* fresh new route */
- listnode_delete(qpim_static_route_list, s_route);
+ listnode_delete(pim->static_routes, s_route);
pim_static_route_free(s_route);
}
@@ -245,8 +241,9 @@ int pim_static_add(struct interface *iif, struct interface *oif,
return 0;
}
-int pim_static_del(struct interface *iif, struct interface *oif,
- struct in_addr group, struct in_addr source)
+int pim_static_del(struct pim_instance *pim, struct interface *iif,
+ struct interface *oif, struct in_addr group,
+ struct in_addr source)
{
struct listnode *node = NULL;
struct listnode *nextnode = NULL;
@@ -263,8 +260,7 @@ int pim_static_del(struct interface *iif, struct interface *oif,
return -2;
}
- for (ALL_LIST_ELEMENTS(qpim_static_route_list, node, nextnode,
- s_route)) {
+ for (ALL_LIST_ELEMENTS(pim->static_routes, node, nextnode, s_route)) {
if (s_route->iif == iif_index
&& s_route->group.s_addr == group.s_addr
&& s_route->source.s_addr == source.s_addr
@@ -303,8 +299,7 @@ int pim_static_del(struct interface *iif, struct interface *oif,
s_route->c_oil.oif_creation[oif_index] = 0;
if (s_route->c_oil.oil_ref_count <= 0) {
- listnode_delete(qpim_static_route_list,
- s_route);
+ listnode_delete(pim->static_routes, s_route);
pim_static_route_free(s_route);
}
@@ -342,7 +337,8 @@ int pim_static_del(struct interface *iif, struct interface *oif,
return 0;
}
-int pim_static_write_mroute(struct vty *vty, struct interface *ifp)
+int pim_static_write_mroute(struct vty *vty, struct pim_instance *pim,
+ struct interface *ifp)
{
struct pim_interface *pim_ifp = ifp->info;
struct listnode *node;
@@ -354,7 +350,7 @@ int pim_static_write_mroute(struct vty *vty, struct interface *ifp)
if (!pim_ifp)
return 0;
- for (ALL_LIST_ELEMENTS_RO(qpim_static_route_list, node, sroute)) {
+ for (ALL_LIST_ELEMENTS_RO(pim->static_routes, node, sroute)) {
pim_inet4_dump("<ifaddr?>", sroute->group, gbuf, sizeof(gbuf));
pim_inet4_dump("<ifaddr?>", sroute->source, sbuf, sizeof(sbuf));
if (sroute->iif == pim_ifp->mroute_vif_index) {