OpenSDN source code
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
contrail_init_common.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014 Juniper Networks, Inc. All rights reserved.
3  */
4 
5 #ifndef vnsw_agent_init_contrail_cmn_init_hpp
6 #define vnsw_agent_init_contrail_cmn_init_hpp
7 
8 #include <boost/program_options.hpp>
9 #include <init/agent_init.h>
10 
11 class Agent;
12 class AgentParam;
13 
14 // The class to drive agent initialization.
15 // Defines control parameters used to enable/disable agent features
16 class ContrailInitCommon : public AgentInit {
17 public:
19  virtual ~ContrailInitCommon();
20 
21  void ProcessOptions(const std::string &config_file,
22  const std::string &program_name);
23  void ProcessComputeAddress(AgentParam *param);
24  int Start();
25 
26  // Initialization virtual methods
27  void CreateModules();
28  void RegisterDBClients();
29  void InitModules();
30  void CreateVrf();
31  void CreateInterfaces();
32  virtual void InitDone();
33 
34  // Shutdown virtual methods
35  void IoShutdown();
36  void FlushFlows();
37  void ServicesShutdown();
38  virtual void ModulesShutdown();
39  void PktShutdown();
40 
41  bool ksync_enable() const { return ksync_enable_; }
42  bool services_enable() const { return services_enable_; }
43  bool packet_enable() const { return packet_enable_; }
44  bool create_vhost() const { return create_vhost_; }
45  bool uve_enable() const { return uve_enable_; }
46  bool vgw_enable() const { return vgw_enable_; }
48 
49  void set_ksync_enable(bool flag) { ksync_enable_ = flag; }
50  void set_services_enable(bool flag) { services_enable_ = flag; }
51  void set_packet_enable(bool flag) { packet_enable_ = flag; }
52  void set_create_vhost(bool flag) { create_vhost_ = flag; }
53  void set_uve_enable(bool flag) { uve_enable_ = flag; }
54  void set_vgw_enable(bool flag) { vgw_enable_ = flag; }
55  void set_router_id_dep_enable(bool flag) { router_id_dep_enable_ = flag; }
56 private:
64 
65  std::unique_ptr<KSync> ksync_;
66  std::unique_ptr<AgentUveBase> uve_;
67 
68  std::unique_ptr<DiagTable> diag_table_;
69  std::unique_ptr<ServicesModule> services_;
70  std::unique_ptr<PktModule> pkt_;
71  std::unique_ptr<VirtualGateway> vgw_;
72  std::unique_ptr<MacLearningModule> mac_learning_module_;
74 };
75 
76 #endif // vnsw_agent_init_contrail_cmn_init_hpp
virtual void ModulesShutdown()
std::unique_ptr< DiagTable > diag_table_
std::unique_ptr< KSync > ksync_
string program_name(string filename)
void ProcessOptions(const std::string &config_file, const std::string &program_name)
std::unique_ptr< AgentUveBase > uve_
std::unique_ptr< ServicesModule > services_
void set_packet_enable(bool flag)
void set_vgw_enable(bool flag)
std::unique_ptr< MacLearningModule > mac_learning_module_
bool packet_enable() const
bool create_vhost() const
bool ksync_enable() const
void set_router_id_dep_enable(bool flag)
Definition: agent.h:358
void set_services_enable(bool flag)
bool services_enable() const
void set_uve_enable(bool flag)
std::unique_ptr< VirtualGateway > vgw_
bool router_id_dep_enable() const
void set_create_vhost(bool flag)
DISALLOW_COPY_AND_ASSIGN(ContrailInitCommon)
void set_ksync_enable(bool flag)
void ProcessComputeAddress(AgentParam *param)
std::unique_ptr< PktModule > pkt_