home *** CD-ROM | disk | FTP | other *** search
/ zankasoftware.com / zankasoftware.com.tar / zankasoftware.com / wired / rfc1.txt < prev    next >
Text File  |  2006-08-22  |  51KB  |  1,687 lines

  1. Zanka Software                                            Axel Andersson
  2. Request for Comments: 1                                       March 2004
  3.  
  4.                           Wired Protocol 1.0
  5.  
  6. Status of this Memo
  7.  
  8.    This memo provides information for the Internet community. It 
  9.    describes an Internet protocol. Distribution of this memo is 
  10.    unlimited.
  11.  
  12. Copyright Notice
  13.  
  14.    Copyright (C) Axel Andersson 2003-2004. All Rights Reserved.
  15.  
  16. Abstract
  17.  
  18.    The Wired protocol is an application-level protocol for real time
  19.    chat, messaging and file transfers. It is based on the client-server
  20.    model, with many clients connected to one and the same server,
  21.    allowing both public and private messaging. The main design
  22.    principles are standardization and the unification of messaging and
  23.    file transfer systems.
  24.  
  25. Table of Contents
  26.  
  27.    1   Introduction ...................................................3
  28.    1.1   Purpose ......................................................3
  29.    1.2   Terminology ..................................................3
  30.    1.3   Overall Operation ............................................4
  31.    1.4   Access Authentication ........................................4
  32.    2   Protocol Parameters ............................................4
  33.    2.1   Identification Numbers .......................................4
  34.    2.2   Control Characters ...........................................5
  35.    2.3   Strings ......................................................5
  36.    2.4   Booleans .....................................................5
  37.    2.5   Version Strings ..............................................5
  38.    2.6   Addresses ....................................................6
  39.    2.7   Date & Time Format ...........................................6
  40.    2.8   Privilege Specifications .....................................6
  41.    3   Sequences ......................................................7
  42.    3.1   Login Sequence ...............................................7
  43.    3.2   Private Chat Sequence ........................................8
  44.    4   Files ..........................................................9
  45.    4.1   File Listings ................................................9
  46.    4.2   Transfers ....................................................9
  47.    5   Accounts .......................................................10
  48.    6   Commands .......................................................11
  49.    6.1  Command Format ................................................11
  50.    6.2  Command Listing ...............................................11
  51.    6.2.1    BAN .......................................................11
  52.    6.2.2    BROADCAST .................................................11
  53.    6.2.3    CLEARNEWS .................................................11
  54.    6.2.4    CLIENT ....................................................12
  55.    6.2.5    CREATEUSER ................................................12
  56.    6.2.6    CREATEGROUP ...............................................13
  57.    6.2.7    DECLINE ...................................................12
  58.    6.2.8    DELETE ....................................................12
  59.    6.2.9    DELETEUSER ................................................12
  60.    6.2.10   DELETEGROUP ...............................................12
  61.    6.2.11   EDITUSER ..................................................12
  62.    6.2.12   EDITGROUP .................................................13
  63.    6.2.13   FOLDER ....................................................13
  64.    6.2.14   GET .......................................................13
  65.    6.2.15   GROUPS ....................................................13
  66.    6.2.16   HELLO .....................................................13
  67.    6.2.17   ICON ......................................................13
  68.    6.2.18   INFO ......................................................14
  69.    6.2.19   INVITE ....................................................14
  70.    6.2.20   JOIN ......................................................14
  71.    6.2.21   KICK ......................................................14
  72.    6.2.22   LEAVE .....................................................14
  73.    6.2.23   LIST ......................................................14
  74.    6.2.24   ME ........................................................15
  75.    6.2.25   MOVE ......................................................15
  76.    6.2.26   MSG .......................................................15
  77.    6.2.27   NEWS ......................................................15
  78.    6.2.28   NICK ......................................................15
  79.    6.2.29   PASS ......................................................15
  80.    6.2.30   PING ......................................................15
  81.    6.2.31   POST ......................................................15
  82.    6.2.32   PRIVCHAT ..................................................16
  83.    6.2.33   PRIVILEGES ................................................16
  84.    6.2.34   PUT .......................................................16
  85.    6.2.35   READUSER ..................................................16
  86.    6.2.36   READGROUP .................................................16
  87.    6.2.37   SAY .......................................................16
  88.    6.2.38   SEARCH ....................................................17
  89.    6.2.39   STAT ......................................................17
  90.    6.2.40   TRANSFER ..................................................17
  91.    6.2.41   USER ......................................................17
  92.    6.2.42   USERS .....................................................17
  93.    6.2.43   WHO .......................................................17
  94.    7   Messages .......................................................17
  95.    7.1  Message Format ................................................17
  96.    7.2  200 Class Messages ............................................18
  97.    7.2.1    200 Server Information ....................................18
  98.    7.2.2    201 Login Succeeded .......................................18
  99.    7.2.3    202 Ping Reply ............................................18
  100.    7.3  300 Class Messages ............................................18
  101.    7.3.1    300 Chat ..................................................18
  102.    7.3.2    301 Action Chat ...........................................19
  103.    7.3.3    302 Client Join ...........................................19
  104.    7.3.4    303 Client Leave ..........................................19
  105.    7.3.5    304 Status Change .........................................19
  106.    7.3.6    305 Private Message .......................................20
  107.    7.3.7    306 Client Kicked .........................................20
  108.    7.3.8    307 Client Banned .........................................20
  109.    7.3.9    308 Client Information ....................................20
  110.    7.3.10   309 Broadcast Message .....................................21
  111.    7.3.11   310 User List .............................................21
  112.    7.3.12   311 User List Done ........................................21
  113.    7.3.13   320 News ..................................................22
  114.    7.3.14   321 News Done .............................................22
  115.    7.3.15   322 News Posted ...........................................22
  116.    7.3.16   330 Private Chat Created ..................................22
  117.    7.3.17   331 Private Chat Invitiation ..............................22
  118.    7.3.18   332 Private Chat Declined .................................23
  119.    7.4  400 Class Messages ............................................23
  120.    7.4.1    400 Transfer Ready ........................................23
  121.    7.4.2    401 Transfer Queued .......................................23
  122.    7.4.3    402 File Information ......................................23
  123.    7.4.4    410 File Listing ..........................................24
  124.    7.4.5    411 File Listing Done .....................................24
  125.    7.4.6    420 Search Listing ........................................24
  126.    7.4.7    421 Search Listing Done ...................................24
  127.    7.5  500 Class Messages ............................................25
  128.    7.5.1    500 Command Failed ........................................25
  129.    7.5.2    501 Command Not Recognized ................................25
  130.    7.5.3    502 Command Not Implemented ...............................25
  131.    7.5.4    503 Syntax Error ..........................................25
  132.    7.5.5    510 Login Failed ..........................................25
  133.    7.5.6    511 Banned ................................................25
  134.    7.5.7    512 Client Not Found ......................................25
  135.    7.5.8    513 Account Not Found .....................................25
  136.    7.5.9    514 Account Exists ........................................25
  137.    7.5.10   515 Cannot Be Disconnected ................................26
  138.    7.5.11   516 Permission Denied .....................................26
  139.    7.5.12   520 File or Directory Not Found ...........................26
  140.    7.5.13   521 File or Directory Exists ..............................26
  141.    7.5.14   522 Checksum Mismatch .....................................26
  142.    7.6  600 Class Messages ............................................26
  143.    7.6.1    600 User Specification ....................................26
  144.    7.6.2    601 Group Specification ...................................26
  145.    7.6.3    602 Privileges Specification ..............................27
  146.    7.6.4    610 User Listing ..........................................27
  147.    7.6.5    611 User Listing Done .....................................27
  148.    7.6.6    620 Group Listing .........................................27
  149.    7.6.7    621 Group Listing Done ....................................27
  150.    8   References .....................................................28
  151.    9   Author's Address ...............................................28
  152.    10  Full Copyright Statement .......................................28
  153.  
  154. 1 Introduction
  155.  
  156. 1.1 Purpose
  157.  
  158.    The Wired protocol is an application-level protocol for file 
  159.    transfers and user interaction. It is intended to fill a gap among 
  160.    Internet class protocols that either provide transfer services or 
  161.    chat services, usually mutually exclusively. Wired joins these two 
  162.    types together to provide a complete user experience.
  163.  
  164. 1.2 Terminology
  165.  
  166.    client
  167.       A program that establishes connections for the purpose of 
  168.       sending commands and interpreting messages.
  169.  
  170.    command
  171.       A command sent from a client to a server, as defined in section 
  172.       6.
  173.  
  174.    identifier
  175.       A unique 3-digit number that describes the type of message.
  176.  
  177.    field
  178.       A part of a command or a message that conveys a particular 
  179.       pre-defined type of information.
  180.  
  181.    message
  182.       A message sent from a server to a client, as defined in section 
  183.       7.
  184.  
  185.    server
  186.       A program that accepts connections in order to service commands 
  187.       by sending back messages.
  188.  
  189. 1.3 Overall Operation
  190.  
  191.    The Wired protocol is a textual command/message protocol. A client 
  192.    sends a command in a specific format to the server, and the server 
  193.    interprets this command, and if needed, sends back a message with 
  194.    requested information.
  195.  
  196.    Some messages are sent asynchronously, meaning they are sent without 
  197.    having first received a command. These messages can be sent at any  
  198.    given time, and a client should be prepared to handle these as they 
  199.    come.
  200.  
  201.    A single connection ("control connection") is used to send these 
  202.    commands and messages back and forth. A separate connection is used 
  203.    for transfers, in order to maintain the control connection while a 
  204.    transfer is running.
  205.  
  206.    Wired communication takes place over a TCP/IP connection using TLS 
  207.    [1]. The default port is TCP 2000, but other ports can be used. The 
  208.    transfer port is the default port incremented by one, or 2001 by 
  209.    default.
  210.  
  211. 1.4 Access Authentication
  212.  
  213.    Wired requires all clients to provide authentication in order to 
  214.    log in to a server. This authentication consists of a login name 
  215.    and an optional password. Servers wishing to provide anonymous 
  216.    logins should provide a "guest" user with no password. Clients 
  217.    should use this login pair as the default.
  218.  
  219.    Passwords are SHA-1 [2] checksums of the actual passwords. No 
  220.    cleartext should be sent over the connection.
  221.    
  222.    See section 5 for more information on accounts.
  223.  
  224. 2 Protocol Parameters
  225.  
  226. 2.1 Identification Numbers
  227.  
  228.    The protocol uses identification numbers for a number of object 
  229.    types. These are unsigned integers.
  230.  
  231.       ID    = 1*DIGIT
  232.  
  233.    An identification number is assigned to each connected user,
  234.    starting with 1 and incremented for each new user. In certain
  235.    situations, the server software itself may participate in
  236.    communications. When thus, the server assumes the user id 0.
  237.  
  238.    An id number is also assigned to each new chat created. Unlike
  239.    user ids however, these should be assigned randomly from the
  240.    integer range used. The server should also take care to verify
  241.    that each client communicating with a certain chat, is actually
  242.    present on that chat, to prevent unauthorized eavesdropping.
  243.  
  244.    The public chat is the chat available to everyone and the chat
  245.    that is automatically joined upon logging in. The public chat
  246.    is assigned the chat id 1.
  247.  
  248. 2.2 Control Characters
  249.  
  250.    The following control characters from the US-ASCII [7] table are used:
  251.  
  252.       EOT    = <US-ASCII EOT, end of transmission (4)>
  253.       FS     = <US-ASCII FS, file separator (28)>
  254.       GS     = <US-ASCII GS, group separator (29)>
  255.       RS     = <US-ASCII US, record separator (30)>
  256.       SP     = <US-ASCII SP, space (32)>
  257.  
  258. 2.3 Strings
  259.  
  260.    All string contents are sent in Unicode [3], UTF-8 encoding [4]. 
  261.    There is no way to select a character set. Clients must be UTF-8 
  262.    aware if they wish to participate in communications:
  263.  
  264.       STRING    = <any 8-bit sequence of data in UTF-8 encoding>
  265.  
  266. 2.4 Booleans
  267.  
  268.    When a value can be considered as an on/off switch, a boolean value 
  269.    is used:
  270.  
  271.       BOOLEAN    = "0" | "1"
  272.  
  273. 2.5 Version Strings
  274.  
  275.    Version strings are used to convey the version of either the 
  276.    protocol or the applications involved. The protocol version string 
  277.    uses a fixed format:
  278.  
  279.       protocol-version    = 1*DIGIT "." 1*DIGIT
  280.  
  281.    The application version string has a different format:
  282.  
  283.       app-version    = name "/" 1*DIGIT "." 1*DIGIT ["." 1*DIGIT]
  284.                        SP "(" os ")"
  285.                        [ SP "(" lib-version [";" SP lib-version] ")" ]
  286.       name           = STRING
  287.  
  288.       os             = os-release ";" SP os-version ";" SP arch
  289.       os-release     = STRING
  290.       os-version     = STRING
  291.       arch           = STRING
  292.       
  293.       lib-version    = STRING
  294.  
  295.    That is, the application version must always be followed by the
  296.    operating system version, and optionally, by the versions of
  297.    additional software used. For example:
  298.  
  299.       Wired/1.0 (Darwin; 7.2.0; powerpc) (OpenSSL 0.9.7b 10 Apr 2003)
  300.  
  301.    Note that there is no particular format defined for the operation 
  302.    system version strings.
  303.  
  304. 2.6 Addresses
  305.  
  306.    IP addresses are sent in textual representation, in the formats
  307.    described in RFC 790 [8] and RFC 1884 [9]:
  308.    
  309.       IP    = STRING
  310.  
  311. 2.7 Date & Time Format
  312.  
  313.    Date are sent in the ISO 8601 [5] full "date-time" format, as per RFC 
  314.    3339 [6]:
  315.  
  316.       date-fullyear     = 4DIGIT
  317.       date-month        = 2DIGIT  ; 01-12
  318.       date-mday         = 2DIGIT  ; 01-28, 01-29, 01-30, 01-31
  319.       time-hour         = 2DIGIT  ; 00-23
  320.       time-minute       = 2DIGIT  ; 00-59
  321.       time-second       = 2DIGIT  ; 00-58, 00-59, 00-60
  322.       time-secfrac      = "." 1*DIGIT
  323.       time-numoffset    = ("+" / "-") time-hour ":" time-minute
  324.       time-offset       = "Z" / time-numoffset
  325.  
  326.       partial-time      = time-hour ":" time-minute ":" time-second
  327.                            [time-secfrac]
  328.       full-date         = date-fullyear "-" date-month "-" date-mday
  329.       full-time         = partial-time time-offset
  330.  
  331.       date-time         = full-date "T" full-time
  332.  
  333.    An example of such a date is:
  334.  
  335.       1996-12-19T16:39:57-08:00
  336.  
  337.    This represents 39 minutes and 57 seconds after the 16th hour of 
  338.    December 19th, 1996 with an offset of -08:00 from UTC.
  339.  
  340. 2.8 Privilege Specifications
  341.  
  342.    Privilege specifications are sent in the following format:
  343.  
  344.       privileges    = get-user-info      FS broadcast FS
  345.                       post-news          FS clear-news FS
  346.                       download           FS upload FS
  347.                       upload-anywhere    FS create-folders FS 
  348.                       move-files         FS delete-files FS 
  349.                       view-dropboxes     FS create-accounts FS 
  350.                       edit-accounts      FS delete-accounts FS 
  351.                       elevate-privileges FS kick-users FS 
  352.                       ban-users          FS cannot-be-kicked FS 
  353.                       download-speed     FS upload-speed
  354.  
  355.       get-user-info         = BOOLEAN
  356.       broadcast             = BOOLEAN
  357.       post-news             = BOOLEAN
  358.       clear-news            = BOOLEAN
  359.       download              = BOOLEAN
  360.       upload                = BOOLEAN
  361.       upload-anywhere       = BOOLEAN
  362.       create-folders        = BOOLEAN
  363.       move-files            = BOOLEAN
  364.       delete-files          = BOOLEAN
  365.       view-dropboxes        = BOOLEAN
  366.       create-accounts       = BOOLEAN
  367.       edit-accounts         = BOOLEAN
  368.       delete-accounts       = BOOLEAN
  369.       elevate-privileges    = BOOLEAN
  370.       kick-users            = BOOLEAN
  371.       ban-users             = BOOLEAN
  372.       cannot-be-kicked      = BOOLEAN
  373.       download-speed        = 1*DIGIT
  374.       upload-speed          = 1*DIGIT
  375.  
  376.    This is a series of boolean values, indicating whether a user can or 
  377.    cannot perform certain commands.
  378.  
  379.    See section 5 for more information on accounts. See section 4 for more
  380.    information on the file related privileges.
  381.  
  382. 3 Sequences
  383.  
  384. 3.1 Login Sequence
  385.  
  386.    The login sequence takes place directly after the client has 
  387.    established a connection with the server.
  388.    
  389.    1.  The client initiates the sequence by sending the "HELLO" command.
  390.    
  391.    2.  The server responds with the 200 Server Information or 511 Banned 
  392.        message.
  393.    
  394.    3.  The client sends the "NICK", "ICON" and "CLIENT" commands to set
  395.        values before becoming visible to other clients.
  396.       
  397.        Of these, "NICK" is required, "CLIENT" is optional but highly
  398.        recommended, and "ICON" is optional.
  399.    
  400.    4.  The clients sends the "USER" command with the login name. "guest"
  401.        should be used as the default login name.
  402.    
  403.    5.  The client sends the "PASS" command with the checksum of the
  404.        actual password. If the password is empty, no check-summing
  405.        should be performed.
  406.    
  407.    6.  The server responds with the 201 Login Succeeded or 510 Login 
  408.        Failed messages.
  409.    
  410.    7.  The client requests the user list using "WHO", with a value of "1"
  411.        for the public user list.
  412.    
  413.    8.  The server responds with the 310 User List and 311 User List Done
  414.        messages.
  415.    
  416.    9.  Optionally, the client requests the active privileges mask using 
  417.        "PRIVILEGES".
  418.    
  419.    10. The server responds with the 602 Privileges message.
  420.    
  421.    11. Optionally, the client requests the news using "NEWS".
  422.    
  423.    12. The server responds with the 320 News and 321 News Done messages.
  424.  
  425. 3.2 Private Chat Sequence
  426.  
  427.    The private chat sequence takes place when a user requests a private
  428.    chat audience with another user.
  429.    
  430.    1.  Client A initiates the sequence by sending the "PRIVCHAT"
  431.        command.
  432.    
  433.    2.  The server creates a private chat and responds with the 330
  434.        Private Chat Created message. Client A is added to the
  435.        private chat.
  436.    
  437.    3.  Client A invites client B to the private chat by sending the
  438.        "INVITE" message, with the chat id of the new chat and the
  439.        user id of client B.
  440.    
  441.    4.  The server sends the 331 Private Chat Invitation message to
  442.        client B, with the chat id of the new chat and the user id
  443.        of client A.
  444.    
  445.    5.  Client B sends a "JOIN" or "DECLINE" command with the chat id
  446.        of the new chat.
  447.        
  448.        Following the "JOIN" command, client B sends a "WHO" command,
  449.        requesting the user list of the private chat.
  450.    
  451.    6.  In case of "JOIN", the server adds client B to the new chat
  452.        and sends out 302 Client Join messages to the user list of
  453.        the private chat.
  454.        
  455.        The server also replies to "WHO" and sends the user list of
  456.        the private chat to client B.
  457.        
  458.        Client A and client B can now communicate in a closed private
  459.        chat. Other clients can be added by sending out new "INVITE"
  460.        commands.
  461.        
  462.        In case of "DECLINE", the server sends out 332 Private Chat
  463.        Declined messages to the user list of the private chat.
  464.    
  465.    7.  When done, client A and client B send the "LEAVE" command to
  466.        leave the private chat.
  467.    
  468.    8.  The server sends out 303 Client Leave messages to the user list
  469.        of the private chat.
  470.  
  471. 4 Files
  472.  
  473. 4.1 File Listings
  474.    
  475.    The following parameters are sent in file related messages:
  476.    
  477.        file-type    = 1*DIGIT  ; 0-3
  478.    
  479.    The file type is mapped by the server as follows:
  480.    
  481.        0 File
  482.        1 Directory
  483.        2 Uploads Directory
  484.        3 Drop Box Directory
  485.    
  486.    Note that for the directory types, the server should send the count
  487.    of enclosed object as "size" in the listing messages.
  488.    
  489.    Uploads directories and drop boxes are special directories that tie in 
  490.    with the permissions listed in section 5. Uploads and drop box 
  491.    directories  can be uploaded into by accounts with the "upload" 
  492.    privilege; the "upload-anywhere" privilege is required to upload into 
  493.    a regular directory. Having uploads privileges should also enable
  494.    "create-folders", but only in the directories where the client can
  495.    upload.
  496.  
  497.    Drop box directories can only be viewed by accounts with the
  498.    "view-dropboxes" privilege; for others, the directory should appear
  499.    with an empty listing.
  500.    
  501.    Of special consideration is the directory "WIRED", contained within 
  502.    any subdirectory. This directory may contain meta data undefined in
  503.    this document, and should be removed from file listings. Files
  504.    contained within the "WIRED" directories can, however, successfully be 
  505.    used in transfers.
  506.  
  507. 4.2 Transfers
  508.  
  509.    Because servers should supporting queueing and resuming transfers,
  510.    these sequences are a bit more complicated than usual.
  511.  
  512.    Of note is the so-called Wired checksum. These should be SHA-1 [2]
  513.    checksums of the first megabyte (1048576 octets) of the file. This
  514.    is defined to allow check-summing of very large files in real time,
  515.    and to allow checksums of partially transferred files to match,
  516.    provided that they exceed 1 MB in size.
  517.    
  518.    Sequence, for downloads:
  519.    
  520.        1.  The client decides to download a file. If the file has been
  521.            partially downloaded already, the client should issue a
  522.            "STAT" command to get the Wired checksum of the file,
  523.            and compare that to the Wired checksum of the local file.
  524.            If the match is successful, the "GET" command should be
  525.            issued with the appropriate offset.
  526.        
  527.        2.  The server retains the download request, and may issue
  528.            401 Transfer Queued messages until a transfer slot is found.
  529.            When found, the server issues 400 Transfer Ready, with a
  530.            unique random textual key string to identify the transfer.
  531.        
  532.        3.  The client retains the key received in the 400 messages,
  533.            connects to the server's transfer port, and sends the
  534.            "TRANSFER" command with the key to identify which transfer.
  535.        
  536.        4.  If the key matches the queued transfer, the server begins
  537.            sending the file; otherwise, the connection is closed.
  538.    
  539.    And, for uploads:
  540.    
  541.        1.  The client decides to upload a file, and sends the "PUT"
  542.            command with the appropriate Wired checksum and file size.
  543.        
  544.        2.  The server checks if a partially transferred file exists
  545.            at the location the client specified. If so, compares the
  546.            Wired checksum of that file to the one given by the client.
  547.            If a fully transferred file exists at that path, a 521
  548.            File or Directory Exists should be issued.
  549.            
  550.            If the transfer is to be accepted, the server may begin
  551.            sending out 401 Transfer Queued messages until a slot is
  552.            found. Then, the 400 Transfer Ready is issued, with a
  553.            unique key.
  554.        
  555.        3.  Just as for downloads, the client connects to the transfer
  556.            port, sends the "TRANSFER" command, and begins sending
  557.            the file.
  558.  
  559. 5 Accounts
  560.  
  561.    There are two principal types of Wired accounts, users and groups.
  562.  
  563.    User accounts are the primary authentication mechanism, with login
  564.    and password pairs, just like most systems. When the client has
  565.    authenticated, it is assigned a privilege mask by the server, which
  566.    consists of all the values defined in section in 2.8. A client
  567.    should retain this mask by sending the "PRIVILEGES" command and
  568.    save the resulting message. A client should not attempt to perform
  569.    actions that it knows it cannot complete.
  570.    
  571.    The server needs to keep track of the mask, and update it accordingly
  572.    for logged in clients when, for example, an edit accounts request
  573.    completes.
  574.    
  575.    As mentioned in section 1.4 and elsewhere, the default account "guest"
  576.    should be provided when server administrators wish to provide an
  577.    anonymous account.
  578.    
  579.    User accounts can be assigned to group accounts. Group accounts are
  580.    similar to user accounts, but lack the "group" and "password" fields,
  581.    for obvious reasons. Assigning a user account to a group is just a
  582.    matter of specifying the group's name for the "group" field. If
  583.    the "group" field is empty, the user account belongs to no group.
  584.    
  585.    When a user account is assigned to a group, the user account's
  586.    privileges are ignored, and the group account's are used instead.
  587.    Thus, if user A has no limits on either download or upload rates,
  588.    but group 1 has limits in place, assigning user A to group 1 will
  589.    result in all logins for user A to have limits.
  590.  
  591. 6 Commands
  592.  
  593. 6.1 Command Format
  594.  
  595.    A command from a client to a server includes a unique command, 
  596.    optionally followed by a single space and arguments. The command is 
  597.    terminated with EOT.
  598.  
  599.       command     = name [SP argument] EOT
  600.       name        = "BAN"         | "BROADCAST"  | "CLEARNEWS" |
  601.                     "CLIENT"      | "CREATEUSER" | "CREATEGROUP" |
  602.                     "DECLINE"     | "DELETE"     | "DELETEUSER" |
  603.                     "DELETEGROUP" | "EDITUSER"   | "EDITGROUP" |
  604.                     "FOLDER"      | "GET"        | "GROUPS" |
  605.                     "HELLO"       | "ICON"       | "INFO" |
  606.                     "INVITE"      | "JOIN"       | "KICK" |
  607.                     "LEAVE"       | "LIST"       | "ME" |
  608.                     "MOVE"        | "MSG"        | "NEWS" |
  609.                     "NICK"        | "PASS"       | "PING"
  610.                     "POST"        | "PRIVCHAT"   | "PRIVILEGES" |
  611.                     "PUT"         | "READUSER"   | "READGROUP" |
  612.                     "SAY"         | "SEARCH"     | "STAT" |
  613.                     "TRANSFER"    | "USER"       | "USERS" |
  614.                     "WHO"
  615.  
  616. 6.2 Command Listing
  617.  
  618. 6.2.1 BAN
  619.  
  620.       "BAN" SP user FS message EOT
  621.  
  622.       user       = ID
  623.       message    = STRING
  624.  
  625.    Ban the client "user" with the message "message". Performs the same
  626.    action as "KICK", but also installs a temporary ban on "user". The
  627.    duration of the time is user-defined.
  628.  
  629.    Subject to the privilege "ban-users".
  630.  
  631. 6.2.2 BROADCAST
  632.  
  633.       "BROADCAST" SP message EOT
  634.  
  635.       message    = STRING
  636.  
  637.    Send the broadcast message "message" to all connected users.
  638.  
  639.    Subject to the privilege "broadcast".
  640.  
  641. 6.2.3 CLEARNEWS
  642.  
  643.       "CLEARNEWS" EOT
  644.  
  645.    Empty the news.
  646.  
  647.    Subject to the privilege "clear-news".
  648.  
  649. 6.2.4 CLIENT
  650.  
  651.       "CLIENT" SP app-version EOT
  652.  
  653.    See section 2.5 for a specification of "app-version".
  654.  
  655.    Send the client version information. See section 3.1 for more 
  656.    information on the login sequence.
  657.  
  658. 6.2.5 CREATEUSER
  659.  
  660.       "CREATEUSER" SP name FS password FS group FS privileges EOT
  661.  
  662.       name        = STRING
  663.       password    = STRING
  664.       group       = STRING
  665.  
  666.    Create the user account "name", as a member of "group",
  667.    which can be empty.
  668.  
  669.    See section 2.8 for a specification of "privileges".
  670.  
  671.    Subject to the privilege "create-accounts".
  672.  
  673. 6.2.6 CREATEGROUP
  674.  
  675.       "CREATEGROUP" SP name FS privileges EOT
  676.  
  677.       name    = STRING
  678.  
  679.    Create the group account "name".
  680.  
  681.    See section 2.8 for a specification of "privileges".
  682.  
  683.    Subject to the privilege "create-accounts".
  684.  
  685. 6.2.7 DECLINE
  686.  
  687.       "DECLINE" SP chat EOT
  688.  
  689.       chat    = ID
  690.  
  691.    Decline a chat invitation to "chat".
  692.  
  693. 6.2.8 DELETE
  694.  
  695.       "DELETE" SP path EOT
  696.  
  697.       path    = STRING
  698.  
  699.    Delete the file or folder at "path". All deletes are recursive.
  700.  
  701.    Subject to the privilege "delete-files".
  702.  
  703. 6.2.9 DELETEUSER
  704.  
  705.       "DELETEUSER" SP name EOT
  706.  
  707.       name    = STRING
  708.  
  709.    Delete the user account "name".
  710.  
  711.    Subject to the privilege "delete-accounts".
  712.  
  713. 6.2.10 DELETEGROUP
  714.  
  715.       "DELETEGROUP" SP name EOT
  716.  
  717.       name    = STRING
  718.  
  719.    Delete the group account "name".
  720.  
  721.    Subject to the privilege "delete-accounts".
  722.  
  723. 6.2.11 EDITUSER
  724.  
  725.       "EDITUSER" SP name FS password FS group FS privileges EOT
  726.  
  727.       name        = STRING
  728.       password    = STRING
  729.  
  730.    Modify the user account "name", setting new values or privileges.
  731.    A user account cannot be renamed, so "name" must already exist.
  732.    The group membership can be changed by editing "group", which
  733.    can be empty.
  734.  
  735.    See section 2.8 for a specification of "privileges".
  736.  
  737.    Subject to the privilege "edit-accounts".
  738.  
  739. 6.2.12 EDITGROUP
  740.  
  741.       "EDITGROUP" SP name FS privileges EOT
  742.  
  743.       name    = STRING
  744.  
  745.    Modify the group account "name", setting new privileges. A group 
  746.    account cannot be renamed, so "name" must already exist.
  747.  
  748.    See section 2.8 for a specification of "privileges".
  749.  
  750.    Subject to the privilege "edit-accounts".
  751.  
  752. 6.2.13 FOLDER
  753.  
  754.       "FOLDER" SP path EOT
  755.  
  756.       path    = STRING
  757.  
  758.    Create a new folder at "path".
  759.  
  760.    Subject to the privilege "create-folders".
  761.  
  762. 6.2.14 GET
  763.  
  764.       "GET" SP path FS offset EOT
  765.  
  766.       path      = STRING
  767.       offset    = 1*DIGIT
  768.  
  769.    Request a download of the file or folder "path", starting from byte
  770.    offset "offset". See section 4 for more details on transfers.
  771.  
  772.    Subject to the privilege "download".
  773.  
  774. 6.2.15 GROUPS
  775.  
  776.       "GROUPS" EOT
  777.  
  778.    Get a listing of all the group accounts on the server.
  779.  
  780.    Subject to the privilege "edit-accounts".
  781.  
  782. 6.2.16 HELLO
  783.  
  784.       "HELLO" EOT
  785.  
  786.    Start a conversation with a server. See section 3.1 for more 
  787.    information on the login sequence.
  788.  
  789. 6.2.17 ICON
  790.  
  791.    Format:
  792.  
  793.       "ICON" SP icon EOT
  794.  
  795.       icon    = 1*DIGIT
  796.  
  797.    Change the icon to "icon".
  798.  
  799. 6.2.18 INFO
  800.  
  801.       "INFO" SP user EOT
  802.  
  803.       user    = ID
  804.  
  805.    Request client information for "user".
  806.  
  807.    Subject to the privilege "get-user-info".
  808.  
  809. 6.2.19 INVITE
  810.  
  811.       "INVITE" SP user FS chat EOT
  812.  
  813.       user    = ID
  814.       chat    = ID
  815.  
  816.    Invite the client "user" to the chat "chat". See section 3.2 for more
  817.    information on private chat sequences.
  818.  
  819. 6.2.20 JOIN
  820.  
  821.       "JOIN" SP chat EOT
  822.  
  823.       chat    = ID
  824.  
  825.    Join the chat "chat". See section 3.2 for more information on private 
  826.    chat sequences.
  827.  
  828. 6.2.21 KICK
  829.  
  830.       "KICK" SP user FS message EOT
  831.  
  832.       user       = ID
  833.       message    = STRING
  834.  
  835.    Kick the client "user" with the message "message".
  836.  
  837.    Subject to the privilege "kick-users".
  838.  
  839. 6.2.22 LEAVE
  840.  
  841.       "LEAVE" SP chat EOT
  842.  
  843.       chat    = ID
  844.  
  845.    Leave the chat "chat". See section 3.2 for more information on private 
  846.    chat sequences.
  847.  
  848. 6.2.23 LIST
  849.  
  850.       "LIST" SP path EOT
  851.  
  852.       path    = STRING
  853.  
  854.    List the file contents at "path".
  855.  
  856. 6.2.24 ME
  857.  
  858.       "ME" SP chat FS message EOT
  859.  
  860.       chat       = ID
  861.       message    = STRING
  862.  
  863.    Send the action chat "message" to "chat".
  864.  
  865. 6.2.25 MOVE
  866.  
  867.       "MOVE" SP from FS to EOT
  868.  
  869.       from    = STRING
  870.       to      = STRING
  871.  
  872.    Move the file or folder at "from" to "to".
  873.  
  874.    Subject to the privilege "move-files".
  875.  
  876. 6.2.26 MSG
  877.  
  878.    Format:
  879.  
  880.       "MSG" SP user FS message EOT
  881.  
  882.       user       = ID
  883.       message    = STRING
  884.  
  885.    Send the private message "message" to the user "user".
  886.  
  887. 6.2.27 NEWS
  888.  
  889.       "NEWS" EOT
  890.  
  891.    Request the news.
  892.  
  893. 6.2.28 NICK
  894.  
  895.       "NICK" SP nick EOT
  896.  
  897.       nick    = STRING
  898.  
  899.    Change nick to "nick".
  900.  
  901. 6.2.29 PASS
  902.  
  903.       "PASS" SP password EOT
  904.  
  905.       password    = STRING
  906.  
  907.    Send password. See section 3.1 for more information on the login 
  908.    sequence.
  909.  
  910. 6.2.30 PING
  911.  
  912.       "PING" EOT
  913.  
  914.    Ping the server and let it return a 202 message. Should not affect the
  915.    idle time.
  916.  
  917. 6.2.31 POST
  918.  
  919.       "POST" SP message EOT
  920.  
  921.       message    = STRING
  922.  
  923.    Post "message" to the news.
  924.  
  925.    Subject to the privilege "post-news".
  926.  
  927. 6.2.32 PRIVCHAT
  928.  
  929.       "PRIVCHAT" EOT
  930.  
  931.    Create a new chat on the server.
  932.  
  933. 6.2.33 PRIVILEGES
  934.  
  935.       "PRIVILEGES" EOT
  936.  
  937.    Request the current privilege mask. See section 3.1 for more  
  938.    information on the login sequence.
  939.  
  940. 6.2.34 PUT
  941.  
  942.       "PUT" SP path FS size FS checksum EOT
  943.  
  944.       path        = STRING
  945.       size        = 1*DIGIT
  946.       checksum    = STRING
  947.  
  948.    Request an upload of the file to be located at the remote path
  949.    "path", with size "size" and the checksum "checksum". See
  950.    section 4 for more details on transfers.
  951.  
  952.    Subject to the privilege "upload".
  953.  
  954. 6.2.35 READUSER
  955.  
  956.       "READUSER" SP name EOT
  957.  
  958.       name    = STRING
  959.  
  960.    Get the account specification for the user "name".
  961.  
  962.    Subject to the privilege "edit-accounts".
  963.  
  964. 6.2.36 READGROUP
  965.  
  966.       "READGROUP" SP name EOT
  967.  
  968.       name    = STRING
  969.  
  970.    Get the account specification for the group "name".
  971.  
  972.    Subject to the privilege "edit-accounts".
  973.  
  974. 6.2.37 SAY
  975.  
  976.       "SAY" SP chat FS message EOT
  977.  
  978.       chat       = ID
  979.       message    = STRING
  980.  
  981.    Send the chat "message" to "chat".
  982.  
  983. 6.2.38 SEARCH
  984.  
  985.       "SEARCH" SP query EOT
  986.  
  987.       query    = STRING
  988.  
  989.    Search the files for filenames containing "query".
  990.  
  991. 6.2.39 STAT
  992.  
  993.       "STAT" SP path EOT
  994.  
  995.    Get the file information for the file or folder "path".
  996.  
  997. 6.2.40 TRANSFER
  998.  
  999.       "TRANSFER" SP hash EOT
  1000.  
  1001.       hash    = STRING
  1002.  
  1003.    Identify the transfer requested. See section 4 for more information 
  1004.    on files.
  1005.  
  1006. 6.2.41 USER
  1007.  
  1008.       "USER" SP login EOT
  1009.  
  1010.       login    = STRING
  1011.  
  1012.    Send login name. See section 3.1 for more information on the login 
  1013.    sequence.
  1014.  
  1015. 6.2.42 USERS
  1016.  
  1017.       "USERS" EOT
  1018.  
  1019.    Get a listing of all the user accounts on the server.
  1020.  
  1021.    Subject to the privilege "edit-accounts".
  1022.  
  1023. 6.2.43 WHO
  1024.  
  1025.       "WHO" SP chat EOT
  1026.  
  1027.       chat   = ID
  1028.  
  1029.    Get the user list for "chat".
  1030.  
  1031. 7 Server Messages
  1032.  
  1033. 7.1 Message Format
  1034.  
  1035.    A message from a server to a client includes a unique three-digit 
  1036.    number, followed by a space, then optional fields, and a terminator.
  1037.  
  1038.       message       = identifier [SP argument] EOT
  1039.       identifier    = "200" | "201" | "202"
  1040.                       "300" | "301" | "302" | "303" | "304" | "305" |
  1041.                       "306" | "307" | "308" | "309" | "310" | "311" |
  1042.                       "320" | "321" | "322" | "330" | "331" | "332" |
  1043.                       "400" | "401" | "402" | "410" | "411" | "420" |
  1044.                       "421" |
  1045.                       "500" | "501" | "502" | "503" | "510" | "511"
  1046.                       "512" | "513" | "514" | "515" | "516" | "520" |
  1047.                       "521" | "522"
  1048.                       "600" | "601" | "610" | "611" | "620" | "621"
  1049.  
  1050.    The first digit of the identifier defines the class of response. The 
  1051.    last two digits do not have any categorization role. There are five 
  1052.    values for the first digit:
  1053.  
  1054.       2xx Information
  1055.       3xx Chat, news, messaging
  1056.       4xx Files, transfers
  1057.       5xx Errors
  1058.       6xx Administrative
  1059.  
  1060. 7.2 200 Class Messages
  1061.  
  1062. 7.2.1 200 Server Information
  1063.  
  1064.       "200" SP app-version FS protocol-version FS
  1065.                server-name FS server-description FS
  1066.                start-time
  1067.  
  1068.       server-name           = STRING
  1069.       server-description    = STRING
  1070.       start-time            = date-time
  1071.  
  1072.    Basic information about the server.
  1073.  
  1074.    See section 2.5 for a specification of "app-version" and
  1075.    "protocol-version".
  1076.  
  1077.    In response to "HELLO".
  1078.  
  1079. 7.2.2 201 Login Succeeded
  1080.  
  1081.       "201" SP user EOT
  1082.  
  1083.       user    = ID
  1084.  
  1085.    Login succeeded, client was assigned user id "user".
  1086.  
  1087.    In response to "PASS".
  1088.  
  1089. 7.2.3 202 Ping Reply
  1090.  
  1091.       "202" SP "Pong" EOT
  1092.  
  1093.    In response to "PING".
  1094.  
  1095. 7.3 300 Class Messages
  1096.  
  1097. 7.3.1 300 Chat
  1098.  
  1099.       "300" SP chat FS user FS message EOT
  1100.  
  1101.       chat       = ID
  1102.       user       = ID
  1103.       message    = STRING
  1104.  
  1105.    Standard chat message from "user" on "chat". The chat message is 
  1106.    contained within "message ".
  1107.  
  1108.       user ":" SP message
  1109.  
  1110. 7.3.2 301 Action Chat
  1111.  
  1112.       "301" SP chat FS user FS message EOT
  1113.  
  1114.       chat       = ID
  1115.       user       = ID
  1116.       message    = STRING
  1117.  
  1118.    Action chat message from "user" on "chat". The chat message is 
  1119.    contained within "message". Typical output format:
  1120.  
  1121.       "***" SP user SP message
  1122.  
  1123. 7.3.3 302 Client Join
  1124.  
  1125.       "302" SP chat FS user FS idle FS admin FS icon FS nick FS login FS 
  1126.                ip FS host EOT
  1127.  
  1128.       chat     = ID
  1129.       user     = ID
  1130.       idle     = BOOLEAN
  1131.       admin    = BOOLEAN
  1132.       icon     = 1*DIGIT
  1133.       nick     = STRING
  1134.       login    = STRING
  1135.       ip       = IP
  1136.       host     = STRING
  1137.  
  1138.    The client "user" joined "chat". If "chat" is the public chat, the
  1139.    client has joined the server.
  1140.  
  1141.    The rest of the fields are basic information on the client.
  1142.  
  1143. 7.3.4 303 Client Leave
  1144.  
  1145.       303 SP chat FS user EOT
  1146.  
  1147.       chat     = ID
  1148.       user     = ID
  1149.  
  1150.    The client "user" left "chat". If "chat" is the public chat, the
  1151.    client has left the server.
  1152.  
  1153. 7.3.5 304 Status Change
  1154.  
  1155.       "304" SP user FS idle FS admin FS icon FS nick EOT
  1156.  
  1157.       user     = ID
  1158.       idle     = BOOLEAN
  1159.       admin    = BOOLEAN
  1160.       icon     = 1*DIGIT
  1161.       nick     = STRING
  1162.  
  1163.    The client "user" changed status. Any number of the given fields 
  1164.    have changed.
  1165.  
  1166. 7.3.6 305 Private Message
  1167.  
  1168.       "305" SP user FS message EOT
  1169.  
  1170.       user        = ID
  1171.       message     = STRING
  1172.  
  1173.    The client "user" sent the receiver a private message. The actual 
  1174.    message is contained within "message".
  1175.  
  1176. 7.3.7 306 Client Kicked
  1177.  
  1178.       "306" SP victim FS killer FS message EOT
  1179.  
  1180.       victim      = ID
  1181.       killer      = ID
  1182.       message     = STRING
  1183.  
  1184.    The client "victim" was kicked by "killer", who commented with 
  1185.    "message".
  1186.  
  1187. 7.3.8 307 Client Banned
  1188.  
  1189.       "307" SP victim FS killer FS message EOT
  1190.  
  1191.       victim      = ID
  1192.       killer      = ID
  1193.       message     = STRING
  1194.  
  1195.    The client "victim" was banned by "killer", who commented with 
  1196.    "message".
  1197.  
  1198. 7.3.9 308 Client Information
  1199.  
  1200.       "308" SP user FS idle FS admin FS icon FS nick FS login FS
  1201.                ip FS host FS client-version FS cipher-name FS 
  1202.                cipher-bits FS login-time FS idle-time FS
  1203.                downloads FS uploads EOT
  1204.  
  1205.       user              = ID
  1206.       idle              = BOOLEAN
  1207.       admin             = BOOLEAN
  1208.       icon              = 1*DIGIT
  1209.       nick              = STRING
  1210.       login             = STRING
  1211.       ip                = IP
  1212.       host              = STRING
  1213.  
  1214.       client-version    = [application-version]
  1215.       cipher-name       = [STRING]
  1216.       cipher-bits       = 1*DIGIT
  1217.       login-time        = date-time
  1218.       idle-time         = date-time
  1219.       downloads         = *(transfer [GS])
  1220.       uploads           = *(transfer [GS])
  1221.  
  1222.       transfer          = path RS transferred RS size RS speed
  1223.       path              = STRING
  1224.       transferred       = 1*DIGIT
  1225.       size              = 1*DIGIT
  1226.       speed             = 1*DIGIT
  1227.  
  1228.    Extended client information for "user".
  1229.  
  1230.    "cipher-name" and "cipher-bits" describe the name of the encryption
  1231.    cipher the client connected using, and the strength in bits of said
  1232.    cipher. These fields may be empty or zero, respectively.
  1233.  
  1234.    "login-time" and "idle-time" respectively describe when the client 
  1235.    joined the server, and when the client was last active.
  1236.  
  1237.    "downloads" and "uploads" are optional fields that contain any number
  1238.    of "transfer", inter-spaced with RS. These fields may be empty.
  1239.  
  1240.    In response to "INFO".   
  1241.  
  1242. 7.3.10 309 Broadcast Message
  1243.  
  1244.       "309" SP user FS message EOT
  1245.  
  1246.       user        = ID
  1247.       message     = STRING
  1248.  
  1249.    A server-wide broadcast message received from "user". The actual 
  1250.    message is contained within "message".
  1251.  
  1252. 7.3.11 310 User List
  1253.  
  1254.       "310" SP chat FS user FS idle FS admin FS icon FS nick FS login FS 
  1255.                ip FS host EOT
  1256.  
  1257.       chat     = ID
  1258.       user     = ID
  1259.       idle     = BOOLEAN
  1260.       admin    = BOOLEAN
  1261.       icon     = 1*DIGIT
  1262.       nick     = STRING
  1263.       login    = STRING
  1264.       ip       = IP
  1265.       host     = STRING
  1266.  
  1267.    A client in the user list. Same message format as 302.
  1268.  
  1269.    The user list comes sorted by the time each client joined,
  1270.    descending.
  1271.  
  1272.    In response to "WHO".
  1273.  
  1274. 7.3.12 311 User List Done
  1275.  
  1276.       "311" SP chat EOT
  1277.  
  1278.       chat    = ID
  1279.  
  1280.    End of user list for "chat".
  1281.  
  1282.    In response to "WHO".
  1283.  
  1284. 7.3.13 320 News
  1285.  
  1286.       "320" SP nick FS post-time FS post EOT
  1287.  
  1288.       nick         = STRING
  1289.       post-time    = date-time
  1290.       post         = STRING
  1291.  
  1292.    A news post, by "nick", posted at "post-time". The actual post
  1293.    is contained within "post".
  1294.  
  1295.    The news comes sorted by the time it was posted, ascending.
  1296.  
  1297.    In response to "NEWS".
  1298.  
  1299. 7.3.14 321 News Done
  1300.  
  1301.       "321" SP "Done" EOT
  1302.  
  1303.    End of news transfer.
  1304.  
  1305.    In response to "NEWS".
  1306.  
  1307. 7.3.15 322 News Posted
  1308.  
  1309.       "322" SP nick FS post-time FS post EOT
  1310.  
  1311.       nick         = STRING
  1312.       post-time    = date-time
  1313.       post         = STRING
  1314.  
  1315.    A new news post. Same message format as 320.
  1316.  
  1317. 7.3.16 330 Private Chat Created
  1318.  
  1319.       "330" SP chat EOT
  1320.  
  1321.       chat     = ID
  1322.  
  1323.    A new private chat has been created on the server, and the received
  1324.    has been added to it.
  1325.  
  1326.    See section 3.2 for more information on private chat sequences.
  1327.  
  1328.    In response to "PRIVCHAT".
  1329.  
  1330. 7.3.17 331 Private Chat Invitiation
  1331.  
  1332.       "331" SP chat FS user EOT
  1333.  
  1334.       chat     = ID
  1335.       user     = ID
  1336.  
  1337.    The client "user" has invited the received to the private chat
  1338.    "chat".
  1339.  
  1340.    See section 3.2 for more information on private chat sequences.
  1341.  
  1342. 7.3.18 332 Private Chat Declined
  1343.  
  1344.       "332" SP chat FS user EOT
  1345.  
  1346.       chat     = ID
  1347.       user     = ID
  1348.  
  1349.    The client "user" declined the invitation to the chat "chat".
  1350.  
  1351.    See section 3.2 for more information on private chat sequences.
  1352.  
  1353. 7.4 400 Class Messages
  1354.  
  1355. 7.4.1 400 Transfer Ready
  1356.  
  1357.       "400" SP path FS offset FS hash EOT
  1358.  
  1359.       path      = STRING
  1360.       offset    = 1*DIGIT
  1361.       hash      = STRING
  1362.  
  1363.    The transfer of "path" is ready to begin. "hash" is a unique
  1364.    identifier for this particular transfer.
  1365.  
  1366.    See section 4 for more information on files.
  1367.  
  1368.    In response to "GET" and "PUT".
  1369.  
  1370. 7.4.2 401 Transfer Queued
  1371.  
  1372.       "401" SP path FS position EOT
  1373.  
  1374.       path        = STRING
  1375.       position    = 1*DIGIT
  1376.  
  1377.    The transfer of "path" has been queued in line at "position". If
  1378.    "position" is greater than 1, additional 401 messages will be sent
  1379.    until the position reaches 0, at which point a 400 message will be
  1380.    sent.
  1381.  
  1382.    See section 4 for more information on files.
  1383.  
  1384.    In response to "GET" and "PUT".
  1385.  
  1386. 7.4.3 402 File Information
  1387.  
  1388.       "402" SP path FS type FS size FS created FS modified FS
  1389.                checksum EOT
  1390.  
  1391.       path        = STRING
  1392.       type        = file-type
  1393.       size        = 1*DIGIT
  1394.       created     = date-time
  1395.       modified    = date-time
  1396.       checksum    = STRING
  1397.  
  1398.    Extended file information for "path".
  1399.  
  1400.    See section 4 for more information on files.
  1401.  
  1402.    In response to "STAT".
  1403.  
  1404. 7.4.4 410 File Listing
  1405.  
  1406.       "410" SP path FS type FS size EOT
  1407.  
  1408.       path    = STRING
  1409.       type    = file-type
  1410.       size    = 1*DIGIT
  1411.  
  1412.    A file in the file listing.
  1413.  
  1414.    The file listing comes sorted by filename, descending.
  1415.  
  1416.    See section 4 for more information on files.
  1417.  
  1418.    In response to "LIST".
  1419.  
  1420. 7.4.5 411 File Listing Done
  1421.  
  1422.       "411" SP path FS free EOT
  1423.  
  1424.       path    = STRING
  1425.       free    = 1*DIGIT
  1426.  
  1427.    End of file listing for "path". "free" contains the number of octets
  1428.    available in the file system that "path" resides on. This number
  1429.    should only be sent for paths where the receiver has uploads 
  1430.    privileges, otherwise a value of zero should be sent. It is up to the
  1431.    client to determine whether this zero means a full file system or a
  1432.    lack of privileges.
  1433.  
  1434.    In response to "LIST".
  1435.  
  1436. 7.4.6 420 Search Listing
  1437.  
  1438.       "420" SP path FS type FS size EOT
  1439.  
  1440.       path    = STRING
  1441.       type    = file-type
  1442.       size    = 1*DIGIT
  1443.  
  1444.    A file in the search listing. Same message format as 410.
  1445.  
  1446.    The sorting of the search listing is undefined.
  1447.  
  1448.    See section 4 for more information on files.
  1449.  
  1450.    In response to "SEARCH".
  1451.  
  1452. 7.4.7 421 Search Listing Done
  1453.  
  1454.       "421" SP "Done" EOT
  1455.  
  1456.    End of search listing.
  1457.  
  1458.    In response to "SEARCH".
  1459.  
  1460. 7.5 500 Class Messages
  1461.  
  1462. 7.5.1 500 Command Failed
  1463.  
  1464.       "500" SP "Command Failed" EOT
  1465.  
  1466.    An undefined internal error prevented the command from completing.
  1467.  
  1468. 7.5.2 501 Command Not Recognized
  1469.  
  1470.       "501" SP "Command Not Recognized" EOT
  1471.  
  1472.    The command was not recognized.
  1473.  
  1474. 7.5.3 502 Command Not Implemented
  1475.  
  1476.       "502" SP "Command Not Implemented" EOT
  1477.  
  1478.    The command has not been implemented by the server.
  1479.  
  1480. 7.5.4 503 Syntax Error
  1481.  
  1482.       "503" SP "Syntax Error" EOT
  1483.  
  1484.    There was a syntax error in the command.
  1485.  
  1486. 7.5.5 510 Login Failed
  1487.  
  1488.       "510" SP "Login Failed" EOT
  1489.  
  1490.    The login could not complete, the login and/or password provided did 
  1491.    not match a valid entry.
  1492.  
  1493. 7.5.6 511 Banned
  1494.  
  1495.       "511" SP "Banned" EOT
  1496.  
  1497.    The login could not complete, the user is banned.
  1498.  
  1499. 7.5.7 512 Client Not Found
  1500.  
  1501.       "512" SP "Client Not Found" EOT
  1502.  
  1503.    The server could not find the client referred to.
  1504.  
  1505. 7.5.8 513 Account Not Found
  1506.  
  1507.       "513" SP "Account Not Found" EOT
  1508.  
  1509.    The server could not find the account referred to.
  1510.  
  1511. 7.5.9 514 Account Exists
  1512.  
  1513.       "514" SP "Account Exists" EOT
  1514.  
  1515.    The account referred to already exists.
  1516.  
  1517. 7.5.10 515 Cannot Be Disconnected
  1518.  
  1519.       "515" SP "Cannot Be Disconnected" EOT
  1520.  
  1521.    The user attempted to kick or ban another user that has the privilege
  1522.    "cannot-be-disconnected".
  1523.  
  1524. 7.5.11 516 Permission Denied
  1525.  
  1526.       "516" SP "Permission Denied" EOT
  1527.  
  1528.    The command could not complete, the client lacks sufficient 
  1529.    privileges.
  1530.  
  1531. 7.5.12 520 File or Directory Not Found
  1532.  
  1533.       "520" SP "File or Directory Not Found" EOT
  1534.  
  1535.    The file or directory referred to could not be found.
  1536.  
  1537. 7.5.13 521 File or Directory Exists
  1538.  
  1539.       "521" SP "File or Directory Exists" EOT
  1540.  
  1541.    There already exists a file or directory at the path referred to.
  1542.  
  1543. 7.5.14 522 Checksum Mismatch
  1544.  
  1545.       "522" SP "Checksum Mismatch" EOT
  1546.  
  1547.    The two checksums do not match.
  1548.  
  1549. 7.6 600 Class Messages
  1550.  
  1551. 7.6.1 600 User Specification
  1552.  
  1553.       "600" SP name FS password FS group FS privileges EOT
  1554.  
  1555.       name        = STRING
  1556.       group       = STRING
  1557.       password    = STRING
  1558.  
  1559.    A specification of a user account.
  1560.  
  1561.    See section 2.8 for a specification of "privileges".
  1562.  
  1563.    See section 5 for more information on accounts.
  1564.  
  1565.    In response to "READUSER".
  1566.  
  1567. 7.6.2 601 Group Specification
  1568.  
  1569.       "601" SP name FS privileges EOT
  1570.  
  1571.       name    = STRING
  1572.  
  1573.    A specification of a group account.
  1574.  
  1575.    See section 2.8 for a specification of "privileges".
  1576.  
  1577.    See section 5 for more information on accounts.
  1578.  
  1579.    In response to "READGROUP".
  1580.  
  1581. 7.6.3 602 Privileges Specification
  1582.  
  1583.       "602" SP privileges EOT
  1584.  
  1585.    The privileges mask for the receiver.
  1586.  
  1587.    See section 2.8 for a specification of "privileges".
  1588.  
  1589.    See section 5 for more information on accounts.
  1590.  
  1591.    In response to "PRIVILEGES".
  1592.  
  1593. 7.6.4 610 User Listing
  1594.  
  1595.       "610" SP name EOT
  1596.  
  1597.       name    = STRING
  1598.  
  1599.    A user account in the user accounts listing.
  1600.  
  1601.    The sorting of the user accounts listing is undefined.
  1602.  
  1603.    See section 5 for more information on accounts.
  1604.  
  1605.    In response to "USERS".
  1606.  
  1607. 7.6.5 611 User Listing Done
  1608.  
  1609.       "611" SP "Done" EOT
  1610.  
  1611.    End of user listing.
  1612.  
  1613.    In response to "USERS".
  1614.  
  1615. 7.6.6 620 Group Listing
  1616.  
  1617.       "620" SP name EOT
  1618.  
  1619.       name    = STRING
  1620.  
  1621.    A group account in the group accounts listing.
  1622.  
  1623.    The sorting of the group accounts listing is undefined.
  1624.  
  1625.    See section 5 for more information on accounts.
  1626.  
  1627.    In response to "GROUPS".
  1628.  
  1629. 7.6.7 621 Group Listing Done
  1630.  
  1631.       "621" SP "Done" EOT
  1632.  
  1633.    End of group listing.
  1634.  
  1635.    In response to "GROUPS".
  1636.  
  1637. 8 References
  1638.  
  1639.    [1] Dierks, D. and Allen, C., "The TLS Protocol Version 1.0", RFC 
  1640.        2246, January 1999.
  1641.  
  1642.    [2] Eastlake, D., "US Secure Hash Algorithm 1 (SHA1)", RFC 3174, 
  1643.        September 2001.
  1644.  
  1645.    [3] "Information Technology - Universal Multiple- Octet Coded 
  1646.        Character Set (UCS) - Part 1: Architecture and Basic Multilingual 
  1647.        Plane", ISO/IEC 10646-1:1993. 
  1648.  
  1649.    [4] Yergeau, F., "UTF-8, a transformation format of ISO 10646", RFC 
  1650.        2279, January 1998.
  1651.  
  1652.    [5] "Data elements and interchange formats - Information interchange 
  1653.        - Representation of dates and times", ISO 8601:1988(E), 
  1654.        International Organization for Standardization, June, 1988.
  1655.  
  1656.    [6] Newman, C., "Date and Time on the Internet: Timestamps", RFC 
  1657.        3339, July 2002.
  1658.  
  1659.    [7] "Coded Character Set - 7-Bit American Standard Code for 
  1660.        Information Interchange", Standard ANSI X3.4-1986, ANSI, 1986.
  1661.  
  1662.    [8] Postel, J., "Assigned Numbers", RFC 790, September 1981.
  1663.  
  1664.    [9] Hinden, R. and Deering, S., "IP Version 6 Addressing 
  1665.        Architecture", RFC 1884, December 1995.
  1666.  
  1667. 9 Author's Address
  1668.  
  1669.    Axel Andersson, axel@zankasoftware.com
  1670.  
  1671. 10 Full Copyright Statement
  1672.  
  1673.    Copyright (C) Axel Andersson 2003-2004. All Rights Reserved.
  1674.  
  1675.    This document and translations of it may be copied and furnished to
  1676.    others, and derivative works that comment on or otherwise explain
  1677.    it or assist in its implementation may be prepared, copied,
  1678.    published and distributed, in whole or in part, without restriction
  1679.    of any kind, provided that the above copyright notice, this
  1680.    paragraph and the following disclaimer are included on all such
  1681.    copies and derivative works.
  1682.  
  1683.    THIS DOCUMENT AND THE INFORMATION CONTAINED HEREIN IS PROVIDED BY
  1684.    THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
  1685.    INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  1686.    MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  1687.