OpenSDN source code
ifmap_client.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 
6 #include "ifmap/ifmap_client.h"
7 
8 #include "base/bitset.h"
9 #include "base/time_util.h"
10 #include "ifmap/ifmap_exporter.h"
11 #include "ifmap/ifmap_update.h"
12 
14  : index_(kIndexInvalid), exporter_(NULL), msgs_sent_(0), msgs_blocked_(0),
15  bytes_sent_(0), update_nodes_sent_(0), delete_nodes_sent_(0),
16  update_links_sent_(0), delete_links_sent_(0), send_is_blocked_(false),
17  created_at_(UTCTimestampUsec()) {
18 }
19 
21 }
22 
23 void IFMapClient::Initialize(IFMapExporter *exporter, int index) {
24  index_ = index;
25  exporter_ = exporter;
26 }
27 
28 std::vector<std::string> IFMapClient::vm_list() const {
29  std::vector<std::string> vm_list;
30 
31  vm_list.reserve(vm_map_.size());
32  for (VmMap::const_iterator iter = vm_map_.begin(); iter != vm_map_.end();
33  ++iter) {
34  vm_list.push_back(iter->first);
35  }
36  return vm_list;
37 }
38 
IFMapExporter * exporter_
Definition: ifmap_client.h:80
virtual ~IFMapClient()
Definition: ifmap_client.cc:20
VmMap vm_map_
Definition: ifmap_client.h:89
std::vector< std::string > vm_list() const
Definition: ifmap_client.cc:28
int index() const
Definition: ifmap_client.h:32
void Initialize(IFMapExporter *exporter, int index)
Definition: ifmap_client.cc:23
static uint64_t UTCTimestampUsec()
Definition: time_util.h:14