Line data Source code
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 : 13 85 : IFMapClient::IFMapClient() 14 85 : : index_(kIndexInvalid), exporter_(NULL), msgs_sent_(0), msgs_blocked_(0), 15 85 : bytes_sent_(0), update_nodes_sent_(0), delete_nodes_sent_(0), 16 85 : update_links_sent_(0), delete_links_sent_(0), send_is_blocked_(false), 17 85 : created_at_(UTCTimestampUsec()) { 18 85 : } 19 : 20 85 : IFMapClient::~IFMapClient() { 21 85 : } 22 : 23 78 : void IFMapClient::Initialize(IFMapExporter *exporter, int index) { 24 78 : index_ = index; 25 78 : exporter_ = exporter; 26 78 : } 27 : 28 6 : std::vector<std::string> IFMapClient::vm_list() const { 29 6 : std::vector<std::string> vm_list; 30 : 31 6 : vm_list.reserve(vm_map_.size()); 32 6 : for (VmMap::const_iterator iter = vm_map_.begin(); iter != vm_map_.end(); 33 0 : ++iter) { 34 0 : vm_list.push_back(iter->first); 35 : } 36 6 : return vm_list; 37 0 : } 38 :