diff --git a/repos/os/src/server/nic_dump/component.cc b/repos/os/src/server/nic_dump/component.cc index fc67efce5..7eb727d91 100644 --- a/repos/os/src/server/nic_dump/component.cc +++ b/repos/os/src/server/nic_dump/component.cc @@ -56,29 +56,28 @@ Session_component_base(Allocator &guarded_alloc_backing, Net::Session_component::Session_component(Allocator &alloc, size_t const amount, - Ram_session &buf_ram, size_t const tx_buf_size, size_t const rx_buf_size, - Region_map ®ion_map, - Uplink &uplink, Xml_node config, Timer::Connection &timer, unsigned &curr_time, - Entrypoint &ep) + Env &env) : - Session_component_base(alloc, amount, buf_ram, tx_buf_size, rx_buf_size), - Session_rpc_object(region_map, _tx_buf, _rx_buf, &_range_alloc, ep.rpc_ep()), - Interface(ep, config.attribute_value("downlink", Interface_label()), + Session_component_base(alloc, amount, env.ram(), tx_buf_size, rx_buf_size), + Session_rpc_object(env.rm(), _tx_buf, _rx_buf, &_range_alloc, + env.ep().rpc_ep()), + Interface(env.ep(), config.attribute_value("downlink", Interface_label()), timer, curr_time, config.attribute_value("time", false), _guarded_alloc), - _mac(uplink.mac_address()) + _uplink(env, config, timer, curr_time, alloc), + _mac(_uplink.mac_address()) { _tx.sigh_ready_to_ack(_sink_ack); _tx.sigh_packet_avail(_sink_submit); _rx.sigh_ack_avail(_source_ack); _rx.sigh_ready_to_submit(_source_submit); - Interface::remote(uplink); - uplink.Interface::remote(*this); + Interface::remote(_uplink); + _uplink.Interface::remote(*this); } @@ -99,20 +98,15 @@ void Session_component::link_state_sigh(Signal_context_capability sigh) ** Root ** **********/ -Net::Root::Root(Entrypoint &ep, +Net::Root::Root(Env &env, Allocator &alloc, - Uplink &uplink, - Ram_session &buf_ram, Xml_node config, Timer::Connection &timer, - unsigned &curr_time, - Region_map ®ion_map) + unsigned &curr_time) : - Root_component(&ep.rpc_ep(), + Root_component(&env.ep().rpc_ep(), &alloc), - _ep(ep), _uplink(uplink), _buf_ram(buf_ram), - _region_map(region_map), _config(config), _timer(timer), - _curr_time(curr_time) + _env(env), _config(config), _timer(timer), _curr_time(curr_time) { } @@ -143,8 +137,8 @@ Session_component *Net::Root::_create_session(char const *args) } return new (md_alloc()) Session_component(*md_alloc(), ram_quota - session_size, - _buf_ram, tx_buf_size, rx_buf_size, _region_map, - _uplink, _config, _timer, _curr_time, _ep); + tx_buf_size, rx_buf_size, _config, _timer, + _curr_time, _env); } catch (...) { throw Service_denied(); } } diff --git a/repos/os/src/server/nic_dump/component.h b/repos/os/src/server/nic_dump/component.h index 1ebbcab1e..6f5bf50b0 100644 --- a/repos/os/src/server/nic_dump/component.h +++ b/repos/os/src/server/nic_dump/component.h @@ -22,6 +22,7 @@ /* local includes */ #include +#include namespace Net { @@ -29,7 +30,6 @@ namespace Net { class Session_component_base; class Session_component; class Root; - class Uplink; } @@ -73,6 +73,7 @@ class Net::Session_component : public Session_component_base, { private: + Uplink _uplink; Mac_address _mac; @@ -87,15 +88,12 @@ class Net::Session_component : public Session_component_base, Session_component(Genode::Allocator &alloc, Genode::size_t const amount, - Genode::Ram_session &buf_ram, Genode::size_t const tx_buf_size, Genode::size_t const rx_buf_size, - Genode::Region_map ®ion_map, - Uplink &uplink, Genode::Xml_node config, Timer::Connection &timer, unsigned &curr_time, - Genode::Entrypoint &ep); + Genode::Env &env); /****************** @@ -113,13 +111,10 @@ class Net::Root : public Genode::Root_component -#include using namespace Net; using namespace Genode; @@ -33,7 +32,6 @@ class Main Timer::Connection _timer; unsigned _curr_time { 0 }; Genode::Heap _heap; - Uplink _uplink; Net::Root _root; public: @@ -45,9 +43,7 @@ class Main Main::Main(Env &env) : _config(env, "config"), _timer(env), _heap(&env.ram(), &env.rm()), - _uplink(env, _config.xml(), _timer, _curr_time, _heap), - _root(env.ep(), _heap, _uplink, env.ram(), _config.xml(), _timer, - _curr_time, env.rm()) + _root(env, _heap, _config.xml(), _timer, _curr_time) { env.parent().announce(env.ep().manage(_root)); }