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