亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? helper.c

?? BCAST Implementation for NS2
?? C
字號:
/* *   OSPFD routing daemon *   Copyright (C) 2001 by John T. Moy *    *   This program is free software; you can redistribute it and/or *   modify it under the terms of the GNU General Public License *   as published by the Free Software Foundation; either version 2 *   of the License, or (at your option) any later version. *    *   This program is distributed in the hope that it will be useful, *   but WITHOUT ANY WARRANTY; without even the implied warranty of *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the *   GNU General Public License for more details. *    *   You should have received a copy of the GNU General Public License *   along with this program; if not, write to the Free Software *   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */#include "ospfinc.h"#include "monitor.h"#include "system.h"#include "ifcfsm.h"#include "nbrfsm.h"#include "phyint.h"#include "opqlsa.h"/* This file contains the routines implementing * helper mode for hitless restart. *//* If we are in helper mode, we should be advertising * the neighbor as fully adjacent, even if it isn't. */bool SpfNbr::adv_as_full(){    if (n_state == NBS_FULL)        return(true);    if (n_helptim.is_running())        return(true);    return(false);}/* If we are helping a neighbor perform a hitless restart, * its timer should be running. */bool SpfNbr::we_are_helping(){    return(n_helptim.is_running());}/* If the helper timer expires, we exit helper mode with * a reason of "timeout". */void HelperTimer::action(){    np->exit_helper_mode("Timeout");}/* We have received a grace-LSA from a neighbor. If after * parsing the grace-LSA a) the link-state database has not * changed (aside from refreshes) since the beginning * of the requested refresh period and b) the refresh period has not * expired, then we enter helper mode for the neighbor by * setting the helper timer. */void OSPF::grace_LSA_rx(opqLSA *lsap, LShdr *hdr){    SpfNbr *np;    int grace_period;    const char *refusal = 0;    // Ignore our own    if (lsap->adv_rtr() == myid)        return;    if (!(np = lsap->grace_lsa_parse((byte *)(hdr+1),				     ntoh16(hdr->ls_length)-sizeof(LShdr),				     grace_period)))        return;    // Have associated grace-LSA with a neighbor    if (spflog(LOG_GRACERX, 5))        log(np);    // If we are going to cancel some help sessions, do it now    if (topology_change)        htl_topology_change();    // Now determine whether we should accept it    // Skip these checks if already helping    if (!np->we_are_helping()) {    // Neighbor must be in Full state    if (np->n_state != NBS_FULL)        refusal = "Not full";    // No topology changes since grace period start	else if (np->changes_pending())        refusal = "Topology change";    }    // Grace period already expired?    if (refusal == 0 && grace_period <= 0)        refusal = "Timeout";    /* If we are refusing the grace request, either exit     * helper mode if we are already helping, or just     * log the error.     */    if (refusal != 0 && !np->we_are_helping()) {	if (spflog(LOG_GRACE_REJECT, 5)) {	    log(np);	    log(":");	    log(refusal);	}    }    else if (refusal != 0)        np->exit_helper_mode(refusal);    else {        // (Re)enter helper mode	if (spflog(LOG_HELPER_START, 5))	    log(np);        if (np->we_are_helping()) {	    np->n_helptim.stop();	    np->n_ifp->if_helping--;	    np->n_ifp->area()->a_helping--;	    n_helping--;	}	np->n_helptim.start(grace_period*Timer::SECOND, false);	np->n_ifp->if_helping++;	np->n_ifp->area()->a_helping++;	n_helping++;    }}/* When a grace-LSA is flushed, we exit helper mode. * This is considered to be the successful completion * of a hitless restart. */void OSPF::grace_LSA_flushed(class opqLSA *lsap){    SpfNbr *np;    int grace_period;    // Ignore our own    if (lsap->adv_rtr() == myid)        return;    if (!(np = lsap->grace_lsa_parse(lsap->lsa_body,				     lsap->lsa_length - sizeof(LShdr),				     grace_period)))        return;    // Exit helper mode    if (np->we_are_helping())        np->exit_helper_mode("Success");}/* Parse the body of a grace-LSA, determing a) the length of the * requested grace period (from now) and b) the neighbor requesting * grace. */SpfNbr *opqLSA::grace_lsa_parse(byte *body, int len, int &g_period){    TLVbuf buf(body, len);    int type;    InAddr nbr_addr = 0;    int32 val;    // Parse body of grace-LSA    g_period = 0;    while (buf.next_tlv(type)) {	switch(type) {	  case HLRST_PERIOD:	// Length of grace period	    if (!buf.get_int(g_period))	        return(0);	    break;	  case HLRST_REASON:	// Reason for restart	    break;	  case HLRST_IFADDR:	// Interface address	    if (!buf.get_int(val))	        return(0);	    nbr_addr = (InAddr) val;	    break;	  default:	    break;	}    };    g_period -= (int) lsa_age();    return(lsa_ifp->find_nbr(nbr_addr, adv_rtr()));}/* When exiting helper mode, we need to reoriginate * router-LSAs, network-LSAs, and rerun the Designated Router * calculation for the associated interface. * If the neighbor we were helping is DR, make sure it * stays DR until we receive its next Hello Packet. */void SpfNbr::exit_helper_mode(const char *reason, bool actions){    if (ospf->spflog(LOG_HELPER_STOP, 5)) {        ospf->log(this);	ospf->log(":");	ospf->log(reason);    }    n_helptim.stop();    n_ifp->if_helping--;    n_ifp->area()->a_helping--;    ospf->n_helping--;    /* If neighbor is not yet full again, do the     * processing that should have been done when the     * neighjbor initially went out of FULL state,     */    if (n_state != NBS_FULL) {        SpfArea *tap;        tap = n_ifp->transit_area();	if (n_ifp->if_nfull-- == 1)	    n_ifp->reorig_all_grplsas();	if (tap && tap->n_VLs-- == 1 && actions)	    tap->rl_orig();    }    // Neighbor stays DR until next Hello    else if (n_ifp->if_dr_p == this)        n_dr = n_ifp->if_dr;    // Caller may take actions itself    if (actions) {        // Recalculate Designated Router        n_ifp->run_fsm(IFE_NCHG);	// Re-originate router-LSA	n_ifp->area()->rl_orig();	// And network-LSA	n_ifp->nl_orig(false);    }}/* Determine whether a changed LSA should terminate * helping sessions in one or more areas. If so, * set SpfArea::cancel_help_sessions, and the sessions * will be cancelled at the next timer tick. We don't * cancel the sessions in this routine to avoid recursive * updates of the link-state database. */void OSPF::cancel_help_sessions(LSA *lsap){    SpfArea *ap;    if (n_helping == 0)        return;    // Only LS types 1-5 are significant for hitless restart    if (lsap->lsa_type > LST_ASL)        return;    // Area-scoped change    else if (lsap->lsa_type < LST_ASL) {	ap = lsap->lsa_ap;	if ((ap->cancel_help_sessions = (ap->a_helping != 0)))	    topology_change = true;;    }    // Global-scoped change    else {        AreaIterator iter(this);	while ((ap = iter.get_next())) {	    if (ap->is_stub())	        continue;	    if ((ap->cancel_help_sessions = (ap->a_helping != 0)))	        topology_change = true;;	}    }}/* A topology change has occurred. Cancel all helping modes, * and reoriginate router-LSAs, network-LSAs and rerun * Designated Router calculations, as necessary. * * Also note the time, for use in verifying future * grace requests. */void OSPF::htl_topology_change(){    AreaIterator a_iter(this);    SpfArea *ap;    topology_change = false;    // Cancel any helping sessions    while ((ap = a_iter.get_next())) {        if (!ap->cancel_help_sessions)	    continue;	IfcIterator iiter(ap);	SpfIfc *ip;	while ((ip = iiter.get_next())) {	    if (ip->if_helping == 0)	        continue;	    NbrIterator niter(ip);	    SpfNbr *np;	    while ((np = niter.get_next()))	        if (np->we_are_helping())		    np->exit_helper_mode("Topology change", false);	    // Recalculate Designated Router	    ip->run_fsm(IFE_NCHG);	    // Reoriginate network-LSA	    ip->nl_orig(false);	}	ap->cancel_help_sessions = false;    }	// Re-originate all router-LSAs	rl_orig();}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久久久久久岛国免费| 欧美精品99久久久**| 成人永久免费视频| 成人在线一区二区三区| 高清视频一区二区| 91伊人久久大香线蕉| 91在线精品一区二区三区| 在线观看亚洲一区| 91超碰这里只有精品国产| 精品国产一区二区三区av性色 | 九九国产精品视频| 成人精品在线视频观看| 一本一道波多野结衣一区二区| 成人免费毛片片v| 欧美精品九九99久久| 欧美国产一区二区| 亚洲国产一区二区在线播放| 日本午夜精品视频在线观看| 国产成人aaa| 日韩一区二区在线观看视频| 欧美激情中文字幕一区二区| 午夜精品久久久久久久蜜桃app| 亚洲一区二区黄色| jizz一区二区| 久久久久国产免费免费| 日韩在线观看一区二区| 在线观看视频91| 国产精品国产三级国产aⅴ中文 | 久久国产人妖系列| 欧美女孩性生活视频| 一区二区视频在线看| 高清av一区二区| 欧美videofree性高清杂交| 亚洲一区影音先锋| 成人自拍视频在线观看| 欧美激情自拍偷拍| 国产成人精品一区二 | 亚洲免费观看高清完整版在线 | 在线观看亚洲一区| 亚洲男女一区二区三区| 99久久99久久免费精品蜜臀| 国产日韩欧美综合一区| 国产98色在线|日韩| 中文字幕成人在线观看| av电影在线观看完整版一区二区 | 亚洲欧美另类久久久精品2019| 亚洲www啪成人一区二区麻豆| hitomi一区二区三区精品| 国产欧美视频一区二区三区| 国产麻豆精品在线| 久久午夜色播影院免费高清| 丁香亚洲综合激情啪啪综合| 国产精品久久久久aaaa| 欧美在线一二三| 精品一区二区三区蜜桃| 中文字幕中文字幕中文字幕亚洲无线| 亚洲成人自拍网| 久久久久久久精| 欧美在线你懂的| 成人免费视频国产在线观看| 亚洲精品成人在线| www久久久久| 欧美人妖巨大在线| caoporn国产一区二区| 午夜精品久久久久久久99樱桃| 日本韩国欧美国产| 国产一区二区成人久久免费影院 | 豆国产96在线|亚洲| 亚洲香肠在线观看| 国产精品美女一区二区| 欧美午夜精品电影| 99re这里只有精品视频首页| 久久成人羞羞网站| 亚洲无人区一区| 一区二区三区**美女毛片| 国产精品传媒入口麻豆| 日韩欧美成人一区| 欧美一区二区二区| 欧美军同video69gay| 色久优优欧美色久优优| 97久久超碰精品国产| 丁香婷婷综合色啪| 国产精品一区二区果冻传媒| 亚洲午夜久久久| 亚洲一区二区在线免费看| 亚洲人成人一区二区在线观看| 欧美一区二区三区公司| 日韩一区二区高清| 精品美女一区二区| 国产日韩欧美在线一区| 国产女人18水真多18精品一级做| 91精品国产手机| 精品国产3级a| 亚洲欧洲在线观看av| 亚洲欧美激情小说另类| 亚洲综合色噜噜狠狠| 日韩精品一区二区三区四区| 精品久久久久99| 国产精品网友自拍| 亚洲线精品一区二区三区| 美国欧美日韩国产在线播放| 国产一区二区电影| 色婷婷国产精品| ww亚洲ww在线观看国产| 综合中文字幕亚洲| 蜜臀av性久久久久av蜜臀妖精| 日本伊人色综合网| 成人sese在线| 日韩三级视频在线看| 国产精品国产三级国产普通话三级| 国产精品久久久久永久免费观看| 久久天堂av综合合色蜜桃网 | 亚洲欧美电影一区二区| 麻豆免费精品视频| 91福利在线看| 国产精品久久久久久久久快鸭 | 91女神在线视频| 精品精品国产高清a毛片牛牛| 久久久久久久久久久久久夜| 三级久久三级久久久| 欧美综合亚洲图片综合区| 欧美韩日一区二区三区| 激情五月激情综合网| 91精品国产美女浴室洗澡无遮挡| 国产视频视频一区| 日韩av高清在线观看| 欧美综合欧美视频| 悠悠色在线精品| 色一情一乱一乱一91av| 亚洲欧美激情在线| 色综合久久88色综合天天6| 中文字幕一区二区视频| 成人sese在线| 亚洲一区二三区| 欧美日本国产一区| 精品一区二区日韩| 久久精品男人的天堂| 成人夜色视频网站在线观看| 中文字幕av一区二区三区| 成人免费毛片片v| 亚洲午夜久久久久久久久电影网| 97久久人人超碰| 午夜欧美视频在线观看| 91精品视频网| 成人国产电影网| 亚洲午夜av在线| 久久综合九色综合97_久久久| 亚洲国产一区二区在线播放| 精品国产91久久久久久久妲己| 久久精品国产澳门| 中文字幕亚洲欧美在线不卡| 欧美视频在线观看一区| 九一九一国产精品| 亚洲精品免费在线播放| 精品久久久久久久人人人人传媒| 狠狠色狠狠色综合系列| 一区二区三区在线看| 精品国产一区二区三区四区四| 国v精品久久久网| 亚洲一区二区三区四区五区黄| 欧洲视频一区二区| 国产精品正在播放| 精品在线一区二区三区| 亚洲第一会所有码转帖| 亚洲免费三区一区二区| 国产女人水真多18毛片18精品视频| 91色porny| 成人丝袜18视频在线观看| 精品在线免费视频| 美女视频一区在线观看| 日韩国产欧美三级| 日韩电影免费在线看| 一区二区三区在线观看欧美 | 亚洲电影一区二区| 亚洲午夜视频在线| 天堂成人国产精品一区| 亚洲国产精品人人做人人爽| 亚洲成在线观看| 日本在线不卡视频| 国产一区福利在线| 国产91丝袜在线18| 色婷婷激情久久| 777精品伊人久久久久大香线蕉| aaa国产一区| 欧美精品1区2区| 欧美mv和日韩mv国产网站| 国产亚洲一区二区三区四区| 国产精品视频第一区| 亚洲丝袜自拍清纯另类| 亚洲一区二区三区视频在线| 舔着乳尖日韩一区| 国产1区2区3区精品美女| 色伊人久久综合中文字幕| 欧美一级精品在线| 成人欧美一区二区三区1314| 欧美日韩不卡在线| 99九九99九九九视频精品| 亚洲精品写真福利| 国产精品午夜在线| 国产精品乱码一区二区三区软件 |