Loading...
Searching...
No Matches
L4Re::Namespace Class Reference
L4Re C++ Interface » Name-space API

Name-space interface. More...

`#include <namespace>`

Inheritance diagram for L4Re::Namespace:
Collaboration diagram for L4Re::Namespace:

## Public Types

enum | Register_flags { Ro = L4_CAP_FPAGE_RO , Rw = L4_CAP_FPAGE_RW , Rs = L4_CAP_FPAGE_RS , Rws = L4_CAP_FPAGE_RWS , Strong = L4_CAP_FPAGE_S , Trusted = 0x008 , Cap_flags = Ro | Rw | Strong | Trusted , Link = 0x100 , Overwrite = 0x200 }
| Flags for registering name spaces. More...
enum | Query_result_flags { Partly_resolved = 0x020 }
| Flags returned by query IPC, only used internally. More...
enum | Query_timeout { To_default = 3600000 , To_non_blocking = 0 }
| Timeout values for query operation. More...

## Public Member Functions

long | query (char const *name, L4::Cap< void > const &cap, int timeout=To_default, l4_umword_t *local_id=0, bool iterate=true) const noexcept
| Query the name space for a named object.
long | query (char const *name, unsigned len, L4::Cap< void > const &cap, int timeout=To_default, l4_umword_t *local_id=0, bool iterate=true) const noexcept
| Query the name space for a named object.
long | register_obj (char const *name, L4::Ipc::Cap< void > obj, unsigned flags=Rw) const noexcept
| Register an object with a name.
long | unlink (char const *name)
| Remove an entry from the name space.
Public Member Functions inherited from L4::Kobject
l4_msgtag_t | dec_refcnt (l4_mword_t diff, l4_utcb_t *utcb=l4_utcb())
| Decrement the in kernel reference counter for the object.

## Additional Inherited Members

Protected Types inherited from L4::Kobject_t< Namespace, L4::Kobject, L4RE_PROTO_NAMESPACE, L4::Type_info::Demand_t< 1 > >
typedef Namespace | Class
| The target interface type (inheriting from Kobject_t).
typedef Typeid::Iface< PROTO, Namespace > | __Iface
| The interface description for the derived class.
typedef Typeid::Merge_list< Typeid::Iface_list< __Iface >, typename L4::Kobject::__Iface_list > | __Iface_list
| The list of all RPC interfaces provided directly or through inheritance.
Protected Member Functions inherited from L4::Kobject_t< Namespace, L4::Kobject, L4RE_PROTO_NAMESPACE, L4::Type_info::Demand_t< 1 > >
L4::Cap< Class > | c () const noexcept
| Get the capability to ourselves.
Protected Member Functions inherited from L4::Kobject
l4_cap_idx_t | cap () const noexcept
| Return capability selector.
Static Protected Member Functions inherited from L4::Kobject_t< Namespace, L4::Kobject, L4RE_PROTO_NAMESPACE, L4::Type_info::Demand_t< 1 > >
static void | __check_protocols__ () noexcept
| Helper to check for protocol conflicts.

## Detailed Description

Name-space interface.

All name space objects must provide this interface. However, it is not mandatory that a name space object allows to register new capabilities.

The name lookup is done iteratively, this means the hierarchical names are resolved component wise by the client itself.

Definition at line 49 of file namespace.

## Member Enumeration Documentation

## Query_result_flags

enum L4Re::Namespace::Query_result_flags

Flags returned by query IPC, only used internally.

Enumerator
Partly_resolved | Name was only partly resolved.

Definition at line 77 of file namespace.

## Query_timeout

enum L4Re::Namespace::Query_timeout

Timeout values for query operation.

Enumerator
To_default | Default timeout.
To_non_blocking | Expect callee to answer immediately.

Definition at line 83 of file namespace.

## Register_flags

enum L4Re::Namespace::Register_flags

Flags for registering name spaces.

Enumerator
Ro | Read-only.
Rw | Read-write.
Rs | Read-only + strong.
Rws | Read-write + strong.
Strong | Strong.
Trusted | Obsolete, do not use.
Link | Obsolete, do not use.
Overwrite | If entry already exists, overwrite it.

Definition at line 57 of file namespace.

## Member Function Documentation

## query() [1/2]

long L4Re::Namespace::query | ( | char const * | name,
|  | L4::Cap< void > const & | cap,
|  | int | timeout = To_default,
|  | l4_umword_t * | local_id = 0,
|  | bool | iterate = true ) const

noexcept

Query the name space for a named object.

