void Submodule::m_read_vlanports(const json::Value& vlans_configuration) { for (const auto& vlan_json : vlans_configuration.as_array()) { auto vlan = m_get_vlan_by_id(vlan_json["id"].as_uint()); if (nullptr != vlan) { log_debug(GET_LOGGER("module"), "Reading Vlanport configuration."); // Read tagged ports for (const auto& tagged_port : vlan_json["tagged_ports"].as_array()) { auto port = m_get_port_by_id(tagged_port.as_uint()); auto vlanport = VlanPort::make_vlanport(); vlanport->attach_port(port); vlanport->attach_vlan(vlan); vlanport->set_tagging(true); add_vlanport(std::move(vlanport)); } // Untagged ports for (const auto& untagged_port : vlan_json["untagged_ports"].as_array()) { auto port = m_get_port_by_id(untagged_port.as_uint()); auto vlanport = VlanPort::make_vlanport(); vlanport->attach_port(port); vlanport->attach_vlan(vlan); vlanport->set_tagging(false); add_vlanport(std::move(vlanport)); } } } }
void Submodule::m_read_ports(const json::Value& ports_configuration) { for(const auto& port_json : ports_configuration.as_array()) { auto port = Port::make_port(); port->read_configuration(port_json); add_switch_port(std::move(port)); } }
void Submodule::m_read_vlans(const json::Value& vlans_configuration) { for (const auto& vlan_json : vlans_configuration.as_array()){ auto vlan = Vlan::make_vlan(); vlan->read_configuration(vlan_json); add_vlan(std::move(vlan)); } }
void Submodule::m_read_storage_controllers_configuration( const json::Value& controllers_configuration) { for (const auto& controller_json : controllers_configuration.as_array()) { auto controller = StorageController::make_storage_controller(); controller->read_configuration(controller_json); add_storage_controller(std::move(controller)); } }
void Submodule::m_read_network_interfaces_configuration( const json::Value& interfaces_configuration) { for (const auto& interface_json : interfaces_configuration.as_array()) { auto interface = NetworkInterface::make_network_interface(); interface->read_configuration(interface_json); add_network_interface(std::move(interface)); } }