diff options
Diffstat (limited to 'pimd')
-rw-r--r-- | pimd/pim_cmd.c | 161 | ||||
-rw-r--r-- | pimd/pim_igmp.c | 8 | ||||
-rw-r--r-- | pimd/pim_igmpv3.c | 35 | ||||
-rw-r--r-- | pimd/pim_nb_config.c | 6 | ||||
-rw-r--r-- | pimd/pim_zebra.c | 41 |
5 files changed, 109 insertions, 142 deletions
diff --git a/pimd/pim_cmd.c b/pimd/pim_cmd.c index f57bf7093..14aa71052 100644 --- a/pimd/pim_cmd.c +++ b/pimd/pim_cmd.c @@ -3443,80 +3443,70 @@ 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->igmp_group_list, grpnode, + grp)) { char group_str[INET_ADDRSTRLEN]; char hhmmss[10]; char uptime[10]; - pim_inet4_dump("<group?>", grp->group_addr, - group_str, sizeof(group_str)); + pim_inet4_dump("<group?>", grp->group_addr, group_str, + sizeof(group_str)); pim_time_timer_to_hhmmss(hhmmss, sizeof(hhmmss), grp->t_group_timer); pim_time_uptime(uptime, sizeof(uptime), now - grp->group_creation); if (uj) { - json_object_object_get_ex( - json, ifp->name, &json_iface); + json_object_object_get_ex(json, ifp->name, + &json_iface); if (!json_iface) { - json_iface = - json_object_new_object(); - json_object_pim_ifp_add( - json_iface, ifp); - json_object_object_add( - json, ifp->name, - json_iface); - json_groups = - json_object_new_array(); - json_object_object_add( - json_iface, - "groups", - json_groups); + json_iface = json_object_new_object(); + json_object_pim_ifp_add(json_iface, + ifp); + json_object_object_add(json, ifp->name, + json_iface); + json_groups = json_object_new_array(); + json_object_object_add(json_iface, + "groups", + json_groups); } json_group = json_object_new_object(); - json_object_string_add(json_group, - "group", + json_object_string_add(json_group, "group", group_str); if (grp->igmp_version == 3) json_object_string_add( json_group, "mode", grp->group_filtermode_isexcl - ? "EXCLUDE" - : "INCLUDE"); + ? "EXCLUDE" + : "INCLUDE"); - json_object_string_add(json_group, - "timer", hhmmss); + json_object_string_add(json_group, "timer", + hhmmss); json_object_int_add( json_group, "sourcesCount", - grp->group_source_list - ? listcount( + grp->group_source_list ? listcount( grp->group_source_list) - : 0); - json_object_int_add( - json_group, "version", - grp->igmp_version); - json_object_string_add( - json_group, "uptime", uptime); - json_object_array_add(json_groups, - json_group); + : 0); + json_object_int_add(json_group, "version", + grp->igmp_version); + json_object_string_add(json_group, "uptime", + uptime); + json_object_array_add(json_groups, json_group); } else { - vty_out(vty, - "%-16s %-15s %4s %8s %4d %d %8s\n", + vty_out(vty, "%-16s %-15s %4s %8s %4d %d %8s\n", ifp->name, group_str, grp->igmp_version == 3 - ? (grp->group_filtermode_isexcl - ? "EXCL" - : "INCL") - : "----", + ? (grp->group_filtermode_isexcl + ? "EXCL" + : "INCL") + : "----", hhmmss, - grp->group_source_list - ? listcount( + grp->group_source_list ? listcount( grp->group_source_list) - : 0, + : 0, grp->igmp_version, uptime); } } /* scan igmp groups */ @@ -3547,16 +3537,16 @@ 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->igmp_group_list, grpnode, + grp)) { char group_str[INET_ADDRSTRLEN]; char grp_retr_mmss[10]; struct listnode *src_node; struct igmp_source *src; int grp_retr_sources = 0; - pim_inet4_dump("<group?>", grp->group_addr, - group_str, sizeof(group_str)); + pim_inet4_dump("<group?>", grp->group_addr, group_str, + sizeof(group_str)); pim_time_timer_to_mmss( grp_retr_mmss, sizeof(grp_retr_mmss), grp->t_group_query_retransmit_timer); @@ -3564,17 +3554,15 @@ static void igmp_show_group_retransmission(struct pim_instance *pim, /* count group sources with retransmission state */ - for (ALL_LIST_ELEMENTS_RO( - grp->group_source_list, src_node, - src)) { - if (src->source_query_retransmit_count - > 0) { + for (ALL_LIST_ELEMENTS_RO(grp->group_source_list, + src_node, src)) { + if (src->source_query_retransmit_count > 0) { ++grp_retr_sources; } } - vty_out(vty, "%-16s %-15s %-8s %7d %7d\n", - ifp->name, group_str, grp_retr_mmss, + vty_out(vty, "%-16s %-15s %-8s %7d %7d\n", ifp->name, + group_str, grp_retr_mmss, grp->group_specific_query_retransmit_count, grp_retr_sources); @@ -3602,46 +3590,41 @@ 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->igmp_group_list, grpnode, + grp)) { char group_str[INET_ADDRSTRLEN]; struct listnode *srcnode; struct igmp_source *src; - pim_inet4_dump("<group?>", grp->group_addr, - group_str, sizeof(group_str)); + pim_inet4_dump("<group?>", grp->group_addr, group_str, + sizeof(group_str)); /* scan group sources */ - for (ALL_LIST_ELEMENTS_RO( - grp->group_source_list, srcnode, - src)) { + for (ALL_LIST_ELEMENTS_RO(grp->group_source_list, + srcnode, src)) { char source_str[INET_ADDRSTRLEN]; char mmss[10]; char uptime[10]; - pim_inet4_dump( - "<source?>", src->source_addr, - source_str, sizeof(source_str)); + pim_inet4_dump("<source?>", src->source_addr, + source_str, sizeof(source_str)); - pim_time_timer_to_mmss( - mmss, sizeof(mmss), - src->t_source_timer); + pim_time_timer_to_mmss(mmss, sizeof(mmss), + src->t_source_timer); - pim_time_uptime( - uptime, sizeof(uptime), - now - src->source_creation); + pim_time_uptime(uptime, sizeof(uptime), + now - src->source_creation); - vty_out(vty, - "%-16s %-15s %-15s %5s %3s %8s\n", + vty_out(vty, "%-16s %-15s %-15s %5s %3s %8s\n", ifp->name, group_str, source_str, mmss, IGMP_SOURCE_TEST_FORWARDING( src->source_flags) - ? "Y" - : "N", + ? "Y" + : "N", uptime); } /* scan group sources */ - } /* scan igmp groups */ + } /* scan igmp groups */ } /* scan interfaces */ } @@ -3663,32 +3646,29 @@ 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->igmp_group_list, grpnode, + grp)) { char group_str[INET_ADDRSTRLEN]; struct listnode *srcnode; struct igmp_source *src; - pim_inet4_dump("<group?>", grp->group_addr, - group_str, sizeof(group_str)); + pim_inet4_dump("<group?>", grp->group_addr, group_str, + sizeof(group_str)); /* scan group sources */ - for (ALL_LIST_ELEMENTS_RO( - grp->group_source_list, srcnode, - src)) { + for (ALL_LIST_ELEMENTS_RO(grp->group_source_list, + srcnode, src)) { char source_str[INET_ADDRSTRLEN]; - pim_inet4_dump( - "<source?>", src->source_addr, - source_str, sizeof(source_str)); + pim_inet4_dump("<source?>", src->source_addr, + source_str, sizeof(source_str)); - vty_out(vty, - "%-16s %-15s %-15s %7d\n", + vty_out(vty, "%-16s %-15s %-15s %7d\n", ifp->name, group_str, source_str, src->source_query_retransmit_count); } /* scan group sources */ - } /* scan igmp groups */ + } /* scan igmp groups */ } /* scan interfaces */ } @@ -3959,8 +3939,7 @@ static void clear_mroute(struct pim_instance *pim) if (pim_ifp->igmp_group_list) { while (pim_ifp->igmp_group_list->count) { - grp = listnode_head( - pim_ifp->igmp_group_list); + grp = listnode_head(pim_ifp->igmp_group_list); igmp_group_delete(grp); } } diff --git a/pimd/pim_igmp.c b/pimd/pim_igmp.c index 28f2b30ef..50de7124d 100644 --- a/pimd/pim_igmp.c +++ b/pimd/pim_igmp.c @@ -938,11 +938,9 @@ void pim_igmp_if_init(struct pim_interface *pim_ifp, struct interface *ifp) pim_ifp->igmp_group_list = list_new(); pim_ifp->igmp_group_list->del = (void (*)(void *))igmp_group_free; - snprintf(hash_name, sizeof(hash_name), "IGMP %s hash", - ifp->name); - pim_ifp->igmp_group_hash = hash_create(igmp_group_hash_key, - igmp_group_hash_equal, - hash_name); + snprintf(hash_name, sizeof(hash_name), "IGMP %s hash", ifp->name); + pim_ifp->igmp_group_hash = hash_create( + igmp_group_hash_key, igmp_group_hash_equal, hash_name); } void pim_igmp_if_reset(struct pim_interface *pim_ifp) diff --git a/pimd/pim_igmpv3.c b/pimd/pim_igmpv3.c index f13dfe1b8..1f4d904f7 100644 --- a/pimd/pim_igmpv3.c +++ b/pimd/pim_igmpv3.c @@ -198,8 +198,7 @@ static void source_timer_off(struct igmp_group *group, sizeof(source_str)); zlog_debug( "Cancelling TIMER event for group %s source %s on %s", - group_str, source_str, - group->interface->name); + group_str, source_str, group->interface->name); } THREAD_OFF(source->t_source_timer); @@ -362,8 +361,7 @@ void igmp_source_delete(struct igmp_source *source) sizeof(source_str)); zlog_debug( "Deleting IGMP source %s for group %s from interface %s c_oil ref_count %d", - source_str, group_str, - group->interface->name, + source_str, group_str, group->interface->name, source->source_channel_oil ? source->source_channel_oil->oil_ref_count : 0); @@ -994,14 +992,13 @@ static void igmp_send_query_group(struct igmp_group *group, char *query_buf, struct listnode *sock_node; for (ALL_LIST_ELEMENTS_RO(pim_ifp->igmp_socket_list, sock_node, igmp)) { - igmp_send_query(pim_ifp->igmp_version, group, igmp->fd, - ifp->name, query_buf, query_buf_size, - num_sources, group->group_addr, - group->group_addr, - pim_ifp->igmp_specific_query_max_response_time_dsec, - s_flag, - igmp->querier_robustness_variable, - igmp->querier_query_interval); + igmp_send_query( + pim_ifp->igmp_version, group, igmp->fd, ifp->name, + query_buf, query_buf_size, num_sources, + group->group_addr, group->group_addr, + pim_ifp->igmp_specific_query_max_response_time_dsec, + s_flag, igmp->querier_robustness_variable, + igmp->querier_query_interval); } } @@ -1177,10 +1174,9 @@ static int group_retransmit_sources(struct igmp_group *group, interest. */ - igmp_send_query_group(group, query_buf1, - sizeof(query_buf1), - num_sources_tosend1, - 1 /* s_flag */); + igmp_send_query_group( + group, query_buf1, sizeof(query_buf1), + num_sources_tosend1, 1 /* s_flag */); } } /* send_with_sflag_set */ @@ -1214,10 +1210,9 @@ static int group_retransmit_sources(struct igmp_group *group, interest. */ - igmp_send_query_group(group, query_buf2, - sizeof(query_buf2), - num_sources_tosend2, - 0 /* s_flag */); + igmp_send_query_group( + group, query_buf2, sizeof(query_buf2), + num_sources_tosend2, 0 /* s_flag */); } } diff --git a/pimd/pim_nb_config.c b/pimd/pim_nb_config.c index 440db5361..f4627cbcc 100644 --- a/pimd/pim_nb_config.c +++ b/pimd/pim_nb_config.c @@ -105,7 +105,7 @@ static void pim_if_membership_refresh(struct interface *ifp) } } /* scan group sources */ - } /* scan igmp groups */ + } /* scan igmp groups */ /* * Finally delete every PIM (S,G) entry lacking all state info @@ -483,8 +483,8 @@ static void change_query_max_response_time(struct pim_interface *pim_ifp, igmp_group_reset_gmi(grp); /* scan group sources */ - for (ALL_LIST_ELEMENTS_RO(grp->group_source_list, - src_node, src)) { + for (ALL_LIST_ELEMENTS_RO(grp->group_source_list, src_node, + src)) { /* reset source timers for sources with running * timers diff --git a/pimd/pim_zebra.c b/pimd/pim_zebra.c index e8df29b3e..521e4ebc1 100644 --- a/pimd/pim_zebra.c +++ b/pimd/pim_zebra.c @@ -517,8 +517,8 @@ static void igmp_source_forward_reevaluate_one(struct pim_instance *pim, zlog_debug( "local membership del for %s as G is now SSM", pim_str_sg_dump(&sg)); - pim_ifchannel_local_membership_del( - group->interface, &sg); + pim_ifchannel_local_membership_del(group->interface, + &sg); } } else { /* If ASM group add local membership */ @@ -529,8 +529,7 @@ static void igmp_source_forward_reevaluate_one(struct pim_instance *pim, "local membership add for %s as G is now ASM", pim_str_sg_dump(&sg)); pim_ifchannel_local_membership_add( - group->interface, &sg, - false /*is_vxlan*/); + group->interface, &sg, false /*is_vxlan*/); } } } @@ -557,8 +556,8 @@ void igmp_source_forward_reevaluate_all(struct pim_instance *pim) for (ALL_LIST_ELEMENTS_RO(grp->group_source_list, srcnode, src)) { igmp_source_forward_reevaluate_one(pim, src); - } /* scan group sources */ - } /* scan igmp groups */ + } /* scan group sources */ + } /* scan igmp groups */ } /* scan interfaces */ } @@ -576,11 +575,10 @@ void igmp_source_forward_start(struct pim_instance *pim, sg.grp = source->source_group->group_addr; if (PIM_DEBUG_IGMP_TRACE) { - zlog_debug( - "%s: (S,G)=%s oif=%s fwd=%d", __func__, - pim_str_sg_dump(&sg), - source->source_group->interface->name, - IGMP_SOURCE_TEST_FORWARDING(source->source_flags)); + zlog_debug("%s: (S,G)=%s oif=%s fwd=%d", __func__, + pim_str_sg_dump(&sg), + source->source_group->interface->name, + IGMP_SOURCE_TEST_FORWARDING(source->source_flags)); } /* Prevent IGMP interface from installing multicast route multiple @@ -726,16 +724,15 @@ void igmp_source_forward_start(struct pim_instance *pim, Feed IGMPv3-gathered local membership information into PIM per-interface (S,G) state. */ - if (!pim_ifchannel_local_membership_add( - group->interface, &sg, + if (!pim_ifchannel_local_membership_add(group->interface, &sg, false /*is_vxlan*/)) { if (PIM_DEBUG_MROUTE) zlog_warn("%s: Failure to add local membership for %s", __func__, pim_str_sg_dump(&sg)); pim_channel_del_oif(source->source_channel_oil, - group->interface, - PIM_OIF_FLAG_PROTO_IGMP, __func__); + group->interface, PIM_OIF_FLAG_PROTO_IGMP, + __func__); return; } @@ -757,11 +754,10 @@ void igmp_source_forward_stop(struct igmp_source *source) sg.grp = source->source_group->group_addr; if (PIM_DEBUG_IGMP_TRACE) { - zlog_debug( - "%s: (S,G)=%s oif=%s fwd=%d", __func__, - pim_str_sg_dump(&sg), - source->source_group->interface->name, - IGMP_SOURCE_TEST_FORWARDING(source->source_flags)); + zlog_debug("%s: (S,G)=%s oif=%s fwd=%d", __func__, + pim_str_sg_dump(&sg), + source->source_group->interface->name, + IGMP_SOURCE_TEST_FORWARDING(source->source_flags)); } /* Prevent IGMP interface from removing multicast route multiple @@ -784,9 +780,8 @@ void igmp_source_forward_stop(struct igmp_source *source) pim_forward_stop below. */ result = pim_channel_del_oif(source->source_channel_oil, - group->interface, - PIM_OIF_FLAG_PROTO_IGMP, - __func__); + group->interface, PIM_OIF_FLAG_PROTO_IGMP, + __func__); if (result) { if (PIM_DEBUG_IGMP_TRACE) zlog_debug( |