Protocol-A.texi 86 KB
 David Byers committed Jan 13, 1996 1 \input texinfo @c -*-texinfo-*-  David Byers committed Jul 27, 1996 2 @c $Id: Protocol-A.texi,v 1.4 1996/07/27 11:43:04 byers Exp$  David Byers committed Jan 13, 1996 3 4 5 6 7 8 9 @c %**start of header @setfilename protocol-a.info @settitle LysKOM Protocol A @setchapternewpage odd @c %**end of header @iftex @parindent 0pt  David Byers committed Jul 27, 1996 10 @font@tensltt=cmsltt10  David Byers committed Jun 14, 1996 11 12 13 14 15 @begin tex \global\def\rett#1{{\let\t\sltt\tt #1}} \global\def\sltt#1{{\fam\ttfam\tensltt\let\t\rett #1}} \global\let\t\sltt @end tex  David Byers committed Jan 13, 1996 16 17 18 @end iftex @ifinfo  David Byers committed Jun 14, 1996 19 This is the specification of LysKOM Protocol A v. 9.0  David Byers committed Jan 13, 1996 20   David Byers committed Jul 27, 1996 21 Copyright @copyright{} 1995, 1996 Lysator ACS.  David Byers committed Jan 13, 1996 22 23 24 25 26 27 28 29 30 31  Permission is granted to make and distribute verbatim copies of this specification provided the copyright notice and this permission notice are preserved on all copies. @end ifinfo @titlepage @sp 10 @title{LysKOM Protocol A} @sp 2  David Byers committed Jun 14, 1996 32 @subtitle{Protocol version 9.0}  David Byers committed Jan 13, 1996 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 @sp 2 @author by the LysKOM Developers @page @vskip 0pt plus 1filll Copyright @copyright{} 1995 Lysator ACS Permission is granted to make and distribute verbatim copies of this document provided the copyright notice and this permission notice are preserved on all copies. Modified versions of this document may be redistributed with the added condition that all modifications not cleared with the LysKOM development group are clearly marked and that the entire modified work be redistributed under the same conditions as the original. Permission is granted to copy and distribute translations of this manual into another language under the same conditions as for modified versions. @end titlepage @ifinfo @node Top, Overview, (dir), (dir) @comment node-name, next, previous, up  David Byers committed Jun 14, 1996 57 This document specifies LysKOM Protocol A, version 9.0  David Byers committed Jan 13, 1996 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78  @menu * Overview:: * Introduction:: * Data Types:: * Protocol Requests:: * Asynchronous Messages:: * Examples:: @end menu @end ifinfo @node Overview, Document Revision History, Top, Top @chapter Overview LysKOM is a conferencing system@footnote{Or in modern terms, enabling technology for Computer-Supported Cooperative Work (CSCW).}. Similar systems were QZ-KOM and PortaCOM@footnote{Also known as PottaKOM'' and BortaKOM.''}. The LysKOM system is copyrighted by Lysator Academic Computing Society and distributed under conditions of the GNU Public License. LysKOM and its documentation is provided as is'' without warranty of any kind.  David Byers committed Jun 14, 1996 79 This document specifies version 9.0 of protocol A used between a LysKOM client  David Byers committed Jan 13, 1996 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 and a LysKOM server. Anything described here as unspecified'' is liable to change in future protocol versions. This specification is the work of several people. The main contributors have been Per Cederqvist @code{}, @ifinfo Pär @end ifinfo @iftex P@"ar @end iftex Emanuelsson @code{}, Thomas Bellman @code{}, Lars Aronsson @code{}, David Byers @code{}, Linus Tolke @code{} and @ifinfo Kent Engström @end ifinfo @iftex Kent Eng@-str@"om@penalty-10000 @end iftex @code{}. The LysKOM developers can be reached by email to @code{lyskom@@lysator.liu.se}. @menu * Document Revision History:: * Protocol Revision History:: * Protocol Design Principles:: * Notation:: @end menu @node Document Revision History, Protocol Revision History, Overview, Overview @section Document Revision History @table @asis  David Byers committed Jun 14, 1996 116 117 118 119 @item 9.0: @i{In progress} Protocol version 9 is begin developed and this document needs to be updated.  David Byers committed Jan 13, 1996 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 @item 8.0: 1995-11-10 Protocol version 8 is being documented. This specification was translated to English and converted to Texinfo by David Byers. @item 7.1: 1995-01-08. Protocol and document revision history were added by Per Cederqvist. Outline mode was used to make the document more manageable. This version was distributed with lyskomd 1.7.1. @item 7.0: 1994-12-31. The first specification with a version number. All calls that had been added since 1991-06-25 were documented. Pell and Per Cederqvist did the deed. This version was distributed with lyskomd 1.7.0. @item 1993-05-19. Linus Tolke wrote comments for some calls that were without comments. @item 1992-07-06. Linus Tolke converted the document to ISO 8859-1. @item 1991-08-12. Per Cederqvist started using version control for documentation. @item 1991-06-25. Lars Aronsson documented the protocol that was in use at the time. @end table @node Protocol Revision History, Protocol Design Principles, Document Revision History, Overview @section Protocol Revision History  David Byers committed Jun 14, 1996 150 151 152 153 154 155 156 157 158 159 160 161 162 163 @subsection Protocol version 9.0 @table @asis @item Added Functionality @itemize @bullet @item 79=set-info: Can change server information. @item 80=accept-async: Can select asynchronous messages to receive. @item 81=query-async: Can query which messages are being send. @end itemize @end table  David Byers committed Jan 13, 1996 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 @subsection Protocol version 8.0 @table @asis @item Added Functionality @itemize @bullet @item 30=add-recipient: Can change recpt to cc_recpt and vice versa. @item 21=set-conf-type: Accepts Conf-Type and Extended-Conf-Type. @item 10=create-conf: Accepts Conf-Type and Extended-Conf-Type. @end itemize @item New Commands @itemize @bullet @item 77=set-last-read @item 78=get-uconf-stat @end itemize @end table @subsection Protocol version 7 (first implemented in lyskomd 1.7.0) @table @asis @item Added Functionality @itemize @bullet @item 53=send-message: Recipient can be a conference or a person. @end itemize @item New Commands @itemize @bullet @item 74=re-z-lookup @item 75=get_version_info @item 76=lookup_z_name @end itemize @item Other @itemize @bullet @item Det asynkrona meddelanded 1=i-am-off has been removed @end itemize @end table @subsection Protocol Version 6 (first implemented in lyskomd 1.4.0) @table @asis @item New Calls @itemize @bullet @item 67=lookup_person @item 68=lookup_conf @item 69=set_client_version @item 70=get_client_name @item 71=get_client_version @item 72=mark_text @item 73=unmark_text @end itemize @end table @subsection Protocol Version 5 (first implemented in lyskomd 1.3.0) @table @asis @item New Calls @itemize @bullet @item 65=re_lookup_person @item 66=re_lookup_conf @end itemize @end table @subsection Protocol Version 4 (first implemented in lyskomd 1.1.1) @table @asis @item New Calls @itemize @bullet @item 62=login @item 63=who_is_on_ident @item 64=get_session_info_ident @end itemize @end table @subsection Protocol Version 3 (first implemented in lyskomd 1.1.0) @table @asis @item New Calls @itemize @bullet @item 61=find_previous_text_no @item 60=find_next_text_no @item 59=create_anonymous_text @item 58=get_last_text @end itemize @end table @subsection Protocol Version 2 (first implemented in lyskomd 0.30.0) @table @asis @item New Calls @itemize @bullet @item 57=set_user_area @end itemize @end table @subsection Protocol Version 1 (first implemented in lyskomd 0.29.2) @table @asis @item New Calls All calls from 0--56. @end table @node Protocol Design Principles, Notation, Protocol Revision History, Overview @section Transport Protocol Requirements LysKOM protocol A can be run on top of any reliable, bidirectional, 8-bit data stream. All current implementations use TCP/IP. At Lysator port 4894 is used on the host @code{kom.lysator.liu.se}. Data in protocol A is ASCII clear text except within hollerith strings, where arbitrary eight-bit characters are allowed. Data arguments are separated by whitespace. The reason for this unorthodox design is that the protocol should be usable from a text-only terminal, something that is very useful during server and early client development. @node Notation, , Protocol Design Principles, Overview @section Notation This specification uses a BNF-like grammar to describe the protocol and its data elements. It does not use ASN.1 because we don't know ASN.1 and probably wouldn't like it very much even if we did. Data fields have been given names that start with a lower-case letter. Data types have names that start with an upper-case letter. The operator @code{::=} defines the name to its left and @code{:} (a colon) specifies a type. Comments start with @code{!} (exclamation mark) and alternatives are separated by a @code{|} (vertical bar.) A @code{;} (semicolon) terminates statements in the grammar. In some specifications there are literal strings. There is to be no whitespace before or after literal strings unless there is whitespace in the literal itself. @node Introduction, , , Top @chapter Introduction This chapter introduces the concepts used in LysKOM, such as articles, conferences and sessions. @menu * Articles :: * Conferences :: * Persons and Sessions :: * The Misc-Info List :: * Security :: * Membership and Reading:: * Client-Server Dialog :: @end menu @node Articles, Conferences, , Introduction @section Articles An article is represented as a value of the type @code{Text-Stat} and a string containing the article contents. An article will usually have one or more recipients and may be a comment or footnote to other articles. Each article is kept in the database until it is older than the @code{nice} value of each of its recipients and it is not marked by any user. Currently there is a structure called a @code{Misc-Info-List} associated with the @code{Text-Stat}. This list contains information about recipients, senders, comments and footnotes. In the future the information contained in the @code{Misc-Info-List} will be integrated into the @code{Text-Stat}. Every article has at least one number, the global article number. Global numbers are assigned in ascending order to new articles, and are never reused. If an article has recipients it will also have a local number for each recipients. Local numbers are used in some data structures to provide more compact storage and to provida an ordering of articles for a particular recipient. Local numbers are assigned in ascending order and are never reused for a particular recipient, though different recipients will have articles with the same local numbers. Occasionally it is necessary to map between local and global numbers. The server call @code{get-map} does this. @node Conferences, Persons and Sessions, Articles, Introduction @section Conferences Conferences hold articles. They are represented in the protocol as a data type called @code{Conference}. Each conference has a @emph{creator}, the person who created the conference, and a @emph{supervisor}, a conference whose members can modify the conference. If the supervisor is a person, the members of that person's letterbox are supervisors, which in most cases is only that person. We have also introduced a type called @code{UConference} (pronounced micro-conf-stat) which holds a subset of the information contained in the full @code{Conference} type. Use the @code{UConference} type whenever possible since it places a much smaller load on the LysKOM server. Each conference has a type, which is essentially a collection of boolean flags. Currently the types @code{rd-prot}, @code{letterbox}, @code{secret}, @code{original} and @code{anarchy} are defined. @table @code @item rd-prot The conference is protected from reading by non-members. Persons become members by having one of the existing members or supervisors add him or her to the conference. This restriction is enforced by the server. @item original Conferences of this type are intended for original articles only. Comments are to be redirected to the super-conference instead. This restriction is currently not enforced by the server; clients must implement this functionality. @item letterbox Conferences of this type are connected to persons. Letters to a person are sent to the letterbox and the name of the letterbox is synchronised with the person name. It is currently not possible to explicitly set or clear this flag on a conference. @item secret Conferences of this type are secret. The server will not divulge any information of the existence of the conference to persons who are not members or supervisors of the conference. If a letterbox is made secret, that person cannot log in using the person name, but must specify a person number instead. @item anarchy Conferences of this type accept anonymous articles. Other conferences will reject anonymous articles. This restriction is currently not enforced by the server, but will be soon. @end table @node Persons and Sessions, The Misc-Info List, Conferences, Introduction @subsection Persons and Sessions Persons are represented in the protocol by values of the type @code{Person}. Associated with persons are statistics, a set of personal flags and a set of privileges (@pxref{Security}.) Persons are also associated with a conference that has the same number as the person and the @code{letterbox} bit set. Connections to the server are represented as values of the type @code{Session-Info-Ident} or @code{Session-Info}. Sessions have session number that are unique for each session in the lifetime of the server execution. A single user can have several sessions running at once. The session is not released until the network connection is closed; a user can log in and out repeatedly in a single session. @node The Misc-Info List, Security, Persons and Sessions, Introduction @section The Misc-Info List The @code{Misc-Info} list contains tagged data. The fields are sent in groups pertaining to a particular type of information: information about recipient; carbon copy recipient, comment to; footnote to; comment in and footnote in. The information groups may be sent in any order and there may be any number of groups. Within each group the elements are always sent in the order listed below.  David Byers committed Jun 14, 1996 445 @subsection Recipient  David Byers committed Jan 13, 1996 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467  @table @code @item recpt Starts a recipient group. It contains the conference number of a recipient of the article. @item loc-no Always present within a recipient group. It contains the local text number of the article in the conference specified by the preceding @code{recpt} field. @item rec-time If the recipient is a person, this element is added by the server when the recipient marks the article as read. It contains the time when the text was read. @item sent-by Present when the recipient was added by a person other than the author (after the article was created.) It contains the person number of the person who added the recipient. @item sent-at Present when the recipient was added after the article was created. It contains the time when the recipient was added. @end table  David Byers committed Jun 14, 1996 468 @subsection Carbon Copy (CC) Recipient  David Byers committed Jan 13, 1996 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495  The carbon-copy recipient group is identical to the recipient group above. The difference is how new comments to an article with a recipient or carbon-copy recipient are treated. A comment to an article is sent to all recipients, but not to carbon-copy recipients of the original article. @table @code @item cc-recpt Starts a carbon-copy recipient group. It contains the conference number of a carbon-copy recipient of the article. @item loc-no Always present in a CC recipient group. It contains the local text number of the article in the conference specified by the most recent @code{cc-recpt} field. @item rec-time Present after the CC recipient has read the article. It contains the time when the article was read. @item sent-by Present when a CC recipient was added by a person other than the author after the article had been created. It contains the person number of the person who added the cc recipient. @item sent-at Present when a CC recipient was added after the article had been created. It is the time when the CC recipient was added. @end table  David Byers committed Jun 14, 1996 496 @subsection Comment To  David Byers committed Jan 13, 1996 497 498 499 500 501 502 503 504 505 506 507 508 509 510  @table @code @item comm-to Always present when the article is a comment to another article. @item sent-by Present when the article was added as a comment by a person other than the author, after the article had been created. It contains the person number of the person who added the article as a comment. @item sent-at Present when the article was added as a comment after the article had been created. It contains the time when is was added as a comment. @end table  David Byers committed Jun 14, 1996 511 @subsection Footnote To  David Byers committed Jan 13, 1996 512 513 514 515 516 517 518 519 520 521  @table @code @item foot-to Always present when the article is a footnote to another article. @item sent-at Present when the article was added as a footnote after the article had been created. It contains the time when is was added as a footnote. @end table  David Byers committed Jun 14, 1996 522 @subsection Comment in  David Byers committed Jan 13, 1996 523 524 525 526 527 528 529 530  @table @code @item comm-in Present when there are comments to this article. It contains the article number which is a comment to this article. @end table  David Byers committed Jun 14, 1996 531 @subsection Footnote in  David Byers committed Jan 13, 1996 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787  @table @code @item foot-in Present when there are footnotes to this article. It contains the article number which is a footnote to this article. @end table @node Security, Membership and Reading, The Misc-Info List, Introduction @subsection Security Security in LysKOM is based on two components. Each person has a set of privileges and each session has a security level. Rights in the system require both the sufficient privileges and a sufficient security level. The privileges currently available are wheel, admin, statistic, create-conf, create-pers and change-name. Security levels range from 0 to 255. @table @code @item wheel @emph{Normally not assigned} @table @asis @item Level 0 Person may always log in, even when LysKOM is crowded. @item Level 6 Person may set Priv-Bits for all persons. @item Level 7 Person may set password for all persons. @item Level 8 Person acts as supervisor for everything. @item Level 10 Person can read all articles. @end table @item admin @emph{Normally not assigned} @table @asis @item Level 1 Shut down the server@* Set motd_of_kom@* Read last_login @item Level 2 Read status of secret conferences and persons@* Read the protected parts of person and conference statuses@* Read the entire text status, even when there are secret recipients @item Level 3 Change everybody's names @item Level 4 Add/remove members@* Add/remove recipients to articles @item Level 5 Set super-conference@* Remove articles @item Level 6 Set administrator @end table @item statistic @emph{Normally not assigned} @table @asis @item Level 2 Read the statistics portions of persons, even if protected @end table @item create_conf @emph{Normally assigned} @table @asis @item Level 0 Create conferences @end table @item create_pers @emph{Normally assigned} @table @asis @item Level 0 Create persons @end table @end table @node Membership and Reading, Client-Server Dialog, Security, Introduction @section Membership and Reading Persons' memberships in conferences are represented in the protocol as arrays of @code{Membership}-typed values. This structure contains a record of what the person has read in that conference. The first part of the record is the @code{last-text-read} field. It contains the highest local text number such that the person has read every text with an equal or lower local number. The second part of the record is the @code{read-texts} array, which contains the local text numbers higher than @code{last-text-read} that are also read. Finding out which articles a person has read in a particular conference requires a few calls. Normally, a client will retrieve a batch of perhaps 50 articles at a time. The outline of the process is as follows: @enumerate @item Fetch the membership to get the @code{last-text-read} @item Translate 50 local numbers starting as @code{last-text-read} to global numbers. @item Remove the local numbers that are in @code{read-texts} from the result @item Get and translate more texts as needed. @end enumerate The process is complicated because of the translation between local and global text numbers. In the future there will hopefully be a single call that does this work in the server. @node Client-Server Dialog, ,Membership and Reading , Introduction @section Client-Server Dialog The client-server dialog consists of two phases, establishing the connection and the LysKOM session itself. @subsection Connecting to the Server A connection to the server is initiated by connecting to the appropriate network port@footnote{The default port for a LysKOM server is 4894} and sending a single letter which is used to select a protocol version followed by connection information required by that protocol. In protocol A the connection information is a Hollerith string saying who the user connecting is followed by a hewline character. When the server has accepted the connection its reply is protocol-dependent. Protocol A servers will reply with the string @code{LysKOM} on a single line. @example % telnet kom.lysator.liu.se Trying 130.236.254.151 ... Connected to varg.lysator.liu.se. Escape character is '^]'. A5Hbyers LysKOM @end example After connecting, calls to the server can be made. Most calls require the user to log in, but some calls can be made without a log-in. Calls to the server are made by sending a reference number followed by the call as specified. @example server-call ::= ( ref-no : INT32; request : Protocol-Request; ) @end example At some future point the server will reply with the result of the request or an error code preceded by an indicator and the reference number. @example server-reply ::= ok-reply | error-reply; ok-reply ::= ( "=" ref-no : INT32; reply-data; ) error-reply ::= ( "%" ref-no : INT32; error-no : Error-No; error-statuc : INT32; ) error-no ::= INT32; @end example Our notation is not flexible enough to specify the two-way nature of the communication. @code{ref-no} in the reply is always the same as @code{ref-no} in the corresponding request. @code{reply-data} depends on which request was made and is specified together with each request. Please note that there is no whitespace after the initial indicator in the reply. @node Data Types, , , Top @chapter Data Types The data types in protocol A come in two flavors. The first (vanilla) are the simple data types from which the LysKOM (chocolate) data types are built. Simple data types include things like integers and strings while complex data types include things such as conferences and people. @menu * Simple Data Types:: * LysKOM Data Types:: @end menu @node Simple Data Types, LysKOM Data Types, Data Types, Data Types @section Simple Data Types Data elements are sent from client to server separated by one or more ASCII spaces (0x20), tab characters (0x09), line feeds (0x0A) or carriage returns (0x0D.) In messages from server to client the data elements are separated by exactly one space character and the entire message terminated with a line feed. @subsection Integers @dfn{INT32}, @dfn{INT16}, @dfn{INT8} and @dfn{BOOL} are non-negative integers which must fit in 32, 16, 8 and 1 bits, respectively. They are transmitted to the server in ASCII-encoded decimal notation. @subsection Strings @dfn{HOLLERITH} denotes character strings of arbitrary length. They are transmitted as @code{H} where @code{} is the string and @code{} is the number of characters in @code{} in decimal notation. All byte values are allowed in the string itself, including nulls. @subsection Bit Strings @dfn{BITSTRING} is a string of bits, commonly used for a set of boolean-valued flags. Bit strings are denoted as @example BITSTRING ( name-1; name-2; name-3; ... ) @end example in this specification. They are transmitted as a sequence of ASCII ones and zeroes in the order the fields are listed. For instance, given the specification @example shape-of-world : BITSTRING ( is-flat; is-round; is-2d; is-3d; ) @end example most peoples idea of @code{shape-of-world} would be sent as @code{0101} (round and three-dimensional.) @subsection Arrays @dfn{ARRAY} is a list of a fixed number of elements of a single type. The specification for an array is @code{ARRAY } where @code{} is the type of the array elements. Arrays are transmitted as an @code{ @{ ... @}} where @code{} is the number of elements and each @code{} is an element  David Byers committed Jul 27, 1996 788 789 790 of the array. A special case is when the array is empty, in which case the server transmits it as @code{0 *}. Note that the client must always transmit empty arrays as @code{0 @{ @}}.  David Byers committed Jan 13, 1996 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832  In some calls the client can ask the server not to send the array contents, only its length. In these cases the array is transmitted as @code{ *} where @code{} is the number of elements in the array. @subsection Selection @dfn{SELECTION} is tagged data. It consists of an INT32 selector followed by a tail of an arbitrary type and is specified as @example SELECTION ( = : ; = : ; ... ) @end example where each @code{} is the selector value, @code{} the selector name and @code{} the name of the selector tail and @code{} its type. When transmitted, the selector is transmitted as an INT32 followed by the tail belonging to that selector. For instance, given the specification @example phrase : SELECTION ( 1=hello name : HOLLERITH; 2=howdy ; ) @end example two legal messages of the type @code{phrase} are @samp{1 4HJohn} and @samp{2}. @subsection RPC @dfn{RPC} is a notation used to specify calls to the server. An RPC specification has the following form: @example RPC (  David Byers committed Jun 14, 1996 833 834  <> ( ) -> ( ) ; <> ( ) -> ( ) ;  David Byers committed Jan 13, 1996 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000  ) @end example where each @code{} is the name of a call, @code{} is the call number, @code{} is a single data element sent as a request and @code{} is a single data element sent in reply from the server. RPC calls are trasmitted as @code{ } where @code{} and @code{} have the same meaning as above. Note that in the client-server dialog a reference number must also be supplied with each request. This reference number is not part of the RPC itself, but is required for communications @xref{Client-Server Dialog}. @subsection Structure Structures are collections of several data items. In the specification they are written as @example ( : ; : ; ... ) @end example where each @code{} is the name of a data field and the corresponding @code{} is its type. Structures are transmitted as a sequence of their fields. @node LysKOM Data Types, , Simple Data Types, Data Types @section LysKOM Data Types In this section the data types specific to LysKOM are defined. Most of these will probably make very little sense until you know what calls there are. This section does not include the server calls or asynchronous messages, even though these are also data types. Since the types defined here are all based on the simple types, the definitions are more concise in this section. @subsection Common Types The types defined in this section are fairly simple and used in many of the more complex data types. @subsubsection Time @example Time ::= ( seconds : INT32; minutes : INT32; hours : INT32; day : INT32; month : INT32; year : INT32; day-of-week : INT32; day-of-year : INT32; is-dst : BOOL; ) @end example @code{Time} is used to specify times in several data structures. The fields @code{seconds}, @code{minutes} and @code{hours} give wall clock time. @code{day} is the day of month and @code{month} is the current month, starting with zero for January. @code{year} is the number of years since 1900. @code{day-of-week} is the current weekday, with zero used for Sunday. @code{day-of-year} is how many days of the year have passed starting with zero and @code{is-dst} is true when the time indicated is daylight savings time. When the server receives a @code{Time} structure from a client it ignores the @code{day-of-week} and @code{day-of-year} fields. All times are expressed in the time zone of the server. @subsubsection Conference Numbers @example Conf-No ::= INT16; Conf-No-List ::= ARRAY Conf-No @end example These two types denote conference numbers. @code{Conf-No} is used when only a single number is permitted and @code{Conf-No-List} when multiple conference numbers can be specified. @subsubsection Text Numbers @example Text-No ::= INT32; Local-Text-No ::= INT32; Text-List ::= ( first-local-no : Local-Text-No; texts : ARRAY Text-No; ) @end example These three types are used to indicate articles in the LysKOM database. @code{Text-No} is a global text number and @code{Local-Text-No} a local text number. @code{Text-List} is used when a mapping from local to global numbers are required. @subsubsection Person and Session Numbers @example Pers-No ::= Conf-No; Pers-List ::= ARRAY Pers-No; Session-No ::= INT32; @end example @code{Pers-No} is used to indicate a person and @code{Pers-List} to indicate several. @code{Session-No} is used in a few data structures relating to information about active LysKOM sessions. @subsection Conference Types @example Conf-Type ::= BITSTRING ( rd_prot; original; secret; letterbox; ) Extended-Conf-Type ::= BITSTRING ( rd_prot; original; secret; letterbox; anarchy; reserved1; reserved2; reserved3; ) Any-Conf-Type ::= Conf-Type | Extended-Conf-Type; @end example These types are used to specify the type of a conference. @code{Conf-Type} is used in data types and calls that were created before version 8.0 of the protocol and has been augmented in @code{Extended-Conf-Type}. The type @code{Any-Conf-Type} is used when either is admissible. The bits have the following meaning (@pxref{Conferences}, for more info.) @table @code @item rd_prot If unset anyone can add themselves as members to the conference. @item original If set, comments are not allowed in the conference. @item secret If set the conference is secret. It's existence will only be revealed to members and supervisors. @item letterbox Set if the conference is a person's mailbox.