Loading...
Searching...
No Matches
cmd_control
// -*- Mode: C++ -*-
// vim:ft=cpp
/*
* Copyright (C) 2016, 2024 Kernkonzept GmbH.
* Author(s): Sarah Hoffmann <sarah.hoffmann@kernkonzept.com>
*
* License: see LICENSE.spdx (in this directory or the directories above)
*/
#pragma once
#include <l4/sys/cxx/ipc_epiface>
#include <l4/sys/cxx/ipc_string>
namespace L4Re { namespace Ned {
class Cmd_control : public L4::Kobject_0t<Cmd_control>
{
L4_INLINE_RPC_NF(long, execute, (L4::Ipc::String<> cmd,
L4::Ipc::Array<char> &result));
public:
long execute(L4::Ipc::String<> cmd) noexcept
{
L4::Ipc::Array<char> res(0, NULL);
return execute_t::call(c(), cmd, res);
}
long execute(L4::Ipc::String<> cmd,
L4::Ipc::String<char> *result) noexcept
{
L4::Ipc::Array<char> res(result->length, result->data);
long r = execute_t::call(c(), cmd, res);
if (r >= 0)
result->length = res.length;
return r;
}
typedef L4::Typeid::Rpcs<execute_t> Rpcs;
};
} } // namespace
L4Re::Ned::Cmd_control
Direct control interface for Ned.
Definition cmd_control:20
L4Re::Ned::Cmd_control::execute
long execute(L4::Ipc::String<> cmd, L4::Ipc::String< char > *result) noexcept
Execute the given Lua code.
Definition cmd_control:64
L4Re::Ned::Cmd_control::execute
long execute(L4::Ipc::String<> cmd) noexcept
Execute the given Lua code.
Definition cmd_control:42
L4::Kobject_t< Derived, L4::Kobject, L4::PROTO_ANY, Type_info::Demand_t<> >::c
L4::Cap< Class > c() const noexcept
Definition __typeinfo.h:769
L4_INLINE_RPC_NF
#define L4_INLINE_RPC_NF(res, name, args...)
Define an inline RPC call type (the type only, no callable).
Definition ipc_iface:453
L4Re
L4Re C++ Interfaces.
Definition cmd_control:14
L4::Ipc::Array
Array data type for dynamically sized arrays in RPCs.
Definition ipc_array:82
L4::Typeid::Rpcs
Standard list of RPCs of an interface.
Definition __typeinfo.h:428