diff --git a/bfdd/bfdd.c b/bfdd/bfdd.c index b8a059708f21..0cac99010847 100644 --- a/bfdd/bfdd.c +++ b/bfdd/bfdd.c @@ -371,10 +371,6 @@ int main(int argc, char *argv[]) snprintf(ctl_path, sizeof(ctl_path), BFDD_CONTROL_SOCKET, "/", bfdd_di.pathspace); -#if 0 /* TODO add support for JSON configuration files. */ - parse_config(conf); -#endif - /* Initialize FRR infrastructure. */ master = frr_init(); diff --git a/bgpd/bgp_fsm.c b/bgpd/bgp_fsm.c index 29573a1957df..b69e2d71b653 100644 --- a/bgpd/bgp_fsm.c +++ b/bgpd/bgp_fsm.c @@ -1420,19 +1420,6 @@ int bgp_stop(struct peer *peer) 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); diff --git a/bgpd/bgp_pbr.c b/bgpd/bgp_pbr.c index 4f22f5bcfeb9..171522f8ae11 100644 --- a/bgpd/bgp_pbr.c +++ b/bgpd/bgp_pbr.c @@ -2845,19 +2845,6 @@ static void bgp_pbr_handle_entry(struct bgp *bgp, struct bgp_path_info *path, 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; diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 76d500f2dfe1..0ac9a42dc517 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -12314,22 +12314,6 @@ struct bgp_table_stats { 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) { @@ -12344,13 +12328,6 @@ static void bgp_table_stats_rn(struct bgp_dest *dest, struct bgp_dest *top, 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); @@ -12387,16 +12364,6 @@ static void bgp_table_stats_rn(struct bgp_dest *dest, struct bgp_dest *top, 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; } @@ -12506,15 +12473,6 @@ static int bgp_table_stats_single(struct vty *vty, struct bgp *bgp, afi_t afi, 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) { diff --git a/bgpd/bgp_updgrp.c b/bgpd/bgp_updgrp.c index 059e05ef71d0..621a14014fce 100644 --- a/bgpd/bgp_updgrp.c +++ b/bgpd/bgp_updgrp.c @@ -909,7 +909,6 @@ static void update_subgroup_add_peer(struct update_subgroup *subgrp, 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); @@ -1229,8 +1228,6 @@ static int update_subgroup_copy_packets(struct update_subgroup *dest, pkt = bpacket_next(pkt); } - bpacket_queue_sanity_check(SUBGRP_PKTQ(dest)); - return count; } diff --git a/bgpd/bgp_updgrp.h b/bgpd/bgp_updgrp.h index 7261933dc98b..694636ef3d9d 100644 --- a/bgpd/bgp_updgrp.h +++ b/bgpd/bgp_updgrp.h @@ -109,12 +109,6 @@ struct bpacket { 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; diff --git a/bgpd/bgp_updgrp_packet.c b/bgpd/bgp_updgrp_packet.c index 866bf8178a6c..0a3ecc584e2e 100644 --- a/bgpd/bgp_updgrp_packet.c +++ b/bgpd/bgp_updgrp_packet.c @@ -87,39 +87,6 @@ void bpacket_queue_init(struct bpacket_queue *q) 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 * @@ -168,7 +135,6 @@ struct bpacket *bpacket_queue_add(struct bpacket_queue *q, struct stream *s, else bpacket_attr_vec_arr_reset(&pkt->arr); bpacket_queue_add_packet(q, pkt); - bpacket_queue_sanity_check(q); return pkt; } @@ -176,7 +142,6 @@ struct bpacket *bpacket_queue_add(struct bpacket_queue *q, struct stream *s, * 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; @@ -190,7 +155,6 @@ struct bpacket *bpacket_queue_add(struct bpacket_queue *q, struct stream *s, pkt->ver++; bpacket_queue_add_packet(q, pkt); - bpacket_queue_sanity_check(q); return last_pkt; } @@ -290,7 +254,6 @@ static int bpacket_queue_compact(struct bpacket_queue *q) num_deleted++; } - bpacket_queue_sanity_check(q); return num_deleted; } diff --git a/bgpd/rfapi/rfapi.c b/bgpd/rfapi/rfapi.c index f7bbd44512b7..8c455c6ea5e8 100644 --- a/bgpd/rfapi/rfapi.c +++ b/bgpd/rfapi/rfapi.c @@ -578,9 +578,6 @@ void add_vnc_route(struct rfapi_descriptor *rfd, /* cookie, VPN UN addr, peer */ 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; @@ -603,20 +600,6 @@ void add_vnc_route(struct rfapi_descriptor *rfd, /* cookie, VPN UN addr, peer */ 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; diff --git a/bgpd/rfapi/rfapi_private.h b/bgpd/rfapi/rfapi_private.h index e24d62def444..af563679552d 100644 --- a/bgpd/rfapi/rfapi_private.h +++ b/bgpd/rfapi/rfapi_private.h @@ -289,9 +289,6 @@ add_vnc_route(struct rfapi_descriptor *rfd, /* cookie + UN addr for VPN */ 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, diff --git a/eigrpd/eigrp_filter.c b/eigrpd/eigrp_filter.c index 009b57e05f51..c77a6fc1b1d2 100644 --- a/eigrpd/eigrp_filter.c +++ b/eigrpd/eigrp_filter.c @@ -124,39 +124,6 @@ void eigrp_distribute_update(struct distribute_ctx *ctx, } else e->prefix[EIGRP_FILTER_OUT] = NULL; -// This is commented out, because the distribute.[ch] code -// changes looked poorly written from first glance -// commit was 133bdf2d -// TODO: DBS -#if 0 - /* route-map IN for whole process */ - if (dist->route[DISTRIBUTE_V4_IN]) - { - routemap = route_map_lookup_by_name (dist->route[DISTRIBUTE_V4_IN]); - if (routemap) - e->routemap[EIGRP_FILTER_IN] = routemap; - else - e->routemap[EIGRP_FILTER_IN] = NULL; - } - else - { - e->routemap[EIGRP_FILTER_IN] = NULL; - } - - /* route-map OUT for whole process */ - if (dist->route[DISTRIBUTE_V4_OUT]) - { - routemap = route_map_lookup_by_name (dist->route[DISTRIBUTE_V4_OUT]); - if (routemap) - e->routemap[EIGRP_FILTER_OUT] = routemap; - else - e->routemap[EIGRP_FILTER_OUT] = NULL; - } - else - { - e->routemap[EIGRP_FILTER_OUT] = NULL; - } -#endif // TODO: check Graceful restart after 10sec /* cancel GR scheduled */ @@ -232,36 +199,6 @@ void eigrp_distribute_update(struct distribute_ctx *ctx, } else ei->prefix[EIGRP_FILTER_OUT] = NULL; -#if 0 - /* route-map IN for whole process */ - if (dist->route[DISTRIBUTE_V4_IN]) - { - zlog_info("route[DISTRIBUTE_V4_IN]); - if (routemap) - ei->routemap[EIGRP_FILTER_IN] = routemap; - else - ei->routemap[EIGRP_FILTER_IN] = NULL; - } - else - { - ei->routemap[EIGRP_FILTER_IN] = NULL; - } - - /* route-map OUT for whole process */ - if (dist->route[DISTRIBUTE_V4_OUT]) - { - routemap = route_map_lookup_by_name (dist->route[DISTRIBUTE_V4_OUT]); - if (routemap) - ei->routemap[EIGRP_FILTER_OUT] = routemap; - else - ei->routemap[EIGRP_FILTER_OUT] = NULL; - } - else - { - ei->routemap[EIGRP_FILTER_OUT] = NULL; - } -#endif // TODO: check Graceful restart after 10sec /* Cancel GR scheduled */ diff --git a/isisd/isis_bpf.c b/isisd/isis_bpf.c index 454da99e094f..88c3bfa63c40 100644 --- a/isisd/isis_bpf.c +++ b/isisd/isis_bpf.c @@ -67,12 +67,6 @@ uint8_t *readbuff = NULL; static const uint8_t ALL_L1_ISS[6] = {0x01, 0x80, 0xC2, 0x00, 0x00, 0x14}; static const uint8_t ALL_L2_ISS[6] = {0x01, 0x80, 0xC2, 0x00, 0x00, 0x15}; -#if 0 -/* missing support for P2P-over-LAN / ES-IS on BSD */ -static const uint8_t ALL_ISS[6] = {0x09, 0x00, 0x2B, 0x00, 0x00, 0x05}; -static const uint8_t ALL_ESS[6] = {0x09, 0x00, 0x2B, 0x00, 0x00, 0x04}; -#endif - static char sock_buff[16384]; static int open_bpf_dev(struct isis_circuit *circuit) diff --git a/isisd/isis_dlpi.c b/isisd/isis_dlpi.c index 06fb41430c27..bb8c54259768 100644 --- a/isisd/isis_dlpi.c +++ b/isisd/isis_dlpi.c @@ -57,11 +57,6 @@ static t_uscalar_t dlpi_ctl[1024]; /* DLPI control messages */ static const uint8_t ALL_L1_ISS[6] = {0x01, 0x80, 0xC2, 0x00, 0x00, 0x14}; static const uint8_t ALL_L2_ISS[6] = {0x01, 0x80, 0xC2, 0x00, 0x00, 0x15}; static const uint8_t ALL_ISS[6] = {0x09, 0x00, 0x2B, 0x00, 0x00, 0x05}; -#if 0 -/* missing support for ES-IS on Solaris */ -static const uint8_t ALL_ESS[6] = {0x09, 0x00, 0x2B, 0x00, 0x00, 0x04}; -#endif - static uint8_t sock_buff[16384]; static unsigned short pf_filter[] = { diff --git a/lib/buffer.c b/lib/buffer.c index 459d98e75d2e..42796faae82b 100644 --- a/lib/buffer.c +++ b/lib/buffer.c @@ -468,16 +468,6 @@ buffer_status_t buffer_write(struct buffer *b, int fd, const void *p, { ssize_t nbytes; -#if 0 - /* - * Should we attempt to drain any previously buffered data? - * This could help reduce latency in pushing out the data if - * we are stuck in a long-running thread that is preventing - * the main select loop from calling the flush thread... - */ - if (b->head && (buffer_flush_available(b, fd) == BUFFER_ERROR)) - return BUFFER_ERROR; -#endif if (b->head) /* Buffer is not empty, so do not attempt to write the new data. */ diff --git a/lib/if.c b/lib/if.c index c707c4c6d904..fa0b1d0195ad 100644 --- a/lib/if.c +++ b/lib/if.c @@ -802,70 +802,6 @@ void if_dump_all(void) if_dump(ifp); } -#if 0 -/* For debug purpose. */ -DEFUN (show_address, - show_address_cmd, - "show address [vrf NAME]", - SHOW_STR - "address\n" - VRF_CMD_HELP_STR) -{ - int idx_vrf = 3; - struct listnode *node; - struct interface *ifp; - struct connected *ifc; - struct prefix *p; - vrf_id_t vrf_id = VRF_DEFAULT; - - if (argc > 2) - VRF_GET_ID (vrf_id, argv[idx_vrf]->arg); - - FOR_ALL_INTERFACES (vrf, ifp) { - for (ALL_LIST_ELEMENTS_RO (ifp->connected, node, ifc)) { - p = ifc->address; - - if (p->family == AF_INET) - vty_out (vty, "%pFX\n", p); - } - } - return CMD_SUCCESS; -} - -DEFUN (show_address_vrf_all, - show_address_vrf_all_cmd, - "show address vrf all", - SHOW_STR - "address\n" - VRF_ALL_CMD_HELP_STR) -{ - struct vrf *vrf; - struct listnode *node; - struct interface *ifp; - struct connected *ifc; - struct prefix *p; - - RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) - { - if (RB_EMPTY (if_name_head, &vrf->ifaces_by_name)) - continue; - - vty_out (vty, "\nVRF %s(%u)\n\n", - VRF_LOGNAME(vrf), vrf->vrf_id); - - FOR_ALL_INTERFACES (vrf, ifp) { - for (ALL_LIST_ELEMENTS_RO (ifp->connected, node, ifc)) { - p = ifc->address; - - if (p->family == AF_INET) - vty_out (vty, "%pFX\n", p); - } - } - } - return CMD_SUCCESS; -} -#endif - /* Allocate connected structure. */ struct connected *connected_new(void) { @@ -1083,84 +1019,6 @@ struct connected *connected_get_linklocal(struct interface *ifp) return c; } -#if 0 /* this route_table of struct connected's is unused \ - * however, it would be good to use a route_table rather than \ - * a list.. \ - */ -/* Interface looking up by interface's address. */ -/* Interface's IPv4 address reverse lookup table. */ -struct route_table *ifaddr_ipv4_table; -/* struct route_table *ifaddr_ipv6_table; */ - -static void -ifaddr_ipv4_add (struct in_addr *ifaddr, struct interface *ifp) -{ - struct route_node *rn; - struct prefix_ipv4 p; - - p.family = AF_INET; - p.prefixlen = IPV4_MAX_PREFIXLEN; - p.prefix = *ifaddr; - - rn = route_node_get (ifaddr_ipv4_table, (struct prefix *) &p); - if (rn) - { - route_unlock_node (rn); - zlog_info("ifaddr_ipv4_add(): address %pI4 is already added", - ifaddr); - return; - } - rn->info = ifp; -} - -static void -ifaddr_ipv4_delete (struct in_addr *ifaddr, struct interface *ifp) -{ - struct route_node *rn; - struct prefix_ipv4 p; - - p.family = AF_INET; - p.prefixlen = IPV4_MAX_PREFIXLEN; - p.prefix = *ifaddr; - - rn = route_node_lookup (ifaddr_ipv4_table, (struct prefix *) &p); - if (! rn) - { - zlog_info("%s: can't find address %pI4", __func__, ifaddr); - return; - } - rn->info = NULL; - route_unlock_node (rn); - route_unlock_node (rn); -} - -/* Lookup interface by interface's IP address or interface index. */ -static struct interface * -ifaddr_ipv4_lookup (struct in_addr *addr, ifindex_t ifindex) -{ - struct prefix_ipv4 p; - struct route_node *rn; - struct interface *ifp; - - if (addr) - { - p.family = AF_INET; - p.prefixlen = IPV4_MAX_PREFIXLEN; - p.prefix = *addr; - - rn = route_node_lookup (ifaddr_ipv4_table, (struct prefix *) &p); - if (! rn) - return NULL; - - ifp = rn->info; - route_unlock_node (rn); - return ifp; - } - else - return if_lookup_by_index(ifindex, VRF_DEFAULT); -} -#endif /* ifaddr_ipv4_table */ - void if_terminate(struct vrf *vrf) { struct interface *ifp; diff --git a/lib/vty.c b/lib/vty.c index 21b3d47b097b..4062b183e721 100644 --- a/lib/vty.c +++ b/lib/vty.c @@ -396,16 +396,6 @@ static void vty_do_window_size(struct vty *vty) vty_out(vty, "%s", cmd); } -#if 0 /* Currently not used. */ -/* Make don't use lflow vty interface. */ -static void -vty_dont_lflow_ahead (struct vty *vty) -{ - unsigned char cmd[] = { IAC, DONT, TELOPT_LFLOW, '\0' }; - vty_out (vty, "%s", cmd); -} -#endif /* 0 */ - /* Authentication of vty */ static void vty_auth(struct vty *vty, char *buf) { @@ -1090,11 +1080,6 @@ static void vty_describe_command(struct vty *vty) vector_free(varcomps); } -#if 0 - vty_out (vty, " %-*s %s\n", width - desc->cmd[0] == '.' ? desc->cmd + 1 : desc->cmd, - desc->str ? desc->str : ""); -#endif /* 0 */ } if ((token = token_cr)) { @@ -1396,12 +1381,6 @@ static int vty_read(struct thread *thread) case 'Q': vty_buffer_reset(vty); break; -#if 0 /* More line does not work for "show ip bgp". */ - case '\n': - case '\r': - vty->status = VTY_MORELINE; - break; -#endif default: break; } diff --git a/lib/workqueue.c b/lib/workqueue.c index f8e4677220f7..8eabdf52e763 100644 --- a/lib/workqueue.c +++ b/lib/workqueue.c @@ -377,11 +377,6 @@ int work_queue_run(struct thread *thread) if (yielded) wq->yields++; -#if 0 - printf ("%s: cycles %d, new: best %d, worst %d\n", - __func__, cycles, wq->cycles.best, wq->cycles.granularity); -#endif - /* Is the queue done yet? If it is, call the completion callback. */ if (!work_queue_empty(wq)) { if (ret == WQ_RETRY_LATER || diff --git a/ospf6d/ospf6_abr.c b/ospf6d/ospf6_abr.c index eee98275ec7e..7bd51138b303 100644 --- a/ospf6d/ospf6_abr.c +++ b/ospf6d/ospf6_abr.c @@ -160,35 +160,22 @@ int ospf6_abr_originate_summary_to_area(struct ospf6_route *route, && route->type != OSPF6_DEST_TYPE_RANGE && ((route->type != OSPF6_DEST_TYPE_ROUTER) || !CHECK_FLAG(route->path.router_bits, OSPF6_ROUTER_BIT_E))) { -#if 0 - zlog_debug( - "Route type is none of network, range nor ASBR, ignore"); -#endif return 0; } /* AS External routes are never considered */ if (route->path.type == OSPF6_PATH_TYPE_EXTERNAL1 || route->path.type == OSPF6_PATH_TYPE_EXTERNAL2) { -#if 0 - zlog_debug("Path type is external, skip"); -#endif return 0; } /* do not generate if the path's area is the same as target area */ if (route->path.area_id == area->area_id) { -#if 0 - zlog_debug("The route is in the area itself, ignore"); -#endif return 0; } /* do not generate if the nexthops belongs to the target area */ if (ospf6_abr_nexthops_belong_to_area(route, area)) { -#if 0 - zlog_debug("The route's nexthop is in the same area, ignore"); -#endif return 0; } diff --git a/ospf6d/ospf6_flood.c b/ospf6d/ospf6_flood.c index 0662cfd68364..2d896546faf5 100644 --- a/ospf6d/ospf6_flood.c +++ b/ospf6d/ospf6_flood.c @@ -452,12 +452,6 @@ void ospf6_flood_area(struct ospf6_neighbor *from, struct ospf6_lsa *lsa, && oi != OSPF6_INTERFACE(lsa->lsdb->data)) continue; -#if 0 - if (OSPF6_LSA_SCOPE (lsa->header->type) == OSPF6_SCOPE_AS && - ospf6_is_interface_virtual_link (oi)) - continue; -#endif /*0*/ - ospf6_flood_interface(from, lsa, oi); } } @@ -527,12 +521,6 @@ static void ospf6_flood_clear_area(struct ospf6_lsa *lsa, struct ospf6_area *oa) && oi != OSPF6_INTERFACE(lsa->lsdb->data)) continue; -#if 0 - if (OSPF6_LSA_SCOPE (lsa->header->type) == OSPF6_SCOPE_AS && - ospf6_is_interface_virtual_link (oi)) - continue; -#endif /*0*/ - ospf6_flood_clear_interface(lsa, oi); } } diff --git a/ospf6d/ospf6_top.c b/ospf6d/ospf6_top.c index 7b4ed84d5384..4a3697ed3f3e 100644 --- a/ospf6d/ospf6_top.c +++ b/ospf6d/ospf6_top.c @@ -718,39 +718,6 @@ DEFUN (no_ospf6_distance_ospf6, return CMD_SUCCESS; } -#if 0 -DEFUN (ospf6_distance_source, - ospf6_distance_source_cmd, - "distance (1-255) X:X::X:X/M [WORD]", - "Administrative distance\n" - "Distance value\n" - "IP source prefix\n" - "Access list name\n") -{ - VTY_DECLVAR_CONTEXT(ospf6, o); - char *alname = (argc == 4) ? argv[3]->arg : NULL; - ospf6_distance_set (vty, o, argv[1]->arg, argv[2]->arg, alname); - - return CMD_SUCCESS; -} - -DEFUN (no_ospf6_distance_source, - no_ospf6_distance_source_cmd, - "no distance (1-255) X:X::X:X/M [WORD]", - NO_STR - "Administrative distance\n" - "Distance value\n" - "IP source prefix\n" - "Access list name\n") -{ - VTY_DECLVAR_CONTEXT(ospf6, o); - char *alname = (argc == 5) ? argv[4]->arg : NULL; - ospf6_distance_unset (vty, o, argv[2]->arg, argv[3]->arg, alname); - - return CMD_SUCCESS; -} -#endif - DEFUN (ospf6_interface_area, ospf6_interface_area_cmd, "interface IFNAME area ", @@ -911,55 +878,6 @@ DEFUN (no_ospf6_stub_router_admin, return CMD_SUCCESS; } -#if 0 -DEFUN (ospf6_stub_router_startup, - ospf6_stub_router_startup_cmd, - "stub-router on-startup (5-86400)", - "Make router a stub router\n" - "Advertise inability to be a transit router\n" - "Automatically advertise as stub-router on startup of OSPF6\n" - "Time (seconds) to advertise self as stub-router\n") -{ - return CMD_SUCCESS; -} - -DEFUN (no_ospf6_stub_router_startup, - no_ospf6_stub_router_startup_cmd, - "no stub-router on-startup", - NO_STR - "Make router a stub router\n" - "Advertise inability to be a transit router\n" - "Automatically advertise as stub-router on startup of OSPF6\n" - "Time (seconds) to advertise self as stub-router\n") -{ - return CMD_SUCCESS; -} - -DEFUN (ospf6_stub_router_shutdown, - ospf6_stub_router_shutdown_cmd, - "stub-router on-shutdown (5-86400)", - "Make router a stub router\n" - "Advertise inability to be a transit router\n" - "Automatically advertise as stub-router before shutdown\n" - "Time (seconds) to advertise self as stub-router\n") -{ - return CMD_SUCCESS; -} - -DEFUN (no_ospf6_stub_router_shutdown, - no_ospf6_stub_router_shutdown_cmd, - "no stub-router on-shutdown", - NO_STR - "Make router a stub router\n" - "Advertise inability to be a transit router\n" - "Automatically advertise as stub-router before shutdown\n" - "Time (seconds) to advertise self as stub-router\n") -{ - return CMD_SUCCESS; -} -#endif - - static void ospf6_show(struct vty *vty, struct ospf6 *o, json_object *json, bool use_json) { @@ -1390,20 +1308,9 @@ void ospf6_top_init(void) install_element(OSPF6_NODE, &no_ospf6_interface_area_cmd); install_element(OSPF6_NODE, &ospf6_stub_router_admin_cmd); install_element(OSPF6_NODE, &no_ospf6_stub_router_admin_cmd); -/* For a later time */ -#if 0 - install_element (OSPF6_NODE, &ospf6_stub_router_startup_cmd); - install_element (OSPF6_NODE, &no_ospf6_stub_router_startup_cmd); - install_element (OSPF6_NODE, &ospf6_stub_router_shutdown_cmd); - install_element (OSPF6_NODE, &no_ospf6_stub_router_shutdown_cmd); -#endif install_element(OSPF6_NODE, &ospf6_distance_cmd); install_element(OSPF6_NODE, &no_ospf6_distance_cmd); install_element(OSPF6_NODE, &ospf6_distance_ospf6_cmd); install_element(OSPF6_NODE, &no_ospf6_distance_ospf6_cmd); -#if 0 - install_element (OSPF6_NODE, &ospf6_distance_source_cmd); - install_element (OSPF6_NODE, &no_ospf6_distance_source_cmd); -#endif } diff --git a/ospfd/ospf_ase.c b/ospfd/ospf_ase.c index e18d8ddb31d0..51da4a55a7fa 100644 --- a/ospfd/ospf_ase.c +++ b/ospfd/ospf_ase.c @@ -156,84 +156,6 @@ static int ospf_ase_forward_address_check(struct ospf *ospf, return 1; } -#if 0 -/* Calculate ASBR route. */ -static struct ospf_route * -ospf_ase_calculate_asbr_route (struct ospf *ospf, - struct route_table *rt_network, - struct route_table *rt_router, - struct as_external_lsa *al) -{ - struct prefix_ipv4 asbr; - struct ospf_route *asbr_route; - struct route_node *rn; - - /* Find ASBR route from Router routing table. */ - asbr.family = AF_INET; - asbr.prefix = al->header.adv_router; - asbr.prefixlen = IPV4_MAX_BITLEN; - apply_mask_ipv4 (&asbr); - - asbr_route = ospf_find_asbr_route (ospf, rt_router, &asbr); - - if (asbr_route == NULL) - { - if (IS_DEBUG_OSPF (lsa, LSA)) - zlog_debug ("ospf_ase_calculate(): Route to ASBR %pI4 not found", - &asbr.prefix); - return NULL; - } - - if (!(asbr_route->u.std.flags & ROUTER_LSA_EXTERNAL)) - { - if (IS_DEBUG_OSPF (lsa, LSA)) - zlog_debug ("ospf_ase_calculate(): Originating router is not an ASBR"); - return NULL; - } - - if (al->e[0].fwd_addr.s_addr != INADDR_ANY) - { - if (IS_DEBUG_OSPF (lsa, LSA)) - zlog_debug ("ospf_ase_calculate(): Forwarding address is not 0.0.0.0."); - - if (! ospf_ase_forward_address_check (ospf, al->e[0].fwd_addr)) - { - if (IS_DEBUG_OSPF (lsa, LSA)) - zlog_debug ("ospf_ase_calculate(): Forwarding address is one of our addresses, Ignore."); - return NULL; - } - - if (IS_DEBUG_OSPF (lsa, LSA)) - zlog_debug ("ospf_ase_calculate(): Looking up in the Network Routing Table."); - - /* Looking up the path to the fwd_addr from Network route. */ - asbr.family = AF_INET; - asbr.prefix = al->e[0].fwd_addr; - asbr.prefixlen = IPV4_MAX_BITLEN; - - rn = route_node_match (rt_network, (struct prefix *) &asbr); - - if (rn == NULL) - { - if (IS_DEBUG_OSPF (lsa, LSA)) - zlog_debug ("ospf_ase_calculate(): Couldn't find a route to the forwarding address."); - return NULL; - } - - route_unlock_node (rn); - - if ((asbr_route = rn->info) == NULL) - { - if (IS_DEBUG_OSPF (lsa, LSA)) - zlog_debug ("ospf_ase_calculate(): Somehow OSPF route to ASBR is lost"); - return NULL; - } - } - - return asbr_route; -} -#endif - static struct ospf_route * ospf_ase_calculate_new_route(struct ospf_lsa *lsa, struct ospf_route *asbr_route, uint32_t metric) diff --git a/ospfd/ospf_lsa.c b/ospfd/ospf_lsa.c index 72201355e776..8268039f2ab9 100644 --- a/ospfd/ospf_lsa.c +++ b/ospfd/ospf_lsa.c @@ -2163,12 +2163,6 @@ void ospf_external_lsa_flush(struct ospf *ospf, uint8_t type, /* Sweep LSA from Link State Retransmit List. */ ospf_ls_retransmit_delete_nbr_as(ospf, lsa); -/* There must be no self-originated LSA in rtrs_external. */ -#if 0 - /* Remove External route from Zebra. */ - ospf_zebra_delete ((struct prefix_ipv4 *) p, &nexthop); -#endif - if (!IS_LSA_MAXAGE(lsa)) { /* Unregister LSA from Refresh queue. */ ospf_refresher_unregister_lsa(ospf, lsa); @@ -2440,12 +2434,7 @@ ospf_summary_lsa_install(struct ospf *ospf, struct ospf_lsa *new, int rt_recalc) necessary to re-examine all the AS-external-LSAs. */ -#if 0 - /* This doesn't exist yet... */ - ospf_summary_incremental_update(new); */ -#else /* #if 0 */ ospf_spf_calculate_schedule(ospf, SPF_FLAG_SUMMARY_LSA_INSTALL); -#endif /* #if 0 */ } if (IS_LSA_SELF(new)) @@ -2466,16 +2455,8 @@ static struct ospf_lsa *ospf_summary_asbr_lsa_install(struct ospf *ospf, destination is an AS boundary router, it may also be necessary to re-examine all the AS-external-LSAs. */ -#if 0 - /* These don't exist yet... */ - ospf_summary_incremental_update(new); - /* Isn't this done by the above call? - - RFC 2328 Section 16.5 implies it should be */ - /* ospf_ase_calculate_schedule(); */ -#else /* #if 0 */ ospf_spf_calculate_schedule(ospf, SPF_FLAG_ASBR_SUMMARY_LSA_INSTALL); -#endif /* #if 0 */ } /* register LSA to refresh-list. */ diff --git a/ospfd/ospf_snmp.c b/ospfd/ospf_snmp.c index 66dd9c7ca4ac..3f4ca44b0504 100644 --- a/ospfd/ospf_snmp.c +++ b/ospfd/ospf_snmp.c @@ -1236,7 +1236,6 @@ static struct ospf_nbr_nbma *ospfHostLookup(struct variable *v, oid *name, size_t *length, struct in_addr *addr, int exact) { - int len; struct ospf_nbr_nbma *nbr_nbma; struct ospf *ospf; @@ -1257,29 +1256,9 @@ static struct ospf_nbr_nbma *ospfHostLookup(struct variable *v, oid *name, nbr_nbma = ospf_nbr_nbma_lookup(ospf, *addr); - return nbr_nbma; - } else { - len = *length - v->namelen; - if (len > 4) - len = 4; - - oid2in_addr(name + v->namelen, len, addr); - - nbr_nbma = - ospf_nbr_nbma_lookup_next(ospf, addr, len == 0 ? 1 : 0); - - if (nbr_nbma == NULL) - return NULL; - - oid_copy_addr(name + v->namelen, addr, IN_ADDR_SIZE); - - /* Set TOS 0. */ - name[v->namelen + IN_ADDR_SIZE] = 0; - - *length = v->namelen + IN_ADDR_SIZE + 1; - return nbr_nbma; } + return NULL; } diff --git a/ospfd/ospf_spf.c b/ospfd/ospf_spf.c index fae4f1e10c13..82acd0829c2f 100644 --- a/ospfd/ospf_spf.c +++ b/ospfd/ospf_spf.c @@ -1683,68 +1683,6 @@ void ospf_spf_cleanup(struct vertex *spf, struct list *vertex_list) list_delete(&vertex_list); } -#if 0 -static void -ospf_rtrs_print (struct route_table *rtrs) -{ - struct route_node *rn; - struct list *or_list; - struct listnode *ln; - struct listnode *pnode; - struct ospf_route *or; - struct ospf_path *path; - char buf1[BUFSIZ]; - char buf2[BUFSIZ]; - - if (IS_DEBUG_OSPF_EVENT) - zlog_debug ("ospf_rtrs_print() start"); - - for (rn = route_top (rtrs); rn; rn = route_next (rn)) - if ((or_list = rn->info) != NULL) - for (ALL_LIST_ELEMENTS_RO (or_list, ln, or)) - { - switch (or->path_type) - { - case OSPF_PATH_INTRA_AREA: - if (IS_DEBUG_OSPF_EVENT) - zlog_debug ("%s [%d] area: %s", - inet_ntop (AF_INET, &or->id, buf1, BUFSIZ), - or->cost, inet_ntop (AF_INET, &or->u.std.area_id, - buf2, BUFSIZ)); - break; - case OSPF_PATH_INTER_AREA: - if (IS_DEBUG_OSPF_EVENT) - zlog_debug ("%s IA [%d] area: %s", - inet_ntop (AF_INET, &or->id, buf1, BUFSIZ), - or->cost, inet_ntop (AF_INET, &or->u.std.area_id, - buf2, BUFSIZ)); - break; - default: - break; - } - - for (ALL_LIST_ELEMENTS_RO (or->paths, pnode, path)) - { - if (path->nexthop.s_addr == INADDR_ANY) - { - if (IS_DEBUG_OSPF_EVENT) - zlog_debug (" directly attached to %s\r", - ifindex2ifname (path->ifindex), VRF_DEFAULT); - } - else - { - if (IS_DEBUG_OSPF_EVENT) - zlog_debug (" via %pI4, %s\r", - &path->nexthop, - ifindex2ifname (path->ifindex), VRF_DEFAULT); - } - } - } - - zlog_debug ("ospf_rtrs_print() end"); -} -#endif - /* Calculating the shortest-path tree for an area, see RFC2328 16.1. */ void ospf_spf_calculate(struct ospf_area *area, struct ospf_lsa *root_lsa, struct route_table *new_table, diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c index a4a220b1f6b3..949582278fda 100644 --- a/ospfd/ospf_vty.c +++ b/ospfd/ospf_vty.c @@ -6406,31 +6406,7 @@ static int show_as_external_lsa_detail(struct vty *vty, struct ospf_lsa *lsa, return 0; } -#if 0 -static int -show_as_external_lsa_stdvty (struct ospf_lsa *lsa) -{ - struct as_external_lsa *al = (struct as_external_lsa *) lsa->data; - - /* show_ip_ospf_database_header (vty, lsa); */ - - zlog_debug( " Network Mask: /%d%s", - ip_masklen (al->mask), "\n"); - zlog_debug( " Metric Type: %s%s", - IS_EXTERNAL_METRIC (al->e[0].tos) ? - "2 (Larger than any link state path)" : "1", "\n"); - zlog_debug( " TOS: 0%s", "\n"); - zlog_debug( " Metric: %d%s", - GET_METRIC (al->e[0].metric), "\n"); - zlog_debug( " Forward Address: %pI4%s", - &al->e[0].fwd_addr, "\n"); - zlog_debug( " External Route Tag: %"ROUTE_TAG_PRI"%s%s", - (route_tag_t)ntohl (al->e[0].route_tag), "\n", "\n"); - - return 0; -} -#endif /* Show AS-NSSA-LSA detail information. */ static int show_as_nssa_lsa_detail(struct vty *vty, struct ospf_lsa *lsa, json_object *json) @@ -9467,78 +9443,6 @@ DEFUN (ospf_distance_ospf, return CMD_SUCCESS; } -#if 0 -DEFUN (ospf_distance_source, - ospf_distance_source_cmd, - "distance (1-255) A.B.C.D/M", - "Administrative distance\n" - "Distance value\n" - "IP source prefix\n") -{ - VTY_DECLVAR_CONTEXT(ospf, ospf); - int idx_number = 1; - int idx_ipv4_prefixlen = 2; - - ospf_distance_set (vty, ospf, argv[idx_number]->arg, argv[idx_ipv4_prefixlen]->arg, NULL); - - return CMD_SUCCESS; -} - -DEFUN (no_ospf_distance_source, - no_ospf_distance_source_cmd, - "no distance (1-255) A.B.C.D/M", - NO_STR - "Administrative distance\n" - "Distance value\n" - "IP source prefix\n") -{ - VTY_DECLVAR_CONTEXT(ospf, ospf); - int idx_number = 2; - int idx_ipv4_prefixlen = 3; - - ospf_distance_unset (vty, ospf, argv[idx_number]->arg, argv[idx_ipv4_prefixlen]->arg, NULL); - - return CMD_SUCCESS; -} - -DEFUN (ospf_distance_source_access_list, - ospf_distance_source_access_list_cmd, - "distance (1-255) A.B.C.D/M WORD", - "Administrative distance\n" - "Distance value\n" - "IP source prefix\n" - "Access list name\n") -{ - VTY_DECLVAR_CONTEXT(ospf, ospf); - int idx_number = 1; - int idx_ipv4_prefixlen = 2; - int idx_word = 3; - - ospf_distance_set (vty, ospf, argv[idx_number]->arg, argv[idx_ipv4_prefixlen]->arg, argv[idx_word]->arg); - - return CMD_SUCCESS; -} - -DEFUN (no_ospf_distance_source_access_list, - no_ospf_distance_source_access_list_cmd, - "no distance (1-255) A.B.C.D/M WORD", - NO_STR - "Administrative distance\n" - "Distance value\n" - "IP source prefix\n" - "Access list name\n") -{ - VTY_DECLVAR_CONTEXT(ospf, ospf); - int idx_number = 2; - int idx_ipv4_prefixlen = 3; - int idx_word = 4; - - ospf_distance_unset (vty, ospf, argv[idx_number]->arg, argv[idx_ipv4_prefixlen]->arg, argv[idx_word]->arg); - - return CMD_SUCCESS; -} -#endif - DEFUN (ip_ospf_mtu_ignore, ip_ospf_mtu_ignore_addr_cmd, "ip ospf mtu-ignore [A.B.C.D]", @@ -12653,13 +12557,6 @@ static void ospf_vty_zebra_init(void) &no_ospf_external_route_aggregation_no_adrvertise_cmd); install_element(OSPF_NODE, &ospf_route_aggregation_timer_cmd); install_element(OSPF_NODE, &no_ospf_route_aggregation_timer_cmd); - -#if 0 - install_element (OSPF_NODE, &ospf_distance_source_cmd); - install_element (OSPF_NODE, &no_ospf_distance_source_cmd); - install_element (OSPF_NODE, &ospf_distance_source_access_list_cmd); - install_element (OSPF_NODE, &no_ospf_distance_source_access_list_cmd); -#endif /* 0 */ } static int ospf_config_write(struct vty *vty); diff --git a/ospfd/ospfd.c b/ospfd/ospfd.c index 56424abeca1c..04397d50a579 100644 --- a/ospfd/ospfd.c +++ b/ospfd/ospfd.c @@ -1739,26 +1739,6 @@ int ospf_area_nssa_translator_role_set(struct ospf *ospf, return 1; } -#if 0 -/* XXX: unused? Leave for symmetry? */ -static int -ospf_area_nssa_translator_role_unset (struct ospf *ospf, - struct in_addr area_id) -{ - struct ospf_area *area; - - area = ospf_area_lookup_by_area_id (ospf, area_id); - if (area == NULL) - return 0; - - area->NSSATranslatorRole = OSPF_NSSA_ROLE_CANDIDATE; - - ospf_area_check_free (ospf, area_id); - - return 1; -} -#endif - int ospf_area_export_list_set(struct ospf *ospf, struct ospf_area *area, const char *list_name) { @@ -2001,35 +1981,6 @@ struct ospf_nbr_nbma *ospf_nbr_nbma_lookup(struct ospf *ospf, return NULL; } -struct ospf_nbr_nbma *ospf_nbr_nbma_lookup_next(struct ospf *ospf, - struct in_addr *addr, int first) -{ -#if 0 - struct ospf_nbr_nbma *nbr_nbma; - struct listnode *node; -#endif - - if (ospf == NULL) - return NULL; - -#if 0 - for (ALL_LIST_ELEMENTS_RO (ospf->nbr_nbma, node, nbr_nbma)) - { - if (first) - { - *addr = nbr_nbma->addr; - return nbr_nbma; - } - else if (ntohl (nbr_nbma->addr.s_addr) > ntohl (addr->s_addr)) - { - *addr = nbr_nbma->addr; - return nbr_nbma; - } - } -#endif - return NULL; -} - int ospf_nbr_nbma_set(struct ospf *ospf, struct in_addr nbr_addr) { struct ospf_nbr_nbma *nbr_nbma; diff --git a/ospfd/ospfd.h b/ospfd/ospfd.h index 9d5aa6a4f928..954a469b68d4 100644 --- a/ospfd/ospfd.h +++ b/ospfd/ospfd.h @@ -694,8 +694,6 @@ extern void ospf_terminate(void); extern void ospf_nbr_nbma_if_update(struct ospf *, struct ospf_interface *); extern struct ospf_nbr_nbma *ospf_nbr_nbma_lookup(struct ospf *, struct in_addr); -extern struct ospf_nbr_nbma *ospf_nbr_nbma_lookup_next(struct ospf *, - struct in_addr *, int); extern int ospf_oi_count(struct interface *); extern struct ospf_area *ospf_area_new(struct ospf *ospf, diff --git a/pbrd/pbr_nht.c b/pbrd/pbr_nht.c index f99971ab7b7a..723374d9d690 100644 --- a/pbrd/pbr_nht.c +++ b/pbrd/pbr_nht.c @@ -320,13 +320,6 @@ void pbr_nhgroup_delete_cb(const char *name) pbr_map_check_nh_group_change(name); } -#if 0 -static struct pbr_nexthop_cache *pbr_nht_lookup_nexthop(struct nexthop *nexthop) -{ - return NULL; -} -#endif - static void pbr_nht_find_nhg_from_table_update(struct pbr_nexthop_group_cache *pnhgc, uint32_t table_id, bool installed) diff --git a/pimd/pim_hello.c b/pimd/pim_hello.c index e50504ec10e1..6f5c4174e277 100644 --- a/pimd/pim_hello.c +++ b/pimd/pim_hello.c @@ -95,22 +95,6 @@ static void tlv_trace_uint32_hex(const char *label, const char *tlv_name, } } -#if 0 -static void tlv_trace(const char *label, const char *tlv_name, - const char *ifname, struct in_addr src_addr, - int isset) -{ - if (isset) { - char src_str[INET_ADDRSTRLEN]; - pim_inet4_dump("", src_addr, src_str, sizeof(src_str)); - zlog_debug("%s: PIM hello option from %s on interface %s: %s", - label, - src_str, ifname, - tlv_name); - } -} -#endif - static void tlv_trace_list(const char *label, const char *tlv_name, const char *ifname, struct in_addr src_addr, int isset, struct list *addr_list) diff --git a/pimd/test_igmpv3_join.c b/pimd/test_igmpv3_join.c index bf44f3c94a47..3c26517e8880 100644 --- a/pimd/test_igmpv3_join.c +++ b/pimd/test_igmpv3_join.c @@ -54,11 +54,6 @@ static int iface_solve_index(const char *ifname) } for (i = 0; ini[i].if_index; ++i) { -#if 0 - fprintf(stderr, - "%s: interface=%s matching against local ifname=%s ifindex=%d\n", - prog_name, ifname, ini[i].if_name, ini[i].if_index); -#endif if (!strcmp(ini[i].if_name, ifname)) { ifindex = ini[i].if_index; break; diff --git a/ripd/rip_interface.c b/ripd/rip_interface.c index c601ab404737..89e7e5dc17ef 100644 --- a/ripd/rip_interface.c +++ b/ripd/rip_interface.c @@ -208,39 +208,6 @@ static void rip_request_interface(struct interface *ifp) rip_request_interface_send(ifp, RIPv2); } -#if 0 -/* Send RIP request to the neighbor. */ -static void -rip_request_neighbor (struct in_addr addr) -{ - struct sockaddr_in to; - - memset (&to, 0, sizeof(struct sockaddr_in)); - to.sin_port = htons (RIP_PORT_DEFAULT); - to.sin_addr = addr; - - rip_request_send (&to, NULL, rip->version_send, NULL); -} - -/* Request routes at all interfaces. */ -static void -rip_request_neighbor_all (void) -{ - struct route_node *rp; - - if (! rip) - return; - - if (IS_RIP_DEBUG_EVENT) - zlog_debug ("request to the all neighbor"); - - /* Send request to all neighbor. */ - for (rp = route_top (rip->neighbor); rp; rp = route_next (rp)) - if (rp->info) - rip_request_neighbor (rp->p.u.prefix4); -} -#endif - /* Multicast packet receive socket. */ static int rip_multicast_join(struct interface *ifp, int sock) { diff --git a/ripd/rip_snmp.c b/ripd/rip_snmp.c index be222c7a5fc5..4e6ed1400fce 100644 --- a/ripd/rip_snmp.c +++ b/ripd/rip_snmp.c @@ -547,18 +547,7 @@ static uint8_t *rip2PeerTable(struct variable *v, oid name[], size_t *length, return (uint8_t *)&domain; case RIP2PEERLASTUPDATE: -#if 0 - /* We don't know the SNMP agent startup time. We have two choices here: - * - assume ripd startup time equals SNMP agent startup time - * - don't support this variable, at all - * Currently, we do the latter... - */ - *val_len = sizeof(time_t); - uptime = peer->uptime; /* now - snmp_agent_startup - peer->uptime */ - return (uint8_t *) &uptime; -#else return (uint8_t *)NULL; -#endif case RIP2PEERVERSION: *val_len = sizeof(int); diff --git a/ripd/ripd.c b/ripd/ripd.c index 82dd401f9603..a276dedec8f5 100644 --- a/ripd/ripd.c +++ b/ripd/ripd.c @@ -2858,23 +2858,6 @@ void rip_event(struct rip *rip, enum rip_event event, int sock) } } -#if 0 -static void -rip_update_default_metric (void) -{ - struct route_node *np; - struct rip_info *rinfo = NULL; - struct list *list = NULL; - struct listnode *listnode = NULL; - - for (np = route_top (rip->table); np; np = route_next (np)) - if ((list = np->info) != NULL) - for (ALL_LIST_ELEMENTS_RO (list, listnode, rinfo)) - if (rinfo->type != ZEBRA_ROUTE_RIP && rinfo->type != ZEBRA_ROUTE_CONNECT) - rinfo->metric = rip->default_metric; -} -#endif - struct rip_distance *rip_distance_new(void) { return XCALLOC(MTYPE_RIP_DISTANCE, sizeof(struct rip_distance)); diff --git a/ripngd/ripngd.c b/ripngd/ripngd.c index 1ebdae43fbd2..a9f570598fa4 100644 --- a/ripngd/ripngd.c +++ b/ripngd/ripngd.c @@ -2217,136 +2217,6 @@ DEFUN (show_ipv6_ripng_status, return CMD_SUCCESS; } -#if 0 -/* RIPng update timer setup. */ -DEFUN (ripng_update_timer, - ripng_update_timer_cmd, - "update-timer SECOND", - "Set RIPng update timer in seconds\n" - "Seconds\n") -{ - unsigned long update; - char *endptr = NULL; - - update = strtoul (argv[0], &endptr, 10); - if (update == ULONG_MAX || *endptr != '\0') - { - vty_out (vty, "update timer value error\n"); - return CMD_WARNING_CONFIG_FAILED; - } - - ripng->update_time = update; - - ripng_event (RIPNG_UPDATE_EVENT, 0); - return CMD_SUCCESS; -} - -DEFUN (no_ripng_update_timer, - no_ripng_update_timer_cmd, - "no update-timer SECOND", - NO_STR - "Unset RIPng update timer in seconds\n" - "Seconds\n") -{ - ripng->update_time = RIPNG_UPDATE_TIMER_DEFAULT; - ripng_event (RIPNG_UPDATE_EVENT, 0); - return CMD_SUCCESS; -} - -/* RIPng timeout timer setup. */ -DEFUN (ripng_timeout_timer, - ripng_timeout_timer_cmd, - "timeout-timer SECOND", - "Set RIPng timeout timer in seconds\n" - "Seconds\n") -{ - unsigned long timeout; - char *endptr = NULL; - - timeout = strtoul (argv[0], &endptr, 10); - if (timeout == ULONG_MAX || *endptr != '\0') - { - vty_out (vty, "timeout timer value error\n"); - return CMD_WARNING_CONFIG_FAILED; - } - - ripng->timeout_time = timeout; - - return CMD_SUCCESS; -} - -DEFUN (no_ripng_timeout_timer, - no_ripng_timeout_timer_cmd, - "no timeout-timer SECOND", - NO_STR - "Unset RIPng timeout timer in seconds\n" - "Seconds\n") -{ - ripng->timeout_time = RIPNG_TIMEOUT_TIMER_DEFAULT; - return CMD_SUCCESS; -} - -/* RIPng garbage timer setup. */ -DEFUN (ripng_garbage_timer, - ripng_garbage_timer_cmd, - "garbage-timer SECOND", - "Set RIPng garbage timer in seconds\n" - "Seconds\n") -{ - unsigned long garbage; - char *endptr = NULL; - - garbage = strtoul (argv[0], &endptr, 10); - if (garbage == ULONG_MAX || *endptr != '\0') - { - vty_out (vty, "garbage timer value error\n"); - return CMD_WARNING_CONFIG_FAILED; - } - - ripng->garbage_time = garbage; - - return CMD_SUCCESS; -} - -DEFUN (no_ripng_garbage_timer, - no_ripng_garbage_timer_cmd, - "no garbage-timer SECOND", - NO_STR - "Unset RIPng garbage timer in seconds\n" - "Seconds\n") -{ - ripng->garbage_time = RIPNG_GARBAGE_TIMER_DEFAULT; - return CMD_SUCCESS; -} -#endif /* 0 */ - -#if 0 -DEFUN (show_ipv6_protocols, - show_ipv6_protocols_cmd, - "show ipv6 protocols", - SHOW_STR - IPV6_STR - "Routing protocol information\n") -{ - if (! ripng) - return CMD_SUCCESS; - - vty_out (vty, "Routing Protocol is \"ripng\"\n"); - - vty_out (vty, "Sending updates every %ld seconds, next due in %d seconds\n", - ripng->update_time, 0); - - vty_out (vty, "Timerout after %ld seconds, garbage correct %ld\n", - ripng->timeout_time, - ripng->garbage_time); - - vty_out (vty, "Outgoing update filter list for all interfaces is not set"); - vty_out (vty, "Incoming update filter list for all interfaces is not set"); - - return CMD_SUCCESS; -} -#endif - /* Update ECMP routes to zebra when ECMP is disabled. */ void ripng_ecmp_disable(struct ripng *ripng) { @@ -2847,16 +2717,6 @@ void ripng_init(void) install_default(RIPNG_NODE); -#if 0 - install_element (VIEW_NODE, &show_ipv6_protocols_cmd); - install_element (RIPNG_NODE, &ripng_update_timer_cmd); - install_element (RIPNG_NODE, &no_ripng_update_timer_cmd); - install_element (RIPNG_NODE, &ripng_timeout_timer_cmd); - install_element (RIPNG_NODE, &no_ripng_timeout_timer_cmd); - install_element (RIPNG_NODE, &ripng_garbage_timer_cmd); - install_element (RIPNG_NODE, &no_ripng_garbage_timer_cmd); -#endif /* 0 */ - ripng_if_init(); ripng_debug_init(); diff --git a/ripngd/ripngd.h b/ripngd/ripngd.h index a42c32ebb7a9..14ac29b3fef8 100644 --- a/ripngd/ripngd.h +++ b/ripngd/ripngd.h @@ -230,35 +230,6 @@ struct ripng_info { struct agg_node *rp; }; -#ifdef notyet -#if 0 -/* RIPng tag structure. */ -struct ripng_tag -{ - /* Tag value. */ - uint16_t tag; - - /* Port. */ - uint16_t port; - - /* Multicast group. */ - struct in6_addr maddr; - - /* Table number. */ - int table; - - /* Distance. */ - int distance; - - /* Split horizon. */ - uint8_t split_horizon; - - /* Poison reverse. */ - uint8_t poison_reverse; -}; -#endif /* 0 */ -#endif /* not yet */ - typedef enum { RIPNG_NO_SPLIT_HORIZON = 0, RIPNG_SPLIT_HORIZON, @@ -294,13 +265,6 @@ struct ripng_interface { /* Route-map. */ struct route_map *routemap[RIPNG_FILTER_MAX]; -#ifdef notyet -#if 0 - /* RIPng tag configuration. */ - struct ripng_tag *rtag; -#endif /* 0 */ -#endif /* notyet */ - /* Default information originate. */ uint8_t default_originate; diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c index d96d77e77c47..3af3586d3188 100644 --- a/zebra/rt_netlink.c +++ b/zebra/rt_netlink.c @@ -2481,13 +2481,6 @@ static int netlink_nexthop_process_group(struct rtattr **tb, return count; } -#if 0 - // TODO: Need type for something? - zlog_debug("Nexthop group type: %d", - *((uint16_t *)RTA_DATA(tb[NHA_GROUP_TYPE]))); - -#endif - for (int i = 0; ((i < count) && (i < z_grp_size)); i++) { z_grp[i].id = n_grp[i].id; z_grp[i].weight = n_grp[i].weight + 1; diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index 8914f9c59cff..69d3a577cfac 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -2323,14 +2323,6 @@ static void process_subq_route(struct listnode *lnode, uint8_t qindex) UNSET_FLAG(rib_dest_from_rnode(rnode)->flags, RIB_ROUTE_QUEUED(qindex)); -#if 0 - else - { - zlog_debug ("%s: called for route_node (%p, %d) with no ribs", - __func__, rnode, route_node_get_lock_count(rnode)); - zlog_backtrace(LOG_DEBUG); - } -#endif route_unlock_node(rnode); }