Line data Source code
1 : /* 2 : * Copyright (c) 2013 Juniper Networks, Inc. All rights reserved. 3 : * Copyright Contributors to the OpenSDN project 4 : */ 5 : 6 : #ifndef ksync_agent_sandesh_h_ 7 : #define ksync_agent_sandesh_h_ 8 : 9 : #include <oper/agent_sandesh.h> 10 : #include "interface_ksync.h" 11 : #include <cmn/agent_cmn.h> 12 : 13 : class AgentKsyncSandesh; 14 : typedef class boost::shared_ptr<AgentKsyncSandesh> AgentKsyncSandeshPtr; 15 : class AgentKsyncSandesh { 16 : public: 17 : AgentKsyncSandesh(const std::string &context); 18 0 : virtual ~AgentKsyncSandesh() { } 19 : void DoKsyncSandesh(AgentKsyncSandeshPtr sandesh); 20 : void DoKsyncSandeshInternal(AgentKsyncSandeshPtr sandesh); 21 : void SetResp(); 22 : virtual bool UpdateResp(KSyncEntry *entry) = 0; 23 : virtual KSyncDBObject *AgentGetKsyncObject() = 0; 24 : virtual void Alloc() = 0; 25 : 26 : protected: 27 : SandeshResponse *resp_; 28 : std::string context_; 29 : const std::string name_; 30 : Agent *agent_; 31 : }; 32 : 33 : //////////////////////////// 34 : //// ksync interface ////// 35 : /////////////////////////// 36 : class AgentKsyncIntfSandesh : public AgentKsyncSandesh { 37 : public: 38 : AgentKsyncIntfSandesh(const std::string &context); 39 0 : ~AgentKsyncIntfSandesh() { } 40 : bool UpdateResp(KSyncEntry *entry) ; 41 : KSyncDBObject *AgentGetKsyncObject() ; 42 : void Alloc() ; 43 : 44 : private: 45 : friend class KSyncItfReq; 46 : }; 47 : 48 : //////////////////////////// 49 : //// ksync NextHopList ////// 50 : /////////////////////////// 51 : class AgentKsyncNhListSandesh : public AgentKsyncSandesh { 52 : public: 53 : AgentKsyncNhListSandesh(const std::string &context) ; 54 0 : ~AgentKsyncNhListSandesh() { } 55 : bool UpdateResp(KSyncEntry *entry) ; 56 : KSyncDBObject *AgentGetKsyncObject() ; 57 : void Alloc() ; 58 : 59 : private: 60 : friend class KSyncNhListReq; 61 : }; 62 : #endif /*ksync_agent_sandesh_h_*/