📄 ospf.h
字号:
void age_prematurely(LSA *); void sl_orig(INrte *rte, bool transit_changes_only=false); void asbr_orig(ASBRrte *rte); void ase_schedule(class ExRtData *); void ase_orig(class ExRtData *, int forced); void ase_orig(INrte *, int forced); void grp_orig(InAddr group, int forced=0); void reoriginate_ASEs(); void build_update(Pkt *pkt, LShdr *hdr, uns16 mtu, bool demand); void add_to_update(LShdr *hdr, bool demand); void redo_aggregate(INrte *rangerte, SpfArea *ap); void EnterOverflowState(); void opq_orig(SpfIfc *, SpfArea *, byte, lsid_t, byte *, int, bool, int); // Routing calculations ASBRrte *add_asbr(uns32 rtid); void rtsched(LSA *newlsa, RTE *old_rte); void full_calculation(); void dijk_init(PriQ &cand); void host_dijk_init(PriQ &cand); void add_cand_node(SpfIfc *ip, TNode *node, PriQ &cand); void dijkstra(); void update_brs(); void update_asbrs(); void invalidate_ranges(); void rt_scan(); void update_area_ranges(INrte *rte); void advertise_ranges(); void do_all_ases(); void krt_sync(); // MOSPF routines INrte *mc_source(InAddr src); void add_negative_mcache_entry(InAddr src, INrte *srte, InAddr group); // MOSPF cache maintenance void mospf_clear_cache(); void mospf_clear_inter_source(INrte *rte); void mospf_clear_external_source(INrte *rte); void mospf_clear_group(InAddr); // Hitless restart routines // Preparation void prepare_hitless_restart(); void send_grace_lsas(); bool verify_grace_acks(); void store_hitless_parameters(); void next_hitless_phase(); // Helper mode void grace_LSA_rx(class opqLSA *, LShdr *); void grace_LSA_flushed(class opqLSA *); void htl_topology_change(); void cancel_help_sessions(LSA *lsap); // While restarting hitlessly bool in_hitless_restart(); void htl_exit_criteria(); void htl_check_consistency(SpfArea *, LShdr *); void exit_hitless_restart(const char *reason); void htl_reorig(AVLtree *); // Logging routines bool spflog(int, int); void log(int); void log(const char *); void log(Pkt *pdesc); void log(InPkt *iphdr); void log(class LShdr *); void log(class SpfArea *); void log(class SpfIfc *); void log(class SpfNbr *); void log(InAddr *addr); void log(class LSA *); void log(class INrte *); void log(InAddr *addr, InMask *mask); public: // Version numbers enum { vmajor = 2, // Major version number vminor = 16, // Minor version number }; // Entry points into the OSPF code OSPF(uns32 rtid, SPFtime grace); ~OSPF(); void rxpkt(int phyint, InPkt *pkt, int plen); int timeout(); void tick(); void monitor(struct MonMsg *msg, byte type, int size, int conn_id); void rxigmp(int phyint, InPkt *pkt, int plen); MCache *mclookup(InAddr src, InAddr group); void join_indication(InAddr group, int phyint); void leave_indication(InAddr group, int phyint); void phy_up(int phyint); void phy_down(int phyint); void krt_delete_notification(InAddr net, InMask mask); void remnant_notification(InAddr net, InMask mask); MPath *ip_lookup(InAddr dest); InAddr ip_source(InAddr dest); InAddr if_addr(int phyint); void shutdown(int seconds); inline bool shutting_down(); void hitless_restart(int seconds, byte reason); void logflush(); inline rtid_t my_id(); inline int n_extLSAs(); inline uns32 xsum_extLSAs(); // Opaque-LSA API bool adv_link_opq(int phyint, InAddr, lsid_t, byte *, int len, bool); bool adv_area_opq(aid_t, lsid_t, byte *, int len, bool); void adv_as_opq(lsid_t, byte *, int len, bool); void register_for_opqs(int conn_id, bool disconnect=false); bool get_next_opq(int, int &, InAddr &, aid_t &, struct LShdr * &); // Configuration routines void cfgOspf(struct CfgGen *msg); void cfgArea(struct CfgArea *msg, int status); void cfgRnge(struct CfgRnge *msg, int status); void cfgIfc(struct CfgIfc *msg, int status); void cfgHost(struct CfgHost *msg, int status); void cfgVL(struct CfgVL *msg, int status); void cfgAuKey(struct CfgAuKey *key, int status); void cfgNbr(struct CfgNbr *msg, int status); void cfgExRt(struct CfgExRt *msg, int status); void cfgStart(); void cfgDone(); // Configuration query routines // Return true if item found for query and fill in message. // All methods are const as they do not modify any internal structures. void qryOspf(struct CfgGen& msg) const; bool qryArea(struct CfgArea& msg, aid_t area_id) const; bool qryRnge(struct CfgRnge& msg, aid_t area_id, InAddr net, InMask mask) const; bool qryIfc(struct CfgIfc& msg, InAddr address, int phyint = -1) const; bool qryHost(struct CfgHost& msg, aid_t area_id, InAddr net, InMask mask) const; bool qryVL(struct CfgVL& msg, aid_t transit_id, rtid_t nbt_id) const; bool qryAuKey(struct CfgAuKey& msg, byte key_id, InAddr address, int phyint) const; bool qryNbr(struct CfgNbr& msg, InAddr nbr_address) const; bool qryExRt(struct CfgExRt& msg, InAddr net, InMask mask, InAddr gw, int phyint) const; // Query all routines - retrive list of all known values of given types. void getAreas(std::list<CfgArea>& l) const; void getRnges(std::list<CfgRnge>& l, aid_t area_id) const; void getIfcs(std::list<CfgIfc>& l) const; void getHosts(std::list<CfgHost>& l, aid_t area_id) const; void getVLs(std::list<CfgVL>& l, aid_t transit_id) const; void getAuKeys(std::list<CfgAuKey>& l, InAddr address, int phyint) const; void getNbrs(std::list<CfgNbr>& l) const; void getExRts(std::list<CfgExRt>& l, InAddr net, InMask mask) const; friend class IfcIterator; friend class AreaIterator; friend class DBageTimer; friend class Timer; friend class ITimer; friend class SpfNbr; friend class ConfigItem; friend class SpfIfc; friend class VLIfc; friend class NBMAIfc; friend class PhyInt; friend class ASextLSA; friend class ExitOverflowTimer; friend class LocalOrigTimer; friend class SpfArea; friend class asbrLSA; friend class ASBRrte; friend class LSA; friend class TNode; friend class PPIfc; friend class DRIfc; friend class P2mPIfc; friend class RTE; friend class netLSA; friend class HostAddr; friend class Range; friend class INrte; friend class FWDrte; friend class StaticNbr; friend class GroupTimeoutTimer; friend class LeaveQueryTimer; friend class FWDtbl; friend class MPath; friend class ExRtData; friend class opqLSA; friend class HitlessPrepTimer; friend class HitlessRSTTimer; friend void lsa_flush(class LSA *); friend void ExRtData::clear_config(); friend SpfNbr *GetNextAdj(); friend void INrte::run_external();};// Declaration of the single OSPF protocol instanceextern OSPF *ospf;// Inline functionsinline rtid_t OSPF::my_id(){ return(myid);}inline int OSPF::mospf_enabled(){ return(g_mospf_enabled);}inline bool OSPF::mc_abr(){ return(n_area > 1 && inter_area_mc != 0);}inline bool OSPF::shutting_down(){ return(shutdown_phase > 0);}inline SpfArea *OSPF::SummaryArea(){ return(summary_area);}inline int OSPF::donotage(){ if (wo_donotage != 0) return(false); else if (summary_area) return(summary_area->donotage()); else return(true);}inline int OSPF::n_extLSAs(){ return(extLSAs.size());}inline uns32 OSPF::xsum_extLSAs(){ return(ase_xsum);}inline InAddr OSPF::my_addr(){ return(myaddr);}// non-class-related function declarationsvoid lsa_flush(LSA *lsap);int flooding_scope(byte lstype);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -