core: add session args filter to Core_child

Add the filter_session_args() method to Core_child to prefix the labels
of its children.

Fixes #789.
This commit is contained in:
Josef Söntgen 2013-05-08 11:10:35 +02:00 committed by Norman Feske
parent 4ba17f7ebd
commit 136af3764d
1 changed files with 19 additions and 0 deletions

View File

@ -138,6 +138,25 @@ class Core_child : public Child_policy
** Child-policy interface **
****************************/
void filter_session_args(const char *, char *args,
Genode::size_t args_len)
{
using namespace Genode;
char label_buf[Parent::Session_args::MAX_SIZE];
Arg_string::find_arg(args, "label").string(label_buf, sizeof(label_buf), "");
char value_buf[Parent::Session_args::MAX_SIZE];
Genode::snprintf(value_buf, sizeof(value_buf),
"\"%s%s%s\"",
"init",
Genode::strcmp(label_buf, "") == 0 ? "" : " -> ",
label_buf);
Arg_string::set_arg(args, args_len, "label", value_buf);
}
const char *name() const { return "init"; }
Service *resolve_session_request(const char *service, const char *)