diff options
-rw-r--r-- | ospfd/ospf_api.c | 16 | ||||
-rw-r--r-- | ospfd/ospf_api.h | 6 | ||||
-rw-r--r-- | ospfd/ospf_dump.h | 5 | ||||
-rw-r--r-- | ospfd/ospf_flood.c | 54 | ||||
-rw-r--r-- | ospfd/ospf_lsa.c | 40 | ||||
-rw-r--r-- | ospfd/ospf_packet.c | 4 |
6 files changed, 9 insertions, 116 deletions
diff --git a/ospfd/ospf_api.c b/ospfd/ospf_api.c index f06e45392..1ace0977b 100644 --- a/ospfd/ospf_api.c +++ b/ospfd/ospf_api.c @@ -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) diff --git a/ospfd/ospf_api.h b/ospfd/ospf_api.h index c99923e7b..0fc683a5d 100644 --- a/ospfd/ospf_api.h +++ b/ospfd/ospf_api.h @@ -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) */ diff --git a/ospfd/ospf_dump.h b/ospfd/ospf_dump.h index 397f666f6..09c1811c3 100644 --- a/ospfd/ospf_dump.h +++ b/ospfd/ospf_dump.h @@ -108,11 +108,6 @@ (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)) diff --git a/ospfd/ospf_flood.c b/ospfd/ospf_flood.c index 1d85a0498..a72caa841 100644 --- a/ospfd/ospf_flood.c +++ b/ospfd/ospf_flood.c @@ -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); } diff --git a/ospfd/ospf_lsa.c b/ospfd/ospf_lsa.c index 5ab0927e7..3e3f28802 100644 --- a/ospfd/ospf_lsa.c +++ b/ospfd/ospf_lsa.c @@ -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 */ diff --git a/ospfd/ospf_packet.c b/ospfd/ospf_packet.c index 453135cb4..6c7531a36 100644 --- a/ospfd/ospf_packet.c +++ b/ospfd/ospf_packet.c @@ -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)); |