]> git.puffer.fish Git - mirror/frr.git/commitdiff
ospfd: Remove ORIGINAL_CODING check
authorDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 6 Nov 2019 22:12:51 +0000 (17:12 -0500)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 19 Nov 2019 12:47:19 +0000 (07:47 -0500)
We have a bunch of places that look for ORIGINAL_CODING.  There is
nothing in our configure system to define this value and a quick
git blame shows this code as being original to the import a very
very long time ago.  This is dead code, removing.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
ospfd/ospf_api.c
ospfd/ospf_api.h
ospfd/ospf_dump.h
ospfd/ospf_flood.c
ospfd/ospf_lsa.c
ospfd/ospf_packet.c

index f06e45392eb09968afe4692c93f29daf7c1fd23e..1ace0977bc349cc7efae6dd246673db0a25ced26 100644 (file)
@@ -246,13 +246,6 @@ void msg_print(struct msg *msg)
                return;
        }
 
-#ifdef ORIGINAL_CODING
-       zlog_debug(
-               "msg=%p msgtype=%d msglen=%d msgseq=%d streamdata=%p streamsize=%lu\n",
-               msg, msg->hdr.msgtype, ntohs(msg->hdr.msglen),
-               ntohl(msg->hdr.msgseq), STREAM_DATA(msg->s),
-               STREAM_SIZE(msg->s));
-#else /* ORIGINAL_CODING */
        /* API message common header part. */
        zlog_debug("API-msg [%s]: type(%d),len(%d),seq(%lu),data(%p),size(%zd)",
                   ospf_api_typename(msg->hdr.msgtype), msg->hdr.msgtype,
@@ -260,16 +253,7 @@ void msg_print(struct msg *msg)
                   (unsigned long)ntohl(msg->hdr.msgseq), STREAM_DATA(msg->s),
                   STREAM_SIZE(msg->s));
 
-/* API message body part. */
-#ifdef ndef
-       /* Generic Hex/Ascii dump */
-       DumpBuf(STREAM_DATA(msg->s), STREAM_SIZE(msg->s)); /* Sorry, deleted! */
-#else  /* ndef */
-/* Message-type dependent dump function. */
-#endif /* ndef */
-
        return;
-#endif /* ORIGINAL_CODING */
 }
 
 void msg_free(struct msg *msg)
index c99923e7b8261d5ba2959b5ecc02aa4f7d09a518..0fc683a5dbfe73c40972914a37df4b42ceacab2b 100644 (file)
@@ -140,16 +140,10 @@ struct msg_unregister_opaque_type {
  * Power2[0] is not used. */
 
 
-#ifdef ORIGINAL_CODING
-static const uint16_t Power2[] = {0x0,   0x1,    0x2,    0x4,    0x8,   0x10,
-                                 0x20,  0x40,   0x80,   0x100,  0x200, 0x400,
-                                 0x800, 0x1000, 0x2000, 0x4000, 0x8000};
-#else
 static const uint16_t Power2[] = {
        0,       (1 << 0),  (1 << 1),  (1 << 2),  (1 << 3), (1 << 4),
        (1 << 5),  (1 << 6),  (1 << 7),  (1 << 8),  (1 << 9), (1 << 10),
        (1 << 11), (1 << 12), (1 << 13), (1 << 14), (1 << 15)};
-#endif /* ORIGINAL_CODING */
 
 struct lsa_filter_type {
        uint16_t typemask; /* bitmask for selecting LSA types (1..16) */
index 397f666f6907e845bc7548a22dce88608cb92118..09c1811c3c57eecaac284ac54fd76c9147cfd049 100644 (file)
        (conf_debug_ospf_packet[a] & OSPF_DEBUG_##b)
 #define IS_CONF_DEBUG_OSPF(a, b) (conf_debug_ospf_##a & OSPF_DEBUG_##b)
 
-#ifdef ORIGINAL_CODING
-#else  /* ORIGINAL_CODING */
-struct stream;
-#endif /* ORIGINAL_CODING */
-
 #define AREA_NAME(A)    ospf_area_name_string ((A))
 #define IF_NAME(I)      ospf_if_name_string ((I))
 
index 1d85a0498400981dbc06e530f22e4b474621fea1..a72caa8415bbaa46dd61139a2dd26680c89cdb62 100644 (file)
@@ -454,13 +454,8 @@ static int ospf_flood_through_interface(struct ospf_interface *oi,
                        }
                }
 
-/* If the new LSA was received from this neighbor,
-   examine the next neighbor. */
-#ifdef ORIGINAL_CODING
-               if (inbr)
-                       if (IPV4_ADDR_SAME(&inbr->router_id, &onbr->router_id))
-                               continue;
-#else  /* ORIGINAL_CODING */
+ /* If the new LSA was received from this neighbor,
+    examine the next neighbor. */
                if (inbr) {
                        /*
                         * Triggered by LSUpd message parser "ospf_ls_upd ()".
@@ -486,7 +481,6 @@ static int ospf_flood_through_interface(struct ospf_interface *oi,
                                continue;
                        }
                }
-#endif /* ORIGINAL_CODING */
 
                /* Add the new LSA to the Link state retransmission list
                   for the adjacency. The LSA will be retransmitted
@@ -691,43 +685,14 @@ int ospf_flood_through(struct ospf *ospf, struct ospf_neighbor *inbr,
 {
        int lsa_ack_flag = 0;
 
-/* Type-7 LSA's for NSSA are flooded throughout the AS here, and
-   upon return are updated in the LSDB for Type-7's.  Later,
-   re-fresh will re-send them (and also, if ABR, packet code will
-   translate to Type-5's)
+       /* Type-7 LSA's for NSSA are flooded throughout the AS here, and
+          upon return are updated in the LSDB for Type-7's.  Later,
+          re-fresh will re-send them (and also, if ABR, packet code will
+          translate to Type-5's)
 
-   As usual, Type-5 LSA's (if not DISCARDED because we are STUB or
-   NSSA) are flooded throughout the AS, and are updated in the
-   global table.  */
-#ifdef ORIGINAL_CODING
-       switch (lsa->data->type) {
-       case OSPF_ROUTER_LSA:
-       case OSPF_NETWORK_LSA:
-       case OSPF_SUMMARY_LSA:
-       case OSPF_ASBR_SUMMARY_LSA:
-       case OSPF_OPAQUE_LINK_LSA: /* ospf_flood_through_interface ? */
-       case OSPF_OPAQUE_AREA_LSA:
-               lsa_ack_flag =
-                       ospf_flood_through_area(inbr->oi->area, inbr, lsa);
-               break;
-       case OSPF_AS_EXTERNAL_LSA: /* Type-5 */
-       case OSPF_OPAQUE_AS_LSA:
-               lsa_ack_flag = ospf_flood_through_as(ospf, inbr, lsa);
-               break;
-       /* Type-7 Only received within NSSA, then flooded */
-       case OSPF_AS_NSSA_LSA:
-               /* Any P-bit was installed with the Type-7. */
-               lsa_ack_flag =
-                       ospf_flood_through_area(inbr->oi->area, inbr, lsa);
-
-               if (IS_DEBUG_OSPF_NSSA)
-                       zlog_debug(
-                               "ospf_flood_through: LOCAL NSSA FLOOD of Type-7.");
-               break;
-       default:
-               break;
-       }
-#else  /* ORIGINAL_CODING */
+          As usual, Type-5 LSA's (if not DISCARDED because we are STUB or
+          NSSA) are flooded throughout the AS, and are updated in the
+          global table.  */
        /*
         * At the common sub-sub-function "ospf_flood_through_interface()",
         * a parameter "inbr" will be used to distinguish the called context
@@ -757,7 +722,6 @@ int ospf_flood_through(struct ospf *ospf, struct ospf_neighbor *inbr,
                lsa_ack_flag = ospf_flood_through_area(lsa->area, inbr, lsa);
                break;
        }
-#endif /* ORIGINAL_CODING */
 
        return (lsa_ack_flag);
 }
index 5ab0927e71071f06d5d75fbf144564f6cc510824..3e3f288023961ae6318c3a1337d1890c4c0bceeb 100644 (file)
@@ -3202,45 +3202,6 @@ int ospf_lsa_different(struct ospf_lsa *l1, struct ospf_lsa *l2)
        return 0;
 }
 
