2011-12-22 15:19:25 +00:00
|
|
|
/*
|
|
|
|
* \brief Server-side NIC session interface
|
|
|
|
* \author Norman Feske
|
|
|
|
* \date 2009-11-13
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
2017-02-20 12:23:52 +00:00
|
|
|
* Copyright (C) 2009-2017 Genode Labs GmbH
|
2011-12-22 15:19:25 +00:00
|
|
|
*
|
|
|
|
* This file is part of the Genode OS framework, which is distributed
|
2017-02-20 12:23:52 +00:00
|
|
|
* under the terms of the GNU Affero General Public License version 3.
|
2011-12-22 15:19:25 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _INCLUDE__NIC_SESSION__RPC_OBJECT_H_
|
|
|
|
#define _INCLUDE__NIC_SESSION__RPC_OBJECT_H_
|
|
|
|
|
|
|
|
#include <nic_session/nic_session.h>
|
|
|
|
#include <packet_stream_tx/rpc_object.h>
|
|
|
|
#include <packet_stream_rx/rpc_object.h>
|
|
|
|
|
2015-03-04 20:12:14 +00:00
|
|
|
namespace Nic { class Session_rpc_object; }
|
|
|
|
|
|
|
|
|
|
|
|
class Nic::Session_rpc_object : public Genode::Rpc_object<Session, Session_rpc_object>
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
|
|
|
|
Packet_stream_tx::Rpc_object<Tx> _tx;
|
|
|
|
Packet_stream_rx::Rpc_object<Rx> _rx;
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Constructor
|
|
|
|
*
|
|
|
|
* \param tx_ds dataspace used as communication buffer
|
|
|
|
* for the tx packet stream
|
|
|
|
* \param rx_ds dataspace used as communication buffer
|
|
|
|
* for the rx packet stream
|
|
|
|
* \param rx_buffer_alloc allocator used for managing the communication
|
|
|
|
* buffer of the rx packet stream
|
|
|
|
* \param ep entry point used for packet-stream channels
|
|
|
|
*/
|
2017-01-09 14:18:49 +00:00
|
|
|
Session_rpc_object(Genode::Region_map &rm,
|
|
|
|
Genode::Dataspace_capability tx_ds,
|
2015-03-04 20:12:14 +00:00
|
|
|
Genode::Dataspace_capability rx_ds,
|
|
|
|
Genode::Range_allocator *rx_buffer_alloc,
|
|
|
|
Genode::Rpc_entrypoint &ep)
|
|
|
|
:
|
2017-01-09 14:18:49 +00:00
|
|
|
_tx(tx_ds, rm, ep),
|
2019-01-30 16:27:46 +00:00
|
|
|
_rx(rx_ds, rm, *rx_buffer_alloc, ep)
|
|
|
|
{ }
|
2015-03-04 20:12:14 +00:00
|
|
|
|
|
|
|
Genode::Capability<Tx> _tx_cap() { return _tx.cap(); }
|
|
|
|
Genode::Capability<Rx> _rx_cap() { return _rx.cap(); }
|
|
|
|
};
|
2011-12-22 15:19:25 +00:00
|
|
|
|
|
|
|
#endif /* _INCLUDE__NIC_SESSION__RPC_OBJECT_H_ */
|