Parameters

  [in] | name | String to query (without any leading slashes).
  [out] | cap | Capability slot where the received capability will be put.
  [in] | timeout | Timeout of query in milliseconds. The client will only wait if a name has already been registered with the server but no object has yet been attached.
  [out] | local_id | If given, L4_RCV_ITEM_LOCAL_ID will be set for the IPC from the name space, so that if the capability that was received is a local item, the capability ID will be returned with this parameter.
  [in] | iterate | If true, the client will try to resolve names by iteratively calling the name spaces until the name is fully resolved.

Return values

  0 | Name could be fully resolved.
  >0 | Name could only be partly resolved. The number of remaining characters is returned.
  -L4_ENOENT | Entry could not be found.
  -L4_EAGAIN | Entry exists but no object is yet attached. Try again later.
  <0 | IPC errors, see l4_error_code_t.

Definition at line 114 of file namespace_impl.h.

References query().

Referenced by query().

Here is the call graph for this function:
Here is the caller graph for this function:

## query() [2/2]

long L4Re::Namespace::query | ( | char const * | name,
|  | unsigned | len,
|  | L4::Cap< void > const & | cap,
|  | int | timeout = To_default,
|  | l4_umword_t * | local_id = 0,
|  | bool | iterate = true ) const

noexcept

Query the name space for a named object.

The query string does not necessarily need to be null-terminated.

Parameters

  [in] | len | Length of the string to query without any terminating null characters.
  [in] | name | String to query (without any leading slashes).
  [out] | cap | Capability slot where the received capability will be put.
  [in] | timeout | Timeout of query in milliseconds. The client will only wait if a name has already been registered with the server but no object has yet been attached.
  [out] | local_id | If given, L4_RCV_ITEM_LOCAL_ID will be set for the IPC from the name space, so that if the capability that was received is a local item, the capability ID will be returned with this parameter.
  [in] | iterate | If true, the client will try to resolve names by iteratively calling the name spaces until the name is fully resolved.

Return values

  0 | Name could be fully resolved.
  >0 | Name could only be partly resolved. The number of remaining characters is returned.
  -L4_ENOENT | Entry could not be found.
  -L4_EAGAIN | Entry exists but no object is yet attached. Try again later.
  <0 | IPC errors, see l4_error_code_t.

Definition at line 66 of file namespace_impl.h.

References L4_EAGAIN, L4_EINVAL, l4_sleep(), and L4_UNLIKELY.

Here is the call graph for this function:

## register_obj()

long L4Re::Namespace::register_obj | ( | char const * | name,
|  | L4::Ipc::Cap< void > | obj,
|  | unsigned | flags = Rw ) const

inlinenoexcept

Register an object with a name.

Parameters

  name | Name under which the object should be registered.
  obj | Capability to object to register. An invalid capability may be given to only reserve the name for later use.
  flags | Flags to assign to the entry, see L4Re::Namespace::Register_flags. Note that the rights that are assigned to a capability are not only determined by the rights given in these flags but also by the rights with which the obj capability was mapped to the name space.

Return values

  0 | Object was successfully registered with name.
  -L4_EEXIST | Name already registered.
  -L4_EPERM | Insufficient permissions; see precondition.
  -L4_ENOMEM | Server has insufficient resources.
  -L4_EINVAL | Invalid parameter.
  <0 | IPC errors, see l4_error_code_t.

Precondition
  The invoked Namespace capability must have the permission L4_CAP_FPAGE_W.

Definition at line 165 of file namespace.

References L4::Kobject_t< Namespace, L4::Kobject, L4RE_PROTO_NAMESPACE, L4::Type_info::Demand_t< 1 > >::c(), register_obj(), and Rw.

Referenced by register_obj().

Here is the call graph for this function:
Here is the caller graph for this function:

## unlink()

long L4Re::Namespace::unlink | ( | char const * | name | ) |

inline

Remove an entry from the name space.

Parameters

  name | Name of the entry to remove.

Return values

  0 | Entry successfully removed.
  -L4_ENOENT | Given name does not exist.
  -L4_EPERM | Insufficient permissions; see precondition.
  -L4_EACCESS | Name cannot be removed.
  <0 | IPC errors, see l4_error_code_t.

Precondition
  The invoked Namespace capability must have the permission L4_CAP_FPAGE_W.

Definition at line 191 of file namespace.

References L4::Kobject_t< Namespace, L4::Kobject, L4RE_PROTO_NAMESPACE, L4::Type_info::Demand_t< 1 > >::c(), and unlink().

Referenced by unlink().

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following files:

- l4/re/namespace
- l4/re/impl/namespace_impl.h