/
cfg_init.h
137 lines (117 loc) · 4.26 KB
/
cfg_init.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
/*
* Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
*/
#ifndef vnsw_agent_init_cfg_hpp
#define vnsw_agent_init_cfg_hpp
#include <cmn/agent_cmn.h>
#include <ifmap/ifmap_agent_table.h>
#include <sandesh/sandesh_trace.h>
using namespace boost::uuids;
class CfgFilter;
class CfgListener;
class InterfaceCfgClient;
class DiscoveryAgentClient;
class MirrorCfgTable;
class IntfMirrorCfgTable;
class AgentConfig {
public:
AgentConfig(Agent *agent);
virtual ~AgentConfig();
IFMapAgentTable *cfg_vm_interface_table() const {
return cfg_vm_interface_table_;
}
IFMapAgentTable *cfg_vm_table() const {return cfg_vm_table_;}
IFMapAgentTable *cfg_vn_table() const {return cfg_vn_table_;}
IFMapAgentTable *cfg_sg_table() const {return cfg_sg_table_;}
IFMapAgentTable *cfg_acl_table() const {return cfg_acl_table_;}
IFMapAgentTable *cfg_vrf_table() const {return cfg_vrf_table_;}
IFMapAgentTable *cfg_instanceip_table() const {
return cfg_instanceip_table_;
}
IFMapAgentTable *cfg_floatingip_table() const {
return cfg_floatingip_table_;
}
IFMapAgentTable *cfg_floatingip_pool_table() const {
return cfg_floatingip_pool_table_;
}
IFMapAgentTable *cfg_network_ipam_table() const {
return cfg_network_ipam_table_;
}
IFMapAgentTable *cfg_vn_network_ipam_table() const {
return cfg_vn_network_ipam_table_;
}
IFMapAgentTable *cfg_vm_port_vrf_table() const {
return cfg_vm_port_vrf_table_;
}
IFMapAgentTable *cfg_route_table() const {
return cfg_route_table_;
}
IFMapAgentTable *cfg_service_template_table() const {
return cfg_service_template_table_;
}
IFMapAgentTable *cfg_loadbalancer_table() const {
return cfg_loadbalancer_table_;
}
IFMapAgentTable *cfg_service_instance_table() const {
return cfg_service_instance_table_;
}
IFMapAgentTable *cfg_security_group_table() const {
return cfg_security_group_table_;
}
Agent *agent() const { return agent_; }
CfgFilter *cfg_filter() const { return cfg_filter_.get(); }
CfgListener *cfg_listener() const { return cfg_listener_.get(); }
IFMapAgentParser *cfg_parser() const { return cfg_parser_.get(); }
DBGraph *cfg_graph() const { return cfg_graph_.get(); }
MirrorCfgTable *cfg_mirror_table() const { return cfg_mirror_table_.get(); }
DiscoveryAgentClient *discovery_client() const {
return discovery_client_.get();
}
InterfaceCfgClient *cfg_interface_client() const {
return cfg_interface_client_.get();
}
IntfMirrorCfgTable *cfg_intf_mirror_table() const {
return cfg_intf_mirror_table_.get();
}
void CreateDBTables(DB *db);
void RegisterDBClients(DB *db);
void InitDiscovery();
void Init();
void InitDone();
void Shutdown();
private:
Agent *agent_;
std::auto_ptr<CfgFilter> cfg_filter_;
std::auto_ptr<CfgListener> cfg_listener_;
std::auto_ptr<IFMapAgentParser> cfg_parser_;
std::auto_ptr<DBGraph> cfg_graph_;
std::auto_ptr<InterfaceCfgClient> cfg_interface_client_;
std::auto_ptr<DiscoveryAgentClient> discovery_client_;
std::auto_ptr<MirrorCfgTable> cfg_mirror_table_;
std::auto_ptr<IntfMirrorCfgTable> cfg_intf_mirror_table_;
DBTableBase::ListenerId lid_;
IFMapAgentTable *cfg_vm_interface_table_;
IFMapAgentTable *cfg_vm_table_;
IFMapAgentTable *cfg_vn_table_;
IFMapAgentTable *cfg_sg_table_;
IFMapAgentTable *cfg_acl_table_;
IFMapAgentTable *cfg_vrf_table_;
IFMapAgentTable *cfg_instanceip_table_;
IFMapAgentTable *cfg_floatingip_table_;
IFMapAgentTable *cfg_floatingip_pool_table_;
IFMapAgentTable *cfg_network_ipam_table_;
IFMapAgentTable *cfg_vn_network_ipam_table_;
IFMapAgentTable *cfg_vm_port_vrf_table_;
IFMapAgentTable *cfg_route_table_;
IFMapAgentTable *cfg_service_template_table_;
IFMapAgentTable *cfg_loadbalancer_table_;
IFMapAgentTable *cfg_service_instance_table_;
IFMapAgentTable *cfg_security_group_table_;
DISALLOW_COPY_AND_ASSIGN(AgentConfig);
};
extern SandeshTraceBufferPtr CfgTraceBuf;
#define CFG_TRACE(obj, ...) \
do {\
Cfg##obj::TraceMsg(CfgTraceBuf, __FILE__, __LINE__, ##__VA_ARGS__);\
} while(0);\
#endif // vnsw_agent_init_cfg_hpp