2 * Copyright (c) 2007, 2008, 2009, 2012, ETH Zurich.
5 * This file is distributed under the terms in the attached LICENSE file.
6 * If you do not find this file, copies can be found by writing to:
7 * ETH Zurich D-INFK, CAB F.78, Universitaetstr. 6, CH-8092 Zurich,
11 interface octopus "octopus RPC Interface" {
14 alias trigger_id uint64;
15 typedef enum {BINDING_RPC, BINDING_EVENT} binding_type;
17 // XXX: No flounder support for pointer values
27 // Binding Identification
29 rpc get_identifier(out uint64 id);
30 rpc identify(in uint64 id, in binding_type type);
38 * \param query Records to find.
39 * \param t Additional trigger to watch for future events.
40 * \param output Comma separated String of record names or NULL on error.
41 * \param tid Id of registered trigger (0 in case no trigger registered).
42 * \param error_code Error value of request.
44 rpc get_names(in String query[8192], in trigger t, out String output[8192],
45 out trigger_id tid, out errval error_code);
48 * \param query Record to find.
49 * \param t Additional trigger to watch for future events.
50 * \param output Retrieved record or NULL on error.
51 * \param tid Id of registered trigger (0 in case no trigger registered).
52 * \param error_code Error value of request.
54 rpc get(in String query[8192], in trigger t, out String output[8192],
55 out trigger_id tid, out errval error_code);
58 * \param query Record to set.
59 * \param mode Set mode (see getset.h).
60 * \param t Additional trigger to watch for future events.
61 * \param get Return record if it has been set.
62 * \param record In case get is true and no error_code is ok
63 * contains record, otherwise NULL
64 * \param tid Id of registered trigger (0 in case no trigger registered).
65 * \param error_code Error value of request
67 rpc set(in String query[8192], in uint64 mode, in trigger t, in bool get,
68 out String record[8192], out trigger_id tid, out errval error_code);
71 * Find a record using an ID capability as the key/name of the record.
73 * \param idcap ID capability used as the name of the record.
74 * \param t Additional trigger to watch for future events.
75 * \param output Retrieved record or NULL on error.
76 * \param tid Id of registered trigger (0 in case no trigger registered).
77 * \param error_code Error value of request.
79 rpc get_with_idcap(in cap idcap, in trigger t, out String output[8192],
80 out trigger_id tid, out errval error_code);
83 * Set a record using an ID capability as the key/name of the record.
85 * \param idcap ID capability used as the key/name of the record.
86 * \param attributes Attributes to store in the record.
87 * \param mode Set mode (see getset.h).
88 * \param t Additional trigger to watch for future events.
89 * \param get Return record if it has been set.
90 * \param record In case get is true and no error_code is ok
91 * contains record, otherwise NULL
92 * \param tid Id of registered trigger (0 in case no trigger registered).
93 * \param error_code Error value of request
95 rpc set_with_idcap(in cap idcap, in String attributes[2048], in uint64 mode,
96 in trigger t, in bool get, out String record[2048],
97 out trigger_id tid, out errval error_code);
100 * \param query Record(s) to delete.
101 * \param t Additional trigger to watch for future events.
102 * \param tid Id of registered trigger (0 in case no trigger registered).
103 * \param error_code Error value of request
105 rpc del(in String query[8192], in trigger t, out trigger_id tid,
106 out errval error_code);
110 * \param t Additional trigger to watch for future events.
111 * \param tid Id of registered trigger (0 in case no trigger registered).
112 * \param error_code Error value of request.
114 rpc exists(in String query[8192], in trigger t, out trigger_id tid,
115 out errval error_code);
118 * \brief Blocks until a record matching the provided query is registered.
120 * This was introduced specifically for the nameserver API
121 * due to limitations of the memory allocation during bootstrapping we
122 * can't use THC but need to support nameservice blocking lookup.
123 * If you use this call you might want to consider using
124 * a combination of get and triggers.
130 rpc wait_for(in String query[8192], out String record[2048], out errval error_code);
133 * \brief Used to remove Triggers in case they are not needed anymore.
135 * Note that non persistent trigger are removed automatically after
136 * they have fired. For persistent triggers be aware that you might
137 * still get a notification after the trigger has been removed because
138 * trigger events are sent over another binding.
140 * \param id Trigger ID to remove
141 * \param error_code Error of operation
143 rpc remove_trigger(in uint64 id, out errval error_code);
147 // Publish/Subscribe API
152 * \param client_state Additional state supplied by client.
153 * \param id Identifier for this subscription supplied by server.
154 * \param error_code Status of request.
156 rpc subscribe(in String query[8192], in uint64 trigger_fn, in uint64 state,
157 out uint64 id, out errval error_code);
160 * \param id Id for the subscription
161 * \param error_code Status of request
163 rpc unsubscribe(in uint64 id, out errval error_code);
166 * \param record Message to publish.
167 * \param error_code Status of request.
169 rpc publish(in String record[2048], out errval error_code);
173 // Async events (sent by server to client)
175 message trigger(trigger_id id, uint64 trigger_fn, mode m, String record[2048],
178 message subscription(trigger_id id, uint64 trigger_fn, mode m,
179 String record[2048], uint64 state);
183 // Backward compability with chips
186 // Simple capability storage
187 rpc get_cap(in String key[256], out cap retcap, out errval reterr);
188 rpc put_cap(in String key[256], in cap storecap, out errval reterr);
189 rpc sput_cap(in String key[256], in cap storecap, out String retkey[256], out errval reterr);
190 rpc remove_cap(in String key[256], out errval reterr);