struct listnode *node;
struct bgp *bgp;
- if (!bgp_option_check(BGP_OPT_MULTIPLE_INSTANCE)) {
- vty_out(vty, "BGP Multiple Instance is not enabled\n");
- return CMD_WARNING;
- }
-
vty_out(vty, "Defined BGP views:\n");
for (ALL_LIST_ELEMENTS_RO(inst, node, bgp)) {
/* Skip VRFs. */
json_object *json_vrfs = NULL;
int count = 0;
- if (!bgp_option_check(BGP_OPT_MULTIPLE_INSTANCE)) {
- vty_out(vty, "BGP Multiple Instance is not enabled\n");
- return CMD_WARNING;
- }
-
if (uj) {
json = json_object_new_object();
json_vrfs = json_object_new_object();
{
switch (flag) {
case BGP_OPT_NO_FIB:
- case BGP_OPT_MULTIPLE_INSTANCE:
case BGP_OPT_CONFIG_CISCO:
case BGP_OPT_NO_LISTEN:
case BGP_OPT_NO_ZEBRA:
int bgp_option_unset(int flag)
{
switch (flag) {
- case BGP_OPT_MULTIPLE_INSTANCE:
- if (listcount(bm->bgp) > 1)
- return BGP_ERR_MULTIPLE_INSTANCE_USED;
/* Fall through. */
case BGP_OPT_NO_ZEBRA:
case BGP_OPT_NO_FIB:
struct vrf *vrf = NULL;
/* Multiple instance check. */
- if (bgp_option_check(BGP_OPT_MULTIPLE_INSTANCE)) {
- if (name)
- bgp = bgp_lookup_by_name(name);
- else
- bgp = bgp_get_default();
-
- /* Already exists. */
- 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;
- return 0;
- }
- } else {
- /* BGP instance name can not be specified for single instance.
- */
- if (name)
- return BGP_ERR_MULTIPLE_INSTANCE_NOT_SET;
-
- /* Get default BGP structure if exists. */
+ 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_AS_MISMATCH;
- }
- *bgp_val = bgp;
- return 0;
+ /* Already exists. */
+ 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;
+ return 0;
}
bgp = bgp_create(as, name, inst_type);
struct listnode *node, *nnode;
struct listnode *mnode, *mnnode;
- /* BGP Multiple instance. */
- if (!bgp_option_check(BGP_OPT_MULTIPLE_INSTANCE)) {
- vty_out(vty, "no bgp multiple-instance\n");
- write++;
- }
-
/* BGP Config type. */
if (bgp_option_check(BGP_OPT_CONFIG_CISCO)) {
vty_out(vty, "bgp config-type cisco\n");
/* Router bgp ASN */
vty_out(vty, "router bgp %u", bgp->as);
- if (bgp_option_check(BGP_OPT_MULTIPLE_INSTANCE)) {
- if (bgp->name)
- vty_out(vty, " %s %s",
- (bgp->inst_type
- == BGP_INSTANCE_TYPE_VIEW)
- ? "view"
- : "vrf",
- bgp->name);
- }
+ if (bgp->name)
+ vty_out(vty, " %s %s",
+ (bgp->inst_type == BGP_INSTANCE_TYPE_VIEW)
+ ? "view" : "vrf", bgp->name);
vty_out(vty, "\n");
/* No Synchronization */
bf_init(bm->rd_idspace, UINT16_MAX);
bf_assign_zero_index(bm->rd_idspace);
- /* Enable multiple instances by default. */
- bgp_option_set(BGP_OPT_MULTIPLE_INSTANCE);
-
/* mpls label dynamic allocation pool */
bgp_lp_init(bm->master, &bm->labelpool);