L4Re Operating System Framework
Interface and Usage Documentation
Loading...
Searching...
No Matches
L4Re::Namespace Class Reference

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 Base::__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< Classc () 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 60 of file namespace.

Member Enumeration Documentation

◆ Query_result_flags

Flags returned by query IPC, only used internally.

Enumerator
Partly_resolved 

Name was only partly resolved.

Definition at line 88 of file namespace.

◆ Query_timeout

Timeout values for query operation.

Enumerator
To_default 

Default timeout.

To_non_blocking 

Expect callee to answer immediately.

Definition at line 94 of file 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 68 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]nameString to query (without any leading slashes).
[out]capCapability slot where the received capability will be put.
[in]timeoutTimeout 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_idIf 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]iterateIf true, the client will try to resolve names by iteratively calling the name spaces until the name is fully resolved.
Return values
0Name could be fully resolved.
>0Name could only be partly resolved. The number of remaining characters is returned.
-L4_ENOENTEntry could not be found.
-L4_EAGAINEntry exists but no object is yet attached. Try again later.
<0IPC errors, see l4_error_code_t.

Definition at line 125 of file namespace_impl.h.

◆ 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]lenLength of the string to query without any terminating null characters.
[in]nameString to query (without any leading slashes).
[out]capCapability slot where the received capability will be put.
[in]timeoutTimeout 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_idIf 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]iterateIf true, the client will try to resolve names by iteratively calling the name spaces until the name is fully resolved.
Return values
0Name could be fully resolved.
>0Name could only be partly resolved. The number of remaining characters is returned.
-L4_ENOENTEntry could not be found.
-L4_EAGAINEntry exists but no object is yet attached. Try again later.
<0IPC errors, see l4_error_code_t.

Definition at line 77 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
nameName under which the object should be registered.
objCapability to object to register. An invalid capability may be given to only reserve the name for later use.
flagsFlags 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
0Object was successfully registered with name.
-L4_EEXISTName already registered.
-L4_EPERMCaller does not have L4_CAP_FPAGE_W right on the invoked capability.
-L4_ENOMEMServer has insufficient resources.
-L4_EINVALInvalid parameter.
<0IPC errors, see l4_error_code_t.
Precondition
requires capability rights: {RW}

Definition at line 176 of file namespace.

◆ unlink()

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

Remove an entry from the name space.

Parameters
nameName of the entry to remove.
Return values
0Entry successfully removed.
-L4_ENOENTGiven name does not exist.
-L4_EPERMCaller does not have L4_CAP_FPAGE_W right on the invoked capability.
-L4_EACCESSName cannot be removed.
<0IPC errors, see l4_error_code_t.
Precondition
requires capability rights: {RW}

Definition at line 203 of file namespace.


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