-#ifdef ORIGINAL_CODING
-void ospf_lsa_flush_self_originated(struct ospf_neighbor *nbr,
-                                   struct ospf_lsa *self, struct ospf_lsa *new)
-{
-       uint32_t seqnum;
-
-       /* Adjust LS Sequence Number. */
-       seqnum = ntohl(new->data->ls_seqnum) + 1;
-       self->data->ls_seqnum = htonl(seqnum);
-
-       /* Recalculate LSA checksum. */
-       ospf_lsa_checksum(self->data);
-
-       /* Reflooding LSA. */
-       /*  RFC2328  Section 13.3
-                 On non-broadcast networks, separate   Link State Update
-                 packets must be sent, as unicasts, to each adjacent   neighbor
-                 (i.e., those in state Exchange or greater).    The destination
-                 IP addresses for these packets are the neighbors' IP
-                 addresses.   */
-       if (nbr->oi->type == OSPF_IFTYPE_NBMA) {
-               struct route_node *rn;
-               struct ospf_neighbor *onbr;
-
-               for (rn = route_top(nbr->oi->nbrs); rn; rn = route_next(rn))
-                       if ((onbr = rn->info) != NULL)
-                               if (onbr != nbr->oi->nbr_self
-                                   && onbr->status >= NSM_Exchange)
-                                       ospf_ls_upd_send_lsa(
-                                               onbr, self,
-                                               OSPF_SEND_PACKET_DIRECT);
-       } else
-               ospf_ls_upd_send_lsa(nbr, self, OSPF_SEND_PACKET_INDIRECT);
-
-       if (IS_DEBUG_OSPF(lsa, LSA_GENERATE))
-               zlog_debug("LSA[Type%d:%s]: Flush self-originated LSA",
-                          self->data->type, inet_ntoa(self->data->id));
-}
-#else  /* ORIGINAL_CODING */
 int ospf_lsa_flush_schedule(struct ospf *ospf, struct ospf_lsa *lsa)
 {
        if (lsa == NULL || !IS_LSA_SELF(lsa))
@@ -3345,7 +3306,6 @@ void ospf_flush_self_originated_lsas_now(struct ospf *ospf)
 
        return;
 }
-#endif /* ORIGINAL_CODING */
 
 /* If there is self-originated LSA, then return 1, otherwise return 0. */
 /* An interface-independent version of ospf_lsa_is_self_originated */
index 453135cb4d89a34c8ab1a32c4023fb1478a5ace8..6c7531a3626e452f18c79dad89e067450c0fd653 100644 (file)
@@ -1505,10 +1505,6 @@ static void ospf_db_desc(struct ip *iph, struct ospf_header *ospfh,
 
                /* Check DD Options. */
                if (dd->options != nbr->options) {
-#ifdef ORIGINAL_CODING
-                       /* Save the new options for debugging */
-                       nbr->options = dd->options;
-#endif /* ORIGINAL_CODING */
                        flog_warn(EC_OSPF_PACKET,
                                  "Packet[DD]: Neighbor %s options mismatch.",
                                  inet_ntoa(nbr->router_id));