LCOV - code coverage report
Current view: top level - vnsw/agent/init - contrail_init_common.h (source / functions) Hit Total Coverage
Test: OpenSDN C/C++ coverage (all TARGET_SET jobs) Lines: 8 8 100.0 %
Date: 2026-11-09 02:10:49 Functions: 8 8 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       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:
      19             :     ContrailInitCommon();
      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         140 :     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_; }
      48             :     bool router_id_dep_enable() const { return router_id_dep_enable_; }
      49             : 
      50           3 :     void set_ksync_enable(bool flag) { ksync_enable_ = flag; }
      51           3 :     void set_services_enable(bool flag) { services_enable_ = flag; }
      52           3 :     void set_packet_enable(bool flag) { packet_enable_ = flag; }
      53           3 :     void set_create_vhost(bool flag) { create_vhost_ = flag; }
      54           3 :     void set_uve_enable(bool flag) { uve_enable_ = flag; }
      55           3 :     void set_vgw_enable(bool flag) { vgw_enable_ = flag; }
      56           3 :     void set_router_id_dep_enable(bool flag) { router_id_dep_enable_ = flag; }
      57             : private:
      58             :     bool create_vhost_;
      59             :     bool ksync_enable_;
      60             :     bool services_enable_;
      61             :     bool packet_enable_;
      62             :     bool uve_enable_;
      63             :     bool vgw_enable_;
      64             :     bool router_id_dep_enable_;
      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_;
      74             :     DISALLOW_COPY_AND_ASSIGN(ContrailInitCommon);
      75             : };
      76             : 
      77             : #endif // vnsw_agent_init_contrail_cmn_init_hpp

Generated by: LCOV version 1.14