/* * \brief Client-side NIC session interface * \author Norman Feske * \date 2009-11-13 */ /* * Copyright (C) 2009-2017 Genode Labs GmbH * * This file is part of the Genode OS framework, which is distributed * under the terms of the GNU Affero General Public License version 3. */ #ifndef _INCLUDE__NIC_SESSION__CLIENT_H_ #define _INCLUDE__NIC_SESSION__CLIENT_H_ #include #include #include #include namespace Nic { class Session_client; } class Nic::Session_client : public Genode::Rpc_client { private: Packet_stream_tx::Client _tx; Packet_stream_rx::Client _rx; public: /** * Constructor * * \param tx_buffer_alloc allocator used for managing the * transmission buffer */ Session_client(Session_capability session, Genode::Range_allocator &tx_buffer_alloc, Genode::Region_map &rm) : Genode::Rpc_client(session), _tx(call(), rm, tx_buffer_alloc), _rx(call(),rm ) { } /*************************** ** NIC session interface ** ***************************/ Mac_address mac_address() override { return call(); } Tx *tx_channel() override { return &_tx; } Rx *rx_channel() override { return &_rx; } Tx::Source *tx() override { return _tx.source(); } Rx::Sink *rx() override { return _rx.sink(); } void link_state_sigh(Genode::Signal_context_capability sigh) override { call(sigh); } bool link_state() override { return call(); } }; #endif /* _INCLUDE__NIC_SESSION__CLIENT_H_ */