OpenSDN source code
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
agent_init.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014 Juniper Networks, Inc. All rights reserved.
3  */
4 
5 #include <cmn/agent_cmn.h>
6 
7 #include <cmn/agent_factory.h>
8 #include <cmn/agent_stats.h>
9 #include <cmn/event_notifier.h>
10 #include <init/agent_param.h>
11 
12 #include <cfg/cfg_init.h>
13 #include <vgw/cfg_vgw.h>
14 
15 #include <oper/operdb_init.h>
16 #include <oper/sg.h>
17 #include <oper/vrf.h>
18 #include <oper/nexthop.h>
19 #include <oper/vn.h>
20 #include <oper/vm.h>
21 #include <oper/interface.h>
22 #include <oper/route_common.h>
23 #include <oper/agent_profile.h>
24 #include <oper/crypt_tunnel.h>
25 #include <filter/acl.h>
26 #include <oper/multicast_policy.h>
29 
30 #include "agent_init.h"
31 
33  agent_(new Agent()), agent_param_(NULL), trigger_(),
34  enable_controller_(true) {
35 }
36 
38  stats_.reset();
39  trigger_.reset();
40  controller_.reset();
41  cfg_.reset();
42  oper_.reset();
43  resource_manager_.reset();
44  agent_->db()->ClearFactoryRegistry();
45  agent_.reset();
46 }
47 
48 /****************************************************************************
49  * Initialization routines
50 ****************************************************************************/
52  (const std::string &config_file, const std::string &program_name) {
53  agent_param_->Init(config_file, program_name);
54 }
55 
57  return Module::VROUTER_AGENT;
58 }
59 
61  Module::type module = static_cast<Module::type>(ModuleType());
62  return g_vns_constants.ModuleNames.find(module)->second;
63 }
64 
66  return agent_param_->agent_name();
67 }
68 
70  return g_vns_constants.INSTANCE_ID_DEFAULT;
71 }
72 
74  boost::system::error_code ec;
75  Ip4Address ip = Ip4Address::from_string("127.0.0.1", ec);
76  if (ec.value() != 0) {
77  assert(0);
78  }
79 
81  agent_->set_vrouter_server_ip(ip);
82  agent_->set_vrouter_server_port(VROUTER_SERVER_PORT);
83  agent_->set_pkt_interface_name("pkt0");
85  agent_->set_vrouter_server_ip(ip);
86  agent_->set_vrouter_server_port(VROUTER_SERVER_PORT);
87  agent_->set_pkt_interface_name("unix");
88  }
89 }
90 
91 // Start of Agent init.
92 // Trigger init in DBTable task context
94  agent_->set_task_scheduler(TaskScheduler::GetInstance());
95  agent_->set_agent_init(this);
96 
97  // Init platform specific information
98  InitPlatform();
99 
100  // Copy tunable parameters into agent_
101  agent_->CopyConfig(agent_param_);
102 
103  string module_name = ModuleName();
104  agent_->set_agent_name(AgentName());
105  agent_->set_instance_id(InstanceId());
106  agent_->set_module_type(ModuleType());
107  agent_->set_module_name(module_name);
108  std::vector<std::string> v_slo_destinations = agent_param_->
109  get_slo_destination();
110  std::string log_property_file = agent_param_->log_property_file();
111  if (log_property_file.size()) {
112  LoggingInit(log_property_file);
113  }
114  else {
116  agent_param_->log_files_count(), false,
117  agent_param_->syslog_facility(), module_name,
120  }
122 
123  // Set the sample logger params
129  module_name, true);
130  // Set the SLO logger params
136  module_name, false);
137 
140 
141  int ret = agent_param_->Validate();
142  if (ret != 0) {
143  return ret;
144  }
145 
147 
148  int task_id = agent_->task_scheduler()->GetTaskId(AGENT_INIT_TASKNAME);
149  trigger_.reset(new TaskTrigger(boost::bind(&AgentInit::InitBase, this),
150  task_id, 0));
151  trigger_->Set();
152  return 0;
153 }
154 
155 // Start init sequence
157  FactoryInit();
158  InitLoggingBase();
159  CreatePeersBase();
162  return true;
163 }
164 
166  agent_->SetResourceManagerReady();
169  InitModulesBase();
171  CreateVrfBase();
174  InitDoneBase();
175 
176  Init();
177  agent_->set_init_done(true);
179 }
180 
185  false,
187  InitLogging();
188 }
189 
190 // Connect to collector specified in config
192  agent_->InitCollector();
193  InitCollector();
194 }
195 
196 // Create peers
198  agent_->InitPeers();
199  CreatePeers();
200 }
201 
202 // Create the basic modules for agent operation.
203 // Optional modules or modules that have different implementation are created
204 // by init module
206  //Event notify manager
207  event_notifier_.reset(new EventNotifier(agent()));
209 
210  cfg_.reset(new AgentConfig(agent()));
211  agent_->set_cfg(cfg_.get());
212 
213  oper_.reset(new OperDB(agent()));
214  agent_->set_oper_db(oper_.get());
215 
216  if (enable_controller_) {
217  controller_.reset(new VNController(agent()));
218  agent_->set_controller(controller_.get());
219  }
220 
221  stats_.reset(new AgentStats(agent()));
222  agent()->set_stats(stats_.get());
223 
224  CreateModules();
225 }
226 
229  resource_manager_->Init();
230 }
231 
233  if (cfg_.get()) {
234  cfg_->CreateDBTables(agent_->db());
235  }
236 
237  if (oper_.get()) {
238  oper_->CreateDBTables(agent_->db());
239  }
240 
241  CreateDBTables();
242 }
243 
245  if (cfg_.get()) {
246  cfg_->RegisterDBClients(agent_->db());
247  }
248 
249  if (oper_.get()) {
250  oper_->RegisterDBClients();
251  }
252 
254 }
255 
257  if (cfg_.get()) {
258  cfg_->Init();
259  }
260 
261  if (oper_.get()) {
262  oper_->Init();
263  }
264 
265  InitModules();
266 }
267 
268 static void CreateVrfIndependentNextHop(Agent *agent) {
269 
271  DiscardNHKey key1;
272  NextHop *nh = static_cast<NextHop *>
273  (agent->nexthop_table()->FindActiveEntry(&key1));
274  agent->nexthop_table()->set_discard_nh(nh);
275 
276  //Reserve index 2, this would be used to
277  //set as RPF NH when packet has to be discarded
278  //due to source route mismatch
279  assert(agent->nexthop_table()->ReserveIndex() ==
282  L2ReceiveNHKey key2;
283  nh = static_cast<NextHop *>
284  (agent->nexthop_table()->FindActiveEntry(&key2));
285  agent->nexthop_table()->set_l2_receive_nh(nh);
286 }
287 
289  // Bridge Receive routes are added on VRF creation. Ensure that Bridge
290  // Receive-NH which is independent of VRF is created first
292 
293  // Create the default VRF
294  VrfTable *vrf_table = agent_->vrf_table();
295 
296  vrf_table->CreateStaticVrf(agent_->fabric_vrf_name());
297  vrf_table->CreateFabricPolicyVrf(agent_->fabric_policy_vrf_name());
298  VrfEntry *vrf = vrf_table->FindVrfFromName(agent_->fabric_vrf_name());
299  assert(vrf);
300  VrfEntry *policy_vrf = vrf_table->FindVrfFromName(agent_->
301  fabric_policy_vrf_name());
302  assert(policy_vrf);
303 
304  agent_->set_fabric_vrf(vrf);
305  agent_->set_fabric_policy_vrf(policy_vrf);
306  agent_->set_fabric_inet4_unicast_table(vrf->GetInet4UnicastRouteTable());
307  agent_->set_fabric_inet4_mpls_table(vrf->GetInet4MplsUnicastRouteTable());
308  agent_->set_fabric_inet4_multicast_table
310  agent_->set_fabric_l2_unicast_table(vrf->GetBridgeRouteTable());
311  agent_->set_fabric_evpn_table(vrf->GetEvpnRouteTable());
312 
313  CreateVrf();
314 }
315 
317  CreateNextHops();
318 }
319 
322 }
323 
325  if (agent_->router_id_configured() == false) {
326  LOG(DEBUG,
327  "Router ID not configured. Connection to controller postponed");
328  } else {
329  LOG(DEBUG, "Router ID configured. Connection to controller initiated");
330  // Connect to controller and DNS servers
331  agent_->controller()->Connect();
332  }
333 
335  if (agent_->controller()) {
336  agent_->controller()->EnableWorkQueue();
337  }
338 }
339 
341  TaskScheduler *scheduler = agent_->task_scheduler();
342  // Enable task latency measurements once init is done
346  if (cfg_.get()) {
347  cfg_->InitDone();
348  }
349  // Enable task latency measurements once init is done
350  scheduler->EnableLatencyThresholds
351  (agent_param_->tbb_exec_delay() * 1000,
352  agent_param_->tbb_schedule_delay() * 1000);
353 
354  // Flow related tasks are known have greater latency. Add exception
355  // for them
356  uint32_t execute_delay = (20 * 1000);
357  uint32_t schedule_delay = (20 * 1000);
358  scheduler->SetLatencyThreshold(kTaskFlowEvent, execute_delay,
359  schedule_delay);
360  scheduler->SetLatencyThreshold(kTaskFlowKSync, execute_delay,
361  schedule_delay);
362  scheduler->SetLatencyThreshold(kTaskFlowUpdate, execute_delay,
363  schedule_delay);
364  scheduler->SetLatencyThreshold(kTaskFlowStatsCollector, (execute_delay * 2),
365  (schedule_delay * 2));
366  scheduler->SetLatencyThreshold(kTaskSessionStatsCollector, (execute_delay * 2),
367  (schedule_delay * 2));
368  scheduler->SetLatencyThreshold(kTaskSessionStatsCollectorEvent, (execute_delay * 2),
369  (schedule_delay * 2));
370  agent_->InitDone();
371  InitDone();
372 }
373 
374 /****************************************************************************
375  * Shutdown routines
376  ***************************************************************************/
377 typedef boost::function<bool(void)> TaskFnPtr;
378 static void RunInTaskContext(AgentInit *init, uint32_t task_id, TaskFnPtr fn) {
379  TaskTrigger trigger(fn, task_id, 0);
380  trigger.Set();
381  init->WaitForIdle();
382  return;
383 }
384 
385 // Shutdown IO channel to controller+DNS
387  agent_->controller()->Cleanup();
388  agent_->controller()->DisConnect();
389  IoShutdown();
390 }
391 
393  init->IoShutdownBase();
394  return true;
395 }
396 
398  FlushFlows();
399  return;
400 }
401 
403  init->FlushFlowsBase();
404  return true;
405 }
406 
408  VgwShutdown();
409  return;
410 }
411 
413  init->VgwShutdownBase();
414  return true;
415 }
416 
418  DeleteRoutes();
419  if (agent_->oper_db())
420  agent_->oper_db()->DeleteRoutes();
421 }
422 
424  init->DeleteRoutesBase();
425  return true;
426 }
427 
428 static bool FlushTable(AgentDBTable *table) {
429  table->Flush();
430  return true;
431 }
432 
436  boost::uuids::nil_uuid(),
437  agent_->vhost_interface_name()));
438  VmInterfaceConfigData *data = new VmInterfaceConfigData(agent_.get(), NULL);
439  req.data.reset(data);
440  agent_->interface_table()->Enqueue(&req);
441 }
442 
444  int task_id = agent_->task_scheduler()->GetTaskId(AGENT_SHUTDOWN_TASKNAME);
445 
446  RunInTaskContext(this, task_id, boost::bind(&DeleteRoutesInternal, this));
447  agent_->vrf_table()->DeleteStaticVrf(agent_->fabric_policy_vrf_name());
448 
449  agent_->vrf_table()->DeleteStaticVrf(agent_->fabric_policy_vrf_name());
450 
451  DeleteVhost();
452 
453  RunInTaskContext(this, task_id,
454  boost::bind(&FlushTable, agent_->interface_table()));
455  agent_->set_vhost_interface(NULL);
456 
457  RunInTaskContext(this, task_id,
458  boost::bind(&FlushTable, agent_->vm_table()));
459 
460  RunInTaskContext(this, task_id,
461  boost::bind(&FlushTable, agent_->vn_table()));
462 
463 
464  agent_->vrf_table()->DeleteStaticVrf(agent_->fabric_vrf_name());
465  RunInTaskContext(this, task_id,
466  boost::bind(&FlushTable, agent_->vrf_table()));
467 
468  RunInTaskContext(this, task_id,
469  boost::bind(&FlushTable, agent_->nexthop_table()));
470  agent_->nexthop_table()->set_discard_nh(NULL);
471 
472 
473  RunInTaskContext(this, task_id,
474  boost::bind(&FlushTable, agent_->sg_table()));
475 
476  RunInTaskContext(this, task_id,
477  boost::bind(&FlushTable, agent_->acl_table()));
478 
479  RunInTaskContext(this, task_id,
480  boost::bind(&FlushTable, agent_->mp_table()));
481 }
482 
484  uint32_t count, int msec) {
485  while ((table->Size() > count) && (msec > 0)) {
486  init->WaitForIdle();
487  usleep(1000);
488  msec -= 1;
489  }
490 
491  return (table->Size() == count);
492 }
493 
495  WaitForDbCount(agent_->interface_table(), this, 0, 10000);
496  WaitForDbCount(agent_->vrf_table(), this, 0, 10000);
497  WaitForDbCount(agent_->nexthop_table(), this, 0, 10000);
498  WaitForDbCount(agent_->vm_table(), this, 0, 10000);
499  WaitForDbCount(agent_->vn_table(), this, 0, 10000);
500  WaitForDbCount(agent_->mpls_table(), this, 2, 10000);
501  WaitForDbCount(agent_->acl_table(), this, 0, 10000);
502  WaitForDbCount(agent_->mp_table(), this, 0, 10000);
503 }
504 
507  return;
508 }
509 
511  init->ServicesShutdownBase();
512  return true;
513 }
514 
516  PktShutdown();
517  return;
518 }
519 
521  init->PktShutdownBase();
522  return true;
523 }
524 
526  if (agent_->oper_db() && agent_->oper_db()->agent_profile()) {
527  agent_->oper_db()->agent_profile()->Shutdown();
528  }
529 }
530 
532  init->ProfileShutdownBase();
533  return true;
534 }
535 
537  ModulesShutdown();
538  if (agent_->oper_db()) {
539  agent_->oper_db()->Shutdown();
540  }
541 
542  if (agent_->cfg()) {
543  agent_->cfg()->Shutdown();
544  }
545  return;
546 }
547 
549  init->ModulesShutdownBase();
550  return true;
551 }
552 
554  UveShutdown();
555  return;
556 }
557 
560  return;
561 }
562 
565  return;
566 }
567 
569  init->UveShutdownBase();
570  return true;
571 }
572 
575  return true;
576 }
577 
580  return true;
581 }
582 
584  KSyncShutdown();
585  return;
586 }
587 
589  init->KSyncShutdownBase();
590  return true;
591 }
592 
594  int task_id = agent_->task_scheduler()->GetTaskId(AGENT_SHUTDOWN_TASKNAME);
595 
597  RunInTaskContext(this, task_id, boost::bind(&IoShutdownInternal, this));
598  RunInTaskContext(this, task_id, boost::bind(&ProfileShutdownInternal, this));
599  RunInTaskContext(this, task_id, boost::bind(&FlushFlowsInternal, this));
600  RunInTaskContext(this, task_id, boost::bind(&VgwShutdownInternal, this));
601  WaitForDBEmpty();
602  RunInTaskContext(this, task_id, boost::bind(&ServicesShutdownInternal,
603  this));
604  RunInTaskContext(this, task_id, boost::bind
606  RunInTaskContext(this, task_id, boost::bind(&StatsCollectorShutdownInternal,
607  this));
608  RunInTaskContext(this, task_id, boost::bind(&UveShutdownInternal, this));
609  RunInTaskContext(this, task_id, boost::bind(&PktShutdownInternal, this));
610  RunInTaskContext(this, task_id, boost::bind(&ModulesShutdownInternal,
611  this));
612  RunInTaskContext(this, task_id, boost::bind(&KSyncShutdownInternal, this));
613 
614  Sandesh::Uninit();
615  WaitForIdle();
616 
617  agent_->event_manager()->Shutdown();
618  WaitForIdle();
619 }
virtual void ProcessOptions(const std::string &config_file, const std::string &program_name)
Definition: agent_init.cc:52
static void Create()
Definition: nexthop.cc:1626
virtual std::string InstanceId()
Definition: agent_init.cc:69
log4cplus::LogLevel SandeshLevelTolog4Level(SandeshLevel::type slevel)
Definition: sandesh.cc:395
virtual void CreateInterfaces()
Definition: agent_init.h:94
static void RunInTaskContext(AgentInit *init, uint32_t task_id, TaskFnPtr fn)
Definition: agent_init.cc:378
const int log_files_count() const
Definition: agent_param.h:291
virtual void CreateNextHops()
Definition: agent_init.h:90
void init()
Definition: bgp_log.cc:37
static bool ProfileShutdownInternal(AgentInit *init)
Definition: agent_init.cc:531
virtual void KSyncShutdownBase()
Definition: agent_init.cc:583
std::unique_ptr< EventNotifier > event_notifier_
Definition: agent_init.h:181
The TaskScheduler keeps track of what tasks are currently schedulable. When a task is enqueued it is ...
Definition: task.h:178
Definition: vrf.h:86
AgentRouteTable * GetInet4MulticastRouteTable() const
Definition: vrf.cc:326
static SandeshLevel::type StringToLevel(std::string level)
Definition: sandesh.cc:861
AgentRouteTable * GetEvpnRouteTable() const
Definition: vrf.cc:330
Definition: vrf.h:268
virtual void InitLoggingBase()
Definition: agent_init.cc:181
#define kTaskFlowEvent
Definition: agent.h:321
virtual void DeleteDBEntriesBase()
Definition: agent_init.cc:443
void IoShutdownBase()
Definition: agent_init.cc:386
const std::vector< std::string > & get_sample_destination()
Definition: agent_param.h:295
std::unique_ptr< AgentConfig > cfg_
Definition: agent_init.h:175
NextHopTable * nexthop_table() const
Definition: agent.h:475
virtual void InitLogging()
Definition: agent_init.h:57
Platform platform() const
Definition: agent_param.h:343
#define kTaskSessionStatsCollectorEvent
Definition: agent.h:330
virtual void CreatePeers()
Definition: agent_init.h:82
string program_name(string filename)
static void SetLoggingParams(bool enable_local_log, std::string category, std::string level, bool enable_trace_print=false, bool enable_flow_log=false, bool enable_session_syslog=false)
Definition: sandesh.cc:369
static bool IoShutdownInternal(AgentInit *init)
Definition: agent_init.cc:392
void Flush()
Definition: agent_db.cc:238
void LogConfig() const
std::unique_ptr< DBRequestData > data
Definition: db_table.h:49
static bool StatsCollectorShutdownInternal(AgentInit *init)
Definition: agent_init.cc:573
virtual void VgwShutdownBase()
Definition: agent_init.cc:407
virtual void CreateModules()
Definition: agent_init.h:65
InetUnicastAgentRouteTable * GetInet4UnicastRouteTable() const
Definition: vrf.cc:319
virtual size_t Size() const
Definition: db_table.h:100
AgentDBEntry * FindActiveEntry(const DBEntry *key)
Definition: agent_db.cc:110
virtual void VgwShutdown()
Definition: agent_init.h:121
InetUnicastAgentRouteTable * GetInet4MplsUnicastRouteTable() const
Definition: vrf.cc:323
void CreateResourceManager()
Definition: agent_init.cc:227
std::unique_ptr< VNController > controller_
Definition: agent_init.h:179
std::unique_ptr< ResourceManager > resource_manager_
Definition: agent_init.h:180
std::unique_ptr< Agent > agent_
Definition: agent_init.h:168
#define kTaskFlowUpdate
Definition: agent.h:323
void InitPlatform()
Definition: agent_init.cc:73
static bool VgwShutdownInternal(AgentInit *init)
Definition: agent_init.cc:412
std::unique_ptr< OperDB > oper_
Definition: agent_init.h:176
static bool FlushFlowsInternal(AgentInit *init)
Definition: agent_init.cc:402
virtual void DeleteRoutes()
Definition: agent_init.h:125
std::unique_ptr< TaskTrigger > trigger_
Definition: agent_init.h:172
static bool UveShutdownInternal(AgentInit *init)
Definition: agent_init.cc:568
static bool WaitForDbCount(DBTableBase *table, AgentInit *init, uint32_t count, int msec)
Definition: agent_init.cc:483
boost::function< bool(void)> TaskFnPtr
Definition: agent_init.cc:377
#define kTaskSessionStatsCollector
Definition: agent.h:329
virtual void FlushFlows()
Definition: agent_init.h:117
virtual void StatsCollectorShutdown()
Definition: agent_init.h:152
static void Create()
Definition: nexthop.cc:1608
virtual void RegisterDBClientsBase()
Definition: agent_init.cc:244
virtual bool Init()
Definition: agent_init.h:54
void set_discard_nh(NextHop *nh)
Definition: nexthop.h:1970
virtual void WaitForIdle()=0
static bool DeleteRoutesInternal(AgentInit *init)
Definition: agent_init.cc:423
void EnableLatencyThresholds(uint32_t execute, uint32_t schedule)
Enable logging of tasks exceeding configured latency.
Definition: task.cc:595
bool log_flow() const
Definition: agent_param.h:294
virtual void RegisterDBClients()
Definition: agent_init.h:73
#define AGENT_SHUTDOWN_TASKNAME
Definition: agent.h:299
virtual void FlowStatsCollectorShutdownBase()
Definition: agent_init.cc:563
#define VROUTER_SERVER_PORT
Definition: agent.h:306
virtual void InitDoneBase()
Definition: agent_init.cc:340
virtual void CreatePeersBase()
Definition: agent_init.cc:197
static const uint32_t kRpfDiscardIndex
Definition: nexthop.h:1947
virtual void DeleteRoutesBase()
Definition: agent_init.cc:417
uint8_t type
Definition: load_balance.h:109
Definition: agent.h:358
std::unique_ptr< AgentStats > stats_
Definition: agent_init.h:174
static TaskScheduler * GetInstance()
Definition: task.cc:547
virtual void IoShutdown()
Definition: agent_init.h:113
void set_l2_receive_nh(NextHop *nh)
Definition: nexthop.h:1973
#define kTaskFlowKSync
Definition: agent.h:322
std::unique_ptr< DBRequestKey > key
Definition: db_table.h:48
virtual void InitDone()
Definition: agent_init.h:102
virtual void CreateVrfBase()
Definition: agent_init.cc:288
static bool PktShutdownInternal(AgentInit *init)
Definition: agent_init.cc:520
virtual int Start()
Definition: agent_init.cc:93
virtual std::string ModuleName()
Definition: agent_init.cc:60
AgentRouteTable * GetBridgeRouteTable() const
Definition: vrf.cc:334
void LoggingInit()
Definition: logging.cc:51
static bool ServicesShutdownInternal(AgentInit *init)
Definition: agent_init.cc:510
virtual void InitCollectorBase()
Definition: agent_init.cc:191
virtual void CreateModulesBase()
Definition: agent_init.cc:205
bool enable_controller_
Definition: agent_init.h:178
virtual void CreateDBTables()
Definition: agent_init.h:69
virtual void UveShutdown()
Definition: agent_init.h:148
boost::asio::ip::address_v4 Ip4Address
Definition: address.h:14
#define kTaskFlowStatsCollector
Definition: agent.h:328
virtual void PktShutdownBase()
Definition: agent_init.cc:515
uint32_t tbb_exec_delay() const
Definition: agent_param.h:454
void set_stats(AgentStats *stats)
Definition: agent.cc:885
const std::string log_file() const
Definition: agent_param.h:290
void set_event_notifier(EventNotifier *mgr)
Definition: agent.cc:897
virtual void FlushFlowsBase()
Definition: agent_init.cc:397
virtual void PktShutdown()
Definition: agent_init.h:137
virtual void FlowStatsCollectorShutdown()
Definition: agent_init.h:156
static bool FlowStatsCollectorShutdownInternal(AgentInit *init)
Definition: agent_init.cc:578
virtual std::string AgentName()
Definition: agent_init.cc:65
uint32_t tbb_schedule_delay() const
Definition: agent_param.h:455
uint32_t ReserveIndex()
Definition: nexthop.cc:289
virtual void ConnectToController()
Definition: agent_init.h:99
virtual void CreateVrf()
Definition: agent_init.h:86
virtual void CreateNextHopsBase()
Definition: agent_init.cc:316
virtual void ServicesShutdown()
Definition: agent_init.h:133
virtual void InitCollector()
Definition: agent_init.h:61
virtual void CreateInterfacesBase()
Definition: agent_init.cc:320
static bool ModulesShutdownInternal(AgentInit *init)
Definition: agent_init.cc:548
virtual void CreateDBTablesBase()
Definition: agent_init.cc:232
virtual void ModulesShutdownBase()
Definition: agent_init.cc:536
#define LOG(_Level, _Msg)
Definition: logging.h:33
virtual void ProfileShutdownBase()
Definition: agent_init.cc:525
virtual void KSyncShutdown()
Definition: agent_init.h:160
virtual int ModuleType()
Definition: agent_init.cc:56
AgentParam * agent_param_
Definition: agent_init.h:169
static void Uninit()
Definition: sandesh.cc:341
const std::vector< std::string > & get_slo_destination()
Definition: agent_param.h:298
virtual void ConnectToControllerBase()
Definition: agent_init.cc:324
static void set_logger_appender(const std::string &file_name, long max_file_size, int max_backup_index, const std::string &syslog_facility, const std::vector< std::string > &destn, const std::string &ident, bool is_sampled_logger)
Definition: sandesh.cc:1003
virtual void FactoryInit()=0
void DeleteVhost()
Definition: agent_init.cc:433
const std::string & log_level() const
Definition: agent_param.h:301
virtual void ModulesShutdown()
Definition: agent_init.h:144
bool log_local() const
Definition: agent_param.h:293
const std::string & log_category() const
Definition: agent_param.h:302
static bool KSyncShutdownInternal(AgentInit *init)
Definition: agent_init.cc:588
void SetLatencyThreshold(const std::string &name, uint32_t execute, uint32_t schedule)
Definition: task.cc:602
Agent * agent() const
Definition: agent_init.h:26
virtual void ServicesShutdownBase()
Definition: agent_init.cc:505
virtual void UveShutdownBase()
Definition: agent_init.cc:553
const std::string syslog_facility() const
Definition: agent_param.h:305
void SetResourceManagerReady()
Definition: agent_init.cc:165
const std::string & log_property_file() const
Definition: agent_param.h:303
const long log_file_size() const
Definition: agent_param.h:292
virtual void InitModulesBase()
Definition: agent_init.cc:256
void PostValidateLogConfig() const
virtual int Validate()
static bool FlushTable(AgentDBTable *table)
Definition: agent_init.cc:428
const std::string & agent_name() const
Definition: agent_param.h:204
virtual void StatsCollectorShutdownBase()
Definition: agent_init.cc:558
virtual ~AgentInit()
Definition: agent_init.cc:37
#define AGENT_INIT_TASKNAME
Definition: agent.h:297
virtual void Shutdown()
Definition: agent_init.cc:593
VirtualGatewayConfigTable * vgw_config_table() const
Definition: agent_param.h:329
static void set_send_to_collector_flags(const std::vector< std::string > &sampled_destination, const std::vector< std::string > &slo_destination)
Definition: sandesh.cc:1056
static void CreateVrfIndependentNextHop(Agent *agent)
Definition: agent_init.cc:268
virtual bool InitBase()
Definition: agent_init.cc:156
void InitDone(Agent *agent)
Definition: cfg_vgw.cc:97
virtual void InitModules()
Definition: agent_init.h:78
void WaitForDBEmpty()
Definition: agent_init.cc:494