Revert "bgpd: use common api in bgp_get"

This reverts commit bdaadb91e8.
This commit is contained in:
Igor Ryzhov 2021-05-14 02:12:24 +03:00
parent 012baeeca6
commit 385069ca17

View File

@ -48,6 +48,33 @@ FRR_CFG_DEFAULT_ULONG(BGP_KEEPALIVE,
{ .val_ulong = 60 },
);
static int bgp_lookup_by_as_name_type(struct bgp **bgp_val, as_t *as,
const char *name,
enum bgp_instance_type inst_type)
{
struct bgp *bgp;
if (name)
bgp = bgp_lookup_by_name(name);
else
bgp = bgp_get_default();
if (bgp) {
if (bgp->as != *as) {
*as = bgp->as;
return BGP_ERR_INSTANCE_MISMATCH;
}
if (bgp->inst_type != inst_type)
return BGP_ERR_INSTANCE_MISMATCH;
*bgp_val = bgp;
} else {
*bgp_val = NULL;
}
return BGP_SUCCESS;
}
int routing_control_plane_protocols_name_validate(
struct nb_cb_create_args *args)
{