Remove all dead #if 0 code from bgpd.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
peer->update_time = 0;
-/* Until we are sure that there is no problem about prefix count
- this should be commented out.*/
-#if 0
- /* Reset prefix count */
- peer->pcount[AFI_IP][SAFI_UNICAST] = 0;
- peer->pcount[AFI_IP][SAFI_MULTICAST] = 0;
- peer->pcount[AFI_IP][SAFI_LABELED_UNICAST] = 0;
- peer->pcount[AFI_IP][SAFI_MPLS_VPN] = 0;
- peer->pcount[AFI_IP6][SAFI_UNICAST] = 0;
- peer->pcount[AFI_IP6][SAFI_MULTICAST] = 0;
- peer->pcount[AFI_IP6][SAFI_LABELED_UNICAST] = 0;
-#endif /* 0 */
-
if (!CHECK_FLAG(peer->flags, PEER_FLAG_CONFIG_NODE)
&& !(CHECK_FLAG(peer->flags, PEER_FLAG_DELETE))) {
peer_delete(peer);
zlog_warn("PBR: Sample action Ignored");
}
}
-#if 0
- if (api->actions[i].u.za.filter
- & TRAFFIC_ACTION_DISTRIBUTE) {
- if (BGP_DEBUG(pbr, PBR)) {
- bgp_pbr_print_policy_route(api);
- zlog_warn("PBR: Distribute action Applies");
- }
- continue_loop = 0;
- /* continue forwarding entry as before
- * no action
- */
- }
-#endif /* XXX to confirm behaviour of traffic action. for now , ignore */
/* terminate action: run other filters
*/
break;
double total_space;
};
-#if 0
-#define TALLY_SIGFIG 100000
-static unsigned long
-ravg_tally (unsigned long count, unsigned long oldavg, unsigned long newval)
-{
- unsigned long newtot = (count-1) * oldavg + (newval * TALLY_SIGFIG);
- unsigned long res = (newtot * TALLY_SIGFIG) / count;
- unsigned long ret = newtot / count;
-
- if ((res % TALLY_SIGFIG) > (TALLY_SIGFIG/2))
- return ret + 1;
- else
- return ret;
-}
-#endif
-
static void bgp_table_stats_rn(struct bgp_dest *dest, struct bgp_dest *top,
struct bgp_table_stats *ts, unsigned int space)
{
ts->counts[BGP_STATS_PREFIXES]++;
ts->counts[BGP_STATS_TOTPLEN] += rn_p->prefixlen;
-#if 0
- ts->counts[BGP_STATS_AVGPLEN]
- = ravg_tally (ts->counts[BGP_STATS_PREFIXES],
- ts->counts[BGP_STATS_AVGPLEN],
- rn_p->prefixlen);
-#endif
-
/* check if the prefix is included by any other announcements */
while (pdest && !bgp_dest_has_bgp_path_info_data(pdest))
pdest = bgp_dest_parent_nolock(pdest);
ts->counts[BGP_STATS_ASPATH_TOTHOPS] += hops;
ts->counts[BGP_STATS_ASPATH_TOTSIZE] += size;
-#if 0
- ts->counts[BGP_STATS_ASPATH_AVGHOPS]
- = ravg_tally (ts->counts[BGP_STATS_ASPATH_COUNT],
- ts->counts[BGP_STATS_ASPATH_AVGHOPS],
- hops);
- ts->counts[BGP_STATS_ASPATH_AVGSIZE]
- = ravg_tally (ts->counts[BGP_STATS_ASPATH_COUNT],
- ts->counts[BGP_STATS_ASPATH_AVGSIZE],
- size);
-#endif
if (highest > ts->counts[BGP_STATS_ASN_HIGHEST])
ts->counts[BGP_STATS_ASN_HIGHEST] = highest;
}
continue;
switch (i) {
-#if 0
- case BGP_STATS_ASPATH_AVGHOPS:
- case BGP_STATS_ASPATH_AVGSIZE:
- case BGP_STATS_AVGPLEN:
- vty_out (vty, "%-30s: ", table_stats_strs[i]);
- vty_out (vty, "%12.2f",
- (float)ts.counts[i] / (float)TALLY_SIGFIG);
- break;
-#endif
case BGP_STATS_ASPATH_TOTHOPS:
case BGP_STATS_ASPATH_TOTSIZE:
if (!json) {
bpacket_add_peer(pkt, paf);
- bpacket_queue_sanity_check(SUBGRP_PKTQ(subgrp));
if (BGP_DEBUG(update_groups, UPDATE_GROUPS))
zlog_debug("peer %s added to subgroup s%" PRIu64,
paf->peer->host, subgrp->id);
pkt = bpacket_next(pkt);
}
- bpacket_queue_sanity_check(SUBGRP_PKTQ(dest));
-
return count;
}
struct bpacket_queue {
TAILQ_HEAD(pkt_queue, bpacket) pkts;
-#if 0
- /* A dummy packet that is used to thread all peers that have
- completed their work */
- struct bpacket sentinel;
-#endif
-
unsigned int conf_max_count;
unsigned int curr_count;
unsigned int hwm_count;
TAILQ_INIT(&(q->pkts));
}
-/*
- * bpacket_queue_sanity_check
- */
-void bpacket_queue_sanity_check(struct bpacket_queue __attribute__((__unused__))
- * q)
-{
-#if 0
- struct bpacket *pkt;
-
- pkt = bpacket_queue_last (q);
- assert (pkt);
- assert (!pkt->buffer);
-
- /*
- * Make sure the count of packets is correct.
- */
- int num_pkts = 0;
-
- pkt = bpacket_queue_first (q);
- while (pkt)
- {
- num_pkts++;
-
- if (num_pkts > q->curr_count)
- assert (0);
-
- pkt = TAILQ_NEXT (pkt, pkt_train);
- }
-
- assert (num_pkts == q->curr_count);
-#endif
-}
-
/*
* bpacket_queue_add_packet
*
else
bpacket_attr_vec_arr_reset(&pkt->arr);
bpacket_queue_add_packet(q, pkt);
- bpacket_queue_sanity_check(q);
return pkt;
}
* Fill in the new information into the current sentinel and create a
* new sentinel.
*/
- bpacket_queue_sanity_check(q);
last_pkt = bpacket_queue_last(q);
assert(last_pkt->buffer == NULL);
last_pkt->buffer = s;
pkt->ver++;
bpacket_queue_add_packet(q, pkt);
- bpacket_queue_sanity_check(q);
return last_pkt;
}
num_deleted++;
}
- bpacket_queue_sanity_check(q);
return num_deleted;
}
struct bgp_attr_encap_subtlv *encaptlv;
char buf[PREFIX_STRLEN];
char buf2[RD_ADDRSTRLEN];
-#if 0 /* unused? */
- struct prefix pfx_buf;
-#endif
struct rfapi_nexthop *lnh = NULL; /* local nexthop */
struct rfapi_vn_option *vo;
return;
}
-#if 0 /* unused? */
- if ((safi == SAFI_MPLS_VPN) && (flags & RFAPI_AHR_SET_PFX_TO_NEXTHOP))
- {
-
- if (rfapiRaddr2Qprefix (nexthop, &pfx_buf))
- {
- vnc_zlog_debug_verbose
- ("%s: can't set pfx to vn addr, not adding SAFI_MPLS_VPN route",
- __func__);
- return;
- }
- p = &pfx_buf;
- }
-#endif
for (vo = options_vn; vo; vo = vo->next) {
if (RFAPI_VN_OPTION_TYPE_L2ADDR == vo->type) {
l2o = &vo->v.l2addr;
uint8_t type, uint8_t sub_type, int flags);
#define RFAPI_AHR_NO_TUNNEL_SUBTLV 0x00000001
#define RFAPI_AHR_RFPOPT_IS_VNCTLV 0x00000002 /* hack! */
-#if 0 /* unused? */
-# define RFAPI_AHR_SET_PFX_TO_NEXTHOP 0x00000004
-#endif
extern void del_vnc_route(struct rfapi_descriptor *rfd, struct peer *peer,
struct bgp *bgp, safi_t safi, const struct prefix *p,