L4Re - L4 Runtime Environment
|
Name-space interface. More...
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 , 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... | |
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 throw () |
Query the name space for a named object. More... | |
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 throw () |
Query the name space for a named object. More... | |
long | register_obj (char const *name, L4::Ipc::Cap< void > obj, unsigned flags=Rw) const throw () |
Register an object with a name. More... | |
long | unlink (char const *name) |
Remove an entry from the name space. More... | |
![]() | |
l4_msgtag_t | dec_refcnt (l4_mword_t diff, l4_utcb_t *utcb=l4_utcb()) |
Decrement the in kernel reference counter for the object. More... | |
Additional Inherited Members | |
![]() | |
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. | |
![]() | |
L4::Cap< Class > | c () const |
Get the capability to ourselves. | |
![]() | |
l4_cap_idx_t | cap () const throw () |
Return capability selector. More... | |
![]() | |
static void | __check_protocols__ () |
Helper to check for protocol conflicts. | |
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.
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 | ||
throw | ( | ||
) |
Query the name space for a named object.
[in] | name | String to query (without any leading slashes). |
[in] | 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. |
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 118 of file namespace_impl.h.
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 | ||
throw | ( | ||
) |
Query the name space for a named object.
The query string does not necessarily need to be null-terminated.
[in] | len | Length of the string to query without any terminating null characters. |
[in] | name | String to query (without any leading slashes). |
[in] | 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. |
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 77 of file namespace_impl.h.
References L4_EAGAIN, L4_EINVAL, l4_sleep(), and L4_UNLIKELY.
|
inline |
Register an object with a name.
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. |
0 | Object was successfully registered with name. |
-L4_EEXIST | Name already registered. |
-L4_EPERM | Caller doesn't have necessary permissions. |
-L4_ENOMEM | Server has insufficient resources. |
-L4_EINVAL | Invalid parameter. |
<0 | IPC errors, see l4_error_code_t. |
Definition at line 176 of file namespace.
References L4_RPC_NF_OP.
|
inline |
Remove an entry from the name space.
name | Name of the entry to remove. |
0 | Entry successfully removed. |
-L4_ENOENT | Given name does not exist. |
-L4_EPERM | Caller does not have write permission. |
-L4_EACCESS | Name cannot be removed. |
<0 | IPC errors, see l4_error_code_t. |