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