return writes;
}
+#if PIM_IPV == 4
+int pim_config_write(struct vty *vty, int writes, struct interface *ifp,
+ struct pim_instance *pim)
+{
+ struct pim_interface *pim_ifp = ifp->info;
+
+ if (PIM_IF_TEST_PIM(pim_ifp->options)) {
+ vty_out(vty, " ip pim\n");
+ ++writes;
+ }
+
+ /* IF ip pim drpriority */
+ if (pim_ifp->pim_dr_priority != PIM_DEFAULT_DR_PRIORITY) {
+ vty_out(vty, " ip pim drpriority %u\n",
+ pim_ifp->pim_dr_priority);
+ ++writes;
+ }
+
+ /* IF ip pim hello */
+ if (pim_ifp->pim_hello_period != PIM_DEFAULT_HELLO_PERIOD) {
+ vty_out(vty, " ip pim hello %d", pim_ifp->pim_hello_period);
+ if (pim_ifp->pim_default_holdtime != -1)
+ vty_out(vty, " %d", pim_ifp->pim_default_holdtime);
+ vty_out(vty, "\n");
+ ++writes;
+ }
+
+ /* update source */
+ if (!pim_addr_is_any(pim_ifp->update_source)) {
+ vty_out(vty, " ip pim use-source %pPA\n",
+ &pim_ifp->update_source);
+ ++writes;
+ }
+
+ /* IF ip igmp */
+ if (PIM_IF_TEST_IGMP(pim_ifp->options)) {
+ vty_out(vty, " ip igmp\n");
+ ++writes;
+ }
+
+ /* ip igmp version */
+ if (pim_ifp->igmp_version != IGMP_DEFAULT_VERSION) {
+ vty_out(vty, " ip igmp version %d\n", pim_ifp->igmp_version);
+ ++writes;
+ }
+
+ /* IF ip igmp query-max-response-time */
+ if (pim_ifp->gm_query_max_response_time_dsec !=
+ IGMP_QUERY_MAX_RESPONSE_TIME_DSEC) {
+ vty_out(vty, " ip igmp query-max-response-time %d\n",
+ pim_ifp->gm_query_max_response_time_dsec);
+ ++writes;
+ }
+
+ /* IF ip igmp query-interval */
+ if (pim_ifp->gm_default_query_interval != IGMP_GENERAL_QUERY_INTERVAL) {
+ vty_out(vty, " ip igmp query-interval %d\n",
+ pim_ifp->gm_default_query_interval);
+ ++writes;
+ }
+
+ /* IF ip igmp last-member_query-count */
+ if (pim_ifp->gm_last_member_query_count !=
+ IGMP_DEFAULT_ROBUSTNESS_VARIABLE) {
+ vty_out(vty, " ip igmp last-member-query-count %d\n",
+ pim_ifp->gm_last_member_query_count);
+ ++writes;
+ }
+
+ /* IF ip igmp last-member_query-interval */
+ if (pim_ifp->gm_specific_query_max_response_time_dsec !=
+ IGMP_SPECIFIC_QUERY_MAX_RESPONSE_TIME_DSEC) {
+ vty_out(vty, " ip igmp last-member-query-interval %d\n",
+ pim_ifp->gm_specific_query_max_response_time_dsec);
+ ++writes;
+ }
+
+ /* IF ip igmp join */
+ if (pim_ifp->gm_join_list) {
+ struct listnode *node;
+ struct gm_join *ij;
+ for (ALL_LIST_ELEMENTS_RO(pim_ifp->gm_join_list, node, ij)) {
+ char group_str[INET_ADDRSTRLEN];
+ char source_str[INET_ADDRSTRLEN];
+ pim_inet4_dump("<grp?>", ij->group_addr, group_str,
+ sizeof(group_str));
+ if (ij->source_addr.s_addr == INADDR_ANY) {
+ vty_out(vty, " ip igmp join %s\n", group_str);
+ } else {
+ inet_ntop(AF_INET, &ij->source_addr, source_str,
+ sizeof(source_str));
+ vty_out(vty, " ip igmp join %s %s\n", group_str,
+ source_str);
+ }
+ ++writes;
+ }
+ }
+
+ if (pim_ifp->activeactive)
+ vty_out(vty, " ip pim active-active\n");
+
+ /* boundary */
+ if (pim_ifp->boundary_oil_plist) {
+ vty_out(vty, " ip multicast boundary oil %s\n",
+ pim_ifp->boundary_oil_plist);
+ ++writes;
+ }
+
+ writes += pim_static_write_mroute(pim, vty, ifp);
+ pim_bsm_write_config(vty, ifp);
+ ++writes;
+ pim_bfd_write_config(vty, ifp);
+ ++writes;
+
+ return writes;
+}
+#endif
+
int pim_interface_config_write(struct vty *vty)
{
struct pim_instance *pim;
vty_out(vty, " description %s\n", ifp->desc);
++writes;
}
-
- if (ifp->info) {
- struct pim_interface *pim_ifp = ifp->info;
-
- if (PIM_IF_TEST_PIM(pim_ifp->options)) {
- vty_out(vty, " ip pim\n");
- ++writes;
- }
-
- /* IF ip pim drpriority */
- if (pim_ifp->pim_dr_priority
- != PIM_DEFAULT_DR_PRIORITY) {
- vty_out(vty, " ip pim drpriority %u\n",
- pim_ifp->pim_dr_priority);
- ++writes;
- }
-
- /* IF ip pim hello */
- if (pim_ifp->pim_hello_period
- != PIM_DEFAULT_HELLO_PERIOD) {
- vty_out(vty, " ip pim hello %d",
- pim_ifp->pim_hello_period);
- if (pim_ifp->pim_default_holdtime != -1)
- vty_out(vty, " %d",
- pim_ifp->pim_default_holdtime);
- vty_out(vty, "\n");
- ++writes;
- }
-
- /* update source */
- if (!pim_addr_is_any(pim_ifp->update_source)) {
- vty_out(vty,
- " ip pim use-source %pPA\n",
- &pim_ifp->update_source);
- ++writes;
- }
-
- /* IF ip igmp */
- if (PIM_IF_TEST_IGMP(pim_ifp->options)) {
- vty_out(vty, " ip igmp\n");
- ++writes;
- }
-
- /* ip igmp version */
- if (pim_ifp->igmp_version
- != IGMP_DEFAULT_VERSION) {
- vty_out(vty, " ip igmp version %d\n",
- pim_ifp->igmp_version);
- ++writes;
- }
-
- /* IF ip igmp query-max-response-time */
- if (pim_ifp->gm_query_max_response_time_dsec !=
- IGMP_QUERY_MAX_RESPONSE_TIME_DSEC) {
- vty_out(vty,
- " ip igmp query-max-response-time %d\n",
- pim_ifp->gm_query_max_response_time_dsec);
- ++writes;
- }
-
- /* IF ip igmp query-interval */
- if (pim_ifp->gm_default_query_interval !=
- IGMP_GENERAL_QUERY_INTERVAL) {
- vty_out(vty,
- " ip igmp query-interval %d\n",
- pim_ifp->gm_default_query_interval);
- ++writes;
- }
-
- /* IF ip igmp last-member_query-count */
- if (pim_ifp->gm_last_member_query_count !=
- IGMP_DEFAULT_ROBUSTNESS_VARIABLE) {
- vty_out(vty,
- " ip igmp last-member-query-count %d\n",
- pim_ifp->gm_last_member_query_count);
- ++writes;
- }
-
- /* IF ip igmp last-member_query-interval */
- if (pim_ifp->gm_specific_query_max_response_time_dsec !=
- IGMP_SPECIFIC_QUERY_MAX_RESPONSE_TIME_DSEC) {
- vty_out(vty,
- " ip igmp last-member-query-interval %d\n",
- pim_ifp->gm_specific_query_max_response_time_dsec);
- ++writes;
- }
-
#if PIM_IPV == 4
- /* IF ip igmp join */
- if (pim_ifp->gm_join_list) {
- struct listnode *node;
- struct gm_join *ij;
- for (ALL_LIST_ELEMENTS_RO(
- pim_ifp->gm_join_list,
- node, ij)) {
- char group_str[INET_ADDRSTRLEN];
- char source_str
- [INET_ADDRSTRLEN];
- pim_inet4_dump(
- "<grp?>",
- ij->group_addr,
- group_str,
- sizeof(group_str));
- if (ij->source_addr.s_addr == INADDR_ANY) {
- vty_out(vty,
- " ip igmp join %s\n",
- group_str);
- } else {
- inet_ntop(AF_INET,
- &ij->source_addr,
- source_str,
- sizeof(source_str));
- vty_out(vty,
- " ip igmp join %s %s\n",
- group_str, source_str);
- }
- ++writes;
- }
- }
-#endif /* PIM_IPV == 4 */
-
- if (pim_ifp->activeactive)
- vty_out(vty, " ip pim active-active\n");
-
- /* boundary */
- if (pim_ifp->boundary_oil_plist) {
- vty_out(vty,
- " ip multicast boundary oil %s\n",
- pim_ifp->boundary_oil_plist);
- ++writes;
- }
-
- writes +=
- pim_static_write_mroute(pim, vty, ifp);
- pim_bsm_write_config(vty, ifp);
- ++writes;
- pim_bfd_write_config(vty, ifp);
- ++writes;
- }
+ if (ifp->info)
+ pim_config_write(vty, writes, ifp, pim);
+#endif
if_vty_config_end(vty);
++writes;
}