xorp

xrl_process_spy.hh

00001 // -*- c-basic-offset: 4; tab-width: 8; indent-tabs-mode: t -*-
00002 
00003 // Copyright (c) 2001-2009 XORP, Inc.
00004 //
00005 // This program is free software; you can redistribute it and/or modify
00006 // it under the terms of the GNU General Public License, Version 2, June
00007 // 1991 as published by the Free Software Foundation. Redistribution
00008 // and/or modification of this program under the terms of any other
00009 // version of the GNU General Public License is not permitted.
00010 // 
00011 // This program is distributed in the hope that it will be useful, but
00012 // WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more details,
00014 // see the GNU General Public License, Version 2, a copy of which can be
00015 // found in the XORP LICENSE.gpl file.
00016 // 
00017 // XORP Inc, 2953 Bunker Hill Lane, Suite 204, Santa Clara, CA 95054, USA;
00018 // http://xorp.net
00019 
00020 // $XORP: xorp/rip/xrl_process_spy.hh,v 1.12 2008/10/02 21:58:19 bms Exp $
00021 
00022 #ifndef __RIP_XRL_PROCESS_SPY_HH__
00023 #define __RIP_XRL_PROCESS_SPY_HH__
00024 
00025 #include "libxorp/service.hh"
00026 
00027 class XrlRouter;
00028 
00036 class XrlProcessSpy : public ServiceBase {
00037 public:
00038     XrlProcessSpy(XrlRouter& rtr);
00039     ~XrlProcessSpy();
00040 
00046     int startup();
00047 
00053     int shutdown();
00054 
00061     bool fea_present() const;
00062 
00069     bool rib_present() const;
00070 
00079     void birth_event(const string& class_name,
00080              const string& instance_name);
00081 
00089     void death_event(const string& class_name,
00090              const string& instance_name);
00091 
00092 protected:
00093     void send_register(uint32_t idx);
00094     void register_cb(const XrlError& e, uint32_t idx);
00095     void schedule_register_retry(uint32_t idx);
00096 
00097     void send_deregister(uint32_t idx);
00098     void deregister_cb(const XrlError& e, uint32_t idx);
00099     void schedule_deregister_retry(uint32_t idx);
00100 
00101 protected:
00102     static const uint32_t FEA_IDX = 0;
00103     static const uint32_t RIB_IDX = 1;
00104     static const uint32_t END_IDX = 2;
00105 
00106 protected:
00107     XrlRouter&  _rtr;
00108     string  _cname[END_IDX];
00109     string  _iname[END_IDX];
00110     XorpTimer   _retry;
00111 };
00112 
00113 #endif // __RIP_XRL_PROCESS_SPY_HH__
 All Classes Namespaces Functions Variables Typedefs Enumerations