mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-13 22:57:45 +00:00
pimd, pim6d: Rename and move api pim_cmd_interface_delete
Rename pim_cmd_interface_delete to pim_pim_interface_delete and move the api to pimd/pim_iface.c Changed the return type of the api from int to void. Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
This commit is contained in:
parent
e7356fdba1
commit
692b1f3e97
@ -1775,3 +1775,27 @@ static void pim_if_membership_clear(struct interface *ifp)
|
|||||||
|
|
||||||
pim_ifchannel_membership_clear(ifp);
|
pim_ifchannel_membership_clear(ifp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void pim_pim_interface_delete(struct interface *ifp)
|
||||||
|
{
|
||||||
|
struct pim_interface *pim_ifp = ifp->info;
|
||||||
|
|
||||||
|
if (!pim_ifp)
|
||||||
|
return;
|
||||||
|
|
||||||
|
pim_ifp->pim_enable = false;
|
||||||
|
|
||||||
|
pim_if_membership_clear(ifp);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* pim_sock_delete() removes all neighbors from
|
||||||
|
* pim_ifp->pim_neighbor_list.
|
||||||
|
*/
|
||||||
|
pim_sock_delete(ifp, "pim unconfigured on interface");
|
||||||
|
pim_upstream_nh_if_update(pim_ifp->pim, ifp);
|
||||||
|
|
||||||
|
if (!pim_ifp->gm_enable) {
|
||||||
|
pim_if_addr_del_all(ifp);
|
||||||
|
pim_if_delete(ifp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -243,5 +243,6 @@ bool pim_if_is_vrf_device(struct interface *ifp);
|
|||||||
int pim_if_ifchannel_count(struct pim_interface *pim_ifp);
|
int pim_if_ifchannel_count(struct pim_interface *pim_ifp);
|
||||||
|
|
||||||
void pim_iface_init(void);
|
void pim_iface_init(void);
|
||||||
|
void pim_pim_interface_delete(struct interface *ifp);
|
||||||
|
|
||||||
#endif /* PIM_IFACE_H */
|
#endif /* PIM_IFACE_H */
|
||||||
|
@ -147,32 +147,6 @@ static int pim_cmd_interface_add(struct interface *ifp)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int pim_cmd_interface_delete(struct interface *ifp)
|
|
||||||
{
|
|
||||||
struct pim_interface *pim_ifp = ifp->info;
|
|
||||||
|
|
||||||
if (!pim_ifp)
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
pim_ifp->pim_enable = false;
|
|
||||||
|
|
||||||
pim_if_membership_clear(ifp);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* pim_sock_delete() removes all neighbors from
|
|
||||||
* pim_ifp->pim_neighbor_list.
|
|
||||||
*/
|
|
||||||
pim_sock_delete(ifp, "pim unconfigured on interface");
|
|
||||||
pim_upstream_nh_if_update(pim_ifp->pim, ifp);
|
|
||||||
|
|
||||||
if (!pim_ifp->gm_enable) {
|
|
||||||
pim_if_addr_del_all(ifp);
|
|
||||||
pim_if_delete(ifp);
|
|
||||||
}
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int interface_pim_use_src_cmd_worker(struct interface *ifp,
|
static int interface_pim_use_src_cmd_worker(struct interface *ifp,
|
||||||
pim_addr source_addr, char *errmsg, size_t errmsg_len)
|
pim_addr source_addr, char *errmsg, size_t errmsg_len)
|
||||||
{
|
{
|
||||||
@ -1559,12 +1533,7 @@ int lib_interface_pim_address_family_destroy(struct nb_cb_destroy_args *args)
|
|||||||
if (!pim_ifp)
|
if (!pim_ifp)
|
||||||
return NB_OK;
|
return NB_OK;
|
||||||
|
|
||||||
if (!pim_cmd_interface_delete(ifp)) {
|
pim_pim_interface_delete(ifp);
|
||||||
snprintf(args->errmsg, args->errmsg_len,
|
|
||||||
"Unable to delete interface information %s",
|
|
||||||
ifp->name);
|
|
||||||
return NB_ERR_INCONSISTENCY;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return NB_OK;
|
return NB_OK;
|
||||||
@ -1612,11 +1581,7 @@ int lib_interface_pim_address_family_pim_enable_modify(struct nb_cb_modify_args
|
|||||||
if (!pim_ifp)
|
if (!pim_ifp)
|
||||||
return NB_ERR_INCONSISTENCY;
|
return NB_ERR_INCONSISTENCY;
|
||||||
|
|
||||||
if (!pim_cmd_interface_delete(ifp)) {
|
pim_pim_interface_delete(ifp);
|
||||||
snprintf(args->errmsg, args->errmsg_len,
|
|
||||||
"Unable to delete interface information");
|
|
||||||
return NB_ERR_INCONSISTENCY;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user