From: Donald Sharp Date: Mon, 31 Jul 2017 14:41:12 +0000 (-0400) Subject: pimd: Rename pim_ifp->pim_ifchannel_list X-Git-Tag: frr-4.0-dev~468^2~7 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=86b473a7e810bc8cfb37fbf9d733048e83c59fbd;p=mirror%2Ffrr.git pimd: Rename pim_ifp->pim_ifchannel_list Remove the redundant information in pim_ifp->pim_ifchannel_list just call it pim_ifp->ifchannel_list Signed-off-by: Donald Sharp --- diff --git a/pimd/pim_cmd.c b/pimd/pim_cmd.c index 1519e7a116..6dfd9c2d60 100644 --- a/pimd/pim_cmd.c +++ b/pimd/pim_cmd.c @@ -228,7 +228,7 @@ static void pim_show_assert(struct pim_instance *pim, struct vty *vty) if (!pim_ifp) continue; - for (ALL_LIST_ELEMENTS_RO(pim_ifp->pim_ifchannel_list, + for (ALL_LIST_ELEMENTS_RO(pim_ifp->ifchannel_list, ch_node, ch)) { pim_show_assert_helper(vty, pim_ifp, ch, now); } /* scan interface channels */ @@ -282,7 +282,7 @@ static void pim_show_assert_internal(struct pim_instance *pim, struct vty *vty) if (!pim_ifp) continue; - for (ALL_LIST_ELEMENTS_RO(pim_ifp->pim_ifchannel_list, + for (ALL_LIST_ELEMENTS_RO(pim_ifp->ifchannel_list, ch_node, ch)) { pim_show_assert_internal_helper(vty, pim_ifp, ch); } /* scan interface channels */ @@ -332,7 +332,7 @@ static void pim_show_assert_metric(struct pim_instance *pim, struct vty *vty) if (!pim_ifp) continue; - for (ALL_LIST_ELEMENTS_RO(pim_ifp->pim_ifchannel_list, + for (ALL_LIST_ELEMENTS_RO(pim_ifp->ifchannel_list, ch_node, ch)) { pim_show_assert_metric_helper(vty, pim_ifp, ch); } /* scan interface channels */ @@ -396,7 +396,7 @@ static void pim_show_assert_winner_metric(struct pim_instance *pim, if (!pim_ifp) continue; - for (ALL_LIST_ELEMENTS_RO(pim_ifp->pim_ifchannel_list, + for (ALL_LIST_ELEMENTS_RO(pim_ifp->ifchannel_list, ch_node, ch)) { pim_show_assert_winner_metric_helper(vty, pim_ifp, ch); } /* scan interface channels */ @@ -487,7 +487,7 @@ static void pim_show_membership(struct pim_instance *pim, struct vty *vty, if (!pim_ifp) continue; - for (ALL_LIST_ELEMENTS_RO(pim_ifp->pim_ifchannel_list, + for (ALL_LIST_ELEMENTS_RO(pim_ifp->ifchannel_list, ch_node, ch)) { pim_show_membership_helper(vty, pim_ifp, ch, json); } /* scan interface channels */ @@ -1364,7 +1364,7 @@ static void pim_show_interfaces(struct pim_instance *pim, struct vty *vty, continue; pim_nbrs = pim_ifp->pim_neighbor_list->count; - pim_ifchannels = pim_ifp->pim_ifchannel_list->count; + pim_ifchannels = pim_ifp->ifchannel_list->count; fhr = 0; for (ALL_LIST_ELEMENTS_RO(pim->upstream_list, upnode, up)) @@ -1704,7 +1704,7 @@ static void pim_show_join(struct pim_instance *pim, struct vty *vty, u_char uj) if (!pim_ifp) continue; - for (ALL_LIST_ELEMENTS_RO(pim_ifp->pim_ifchannel_list, + for (ALL_LIST_ELEMENTS_RO(pim_ifp->ifchannel_list, ch_node, ch)) { pim_show_join_helper(vty, pim_ifp, ch, json, now, uj); @@ -2534,7 +2534,7 @@ static void pim_show_join_desired(struct pim_instance *pim, struct vty *vty, if (!pim_ifp) continue; - for (ALL_LIST_ELEMENTS_RO(pim_ifp->pim_ifchannel_list, + for (ALL_LIST_ELEMENTS_RO(pim_ifp->ifchannel_list, ch_node, ch)) { /* scan all interfaces */ pim_show_join_desired_helper(pim, vty, diff --git a/pimd/pim_iface.c b/pimd/pim_iface.c index 24679a2461..2fabf37a5e 100644 --- a/pimd/pim_iface.c +++ b/pimd/pim_iface.c @@ -81,9 +81,8 @@ static void *if_list_clean(struct pim_interface *pim_ifp) if (pim_ifp->upstream_switch_list) list_delete(pim_ifp->upstream_switch_list); - if (pim_ifp->pim_ifchannel_list) { - list_delete(pim_ifp->pim_ifchannel_list); - } + if (pim_ifp->ifchannel_list) + list_delete(pim_ifp->ifchannel_list); if (pim_ifp->pim_ifchannel_hash) hash_free(pim_ifp->pim_ifchannel_hash); @@ -139,7 +138,7 @@ struct pim_interface *pim_if_new(struct interface *ifp, int igmp, int pim) pim_ifp->igmp_socket_list = NULL; pim_ifp->pim_neighbor_list = NULL; pim_ifp->upstream_switch_list = NULL; - pim_ifp->pim_ifchannel_list = NULL; + pim_ifp->ifchannel_list = NULL; pim_ifp->pim_ifchannel_hash = NULL; pim_ifp->pim_generation_id = 0; @@ -169,14 +168,14 @@ struct pim_interface *pim_if_new(struct interface *ifp, int igmp, int pim) } /* list of struct pim_ifchannel */ - pim_ifp->pim_ifchannel_list = list_new(); - if (!pim_ifp->pim_ifchannel_list) { + pim_ifp->ifchannel_list = list_new(); + if (!pim_ifp->ifchannel_list) { zlog_err("%s %s: failure: pim_ifchannel_list=list_new()", __FILE__, __PRETTY_FUNCTION__); return if_list_clean(pim_ifp); } - pim_ifp->pim_ifchannel_list->del = (void (*)(void *))pim_ifchannel_free; - pim_ifp->pim_ifchannel_list->cmp = + pim_ifp->ifchannel_list->del = (void (*)(void *))pim_ifchannel_free; + pim_ifp->ifchannel_list->cmp = (int (*)(void *, void *))pim_ifchannel_compare; snprintf(hash_name, 64, "Pim Interface %s hash", @@ -216,7 +215,7 @@ void pim_if_delete(struct interface *ifp) list_delete(pim_ifp->igmp_socket_list); list_delete(pim_ifp->pim_neighbor_list); list_delete(pim_ifp->upstream_switch_list); - list_delete(pim_ifp->pim_ifchannel_list); + list_delete(pim_ifp->ifchannel_list); hash_free(pim_ifp->pim_ifchannel_hash); @@ -235,7 +234,7 @@ void pim_if_update_could_assert(struct interface *ifp) pim_ifp = ifp->info; zassert(pim_ifp); - for (ALL_LIST_ELEMENTS(pim_ifp->pim_ifchannel_list, node, next_node, + for (ALL_LIST_ELEMENTS(pim_ifp->ifchannel_list, node, next_node, ch)) { pim_ifchannel_update_could_assert(ch); } @@ -251,7 +250,7 @@ static void pim_if_update_my_assert_metric(struct interface *ifp) pim_ifp = ifp->info; zassert(pim_ifp); - for (ALL_LIST_ELEMENTS(pim_ifp->pim_ifchannel_list, node, next_node, + for (ALL_LIST_ELEMENTS(pim_ifp->ifchannel_list, node, next_node, ch)) { pim_ifchannel_update_my_assert_metric(ch); } @@ -1480,7 +1479,7 @@ void pim_if_assert_on_neighbor_down(struct interface *ifp, pim_ifp = ifp->info; zassert(pim_ifp); - for (ALL_LIST_ELEMENTS(pim_ifp->pim_ifchannel_list, node, next_node, + for (ALL_LIST_ELEMENTS(pim_ifp->ifchannel_list, node, next_node, ch)) { /* Is (S,G,I) assert loser ? */ if (ch->ifassert_state != PIM_IFASSERT_I_AM_LOSER) @@ -1499,13 +1498,13 @@ void pim_if_update_join_desired(struct pim_interface *pim_ifp) struct pim_ifchannel *ch; /* clear off flag from interface's upstreams */ - for (ALL_LIST_ELEMENTS_RO(pim_ifp->pim_ifchannel_list, ch_node, ch)) { + for (ALL_LIST_ELEMENTS_RO(pim_ifp->ifchannel_list, ch_node, ch)) { PIM_UPSTREAM_FLAG_UNSET_DR_JOIN_DESIRED_UPDATED( ch->upstream->flags); } /* scan per-interface (S,G,I) state on this I interface */ - for (ALL_LIST_ELEMENTS_RO(pim_ifp->pim_ifchannel_list, ch_node, ch)) { + for (ALL_LIST_ELEMENTS_RO(pim_ifp->ifchannel_list, ch_node, ch)) { struct pim_upstream *up = ch->upstream; if (PIM_UPSTREAM_FLAG_TEST_DR_JOIN_DESIRED_UPDATED(up->flags)) @@ -1528,7 +1527,7 @@ void pim_if_update_assert_tracking_desired(struct interface *ifp) if (!pim_ifp) return; - for (ALL_LIST_ELEMENTS(pim_ifp->pim_ifchannel_list, node, next_node, + for (ALL_LIST_ELEMENTS(pim_ifp->ifchannel_list, node, next_node, ch)) { pim_ifchannel_update_assert_tracking_desired(ch); } diff --git a/pimd/pim_iface.h b/pimd/pim_iface.h index 963d41fc3e..7739e3af2b 100644 --- a/pimd/pim_iface.h +++ b/pimd/pim_iface.h @@ -106,7 +106,7 @@ struct pim_interface { uint16_t pim_override_interval_msec; /* config */ struct list *pim_neighbor_list; /* list of struct pim_neighbor */ struct list *upstream_switch_list; - struct list *pim_ifchannel_list; /* list of struct pim_ifchannel */ + struct list *ifchannel_list; struct hash *pim_ifchannel_hash; /* neighbors without lan_delay */ diff --git a/pimd/pim_ifchannel.c b/pimd/pim_ifchannel.c index 532f7ee8a2..750dc7f5e9 100644 --- a/pimd/pim_ifchannel.c +++ b/pimd/pim_ifchannel.c @@ -111,7 +111,7 @@ static void pim_ifchannel_find_new_children(struct pim_ifchannel *ch) && (ch->sg.grp.s_addr == INADDR_ANY)) return; - for (ALL_LIST_ELEMENTS_RO(pim_ifp->pim_ifchannel_list, ch_node, + for (ALL_LIST_ELEMENTS_RO(pim_ifp->ifchannel_list, ch_node, child)) { if ((ch->sg.grp.s_addr != INADDR_ANY) && (child->sg.grp.s_addr == ch->sg.grp.s_addr) @@ -194,7 +194,7 @@ void pim_ifchannel_delete(struct pim_ifchannel *ch) into pim_ifchannel_free() because the later is called by list_delete_all_node() */ - listnode_delete(pim_ifp->pim_ifchannel_list, ch); + listnode_delete(pim_ifp->ifchannel_list, ch); hash_release(pim_ifp->pim_ifchannel_hash, ch); if (PIM_DEBUG_PIM_TRACE) @@ -215,7 +215,7 @@ void pim_ifchannel_delete_all(struct interface *ifp) if (!pim_ifp) return; - for (ALL_LIST_ELEMENTS(pim_ifp->pim_ifchannel_list, ifchannel_node, + for (ALL_LIST_ELEMENTS(pim_ifp->ifchannel_list, ifchannel_node, ifchannel_nextnode, ifchannel)) { pim_ifchannel_delete(ifchannel); } @@ -461,9 +461,8 @@ void pim_ifchannel_membership_clear(struct interface *ifp) pim_ifp = ifp->info; zassert(pim_ifp); - for (ALL_LIST_ELEMENTS_RO(pim_ifp->pim_ifchannel_list, ch_node, ch)) { + for (ALL_LIST_ELEMENTS_RO(pim_ifp->ifchannel_list, ch_node, ch)) ifmembership_set(ch, PIM_IFMEMBERSHIP_NOINFO); - } } void pim_ifchannel_delete_on_noinfo(struct interface *ifp) @@ -476,7 +475,7 @@ void pim_ifchannel_delete_on_noinfo(struct interface *ifp) pim_ifp = ifp->info; zassert(pim_ifp); - for (ALL_LIST_ELEMENTS(pim_ifp->pim_ifchannel_list, node, next_node, + for (ALL_LIST_ELEMENTS(pim_ifp->ifchannel_list, node, next_node, ch)) { delete_on_noinfo(ch); } @@ -554,7 +553,7 @@ struct pim_ifchannel *pim_ifchannel_add(struct interface *ifp, ch->ifjoin_creation = 0; /* Attach to list */ - listnode_add_sort(pim_ifp->pim_ifchannel_list, ch); + listnode_add_sort(pim_ifp->ifchannel_list, ch); ch = hash_get(pim_ifp->pim_ifchannel_hash, ch, hash_alloc_intern); up = pim_upstream_add(pim_ifp->pim, sg, NULL, up_flags, @@ -573,7 +572,7 @@ struct pim_ifchannel *pim_ifchannel_add(struct interface *ifp, THREAD_OFF(ch->t_ifjoin_prune_pending_timer); THREAD_OFF(ch->t_ifassert_timer); - listnode_delete(pim_ifp->pim_ifchannel_list, ch); + listnode_delete(pim_ifp->ifchannel_list, ch); hash_release(pim_ifp->pim_ifchannel_hash, ch); XFREE(MTYPE_PIM_IFCHANNEL, ch); return NULL; @@ -1302,7 +1301,7 @@ void pim_ifchannel_scan_forward_start(struct interface *new_ifp) if (new_pim_ifp == loop_pim_ifp) continue; - for (ALL_LIST_ELEMENTS_RO(loop_pim_ifp->pim_ifchannel_list, + for (ALL_LIST_ELEMENTS_RO(loop_pim_ifp->ifchannel_list, ch_node, ch)) { if (ch->ifjoin_state == PIM_IFJOIN_JOIN) { struct pim_upstream *up = ch->upstream;