Line data Source code
1 : /* 2 : * Copyright (c) 2013 Juniper Networks, Inc. All rights reserved. 3 : */ 4 : 5 : #include "ifmap/ifmap_client.h" 6 : 7 : #include "base/bitset.h" 8 : #include "base/time_util.h" 9 : #include "ifmap/ifmap_exporter.h" 10 : #include "ifmap/ifmap_update.h" 11 : 12 83 : IFMapClient::IFMapClient() 13 83 : : index_(kIndexInvalid), exporter_(NULL), msgs_sent_(0), msgs_blocked_(0), 14 83 : bytes_sent_(0), update_nodes_sent_(0), delete_nodes_sent_(0), 15 83 : update_links_sent_(0), delete_links_sent_(0), send_is_blocked_(false), 16 83 : created_at_(UTCTimestampUsec()) { 17 83 : } 18 : 19 83 : IFMapClient::~IFMapClient() { 20 83 : } 21 : 22 74 : void IFMapClient::Initialize(IFMapExporter *exporter, int index) { 23 74 : index_ = index; 24 74 : exporter_ = exporter; 25 74 : } 26 : 27 6 : std::vector<std::string> IFMapClient::vm_list() const { 28 6 : std::vector<std::string> vm_list; 29 : 30 6 : vm_list.reserve(vm_map_.size()); 31 6 : for (VmMap::const_iterator iter = vm_map_.begin(); iter != vm_map_.end(); 32 0 : ++iter) { 33 0 : vm_list.push_back(iter->first); 34 : } 35 6 : return vm_list; 36 0 : } 37 :