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