xref: /haiku/docs/develop/servers/registrar/Protocols.rst (revision ed24eb5ff12640d052171c6a7feba37fab8a75d1)
1Registrar Protocols
2===================
3
4Standard Replies
5----------------
6
7standard success reply message
8..............................
9
10reply:		B_REG_SUCCESS
11
12- [ <additional fields> ]
13
14fields:
15
16- <additional fields>: Request-specific fields.
17
18standard error reply message
19............................
20
21reply:		B_REG_ERROR
22
23- "error": B_INT32_TYPE
24- [ "error_description": B_STRING_TYPE ]
25- [ <additional fields> ]
26
27fields:
28
29- "error": The error code (a status_t).
30- "error_description": Optional human readable description.
31- <additional fields>: Request-specific fields.
32
33
34standard general result reply message
35.....................................
36
37reply:		B_REG_RESULT
38
39- "result": B_INT32_TYPE
40- [ "result_description": B_STRING_TYPE ]
41- [ <additional fields> ]
42
43fields:
44
45- "result": The result value (a status_t).
46- "result_description": Optional human readable description.
47- <additional fields>: Request-specific fields.
48
49General Requests
50----------------
51
52Getting the messengers
53......................
54
55for MIME, clipboard and disk device management respectively
56
57+--------------+-------------------------------------------------------+
58| target       | registrar app looper (preferred handler)              |
59+--------------+-------------------------------------------------------+
60| message      | - B_REG_GET_MIME_MESSENGER                            |
61|              | - B_REG_GET_CLIPBOARD_MESSENGER                       |
62|              | - B_REG_GET_DISK_DEVICE_MESSENGER                     |
63+--------------+-------------------------------------------------------+
64| reply        | standard success                                      |
65|              |                                                       |
66|              | - "messenger": B_MESSENGER_TYPE                       |
67+--------------+-------------------------------------------------------+
68| on error     | - B_NO_REPLY (fatal)                                  |
69|              | - standard error (fatal)                              |
70+--------------+-------------------------------------------------------+
71
72reply fields:
73
74- "messenger": The requested messenger.
75
76Shut down
77.........
78
79+--------------+-------------------------------------------------------+
80| target       | registrar app looper (preferred handler)              |
81+--------------+-------------------------------------------------------+
82| message      | B_REG_SHUT_DOWN                                       |
83|              |                                                       |
84|              | - "reboot":			B_BOOL_TYPE            |
85|              | - "confirm":			B_BOOL_TYPE            |
86|              | - "synchronously":	B_BOOL_TYPE                    |
87+--------------+-------------------------------------------------------+
88| reply        | standard success                                      |
89+--------------+-------------------------------------------------------+
90| on error     | - B_NO_REPLY (fatal)                                  |
91|              | - standard error (fatal)                              |
92+--------------+-------------------------------------------------------+
93
94message fields:
95
96- "reboot": If true, the system reboots instead of turning the power off.
97- "confirm": If true, the user will be asked to confirm to shut down the system.
98- "synchronously": If true, the request sender gets a reply only, if the
99  shutdown process fails. Otherwise the reply will be sent
100  right before asking the user for confirmation (if desired).
101
102Roster Requests
103---------------
104
105App registration (BRoster::AddApplication())
106............................................
107
108+--------------+-------------------------------------------------------+
109| target       | roster                                                |
110+--------------+-------------------------------------------------------+
111| message      | B_REG_ADD_APP                                         |
112|              |                                                       |
113|              | - "signature":			B_MIME_STRING_TYPE     |
114|              | - "ref":			B_REF_TYPE             |
115|              | - "flags":			B_UINT32_TYPE          |
116|              | - "team":			B_INT32_TYPE           |
117|              | - "thread":			B_INT32_TYPE           |
118|              | - "port":			B_INT32_TYPE           |
119|              | - "full_registration":	        B_BOOL_TYPE            |
120+--------------+-------------------------------------------------------+
121| reply        | standard success                                      |
122|              |                                                       |
123|              | - [ "token":				B_INT32_TYPE ] |
124|              | - [ "other_team":			B_INT32_TYPE ] |
125+--------------+-------------------------------------------------------+
126| on error     | - B_NO_REPLY (fatal)                                  |
127|              | - standard error                                      |
128+--------------+-------------------------------------------------------+
129
130message fields:
131
132- "signature": The application signature.
133- "ref": An entry_ref to the application executable.
134- "flags": The application flags.
135- "team": The application team (team_id).
136- "port": The app looper port (port_id).
137- "full_registration": Whether full or pre-registration is requested.
138
139reply fields:
140
141- "token": If pre-registration was requested (uint32). Unique token to be
142  passed to BRoster::SetThreadAndTeam().
143- "other_team": For single/exclusive launch applications that are launched
144  the second time. The team ID of the already running instance (team_id).
145
146error reply fields:
147
148- "error":
149
150  - B_BAD_VALUE: A request message field is missing or contains an invalid value.
151  - B_ENTRY_NOT_FOUND: The entry_ref doesn't refer to a file.
152  - B_ALREADY_RUNNING: For single/exclusive launch applications that are launched the second time.
153  - B_REG_ALREADY_REGISTERED: The team is already registered.
154  - ...
155
156app registration (BRoster::CompleteRegistration())
157..................................................
158
159+--------------+-------------------------------------------------------+
160| target       | roster                                                |
161+--------------+-------------------------------------------------------+
162| message      | B_REG_COMPLETE_REGISTRATION                           |
163|              |                                                       |
164|              | - "team":		B_INT32_TYPE                   |
165|              | - "thread":	B_INT32_TYPE                           |
166|              | - "port":		B_INT32_TYPE                   |
167+--------------+-------------------------------------------------------+
168| reply        | standard success                                      |
169+--------------+-------------------------------------------------------+
170| on error     | - B_NO_REPLY (fatal)                                  |
171|              | - standard error                                      |
172+--------------+-------------------------------------------------------+
173
174message fields:
175
176- "team": The application team (team_id).
177- "thread": The application looper thread (thread_id).
178- "port": The app looper port (port_id).
179
180error reply fields:
181
182- "error":
183
184  - B_BAD_VALUE: A request message field is missing or contains an
185    invalid value.
186  - B_REG_APP_NOT_PRE_REGISTERED: The team is unknown to the roster or the
187    application is already fully registered.
188  - ...
189
190app registration check (BRoster::IsAppRegistered())
191...................................................
192
193+--------------+-------------------------------------------------------+
194| target       | roster                                                |
195+--------------+-------------------------------------------------------+
196| message      | B_REG_IS_APP_REGISTERED                               |
197|              |                                                       |
198|              | - "ref":		B_REF_TYPE                     |
199|              | - ( "team":	B_INT32_TYPE | "token":	B_INT32_TYPE ) |
200+--------------+-------------------------------------------------------+
201| reply        | standard success                                      |
202|              |                                                       |
203|              | - "registered":		B_BOOL_TYPE            |
204|              | - "pre-registered":	B_BOOL_TYPE                    |
205|              | - [ "app_info":		flattened app_info ]   |
206+--------------+-------------------------------------------------------+
207| on error     | - B_NO_REPLY (fatal)                                  |
208|              | - standard error                                      |
209+--------------+-------------------------------------------------------+
210
211message fields:
212
213- "ref": An entry_ref to the application executable.
214- "team": The application team (team_id).
215- "token": The application's preregistration token.
216
217reply fields:
218
219- "registered": true, if the app is (pre-)registered, false otherwise.
220- "pre-registered": true, if the app is pre-registered, false otherwise.
221- "app_info": Flattened app info, if the app is known (i.e. (pre-)registered).
222
223error reply fields:
224
225- "error":
226
227  - B_BAD_VALUE: A request message field is missing or contains an
228    invalid value.
229  - B_ENTRY_NOT_FOUND: The entry_ref doesn't refer to a file.
230  - ...
231
232pre-registrated app unregistration (BRoster::RemovePreRegApp())
233...............................................................
234
235+--------------+-------------------------------------------------------+
236| target       | roster                                                |
237+--------------+-------------------------------------------------------+
238| message      | B_REG_REMOVE_PRE_REGISTERED_APP                       |
239|              |                                                       |
240|              | - "token":	B_INT32_TYPE                           |
241+--------------+-------------------------------------------------------+
242| reply        | standard success                                      |
243+--------------+-------------------------------------------------------+
244| on error     | - B_NO_REPLY (fatal)                                  |
245|              | - standard error                                      |
246+--------------+-------------------------------------------------------+
247
248message fields:
249
250- "token": The token BRoster::AddApplication() returned (uint32).
251
252error reply fields:
253
254- "error":
255
256  - B_BAD_VALUE: A request message field is missing or contains an
257    invalid value.
258  - B_REG_APP_NOT_PRE_REGISTERED: The token does not identify a pre-registered
259    application.
260  - ...
261
262app unregistration (BRoster::RemoveApp())
263.........................................
264
265+--------------+-------------------------------------------------------+
266| target       | roster                                                |
267+--------------+-------------------------------------------------------+
268| message      | B_REG_REMOVE_APP                                      |
269|              |                                                       |
270|              | - "team":	B_INT32_TYPE                           |
271+--------------+-------------------------------------------------------+
272| reply        | standard success                                      |
273+--------------+-------------------------------------------------------+
274| on error     | - B_NO_REPLY (fatal)                                  |
275|              | - standard error                                      |
276+--------------+-------------------------------------------------------+
277
278message fields:
279
280- "team": The application team (team_id).
281
282error reply fields:
283
284- "error":
285
286  - B_BAD_VALUE: A request message field is missing or contains an
287    invalid value.
288  - B_REG_APP_NOT_REGISTERED: The team is unknown to the roster.
289  - ...
290
291app pre-registration, set thread/team (BRoster::SetThreadAndTeam())
292...................................................................
293
294+--------------+-------------------------------------------------------+
295| target       | roster                                                |
296+--------------+-------------------------------------------------------+
297| message      | B_REG_SET_THREAD_AND_TEAM                             |
298|              |                                                       |
299| 	       | - "token":	B_INT32_TYPE                           |
300|	       | - "team":		B_INT32_TYPE                   |
301| 	       | - "thread":	B_INT32_TYPE                           |
302+--------------+-------------------------------------------------------+
303| reply        | standard success                                      |
304+--------------+-------------------------------------------------------+
305| on error     | - B_NO_REPLY (fatal)                                  |
306|              | - standard error                                      |
307+--------------+-------------------------------------------------------+
308
309message fields:
310
311- "token": The token BRoster::AddApplication() returned (uint32).
312- "team": The application team (team_id).
313- "thread": The application looper thread (thread_id).
314
315error reply fields:
316
317- "error":
318
319  - B_BAD_VALUE: A request message field is missing or contains an
320    invalid value.
321  - B_REG_APP_NOT_PRE_REGISTERED: The token does not identify a pre-registered
322    application.
323  - ...
324
325app registration, change app signature (BRoster::SetSignature())
326................................................................
327
328+--------------+-------------------------------------------------------+
329| target       | roster                                                |
330+--------------+-------------------------------------------------------+
331| message      | B_REG_SET_SIGNATURE                                   |
332|              |                                                       |
333|	       | - "team":			B_INT32_TYPE           |
334|	       | - "signature":	B_STRING_TYPE                          |
335+--------------+-------------------------------------------------------+
336| reply        | standard success                                      |
337+--------------+-------------------------------------------------------+
338| on error     | - B_NO_REPLY (fatal)                                  |
339|              | - standard error                                      |
340+--------------+-------------------------------------------------------+
341
342message fields:
343
344- "team": The application team (team_id).
345- "signature": The application's new signature.
346
347error reply fields:
348
349- "error":
350
351  - B_BAD_VALUE: A request message field is missing or contains an
352    invalid value.
353  - B_REG_APP_NOT_REGISTERED: The team does not identify a registered
354    application.
355  - ...
356
357get an app info (BRoster::Get{Running,Active,}AppInfo())
358........................................................
359
360+--------------+-------------------------------------------------------+
361| target       | roster                                                |
362+--------------+-------------------------------------------------------+
363| message      | B_REG_GET_APP_INFO                                    |
364|              |                                                       |
365| 	       | [ "team":			B_INT32_TYPE           |
366| 	       |  | "ref":			B_REF_TYPE             |
367| 	       |  | "signature":	B_STRING_TYPE ]                |
368+--------------+-------------------------------------------------------+
369| reply        | standard success                                      |
370|              |                                                       |
371| 	       | - "app_info":	B_REG_APP_INFO_TYPE                    |
372+--------------+-------------------------------------------------------+
373| on error     | - B_NO_REPLY (fatal)                                  |
374|              | - standard error                                      |
375+--------------+-------------------------------------------------------+
376
377message fields:
378
379- "team": The application team (team_id).
380- "ref": An entry_ref to the application executable.
381- "signature": The application signature.
382- If both are omitted the active application is referred to.
383
384reply fields:
385
386- "app_info": The requested app_info (flat_app_info).
387
388error reply fields:
389
390- "error":
391
392  - B_BAD_VALUE: A request message field is missing or contains an
393    invalid value.
394  - B_BAD_TEAM_ID: The supplied team ID does not identify a registered
395    application.
396  - B_ERROR:
397
398    - An entry_ref or a signature has been supplied and no such application
399      is currently running.
400    - No team ID has been supplied and currently there is no active
401      application.
402
403  - ...
404
405get an app list (BRoster::GetAppList())
406.......................................
407
408+--------------+-------------------------------------------------------+
409| target       | roster                                                |
410+--------------+-------------------------------------------------------+
411| message      | B_REG_GET_APP_LIST                                    |
412|              |                                                       |
413|              | - [ "signature":	B_STRING_TYPE ]                |
414+--------------+-------------------------------------------------------+
415| reply        | standard success                                      |
416|              |                                                       |
417|              | - "teams":	B_INT32_TYPE[]                         |
418+--------------+-------------------------------------------------------+
419| on error     | - B_NO_REPLY (fatal)                                  |
420|              | - standard error                                      |
421+--------------+-------------------------------------------------------+
422
423message fields:
424
425- "signature": The application signature.
426
427reply fields:
428
429- "teams": The requested list of team IDs (team_id).
430
431error reply fields:
432
433- "error":
434
435  - B_BAD_VALUE: A request message field is missing or contains an
436    invalid value.
437  - ...
438
439activate an app (BRoster::ActivateApp())
440........................................
441
442+--------------+-------------------------------------------------------+
443| target       | roster                                                |
444+--------------+-------------------------------------------------------+
445| message      | B_REG_ACTIVATE_APP                                    |
446|              |                                                       |
447|              | "team":	B_INT32_TYPE                           |
448+--------------+-------------------------------------------------------+
449| reply        | standard success                                      |
450+--------------+-------------------------------------------------------+
451| on error     | - B_NO_REPLY (fatal)                                  |
452|              | - standard error                                      |
453+--------------+-------------------------------------------------------+
454
455message fields:
456
457- "team": The application team (team_id).
458
459error reply fields:
460
461- "error":
462
463  - B_BAD_VALUE: A request message field is missing or contains an
464    invalid value.
465  - B_BAD_TEAM_ID: The supplied team ID does not identify a registered
466    application.
467  - ...
468
469broadcast a message (BRoster::Broadcast())
470..........................................
471
472+--------------+-------------------------------------------------------+
473| target       | roster                                                |
474+--------------+-------------------------------------------------------+
475| message      | B_REG_BROADCAST                                       |
476|              |                                                       |
477| 	       | - "team":			B_INT32_TYPE           |
478| 	       | - "message":		B_MESSAGE_TYPE                 |
479| 	       | - "reply_target":	B_MESSENGER_TYPE               |
480+--------------+-------------------------------------------------------+
481| reply        | standard success                                      |
482+--------------+-------------------------------------------------------+
483| on error     | - B_NO_REPLY (fatal)                                  |
484|              | - standard error                                      |
485+--------------+-------------------------------------------------------+
486
487message fields:
488
489- "team": The requesting team (team_id).
490- "message": The message to be broadcast.
491- "reply_target": The reply target for the message.
492
493error reply fields:
494
495- "error":
496
497  - B_BAD_VALUE: A request message field is missing or contains an
498    invalid value.
499  - ...
500
501start roster watching (BRoster::StartWatching())
502................................................
503
504+--------------+-------------------------------------------------------+
505| target       | roster                                                |
506+--------------+-------------------------------------------------------+
507| message      | B_REG_START_WATCHING                                  |
508|              |                                                       |
509| 	       | - "target":	B_MESSENGER_TYPE                       |
510| 	       | - "events":	B_INT32_TYPE                           |
511+--------------+-------------------------------------------------------+
512| reply        | standard success                                      |
513+--------------+-------------------------------------------------------+
514| on error     | - B_NO_REPLY (fatal)                                  |
515|              | - standard error                                      |
516+--------------+-------------------------------------------------------+
517
518message fields:
519
520- "target": The target the event messages shall be sent to.
521- "events": Specifies the events the caller is interested in (uint32).
522
523error reply fields:
524
525- "error":
526
527  - B_BAD_VALUE: A request message field is missing or contains an
528    invalid value.
529  - ...
530
531stop roster watching (BRoster::StopWatching())
532..............................................
533
534+--------------+-------------------------------------------------------+
535| target       | roster                                                |
536+--------------+-------------------------------------------------------+
537| message      | B_REG_STOP_WATCHING                                   |
538|              |                                                       |
539|              | - "target":	B_MESSENGER_TYPE                       |
540+--------------+-------------------------------------------------------+
541| reply        | standard success                                      |
542+--------------+-------------------------------------------------------+
543| on error     | - B_NO_REPLY (fatal)                                  |
544|              | - standard error                                      |
545+--------------+-------------------------------------------------------+
546
547message fields:
548
549- "target": The target that shall not longer receive any event messages.
550
551error reply fields:
552
553- "error":
554
555  - B_BAD_VALUE: A request message field is missing or contains an
556    invalid value.
557  - ...
558
559MIME Database Requests
560----------------------
561
562install a mime type (BMimeType::Install())
563..........................................
564
565+--------------+-------------------------------------------------------+
566| target       | mime manager (BRoster::fMimeMess)                     |
567+--------------+-------------------------------------------------------+
568| message      | B_REG_MIME_INSTALL                                    |
569|              |                                                       |
570|              | - "type": B_STRING_TYPE                               |
571+--------------+-------------------------------------------------------+
572| reply        | standard general result                               |
573+--------------+-------------------------------------------------------+
574
575message fields:
576
577- "type": The mime type
578
579reply fields:
580
581- "result":
582
583  - B_OK: success
584  - B_FILE_EXISTS: the type is already installed
585  - ...
586
587remove a mime type (BMimeType::Delete())
588........................................
589
590+--------------+-------------------------------------------------------+
591| target       | mime manager (BRoster::fMimeMess)                     |
592+--------------+-------------------------------------------------------+
593| message      | B_REG_MIME_DELETE                                     |
594|              |                                                       |
595|              | - "type": B_STRING_TYPE                               |
596+--------------+-------------------------------------------------------+
597| reply        | standard general result                               |
598+--------------+-------------------------------------------------------+
599
600message fields:
601
602- "type": The mime type
603
604reply fields:
605
606- "result":
607
608  - B_OK: success
609  - B_ENTRY_NOT_FOUND: the type was not found
610  - (other error code): failure
611
612set a specific attribute of a mime type (BMimeType::Set*()), installing if necessary
613....................................................................................
614
615+--------------+-------------------------------------------------------+
616| target       | mime manager (BRoster::fMimeMess)                     |
617+--------------+-------------------------------------------------------+
618| message      | B_REG_MIME_SET_PARAM                                  |
619|              |                                                       |
620| 	       | - "type": B_STRING_TYPE                               |
621| 	       | - "which": B_INT32_TYPE                               |
622| 	       | - [ additional fields depending upon the "which"      |
623|              |   field (see below) ]                                 |
624+--------------+-------------------------------------------------------+
625| reply        | standard general result                               |
626+--------------+-------------------------------------------------------+
627
628message fields:
629
630- "type": The mime type
631- "which": Which attribute to set. May be one of the following:
632
633+---------------------------+-------------------------------+-----------------------------------+
634| "which"                   | additional message fields     | field comments                    |
635+===========================+===============================+===================================+
636| B_REG_MIME_ICON           | "icon data": B_RAW_TYPE,      |  B_CMAP8 bitmap data only         |
637|                           +-------------------------------+-----------------------------------+
638|                           | "icon size": B_INT32_TYPE     | B_{MINI,LARGE}_ICON or -1 for flat|
639|                           |                               | vector icon data                  |
640+---------------------------+-------------------------------+-----------------------------------+
641| B_REG_MIME_PREFERRED_APP  | "signature": B_STRING_TYPE    |                                   |
642|                           +-------------------------------+-----------------------------------+
643|                           | "app verb": B_INT32_TYPE      |                                   |
644+---------------------------+-------------------------------+-----------------------------------+
645| B_REG_MIME_ATTR_INFO      | "attr info": B_MESSAGE_TYPE   |                                   |
646+---------------------------+-------------------------------+-----------------------------------+
647| B_REG_MIME_FILE_EXTENSIONS| "extensions": B_MESSAGE_TYPE  |                                   |
648+---------------------------+-------------------------------+-----------------------------------+
649| B_REG_MIME_DESCRIPTION    | "long": B_BOOL_TYPE,          |                                   |
650|                           +-------------------------------+-----------------------------------+
651|                           | "description": B_STRING_TYPE  |                                   |
652+---------------------------+-------------------------------+-----------------------------------+
653| B_REG_MIME_SNIFFER_RULE   | "sniffer rule": B_STRING_TYPE |                                   |
654+---------------------------+-------------------------------+-----------------------------------+
655| B_REG_MIME_APP_HINT       | "app hint": B_REF_TYPE        |                                   |
656+---------------------------+-------------------------------+-----------------------------------+
657| B_REG_MIME_ICON_FOR_TYPE  | "file type": B_STRING_TYPE,   |                                   |
658|                           +-------------------------------+-----------------------------------+
659|                           | "icon data": B_RAW_TYPE,      |                                   |
660|                           +-------------------------------+-----------------------------------+
661|                           | "icon size": B_INT32_TYPE     |                                   |
662+---------------------------+-------------------------------+-----------------------------------+
663| B_REG_MIME_SUPPORTED_TYPES| "types": B_MESSAGE_TYPE       |                                   |
664+---------------------------+-------------------------------+-----------------------------------+
665
666reply fields:
667
668- "result":
669
670  - B_OK: success
671  - (error code): failure
672
673delete a specific attribute of a mime type (BMimeType::Delete*()),
674..................................................................
675
676+--------------+-------------------------------------------------------+
677| target       | mime manager (BRoster::fMimeMess)                     |
678+--------------+-------------------------------------------------------+
679| message      | B_REG_MIME_DELETE_PARAM                               |
680|              |                                                       |
681| 	       | - "type": B_STRING_TYPE                               |
682| 	       | - "which": B_INT32_TYPE                               |
683| 	       | - [ additional fields depending upon the "which"      |
684|              |   field (see below) ]                                 |
685+--------------+-------------------------------------------------------+
686| reply        | standard general result                               |
687+--------------+-------------------------------------------------------+
688
689message fields:
690
691- "type": The mime type
692- "which": Which attribute to delete. May be one of the following:
693
694+---------------------------+-------------------------------+-----------------------------------+
695| "which"                   | additional message fields     | field comments                    |
696+===========================+===============================+===================================+
697| B_REG_MIME_ICON:	    | "icon size": B_INT32_TYPE     | B_{MINI,LARGE}_ICON or -1 for     |
698|                           |                               | vector icon data                  |
699+---------------------------+-------------------------------+-----------------------------------+
700| B_REG_MIME_PREFERRED_APP  | "app verb": B_INT32_TYPE      |                                   |
701+---------------------------+-------------------------------+-----------------------------------+
702| B_REG_MIME_ATTR_INFO      |                               |                                   |
703+---------------------------+-------------------------------+-----------------------------------+
704| B_REG_MIME_FILE_EXTENSIONS|                               |                                   |
705+---------------------------+-------------------------------+-----------------------------------+
706| B_REG_MIME_DESCRIPTION    | "long": B_BOOL_TYPE           |                                   |
707+---------------------------+-------------------------------+-----------------------------------+
708| B_REG_MIME_SNIFFER_RULE   |                               |                                   |
709+---------------------------+-------------------------------+-----------------------------------+
710| B_REG_MIME_APP_HINT       |                               |                                   |
711+---------------------------+-------------------------------+-----------------------------------+
712| B_REG_MIME_ICON_FOR_TYPE  | "file type": B_STRING_TYPE,   |                                   |
713|                           +-------------------------------+-----------------------------------+
714|                           | "icon size": B_INT32_TYPE     |                                   |
715+---------------------------+-------------------------------+-----------------------------------+
716| B_REG_MIME_SUPPORTED_TYPES|                               |                                   |
717+---------------------------+-------------------------------+-----------------------------------+
718
719reply fields:
720
721- "result":
722
723  - B_OK: success
724  - B_ENTRY_NOT_FOUND: no such attribute exists, or the type is not installed
725  - (other error code): failure
726
727subscribe a BMessenger to the MIME monitor service (BMimeType::StartWatching())
728...............................................................................
729
730+--------------+-------------------------------------------------------+
731| target       | mime manager (BRoster::fMimeMess)                     |
732+--------------+-------------------------------------------------------+
733| message      | B_REG_MIME_START_WATCHING                             |
734|              |                                                       |
735| 	       | "target": B_MESSENGER_TYPE                            |
736+--------------+-------------------------------------------------------+
737| reply        | standard general result                               |
738+--------------+-------------------------------------------------------+
739
740message fields:
741
742- "target": The BMessenger subscribing to the monitor service
743
744reply fields:
745
746- "result":
747
748  - B_OK: success
749  - (error code): failure
750
751unsubscribe a BMessenger from the MIME monitor service (BMimeType::StopWatching())
752..................................................................................
753
754+--------------+-------------------------------------------------------+
755| target       | mime manager (BRoster::fMimeMess)                     |
756+--------------+-------------------------------------------------------+
757| message      | B_REG_MIME_STOP_WATCHING                              |
758|              |                                                       |
759|              | "target": B_MESSENGER_TYPE                            |
760+--------------+-------------------------------------------------------+
761| reply        | standard general result                               |
762+--------------+-------------------------------------------------------+
763
764message fields:
765
766- "target": The BMessenger unsubscribing from the monitor service
767
768reply fields:
769
770- "result":
771
772  - B_OK: success
773  - B_ENTRY_NOT_FOUND: the given BMessenger was not subscribed to the service
774  - (other error code): failure
775
776perform an update_mime_info() call
777..................................
778
779+--------------+-------------------------------------------------------+
780| target       | mime manager (BRoster::fMimeMess)                     |
781+--------------+-------------------------------------------------------+
782| message      | B_REG_MIME_UPDATE_MIME_INFO                           |
783|              |                                                       |
784|	       | - "entry": B_REF_TYPE                                 |
785|	       | - "recursive": B_BOOLEAN_TYPE                         |
786|	       | - "synchronous": B_BOOLEAN_TYPE                       |
787|	       | - "force": B_INT32_TYPE                               |
788+--------------+-------------------------------------------------------+
789| reply        | standard general result                               |
790+--------------+-------------------------------------------------------+
791
792message fields:
793
794- "entry": The base entry to update.
795- "recursive": If true and "entry" is a directory, update all entries
796  below "entry" in the hierarchy.
797- "synchronous": If true, the call will block until the operation is
798  completed. If false, the call will return immediately and the operation
799  will run asynchronously in another thread.
800- "force": Specifies how to handle entries for which a BEOS:TYPE attribute
801  already exists. Valid values are
802  B_UPDATE_MIME_INFO_{NO_FORCE, FORCE_KEEP_TYPE, FORCE_UPDATE_ALL}.
803
804reply fields:
805
806- "result":
807
808  - B_OK: The asynchronous update_mime_info() call has been successfully
809          started (and may still be running).
810  - (error code): failure
811
812perform a create_app_meta_mime() call
813.....................................
814
815+--------------+-------------------------------------------------------+
816| target       | mime manager (BRoster::fMimeMess)                     |
817+--------------+-------------------------------------------------------+
818| message      | B_REG_MIME_CREATE_APP_META_MIME                       |
819|              |                                                       |
820|	       | - "entry": B_REF_TYPE                                 |
821|	       | - "recursive": B_BOOLEAN_TYPE                         |
822|	       | - "synchronous": B_BOOLEAN_TYPE                       |
823|	       | - "force": B_INT32_TYPE                               |
824+--------------+-------------------------------------------------------+
825| reply        | standard general result                               |
826+--------------+-------------------------------------------------------+
827
828message fields:
829
830- "entry": The base entry to update.
831- "recursive": If true and "entry" is a directory, update all entries
832  below "entry" in the hierarchy.
833- "synchronous": If true, the call will block until the operation is
834  completed. If false, the call will return immediately and the operation
835  will run asynchronously in another thread.
836- "force": If != 0, also update entries for which meta app information
837  already exists.
838
839reply fields:
840
841- "result":
842
843  - B_OK: The asynchronous update_mime_info() call has been successfully
844          started (and may still be running).
845  - (error code): failure
846
847notify the thread manager to perform a clean up run
848...................................................
849
850+--------------+-----------------------------------------------------------------------------+
851| target       | thread manager/mime manager (MIMEManager::fThreadManager/BRoster::fMimeMess)|
852+--------------+-----------------------------------------------------------------------------+
853| message      | B_REG_MIME_UPDATE_THREAD_FINISHED                                           |
854+--------------+-----------------------------------------------------------------------------+
855| reply        | none (message should be sent asynchronously)                                |
856+--------------+-----------------------------------------------------------------------------+
857
858Message Runner Requests
859-----------------------
860
861message runner registration (BMessageRunner::InitData())
862........................................................
863
864+--------------+-------------------------------------------------------+
865| target       | roster                                                |
866+--------------+-------------------------------------------------------+
867| message      | B_REG_REGISTER_MESSAGE_RUNNER                         |
868|              |                                                       |
869|              | - "team":			   B_INT32_TYPE        |
870|              | - "target":			B_MESSENGER_TYPE       |
871|              | - "message":				B_MESSAGE_TYPE |
872|              | - "interval":				B_INT64_TYPE   |
873|              | - "count":				B_INT32_TYPE   |
874|              | - "reply_target":		   B_MESSENGER_TYPE    |
875+--------------+-------------------------------------------------------+
876| reply        | standard success                                      |
877|              |                                                       |
878|              | - "token":				B_INT32_TYPE   |
879+--------------+-------------------------------------------------------+
880| on error:    | - B_NO_REPLY (fatal)                                  |
881|              | - standard error                                      |
882+--------------+-------------------------------------------------------+
883
884message fields:
885
886- "team": ID of the team owning the BMessageRunner (team_id).
887- "target": The message target.
888- "message": The message to be sent to the target.
889- "interval": Period of time before the first message is sent and between
890  messages (if more than one shall be sent) in microseconds.
891- "count": Specifies how many times the message shall be sent.
892  A value less than 0 for an unlimited number of repetitions.
893- "reply_target": Target replies to the delivered message(s) shall be sent to.
894
895reply fields:
896
897- "token": Unique token identifying the message runner.
898
899error reply fields:
900
901- "error":
902
903  - B_BAD_VALUE: A request message field is missing or contains an
904    invalid value.
905  - ...
906
907message runner unregistration (BMessageRunner::~BMessageRunner())
908.................................................................
909
910+--------------+-------------------------------------------------------+
911| target       | roster                                                |
912+--------------+-------------------------------------------------------+
913| message:     | B_REG_UNREGISTER_MESSAGE_RUNNER                       |
914|              |                                                       |
915|              | - "token":				B_INT32_TYPE   |
916+--------------+-------------------------------------------------------+
917| reply        | standard success                                      |
918+--------------+-------------------------------------------------------+
919| on error:    | - B_NO_REPLY (fatal)                                  |
920|              | - standard error                                      |
921+--------------+-------------------------------------------------------+
922
923message fields:
924
925- "token": Unique token identifying the message runner. Returned by the
926  B_REG_REGISTER_MESSAGE_RUNNER request.
927
928error reply fields:
929
930- "error":
931
932  - B_BAD_VALUE: A request message field is missing or contains an
933    invalid value.
934  - ...
935
936set message runner parameters (BMessageRunner::SetParams())
937...........................................................
938
939+--------------+-------------------------------------------------------+
940| target       | roster                                                |
941+--------------+-------------------------------------------------------+
942| message      | B_REG_SET_MESSAGE_RUNNER_PARAMS                       |
943|              |                                                       |
944|              | - "token":				B_INT32_TYPE   |
945|              | - [ "interval":			B_INT64_TYPE ] |
946|              | - [ "count":				B_INT32_TYPE ] |
947+--------------+-------------------------------------------------------+
948| reply        | standard success                                      |
949+--------------+-------------------------------------------------------+
950| on error:    | - B_NO_REPLY (fatal)                                  |
951|              | - standard error                                      |
952+--------------+-------------------------------------------------------+
953
954message fields:
955
956- "token": Unique token identifying the message runner. Returned by the
957  B_REG_REGISTER_MESSAGE_RUNNER request.
958- "interval": Period of time before the first message is sent and between
959  messages (if more than one shall be sent) in microseconds.
960- "count": Specifies how many times the message shall be sent.
961  A value less than 0 for an unlimited number of repetitions.
962
963error reply fields:
964
965- "error":
966
967  - B_BAD_VALUE: A request message field is missing or contains an
968    invalid value.
969  - ...
970
971get message runner info (BMessageRunner::InitData())
972....................................................
973
974+--------------+-------------------------------------------------------+
975| target       | roster                                                |
976+--------------+-------------------------------------------------------+
977| message:     | B_REG_GET_MESSAGE_RUNNER_INFO                         |
978|              |                                                       |
979|              | - "token":				B_INT32_TYPE   |
980+--------------+-------------------------------------------------------+
981| reply        | standard success                                      |
982|              |                                                       |
983|              | - "interval":				B_INT64_TYPE   |
984|              | - "count":				B_INT32_TYPE   |
985+--------------+-------------------------------------------------------+
986| on error:    | - B_NO_REPLY (fatal)                                  |
987|              | - standard error                                      |
988+--------------+-------------------------------------------------------+
989
990message fields:
991
992- "token": Unique token identifying the message runner. Returned by the
993  B_REG_REGISTER_MESSAGE_RUNNER request.
994
995reply fields:
996
997- "interval": Period of time before the first message is sent and between
998  messages (if more than one shall be sent) in microseconds.
999- "count": Specifies how many times the message still has to be sent.
1000  A value less than 0 for an unlimited number of repetitions.
1001
1002error reply fields:
1003
1004- "error":
1005
1006  - B_BAD_VALUE: A request message field is missing or contains an
1007    invalid value.
1008  - ...
1009
1010Clipboard Handler Requests
1011--------------------------
1012
1013add new clipboard to system (BClipboard::BClipboard())
1014......................................................
1015
1016+--------------+-------------------------------------------------------+
1017| target       | clipboard handler                                     |
1018+--------------+-------------------------------------------------------+
1019| message      | B_REG_ADD_CLIPBOARD                                   |
1020|              |                                                       |
1021|              | - "name":			      B_STRING_TYPE    |
1022+--------------+-------------------------------------------------------+
1023| reply        | standard general result                               |
1024+--------------+-------------------------------------------------------+
1025
1026message fields:
1027
1028- "name": Name used to identify the particular clipboard to add
1029
1030reply fields:
1031
1032- "result":
1033
1034  - B_OK: success
1035  - B_BAD_VALUE: name field was not specified in message
1036
1037get clipboard write count (BClipboard::GetSystemCount())
1038........................................................
1039
1040+--------------+-------------------------------------------------------+
1041| target       | clipboard handler                                     |
1042+--------------+-------------------------------------------------------+
1043| message      | B_REG_GET_CLIPBOARD_COUNT                             |
1044|              |                                                       |
1045|              | - "name":				 B_STRING_TYPE |
1046+--------------+-------------------------------------------------------+
1047| reply        | standard general result                               |
1048|              |                                                       |
1049|              | - "count":				B_INT32_TYPE   |
1050+--------------+-------------------------------------------------------+
1051
1052message fields:
1053
1054- "name": Name used to identify the particular clipboard
1055
1056reply fields:
1057
1058- "result":
1059
1060  - B_OK: success
1061  - B_BAD_VALUE: no name / no valid name specified in message
1062
1063- "count":
1064
1065  - number of times this clipboard has been written to
1066
1067start watching clipboard (BClipboard::StartWatching())
1068......................................................
1069
1070+--------------+-------------------------------------------------------+
1071| target       | clipboard handler                                     |
1072+--------------+-------------------------------------------------------+
1073| message      | B_REG_CLIPBOARD_START_WATCHING                        |
1074|              |                                                       |
1075|              | - "name":				 B_STRING_TYPE |
1076|              | - "target":			      B_MESSENGER_TYPE |
1077+--------------+-------------------------------------------------------+
1078| reply        | standard general result                               |
1079+--------------+-------------------------------------------------------+
1080
1081message fields:
1082
1083- "name": Name used to identify the particular clipboard
1084- "target": Messenger pointing to the target to notify
1085
1086reply fields:
1087
1088- "result":
1089
1090  - B_OK: success
1091  - B_BAD_VALUE: no name / no valid name specified in message
1092  		 no target specified
1093
1094stop watching clipboard (BClipboard::StopWatching())
1095....................................................
1096
1097+--------------+-------------------------------------------------------+
1098| target       | clipboard handler                                     |
1099+--------------+-------------------------------------------------------+
1100| message      | B_REG_CLIPBOARD_STOP_WATCHING                         |
1101|              |                                                       |
1102|              | - "name":				 B_STRING_TYPE |
1103|              | - "target":			      B_MESSENGER_TYPE |
1104+--------------+-------------------------------------------------------+
1105| reply        | standard general result                               |
1106+--------------+-------------------------------------------------------+
1107
1108message fields:
1109
1110- "name": Name used to identify the particular clipboard
1111- "target": Messenger pointing to the target to remove from the notify list
1112
1113reply fields:
1114
1115- "result":
1116
1117  - B_OK: success
1118  - B_BAD_VALUE: no name / no valid name specified in message / no target specified
1119
1120download clipboard data (BClipboard::DownloadFromSystem())
1121..........................................................
1122
1123+--------------+-------------------------------------------------------+
1124| target       | clipboard handler                                     |
1125+--------------+-------------------------------------------------------+
1126| message      | B_REG_DOWNLOAD_CLIPBOARD                              |
1127|              |                                                       |
1128|              | "name":				B_STRING_TYPE  |
1129+--------------+-------------------------------------------------------+
1130| reply        | standard general result                               |
1131|              |                                                       |
1132|              | - "data":			      B_MESSAGE_TYPE   |
1133|              | - "data source":		      B_MESSENGER_TYPE |
1134|              | - "count":				B_INT32_TYPE   |
1135+--------------+-------------------------------------------------------+
1136
1137message fields:
1138
1139- "name": Name used to identify the particular clipboard
1140
1141reply fields:
1142
1143- "result":
1144
1145  - B_OK: success
1146  - B_BAD_VALUE: no name / no valid name specified in message
1147    no target specified
1148
1149- "data": message with Data fields containing the contents of the clipboard
1150- "data source": messenger to the be_app_messenger of the application which last wrote data
1151- "count": number of times this clipboard has been written to
1152
1153upload clipboard data (BClipboard::UploadToSystem())
1154....................................................
1155
1156+--------------+-------------------------------------------------------+
1157| target       | clipboard handler                                     |
1158+--------------+-------------------------------------------------------+
1159| message      | B_REG_UPLOAD_CLIPBOARD                                |
1160|              |                                                       |
1161|	       | "name":			   B_STRING_TYPE       |
1162|	       | "data":			   B_MESSAGE_TYPE      |
1163|	       | "data source":			   B_MESSENGER_TYPE    |
1164+--------------+-------------------------------------------------------+
1165| reply        | standard general result                               |
1166|              |                                                       |
1167|              | - "count":				B_INT32_TYPE   |
1168+--------------+-------------------------------------------------------+
1169
1170message fields:
1171
1172- "name": Name used to identify the particular clipboard
1173- "data": message with Data fields containing the contents of the clipboard
1174- "data source": messenger to the be_app_messenger of the application which last wrote data
1175
1176reply fields:
1177
1178- "result":
1179
1180  - B_OK: success
1181  - B_BAD_VALUE: no name / no valid name specified in message / no target specified
1182
1183- "count":
1184
1185  - number of times this clipboard has been written to
1186
1187Disk Device Requests
1188--------------------
1189
1190get next disk device
1191....................
1192
1193+--------------+-------------------------------------------------------+
1194| target       | disk device manager                                   |
1195+--------------+-------------------------------------------------------+
1196| message      | B_REG_NEXT_DISK_DEVICE                                |
1197|              |                                                       |
1198|              | - "cookie":				B_INT32_TYPE   |
1199+--------------+-------------------------------------------------------+
1200| reply        | standard general result                               |
1201|              |                                                       |
1202|              | - "device":				B_MESSAGE_TYPE |
1203|              | - "cookie":				B_INT32_TYPE   |
1204+--------------+-------------------------------------------------------+
1205
1206message fields:
1207
1208- "cookie": An iteration cookie. Initially 0.
1209
1210reply fields:
1211
1212- "device": Archived BDiskDevice info.
1213- "cookie": Next value for the iteration cookie.
1214- "result":
1215
1216  - B_BAD_VALUE: A request message field is missing or contains an
1217    invalid value.
1218  - B_ENTRY_NOT_FOUND: Iteration finished.
1219  - ...
1220
1221get disk device
1222...............
1223
1224+--------------+-------------------------------------------------------+
1225| target       | disk device manager                                   |
1226+--------------+-------------------------------------------------------+
1227| message      | B_REG_GET_DISK_DEVICE                                 |
1228|              |                                                       |
1229|              | - "device_id":			B_INT32_TYPE           |
1230|              | - | "session_id":			B_INT32_TYPE   |
1231|              | - | "partition_id":		B_INT32_TYPE           |
1232+--------------+-------------------------------------------------------+
1233| reply        | standard general result                               |
1234|              |                                                       |
1235|              | - "device":				B_MESSAGE_TYPE |
1236+--------------+-------------------------------------------------------+
1237
1238message fields:
1239
1240- "device_id": ID of the device to be retrieved.
1241- "session_id": ID of session whose device shall be retrieved.
1242- "partition_id": ID of partition whose device shall be retrieved.
1243
1244reply fields:
1245
1246- "device": Archived BDiskDevice info.
1247- "result":
1248
1249  - B_BAD_VALUE: A request message field is missing or contains an
1250    invalid value.
1251  - B_ENTRY_NOT_FOUND: A device/session/partition with that ID could not
1252  	be found.
1253  - ...
1254
1255update disk device
1256..................
1257
1258+--------------+-------------------------------------------------------+
1259| target       | disk device manager                                   |
1260+--------------+-------------------------------------------------------+
1261| message      | B_REG_UPDATE_DISK_DEVICE                              |
1262|              |                                                       |
1263|              | - "device_id":			B_INT32_TYPE           |
1264|              | - | "session_id":			B_INT32_TYPE   |
1265|              | - | "partition_id":		B_INT32_TYPE           |
1266|              | - "change_counter":		B_INT32_TYPE           |
1267|              | - "update_policy":		B_INT32_TYPE           |
1268+--------------+-------------------------------------------------------+
1269| reply        | standard general result                               |
1270|              |                                                       |
1271|              | - "up_to_date":			B_BOOLEAN_TYPE |
1272|              | - [ "device":			B_MESSAGE_TYPE ]       |
1273+--------------+-------------------------------------------------------+
1274
1275message fields:
1276
1277- "device_id": ID of the device to be retrieved.
1278- "session_id": ID of session whose device shall be retrieved.
1279- "partition_id": ID of partition whose device shall be retrieved.
1280- "change_counter": Change counter of the object (or device in case of
1281  B_REG_DEVICE_UPDATE_DEVICE_CHANGED update policy) in question.
1282- "update_policy": (uint32)
1283
1284  - B_REG_DEVICE_UPDATE_CHECK: Check only, if the object is up to date.
1285  - B_REG_DEVICE_UPDATE_CHANGED: Update only, if the object has changed.
1286  - B_REG_DEVICE_UPDATE_DEVICE_CHANGED: Update, if the device has changed, even
1287    if the partition/session has not.
1288
1289  The latter two have the same semantics, if the object is a device.
1290
1291reply fields:
1292
1293- "up_to_date": true, if the object (and for
1294  B_REG_DEVICE_UPDATE_DEVICE_CHANGED also the device) is already up to date,
1295  false otherwise.
1296- "device": Archived BDiskDevice info.
1297- "result":
1298
1299  - B_BAD_VALUE: A request message field is missing or contains an
1300    invalid value.
1301  - B_ENTRY_NOT_FOUND: A device/session/partition with that ID could not
1302    be found.
1303  - ...
1304
1305start disk device watching
1306..........................
1307
1308+--------------+-------------------------------------------------------+
1309| target       | disk device manager                                   |
1310+--------------+-------------------------------------------------------+
1311| message      | B_REG_DEVICE_START_WATCHING                           |
1312|              |                                                       |
1313|              | - "target":	B_MESSENGER_TYPE                       |
1314|              | - "events":	B_INT32_TYPE                           |
1315+--------------+-------------------------------------------------------+
1316| reply        | standard general result                               |
1317+--------------+-------------------------------------------------------+
1318| on error     | - B_NO_REPLY (fatal)                                  |
1319|              | - standard error                                      |
1320+--------------+-------------------------------------------------------+
1321
1322message fields:
1323
1324- "target": The target the event messages shall be sent to.
1325- "events": Specifies the events the caller is interested in (uint32).
1326- "result":
1327
1328  - B_BAD_VALUE: A request message field is missing or contains an
1329    invalid value.
1330  - ...
1331
1332stop disk device watching
1333.........................
1334
1335+--------------+-------------------------------------------------------+
1336| target       | disk device manager                                   |
1337+--------------+-------------------------------------------------------+
1338| message      | B_REG_DEVICE_STOP_WATCHING                            |
1339|              |                                                       |
1340|              | - "target":	B_MESSENGER_TYPE                       |
1341+--------------+-------------------------------------------------------+
1342| reply        | standard general result                               |
1343+--------------+-------------------------------------------------------+
1344| on error     | - B_NO_REPLY (fatal)                                  |
1345|              | - standard error                                      |
1346+--------------+-------------------------------------------------------+
1347
1348message fields:
1349
1350- "target": The target that shall not longer receive any event messages.
1351- "result":
1352
1353  - B_BAD_VALUE: A request message field is missing or contains an
1354    invalid value.
1355  - ...
1356