home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1997 December / Internet_Info_CD-ROM_Walnut_Creek_December_1997.iso / drafts / draft_ietf_a_c / draft-ietf-asid-whoispp-01.txt < prev    next >
Text File  |  1997-03-27  |  87KB  |  2,117 lines

  1.  
  2. ASID Working Group                                      Patrik Faltstrom
  3. Internet-Draft                                                    Tele 2
  4. Expires: September  1997                                     Sima Newell
  5. draft-ietf-asid-whoispp-01.txt           Bunyip Information Systems Inc.
  6. Replaces: RFC-1835                                      Leslie L. Daigle
  7.                                          Bunyip Information Systems Inc.
  8.                                                               March 1997
  9.  
  10.                   Architecture of the Whois++ service
  11.  
  12. Status of this Memo
  13.  
  14.       This document is an Internet-Draft.  Internet-Drafts are working
  15.       documents of the Internet Engineering Task Force (IETF), its
  16.       areas, and its working groups.  Note that other groups may also
  17.       distribute working documents as Internet-Drafts.
  18.  
  19.       Internet-Drafts are draft documents valid for a maximum of six
  20.       months and may be updated, replaced, or obsoleted by other docu-
  21.       ments at any time.  It is inappropriate to use Internet- Drafts as
  22.       reference material or to cite them other than as ``work in
  23.       progress.''
  24.  
  25.       To learn the current status of any Internet-Draft, please check
  26.       the ``1id-abstracts.txt'' listing contained in the Internet-
  27.       Drafts Shadow Directories on ftp.is.co.za (Africa), nic.nordu.net
  28.       (Europe), munnari.oz.au (Pacific Rim), ds.internic.net (US East
  29.       Coast), or ftp.isi.edu (US West Coast).
  30.  
  31.       Distribution of this document is unlimited.
  32.  
  33. Abstract
  34.  
  35.    This document describes Whois++, an extension to the trivial WHOIS
  36.    service described in RFC 954 to permit WHOIS-like servers to make
  37.    available more structured information to the Internet.  We describe
  38.    an extension to the simple WHOIS data model and query protocol and a
  39.    companion extensible, distributed indexing service.  A number of
  40.    options have also been added such as the use of multiple languages
  41.    and character sets, more advanced search expressions, structured data
  42.    and a number of other useful features.  An optional authentication
  43.    mechanism for protecting all or part of the associated Whois++
  44.    information database from unauthorized access is also described.
  45.  
  46. Table of Contents
  47.  
  48.    Part I - Whois++ Overview .................................
  49.    1.1.  Purpose and Motivation ..............................
  50.    1.2.  Basic Information Model .............................
  51.    1.2.1.  Changes to the current WHOIS Model ................
  52.    1.2.2.  Registering Whois++ servers .......................
  53.    1.2.3.  The Whois++ Search Selection Mechanism ............
  54.    1.2.4.  The Whois++ Architecture ..........................
  55.    1.3.  Indexing in Whois++ .................................
  56.    1.4.  Getting Help ........................................
  57.    1.4.1.  Minimum HELP Required .............................
  58.    1.5.  Options and Constraints .............................
  59.    1.6.  Formatting Responses ................................
  60.    1.7.  Reporting Warnings and Errors .......................
  61.    1.8.  Privacy and Security Issues .........................
  62.    Part II - Whois++ Implementation ..........................
  63.    2.1.  The Whois++ interaction model .......................
  64.    2.2.  The Whois++ Command set .............................
  65.    2.2.1.  System Commands ...................................
  66.    2.2.1.1.  The COMMANDS command ............................
  67.    2.2.1.2.  The CONSTRAINTS command .........................
  68.    2.2.1.3.  The DESCRIBE command ............................
  69.    2.2.1.4.  The HELP command ................................
  70.    2.2.1.5.  The LIST command ................................
  71.    2.2.1.6.  The POLLED-BY command ...........................
  72.    2.2.1.7.  The POLLED-FOR command ..........................
  73.    2.2.1.8.  The SHOW command ................................
  74.    2.2.1.9.  The VERSION command .............................
  75.    2.2.2.  The Search Command ................................
  76.    2.2.2.1.  Format of a Search Term .........................
  77.    2.2.2.2.  Format of a Search String .......................
  78.    2.3.  Whois++ Constraints .................................
  79.    2.3.1.  Required Constraints ..............................
  80.    2.3.2.  Optional CONSTRAINTS ..............................
  81.    2.3.2.1.  The SEARCH Constraint ...........................
  82.    2.3.2.2.  The FORMAT Constraint ...........................
  83.    2.3.2.3.  The MAXFULL Constraint ..........................
  84.    2.3.2.4.  The MAXHITS Constraint ..........................
  85.    2.3.2.5.  The CASE Constraint .............................
  86.    2.3.2.6.  The AUTHENTICATE Constraint .....................
  87.    2.3.2.7.  The NAME Constraint .............................
  88.    2.3.2.8.  The PASSWORD Constraint .........................
  89.    2.3.2.9.  The LANGUAGE Constraint .........................
  90.    2.3.2.10.  The INCHARSET Constraint .......................
  91.    2.3.2.11.  The INCHARSET Constraint .......................
  92.    2.3.2.12.  The IGNORE Constraint ..........................
  93.    2.3.2.13.  The INCLUDE Constraint .........................
  94.    2.4.  Server Response Modes ...............................
  95.    2.4.1.  Default Responses .................................
  96.    2.4.2.  Format of Responses ...............................
  97.    2.4.3.  Syntax of a Formatted Response ....................
  98.    2.4.3.1.  A FULL format response ..........................
  99.    2.4.3.2.  ABRIDGED Format Response ........................
  100.    2.4.3.3.  HANDLE Format Response ..........................
  101.    2.4.3.4.  SUMMARY Format Response .........................
  102.    2.4.3.5.  SERVERS-TO-ASK Response .........................
  103.    2.4.4.  System Generated Messages .........................
  104.    2.5.  Compatibility with Older WHOIS Servers ..............
  105.    3.  Miscellaneous .........................................
  106.    3.1.  Acknowledgements ....................................
  107.    3.2.  References ..........................................
  108.    3.3.  Authors' Addresses ..................................
  109.    Appendix A - Some Sample Queries ..........................
  110.    Appendix B - Some sample responses ........................
  111.    Appendix C - Sample responses to system commands ..........
  112.    Appendix D - Sample Whois++ session .......................
  113.    Appendix E - System messages ..............................
  114.    Appendix F - The Whois++ Input Syntax .....................
  115.    Appendix G - The Whois++ Response Syntax ..................
  116.    Appendix H - Description of Regular expressions ...........
  117.  
  118. 1.  Part I - Whois++ Overview
  119.  
  120. 1.1.  Purpose and Motivation
  121.  
  122.    The current NIC WHOIS service [HARR85] is used to provide a very
  123.    limited directory service, serving information about a small number
  124.    of Internet users registered with the DDN NIC. Over time the basic
  125.    service has been expanded to serve additional information and similar
  126.    services have also been set up on other hosts.  Unfortunately, these
  127.    additions and extensions have been done in an ad hoc and
  128.    uncoordinated manner.
  129.  
  130.    The basic WHOIS information model represents each individual record
  131.    as a Rolodex-like collection of text. Each record has a unique
  132.    identifier (or handle), but otherwise is assumed to have little
  133.    structure. The current service allows users to issue searches for
  134.    individual strings within individual records, as well as searches for
  135.    individual record handles using a very simple query-response
  136.    protocol.
  137.  
  138.    Despite its utility, the current NIC WHOIS service cannot function as
  139.    a general White Pages service for the entire Internet. Given the
  140.    inability of a single server to offer guaranteed response or
  141.    reliability, the huge volume of traffic that a full scale directory
  142.    service will generate and the potentially huge number of users of
  143.    such a service, such a trivial architecture is obviously unsuitable
  144.    for the current Internet's needs for information services.
  145.  
  146.    This document describes the architecture and protocol for Whois++, a
  147.    simple, distributed and extensible information lookup service based
  148.    upon a small set of extensions to the original WHOIS information
  149.    model.  These extensions allow the new service to address the
  150.    community's needs for a simple directory service, yet the extensible
  151.    architecture is expected to also allow it to find applications in a
  152.    number of other information service areas.
  153.  
  154.    Added features include an extension to the trivial WHOIS data model
  155.    and query protocol and a companion extensible, distributed indexing
  156.    service. A number of other options have also been added, like boolean
  157.    operators, more powerful search constraints and search methods.  In
  158.    addition, the data has been structured to make both the client and
  159.    server elements of the dialogue more stringent and easily
  160.    parsed.  An optional authentication mechanism for protecting all or
  161.    parts of the associated Whois++ information database from
  162.    unauthorized access is also briefly described.
  163.  
  164.    The architecture of Whois++ allows distributed maintenance of
  165.    the directory contents and the use of the Whois++ indexing service
  166.    for locating additional Whois++ servers. Although a general overview
  167.    of this service is included for completeness, the indexing extensions
  168.    are described described separately in [WINDX].
  169.  
  170.    It should be noted that Whois++ is not backward compatible with WHOIS.
  171.  
  172. 1.2.  The Whois++ Information Model
  173.  
  174.    The Whois++ service is based on the use of information templates, which
  175.    consist of ordered sets of data elements (or attribute-value pairs).
  176.    It underlying recommendation is to use standardized templates where
  177.    available.
  178.  
  179.    It is intended that adding structured template types to a server 
  180.    and subsequently searching through information stored in templates
  181.    of a specified type should be simple tasks.  The creation and use of 
  182.    customized templates should also be possible with little effort, although 
  183.    their use is discouraged where appropriate standardized templates exist.
  184.  
  185.    Registration and schema definitions are done on an attribute by
  186.    attribute basis, so a client that receives a record parses the
  187.    record structure one attribute at a time. Because of this system,
  188.    the client does not need to know the structure of the whole record,
  189.    only individual attributes. If the client sees an unknown
  190.    attribute, it will skip that one and continue parsing the
  191.    subsequent attributes.  A server that defines schemas can therefore
  192.    add its own unregistered attributes to a well-defined template type.
  193.  
  194.    We also offer methods to allow the user to constrain searches to
  195.    desired attributes or template types, in addition to the existing
  196.    commands for specifying handles or simple strings.
  197.  
  198.    It is expected that the minimalist approach we have taken will find
  199.    applications where the high cost of configuring and operating
  200.    traditional White Pages services can not currently be justified.
  201.  
  202.    Note also that the architecture makes no assumptions about the search
  203.    and retrieval mechanisms used within individual servers.  Operators
  204.    are free to use dedicated database formats, fast indexing software or
  205.    even provide gateways to other directory services to store and
  206.    retrieve information. The Whois++ server simply functions as a
  207.    known front end, offering a simple data model and communicating
  208.    through a well known port and query protocol. The format of both
  209.    queries and replies has been structured to allow the use of client
  210.    software for generating searches and displaying the results. At the
  211.    same time, some effort has been made to keep responses legible (to
  212.    some degree) by human users, both to ensure low entry cost and to
  213.    ease debugging.
  214.  
  215.    The actual implemention details of an individual Whois++ search
  216.    engine are left to the imagination of the implementor.  It is hoped
  217.    that the simple, extensible approach taken will encourage
  218.    experimentation and the development of improved search engines.
  219.  
  220. 1.2.1.  Changes to the current WHOIS Model
  221.  
  222.    The current WHOIS service is based upon an extremely simple data
  223.    model.  The NIC WHOIS database consists of a series of individual
  224.    records, each of which is identified by a single unique identifer
  225.    (the "handle"). Each record contains one or more lines of
  226.    information. Currently, there is no structure or implicit ordering of
  227.    this information, although each record is implicitly concerned
  228.    with information about a single user or service.
  229.  
  230.    We have implemented two basic changes to this model. First, we have
  231.    structured the information within the database as collections of data
  232.    elements that are simple attribute/value pairs. Each individual record
  233.    contains a specified ordered set of these data elements.
  234.  
  235.    Second, we have introduced the classing of database records into
  236.    template types. In effect, each record is based upon one template of a
  237.    specified set; each template contains a finite and specified number
  238.    of data elements. This classing allows users to limit searches 
  239.    to specific collections of information, such as information about
  240.    users, services, abstracts of papers, or descriptions of software.
  241.  
  242.    Since the data typing is done at the attribute level, not the template
  243.    level, it is also possible to add non-standard attributes to a 
  244.    well-known template type.
  245.  
  246.    As an addition to the model, we require that each individual Whois++
  247.    database on the Internet be assigned a unique handle, analogous to
  248.    the handle associated with each database record.
  249.  
  250.    The Whois++ database structure is shown in Fig. 1.
  251.  
  252.  ______________________________________________________________________
  253. |                                                                      |
  254. |   +  Single unique Whois++ server   handle                           |
  255. |                                                                      |
  256. |              _______                 _______                _______  |
  257. |    handle3  |..  .. |      handle6  |..  .. |     handle9  |..  .. | |
  258. |            _______  |              _______  |             _______  | |
  259. |  handle2  |..  .. |      handle5  |..  .. |     handle8  |..  .. |   |
  260. |           _______ |               _______ |              _______ |   |
  261. | handle1  |..  .. |      handle4  |..  .. |     handle7  |..  .. |    |
  262. |          |..  .. |               |..  .. |              |..  .. |    |
  263. |           -------                 -------                -------     |
  264. |      Template                   Template               Template      |
  265. |       Type 1                     Type 2                 Type 3       |
  266. |                                                                      |
  267. |                                                                      |
  268. |                                                                      |
  269. |                                                                      |
  270. |               Fig.1 - Structure of a Whois++ database.               |
  271. |                                                                      |
  272. | Notes: - Entire database is identified by a single unique Whois++    |
  273. |          serverhandle.                                               |
  274. |        - Each record has a single unique handle.               |
  275. |     - Each record has a specific set of attributes, which is      |
  276. |          determined by the Template Type used.               |
  277. |        - Each value associated with an attribute is a text string    |
  278. |          of an arbitrary length.                                     |
  279. |______________________________________________________________________|
  280.  
  281.  
  282.  
  283. 1.2.2.  Registering Whois++ servers
  284.  
  285.    We propose that individual database handles be registered through the
  286.    Internet Assigned Numbers Authority (the IANA), ensuring their
  287.    uniqueness. This will allow us to specify each Whois++ entry on the
  288.    Internet as a unique pair consisting of a server handle and a record
  289.    handle.
  290.  
  291.    A unique registered handle is preferable to using the host's IP
  292.    address, since it is conceivable that the Whois++ server for a
  293.    particular domain may move over time.  If we preserve the unique
  294.    Whois++ handle in such cases we have the option of using it for
  295.    resource discovery and networked information retrieval (see [IIIR]
  296.    for a discussion of resource and discovery and support issues).
  297.  
  298.    Uniqueness of server handles can be guaranteed by registering them with
  299.    IANA.
  300.  
  301.    We believe that organizing information around a series of such
  302.    templates will make it easier for administrators to gather and
  303.    maintain this information and thus encourage them to make such
  304.    information available.  At the same time, as users become more
  305.    familiar with the data elements available within specific templates
  306.    they will be able to specify their searches better, and the service
  307.    will become more useful.
  308.  
  309.  
  310. 1.2.3.  The Whois++ Search Selection Mechanism
  311.  
  312.    The WHOIS++ search mechanism is intended to be extremely simple. A
  313.    search command comprises one required element and one optional
  314.    element.  The first (required) element is a set of one or more search
  315.    terms.  The second (optional) element is a colon followed by set of 
  316.    one or more global constraints, which modify or control the search.
  317.  
  318.    Within each search term, the user may specify the template type,
  319.    attribute, value or handle that any record returned must satisfy. Each
  320.    search term can have an optional set of local constraints that apply
  321.    only to that term.
  322.                        
  323.    A Whois++ database may be seen as a single collection of
  324.    typed records. Each search term specifies a further constraint that the
  325.    selected set of output records must satisfy. Each term may thus be
  326.    thought of as performing a subtractive selection, in the sense that
  327.    any record that does not fulfill the term is discarded from the result
  328.    set.  Result sets can be further specified by supplying multiple search
  329.    terms, related by logical connectives (AND, OR, NOT).  
  330.  
  331. 1.2.4.  The Whois++ Architecture
  332.  
  333.    The Whois++ directory service has an architecture which is separated
  334.    into two components: the base level server, which is described in
  335.    this paper, and an indexing server (described in [WINDX]). A single 
  336.    physical server can act as both a base level server and an indexing server.
  337.  
  338.    A base level server is one which contains only filled templates. An
  339.    indexing server is one which contains forward knowledge (q.v.) and
  340.    pointers to other indexing servers or base level servers.
  341.  
  342. 1.3.  Indexing in Whois++
  343.  
  344.    Indexing in Whois++ is used to tie together many base level servers
  345.    and index servers into a unified directory service.  For more detailed
  346.    information on this subject, see [WINDX].
  347.  
  348.    Each base level server and index server that is to participate
  349.    in the unified directory service must generate forward knowledge
  350.    for the entries it contains. One type of forward knowledge is the
  351.    "centroid".
  352.  
  353.    An example of a centroid is as follows.  Consider a Whois++ server
  354.    that contains exactly three records:
  355.  
  356.         Record 1                        Record 2
  357.         Template: Person                Template: Person
  358.         First-Name: John                First-Name: Joe
  359.         Last-Name: Smith                Last-Name: Smith
  360.         Favourite-Drink: Labatt Beer    Favourite-Drink: Molson Beer
  361.  
  362.         Record 3
  363.         Template: Domain
  364.         Domain-Name: foo.edu
  365.         Contact-Name: Mike Foobar
  366.  
  367.         the centroid for this server would be
  368.  
  369.         Template:       Person
  370.         First-Name:     Joe
  371.                         John
  372.         Last-Name:      Smith
  373.         Favourite-Drink:Beer
  374.                         Labatt
  375.                         Molson
  376.  
  377.         Template:       Domain
  378.         Domain-Name:    foo.edu
  379.         Contact-Name:   Mike
  380.                         Foobar
  381.  
  382.    An index server would then collect this centroid for this server as
  383.    forward knowledge.
  384.  
  385.    Index servers can collect forward knowledge for any servers it
  386.    polls.  In effect, all of the servers that the index server knows
  387.    about can be searched with a single query to the index server; the
  388.    index server holds the forward knowledge along with pointers to the
  389.    servers it indexes, and can refer the query to servers which might
  390.    hold information which satisfies the query.
  391.  
  392.    Implementors of this protocol are strongly encouraged to incorporate
  393.    centroid generation abilities into their servers.
  394.  
  395.    Whois++ uses the Common Indexing Protocol, which was originally described 
  396.    in [WINDX] as a centroid-like object to provide index information
  397.    (forward knowledge) about server contents.  This work is being extended in 
  398.    the IETF's FIND Working-Group.
  399.  
  400.  
  401. -------------------------------------------------------------------
  402.  
  403.                               ____             ____
  404. top level                    |    |           |    |
  405. whois index                  |    |           |    |
  406. servers                       ----             ----
  407.                              /    \________     /
  408.                             /              \   /
  409.                         ____                ____
  410. first level            |    |              |    |
  411. whois index            |    |              |    |
  412. servers                 ----                ----
  413.                        /                   /    \
  414.                       /                   /      \
  415.                     ____                ____      ____
  416. individual         |    |              |    |    |    |
  417. whois servers      |    |              |    |    |    |
  418.                     ----                ----      ----
  419.  
  420.  
  421.                  Fig. 2 - Indexing system architecture.
  422.  
  423. -------------------------------------------------------------------
  424.  
  425. 1.4.  Getting Help
  426.  
  427.    Another extension to the basic WHOIS service is the requirement that
  428.    all servers support at least a minimal set of help commands, allowing
  429.    users to find out information about both the individual server and
  430.    the entire Whois++ service itself. This is done in the context of the
  431.    new extended information model by defining two specific template
  432.    formats and requiring each server to offer at least one example of
  433.    each record using these formats. The operator of each Whois++ service
  434.    is therefor expected to have, as a minimum, a single example of
  435.    SERVICES and HELP records, which can be accessed through appropriate
  436.    commands.
  437.  
  438. 1.4.1.  Minimum HELP Required
  439.  
  440.      Executing the command:
  441.  
  442.              DESCRIBE
  443.  
  444.      gives a brief information about the Whois++ server.
  445.  
  446.      Executing the command:
  447.  
  448.              HELP
  449.  
  450.      gives a brief description of the Whois++ service itself.
  451.  
  452.      The text of both required helped records should contain pointers to
  453.      additional help subjects that are available.
  454.  
  455.  
  456.      Executing the command:
  457.  
  458.              HELP <searchstring>
  459.  
  460.      gives information on <searchstring>.
  461.  
  462. 1.5.  Options and Constraints
  463.  
  464.    The Whois++ service is based upon a minimal core set of commands and
  465.    controlling constraints. A small set of additional optional commands
  466.    and constraints can be supported by a server. These allow users to
  467.    perform such tasks as provide security options, modify the
  468.    information contents of a server or add multilingual support. The
  469.    required set of Whois++ commands are listed in section 2.2.
  470.    Whois++ constraints are described in section 2.3. Optional
  471.    constraints are described in section 2.3.2.
  472.  
  473. 1.6.  Formatting Responses
  474.  
  475.    The output returned by a Whois++ server is structured to allow
  476.    machine parsing and automated handling. Of particular interest is the
  477.    ability to return summary information about a search instead of having
  478.    to return the entire results.
  479.  
  480.    All output of searches will be returned in one of five output
  481.    formats, which will be one of FULL, ABRIDGED, HANDLE, SUMMARY or
  482.    SERVER-TO-ASK.  Note that a conforming server is only required to
  483.    support the FULL format.
  484.  
  485.    When available, SERVER-TO-ASK format is used to indicate that a
  486.    search cannot be completed but that one or more alternative Whois++
  487.    servers may be able to perform the search.
  488.  
  489.    Details of each output format are specified in section 2.4.
  490.  
  491. 1.7.  Reporting Warnings and Errors
  492.  
  493.    The formatted response of Whois++ commands allows the encoding of
  494.    warning or error messages to simplify parsing and machine handling.
  495.    The syntax of output formats are described in detail in section 2.4,
  496.    and details of Whois++ warnings and error conditions are given in
  497.    Appendix E.
  498.  
  499.    All system messages are numerical, but can be tagged with text. It is
  500.    the client's decision if the text is presented to the user.
  501.  
  502. 1.8.  Privacy and Security Issues
  503.  
  504.    The basic Whois++ service was conceived as a simple, unauthenticated
  505.    information lookup service, but there are occasions when
  506.    authentication mechanisms are required. To handle such cases, one
  507.    optional mechanism is provided for authenticating each Whois++
  508.    transaction.  This is the ability to name a (mutually-recognized)
  509.    authentication scheme in the optional AUTHENTICATE  global constraint.
  510.  
  511.    The one currently defined authentication scheme is PASSWORD, which
  512.    uses simple password authentication. Any other scheme name used must
  513.    begin with the characters "X-" and should thus be regarded as
  514.    experimental and non-standard.
  515.  
  516.    Note that the Whois++ authentication mechanism does not dictate the
  517.    actual authentication scheme used, it merely provides a framework for
  518.    indicating that a particular transaction is to be authenticated, and
  519.    the appropriate scheme to use. This mechanism is extensible and
  520.    individual implementors are free to add additional schemes.
  521.  
  522.    This document describes a very simple authentication scheme in which a
  523.    combination of username and password is sent together with the search
  524.    string so the server can verify that the user have access to the
  525.    information. Note that this is NOT by any means a method recommended
  526.    to secure the data itself because both password and information are
  527.    transferred unencrypted over the network.
  528.  
  529.    Other, more sophisticated security and authentication schemes may
  530.    be proposed to address specific needs.  For example, the Simple 
  531.    Authentication and Security Layer (SASL) work proposed by John Myers
  532.    (particularly for POP and IMAP) may be applicable here.
  533.  
  534.  
  535. 2.  Part II - Whois++ Implementation
  536.  
  537. 2.1.  The Whois++ interaction model
  538.  
  539.    The Whois++ service has an assigned port number -- number 63.  
  540.    However, there is nothing inherent the Whois++ protocol or interaction
  541.    model that prevents it from being used on any TCP connection on
  542.    any port -- the specification of the connection is outside the scope
  543.    of this protocol spec.  Once a connection is established, the
  544.    server issues a banner message, and listens for input. The command
  545.    specified in this input is processed and the results returned
  546.    including an ending system message. If the client
  547.    does not specify the optional HOLD constraint, the connection is
  548.    then terminated.
  549.  
  550.    If the server supports the optional HOLD constraint, and this
  551.    constraint is specified as part of any command, the server continues
  552.    to listen on the connection for another (single) line of input.
  553.    This cycle continues as long as the sender continues to append the
  554.    required HOLD constraint to each subsequent command.
  555.  
  556.  
  557. 2.2.  The Whois++ Command set
  558.  
  559.    The Whois++ command set consists of a core set of required systems
  560.    commands, a single required search command and an set of optional
  561.    system commands which support features that are not required by all
  562.    servers. The set of required Whois++ system commands are listed in
  563.    Table I. Valid search terms for the search command
  564.    are described in Table II.
  565.  
  566.    Each Whois++ command also allows the use of one or more controlling
  567.    constraints, which, when selected, are used to override defaults or
  568.    otherwise modify the server's behavior. There is a core set of
  569.    constraints that must be supported by all conforming servers:
  570.    SEARCH (which controls the type of search performed), FORMAT (which
  571.    determines the output format used) and MAXHITS (which determines the
  572.    maximum number of matches that a search can return). These required
  573.    constraints are summarized in Table III.
  574.  
  575.    An additional set of optional constraints are used to provide support
  576.    for different character sets, provide data for the authentication 
  577.    scheme, and requesting multiple transactions during a single communications 
  578.    session. These optional constraints are listed in Table IV.
  579.  
  580.    It is possible, using the required COMMANDS and CONSTRAINTS system
  581.    commands, to query any Whois++ server for its list of supported
  582.    commands and constraints.
  583.  
  584.    Please note that the line terminator is defined as a carriage
  585.    return and line feed (CR/LF) pair.  Also, none of the commands or
  586.    constraints supported by Whois++ are case sensitive.  For example,
  587.    the following are equivalent: HELP, Help, help, hElp.
  588.    Capitalization of all letters (e.g. HELP) is used only to improve
  589.    the legibility of this document.  Finally, "attribute value" is
  590.    defined as "the value associated with an attribute".
  591.  
  592. 2.2.1.  System Commands
  593.  
  594.    System commands are commands to the server for information or to
  595.    control its operation. These include commands to list the template
  596.    types available from individual servers, to obtain a single blank
  597.    template of any available type, and commands to obtain the list of
  598.    valid commands and constraints supported on a server.
  599.  
  600.    There are also commands to obtain the current version of the Whois++
  601.    protocol supported, to access a simple help subsystem, to obtain a
  602.    brief description of the service provided by the Whois++
  603.    server. The DESCRIBE command is intended, among other
  604.    things, to support the automated registration of the service in
  605.    yellow pages directory services. The required commands are listed
  606.    in Table I.
  607.  
  608. ------------------------------------------------------------------------
  609.  
  610. Short Long Form                               Functionality
  611. -----  ---------                               -------------
  612.        COMMANDS        [ ':' HOLD ]          List Whois++ commands
  613.                                              supported by this server
  614.  
  615.        CONSTRAINTS     [ ':' HOLD ]          List valid constraints
  616.                                              supported by this server
  617.  
  618.        DESCRIBE        [ ':' HOLD ]          Describe this server,
  619.                                              formating the response
  620.                                              using a standard
  621.                                              SERVICES template
  622.  
  623.  '?'   HELP [<string>  [':' (<othercnstrnts> / HOLD) 
  624.                         0*(';' (<otherconstraints> / HOLD))]]     
  625.                                              Provide help specific to this
  626.                                              Whois++ server, using a 
  627.                                              "Help" template
  628.  
  629.        LIST            [':' (<othercnstrnts> / HOLD) 
  630.                         0*(';' (<otherconstraints> / HOLD))]
  631.                                              List templates supported
  632.                                              by this server
  633.  
  634.        POLLED-BY       [ ':' HOLD ]          List indexing servers
  635.                                              that are known to poll
  636.                                              this server
  637.  
  638.        POLLED-FOR      [ ':' HOLD ]          List information about
  639.                                              servers this server polls
  640.  
  641.        SHOW <string>   [':' <cnstrnts>]      Show contents of template
  642.                                              specified in <string>
  643.  
  644.        VERSION         [ ':' HOLD ]          Show the version of
  645.                                              the protocol supported by
  646.                          this server
  647.  
  648.               Table I - Required Whois++ SYSTEM commands.
  649.  
  650. ------------------------------------------------------------------------
  651.  
  652.    Below follows a descriptions for each command. Examples of responses
  653.    to each command are provided in Appendix C.
  654.  
  655. 2.2.1.1.  The COMMANDS command
  656.  
  657.    The COMMANDS command returns a list of commands that the server
  658.    supports. The response is formatted as a FULL response.
  659.  
  660. 2.2.1.2.  The CONSTRAINTS command
  661.  
  662.    The CONSTRAINTS command returns a list of both the constraints and
  663.    their values that the server supports. The response is formatted as a
  664.    FULL response, where every constraint is represented as a separate
  665.    record. The template name for these records is CONSTRAINT.  No
  666.    attention is paid to handles. Each record has, as a minimum, the
  667.    following two attributes:
  668.  
  669.      - "Constraint", whose value is the constraint name
  670.      - "Default", which shows the default value for this constraint.
  671.  
  672.    If the client is permitted to change the value of the constraint,
  673.    there is also:
  674.  
  675.      - "Range", which contains a list of values that this
  676.        server supports, as a comma separated list, or, if the range
  677.        is numerical, as a pair of numbers separated with a hyphen.
  678.  
  679.    Note that, irrespective of whether a session is continued (with the HOLD
  680.    constraint) or not, constraints are set to the default value unless
  681.    explicitly changed with a constraint in each query.
  682.  
  683. 2.2.1.3.  The DESCRIBE command
  684.  
  685.    The DESCRIBE command gives a brief description about the server in a
  686.    "Services" template. The result is formatted as a FULL response with
  687.    as a minimum one attribute:
  688.  
  689.      - "Text", which describes the service in a form legible by human users.
  690.  
  691. 2.2.1.4.  The HELP command
  692.  
  693.    The HELP command takes an optional argument which is the subject on
  694.    which to get help. The answer is formatted as a FULL format response.
  695.  
  696. 2.2.1.5.  The LIST command
  697.  
  698.    The LIST command returns the name of the templates available on the
  699.    server. The answer is formatted as a FULL format response.
  700.  
  701. 2.2.1.6.  The POLLED-BY command
  702.  
  703.    The POLLED-BY command returns a list of servers and the templates and
  704.    attribute names that those servers polled as centroids from this
  705.    server. The format is in FULL format with two attributes, "Template"
  706.    and "Field", whose values are lists of the names of the polled
  707.    templates and fields, respectively.  An empty result means either
  708.    that the server is not polled by anyone, or that it doesn't support
  709.    indexing.
  710.  
  711. 2.2.1.7.  The POLLED-FOR command
  712.  
  713.    The POLLED-FOR command returns a list of servers that this server has
  714.    polled, and the template and attribute names for each of those.  The
  715.    answer is in FULL format with two attributes, Template and Field.  An
  716.    empty result means either that the server is not polling anyone, or
  717.    that it doesn't support indexing.
  718.  
  719. 2.2.1.8.  The SHOW command
  720.  
  721.    The SHOW command takes a template name as argument and returns
  722.    information about that template, formatted as a FULL response.
  723.    The answer is formatted as a blank template with the requested name.
  724.  
  725. 2.2.1.9.  The VERSION command
  726.  
  727.    The output format is a FULL response containg a record with template
  728.    name VERSION. The record must have attribute name "Version", whose
  729.    value is "2.0" for this version of the protocol.  The record may also
  730.    have the additional fields "Program-Name" and "Program-Version" which
  731.    gives information about the server implementation if the server so
  732.    desires.
  733.  
  734.    If the server also supports the earlier version of the protocol,
  735.    "1.0", two records are given back as a response to the VERSION
  736.    command, one for each version supported.
  737.  
  738. 2.2.2.  The SEARCH Command
  739.  
  740.    A SEARCH command comprises one required element and one optional
  741.    element.  The first (required) element is a set of one or more search
  742.    terms.  The second (optional) element is a set of global constraints,
  743.    which modify or control the search. Each search term can have an
  744.    optional set of local constraints that apply only to that term.
  745.    
  746.    Each attribute value in the Whois++ database is divided into one or
  747.    more words separated by whitespace (see Appendix F for a definition
  748.    of whitespace) . Each search term operates on every word in the attribute 
  749.    value.
  750.  
  751.    Two or more search terms have to be combined with boolean operators AND,
  752.    OR or NOT. The operator AND has higher precedence than the operator OR,
  753.    but this can be changed by the use of parentheses.
  754.  
  755.    Boolean operators function as follows for two search terms, A and
  756.    B.  Let A1 be the result set from the first search term and B1 be the
  757.    result set from the second search.  The operation A AND B returns the
  758.    hits in the intersection of sets A1 and B1.  The operation A OR B
  759.    returns the hits in the union of the sets A1 and B1.  The operation
  760.    NOT A returns all possible results that are not in set A1.  The
  761.    behaviour of the boolean operators can be generalized to N search
  762.    terms where N > 2.  Note that NOT has a higher precedence than AND
  763.    or OR, so NOT A AND B returns the hits in B that are not in A.
  764.  
  765.    Search constraints that apply to all search terms are specified as
  766.    global constraints. Local constraints override global constraints for
  767.    the search term they are bound to. The search terms and the global
  768.    constraints are separated with a colon (':'). Each additional global
  769.    constraint is appended to the end of the search command, and a
  770.    semicolon ';' is used as the delimiter between global constraints.
  771.  
  772.    If any of the search constraints can not be fulfilled, or if
  773.    several of the specified constraints are mutually exclusive, the
  774.    server ignores the constraints that can not be fulfilled and those
  775.    that are mutually exclusive.  The server performs the search using
  776.    only the remaining constraints and returns the corresponding set of
  777.    records.
  778.  
  779.    The set of required constraints are listed in Table III. The set
  780.    of optional constraints are listed in Table IV.
  781.  
  782.    As an option, the server may accept specifications for attributes
  783.    to be included or excluded from a reply. Thus, users could specify
  784.    -only- those attributes to return, or specific attributes to filter
  785.    out, thus creating custom views.
  786.  
  787. 2.2.2.1.  Format of a Search Term
  788.  
  789.    Each search term consists of one of the following:
  790.  
  791.      1) A search string, followed by an optional set of semicolon-
  792.         separated local constraints. If local constraints are
  793.         specified, they are separated from the search string by a
  794.         semicolon.  This is noted as:
  795.  
  796.         <value>  [';' <constraint>]*
  797.  
  798.      2) A search term specifier (as listed in Table II), followed by a
  799.         '=', followed by a search string, an optional set of
  800.         semicolon-separated local constraints. If local constraints are
  801.         specified, they are separated from the search string by a
  802.         semicolon. This is noted as:
  803.  
  804.     <specifier> = <value> [';' <constraint>]*
  805.  
  806.      3) An attribute name, followed by '=', followed by
  807.         a search string, followed by an optional set of
  808.         semicolon-separate local constraints. If local constraints are
  809.         specified, they are separated from the search string by a
  810.         semicolon.
  811.  
  812.     <attribute_name> = <value>  [';' <constraint>]*
  813.  
  814.     (Note: A <constraint> is a valid local constraint specification.)
  815.  
  816.    If no search term specifier is provided, then the search will be
  817.    applied to attribute values only. This corresponds to an identifier
  818.    of VALUE.
  819.  
  820.    When the user specifies the search term using the form:
  821.  
  822.              "<attribute_name> = <value>"
  823.  
  824.    this is considered to be an ATTRIBUTE-VALUE search.
  825.  
  826.    For discussion of the system reply format, and selecting the
  827.    appropriate reply format, see section 2.4.
  828.  
  829.      -------------------------------------------------------------------
  830.  
  831.       Valid specifiers:
  832.       -----------------
  833.  
  834.       Name                                       Functionality
  835.       ----                                       -------------
  836.  
  837.       HANDLE                            Confine search to handles.
  838.       VALUE                             Confine search to attribute
  839.                                         values.
  840.  
  841.      (Note: The specifier HANDLE= can be replaced with the shorthand '!')
  842.  
  843.              Table II - Valid search command term specifiers.
  844.  
  845.       -------------------------------------------------------------------
  846.  
  847. 2.2.2.2.  Format of a Search String
  848.  
  849.    Special characters that need to be quoted are preceeded by a
  850.    backslash, '\'.
  851.  
  852.    Special characters are space ' ', tab, equal sign '=', comma ',',
  853.    colon ':', backslash '\', semicolon ';', asterisk '*', period '.',
  854.    parenthesis '()', square brackets '[]', dollar sign '$' and
  855.    circumflex '^'.
  856.  
  857.    If the search term is given in some other character set than ISO-
  858.    8859-1, it must be specified by the constraint INCHARSET.
  859.  
  860. 2.3.  Whois++ Constraints
  861.  
  862.    Constraints are intended to be hints or recommendations to the server
  863.    about how to process a command. They may also be used to override
  864.    default behaviour, such as requesting that a server not drop the
  865.    connection after performing a command.
  866.  
  867.    Thus, a user might specify a search constraint as "SEARCH=exact",
  868.    which means that the search engine is to perform an exact match
  869.    search. The user might also specify "LANGUAGE=Fr", which means that the
  870.    server should (if possible) display the French versions of the attribute 
  871.    values, and if possible use French in fuzzy matches. The server should also
  872.    issue system messages in French.
  873.  
  874.    In general, constraints take the form "<constraintname>=<value>", where
  875.    <value> is one of a specified set of valid values. The notable
  876.    exception is "HOLD", which takes no argument.
  877.  
  878.    All constraints can be used as a global constraint (i.e., on the
  879.    whole query transaction). Only a few can be used as a constraint
  880.    local to a search term. See tables III and IV for information about which
  881.    constraints can be local.
  882.  
  883.    The CONSTRAINTS system command is used to list the search constraints
  884.    supported by an individual server.
  885.  
  886.    If a server cannot satisfy the specified constraint, the server should
  887.    indicate this to the user through the use of system messages. 
  888.    In such cases, the search is still performed, with the the server
  889.    ignoring unsupported constraints.
  890.  
  891.  
  892. 2.3.1.  Required Constraints
  893.  
  894.    The following CONSTRAINTS must be supported in all conforming Whois++
  895.    servers.
  896.  
  897.      ------------------------------------------------------------------
  898.  
  899.       Format                                           LOCAL/GLOBAL
  900.       ------                                           -------------
  901.  
  902.      SEARCH=   exact / lstring                         LOCAL/GLOBAL
  903.  
  904.      FORMAT=   full / abridged / handle / summary      GLOBAL
  905.  
  906.      MAXHITS=  1-<max-allowed>                         GLOBAL
  907.  
  908.      Table III - Required Whois++ constraints.
  909.  
  910.      ------------------------------------------------------------------
  911.  
  912. 2.3.2.  Optional CONSTRAINTS
  913.  
  914.    The following CONSTRAINTS and constraint values are not required of a
  915.    conforming Whois++ server, but may be supported. If supported, their
  916.    names and supported values must be returned in the response to the
  917.    CONSTRAINTS command.
  918.  
  919.   ---------------------------------------------------------------------
  920.  
  921.    Format                                                    LOCAL/GLOBAL
  922.    ------                                                    -------------
  923.  
  924.   SEARCH=       regex / fuzzy / substring                    LOCAL/GLOBAL
  925.  
  926.   CASE=         ignore | consider                            LOCAL/GLOBAL
  927.  
  928.   FORMAT=       server-to-ask                                GLOBAL
  929.  
  930.   MAXFULL=      1-<max-allowed>                              GLOBAL
  931.  
  932.   AUTHENTICATE= password                                     GLOBAL
  933.  
  934.   NAME=         <string>                                     GLOBAL
  935.  
  936.   PASSWORD=     <string>                                     GLOBAL
  937.  
  938.   INCHARSET=    us-ascii / iso-8859-* /
  939.                   UNICODE-1-1-UTF-8 / UNICODE-2-0-UTF-8      GLOBAL
  940.  
  941.   OUTCHARSET=   us-ascii / iso-8859-* /
  942.                   UNICODE-1-1-UTF-8 / UNICODE-2-0-UTF-8      GLOBAL
  943.  
  944.   LANGUAGE=     <As defined in ISO 639:1988>                 GLOBAL
  945.  
  946.   HOLD                                                       GLOBAL
  947.  
  948.   IGNORE=       <attributelist>                              GLOBAL
  949.  
  950.   INCLUDE=      <attributelist>                              GLOBAL
  951.  
  952.                 Table IV - Optional Whois++ constraints.
  953.  
  954.   ----------------------------------------------------------------------
  955.  
  956. 2.3.2.1.  The SEARCH Constraint
  957.  
  958.    The SEARCH constraint is used for specifying the method that is to be
  959.    used for the search. The default method is "exact". Following is a
  960.    definition of each search method.
  961.  
  962.  
  963.    exact           The search will succeed for a word that exactly
  964.                    matches the search string.
  965.  
  966.    substring       The search will succeed for a word that matches
  967.                    a part of a word.
  968.  
  969.    regex           The search will succeed for a word when a regular
  970.                    expression matches the searched data. Regular
  971.                    expression is built up by using constructions of
  972.                    '*', '.', '^', '$', and '[]'. For use of
  973.                    regular expressions see Appendix H.
  974.  
  975.    fuzzy           The search will succeed for words that matches the
  976.                    search string by using an algorithm designed to catch
  977.                    closely related names with different spelling, e.g.
  978.                    names with the same pronunciation.  The server
  979.                    chooses which algorithm to use, but it may vary
  980.                    depending on template name, attribute name and
  981.                    language used (see Constraint Language above).
  982.  
  983.    lstring         The search will succeed for words that begins
  984.                    with the search string.
  985.  
  986. 2.3.2.2.  The FORMAT Constraint
  987.  
  988.    The FORMAT constraint describes what format the result will be in.
  989.    Default format is FULL. For a description of each format, see Server
  990.    Response Modes below.
  991.  
  992. 2.3.2.3.  The MAXFULL Constraint
  993.  
  994.    The MAXFULL constraint sets the limit of the number of matching
  995.    records the server allows before it enforces SUMMARY responses.  The
  996.    client may attempt to override this value by specifying another value
  997.    to that constraint. Example: If, for privacy reasons, the server is to
  998.    return the response in SUMMARY format if the number of hits exceeds
  999.    2, the MAXFULL constraint is set to 2 by the server.
  1000.  
  1001.    Regardless of what format the client asked for, the server will change the 
  1002.    response format to SUMMARY when the number of matching records equals or 
  1003.    exceeds this value.
  1004.  
  1005. 2.3.2.4.  The MAXHITS Constraint
  1006.  
  1007.    The MAXHITS constraint sets the maximum number of records returned to the
  1008.    client in response to a query.
  1009.  
  1010. 2.3.2.5.  The CASE Constraint
  1011.  
  1012.    The CASE constraint defines if the search should be case
  1013.    sensitive or not. Default value is to have case ignored.
  1014.  
  1015. 2.3.2.6.  The AUTHENTICATE Constraint
  1016.  
  1017.    The AUTHENTICATE constraint describes which authentication scheme to
  1018.    use when executing the search.   Depending on the authentication scheme
  1019.    used, some other constraints may have to be specified.    The authentication
  1020.    scheme definition identifies which constraints it requires.
  1021.  
  1022.    The only authentication scheme described in this document is
  1023.    "password".  If used, also the two other constraints "name" and
  1024.    "password" need to be set.
  1025.  
  1026. 2.3.2.7.  The NAME Constraint
  1027.  
  1028.    The NAME constraint is only used together with some authentication
  1029.    scheme named by the constraint "authenticate". 
  1030.  
  1031.    With the password authentication scheme, this is expected to be a string
  1032.    of characters representing a username, for which the specified password
  1033.    should be verified (i.e., similar to the UNIX login program).
  1034.  
  1035.  
  1036. 2.3.2.8.  The PASSWORD Constraint
  1037.  
  1038.    The PASSWORD constraint is only used together with some
  1039.    authentication scheme named by the constraint "authenticate". 
  1040.  
  1041.    The password authentication scheme requires that the password associated
  1042.    with the username be supplied by this constraint.  The server
  1043.    can use that pair of strings to do a simple authentication check,
  1044.    similar to the UNIX login program.
  1045.  
  1046. 2.3.2.9.  The LANGUAGE Constraint
  1047.  
  1048.    The LANGUAGE constraint specifies the language in which the client
  1049.    wishes to receive responses.  It therefore specifies which attribute
  1050.    values should be presented to the user (i.e., only those in the specified
  1051.    language, or for which no language information is available).
  1052.    It can also be used as an extra information to the fuzzy matching search 
  1053.    method, and it might also be used to tell the server to give the system 
  1054.    responses in another language.  This should preferably be handled by
  1055.    the client. The language codes defined in RFC 1766 [ALVE95] should be
  1056.    used as a value for the language constraint. In these, the case of
  1057.    the letters are insignificant.
  1058.  
  1059.    If a record has attribute values in different languages, and no LANGUAGE
  1060.    search constraint was given in the query, the switch between the
  1061.    different languages should be given in the response by the use
  1062.    of system messages 601 which has one argument only, the name of the
  1063.    language or one of the predefined strings "ANY" or "DEF". A block
  1064.    of alternative attribute values starts with a language definition
  1065.    like "% 601 SE". After the first language specification, zero or
  1066.    more language specifications can be given, each switching into the
  1067.    desired language. When all specific languages have been tagged, the
  1068.    specification "% 601 DEF" can be used for specifying default attribute
  1069.    values. A block of alternative attributes must end with "% 601 ANY".
  1070.  
  1071.    The following is an example of a response using the language messages:
  1072.  
  1073.        # FULL USER LOCAL USER-DOE
  1074.        % 601 FR
  1075.         Name: Monsieur John Doe
  1076.        % 601 SV
  1077.         Name: Herr John Doe
  1078.        % 601 DEF
  1079.         Name: Mister John Doe
  1080.        % 601 ANY
  1081.         Email: jdoe@doe.pp.se
  1082.        # END
  1083.  
  1084.    The language specifications may be suppressed by the server (using
  1085.    the % 601 messages) if the client has explicitly, by using the global 
  1086.    constraint LANGUAGE, asked for a specific language.
  1087.  
  1088. 2.3.2.10.  The INCHARSET Constraint
  1089.  
  1090.    The INCHARSET constraint tells the server in which character set the
  1091.    search string itself is given. The default character set is ISO-
  1092.    8859-1.
  1093.  
  1094. 2.3.2.11.  The OUTCHARSET Constraint
  1095.  
  1096.    The OUTCHARSET constraint tells the server in which character set the
  1097.    search result is supposed to be given in. The default character set is
  1098.    ISO-8859-1, but the server may choose something else. 
  1099.  
  1100. 2.3.2.12.  The IGNORE Constraint
  1101.  
  1102.    The IGNORE constraint specifies which attributes NOT to include in
  1103.    the result. All other attributes will be included (as if named
  1104.    explicitly by the "include" constraint).
  1105.  
  1106.    If an attribute is named both with the "include" and "ignore"
  1107.    constraint, the attribute is to be included in the result, but the
  1108.    system message "% 112 Requested constraint not fulfilled" must be
  1109.    sent.
  1110.  
  1111. 2.3.2.13.  The INCLUDE Constraint
  1112.  
  1113.    The INCLUDE constraint specifies which attributes to include in the
  1114.    result. All other attributes will be excluded (as if named explicitly
  1115.    by the "ignore" constraint).
  1116.  
  1117.    If an attribute is named both with the "include" and "ignore"
  1118.    constraint, the attribute is to be included in the result, but the
  1119.    system message must be "% 112 Requested constraint not fulfilled".
  1120.  
  1121. 2.3.2.14.  The HOLD Constraint
  1122.  
  1123.    The HOLD constraint requests that the server hold open the connection 
  1124.    after sending the response to the query.  The server waits for another
  1125.    user input string.
  1126.  
  1127.  
  1128. 2.4.  Server Response Modes
  1129.  
  1130.    The grammar for Whois++ responses is given in Appendix G, and described
  1131.    below.
  1132.  
  1133.    There are currently a total of five different response modes possible
  1134.    for Whois++ servers. These are FULL, ABRIDGED, HANDLE, SUMMARY and
  1135.    SERVER-TO-ASK. The syntax of each output format is specified in more
  1136.    detail in Appendix G.
  1137.  
  1138.      1) A FULL format response provides the complete contents of a
  1139.         template matching the specified query, including the template
  1140.         type, the server handle and an optional record handle.
  1141.  
  1142.      2) An ABRIDGED format response provides a brief summary, including
  1143.         (as a minimum) the server handle, the corresponding record handle
  1144.         and relevant information for that template.
  1145.  
  1146.      3) A HANDLE format response returns a line with information about
  1147.         the server handle and record handle for a record that matched
  1148.         the specified query.
  1149.  
  1150.      4) A SUMMARY response provides only a brief summary of information
  1151.         the number of matches and the list of template types in which the
  1152.         matches occurred.
  1153.  
  1154.      5) A SERVER-TO-ASK response only returns pointers to other index
  1155.         servers which might possibly be able to answer the specified
  1156.         query.
  1157.  
  1158.    The server may optionally respond with an empty result set and may also 
  1159.    respond with an empty response together with a system message to indicate 
  1160.    that the query was too complex for it to fulfill.
  1161.  
  1162. 2.4.1.  Default Responses
  1163.  
  1164.    By default, a Whois++ server will provide FULL responses. This may be
  1165.    changed by the client with the use of the global constraint "format".
  1166.  
  1167.    The server will not respond with more matches than the value
  1168.    specified with the global constraint "maxhits" in any response
  1169.    format. If the number of matches exceeds this value, the server will
  1170.    issues the system message 110 (maxhits value exceeded), but will
  1171.    still show the responses, up to the number of the "maxhits"
  1172.    constraint value.  This mechanism will allow the server to hide the
  1173.    number of possible matches to a search command.
  1174.  
  1175.  
  1176. 2.4.2.  Format of Responses
  1177.  
  1178.    Each response consists of a numerical system generated message, which
  1179.    can be tagged with text, followed by an optional formatted response
  1180.    message, followed by a second system generated message. The formatted
  1181.    response itself can include system messages, for example for switches in
  1182.    language.
  1183.  
  1184.    That is:
  1185.  
  1186.         '%' <system messages> <nl>
  1187.  
  1188.         [ <formatted response> ]
  1189.  
  1190.         '%' <system messages> <nl>
  1191.  
  1192.  
  1193.    If there are no matches to a query, the system is not required to
  1194.    generate any output as a formatted response, although it must still
  1195.    generate system messages.
  1196.  
  1197.    For information about the standard text for system messages, see 
  1198.    Appendix E.
  1199.  
  1200. 2.4.3.  Syntax of a Formatted Response
  1201.  
  1202.    All formatted responses except for the HANDLE response, consist of a
  1203.    response-specific START line, followed by an optional response-
  1204.    specific data section, followed by a TERMINATION line.  The HANDLE
  1205.    response is different in that it only consists of a START line.  It
  1206.    is permissible to insert any number of lines consisting solely of
  1207.    CR/LF pairs within a formatted response to improve readability.
  1208.  
  1209.    Each line shall be limited to no more than 81 characters, including
  1210.    the terminating CR/LF pair.  If a line (including the required leading
  1211.    single space) would exceed 81 characters, it must be broken into
  1212.    lines of no more than 81 characters, with each continuation line
  1213.    beginning with a "+" character in the first column instead of the
  1214.    leading character.
  1215.  
  1216.    If an attribute value in a data section includes a line break, the
  1217.    line break must be replaced by a CR/LF pair and the following line
  1218.    begin with a "-" character in the first column, instead of the
  1219.    leading character. The attribute name is not repeated on consecutive
  1220.    lines.
  1221.  
  1222.    A TERMINATION line consists of a line with a '#' in the first column,
  1223.    followed by one space (ASCII 32) character, followed by the keyword END, 
  1224.    followed by zero or more characters, followed by a CR/LF pair.
  1225.  
  1226.    A response-specific section will be one of the following:
  1227.  
  1228.        1) FULL Format Response
  1229.        2) ABRIDGED Format Response
  1230.        3) HANDLE Format Response
  1231.        4) SUMMARY Format Response
  1232.        5) SERVER-TO-ASK Format Response
  1233.  
  1234.  
  1235. 2.4.3.1.  A FULL format response
  1236.  
  1237.    A FULL format response consists of a series of responses, each
  1238.    consisting of a START line, followed by the complete template
  1239.    information for the matching record and a TERMINATION line.
  1240.  
  1241.    Each START line consists of a '#' in the first column, followed by
  1242.    one space character, the word "FULL", a space character,
  1243.    the name of the corresponding template type, one space
  1244.    character, the server handle, a space character, (optionally) the 
  1245.    handle for the record, and a terminating CR/LF pair.
  1246.  
  1247.    The template information for the record will be returned as a series
  1248.    of lines consisting of a single space, followed by the corresponding
  1249.    line of the record.
  1250.  
  1251.    The line of the record shall consist of a single space and the
  1252.    attribute name followed by a ':', a single space, the value of that
  1253.    attribute, and a CR/LF pair.
  1254.  
  1255. 2.4.3.2.  ABRIDGED Format Response
  1256.  
  1257.    Each ABRIDGED format response consists of a START line, a single line
  1258.    excerpt of the template information from each matching record and a
  1259.    TERMINATION line. The excerpt information shall include information
  1260.    that is relevant to the template type.
  1261.  
  1262.    The START line consists of a '#' in the first column, followed by one
  1263.    space character, the word "ABRIDGED", a space character,
  1264.    the name of the corresponding template type, a space character,
  1265.    the server handle, a space character, the handle for the
  1266.    record, and a terminating CR/LF pair.
  1267.  
  1268.    The abridged template information will be returned as a line,
  1269.    consisting of a single space, followed by the abridged line of the
  1270.    record and a CR/LF pair.
  1271.  
  1272.  
  1273. 2.4.3.3.  HANDLE Format Response
  1274.  
  1275.    A HANDLE response consists of a single START line, which shall start
  1276.    with a '#' in the first column, followed by one space
  1277.    character, the word "HANDLE", a space character, the name of
  1278.    the corresponding template, a space character, the handle for
  1279.    the server, a space character, the handle for that record, and
  1280.    a terminating CR/LF pair.
  1281.  
  1282. 2.4.3.4.  SUMMARY Format Response
  1283.  
  1284.    A SUMMARY format response consists of a single response,
  1285.    consisting of a line listing the number of matches to the specified
  1286.    query, optionally a count of referrals, followed by a list of all template 
  1287.    types which satisfied the query at least once.
  1288.  
  1289.    The START line shall begin with a '#' in the first column, be
  1290.    followed by one white space character, the word "SUMMARY", a white
  1291.    space character, the handle for the server, and a terminating
  1292.    CR/LF pair.
  1293.  
  1294.    The format of the attributes in the SUMMARY format follows the
  1295.    rules for the FULL template, with the attributes "matches",
  1296.    "referrals" and "templates". "matches" and "templates" are
  1297.    mandatory, "referrals" optional.
  1298.  
  1299.    The first line must begin with the string "matches:", be
  1300.    followed by a space and the number of responses to the query and
  1301.    terminated by a CR/LF pair.
  1302.  
  1303.    The following line shall either begin with the string "templates: "
  1304.    or the string "referrals: ". The string "templates: " are followed
  1305.    by a CR/LF separated list of the name of the template types
  1306.    which matched the query.  Each line following the first which
  1307.    include the text "templates:" must begin with a '-' instead of
  1308.    a space. The string "referrals: " is followed by the number of
  1309.    referrals included in the number of hits.
  1310.  
  1311. 2.4.3.5.  SERVER-TO-ASK Response
  1312.  
  1313.    A SERVER-TO-ASK response consists of information to the client about
  1314.    a server to contact next to resolve a query.  If the server has
  1315.    pointers to more than one server, it will present additional SERVER-
  1316.    TO-ASK responses.
  1317.  
  1318.    The SERVER-TO-ASK response will consist of a START line and a number
  1319.    of lines with attribute-value pairs, separated by CRLF. Each line is
  1320.    indented with one space. The end of a SERVER-TO-ASK response is
  1321.    indicated with a TERMINATION line.
  1322.  
  1323.    Each START line consists of a '#' in the first column, followed by
  1324.    one space character, the word "SERVER-TO-ASK", a space
  1325.    character, the handle of the server and a terminating CR/LF pair.
  1326.  
  1327.    1. "Server-Handle" - The server handle of the server pointed at.
  1328.       (req.)
  1329.    2. "Host-Name" - Hostname for the server pointed at.
  1330.    3. "Host-Port" - Portnumber for the server pointed at.
  1331.    4. "Protocol" - The protocol to use when contacting this server. (opt.)
  1332.  
  1333.    Other attributes may be present, depending on the index server.
  1334.    The default protocol to use is Whois++.
  1335.  
  1336. 2.4.4.  System Generated Messages
  1337.  
  1338.    All system generated messages must have a '%' as the first
  1339.    character, a space as the second one, followed by a three digit
  1340.    number, a space and an optional text message. The total length of the
  1341.    line must be no more than 81 characters long, including the
  1342.    terminating CR/LF pair. There is no limit to the number of system
  1343.    messages that may be generated.
  1344.  
  1345.    The format for multiline replies requires that every line, except the
  1346.    last, begin with "%", followed by space, the reply code, a hyphen,
  1347.    and an optional text.  The last line will begin with "%", followed by
  1348.    space, the reply code, a space and some optional text.
  1349.  
  1350.    System generated messages displayed before or after the formatted
  1351.    response section are expected to refer to operation of the system or
  1352.    refer to the entire query. System generated messages within the
  1353.    output of an individual record during a FULL response are expected to
  1354.    refer to that record only, and could (for example) be used to
  1355.    indicate problems with that record of the response. See Appendix E
  1356.    for a description of system messages.
  1357.  
  1358. 2.5.  Compatibility with Older WHOIS Servers
  1359.  
  1360.    Note that this format, although potentially more verbose, is still in
  1361.    a human readable form. Responses from older systems that do not
  1362.    follow this format are still conformant, since their responses would
  1363.    be interpreted as being equivalent to optional text messages, without
  1364.    a formatted response.  Clients written to this specification would
  1365.    display the responses as a advisory text message, where it would
  1366.    still be readable by the user.
  1367.  
  1368. 3.  Miscellaneous
  1369.  
  1370. 3.1.  Acknowledgements
  1371.  
  1372.    This document has been through many iterations of refinement, with
  1373.    contributions of different natures along the way.  These acknowledgements
  1374.    accrue.
  1375.  
  1376.    The Whois++ effort began as an intensive brainstorming session at the
  1377.    24th IETF, in Boston Massachusetts.  Present at the birth, and
  1378.    contributing ideas through this early phase, were (alphabetically)
  1379.    Peter Deutsch, Alan Emtage, Jim Fullton, Joan Gargano, Brad
  1380.    Passwaters, Simon Spero, and Chris Weider. Others who have since
  1381.    helped shape this document with feedback and suggestions include
  1382.    Roxana Bradescu, Patrik Faltstrom, Kevin Gamiel, Dan Kegel, Michael
  1383.    Mealling, Mark Prior and Rickard Schoultz.
  1384.  
  1385.    Version 2 of the protocol is based on input during the lifetime of
  1386.    version 1. Special mention goes to Jeff Allen, Leslie Daigle,
  1387.    and Philippe Boucher. During the polishing of the RFC for version 2,
  1388.    important input was given by Len Charest, Clarke Anderson and others
  1389.    in the ASID working group of the IETF.
  1390.  
  1391.    Work in the European ROADS project provided the opportunity to test this 
  1392.    protocol specification from the point of view of developing a test suite.  
  1393.    The challenge was not only to provide AN implementation that satisfied the
  1394.    document, but to build tools that would be able to respond to all 
  1395.    POSSIBLE responses that could be implemented from the spec.  This then
  1396.    lead to the contribution of some textual clarifications.  Specific thanks
  1397.    go to Bill Heelan and Philippe Boucher.
  1398.  
  1399.  
  1400.  
  1401. 3.2  References
  1402.  
  1403.    [ALVE95]        Alvestrand H., "Tags for the Identification of
  1404.                    Languages", RFC 1766, UNINETT, March 1995.
  1405.  
  1406.    [RFC822]        Crocker, D., "Standard for the Format of ARPA Internet
  1407.                    Text Messages", RFC 822, August 1982.
  1408.  
  1409.    [HARR85]        Harrenstein K., Stahl M., and E. Feinler,
  1410.                    "NICNAME/WHOIS", RFC 954, SRI, October 1985.
  1411.  
  1412.    [POST82]        Postel J., "Simple Mail Transfer Protocol", STD 10,
  1413.                    RFC 821, USC/Information Sciences Institute,
  1414.                    August 1982.
  1415.  
  1416.    [IIIR]          Weider C., and P. Deutsch, "A Vision of an
  1417.                    Integrated Internet Information Service", RFC 1727
  1418.                    Bunyip Information Systems, Inc., December 1994.
  1419.  
  1420.    [WINDX]         Weider, C., J. Fullton, and S. Spero, "Architecture of
  1421.                    the Whois++ Index Service", RFC 1913, February 1996.
  1422.  
  1423. 3.3.  Authors Addresses
  1424.  
  1425.    Patrik Faltstrom
  1426.    Tele2
  1427.    Borgarfjordsgatan 16
  1428.    BOX 62
  1429.    194 64 Kista
  1430.    SWEDEN
  1431.  
  1432.    Email: paf@swip.net
  1433.  
  1434.   
  1435.    Sima Newell
  1436.    Bunyip Information Systems Inc.
  1437.    310 Ste. Catherine St. W
  1438.    Suite 300
  1439.    Montreal, Quebec,  CANADA
  1440.    H2X 2A1
  1441.  
  1442.    Email:  sima@bunyip.com
  1443.  
  1444.    Leslie L. Daigle
  1445.    Bunyip Information Systems Inc.
  1446.    310 Ste. Catherine St. W
  1447.    Suite 300
  1448.    Montreal, Quebec,  CANADA
  1449.    H2X 2A1
  1450.  
  1451.    Email:  leslie@bunyip.com
  1452.  
  1453.  
  1454. Appendix A - Some Sample Queries
  1455.  
  1456.        author=leslie and template=user
  1457.  
  1458.    The result will consist of all records where attribute "author"
  1459.    matches "leslie" with case ignored. Only USER templates will be
  1460.    searched. An example of a matching attribute is "Author=Leslie L. Daigle".
  1461.    This is the typical case of searching.
  1462.  
  1463.        author=leslie and template=user:language=fr
  1464.  
  1465.    The result will consist of the same records as above, but if
  1466.    attributes are available in alternative languages, only the
  1467.    ones in French will be displayed. These are either the ones which
  1468.    have explicitly been tagged as having French values, or ones that
  1469.    are tagged as being in the "DEF" (default) language.
  1470.  
  1471.        schoultz and rick;search=lstring
  1472.  
  1473.    The result will consist of all records which have one attribute value
  1474.    matching "schoultz" exactly (because the default search type is exact)
  1475.    and one attribute with "rick" as leading substring, both with case ignored. 
  1476.    One example is "Name=Rickard Schoultz".
  1477.  
  1478.        value=phone;search=substring
  1479.  
  1480.    The result will consist of all records which have attribute values
  1481.    matching *phone*, for example the record "Name=Acme telephone inc.",
  1482.    but will not match the attribute name "phone". (Since term specifier
  1483.    is "value" by default, the search term could just as well have been 
  1484.    simply "phone").
  1485.  
  1486.       ucdavis;search=substring and (gargano or joan):include=name,email
  1487.  
  1488.    This search command will find records which have records containing
  1489.    the words "gargano" or "joan" somewhere in the record, and has the
  1490.    word "ucdavis" somewhere in a word. The result will only show the
  1491.    "name" and "email" fields.
  1492.  
  1493. Appendix B - Some sample responses
  1494.  
  1495.       1) FULL format responses:
  1496.  
  1497.       # FULL USER SERVERHANDLE1 PD45
  1498.        Name: Peter Deutsch
  1499.        email: peterd@bunyip.com
  1500.       # END
  1501.       # FULL USER SERVERHANDLE1 AE1
  1502.        Name: Alan Emtage
  1503.        email: bajan@bunyip.com
  1504.       # END
  1505.       # FULL USER SERVERHANDLE1 NW1
  1506.        Name: Nick West
  1507.        Favourite-Bicycle-Forward-Wheel-Brand: New Bicy
  1508.       +cles Acme Inc.
  1509.        email: nick@bicycle.acme.com
  1510.        My-favourite-song: Happy birthday to you!
  1511.       -Happy birthday to you!
  1512.       -Happy birthday dear Nick!
  1513.       -Happy birthday to you.
  1514.       # END
  1515.       # FULL SERVICES SERVERHANDLE1 WWW1
  1516.        Type: World Wide Web
  1517.        Location: the world
  1518.       # END
  1519.  
  1520.                           --------------------
  1521.  
  1522.  
  1523.       2) An ABRIDGED format response:
  1524.  
  1525.       # ABRIDGED USER SERVERHANDLE1 PD45
  1526.        Peter Deutsch             peterd@bunyip.com
  1527.       # END
  1528.       # ABRIDGED USER SERVERHANDLE1 AE1
  1529.        Alan Emtage               bajan@bunyip.com
  1530.       # END
  1531.       # ABRIDGED USER SERVERHANDLE1 WWW1
  1532.        World Wide Web            the world
  1533.       # END
  1534.  
  1535.  
  1536.                           --------------------
  1537.  
  1538.  
  1539.       3) HANDLE format responses:
  1540.  
  1541.  
  1542.       # HANDLE USER SERVERHANDLE1 PD45
  1543.       # HANDLE USER SERVERHANDLE1 AE1
  1544.       # HANDLE SERVICES SERVERHANDLE1 WWW1
  1545.  
  1546.  
  1547.                           --------------------
  1548.  
  1549.       4) A SUMMARY format response:
  1550.  
  1551.       # SUMMARY SERVERHANDLE1
  1552.        Matches: 35
  1553.        Referrals: 2
  1554.        Templates: User
  1555.       -Services
  1556.       -Abstracts
  1557.       # END
  1558.  
  1559. Appendix C - Sample responses to system commands
  1560.  
  1561.    C.1 Response to the LIST command
  1562.  
  1563.       # FULL LIST SERVERHANDLE1
  1564.        Templates: USER
  1565.       -SERVICES
  1566.       -HELP
  1567.       # END
  1568.  
  1569.  
  1570.    C.2 Response to the SHOW command
  1571.  
  1572.       This example shows the result after issuing "show user":
  1573.  
  1574.       # FULL USER SERVERHANDLE1
  1575.         Name:
  1576.         Email:
  1577.         Work-Phone:
  1578.         Organization-Name:
  1579.         City:
  1580.         Country:
  1581.       # END
  1582.  
  1583.    C.3 Response to the POLLED-BY command
  1584.  
  1585.       # FULL POLLED-BY SERVERHANDLE1
  1586.        Server-handle: serverhandle2
  1587.        Cached-Host-Name: sunic.sunet.se
  1588.        Cached-Host-Port: 7070
  1589.        Template: USER
  1590.        Field: ALL
  1591.       # END
  1592.       # FULL POLLED-BY SERVERHANDLE1
  1593.        Server-handle: serverhandle3
  1594.        Cached-Host-Name: kth.se
  1595.        Cached-Host-Port: 7070
  1596.        Template: ALL
  1597.        Field: Name,Email
  1598.       # END
  1599.  
  1600.  
  1601.    C.4 Response to the POLLED-FOR command
  1602.  
  1603.       # FULL POLLED-FOR SERVERHANDLE1
  1604.        Server-Handle: serverhandle5
  1605.        Template: ALL
  1606.        Field: Name,Address,Job-Title,Organization-Name,
  1607.       +Organization-Address,Organization-Name
  1608.       # END
  1609.       # FULL POLLED-FOR SERVERHANDLE1
  1610.        Server-Handle: serverhandle4
  1611.        Template: USER
  1612.        Field: ALL
  1613.       # END
  1614.  
  1615.  
  1616.    C.5 Response to the VERSION command
  1617.  
  1618.       # FULL VERSION BUNYIP.COM
  1619.        Version: 2.0
  1620.        Program-Name: Digger
  1621.        Program-Version: 3.0b1
  1622.        Program-Author: Bunyip Information Systems Inc.
  1623.        Program-Author-Email: digger-info@bunyip.com
  1624.        Bug-Report-Email: digger-bugs@bunyip.com
  1625.       # END
  1626.  
  1627.  
  1628.    C.6 Response to the CONSTRAINTS command
  1629.  
  1630.       # FULL CONSTRAINTS SERVERHANDLE1
  1631.        CONSTRAINT: maxhits
  1632.        DEFAULT: 100
  1633.        RANGE: 0-100
  1634.       # END
  1635.       # FULL CONSTRAINTS SERVERHANDLE1
  1636.        CONSTRAINT: case
  1637.        DEFAULT: ignore
  1638.        RANGE: ignore, consider
  1639.       # END
  1640.       # FULL CONSTRAINTS SERVERHANDLE1
  1641.        CONSTRAINT: search
  1642.        DEFAULT: exact
  1643.        RANGE: exact, lstring, substring, fuzzy
  1644.       # END
  1645.       # FULL CONSTRAINTS SERVERHANDLE1
  1646.        CONSTRAINT: language
  1647.        DEFAULT: DEF
  1648.        RANGE: FR, EN, SV, ANY, DEF
  1649.       # END
  1650.       # FULL CONSTRAINTS SERVERHANDLE1
  1651.        CONSTRAINT: incharset
  1652.        DEFAULT: ISO-8859-1
  1653.        RANGE: ISO-8859-1, UNICODE-1-1-UTF8
  1654.       # END
  1655.       # FULL CONSTRAINTS SERVERHANDLE1
  1656.        CONSTRAINT: outcharset
  1657.        DEFAULT: ISO-8859-1
  1658.        RANGE: ISO-8859-1, UNICODE-1-1-UTF8, HTML
  1659.       # END
  1660.  
  1661.    C.7 Response to the COMMANDS command
  1662.  
  1663.       # FULL COMMANDS SERVERHANDLE1
  1664.        Commands: commands
  1665.       -constraints
  1666.       -describe
  1667.       -help
  1668.       -list
  1669.       -polled-by
  1670.       -polled-for
  1671.       -show
  1672.       -version
  1673.       # END
  1674.  
  1675.  
  1676.  
  1677.  
  1678.  
  1679. Appendix D - Sample Whois++ session
  1680.  
  1681.    Below is an example of a session between a client and a server. The
  1682.    angle brackets to the left is not part of the communication, but is
  1683.    just put there to denote the direction of the communication between
  1684.    the server or the client. Text appended to '>' means messages from
  1685.    the server and '<' from the client.
  1686.  
  1687.      Client connects to the server
  1688.  
  1689.      >% 220-Welcome to
  1690.      >% 220-the Whois++ server
  1691.      >% 220 at ACME inc.
  1692.      <name=Nick:hold
  1693.      >% 200 Command okay
  1694.      >
  1695.      ># FULL USER ACME.COM NW1
  1696.      > name: Nick West
  1697.      > email: nick@acme.com
  1698.      ># END
  1699.      ># SERVER-TO-ASK ACME.COM
  1700.      > Server-Handle: SUNETSE01
  1701.      > Host-Name: whois.sunet.se
  1702.      > Host-Port: 7070
  1703.      ># END
  1704.      ># SERVER-TO-ASK ACME.COM
  1705.      > Server-Handle: KTHSE01
  1706.      ># END
  1707.      >% 226 Transfer complete
  1708.      <version
  1709.      >% 200 Command okay
  1710.      ># FULL VERSION ACME.COM
  1711.      > Version: 2.0
  1712.      ># END
  1713.      >% 226 Transfer complete
  1714.      >% 203 Bye
  1715.      Server closes the connection
  1716.  
  1717.    In the example above, the client connected to a Whois++ server and
  1718.    queried for all records where the attribute "name" equals "Nick", and
  1719.    asked the server not to close the connection after the response by
  1720.    using the global constraint "HOLD".
  1721.  
  1722.    The server responds with one record and a pointer to two other
  1723.    servers that either holds records or pointers to other servers.
  1724.  
  1725.    The client continues with asking for the servers version number
  1726.    without using the HOLD constraint.  After responding with protocol
  1727.    version, the server closes the connection.
  1728.  
  1729.    Note that each response from the server begins system message 200
  1730.    (Command OK), and ends with system message 226 (Transfer Complete).
  1731.  
  1732. Appendix E - System messages
  1733.  
  1734.    A system message begins with a '%', followed by a space and a three
  1735.    digit number, a space, and an optional text message. The line message
  1736.    must be no more than 81 characters long, including the terminating CR
  1737.    LF pair. There is no limit to the number of system messages that may
  1738.    be generated.
  1739.  
  1740.    A multiline system message have a hyphen instead of a space in column
  1741.    6, immediately after the numeric response code in all lines, except
  1742.    the last one, where the space is used.
  1743.  
  1744.      Example 1
  1745.  
  1746.      % 200 Command okay
  1747.  
  1748.      Example 2
  1749.  
  1750.      % 220-Welcome to
  1751.      % 220-the Whois++ server
  1752.      % 220 at ACME inc.
  1753.  
  1754.    The client is not expected to parse the text part of the response
  1755.    message except when receiving reply 600 or 601, in which case the
  1756.    text part is in the former case the name of a character set that
  1757.    will be used by the server in the rest of the response, and in the
  1758.    latter case when it specifies what language the attribute value is in.
  1759.    The valid values for characters sets is specified in the "characterset"
  1760.    list in the grammar in Appendix F.
  1761.  
  1762.    The theory of reply codes is described in Appendix E in STD 10, RFC
  1763.    821 [POST82].
  1764.  
  1765. ------------------------------------------------------------------------
  1766.  
  1767. List of system response codes
  1768. ------------------------------
  1769.  
  1770. 110 Too many hits                         The number of matches exceeded
  1771.                                           the value specified by the
  1772.                                           maxhits constraint. Server
  1773.                                           will still reply with as many
  1774.                                           records as "maxhits" allows.
  1775.  
  1776. 111 Requested constraint not supported    One or more constraints in
  1777.                                           query is not implemented, but
  1778.                                           the search is still done.
  1779.  
  1780. 112 Requested constraint not fulfilled   One or more constraints in
  1781.                                           query has unacceptable value
  1782.                                           and was therefore not used,
  1783.                                           but the search is still done.
  1784.  
  1785. 200 Command Ok                            Command accepted (i.e., syntax
  1786.                                           okay, will be executed).
  1787.                                           The client must wait for a
  1788.                                           transaction end system message.
  1789.  
  1790. 201 Command Completed successfully        Command accepted and executed.
  1791.  
  1792. 203 Bye                                   Server is closing connection
  1793.  
  1794. 220 Service Ready                         Greeting message. Server is
  1795.                                           accepting commands.
  1796.  
  1797. 226 Transaction complete                  End of data. All responses to
  1798.                                           query are sent.
  1799.  
  1800. 430 Authentication needed                 Client requested information
  1801.                                           that needs authentication.
  1802.  
  1803. 500 Syntax error
  1804.  
  1805. 502 Search expression too complicated     This message is sent when the
  1806.                                           server is not able to resolve
  1807.                                           a query (i.e. when a client
  1808.                                           sent a regular expression that
  1809.                                           is too deeply nested).
  1810.  
  1811. 530 Authentication failed                 The authentication phase
  1812.                                           failed.
  1813.  
  1814. 600 <token>                               Subsequent attribute values
  1815.                                           are encoded in the character
  1816.                                           set specified by <token>.
  1817.  
  1818. 601 <token>                               Subsequent attribute values
  1819.                                           are in the language specified
  1820.                                           by <token>.
  1821.  
  1822. 601 DEF                                   Subsequent attribute values
  1823.                                           are default values, i.e. they
  1824.                                           should be used for all languages
  1825.                                           not specified by "601 <token>"
  1826.                                           since last "601 ANY" message.
  1827.  
  1828. 601 ANY                                   Subsequent attribute values
  1829.                                           are for all languages.
  1830.  
  1831.                     Table V - System response codes
  1832.  
  1833. ------------------------------------------------------------------------
  1834.  
  1835. Appendix F - The Whois++ Input Grammar
  1836.  
  1837. The following grammar, which uses BNF-like notation as defined in [RFC822],
  1838. defines the set of acceptable input to a Whois++ server.
  1839.  
  1840. N.B.:  All Whois++ command, constraint, and value literals are shown here in 
  1841. lower case for simplicity.  These literals are to be accepted in upper, lower,
  1842. or mixed case.
  1843.  
  1844.  
  1845.  
  1846.    whois-command   =   ( system-command [":" "hold"]
  1847.                        / terms [":" globalcnstrnts] ) NL
  1848.  
  1849.    system-command  =   "constraints"
  1850.                        / "describe"
  1851.                        / "commands"
  1852.                        / "polled-by"
  1853.                        / "polled-for"
  1854.                        / "version"
  1855.                        / "list"
  1856.                        / "show" [1*SP string]
  1857.                        / "help" [1*SP string]
  1858.                        / "?" [string]
  1859.  
  1860.    terms           =   and-expr *("or" and-expr)
  1861.  
  1862.    and-expr        =   not-expr *("and" not-expr)
  1863.  
  1864.    not-expr        =   ["not"] (term / ( "(" terms ")" ))
  1865.  
  1866.    term            =   generalterm / specificterm
  1867.                        / shorthandle / combinedterm
  1868.  
  1869.    generalterm     =   string *(";" localcnstrnt)
  1870.  
  1871.    specificterm    =   specificname "=" string
  1872.                        *(";" localcnstrnt)
  1873.  
  1874.    specificname    =   "handle" / "value"
  1875.  
  1876.    shorthandle     =   "!" string *(";" localcnstrnt)
  1877.  
  1878.    combinedterm    =   attributename "=" string *(";" localcnstrnt)
  1879.  
  1880.    globalcnstrnts  =   globalcnstrnt *(";" globalcnstrnt)
  1881.  
  1882.    globalcnstrnt   =   localcnstrnt
  1883.                        / "format" "=" format
  1884.                        / "maxfull" "=" 1*digit
  1885.                        / "maxhits" "=" 1*digit
  1886.                        / opt-globalcnst
  1887.  
  1888.    opt-globalcnst  =   "hold"
  1889.                        / "authenticate" "=" auth-method
  1890.                        / "name" "=" string
  1891.                        / "password" "=" string
  1892.                        / "language" "=" language
  1893.                        / "incharset" "=" characterset
  1894.                        / "ignore" "=" string
  1895.                        / "include" "=" string
  1896.  
  1897.    format          =   "full" / "abridged" / "handle" / "summary"
  1898.                        / "server-to-ask"
  1899.  
  1900.    language        = <The language code defined in RFC1766 [ALVE95]>
  1901.  
  1902.    characterset    =   "us-ascii" / "iso-8859-1" / "iso-8859-2" /
  1903.                        "iso-8859-3" / "iso-8859-4" / "iso-8859-5" /
  1904.                        "iso-8859-6" / "iso-8859-7" / "iso-8859-8" /
  1905.                        "iso-8859-9" / "iso-8859-10" / "UNICODE-1-1-UTF-8" /
  1906.                        "UNICODE-2-0-UTF-8" / charset-value
  1907.  
  1908.    charset-value   =   1*char
  1909.  
  1910.    localcnstrnt    =   "search" "=" searchvalue /
  1911.                        "case" "=" casevalue
  1912.  
  1913.    searchvalue     =   "exact" / "substring" / "regex" / "fuzzy"
  1914.                        / "lstring"
  1915.  
  1916.    casevalue       =   "ignore" / "consider"
  1917.  
  1918.    auth-method     =   "password"
  1919.  
  1920.    string          =   0*char
  1921.  
  1922.    attributename   =   1*normalchar
  1923.  
  1924.    char            =   "\" specialchar / normalchar
  1925.  
  1926.    normalchar      =   <Characters 32 to 254(decimal) except specialchar>
  1927.  
  1928.    specialchar     =   " " / <tab> / "=" / "," / ":" / ";" / "\" /
  1929.                        "*" / "." / "(" / ")" / "[" / "]" / "^" /
  1930.                        "$" / "!" / "?"
  1931.    whitespace      =   1*(" " / <tab> / <CR> / <LF> / "@")
  1932.  
  1933.    digit           =   "0" / "1" / "2" / "3" / "4" /
  1934.                        "5" / "6" / "7" / "8" / "9"
  1935.  
  1936.    NL              =   <CR LF (decimal 13 10)>
  1937.  
  1938.  
  1939.    NOTE: Blanks that are significant to a query must be escaped.  The 
  1940.    following characters, when significant to the query, may be preceded
  1941.    and/or followed by a single blank:
  1942.  
  1943.      : ; , ( ) = !
  1944.  
  1945.  
  1946.  
  1947. Appendix G - The Whois++ Response Grammar
  1948.  
  1949. The following grammar, which uses BNF-like notation as defined in [RFC822],
  1950. defines the set of responses expected from a Whois++ server upon receipt of a 
  1951. valid Whois++ query.
  1952.  
  1953. N.B.:  All the literals supplied by the Whois++ server may be in upper, lower,
  1954. or mixed case.  For clarity, they are shown here in upper case only.
  1955.  
  1956.  
  1957.    server          =   goodmessage mnl output mnl endmessage onlynl
  1958.                      / badmessage onlynl endmessage onlynl
  1959.  
  1960.    output          =   full / abridged / summary / handle
  1961.  
  1962.    full            =   0*(full-record / server-to-ask)
  1963.  
  1964.    abridged        =   0*(abridged-record / server-to-ask)
  1965.  
  1966.    summary         =   summary-record 
  1967.  
  1968.    handle          =   0*(handle-record / server-to-ask)
  1969.    
  1970.    full-record     =   "# FULL " template serverhandle localhandle nl
  1971.                        1*(fulldata nl)
  1972.                        "# END" nl
  1973.  
  1974.    abridged-record =   "# ABRIDGED " template serverhandle localhandle nl
  1975.                        abridgeddata nl
  1976.                        "# END" nl
  1977.  
  1978.    summary-record   =  "# SUMMARY " serverhandle nl
  1979.                        summarydata nl
  1980.                        "# END" nl
  1981.  
  1982.    handle-record    =  "# HANDLE " template serverhandle localhandle nl
  1983.    
  1984.    server-to-ask   =   "# SERVER-TO-ASK " serverhandle nl
  1985.                        server-to-askdata nl
  1986.                        "# END" nl
  1987.    
  1988.    fulldata        =   " " attributename ": " attributevalue
  1989.    
  1990.    abridgeddata    =   " " 0*( attributevalue / tab )
  1991.    
  1992.    summarydata     =   " Matches: " number nl 
  1993.                        [" Referrals: " number nl]
  1994.                        " Templates: " template 0*( nl "-" template)
  1995.  
  1996.    server-to-ask-data = " Server-Handle:" <serverhandle> <nl>
  1997.                         " Host-Name: " hostname nl
  1998.                         " Host-Port: " number nl
  1999.                         [" Protocol: " prot nl]
  2000.                         0*(" " sstring ": " sstring nl)
  2001.  
  2002.    
  2003.    attributename   =   sstring
  2004.    
  2005.    attributevalue  =   longstring
  2006.    
  2007.    template        =   sstring
  2008.    
  2009.    serverhandle    =   sstring
  2010.    
  2011.    localhandle     =   sstring
  2012.    
  2013.    hostname        =   sstring
  2014.  
  2015.    prot            =   sstring
  2016.  
  2017.    longstring      =   string 0*( nl ( "+" / "-" ) string )
  2018.    
  2019.    string          =   0*char
  2020.    
  2021.    sstring         =   0*schar
  2022.    
  2023.    schar           =   <Characters 32-254 (decimal) except special-char>
  2024.    
  2025.    char            =   <Characters 32-254 (decimal) except nl>
  2026.    
  2027.    special-char    =   ":" / " " / tab / nl
  2028.    
  2029.    tab             =   <TAB (decimal 9)>
  2030.    
  2031.    mnl             =   1*nl
  2032.    
  2033.    nl              =   onlynl [ 1*(message onlynl) ]
  2034.    
  2035.    onlynl          =   <CR LF (decimal 13 10)>
  2036.    
  2037.    message         =   [1*( messagestart "-" string onlynl)]
  2038.                        messagestart " " string onlynl
  2039.    
  2040.    messagestart    =   "% " digit digit digit
  2041.    
  2042.    goodmessage     =   [1*( goodmessagestart "-" string onlynl)]
  2043.                        goodmessagestart " " string onlynl
  2044.    
  2045.    goodmessagestart=   "% 200"
  2046.    
  2047.    messagestart    =   "% " digit digit digit
  2048.    
  2049.    badmessage      =   [1*( badmessagestart "-" string onlynl)]
  2050.                        badmessagestart " " string onlynl
  2051.    
  2052.    badmessagestart =   "% 5" digit digit
  2053.  
  2054.    endmessage      =   endmessageclose / endmessagecont
  2055.    
  2056.    endmessageclose =   [endmessagestart " " string onlynl]
  2057.                        byemessage
  2058.  
  2059.    endmessagecont  =   endmessagestart " " string onlynl
  2060.  
  2061.    endmessagestart =   "% 226"
  2062.  
  2063.    byemessage      =   byemessagestart " " string onlynl
  2064.  
  2065.    endmessagestart =   "% 203"
  2066.   
  2067.    number          =   1*( digit )
  2068.    
  2069.    digit           =   "0" / "1" / "2" / "3" / "4" / "5" / "6" / "7" / "8" / "9"
  2070.    
  2071.    
  2072.    
  2073.  
  2074.  
  2075.  
  2076. Appendix H - Description of Regular expressions
  2077.  
  2078.    The regular expressions described in this section are the same as used
  2079.    in many other applications and operating systems. However, it is very
  2080.    simple and does not include logical operators AND and OR.
  2081.  
  2082.    Searches using regular expressions always use substring
  2083.    matching except when the regular expression contains the characters
  2084.    '^' or '$'.
  2085.  
  2086.        Character                                Function
  2087.        ---------                                --------
  2088.  
  2089.         <any except those listed in this table> Matches itself
  2090.  
  2091.         .                                       Matches any character
  2092.  
  2093.         a*                                      Matches zero or more 'a'
  2094.  
  2095.         [ab]                                    Matches 'a' or 'b'
  2096.  
  2097.         [a-c]                                   Matches 'a', 'b' or 'c'
  2098.  
  2099.         ^                                       Matches beginning of
  2100.                                                 a token
  2101.  
  2102.         $                                       Matches end of a token
  2103.  
  2104.           Examples
  2105.           ---------
  2106.  
  2107.             String         Matches       Doesn't match
  2108.             -------        -------       -------------
  2109.              hello          xhelloy         heello
  2110.              h.llo          hello           helio
  2111.              h.*o           hello           helloa
  2112.              h[a-f]llo      hello           hgllo
  2113.              ^he.*          hello           ehello
  2114.              .*lo$          hello           helloo
  2115.  
  2116.  
  2117.