]> git.proxmox.com Git - mirror_frr.git/blobdiff - pimd/pim_cmd.c
pimd: Create pimreg interface when we start any interface config
[mirror_frr.git] / pimd / pim_cmd.c
index 77ea314d54d5bf154cf30699681fefb8ed3ae84f..19a42964ebaaed1cf9f8d3dde302a1f41de02f5f 100644 (file)
@@ -1207,6 +1207,8 @@ static void pim_show_interfaces_single(struct pim_instance *pim,
                        print_header = 1;
                        for (ALL_LIST_ELEMENTS_RO(pim->upstream_list, upnode,
                                                  up)) {
+                               if (!up->rpf.source_nexthop.interface)
+                                       continue;
 
                                if (strcmp(ifp->name,
                                           up->rpf.source_nexthop
@@ -2311,6 +2313,41 @@ static void json_object_pim_upstream_add(json_object *json,
        /* XXX: need to print ths flag in the plain text display as well */
        if (up->flags & PIM_UPSTREAM_FLAG_MASK_SRC_MSDP)
                json_object_boolean_true_add(json, "sourceMsdp");
+
+       if (up->flags & PIM_UPSTREAM_FLAG_MASK_SEND_SG_RPT_PRUNE)
+               json_object_boolean_true_add(json, "sendSGRptPrune");
+
+       if (up->flags & PIM_UPSTREAM_FLAG_MASK_SRC_LHR)
+               json_object_boolean_true_add(json, "lastHopRouter");
+
+       if (up->flags & PIM_UPSTREAM_FLAG_MASK_DISABLE_KAT_EXPIRY)
+               json_object_boolean_true_add(json, "disableKATExpiry");
+
+       if (up->flags & PIM_UPSTREAM_FLAG_MASK_STATIC_IIF)
+               json_object_boolean_true_add(json, "staticIncomingInterface");
+
+       if (up->flags & PIM_UPSTREAM_FLAG_MASK_ALLOW_IIF_IN_OIL)
+               json_object_boolean_true_add(json,
+                                            "allowIncomingInterfaceinOil");
+
+       if (up->flags & PIM_UPSTREAM_FLAG_MASK_NO_PIMREG_DATA)
+               json_object_boolean_true_add(json, "noPimRegistrationData");
+
+       if (up->flags & PIM_UPSTREAM_FLAG_MASK_FORCE_PIMREG)
+               json_object_boolean_true_add(json, "forcePimRegistration");
+
+       if (up->flags & PIM_UPSTREAM_FLAG_MASK_SRC_VXLAN_ORIG)
+               json_object_boolean_true_add(json, "sourceVxlanOrigination");
+
+       if (up->flags & PIM_UPSTREAM_FLAG_MASK_SRC_VXLAN_TERM)
+               json_object_boolean_true_add(json, "sourceVxlanTermination");
+
+       if (up->flags & PIM_UPSTREAM_FLAG_MASK_MLAG_VXLAN)
+               json_object_boolean_true_add(json, "mlagVxlan");
+
+       if (up->flags & PIM_UPSTREAM_FLAG_MASK_MLAG_NON_DF)
+               json_object_boolean_true_add(json,
+                                            "mlagNonDesignatedForwarder");
 }
 
 static const char *
@@ -6490,6 +6527,8 @@ static int pim_cmd_interface_add(struct interface *ifp)
 
        pim_if_addr_add_all(ifp);
        pim_if_membership_refresh(ifp);
+
+       pim_if_create_pimreg(pim_ifp->pim);
        return 1;
 }
 
@@ -8819,7 +8858,7 @@ static void pim_show_vxlan_sg_entry(struct pim_vxlan_sg *vxlan_sg,
        char src_str[INET_ADDRSTRLEN];
        char grp_str[INET_ADDRSTRLEN];
        json_object *json_row;
-       bool installed = (vxlan_sg->up)?TRUE:FALSE;
+       bool installed = (vxlan_sg->up) ? true : false;
        const char *iif_name = vxlan_sg->iif?vxlan_sg->iif->name:"-";
        const char *oif_name;
 
@@ -8917,7 +8956,7 @@ static void pim_show_vxlan_sg_match_addr(struct pim_instance *pim,
 
        cwd.vty = vty;
        cwd.json = json;
-       cwd.addr_match = TRUE;
+       cwd.addr_match = true;
        hash_iterate(pim->vxlan.sg_hash, pim_show_vxlan_sg_hash_entry, &cwd);
 
        if (uj) {
@@ -8958,7 +8997,7 @@ static void pim_show_vxlan_sg_one(struct pim_instance *pim,
 
        vxlan_sg = pim_vxlan_sg_find(pim, &sg);
        if (vxlan_sg) {
-               installed = (vxlan_sg->up)?TRUE:FALSE;
+               installed = (vxlan_sg->up) ? true : false;
                iif_name = vxlan_sg->iif?vxlan_sg->iif->name:"-";
 
                if (pim_vxlan_is_orig_mroute(vxlan_sg))
@@ -9094,8 +9133,8 @@ DEFUN_HIDDEN (no_ip_pim_mlag,
        struct in_addr addr;
 
        addr.s_addr = 0;
-       pim_vxlan_mlag_update(TRUE /*mlag_enable*/,
-               FALSE /*peer_state*/, PIM_VXLAN_MLAG_ROLE_SECONDARY,
+       pim_vxlan_mlag_update(true/*mlag_enable*/,
+               false/*peer_state*/, PIM_VXLAN_MLAG_ROLE_SECONDARY,
                NULL/*peerlink*/, &addr);
 
        return CMD_SUCCESS;
@@ -9145,9 +9184,9 @@ DEFUN_HIDDEN (ip_pim_mlag,
 
        idx += 2;
        if (!strcmp(argv[idx]->arg, "up")) {
-               peer_state = TRUE;
+               peer_state = true;
        } else if (strcmp(argv[idx]->arg, "down")) {
-               peer_state = FALSE;
+               peer_state = false;
        } else {
                vty_out(vty, "unknown MLAG state %s\n", argv[idx]->arg);
                return CMD_WARNING;
@@ -9161,7 +9200,7 @@ DEFUN_HIDDEN (ip_pim_mlag,
                        errno, safe_strerror(errno));
                return CMD_WARNING_CONFIG_FAILED;
        }
-       pim_vxlan_mlag_update(TRUE, peer_state, role, ifp, &reg_addr);
+       pim_vxlan_mlag_update(true, peer_state, role, ifp, &reg_addr);
 
        return CMD_SUCCESS;
 }