home *** CD-ROM | disk | FTP | other *** search
/ Unix System Administration Handbook 1997 October / usah_oct97.iso / rfc / 700s / rfc729.txt < prev    next >
Text File  |  1992-10-14  |  7KB  |  187 lines

  1. Network Working Group                 Dave Crocker, Rand-ISD
  2. Request for Comments: 729             (Dcrocker at Rand-Unix)
  3. NlC: 40306                     13 May l977
  4.  
  5.  
  6.  
  7.  
  8.             TELNET Byte Macro Option
  9.  
  10.  
  11. 1. Command name and code:
  12.  
  13.    BM 19
  14.  
  15. 2. Command Meanings:
  16.  
  17.    IAC WILL BM
  18.  
  19.     The sender of this  command REQUESTS or AGREES  to use the  BM
  20.     option, and will send sing1e  data characters which are to  be
  21.     interpreted as if longer data strings had been sent.
  22.  
  23.    IAC WON'T BM
  24.  
  25.     The  sender  of  this  option  REFUSES  to  send  single  data
  26.     characters which  are  to be  interpreted  as if  longer  data
  27.     strings had been sent.
  28.  
  29.    IAC DO BM
  30.  
  31.     The sender REQUESTS or AGREES to have the other side (send  of
  32.     WILL BM) issue  send single  data characters which  are to  be
  33.     interpreted as if longer data strings had been sent.
  34.  
  35.    IAC DON'T BM
  36.  
  37.     The sender REFUSES to allow the other side to send single data
  38.     characters which  are  to be  interpreted  as if  longer  data
  39.     strings had been sent.
  40.  
  41.    IAC SB BM <DEFINE> <macro byte> <count>
  42.                    <expansion string> IAC SE
  43.     where:
  44.  
  45.        <macro byte> is the  data byte actually  to be sent  across
  46.        the network; it may NOT be Telnet IAC (decimal 255).
  47.  
  48.  
  49. RFC #729 Telnet Byte Macro Option                 Page 2
  50.  
  51.  
  52.  
  53.        <count> is a  one-byte binary number,  indicating how  many
  54.        <expansion string> characters follow, up to the ending  IAC
  55.        SE, but not including it.
  56.  
  57.        <expansion string> is a string of one or more Telnet  ASCII
  58.        characters and/or commands,  which the <macro  byte> is  to
  59.        represent; any  character may  occur within  an  <expansion
  60.        string>.
  61.  
  62.     The indicated  <macro  byte>  will  be  sent  instead  of  the
  63.     indicated <expansion string>. The receiver of the <macro byte>
  64.     (the sender  of the  DO BM)  is to  behave EXACTLY  as if  the
  65.     <expansion string> of bytes had instead been received from the
  66.     network. This  interpretation is  to  occur before  any  other
  67.     Telnet interpretations, unless the <macro byte> occurs as part
  68.     of a BM subcommand; in this case no special interpretation  is
  69.     to be made.
  70.  
  71.     Note that the effect of a particular <macro byte> may be
  72.     negated by reseting it to "expand" into itself.
  73.  
  74.     <DEFINE> is decimal 01.
  75.  
  76.  
  77.    IAC SB BM <ACCEPT> <macro byte> IAC SE
  78.  
  79.     The receiver  of the  <DEFINE> for  <macro byte>  accepts  the
  80.     requested definition and will perform the indicating expansion
  81.     whenever a <macro byte>  is received and is  not part of a  BM
  82.     subcommand.
  83.  
  84.     <ACCEPT> is decimal 02.
  85.  
  86.  
  87.    IAC SB BM <REFUSE> <macro byte> <REASON> IAC SE
  88.  
  89.     The receive  of  the  <DEFINE> for  <macro  byte>  refuses  to
  90.     perform  the  indicated  translation  from  <macro  byte>   to
  91.     <expansion string> either because the particular <macro  byte>
  92.     is not  an acceptable  choice  or because  the length  of  the
  93.     <expansion string> exceeds available storage.
  94.  
  95.    <REFUSE> is decimal 03.
  96.  
  97.    <REASON> may be
  98.  
  99.        <BAD CHOICE> which is decimal 01; or
  100.  
  101.        <TOO LONG> which is decimal 02.
  102.  
  103.  
  104. RFC #729 Telnet Byte Macro Option                 Page 3
  105.  
  106.  
  107.  
  108.  
  109.    IAC SB BM <LITERAL> <macro byte> IAC SE
  110.  
  111.     The <macro byte> is to be treated as real data, rather than as
  112.     representative of the <expansion string>
  113.  
  114.     <LITERAL> is decimal 03.
  115.  
  116.  
  117.  
  118.  
  119. 3. Default:
  120.  
  121.    WON'T BM -- DON'T BM
  122.  
  123.     No reinterpretation of data is allowed.
  124.  
  125. 4. Motivation for the option:
  126.  
  127.    Subcommands for Telnet options currently require a minimum of  five
  128.    characters to be sent over the network (i.e., IAC SB <Option  name>
  129.    IAC SE).   For sub-commands  which  are employed  infrequently,  in
  130.    absolute numbers and in relation  to normal data, this overhead  is
  131.    tolerable. In other cases,  however, it is  not. For example,  data
  132.    which is  sent  in  a  block-oriented fashion  may  need  a  "block
  133.    separator" mark. If  blocks are commonly  as small as  five or  ten
  134.    bytes, then most of the cross-net data will be control information.
  135.    The BM option is intended  as a simple data compression  technique,
  136.    to remove this overhead from the communication channel.
  137.  
  138.  
  139. 5. Description of the option
  140.  
  141.    The  option  is   enabled  through  the   standard  Telnet   Option
  142.    negotiation process. Afterwards, the SENDER of data (the side which
  143.    sends the IAC WILL BM) is  free to define and use mappings  between
  144.    single and multiple NOT characters. Except for the ability to offer
  145.    a blanket refusal,  the receiver of  data has no  control over  the
  146.    definition and use of mappings.
  147.  
  148.    The sender (of the WILL BM) is prohibited from using or  redefining
  149.    a <macro byte> until  it has received an  <ACCEPT> or <REFUSE>,  in
  150.    reply to a <DEFINE>.
  151.  
  152.    NOTE: The  Telnet command  character  IAC (decimal  255) may  be  a
  153.    member of an <expansion string> but is the ONLY character which may
  154.    NOT be  defined  as  a  <macro  byte>.  ALL  OTHER  Telnet  command
  155.    characters use IAC  as a  preface and therefore  occupy a  SEPARATE
  156.    portion of the data space than do regular data bytes.
  157.  
  158. RFC #729 Telnet Byte Macro Option Page 4
  159.  
  160.  
  161.  
  162.    With  the  exception  of  IAC,  data  transfered  as  part  of   BM
  163.    subcommands are NOT to be interpreted. They are to be taken only as
  164.    their  normal  character  values.   This  avoids  the  problem   of
  165.    distinguishing between a character which is to be taken as a <macro
  166.    byte>, and interpreted as its corresponding <expansion string>, and
  167.    that same character to be taken  as its usual Telnet NVT value.  In
  168.    all other  cases,  however, <macro  byte>s  are to  be  interpreted
  169.    immediately, as if  the <expansion string>  had actually been  sent
  170.    across  the  network.    Expanded  strings  are   not  subject   to
  171.    reinterpretation, so that recursive definitions cannot be made.
  172.  
  173.    The <count>  in  the <DEFINE>  subcommand  allows the  receiver  to
  174.    allocate storage. IAC interpretation  is not over-ridden during  BM
  175.    subcommands so  that  IAC  SE will  continue  to  safely  terminate
  176.    malformed subcommands. To include  IAC as part  of a <DEFINE>,  the
  177.    string "IAC IAC" must be sent.
  178.  
  179.    The BM option is notably inefficient with regard to problems during
  180.    <macro byte> definition and use of  <macro byte>s as real data.  It
  181.    is expected that relatively few  <macro byte>s will be defined  and
  182.    that they will represent relatively short strings. Since the Telnet
  183.    data space  between decimal  128 and  decimal 254  is not  normally
  184.    used, except  by  implementations  employing  the  original  Telnet
  185.    protocol, it is  recommended that <macro  byte>s normally be  drawn
  186.    from that pool.
  187.