OpenSDN source code
linux_vxlan_agent_init.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
3  * Copyright Contributors to the OpenSDN project
4  */
5 #include <cmn/agent_cmn.h>
6 
7 #include <ksync/ksync_index.h>
8 #include <ksync/ksync_entry.h>
9 #include <ksync/ksync_object.h>
10 
11 #include <vnc_cfg_types.h>
12 #include <bgp_schema_types.h>
13 #include <agent_types.h>
14 
15 #include <init/agent_param.h>
16 #include <cmn/agent_db.h>
17 
18 #include <oper/operdb_init.h>
19 #include <oper/peer.h>
20 #include <oper/vrf.h>
21 #include <oper/interface_common.h>
22 #include <oper/nexthop.h>
23 #include <oper/multicast.h>
24 #include <oper/vn.h>
25 #include <oper/mirror_table.h>
26 #include <oper/vxlan.h>
27 #include <oper/mpls.h>
28 #include <oper/route_common.h>
29 #include <oper/bridge_route.h>
30 
31 #include <cfg/cfg_init.h>
33 #include <uve/agent_uve.h>
34 
39 
40 #include "linux_vxlan.h"
41 #include "linux_bridge.h"
42 #include "linux_port.h"
43 #include "linux_fdb.h"
44 
45 #include "linux_vxlan_agent_init.h"
46 
48  : ksync_vxlan_(nullptr) {
49 }
50 
52  ksync_vxlan_.reset(nullptr);
53  uve_.reset(nullptr);
54 }
55 
57  (const std::string &config_file, const std::string &program_name) {
59 }
60 
62  return AgentInit::Start(logging);
63 }
64 
65 /****************************************************************************
66  * Initialization routines
67 ****************************************************************************/
69 }
70 
72  ksync_vxlan_.reset(new KSyncLinuxVxlan(agent()));
76  agent()->set_uve(uve_.get());
77 }
78 
80  ksync_vxlan_->RegisterDBClients(agent()->db());
81  uve_->RegisterDBClients();
82 }
83 
85  ksync_vxlan_->Init();
86  uve_->Init();
87 }
88 
90  agent()->controller()->Connect();
91 }
92 
93 /****************************************************************************
94  * Shutdown routines
95  ****************************************************************************/
97  ksync_vxlan_->Shutdown();
98 }
99 
101  uve_->Shutdown();
102 }
103 
105  sleep(5);
106 }
virtual void ProcessOptions(const std::string &config_file, const std::string &program_name)
Definition: agent_init.cc:53
virtual int Start(Logging &logging)
Definition: agent_init.cc:94
Agent * agent() const
Definition: agent_init.h:29
static const uint64_t kBandwidthInterval
static const uint32_t kDefaultInterval
static const uint32_t kIncrementalInterval
VNController * controller() const
Definition: agent.cc:985
void set_uve(AgentUveBase *uve)
Definition: agent.cc:917
int Start(Logging &logging)
void ProcessOptions(const std::string &config_file, const std::string &program_name)
std::unique_ptr< AgentUveBase > uve_
std::unique_ptr< KSyncVxlan > ksync_vxlan_
A class providing basic control over logging capabilities in OpenSDN control plane.
Definition: logging.h:44
string program_name(string filename)