mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-07 17:18:56 +00:00
isisd: modify signature of isis_area_destroy()
Make that function accept an IS-IS area pointer instead of an area name, making it more in line with the rest of the code base (*delete() functions shouldn't perform lookups internally). Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
This commit is contained in:
parent
6aa15aebc3
commit
14c6e77243
@ -77,7 +77,7 @@ int isis_instance_destroy(struct nb_cb_destroy_args *args)
|
|||||||
return NB_OK;
|
return NB_OK;
|
||||||
|
|
||||||
area = nb_running_unset_entry(args->dnode);
|
area = nb_running_unset_entry(args->dnode);
|
||||||
isis_area_destroy(area->area_tag);
|
isis_area_destroy(area);
|
||||||
|
|
||||||
return NB_OK;
|
return NB_OK;
|
||||||
}
|
}
|
||||||
|
@ -247,21 +247,12 @@ int isis_area_get(struct vty *vty, const char *area_tag)
|
|||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
int isis_area_destroy(const char *area_tag)
|
void isis_area_destroy(struct isis_area *area)
|
||||||
{
|
{
|
||||||
struct isis_area *area;
|
|
||||||
struct listnode *node, *nnode;
|
struct listnode *node, *nnode;
|
||||||
struct isis_circuit *circuit;
|
struct isis_circuit *circuit;
|
||||||
struct area_addr *addr;
|
struct area_addr *addr;
|
||||||
|
|
||||||
area = isis_area_lookup(area_tag);
|
|
||||||
|
|
||||||
if (area == NULL) {
|
|
||||||
zlog_warn("%s: could not find area with area-tag %s",
|
|
||||||
__func__, area_tag);
|
|
||||||
return CMD_ERR_NO_MATCH;
|
|
||||||
}
|
|
||||||
|
|
||||||
QOBJ_UNREG(area);
|
QOBJ_UNREG(area);
|
||||||
|
|
||||||
if (fabricd)
|
if (fabricd)
|
||||||
@ -324,8 +315,6 @@ int isis_area_destroy(const char *area_tag)
|
|||||||
memset(isis->sysid, 0, ISIS_SYS_ID_LEN);
|
memset(isis->sysid, 0, ISIS_SYS_ID_LEN);
|
||||||
isis->sysid_set = 0;
|
isis->sysid_set = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return CMD_SUCCESS;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef FABRICD
|
#ifdef FABRICD
|
||||||
@ -1589,8 +1578,20 @@ DEFUN (no_router_openfabric,
|
|||||||
PROTO_HELP
|
PROTO_HELP
|
||||||
"ISO Routing area tag\n")
|
"ISO Routing area tag\n")
|
||||||
{
|
{
|
||||||
|
struct isis_area *area;
|
||||||
|
const char *area_tag;
|
||||||
int idx_word = 3;
|
int idx_word = 3;
|
||||||
return isis_area_destroy(argv[idx_word]->arg);
|
|
||||||
|
area_tag = argv[idx_word]->arg;
|
||||||
|
area = isis_area_lookup(area_tag);
|
||||||
|
if (area == NULL) {
|
||||||
|
zlog_warn("%s: could not find area with area-tag %s",
|
||||||
|
__func__, area_tag);
|
||||||
|
return CMD_ERR_NO_MATCH;
|
||||||
|
}
|
||||||
|
|
||||||
|
isis_area_destroy(area);
|
||||||
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
#endif /* ifdef FABRICD */
|
#endif /* ifdef FABRICD */
|
||||||
#ifdef FABRICD
|
#ifdef FABRICD
|
||||||
|
@ -198,7 +198,7 @@ void isis_new(unsigned long process_id, vrf_id_t vrf_id);
|
|||||||
struct isis_area *isis_area_create(const char *);
|
struct isis_area *isis_area_create(const char *);
|
||||||
struct isis_area *isis_area_lookup(const char *);
|
struct isis_area *isis_area_lookup(const char *);
|
||||||
int isis_area_get(struct vty *vty, const char *area_tag);
|
int isis_area_get(struct vty *vty, const char *area_tag);
|
||||||
int isis_area_destroy(const char *area_tag);
|
void isis_area_destroy(struct isis_area *area);
|
||||||
void print_debug(struct vty *, int, int);
|
void print_debug(struct vty *, int, int);
|
||||||
struct isis_lsp *lsp_for_arg(struct lspdb_head *head, const char *argv);
|
struct isis_lsp *lsp_for_arg(struct lspdb_head *head, const char *argv);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user