]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: Remove BGP_OPT_CONFIG_CISCO 4453/head
authorDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 3 Jun 2019 19:06:16 +0000 (15:06 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 3 Jun 2019 19:06:16 +0000 (15:06 -0400)
The BGP_OPT_CONFIG_CISCO command could no longer be set
as such remove it from the system as a viable option to
be used.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
bgpd/bgp_route.c
bgpd/bgpd.c
bgpd/bgpd.h

index 543df2b048c4e5c3b2691ae510126e0eea8bd2c7..899830e95f4a1784ad5d61f683b4e0a5f003b6a0 100644 (file)
@@ -12380,30 +12380,9 @@ void bgp_config_write_network(struct vty *vty, struct bgp *bgp, afi_t afi,
 
                p = &rn->p;
 
-               /* "network" configuration display.  */
-               if (bgp_option_check(BGP_OPT_CONFIG_CISCO) && afi == AFI_IP) {
-                       uint32_t destination;
-                       struct in_addr netmask;
-
-                       destination = ntohl(p->u.prefix4.s_addr);
-                       masklen2ip(p->prefixlen, &netmask);
-                       vty_out(vty, "  network %s",
-                               inet_ntop(p->family, &p->u.prefix, buf,
-                                         SU_ADDRSTRLEN));
-
-                       if ((IN_CLASSC(destination) && p->prefixlen == 24)
-                           || (IN_CLASSB(destination) && p->prefixlen == 16)
-                           || (IN_CLASSA(destination) && p->prefixlen == 8)
-                           || p->u.prefix4.s_addr == 0) {
-                               /* Natural mask is not display. */
-                       } else
-                               vty_out(vty, " mask %s", inet_ntoa(netmask));
-               } else {
-                       vty_out(vty, "  network %s/%d",
-                               inet_ntop(p->family, &p->u.prefix, buf,
-                                         SU_ADDRSTRLEN),
-                               p->prefixlen);
-               }
+               vty_out(vty, "  network %s/%d",
+                       inet_ntop(p->family, &p->u.prefix, buf, SU_ADDRSTRLEN),
+                       p->prefixlen);
 
                if (bgp_static->label_index != BGP_INVALID_LABEL_INDEX)
                        vty_out(vty, " label-index %u",
@@ -12427,20 +12406,9 @@ void bgp_config_write_network(struct vty *vty, struct bgp *bgp, afi_t afi,
 
                p = &rn->p;
 
-               if (bgp_option_check(BGP_OPT_CONFIG_CISCO) && afi == AFI_IP) {
-                       struct in_addr netmask;
-
-                       masklen2ip(p->prefixlen, &netmask);
-                       vty_out(vty, "  aggregate-address %s %s",
-                               inet_ntop(p->family, &p->u.prefix, buf,
-                                         SU_ADDRSTRLEN),
-                               inet_ntoa(netmask));
-               } else {
-                       vty_out(vty, "  aggregate-address %s/%d",
-                               inet_ntop(p->family, &p->u.prefix, buf,
-                                         SU_ADDRSTRLEN),
-                               p->prefixlen);
-               }
+               vty_out(vty, "  aggregate-address %s/%d",
+                       inet_ntop(p->family, &p->u.prefix, buf, SU_ADDRSTRLEN),
+                       p->prefixlen);
 
                if (bgp_aggregate->as_set)
                        vty_out(vty, " as-set");
index 78d2f9c3edf0b8333e56951bc71870541b048624..02eda7a430c4086168be691f4fbedf479bc923e3 100644 (file)
@@ -171,7 +171,6 @@ int bgp_option_set(int flag)
 {
        switch (flag) {
        case BGP_OPT_NO_FIB:
-       case BGP_OPT_CONFIG_CISCO:
        case BGP_OPT_NO_LISTEN:
        case BGP_OPT_NO_ZEBRA:
                SET_FLAG(bm->options, flag);
@@ -188,7 +187,6 @@ int bgp_option_unset(int flag)
        /* Fall through.  */
        case BGP_OPT_NO_ZEBRA:
        case BGP_OPT_NO_FIB:
-       case BGP_OPT_CONFIG_CISCO:
                UNSET_FLAG(bm->options, flag);
                break;
        default:
@@ -1201,21 +1199,18 @@ struct peer *peer_new(struct bgp *bgp)
 
        /* Set default flags. */
        FOREACH_AFI_SAFI (afi, safi) {
-               if (!bgp_option_check(BGP_OPT_CONFIG_CISCO)) {
-                       SET_FLAG(peer->af_flags[afi][safi],
-                                PEER_FLAG_SEND_COMMUNITY);
-                       SET_FLAG(peer->af_flags[afi][safi],
-                                PEER_FLAG_SEND_EXT_COMMUNITY);
-                       SET_FLAG(peer->af_flags[afi][safi],
-                                PEER_FLAG_SEND_LARGE_COMMUNITY);
-
-                       SET_FLAG(peer->af_flags_invert[afi][safi],
-                                PEER_FLAG_SEND_COMMUNITY);
-                       SET_FLAG(peer->af_flags_invert[afi][safi],
-                                PEER_FLAG_SEND_EXT_COMMUNITY);
-                       SET_FLAG(peer->af_flags_invert[afi][safi],
-                                PEER_FLAG_SEND_LARGE_COMMUNITY);
-               }
+               SET_FLAG(peer->af_flags[afi][safi], PEER_FLAG_SEND_COMMUNITY);
+               SET_FLAG(peer->af_flags[afi][safi],
+                        PEER_FLAG_SEND_EXT_COMMUNITY);
+               SET_FLAG(peer->af_flags[afi][safi],
+                        PEER_FLAG_SEND_LARGE_COMMUNITY);
+
+               SET_FLAG(peer->af_flags_invert[afi][safi],
+                        PEER_FLAG_SEND_COMMUNITY);
+               SET_FLAG(peer->af_flags_invert[afi][safi],
+                        PEER_FLAG_SEND_EXT_COMMUNITY);
+               SET_FLAG(peer->af_flags_invert[afi][safi],
+                        PEER_FLAG_SEND_LARGE_COMMUNITY);
                peer->addpath_type[afi][safi] = BGP_ADDPATH_NONE;
        }
 
@@ -7296,45 +7291,19 @@ static void bgp_config_write_peer_af(struct vty *vty, struct bgp *bgp,
        flag_slcomm = peergroup_af_flag_check(peer, afi, safi,
                                              PEER_FLAG_SEND_LARGE_COMMUNITY);
 
-       if (!bgp_option_check(BGP_OPT_CONFIG_CISCO)) {
-               if (flag_scomm && flag_secomm && flag_slcomm) {
-                       vty_out(vty, "  no neighbor %s send-community all\n",
-                               addr);
-               } else {
-                       if (flag_scomm)
-                               vty_out(vty,
-                                       "  no neighbor %s send-community\n",
-                                       addr);
-                       if (flag_secomm)
-                               vty_out(vty,
-                                       "  no neighbor %s send-community extended\n",
-                                       addr);
-
-                       if (flag_slcomm)
-                               vty_out(vty,
-                                       "  no neighbor %s send-community large\n",
-                                       addr);
-               }
+       if (flag_scomm && flag_secomm && flag_slcomm) {
+               vty_out(vty, "  no neighbor %s send-community all\n", addr);
        } else {
-               if (flag_scomm && flag_secomm && flag_slcomm) {
-                       vty_out(vty, "  neighbor %s send-community all\n",
+               if (flag_scomm)
+                       vty_out(vty, "  no neighbor %s send-community\n", addr);
+               if (flag_secomm)
+                       vty_out(vty,
+                               "  no neighbor %s send-community extended\n",
                                addr);
-               } else if (flag_scomm && flag_secomm) {
-                       vty_out(vty, "  neighbor %s send-community both\n",
+
+               if (flag_slcomm)
+                       vty_out(vty, "  no neighbor %s send-community large\n",
                                addr);
-               } else {
-                       if (flag_scomm)
-                               vty_out(vty, "  neighbor %s send-community\n",
-                                       addr);
-                       if (flag_secomm)
-                               vty_out(vty,
-                                       "  neighbor %s send-community extended\n",
-                                       addr);
-                       if (flag_slcomm)
-                               vty_out(vty,
-                                       "  neighbor %s send-community large\n",
-                                       addr);
-               }
        }
 
        /* Default information */
@@ -7545,12 +7514,6 @@ int bgp_config_write(struct vty *vty)
        struct listnode *node, *nnode;
        struct listnode *mnode, *mnnode;
 
-       /* BGP Config type. */
-       if (bgp_option_check(BGP_OPT_CONFIG_CISCO)) {
-               vty_out(vty, "bgp config-type cisco\n");
-               write++;
-       }
-
        if (bm->rmap_update_timer != RMAP_DEFAULT_UPDATE_TIMER)
                vty_out(vty, "bgp route-map delay-timer %u\n",
                        bm->rmap_update_timer);
@@ -7574,10 +7537,6 @@ int bgp_config_write(struct vty *vty)
                                ? "view" : "vrf", bgp->name);
                vty_out(vty, "\n");
 
-               /* No Synchronization */
-               if (bgp_option_check(BGP_OPT_CONFIG_CISCO))
-                       vty_out(vty, " no synchronization\n");
-
                /* BGP fast-external-failover. */
                if (CHECK_FLAG(bgp->flags, BGP_FLAG_NO_FAST_EXT_FAILOVER))
                        vty_out(vty, " no bgp fast-external-failover\n");
@@ -7791,10 +7750,6 @@ int bgp_config_write(struct vty *vty)
                if (bgp->autoshutdown)
                        vty_out(vty, " bgp default shutdown\n");
 
-               /* No auto-summary */
-               if (bgp_option_check(BGP_OPT_CONFIG_CISCO))
-                       vty_out(vty, " no auto-summary\n");
-
                /* IPv4 unicast configuration.  */
                bgp_config_write_family(vty, bgp, AFI_IP, SAFI_UNICAST);
 
index 7afcf11249e7b036da2fcdfd38a3d4dd9d4ab14b..518f1f6714fdf2009b62a09eca10562a7be0e32c 100644 (file)
@@ -134,9 +134,8 @@ struct bgp_master {
        /* Various BGP global configuration.  */
        uint8_t options;
 #define BGP_OPT_NO_FIB                   (1 << 0)
-#define BGP_OPT_CONFIG_CISCO             (1 << 2)
-#define BGP_OPT_NO_LISTEN                (1 << 3)
-#define BGP_OPT_NO_ZEBRA                 (1 << 4)
+#define BGP_OPT_NO_LISTEN                (1 << 1)
+#define BGP_OPT_NO_ZEBRA                 (1 << 2)
 
        uint64_t updgrp_idspace;
        uint64_t subgrp_idspace;