LCOV - code coverage report
Current view: top level - vnsw/agent/cfg - cfg_init.h (source / functions) Hit Total Coverage
Test: OpenSDN C/C++ coverage (all TARGET_SET jobs) Lines: 60 78 76.9 %
Date: 2026-11-30 02:00:48 Functions: 33 43 76.7 %
Legend: Lines: hit not hit

          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 vnsw_agent_init_cfg_hpp
       7             : #define vnsw_agent_init_cfg_hpp
       8             : 
       9             : #include <cmn/agent_cmn.h>
      10             : #include <ifmap/ifmap_agent_table.h>
      11             : #include <sandesh/sandesh_trace.h>
      12             : 
      13             : class CfgFilter;
      14             : class CfgListener;
      15             : class MirrorCfgTable;
      16             : class IntfMirrorCfgTable;
      17             : 
      18             : class AgentConfig  {
      19             : public:
      20             :     AgentConfig(Agent *agent);
      21             :     virtual ~AgentConfig();
      22             : 
      23         334 :     IFMapAgentTable *cfg_vm_interface_table() const {
      24         334 :         return cfg_vm_interface_table_;
      25             :     }
      26         308 :     IFMapAgentTable *cfg_vm_table() const {return cfg_vm_table_;}
      27         915 :     IFMapAgentTable *cfg_vn_table() const {return cfg_vn_table_;}
      28         259 :     IFMapAgentTable *cfg_sg_table() const {return cfg_sg_table_;}
      29         169 :     IFMapAgentTable *cfg_acl_table() const {return cfg_acl_table_;}
      30         223 :     IFMapAgentTable *cfg_vrf_table() const {return cfg_vrf_table_;}
      31         259 :     IFMapAgentTable *cfg_instanceip_table() const {
      32         259 :         return cfg_instanceip_table_;
      33             :     }
      34         259 :     IFMapAgentTable *cfg_floatingip_table() const {
      35         259 :         return cfg_floatingip_table_;
      36             :     }
      37         259 :     IFMapAgentTable *cfg_aliasip_table() const {
      38         259 :         return cfg_aliasip_table_;
      39             :     }
      40           0 :     IFMapAgentTable *cfg_floatingip_pool_table() const {
      41           0 :         return cfg_floatingip_pool_table_;
      42             :     }
      43           0 :     IFMapAgentTable *cfg_aliasip_pool_table() const {
      44           0 :         return cfg_aliasip_pool_table_;
      45             :     }
      46             :     IFMapAgentTable *cfg_network_ipam_table() const {
      47             :         return cfg_network_ipam_table_;
      48             :     }
      49         178 :     IFMapAgentTable *cfg_vn_network_ipam_table() const {
      50         178 :         return cfg_vn_network_ipam_table_;
      51             :     }
      52         259 :     IFMapAgentTable *cfg_vm_port_vrf_table() const {
      53         259 :         return cfg_vm_port_vrf_table_;
      54             :     }
      55         259 :     IFMapAgentTable *cfg_route_table() const {
      56         259 :         return cfg_route_table_;
      57             :     }
      58             : 
      59           7 :     IFMapAgentTable *cfg_service_template_table() const {
      60           7 :         return cfg_service_template_table_;
      61             :     }
      62             : 
      63         259 :     IFMapAgentTable *cfg_subnet_table() const {
      64         259 :         return cfg_subnet_table_;
      65             :     }
      66             : 
      67         264 :     IFMapAgentTable *cfg_logical_port_table() const {
      68         264 :         return cfg_logical_port_table_;
      69             :     }
      70             : 
      71           7 :     IFMapAgentTable *cfg_service_instance_table() const {
      72           7 :         return cfg_service_instance_table_;
      73             :     }
      74             : 
      75           7 :     IFMapAgentTable *cfg_security_group_table() const {
      76           7 :         return cfg_security_group_table_;
      77             :     }
      78             : 
      79           3 :     IFMapAgentTable *cfg_physical_device_table() const {
      80           3 :         return cfg_physical_device_table_;
      81             :     }
      82             : 
      83         386 :     IFMapAgentTable *cfg_qos_table() const {
      84         386 :         return cfg_qos_table_;
      85             :     }
      86             : 
      87           0 :     IFMapAgentTable *cfg_global_qos_table() const {
      88           0 :         return cfg_global_qos_table_;
      89             :     }
      90             : 
      91           2 :     IFMapAgentTable *cfg_qos_queue_table() const {
      92           2 :         return cfg_qos_queue_table_;
      93             :     }
      94             : 
      95           2 :     IFMapAgentTable *cfg_forwarding_class_table() const {
      96           2 :         return cfg_forwarding_class_table_;
      97             :     }
      98             : 
      99           2 :     IFMapAgentTable *cfg_bridge_domain_table() const {
     100           2 :         return cfg_bridge_domain_table_;
     101             :     }
     102             : 
     103         259 :     IFMapAgentTable *cfg_vm_port_bridge_domain_table() const {
     104         259 :         return cfg_vm_port_bridge_domain_table_;
     105             :     }
     106             : 
     107         127 :     IFMapAgentTable *cfg_health_check_table() const {
     108         127 :         return cfg_health_check_table_;
     109             :     }
     110             : 
     111           2 :     IFMapAgentTable *cfg_policy_set_table() const {
     112           2 :         return cfg_policy_set_table_;
     113             :     }
     114             : 
     115           2 :     IFMapAgentTable *cfg_firewall_policy_table() const {
     116           2 :         return cfg_firewall_policy_table_;
     117             :     }
     118             : 
     119           2 :     IFMapAgentTable *cfg_firewall_rule_table() const {
     120           2 :         return cfg_firewall_rule_table_;
     121             :     }
     122             : 
     123           0 :     IFMapAgentTable *cfg_service_group_table() const {
     124           0 :         return cfg_service_group_table_;
     125             :     }
     126             : 
     127           0 :     IFMapAgentTable *cfg_address_group_table() const {
     128           0 :         return cfg_address_group_table_;
     129             :     }
     130             : 
     131           0 :     IFMapAgentTable *cfg_firewall_policy_firewall_rule_table() const {
     132           0 :         return cfg_firewall_policy_firewall_rule_table_;
     133             :     }
     134             : 
     135         655 :     IFMapAgentTable *cfg_tag_table() const {
     136         655 :         return cfg_tag_table_;
     137             :     }
     138             : 
     139           0 :     IFMapAgentTable *cfg_policy_set_firewall_policy_table() const {
     140           0 :         return cfg_policy_set_firewall_policy_table_;
     141             :     }
     142             : 
     143           0 :     IFMapAgentTable *cfg_policy_management_table() const {
     144           0 :         return cfg_policy_management_table_;
     145             :     }
     146             : 
     147         259 :     IFMapAgentTable *cfg_project_table() const {
     148         259 :         return cfg_project_table_;
     149             :     }
     150             : 
     151         386 :     IFMapAgentTable *cfg_slo_table() const {
     152         386 :         return cfg_slo_table_;
     153             :     }
     154             : 
     155         261 :     IFMapAgentTable *cfg_port_tuple_table() const {
     156         261 :         return cfg_port_tuple_table_;
     157             :     }
     158             : 
     159         127 :     IFMapAgentTable *cfg_multicast_policy_table() const {
     160         127 :         return cfg_multicast_policy_table_;
     161             :     }
     162             : 
     163           0 :     Agent *agent() const { return agent_; }
     164             :     CfgFilter *cfg_filter() const { return cfg_filter_.get(); }
     165           0 :     IFMapAgentParser *cfg_parser() const { return cfg_parser_.get(); }
     166           2 :     DBGraph *cfg_graph() const { return cfg_graph_.get(); }
     167             :     MirrorCfgTable *cfg_mirror_table() const { return cfg_mirror_table_.get(); }
     168             : 
     169             :     IntfMirrorCfgTable *cfg_intf_mirror_table() const {
     170             :         return cfg_intf_mirror_table_.get();
     171             :     }
     172             : 
     173             :     void CreateDBTables(DB *db);
     174             :     void RegisterDBClients(DB *db);
     175             :     void Register(const char *node_name, AgentDBTable *table,
     176             :                   int need_property_id);
     177             :     void Init();
     178             :     void InitDone();
     179             :     void Shutdown();
     180             : private:
     181             :     Agent *agent_;
     182             :     std::unique_ptr<CfgFilter> cfg_filter_;
     183             :     std::unique_ptr<IFMapAgentParser> cfg_parser_;
     184             :     std::unique_ptr<DBGraph> cfg_graph_;
     185             :     std::unique_ptr<MirrorCfgTable> cfg_mirror_table_;
     186             :     std::unique_ptr<IntfMirrorCfgTable> cfg_intf_mirror_table_;
     187             : 
     188             :     DBTableBase::ListenerId lid_;
     189             : 
     190             :     IFMapAgentTable *cfg_vm_interface_table_;
     191             :     IFMapAgentTable *cfg_vm_table_;
     192             :     IFMapAgentTable *cfg_vn_table_;
     193             :     IFMapAgentTable *cfg_sg_table_;
     194             :     IFMapAgentTable *cfg_acl_table_;
     195             :     IFMapAgentTable *cfg_vrf_table_;
     196             :     IFMapAgentTable *cfg_instanceip_table_;
     197             :     IFMapAgentTable *cfg_floatingip_table_;
     198             :     IFMapAgentTable *cfg_aliasip_table_;
     199             :     IFMapAgentTable *cfg_floatingip_pool_table_;
     200             :     IFMapAgentTable *cfg_aliasip_pool_table_;
     201             :     IFMapAgentTable *cfg_network_ipam_table_;
     202             :     IFMapAgentTable *cfg_vn_network_ipam_table_;
     203             :     IFMapAgentTable *cfg_vm_port_vrf_table_;
     204             :     IFMapAgentTable *cfg_route_table_;
     205             :     IFMapAgentTable *cfg_service_template_table_;
     206             :     IFMapAgentTable *cfg_subnet_table_;
     207             :     IFMapAgentTable *cfg_logical_port_table_;
     208             :     IFMapAgentTable *cfg_loadbalancer_table_;
     209             :     IFMapAgentTable *cfg_loadbalancer_pool_table_;
     210             :     IFMapAgentTable *cfg_service_instance_table_;
     211             :     IFMapAgentTable *cfg_security_group_table_;
     212             :     IFMapAgentTable *cfg_physical_device_table_;
     213             :     IFMapAgentTable *cfg_health_check_table_;
     214             :     IFMapAgentTable *cfg_qos_table_;
     215             :     IFMapAgentTable *cfg_global_qos_table_;
     216             :     IFMapAgentTable *cfg_qos_queue_table_;
     217             :     IFMapAgentTable *cfg_forwarding_class_table_;
     218             :     IFMapAgentTable *cfg_bridge_domain_table_;
     219             :     IFMapAgentTable *cfg_vm_port_bridge_domain_table_;
     220             :     IFMapAgentTable *cfg_policy_set_table_;
     221             :     IFMapAgentTable *cfg_firewall_policy_table_;
     222             :     IFMapAgentTable *cfg_firewall_rule_table_;
     223             :     IFMapAgentTable *cfg_service_group_table_;
     224             :     IFMapAgentTable *cfg_address_group_table_;
     225             :     IFMapAgentTable *cfg_firewall_policy_firewall_rule_table_;
     226             :     IFMapAgentTable *cfg_tag_table_;
     227             :     IFMapAgentTable *cfg_policy_set_firewall_policy_table_;
     228             :     IFMapAgentTable *cfg_policy_management_table_;
     229             :     IFMapAgentTable *cfg_project_table_;
     230             :     IFMapAgentTable *cfg_slo_table_;
     231             :     IFMapAgentTable *cfg_port_tuple_table_;
     232             :     IFMapAgentTable *cfg_multicast_policy_table_;
     233             :     DISALLOW_COPY_AND_ASSIGN(AgentConfig);
     234             : };
     235             : 
     236             : extern SandeshTraceBufferPtr CfgTraceBuf;
     237             : #define CONFIG_TRACE(obj, ...) \
     238             : do {\
     239             :     Config##obj::TraceMsg(CfgTraceBuf, __FILE__, __LINE__, ##__VA_ARGS__);\
     240             : } while (false)
     241             : 
     242             : #endif // vnsw_agent_init_cfg_hpp

Generated by: LCOV version 1.14