From fcb861689a5590f06105895fbb6e3f3f43056bfc Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Tue, 21 Feb 2017 23:00:24 +0100 Subject: [PATCH] base: support for re-validating session routes This patch supplements 'Session_state' with the methods needed to test the validity of a session with a changed routing policy. --- repos/base/include/base/child.h | 5 +++++ repos/base/include/base/service.h | 2 ++ repos/base/include/base/session_state.h | 13 ++++++++++++- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/repos/base/include/base/child.h b/repos/base/include/base/child.h index c445a5ff6..47f04696f 100644 --- a/repos/base/include/base/child.h +++ b/repos/base/include/base/child.h @@ -468,6 +468,11 @@ class Genode::Child : protected Rpc_object, } void wakeup() override { _service.wakeup(); } + + bool operator == (Service const &other) const override + { + return _service == other; + } }; Constructible _env_service; diff --git a/repos/base/include/base/service.h b/repos/base/include/base/service.h index b9e8adfa7..f385316a0 100644 --- a/repos/base/include/base/service.h +++ b/repos/base/include/base/service.h @@ -109,6 +109,8 @@ class Genode::Service : Noncopyable * Return the RAM session to be used for trading resources */ virtual Ram_session_capability ram() const { return _ram; } + + virtual bool operator == (Service const &other) const { return this == &other; } }; diff --git a/repos/base/include/base/session_state.h b/repos/base/include/base/session_state.h index 2f956e067..d7de31acd 100644 --- a/repos/base/include/base/session_state.h +++ b/repos/base/include/base/session_state.h @@ -139,7 +139,8 @@ class Genode::Session_state : public Parent::Client, public Parent::Server, error("dangling session in parent-side ID space: ", *this); } - Service &service() { return _service; } + Service &service() { return _service; } + Service const &service() const { return _service; } /** * Extend amount of ram attached to the session @@ -197,6 +198,16 @@ class Genode::Session_state : public Parent::Client, public Parent::Server, return false; } + /** + * Return client-side label of the session request + */ + Session_label client_label() const { return label_from_args(_args.string()); } + + /** + * Return label presented to the server along with the session request + */ + Session_label label() const { return _label; } + /** * Assign owner *