Line data Source code
1 : /* 2 : * Copyright (c) 2017 Juniper Networks, Inc. All rights reserved. 3 : * Copyright Contributors to the OpenSDN project 4 : */ 5 : 6 : #include "mac_learning_proto_handler.h" 7 : #include "mac_learning_mgmt.h" 8 : #include "mac_learning_init.h" 9 : 10 : SandeshTraceBufferPtr MacLearningTraceBuf(SandeshTraceBufferCreate("MacLearning", 11 : 5000)); 12 : 13 2 : MacLearningModule::MacLearningModule(Agent *agent): 14 2 : agent_(agent), mac_learning_proto_(NULL) { 15 2 : } 16 : 17 2 : void MacLearningModule::Init() { 18 2 : EventManager *event = agent_->event_manager(); 19 2 : boost::asio::io_context &io = *event->io_service(); 20 : 21 2 : mac_learning_proto_.reset(new MacLearningProto(agent_, io)); 22 2 : agent_->set_mac_learning_proto(mac_learning_proto_.get()); 23 : 24 2 : mac_learning_mgmt_.reset(new MacLearningMgmtManager(agent_)); 25 : 26 2 : mac_learning_db_client_.reset(new MacLearningDBClient(agent_)); 27 2 : mac_learning_db_client_->Init(); 28 2 : } 29 : 30 2 : void MacLearningModule::Shutdown() { 31 2 : mac_learning_db_client_->Shutdown(); 32 2 : }