diff options
author | Sai Gomathi <nsaigomathi@vmware.com> | 2021-12-03 08:05:02 +0100 |
---|---|---|
committer | Sai Gomathi <nsaigomathi@vmware.com> | 2021-12-03 08:12:58 +0100 |
commit | ea7d74d702975def719a574f0b58d642abeef974 (patch) | |
tree | bf25b70f91f5e75e0fadb3de80eeaaaf6228a798 /pimd/pim_cmd.c | |
parent | Merge pull request #10110 from idryzhov/if-yang-remove-vrf (diff) | |
download | frr-ea7d74d702975def719a574f0b58d642abeef974.tar.xz frr-ea7d74d702975def719a574f0b58d642abeef974.zip |
pimd: Modifying members of pim_interface to accommodate IPv6 changes
Modifying the members of pim_interface which are to be used
for both IPv4 and IPv6 to common names(for both MLD and IGMP).
Issue: #10023
Co-authored-by: Mobashshera Rasool <mrasool@vmware.com>
Signed-off-by: Sai Gomathi <nsaigomathi@vmware.com>
Diffstat (limited to 'pimd/pim_cmd.c')
-rw-r--r-- | pimd/pim_cmd.c | 61 |
1 files changed, 27 insertions, 34 deletions
diff --git a/pimd/pim_cmd.c b/pimd/pim_cmd.c index 501d69dbf..81b3ab297 100644 --- a/pimd/pim_cmd.c +++ b/pimd/pim_cmd.c @@ -508,7 +508,7 @@ static void igmp_show_interfaces(struct pim_instance *pim, struct vty *vty, if (!pim_ifp) continue; - for (ALL_LIST_ELEMENTS_RO(pim_ifp->igmp_socket_list, sock_node, + for (ALL_LIST_ELEMENTS_RO(pim_ifp->socket_list, sock_node, igmp)) { char uptime[10]; char query_hhmmss[10]; @@ -525,7 +525,7 @@ static void igmp_show_interfaces(struct pim_instance *pim, struct vty *vty, json_object_string_add(json_row, "upTime", uptime); json_object_int_add(json_row, "version", - pim_ifp->igmp_version); + pim_ifp->version); if (igmp->t_igmp_query_timer) { json_object_boolean_true_add(json_row, @@ -555,7 +555,7 @@ static void igmp_show_interfaces(struct pim_instance *pim, struct vty *vty, : "down", inet_ntop(AF_INET, &igmp->ifaddr, buf, sizeof(buf)), - pim_ifp->igmp_version, + pim_ifp->version, igmp->t_igmp_query_timer ? "local" : "other", &igmp->querier_addr, query_hhmmss, @@ -610,7 +610,7 @@ static void igmp_show_interfaces_single(struct pim_instance *pim, if (strcmp(ifname, "detail") && strcmp(ifname, ifp->name)) continue; - for (ALL_LIST_ELEMENTS_RO(pim_ifp->igmp_socket_list, sock_node, + for (ALL_LIST_ELEMENTS_RO(pim_ifp->socket_list, sock_node, igmp)) { found_ifname = 1; pim_time_uptime(uptime, sizeof(uptime), @@ -625,35 +625,33 @@ static void igmp_show_interfaces_single(struct pim_instance *pim, gmi_msec = PIM_IGMP_GMI_MSEC( igmp->querier_robustness_variable, igmp->querier_query_interval, - pim_ifp->igmp_query_max_response_time_dsec); + pim_ifp->query_max_response_time_dsec); - sqi = PIM_IGMP_SQI( - pim_ifp->igmp_default_query_interval); + sqi = PIM_IGMP_SQI(pim_ifp->default_query_interval); oqpi_msec = PIM_IGMP_OQPI_MSEC( igmp->querier_robustness_variable, igmp->querier_query_interval, - pim_ifp->igmp_query_max_response_time_dsec); + pim_ifp->query_max_response_time_dsec); lmqt_msec = PIM_IGMP_LMQT_MSEC( - pim_ifp->igmp_specific_query_max_response_time_dsec, - pim_ifp->igmp_last_member_query_count); + pim_ifp->specific_query_max_response_time_dsec, + pim_ifp->last_member_query_count); ohpi_msec = PIM_IGMP_OHPI_DSEC( igmp->querier_robustness_variable, igmp->querier_query_interval, - pim_ifp->igmp_query_max_response_time_dsec) + pim_ifp->query_max_response_time_dsec) * 100; - qri_msec = pim_ifp->igmp_query_max_response_time_dsec - * 100; + qri_msec = pim_ifp->query_max_response_time_dsec * 100; if (pim_ifp->pim_sock_fd >= 0) mloop = pim_socket_mcastloop_get( pim_ifp->pim_sock_fd); else mloop = 0; - lmqc = pim_ifp->igmp_last_member_query_count; + lmqc = pim_ifp->last_member_query_count; if (uj) { json_row = json_object_new_object(); @@ -676,7 +674,7 @@ static void igmp_show_interfaces_single(struct pim_instance *pim, "queryOtherTimer", other_hhmmss); json_object_int_add(json_row, "version", - pim_ifp->igmp_version); + pim_ifp->version); json_object_int_add( json_row, "timerGroupMembershipIntervalMsec", @@ -727,7 +725,7 @@ static void igmp_show_interfaces_single(struct pim_instance *pim, &pim_ifp->primary_address); vty_out(vty, "Uptime : %s\n", uptime); vty_out(vty, "Version : %d\n", - pim_ifp->igmp_version); + pim_ifp->version); vty_out(vty, "\n"); vty_out(vty, "\n"); @@ -833,15 +831,14 @@ static void igmp_show_interface_join(struct pim_instance *pim, struct vty *vty, if (!pim_ifp) continue; - if (!pim_ifp->igmp_join_list) + if (!pim_ifp->join_list) continue; pri_addr = pim_find_primary_addr(ifp); pim_inet4_dump("<pri?>", pri_addr, pri_addr_str, sizeof(pri_addr_str)); - for (ALL_LIST_ELEMENTS_RO(pim_ifp->igmp_join_list, join_node, - ij)) { + for (ALL_LIST_ELEMENTS_RO(pim_ifp->join_list, join_node, ij)) { char group_str[INET_ADDRSTRLEN]; char source_str[INET_ADDRSTRLEN]; char uptime[10]; @@ -887,7 +884,7 @@ static void igmp_show_interface_join(struct pim_instance *pim, struct vty *vty, ifp->name, pri_addr_str, source_str, group_str, ij->sock_fd, uptime); } - } /* for (pim_ifp->igmp_join_list) */ + } /* for (pim_ifp->join_list) */ } /* for (iflist) */ @@ -1340,7 +1337,7 @@ static void igmp_show_statistics(struct pim_instance *pim, struct vty *vty, if (ifname && strcmp(ifname, ifp->name)) continue; - for (ALL_LIST_ELEMENTS_RO(pim_ifp->igmp_socket_list, sock_node, + for (ALL_LIST_ELEMENTS_RO(pim_ifp->socket_list, sock_node, igmp)) { igmp_stats_add(&rx_stats, &igmp->rx_stats); } @@ -3429,8 +3426,7 @@ static void igmp_show_groups(struct pim_instance *pim, struct vty *vty, bool uj) continue; /* scan igmp groups */ - for (ALL_LIST_ELEMENTS_RO(pim_ifp->igmp_group_list, grpnode, - grp)) { + for (ALL_LIST_ELEMENTS_RO(pim_ifp->group_list, grpnode, grp)) { char group_str[INET_ADDRSTRLEN]; char hhmmss[10]; char uptime[10]; @@ -3523,8 +3519,7 @@ static void igmp_show_group_retransmission(struct pim_instance *pim, continue; /* scan igmp groups */ - for (ALL_LIST_ELEMENTS_RO(pim_ifp->igmp_group_list, grpnode, - grp)) { + for (ALL_LIST_ELEMENTS_RO(pim_ifp->group_list, grpnode, grp)) { char group_str[INET_ADDRSTRLEN]; char grp_retr_mmss[10]; struct listnode *src_node; @@ -3576,8 +3571,7 @@ static void igmp_show_sources(struct pim_instance *pim, struct vty *vty) continue; /* scan igmp groups */ - for (ALL_LIST_ELEMENTS_RO(pim_ifp->igmp_group_list, grpnode, - grp)) { + for (ALL_LIST_ELEMENTS_RO(pim_ifp->group_list, grpnode, grp)) { char group_str[INET_ADDRSTRLEN]; struct listnode *srcnode; struct igmp_source *src; @@ -3610,7 +3604,7 @@ static void igmp_show_sources(struct pim_instance *pim, struct vty *vty) uptime); } /* scan group sources */ - } /* scan igmp groups */ + } /* scan igmp groups */ } /* scan interfaces */ } @@ -3632,8 +3626,7 @@ static void igmp_show_source_retransmission(struct pim_instance *pim, continue; /* scan igmp groups */ - for (ALL_LIST_ELEMENTS_RO(pim_ifp->igmp_group_list, grpnode, - grp)) { + for (ALL_LIST_ELEMENTS_RO(pim_ifp->group_list, grpnode, grp)) { char group_str[INET_ADDRSTRLEN]; struct listnode *srcnode; struct igmp_source *src; @@ -3654,7 +3647,7 @@ static void igmp_show_source_retransmission(struct pim_instance *pim, src->source_query_retransmit_count); } /* scan group sources */ - } /* scan igmp groups */ + } /* scan igmp groups */ } /* scan interfaces */ } @@ -3923,9 +3916,9 @@ static void clear_mroute(struct pim_instance *pim) /* clean up all igmp groups */ - if (pim_ifp->igmp_group_list) { - while (pim_ifp->igmp_group_list->count) { - grp = listnode_head(pim_ifp->igmp_group_list); + if (pim_ifp->group_list) { + while (pim_ifp->group_list->count) { + grp = listnode_head(pim_ifp->group_list); igmp_group_delete(grp); } } |