OpenSDN source code
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
linux_vxlan_agent_init.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
3  */
4 #include <cmn/agent_cmn.h>
5 
6 #include <ksync/ksync_index.h>
7 #include <ksync/ksync_entry.h>
8 #include <ksync/ksync_object.h>
9 
10 #include <vnc_cfg_types.h>
11 #include <bgp_schema_types.h>
12 #include <agent_types.h>
13 
14 #include <init/agent_param.h>
15 #include <cmn/agent_db.h>
16 
17 #include <oper/operdb_init.h>
18 #include <oper/peer.h>
19 #include <oper/vrf.h>
20 #include <oper/interface_common.h>
21 #include <oper/nexthop.h>
22 #include <oper/multicast.h>
23 #include <oper/vn.h>
24 #include <oper/mirror_table.h>
25 #include <oper/vxlan.h>
26 #include <oper/mpls.h>
27 #include <oper/route_common.h>
28 #include <oper/bridge_route.h>
29 
30 #include <cfg/cfg_init.h>
32 #include <uve/agent_uve.h>
33 
38 
39 #include "linux_vxlan.h"
40 #include "linux_bridge.h"
41 #include "linux_port.h"
42 #include "linux_fdb.h"
43 
44 #include "linux_vxlan_agent_init.h"
45 
47  : ksync_vxlan_(nullptr) {
48 }
49 
51  ksync_vxlan_.reset(nullptr);
52  uve_.reset(nullptr);
53 }
54 
56  (const std::string &config_file, const std::string &program_name) {
57  AgentInit::ProcessOptions(config_file, program_name);
58 }
59 
61  return AgentInit::Start();
62 }
63 
64 /****************************************************************************
65  * Initialization routines
66 ****************************************************************************/
68 }
69 
71  ksync_vxlan_.reset(new KSyncLinuxVxlan(agent()));
75  agent()->set_uve(uve_.get());
76 }
77 
79  ksync_vxlan_->RegisterDBClients(agent()->db());
80  uve_->RegisterDBClients();
81 }
82 
84  ksync_vxlan_->Init();
85  uve_->Init();
86 }
87 
89  agent()->controller()->Connect();
90 }
91 
92 /****************************************************************************
93  * Shutdown routines
94  ****************************************************************************/
96  ksync_vxlan_->Shutdown();
97 }
98 
100  uve_->Shutdown();
101 }
102 
104  sleep(5);
105 }
virtual void ProcessOptions(const std::string &config_file, const std::string &program_name)
Definition: agent_init.cc:52
string program_name(string filename)
void set_uve(AgentUveBase *uve)
Definition: agent.cc:913
void ProcessOptions(const std::string &config_file, const std::string &program_name)
std::unique_ptr< KSyncVxlan > ksync_vxlan_
std::unique_ptr< AgentUveBase > uve_
VNController * controller() const
Definition: agent.cc:981
static const uint32_t kDefaultInterval
static const uint64_t kBandwidthInterval
virtual int Start()
Definition: agent_init.cc:93
static const uint32_t kIncrementalInterval
Agent * agent() const
Definition: agent_init.h:26