这篇教程C++ ALL_LIST_ELEMENTS函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中ALL_LIST_ELEMENTS函数的典型用法代码示例。如果您正苦于以下问题:C++ ALL_LIST_ELEMENTS函数的具体用法?C++ ALL_LIST_ELEMENTS怎么用?C++ ALL_LIST_ELEMENTS使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了ALL_LIST_ELEMENTS函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: ip_address_count/**gjd : under a interface , calculate the all ip address(include ipv4 and ipv6) num**/int ip_address_count(struct interface* ifp) { struct connected *c; struct listnode *cnode, *cnnode; int i = 0; #if 0 for (ALL_LIST_ELEMENTS (ifp->connected, cnode, cnnode, c)) { // if ((c->address->family == AF_INET)||(c->address->family == AF_INET6)) if ((c->address->family == AF_INET)) ++i; } return i; #endif if (ifp->connected) { for (ALL_LIST_ELEMENTS (ifp->connected, cnode, cnnode, c)) {/* if(CHECK_FLAG (c->conf, ZEBRA_IFC_CONFIGURED))*/ if(CHECK_FLAG (c->conf, ZEBRA_IFC_CONFIGURED)||CHECK_FLAG (c->conf, ZEBRA_IFC_REAL)) i++; } } /*zlog_info("############## i = %d #################/n",i);*/ return i; }
开发者ID:kkcloudy,项目名称:daemongroup,代码行数:32,
示例2: delete_marked_cache_groupsstatic voiddelete_marked_cache_groups(){ cache_group* cache_group; cache* cache; struct listnode *cache_group_node, *cache_node; struct listnode *next_node, *next_cache_node; for (ALL_LIST_ELEMENTS(cache_group_list, cache_group_node, next_node, cache_group)) { for (ALL_LIST_ELEMENTS(cache_group->cache_config_list, cache_node, next_cache_node, cache)) { if (cache->delete_flag) { listnode_delete(cache_group->cache_config_list, cache); delete_cache(cache); } } if (listcount(cache_group->cache_config_list) == 0 || cache_group->delete_flag) { listnode_delete(cache_group_list, cache_group); delete_cache_group(cache_group); } }}
开发者ID:rtrlib,项目名称:quagga-rtrlib,代码行数:27,
示例3: forward_offstatic void forward_off(struct pim_upstream *up){ struct listnode *ifnode; struct listnode *ifnextnode; struct listnode *chnode; struct listnode *chnextnode; struct interface *ifp; struct pim_interface *pim_ifp; struct pim_ifchannel *ch; /* scan all interfaces */ for (ALL_LIST_ELEMENTS(iflist, ifnode, ifnextnode, ifp)) { pim_ifp = ifp->info; if (!pim_ifp) continue; /* scan per-interface (S,G) state */ for (ALL_LIST_ELEMENTS(pim_ifp->pim_ifchannel_list, chnode, chnextnode, ch)) { if (ch->upstream != up) continue; pim_forward_stop(ch); } /* scan iface channel list */ } /* scan iflist */}
开发者ID:FujitsuNetworkCommunications,项目名称:Quagga-Graceful-Restart,代码行数:27,
示例4: JoinDesired/* Evaluate JoinDesired(S,G): JoinDesired(S,G) is true if there is a downstream (S,G) interface I in the set: inherited_olist(S,G) = joins(S,G) (+) pim_include(S,G) (-) lost_assert(S,G) JoinDesired(S,G) may be affected by changes in the following: pim_ifp->primary_address pim_ifp->pim_dr_addr ch->ifassert_winner_metric ch->ifassert_winner ch->local_ifmembership ch->ifjoin_state ch->upstream->rpf.source_nexthop.mrib_metric_preference ch->upstream->rpf.source_nexthop.mrib_route_metric ch->upstream->rpf.source_nexthop.interface See also pim_upstream_update_join_desired() below. */int pim_upstream_evaluate_join_desired(struct pim_upstream *up){ struct listnode *ifnode; struct listnode *ifnextnode; struct listnode *chnode; struct listnode *chnextnode; struct interface *ifp; struct pim_interface *pim_ifp; struct pim_ifchannel *ch; /* scan all interfaces */ for (ALL_LIST_ELEMENTS(iflist, ifnode, ifnextnode, ifp)) { pim_ifp = ifp->info; if (!pim_ifp) continue; /* scan per-interface (S,G) state */ for (ALL_LIST_ELEMENTS(pim_ifp->pim_ifchannel_list, chnode, chnextnode, ch)) { if (ch->upstream != up) continue; if (pim_macro_ch_lost_assert(ch)) continue; /* keep searching */ if (pim_macro_chisin_joins_or_include(ch)) return 1; /* true */ } /* scan iface channel list */ } /* scan iflist */ return 0; /* false */}
开发者ID:FujitsuNetworkCommunications,项目名称:Quagga-Graceful-Restart,代码行数:54,
示例5: zread_interface_add/* Register zebra server interface information. Send current all interface and address information. */static intzread_interface_add (struct zserv *client, u_short length){ struct listnode *ifnode, *ifnnode; struct listnode *cnode, *cnnode; struct interface *ifp; struct connected *c; /* Interface information is needed. */ client->ifinfo = 1; for (ALL_LIST_ELEMENTS (iflist, ifnode, ifnnode, ifp)) { /* Skip pseudo interface. */ if (! CHECK_FLAG (ifp->status, ZEBRA_INTERFACE_ACTIVE)) continue; if (zsend_interface_add (client, ifp) < 0) return -1; for (ALL_LIST_ELEMENTS (ifp->connected, cnode, cnnode, c)) { if (CHECK_FLAG (c->conf, ZEBRA_IFC_REAL) && (zsend_interface_address (ZEBRA_INTERFACE_ADDRESS_ADD, client, ifp, c) < 0)) return -1; } } return 0;}
开发者ID:MichaelQQ,项目名称:Quagga-PE,代码行数:32,
示例6: pim_upstream_update_assert_tracking_desiredstatic void pim_upstream_update_assert_tracking_desired(struct pim_upstream *up){ struct listnode *ifnode; struct listnode *ifnextnode; struct listnode *chnode; struct listnode *chnextnode; struct interface *ifp; struct pim_interface *pim_ifp; struct pim_ifchannel *ch; /* scan all interfaces */ for (ALL_LIST_ELEMENTS(iflist, ifnode, ifnextnode, ifp)) { pim_ifp = ifp->info; if (!pim_ifp) continue; /* scan per-interface (S,G) state */ for (ALL_LIST_ELEMENTS(pim_ifp->pim_ifchannel_list, chnode, chnextnode, ch)) { if (ch->upstream != up) continue; pim_ifchannel_update_assert_tracking_desired(ch); } /* scan iface channel list */ } /* scan iflist */}
开发者ID:FujitsuNetworkCommunications,项目名称:Quagga-Graceful-Restart,代码行数:27,
示例7: ospf_if_cleanup/* Restore an interface to its pre UP state Used from ism_interface_down only */voidospf_if_cleanup (struct ospf_interface *oi){ struct route_node *rn; struct listnode *node, *nnode; struct ospf_neighbor *nbr; struct ospf_nbr_nbma *nbr_nbma; struct ospf_lsa *lsa; /* oi->nbrs and oi->nbr_nbma should be deleted on InterfaceDown event */ /* delete all static neighbors attached to this interface */ for (ALL_LIST_ELEMENTS (oi->nbr_nbma, node, nnode, nbr_nbma)) { OSPF_POLL_TIMER_OFF (nbr_nbma->t_poll); if (nbr_nbma->nbr) { nbr_nbma->nbr->nbr_nbma = NULL; nbr_nbma->nbr = NULL; } nbr_nbma->oi = NULL; listnode_delete (oi->nbr_nbma, nbr_nbma); } /* send Neighbor event KillNbr to all associated neighbors. */ for (rn = route_top (oi->nbrs); rn; rn = route_next (rn)) if ((nbr = rn->info) != NULL) if (nbr != oi->nbr_self) OSPF_NSM_EVENT_EXECUTE (nbr, NSM_KillNbr); /* Cleanup Link State Acknowlegdment list. */ for (ALL_LIST_ELEMENTS (oi->ls_ack, node, nnode, lsa)) ospf_lsa_unlock (&lsa); /* oi->ls_ack */ list_delete_all_node (oi->ls_ack); oi->crypt_seqnum = 0; /* Empty link state update queue */ ospf_ls_upd_queue_empty (oi); /* Reset pseudo neighbor. */ ospf_nbr_delete (oi->nbr_self); oi->nbr_self = ospf_nbr_new (oi); ospf_nbr_add_self (oi); ospf_lsa_unlock (&oi->network_lsa_self); oi->network_lsa_self = NULL; OSPF_TIMER_OFF (oi->t_network_lsa_self);#ifdef HAVE_GRACEFUL_RESTART THREAD_TIMER_OFF(oi->t_opaque_lsa_refresh); oi->v_opaque_lsa_count = 0 ;#endif}
开发者ID:millken,项目名称:zhuxianB30,代码行数:57,
示例8: vtysh_config_dump/* Display configuration to file pointer. */voidvtysh_config_dump (FILE *fp){ struct listnode *node, *nnode; struct listnode *mnode, *mnnode; struct config *config; struct list *master; char *line; unsigned int i; for (ALL_LIST_ELEMENTS (config_top, node, nnode, line)) { fprintf (fp, "%s/n", line); fflush (fp); } fprintf (fp, "!/n"); fflush (fp); for (i = 0; i < vector_active (configvec); i++) if ((master = vector_slot (configvec, i)) != NULL) { for (ALL_LIST_ELEMENTS (master, node, nnode, config)) { fprintf (fp, "%s/n", config->name); fflush (fp); for (ALL_LIST_ELEMENTS (config->line, mnode, mnnode, line)) { fprintf (fp, "%s/n", line); fflush (fp); } if (! NO_DELIMITER (i)) { fprintf (fp, "!/n"); fflush (fp); } } if (NO_DELIMITER (i)) { fprintf (fp, "!/n"); fflush (fp); } } for (i = 0; i < vector_active (configvec); i++) if ((master = vector_slot (configvec, i)) != NULL) { list_delete (master); vector_slot (configvec, i) = NULL; } list_delete_all_node (config_top);}
开发者ID:ColinBS,项目名称:quagga-rtrlib,代码行数:53,
示例9: bgp_interface_downstatic intbgp_interface_down (int command, struct zclient *zclient, zebra_size_t length){ struct stream *s; struct interface *ifp; struct connected *c; struct listnode *node, *nnode; s = zclient->ibuf; ifp = zebra_interface_state_read (s); if (! ifp) return 0; if (BGP_DEBUG(zebra, ZEBRA)) zlog_debug("Zebra rcvd: interface %s down", ifp->name); for (ALL_LIST_ELEMENTS (ifp->connected, node, nnode, c)) bgp_connected_delete (c); /* Fast external-failover (Currently IPv4 only) */ { struct listnode *mnode; struct bgp *bgp; struct peer *peer; struct interface *peer_if; for (ALL_LIST_ELEMENTS_RO (bm->bgp, mnode, bgp)) { if (CHECK_FLAG (bgp->flags, BGP_FLAG_NO_FAST_EXT_FAILOVER)) continue; for (ALL_LIST_ELEMENTS (bgp->peer, node, nnode, peer)) { if (peer->ttl != 1) continue; if (peer->su.sa.sa_family == AF_INET) peer_if = if_lookup_by_ipv4 (&peer->su.sin.sin_addr); else continue; if (ifp == peer_if) BGP_EVENT_ADD (peer, BGP_Stop); } } } return 0;}
开发者ID:AsherBond,项目名称:quagga,代码行数:49,
示例10: eigrp_nbr_count_getint eigrp_nbr_count_get(void){ struct eigrp_interface *iface; struct listnode *node, *node2, *nnode2; struct eigrp_neighbor *nbr; struct eigrp *eigrp = eigrp_lookup(); u_int32_t counter; if (eigrp == NULL) { zlog_debug("EIGRP Routing Process not enabled"); return 0; } counter=0; for (ALL_LIST_ELEMENTS_RO(eigrp->eiflist, node, iface)) { for (ALL_LIST_ELEMENTS(iface->nbrs, node2, nnode2, nbr)) { if (nbr->state == EIGRP_NEIGHBOR_UP){ counter++; } } } return counter;}
开发者ID:janovic,项目名称:Quagga-EIGRP,代码行数:26,
示例11: ospf6_spf_display_subtreevoidospf6_spf_display_subtree (struct vty *vty, const char *prefix, int rest, struct ospf6_vertex *v){ struct listnode *node, *nnode; struct ospf6_vertex *c; char *next_prefix; int len; int restnum; /* "prefix" is the space prefix of the display line */ vty_out (vty, "%s+-%s [%d]%s", prefix, v->name, v->cost, VNL); len = strlen (prefix) + 4; next_prefix = (char *) malloc (len); if (next_prefix == NULL) { vty_out (vty, "malloc failed%s", VNL); return; } snprintf (next_prefix, len, "%s%s", prefix, (rest ? "| " : " ")); restnum = listcount (v->child_list); for (ALL_LIST_ELEMENTS (v->child_list, node, nnode, c)) { restnum--; ospf6_spf_display_subtree (vty, next_prefix, restnum, c); } free (next_prefix);}
开发者ID:Addision,项目名称:LVS,代码行数:31,
示例12: igmp_group_deletestatic void igmp_group_delete(struct igmp_group *group){ struct listnode *src_node; struct listnode *src_nextnode; struct igmp_source *src; if (PIM_DEBUG_IGMP_TRACE) { char group_str[100]; pim_inet4_dump("<group?>", group->group_addr, group_str, sizeof(group_str)); zlog_debug("Deleting IGMP group %s from socket %d interface %s", group_str, group->group_igmp_sock->fd, group->group_igmp_sock->interface->name); } for (ALL_LIST_ELEMENTS(group->group_source_list, src_node, src_nextnode, src)) { igmp_source_delete(src); } if (group->t_group_query_retransmit_timer) { THREAD_OFF(group->t_group_query_retransmit_timer); zassert(!group->t_group_query_retransmit_timer); } group_timer_off(group); listnode_delete(group->group_igmp_sock->igmp_group_list, group); igmp_group_free(group);}
开发者ID:AT-Corp,项目名称:quagga-atc,代码行数:28,
示例13: bgp_router_id_update/* Router-id update message from zebra. */static intbgp_router_id_update (int command, struct zclient *zclient, zebra_size_t length){ struct prefix router_id; struct listnode *node, *nnode; struct bgp *bgp; zebra_router_id_update_read(zclient->ibuf,&router_id); if (BGP_DEBUG(zebra, ZEBRA)) { char buf[128]; prefix2str(&router_id, buf, sizeof(buf)); zlog_debug("Zebra rcvd: router id update %s", buf); } router_id_zebra = router_id.u.prefix4; for (ALL_LIST_ELEMENTS (bm->bgp, node, nnode, bgp)) { if (!bgp->router_id_static.s_addr) bgp_router_id_set (bgp, &router_id.u.prefix4); } return 0;}
开发者ID:DorChen,项目名称:quagga,代码行数:27,
示例14: clear_checksum_streamsvoidclear_checksum_streams (uint16_t checksum){ struct listnode * node, * nnode; struct sisis_listener * listener; for(ALL_LIST_ELEMENTS (sm->listen_sockets, node, nnode, listener)) { if(stream_get_getp(listener->chksum_stream) < stream_get_endp(listener->chksum_stream)) { uint16_t checksum_head = stream_getw(listener->chksum_stream); if(checksum_head != checksum) { stream_putw(listener->chksum_stream, checksum_head); uint16_t next_checksum = stream_peekw(listener->chksum_stream); while(next_checksum != checksum_head) { next_checksum = stream_getw(listener->chksum_stream); if(next_checksum != checksum) stream_putw(listener->chksum_stream, next_checksum); } } } }}
开发者ID:ecks,项目名称:sis-is,代码行数:25,
示例15: eigrp_update_send_allvoideigrp_update_send_all (struct eigrp *eigrp, struct eigrp_interface *exception){ struct eigrp_interface *iface; struct listnode *node, *node2, *nnode2; struct eigrp_prefix_entry *pe; for (ALL_LIST_ELEMENTS_RO(eigrp->eiflist, node, iface)) { if (iface != exception) { eigrp_update_send(iface); } } for (ALL_LIST_ELEMENTS(eigrp->topology_changes_internalIPV4, node2, nnode2, pe)) { if(pe->req_action & EIGRP_FSM_NEED_UPDATE) { pe->req_action &= ~EIGRP_FSM_NEED_UPDATE; listnode_delete(eigrp->topology_changes_internalIPV4, pe); zlog_debug("UPDATE COUNT: %d", eigrp->topology_changes_internalIPV4->count); } }}
开发者ID:janovic,项目名称:Quagga-EIGRP,代码行数:26,
示例16: ip_address_count_except_fe80/**Only for real interface first time register rpa table .not include ipv6 address: fe80: xx**/int ip_address_count_except_fe80(struct interface* ifp) { struct connected *c; struct listnode *cnode, *cnnode; int i = 0; if (ifp->connected) { for (ALL_LIST_ELEMENTS (ifp->connected, cnode, cnnode, c)) { if(CHECK_FLAG (c->conf, ZEBRA_IFC_CONFIGURED)||CHECK_FLAG (c->conf, ZEBRA_IFC_REAL)) { if((c->address->family == AF_INET6) &&(IPV6_ADDR_FE80(c->address->u.prefix6.in6_u.u6_addr16[0]))) continue; else i++; } } } /* zlog_info("############## i = %d #################/n",i);*/ return i; }
开发者ID:kkcloudy,项目名称:daemongroup,代码行数:28,
示例17: interface_downintinterface_down (struct thread *thread){ struct ospf6_interface *oi; struct listnode *node, *nnode; struct ospf6_neighbor *on; oi = (struct ospf6_interface *) THREAD_ARG (thread); assert (oi && oi->interface); if (IS_OSPF6_DEBUG_INTERFACE) zlog_debug ("Interface Event %s: [InterfaceDown]", oi->interface->name); /* Leave AllSPFRouters */ if (oi->state > OSPF6_INTERFACE_DOWN) ospf6_sso (oi->interface->ifindex, &allspfrouters6, IPV6_LEAVE_GROUP); ospf6_interface_state_change (OSPF6_INTERFACE_DOWN, oi); for (ALL_LIST_ELEMENTS (oi->neighbor_list, node, nnode, on)) ospf6_neighbor_delete (on); list_delete_all_node (oi->neighbor_list); return 0;}
开发者ID:rgmabs19357,项目名称:qpimd,代码行数:27,
示例18: eigrp_query_send_allu_int32_teigrp_query_send_all (struct eigrp *eigrp){ struct eigrp_interface *iface; struct listnode *node, *node2, *nnode2; struct eigrp_neighbor *nbr; struct eigrp_prefix_entry *pe; u_int32_t counter; if (eigrp == NULL) { zlog_debug("EIGRP Routing Process not enabled"); return 0; } counter=0; for (ALL_LIST_ELEMENTS_RO(eigrp->eiflist, node, iface)) { eigrp_send_query(iface); counter++; } for (ALL_LIST_ELEMENTS(eigrp->topology_changes_internalIPV4, node2, nnode2, pe)) { if(pe->req_action & EIGRP_FSM_NEED_QUERY) { pe->req_action &= ~EIGRP_FSM_NEED_QUERY; listnode_delete(eigrp->topology_changes_internalIPV4, pe); } } return counter;}
开发者ID:janovic,项目名称:Quagga-EIGRP,代码行数:33,
示例19: are_checksums_sameunsigned intare_checksums_same (void){ int same = 0; struct listnode * node, * nnode; struct sisis_listener * listener; struct sisis_listener * listener_swp = (struct sisis_listener *)listgetdata(listhead(sm->listen_sockets)); u_int16_t chsum_swp = listener_swp->chksum; for(ALL_LIST_ELEMENTS (sm->listen_sockets, node, nnode, listener)) { zlog_debug("checksum: %d/n", listener->chksum); if(listener->chksum == chsum_swp) { same = 1; chsum_swp = listener->chksum; } else { return 0; } } return same;}
开发者ID:ecks,项目名称:sis-is,代码行数:25,
示例20: rip_enable_network_lookup_if/* Check wether the interface has at least a connected prefix that * is within the ripng_enable_network table. */static intrip_enable_network_lookup_if (struct interface *ifp){ struct listnode *node, *nnode; struct connected *connected; struct prefix_ipv4 address; for (ALL_LIST_ELEMENTS (ifp->connected, node, nnode, connected)) { struct prefix *p; struct route_node *node; p = connected->address; if (p->family == AF_INET) { address.family = AF_INET; address.prefix = p->u.prefix4; address.prefixlen = IPV4_MAX_BITLEN; node = route_node_match (rip_enable_network, (struct prefix *)&address); if (node) { route_unlock_node (node); return 1; } } } return -1;}
开发者ID:FujitsuNetworkCommunications,项目名称:Quagga-Graceful-Restart,代码行数:33,
示例21: ospf6_abr_disable_areavoidospf6_abr_disable_area (struct ospf6_area *area){ struct ospf6_area *oa; struct ospf6_route *ro; struct ospf6_lsa *old; struct listnode *node, *nnode; /* Withdraw all summary prefixes previously originated */ for (ro = ospf6_route_head (area->summary_prefix); ro; ro = ospf6_route_next (ro)) { old = ospf6_lsdb_lookup (ro->path.origin.type, ro->path.origin.id, area->ospf6->router_id, area->lsdb); if (old) ospf6_lsa_purge (old); ospf6_route_remove (ro, area->summary_prefix); } /* Withdraw all summary router-routes previously originated */ for (ro = ospf6_route_head (area->summary_router); ro; ro = ospf6_route_next (ro)) { old = ospf6_lsdb_lookup (ro->path.origin.type, ro->path.origin.id, area->ospf6->router_id, area->lsdb); if (old) ospf6_lsa_purge (old); ospf6_route_remove (ro, area->summary_router); } /* Schedule Router-LSA for each area (ABR status may change) */ for (ALL_LIST_ELEMENTS (area->ospf6->area_list, node, nnode, oa)) /* update B bit for each area */ OSPF6_ROUTER_LSA_SCHEDULE (oa);}
开发者ID:LabNConsulting,项目名称:OLD-quagga-patches,代码行数:35,
示例22: ospf6_abr_enable_areavoidospf6_abr_enable_area (struct ospf6_area *area){ struct ospf6_area *oa; struct ospf6_route *ro; struct listnode *node, *nnode; for (ALL_LIST_ELEMENTS (area->ospf6->area_list, node, nnode, oa)) { /* update B bit for each area */ OSPF6_ROUTER_LSA_SCHEDULE (oa); /* install other area's configured address range */ if (oa != area) { for (ro = ospf6_route_head (oa->range_table); ro; ro = ospf6_route_next (ro)) { if (CHECK_FLAG (ro->flag, OSPF6_ROUTE_ACTIVE_SUMMARY)) ospf6_abr_originate_summary_to_area (ro, area); } } } /* install calculated routes to border routers */ for (ro = ospf6_route_head (area->ospf6->brouter_table); ro; ro = ospf6_route_next (ro)) ospf6_abr_originate_summary_to_area (ro, area); /* install calculated routes to network (may be rejected by ranges) */ for (ro = ospf6_route_head (area->ospf6->route_table); ro; ro = ospf6_route_next (ro)) ospf6_abr_originate_summary_to_area (ro, area);}
开发者ID:LabNConsulting,项目名称:OLD-quagga-patches,代码行数:34,
示例23: ospf6_area_deletevoidospf6_area_delete (struct ospf6_area *oa){ struct listnode *n, *nnode; struct ospf6_interface *oi; ospf6_route_table_delete (oa->range_table); ospf6_route_table_delete (oa->summary_prefix); ospf6_route_table_delete (oa->summary_router); /* ospf6 interface list */ for (ALL_LIST_ELEMENTS (oa->if_list, n, nnode, oi)) { ospf6_interface_delete (oi); } list_delete (oa->if_list); ospf6_lsdb_delete (oa->lsdb); ospf6_lsdb_delete (oa->lsdb_self); ospf6_spf_table_finish (oa->spf_table); ospf6_route_table_delete (oa->spf_table); ospf6_route_table_delete (oa->route_table); THREAD_OFF (oa->thread_spf_calculation); THREAD_OFF (oa->thread_route_calculation); listnode_delete (oa->ospf6->area_list, oa); oa->ospf6 = NULL; /* free area */ XFREE (MTYPE_OSPF6_AREA, oa);}
开发者ID:Addision,项目名称:LVS,代码行数:33,
示例24: ospf6_deletevoidospf6_delete (struct ospf6 *o){ struct listnode *node, *nnode; struct ospf6_area *oa; ospf6_disable (ospf6); for (ALL_LIST_ELEMENTS (o->area_list, node, nnode, oa)) ospf6_area_delete (oa); list_delete (o->area_list); ospf6_lsdb_delete (o->lsdb); ospf6_lsdb_delete (o->lsdb_self); ospf6_route_table_delete (o->route_table); ospf6_route_table_delete (o->brouter_table); ospf6_route_table_delete (o->external_table); route_table_finish (o->external_id_table); XFREE (MTYPE_OSPF6_TOP, o); /* TODO Fix this */ ospf6 = NULL;}
开发者ID:edderick,项目名称:quagga_zOSPF,代码行数:25,
示例25: if_down/* Interface goes down. We have to manage different behavior of based OS. */voidif_down (struct interface *ifp){ struct listnode *node; struct listnode *next; struct connected *ifc; struct prefix *p; /* Notify to the protocol daemons. */ zebra_interface_down_update (ifp); /* Delete connected routes from the kernel. */ if (ifp->connected) { for (ALL_LIST_ELEMENTS (ifp->connected, node, next, ifc)) { p = ifc->address; if (p->family == AF_INET) connected_down_ipv4 (ifp, ifc);#ifdef HAVE_IPV6 else if (p->family == AF_INET6) connected_down_ipv6 (ifp, ifc);#endif /* HAVE_IPV6 */ } } /* Examine all static routes which direct to the interface. */ rib_update ();}
开发者ID:edderick,项目名称:quagga_zOSPF,代码行数:32,
示例26: ripng_if_downstatic intripng_if_down (struct interface *ifp){ struct route_node *rp; struct ripng_info *rinfo; struct ripng_interface *ri; struct list *list = NULL; struct listnode *listnode = NULL, *nextnode = NULL; if (ripng) for (rp = route_top (ripng->table); rp; rp = route_next (rp)) if ((list = rp->info) != NULL) for (ALL_LIST_ELEMENTS (list, listnode, nextnode, rinfo)) if (rinfo->ifindex == ifp->ifindex) ripng_ecmp_delete (rinfo); ri = ifp->info; if (ri->running) { if (IS_RIPNG_DEBUG_EVENT) zlog_debug ("turn off %s", ifp->name); /* Leave from multicast group. */ ripng_multicast_leave (ifp); ri->running = 0; } return 0;}
开发者ID:KaloNK,项目名称:quagga,代码行数:31,
示例27: ospf_if_is_configured/** check if interface with given address is configured and* return it if yes. special treatment for PtP networks.*/struct ospf_interface *ospf_if_is_configured (struct ospf *ospf, struct in_addr *address){ struct listnode *node, *nnode; struct ospf_interface *oi; struct prefix_ipv4 addr; addr.family = AF_INET; addr.prefix = *address; addr.prefixlen = IPV4_MAX_PREFIXLEN; for (ALL_LIST_ELEMENTS (ospf->oiflist, node, nnode, oi)) if (oi->type != OSPF_IFTYPE_VIRTUALLINK) { if (oi->type == OSPF_IFTYPE_POINTOPOINT) { /* special leniency: match if addr is anywhere on peer subnet */ if (prefix_match(CONNECTED_PREFIX(oi->connected), (struct prefix *)&addr)) return oi; } else { if (IPV4_ADDR_SAME (address, &oi->address->u.prefix4)) return oi; } } return NULL;}
开发者ID:Quagga,项目名称:historical,代码行数:33,
示例28: ripng_connect_setstatic voidripng_connect_set (struct interface *ifp, int set){ struct listnode *node, *nnode; struct connected *connected; struct prefix_ipv6 address; for (ALL_LIST_ELEMENTS (ifp->connected, node, nnode, connected)) { struct prefix *p; p = connected->address; if (p->family != AF_INET6) continue; address.family = AF_INET6; address.prefix = p->u.prefix6; address.prefixlen = p->prefixlen; apply_mask_ipv6 (&address); if (set) { /* Check once more wether this prefix is within a "network IF_OR_PREF" one */ if ((ripng_enable_if_lookup(connected->ifp->name) >= 0) || (ripng_enable_network_lookup2(connected) >= 0)) ripng_redistribute_add (ZEBRA_ROUTE_CONNECT, RIPNG_ROUTE_INTERFACE, &address, connected->ifp->ifindex, NULL); } else { ripng_redistribute_delete (ZEBRA_ROUTE_CONNECT, RIPNG_ROUTE_INTERFACE, &address, connected->ifp->ifindex); if (ripng_redistribute_check (ZEBRA_ROUTE_CONNECT)) ripng_redistribute_add (ZEBRA_ROUTE_CONNECT, RIPNG_ROUTE_REDISTRIBUTE, &address, connected->ifp->ifindex, NULL); } }}
开发者ID:Quagga-RE,项目名称:wip-tcs-rfc6506,代码行数:35,
示例29: ospf6_deletevoid ospf6_delete(struct ospf6 *o){ struct listnode *node, *nnode; struct ospf6_area *oa; QOBJ_UNREG(o); ospf6_flush_self_originated_lsas_now(); ospf6_disable(ospf6); for (ALL_LIST_ELEMENTS(o->area_list, node, nnode, oa)) ospf6_area_delete(oa); list_delete(&o->area_list); ospf6_lsdb_delete(o->lsdb); ospf6_lsdb_delete(o->lsdb_self); ospf6_route_table_delete(o->route_table); ospf6_route_table_delete(o->brouter_table); ospf6_route_table_delete(o->external_table); route_table_finish(o->external_id_table); ospf6_distance_reset(o); route_table_finish(o->distance_table); XFREE(MTYPE_OSPF6_TOP, o);}
开发者ID:ton31337,项目名称:frr,代码行数:30,
示例30: scan_upstream_rpf_cachestatic void scan_upstream_rpf_cache(){ struct listnode *up_node; struct listnode *up_nextnode; struct pim_upstream *up; for (ALL_LIST_ELEMENTS(qpim_upstream_list, up_node, up_nextnode, up)) { struct in_addr old_rpf_addr; enum pim_rpf_result rpf_result; rpf_result = pim_rpf_update(up, &old_rpf_addr); if (rpf_result == PIM_RPF_FAILURE) continue; if (rpf_result == PIM_RPF_CHANGED) { if (up->join_state == PIM_UPSTREAM_JOINED) { /* RFC 4601: 4.5.7. Sending (S,G) Join/Prune Messages Transitions from Joined State RPF'(S,G) changes not due to an Assert The upstream (S,G) state machine remains in Joined state. Send Join(S,G) to the new upstream neighbor, which is the new value of RPF'(S,G). Send Prune(S,G) to the old upstream neighbor, which is the old value of RPF'(S,G). Set the Join Timer (JT) to expire after t_periodic seconds. */ /* send Prune(S,G) to the old upstream neighbor */ pim_joinprune_send(up->rpf.source_nexthop.interface, old_rpf_addr, up->source_addr, up->group_addr, 0 /* prune */); /* send Join(S,G) to the current upstream neighbor */ pim_joinprune_send(up->rpf.source_nexthop.interface, up->rpf.rpf_addr, up->source_addr, up->group_addr, 1 /* join */); pim_upstream_join_timer_restart(up); } /* up->join_state == PIM_UPSTREAM_JOINED */ /* FIXME can join_desired actually be changed by pim_rpf_update() returning PIM_RPF_CHANGED ? */ pim_upstream_update_join_desired(up); } /* PIM_RPF_CHANGED */ } /* for (qpim_upstream_list) */ }
开发者ID:Distrotech,项目名称:quagga,代码行数:59,
注:本文中的ALL_LIST_ELEMENTS函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ ALOGD函数代码示例 C++ ALLOC_ZVAL函数代码示例 |