1<?xml version="1.0" ?>
2
3<!--
4     Copyright 2016, Data61
5     Commonwealth Scientific and Industrial Research Organisation (CSIRO)
6     ABN 41 687 119 230.
7
8     This software may be distributed and modified according to the terms of
9     the BSD 2-Clause license. Note that NO WARRANTY is provided.
10     See "LICENSE_BSD2.txt" for details.
11
12     @TAG(D61_BSD)
13  -->
14
15<interface label_min='NAMESERV_METHODS_BASE' connect_ep='0'>
16    <include>refos/refos.h</include>
17    <include>refos/vmlayout.h</include>
18
19    <function name="nsv_register" return='refos_err_t'>
20        ! @brief Register as a server under the given name so clients can find us.
21
22        Servers need to create an endpoint and call this on the process server, in order for clients
23        to be able to find this server and to connect to it. The anon cap will be given to clients
24        looking for this server, and the client will make its connection call through the anon cap
25        to establish a session.
26 
27        Re-registering will replace the current server anon cap.
28
29        @param nameserv The name server to register onto.
30        @param name String containing name to register under. (No ownership)
31        @param ep The anonymous endpoint cap to register with.
32        @return ESUCCESS on success, refos_err_t error code otherwise.
33
34        <param type="seL4_CPtr" name="nameserv" mode="connect_ep"/>
35        <param type="char*" name="name"/>
36        <param type="seL4_CPtr" name="ep"/>
37    </function>
38
39    <function name="nsv_unregister" return='refos_err_t'>
40        ! @brief Unregister as a server.
41
42        Unregister as a server under given name, so clients are no longer able to find us
43        under that name. Existing anon caps will be invalidated.
44
45        @param nameserv The name server to unregister from.
46        @param name String containing name to unregister for.
47        @return ESUCCESS on success, refos_err_t error code otherwise.
48
49        <param type="seL4_CPtr" name="nameserv" mode="connect_ep"/>
50        <param type="char*" name="name"/>
51    </function>
52
53    <function name="nsv_resolve_segment_internal" return='seL4_CPtr'>
54        ! @brief Resolve the next segment of the given path at the given nameserv.
55
56        Gives back an anon cap if the server is found. For details regarding the anon cap, refer to
57        the documentation under nsv_register(). This function resolves a part of the name, returned
58        as offset into the string that has been resolved. The rest of the path string may be
59        resolved by another dataspace, and so forth, until we get to the end containing the endpoint
60        to the server that actually contains the file. This allows for a simple hierachical
61        namespace with distributed naming.
62
63        @param nameserv The name server to resolve with.
64        @param path The path to resolve.
65        @param[out] resolvedBytes Output containing number of bytes resolved.
66        @param errno Outut error code, if an error occured.
67        @return 0 on error, anon capability to next name server on success.
68
69        <param type="seL4_CPtr" name="nameserv" mode="connect_ep"/>
70        <param type="char*" name="path"/>
71        <param type="int*" name="resolvedBytes" dir="out"/>
72        <param type="refos_err_t*" name="errno" dir="out"/>
73    </function>
74
75</interface>
76