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

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