home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1997 December / Internet_Info_CD-ROM_Walnut_Creek_December_1997.iso / rfc / rfc1833 < prev    next >
Text File  |  1995-08-08  |  24KB  |  788 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7. Network Working Group                                      R. Srinivasan
  8. Request for Comments: 1833                              Sun Microsystems
  9. Category: Standards Track                                    August 1995
  10.  
  11.  
  12.                 Binding Protocols for ONC RPC Version 2
  13.  
  14. Status of this Memo
  15.  
  16.    This document specifies an Internet standards track protocol for the
  17.    Internet community, and requests discussion and suggestions for
  18.    improvements.  Please refer to the current edition of the "Internet
  19.    Official Protocol Standards" (STD 1) for the standardization state
  20.    and status of this protocol.  Distribution of this memo is unlimited.
  21.  
  22. ABSTRACT
  23.  
  24.    This document describes the binding protocols used in conjunction
  25.    with the ONC Remote Procedure Call (ONC RPC Version 2) protocols.
  26.  
  27. TABLE OF CONTENTS
  28.  
  29.    1. Introduction                                               1
  30.    2. RPCBIND Program Protocol                                   2
  31.    2.1 RPCBIND Protocol Specification (in RPC Language)          3
  32.    2.2 RPCBIND Operation                                         9
  33.    2.2.1 RPCBIND Version 3                                       9
  34.    2.2.2 RPCBIND, Version 4                                     10
  35.    3. Port Mapper Program Protocol                              11
  36.    3.1 Port Mapper Protocol Specification (in RPC Language)     11
  37.    3.2 Port Mapper Operation                                    13
  38.    References                                                   14
  39.    Security Considerations                                      14
  40.    Author's Address                                             14
  41.  
  42. 1. Introduction
  43.  
  44.    This document specifies the binding protocols used in conjunction
  45.    with ONC RPC Version 2.  As a prerequisite, the reader is expected to
  46.    be familiar with [1] and [2] which describe the ONC RPC Version 2 and
  47.    XDR (eXternal Data Representation) protocols.
  48.  
  49.    An RPC service is identified by its RPC program number, version
  50.    number, and the transport address where it may be reached.  The
  51.    transport address, in turn, consists of a network address and a
  52.    transport selector.  In the case of a service available over TCP/IP
  53.    or UDP/IP, the network address will be an IP address, and the
  54.    transport selector will be a TCP or UDP port number.
  55.  
  56.  
  57.  
  58. Srinivasan                  Standards Track                     [Page 1]
  59.  
  60. RFC 1833        Binding Protocols for ONC RPC Version 2      August 1995
  61.  
  62.  
  63.    A client program needs to know the RPC program number, version
  64.    number, and the transport address corresponding to a service in order
  65.    to utilize the service.  Of these, the RPC program number and version
  66.    number are usually built into the client program, as part of the
  67.    service definition.  The network address component of the transport
  68.    address is usually available in a name service, or is given as a
  69.    parameter to the client program.  The transport selector (ie., the
  70.    TCP or UDP port) is usually determined dynamically, and varies with
  71.    each invocation of the service.  Server programs allocate a transport
  72.    address, and register it with a well-known lookup service (well-known
  73.    because it uses a fixed transport selector, and resides at the same
  74.    network address as the server).  Client programs consult the lookup
  75.    service in order to obtain the server's transport address.
  76.  
  77.    Such a lookup service is very desirable because the range of well-
  78.    known transport selectors is very small for some transports and the
  79.    number of services is potentially very large.  By running only the
  80.    lookup service on a well-known transport selector, the transport
  81.    addresses of other remote programs can be ascertained by querying the
  82.    lookup service.
  83.  
  84.    This document describes three versions of a lookup service, all of
  85.    which use the same RPC program number (100000).  They all use port
  86.    111 over TCP and UDP transports.  Versions 3 and 4 are described in
  87.    Section 2 ("RPCBIND Program Protocol").  Version 2 is described in
  88.    Section 3 ("Port Mapper Program Protocol").
  89.  
  90.    The distinguishing characteristic of RPCBIND (versions 3 and 4) is
  91.    that this protocol uses a transport-independent format for the
  92.    transport address, known as the universal address format.  An address
  93.    in universal address format is an ASCII string representation of the
  94.    transport dependent address.  String representation of addresses
  95.    corresponding to a transport are defined by the addressing authority
  96.    for the transport.  The RPCBIND protocol can be used for binding ONC
  97.    RPC clients and servers over any transport.
  98.  
  99.    The Port Mapper (version 2), on the other hand, is an older protocol
  100.    that is specific to TCP and UDP.  It handles TCP and UDP ports
  101.    directly.
  102.  
  103. 2. RPCBIND Program Protocol
  104.  
  105.    The RPCBIND program maps RPC program and version numbers to universal
  106.    addresses, thus making dynamic binding of remote programs possible.
  107.  
  108.    The RPCBIND program is bound to a well-known address of each
  109.    supported transport, and other programs register their dynamically
  110.    allocated transport address with it.  The RPCBIND program then makes
  111.  
  112.  
  113.  
  114. Srinivasan                  Standards Track                     [Page 2]
  115.  
  116. RFC 1833        Binding Protocols for ONC RPC Version 2      August 1995
  117.  
  118.  
  119.    those addresses publicly available.
  120.  
  121.    The RPCBIND program also aids in broadcast RPC.  A given RPC program
  122.    will usually have different transport address bindings on different
  123.    machines, so there is no way to directly broadcast to all of these
  124.    programs. The RPCBIND program, however, does have a well-known
  125.    address.  So, to broadcast to a given program, the client actually
  126.    sends its message to the RPCBIND program located at the broadcast
  127.    address. Each instance of the RPCBIND program that picks up the
  128.    broadcast then calls the local service specified by the client.  When
  129.    the RPCBIND program gets the reply from the local service, it sends
  130.    the reply back to the client.
  131.  
  132. 2.1 RPCBIND Protocol Specification (in RPC Language)
  133.  
  134. /*
  135.  * rpcb_prot.x
  136.  * rpcbind protocol, versions 3 and 4, in RPC Language
  137.  */
  138.  
  139. /*
  140.  * rpcbind address for TCP/UDP
  141.  */
  142. const RPCB_PORT = 111;
  143.  
  144. /*
  145.  * A mapping of (program, version, network ID) to address
  146.  *
  147.  * The network identifier  (r_netid):
  148.  * This is a string that represents a local identification for a
  149.  * network. This is defined by a system administrator based on local
  150.  * conventions, and cannot be depended on to have the same value on
  151.  * every system.
  152.  */
  153. struct rpcb {
  154.  unsigned long r_prog;    /* program number */
  155.  unsigned long r_vers;    /* version number */
  156.  string r_netid<>;        /* network id */
  157.  string r_addr<>;         /* universal address */
  158.  string r_owner<>;        /* owner of this service */
  159. };
  160.  
  161. struct rp__list {
  162.  rpcb rpcb_map;
  163.  struct rp__list *rpcb_next;
  164. };
  165.  
  166.  
  167.  
  168.  
  169.  
  170. Srinivasan                  Standards Track                     [Page 3]
  171.  
  172. RFC 1833        Binding Protocols for ONC RPC Version 2      August 1995
  173.  
  174.  
  175. typedef rp__list *rpcblist_ptr;        /* results of RPCBPROC_DUMP */
  176.  
  177.  
  178. /*
  179.  * Arguments of remote calls
  180.  */
  181. struct rpcb_rmtcallargs {
  182.  unsigned long prog;        /* program number */
  183.  unsigned long vers;        /* version number */
  184.  unsigned long proc;        /* procedure number */
  185.  opaque args<>;             /* argument */
  186. };
  187.  
  188.  
  189. /*
  190.  * Results of the remote call
  191.  */
  192. struct rpcb_rmtcallres {
  193.  string addr<>;            /* remote universal address */
  194.  opaque results<>;         /* result */
  195. };
  196.  
  197.  
  198. /*
  199.  * rpcb_entry contains a merged address of a service on a particular
  200.  * transport, plus associated netconfig information.  A list of
  201.  * rpcb_entry items is returned by RPCBPROC_GETADDRLIST.  The meanings
  202.  * and values used for the r_nc_* fields are given below.
  203.  *
  204.  * The network identifier  (r_nc_netid):
  205.  
  206.  *   This is a string that represents a local identification for a
  207.  *   network.  This is defined by a system administrator based on
  208.  *   local conventions, and cannot be depended on to have the same
  209.  *   value on every system.
  210.  *
  211.  * Transport semantics (r_nc_semantics):
  212.  *  This represents the type of transport, and has the following values:
  213.  *     NC_TPI_CLTS     (1)      Connectionless
  214.  *     NC_TPI_COTS     (2)      Connection oriented
  215.  *     NC_TPI_COTS_ORD (3)      Connection oriented with graceful close
  216.  *     NC_TPI_RAW      (4)      Raw transport
  217.  *
  218.  * Protocol family (r_nc_protofmly):
  219.  *   This identifies the family to which the protocol belongs.  The
  220.  *   following values are defined:
  221.  *     NC_NOPROTOFMLY   "-"
  222.  *     NC_LOOPBACK      "loopback"
  223.  
  224.  
  225.  
  226. Srinivasan                  Standards Track                     [Page 4]
  227.  
  228. RFC 1833        Binding Protocols for ONC RPC Version 2      August 1995
  229.  
  230.  
  231.  *     NC_INET          "inet"
  232.  *     NC_IMPLINK       "implink"
  233.  *     NC_PUP           "pup"
  234.  *     NC_CHAOS         "chaos"
  235.  *     NC_NS            "ns"
  236.  *     NC_NBS           "nbs"
  237.  *     NC_ECMA          "ecma"
  238.  *     NC_DATAKIT       "datakit"
  239.  *     NC_CCITT         "ccitt"
  240.  *     NC_SNA           "sna"
  241.  *     NC_DECNET        "decnet"
  242.  *     NC_DLI           "dli"
  243.  *     NC_LAT           "lat"
  244.  *     NC_HYLINK        "hylink"
  245.  *     NC_APPLETALK     "appletalk"
  246.  *     NC_NIT           "nit"
  247.  *     NC_IEEE802       "ieee802"
  248.  *     NC_OSI           "osi"
  249.  *     NC_X25           "x25"
  250.  *     NC_OSINET        "osinet"
  251.  *     NC_GOSIP         "gosip"
  252.  *
  253.  * Protocol name (r_nc_proto):
  254.  *   This identifies a protocol within a family.  The following are
  255.  *   currently defined:
  256.  *      NC_NOPROTO      "-"
  257.  *      NC_TCP          "tcp"
  258.  *      NC_UDP          "udp"
  259.  *      NC_ICMP         "icmp"
  260.  */
  261. struct rpcb_entry {
  262.  string          r_maddr<>;            /* merged address of service */
  263.  string          r_nc_netid<>;         /* netid field */
  264.  unsigned long   r_nc_semantics;       /* semantics of transport */
  265.  string          r_nc_protofmly<>;     /* protocol family */
  266.  string          r_nc_proto<>;         /* protocol name */
  267. };
  268.  
  269. /*
  270.  * A list of addresses supported by a service.
  271.  */
  272. struct rpcb_entry_list {
  273.  rpcb_entry rpcb_entry_map;
  274.  struct rpcb_entry_list *rpcb_entry_next;
  275. };
  276.  
  277. typedef rpcb_entry_list *rpcb_entry_list_ptr;
  278.  
  279.  
  280.  
  281.  
  282. Srinivasan                  Standards Track                     [Page 5]
  283.  
  284. RFC 1833        Binding Protocols for ONC RPC Version 2      August 1995
  285.  
  286.  
  287. /*
  288.  * rpcbind statistics
  289.  */
  290.  
  291. const rpcb_highproc_2 = RPCBPROC_CALLIT;
  292. const rpcb_highproc_3 = RPCBPROC_TADDR2UADDR;
  293. const rpcb_highproc_4 = RPCBPROC_GETSTAT;
  294.  
  295. const RPCBSTAT_HIGHPROC = 13; /* # of procs in rpcbind V4 plus one */
  296. const RPCBVERS_STAT     = 3; /* provide only for rpcbind V2, V3 and V4 */
  297. const RPCBVERS_4_STAT   = 2;
  298. const RPCBVERS_3_STAT   = 1;
  299. const RPCBVERS_2_STAT   = 0;
  300.  
  301. /* Link list of all the stats about getport and getaddr */
  302. struct rpcbs_addrlist {
  303.  unsigned long prog;
  304.  unsigned long vers;
  305.  int success;
  306.  int failure;
  307.  string netid<>;
  308.  struct rpcbs_addrlist *next;
  309. };
  310.  
  311. /* Link list of all the stats about rmtcall */
  312. struct rpcbs_rmtcalllist {
  313.  unsigned long prog;
  314.  unsigned long vers;
  315.  unsigned long proc;
  316.  int success;
  317.  int failure;
  318.  int indirect;    /* whether callit or indirect */
  319.  string netid<>;
  320.  struct rpcbs_rmtcalllist *next;
  321. };
  322.  
  323. typedef int rpcbs_proc[RPCBSTAT_HIGHPROC];
  324. typedef rpcbs_addrlist *rpcbs_addrlist_ptr;
  325. typedef rpcbs_rmtcalllist *rpcbs_rmtcalllist_ptr;
  326.  
  327. struct rpcb_stat {
  328.  rpcbs_proc              info;
  329.  int                     setinfo;
  330.  int                     unsetinfo;
  331.  rpcbs_addrlist_ptr      addrinfo;
  332.  rpcbs_rmtcalllist_ptr   rmtinfo;
  333. };
  334.  
  335.  
  336.  
  337.  
  338. Srinivasan                  Standards Track                     [Page 6]
  339.  
  340. RFC 1833        Binding Protocols for ONC RPC Version 2      August 1995
  341.  
  342.  
  343. /*
  344.  * One rpcb_stat structure is returned for each version of rpcbind
  345.  * being monitored.
  346.  */
  347.  
  348. typedef rpcb_stat rpcb_stat_byvers[RPCBVERS_STAT];
  349.  
  350. /*
  351.  * netbuf structure, used to store the transport specific form of
  352.  * a universal transport address.
  353.  */
  354. struct netbuf {
  355.  unsigned int maxlen;
  356.  opaque buf<>;
  357. };
  358.  
  359.  
  360. /*
  361.  * rpcbind procedures
  362.  */
  363. program RPCBPROG {
  364.  version RPCBVERS {
  365.      bool
  366.      RPCBPROC_SET(rpcb) = 1;
  367.  
  368.      bool
  369.      RPCBPROC_UNSET(rpcb) = 2;
  370.  
  371.      string
  372.      RPCBPROC_GETADDR(rpcb) = 3;
  373.  
  374.      rpcblist_ptr
  375.      RPCBPROC_DUMP(void) = 4;
  376.  
  377.      rpcb_rmtcallres
  378.      RPCBPROC_CALLIT(rpcb_rmtcallargs) = 5;
  379.  
  380.      unsigned int
  381.      RPCBPROC_GETTIME(void) = 6;
  382.  
  383.      netbuf
  384.      RPCBPROC_UADDR2TADDR(string) = 7;
  385.  
  386.      string
  387.      RPCBPROC_TADDR2UADDR(netbuf) = 8;
  388.  } = 3;
  389.  
  390.  
  391.  
  392.  
  393.  
  394. Srinivasan                  Standards Track                     [Page 7]
  395.  
  396. RFC 1833        Binding Protocols for ONC RPC Version 2      August 1995
  397.  
  398.  
  399.  version RPCBVERS4 {
  400.      bool
  401.      RPCBPROC_SET(rpcb) = 1;
  402.  
  403.      bool
  404.      RPCBPROC_UNSET(rpcb) = 2;
  405.  
  406.      string
  407.      RPCBPROC_GETADDR(rpcb) = 3;
  408.  
  409.      rpcblist_ptr
  410.      RPCBPROC_DUMP(void) = 4;
  411.  
  412.      /*
  413.       * NOTE: RPCBPROC_BCAST has the same functionality as CALLIT;
  414.       * the new name is intended to indicate that this
  415.       * procedure should be used for broadcast RPC, and
  416.       * RPCBPROC_INDIRECT should be used for indirect calls.
  417.       */
  418.      rpcb_rmtcallres
  419.      RPCBPROC_BCAST(rpcb_rmtcallargs) = RPCBPROC_CALLIT;
  420.  
  421.      unsigned int
  422.  
  423.      RPCBPROC_GETTIME(void) = 6;
  424.  
  425.      netbuf
  426.      RPCBPROC_UADDR2TADDR(string) = 7;
  427.  
  428.      string
  429.      RPCBPROC_TADDR2UADDR(netbuf) = 8;
  430.  
  431.      string
  432.      RPCBPROC_GETVERSADDR(rpcb) = 9;
  433.  
  434.      rpcb_rmtcallres
  435.      RPCBPROC_INDIRECT(rpcb_rmtcallargs) = 10;
  436.  
  437.      rpcb_entry_list_ptr
  438.      RPCBPROC_GETADDRLIST(rpcb) = 11;
  439.  
  440.      rpcb_stat_byvers
  441.      RPCBPROC_GETSTAT(void) = 12;
  442.  } = 4;
  443. } = 100000;
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450. Srinivasan                  Standards Track                     [Page 8]
  451.  
  452. RFC 1833        Binding Protocols for ONC RPC Version 2      August 1995
  453.  
  454.  
  455. 2.2 RPCBIND Operation
  456.  
  457.    RPCBIND is contacted by way of an assigned address specific to the
  458.    transport being used.  For TCP/IP and UDP/IP, for example, it is port
  459.    number 111.  Each transport has such an assigned, well-known address.
  460.    The following is a description of each of the procedures supported by
  461.    RPCBIND.
  462.  
  463. 2.2.1 RPCBIND Version 3
  464.  
  465.    RPCBPROC_SET:
  466.  
  467.    When a program first becomes available on a machine, it registers
  468.    itself with RPCBIND running on the same machine.  The program passes
  469.    its program number "r_prog", version number "r_vers", network
  470.    identifier "r_netid", universal address "r_addr", and the owner of
  471.    the service "r_owner".  The procedure returns a boolean response
  472.    whose value is TRUE if the procedure successfully established the
  473.    mapping and FALSE otherwise.  The procedure refuses to establish a
  474.    mapping if one already exists for the ordered set ("r_prog",
  475.    "r_vers", "r_netid").  Note that neither "r_netid" nor "r_addr" can
  476.    be NULL, and that "r_netid" should be a valid network identifier on
  477.    the machine making the call.
  478.  
  479.    RPCBPROC_UNSET:
  480.  
  481.    When a program becomes unavailable, it should unregister itself with
  482.    the RPCBIND program on the same machine.  The parameters and results
  483.    have meanings identical to those of RPCBPROC_SET.  The mapping of the
  484.    ("r_prog", "r_vers", "r_netid") tuple with "r_addr" is deleted.  If
  485.    "r_netid" is NULL, all mappings specified by the ordered set
  486.    ("r_prog", "r_vers", *) and the corresponding universal addresses are
  487.    deleted.  Only the owner of the service or the super-user is allowed
  488.    to unset a service.
  489.  
  490.    RPCBPROC_GETADDR:
  491.  
  492.    Given a program number "r_prog", version number "r_vers", and network
  493.    identifier  "r_netid", this procedure returns the universal address
  494.    on which the program is awaiting call requests.  The "r_netid" field
  495.    of the argument is ignored and the "r_netid" is inferred from the
  496.    network identifier of the transport on which the request came in.
  497.  
  498.    RPCBPROC_DUMP:
  499.  
  500.    This procedure lists all entries in RPCBIND's database.  The
  501.    procedure takes no parameters and returns a list of program, version,
  502.    network identifier, and universal addresses.
  503.  
  504.  
  505.  
  506. Srinivasan                  Standards Track                     [Page 9]
  507.  
  508. RFC 1833        Binding Protocols for ONC RPC Version 2      August 1995
  509.  
  510.  
  511.    RPCBPROC_CALLIT:
  512.  
  513.    This procedure allows a caller to call another remote procedure on
  514.    the same machine without knowing the remote procedure's universal
  515.    address.  It is intended for supporting broadcasts to arbitrary
  516.    remote programs via RPCBIND's universal address.  The parameters
  517.    "prog", "vers", "proc", and args are the program number, version
  518.    number, procedure number, and parameters of the remote procedure.
  519.  
  520.    Note - This procedure only sends a response if the procedure was
  521.    successfully executed and is silent (no response) otherwise.
  522.  
  523.    The procedure returns the remote program's universal address, and the
  524.    results of the remote procedure.
  525.  
  526.    RPCBPROC_GETTIME:
  527.  
  528.    This procedure returns the local time on its own machine in seconds
  529.    since the midnight of the First day of January, 1970.
  530.  
  531.    RPCBPROC_UADDR2TADDR:
  532.  
  533.    This procedure converts universal addresses to transport specific
  534.    addresses.
  535.  
  536.    RPCBPROC_TADDR2UADDR:
  537.  
  538.    This procedure converts transport specific addresses to universal
  539.    addresses.
  540.  
  541. 2.2.2 RPCBIND, Version 4
  542.  
  543.    Version 4 of the RPCBIND protocol includes all of the above
  544.    procedures, and adds several additional ones.
  545.  
  546.    RPCBPROC_BCAST:
  547.  
  548.    This procedure is identical to the version 3 RPCBPROC_CALLIT
  549.    procedure.  The new name indicates that the procedure should be used
  550.    for broadcast RPCs only.  RPCBPROC_INDIRECT, defined below, should be
  551.    used for indirect RPC calls.
  552.  
  553.    RPCBPROC_GETVERSADDR:
  554.  
  555.    This procedure is similar to RPCBPROC_GETADDR.  The difference is the
  556.    "r_vers" field of the rpcb structure can be used to specify the
  557.    version of interest.  If that version is not registered, no address
  558.    is returned.
  559.  
  560.  
  561.  
  562. Srinivasan                  Standards Track                    [Page 10]
  563.  
  564. RFC 1833        Binding Protocols for ONC RPC Version 2      August 1995
  565.  
  566.  
  567.    RPCBPROC_INDIRECT:
  568.  
  569.    Similar to RPCBPROC_CALLIT.  Instead of being silent about errors
  570.    (such as the program not being registered on the system), this
  571.    procedure returns an indication of the error.  This procedure should
  572.    not be used for broadcast RPC. It is intended to be used with
  573.    indirect RPC calls only.
  574.  
  575.    RPCBPROC_GETADDRLIST:
  576.  
  577.    This procedure returns a list of addresses for the given rpcb entry.
  578.    The client may be able use the results to determine alternate
  579.    transports that it can use to communicate with the server.
  580.  
  581.    RPCBPROC_GETSTAT:
  582.  
  583.    This procedure returns statistics on the activity of the RPCBIND
  584.    server.  The information lists the number and kind of requests the
  585.    server has received.
  586.  
  587.    Note - All procedures except RPCBPROC_SET and RPCBPROC_UNSET can be
  588.    called by clients running on a machine other than a machine on which
  589.    RPCBIND is running.  RPCBIND only accepts RPCBPROC_SET and
  590.    RPCBPROC_UNSET requests by clients running on the same machine as the
  591.    RPCBIND program.
  592.  
  593. 3. Port Mapper Program Protocol
  594.  
  595.    The port mapper program maps RPC program and version numbers to
  596.    transport- specific port numbers.  This program makes dynamic binding
  597.    of remote programs possible.  The port mapper protocol differs from
  598.    the newer RPCBIND protocols in that it is transport specific in its
  599.    address handling.
  600.  
  601. 3.1 Port Mapper Protocol Specification (in RPC Language)
  602.  
  603.       const PMAP_PORT = 111;      /* portmapper port number */
  604.  
  605.    A mapping of (program, version, protocol) to port number:
  606.  
  607.       struct mapping {
  608.          unsigned int prog;
  609.          unsigned int vers;
  610.          unsigned int prot;
  611.          unsigned int port;
  612.       };
  613.  
  614.  
  615.  
  616.  
  617.  
  618. Srinivasan                  Standards Track                    [Page 11]
  619.  
  620. RFC 1833        Binding Protocols for ONC RPC Version 2      August 1995
  621.  
  622.  
  623.    Supported values for the "prot" field:
  624.  
  625.       const IPPROTO_TCP = 6;      /* protocol number for TCP/IP */
  626.       const IPPROTO_UDP = 17;     /* protocol number for UDP/IP */
  627.  
  628.    A list of mappings:
  629.  
  630.       struct *pmaplist {
  631.          mapping map;
  632.          pmaplist next;
  633.       };
  634.  
  635.    Arguments to callit:
  636.  
  637.       struct call_args {
  638.          unsigned int prog;
  639.          unsigned int vers;
  640.          unsigned int proc;
  641.          opaque args<>;
  642.       };
  643.  
  644.    Results of callit:
  645.  
  646.       struct call_result {
  647.          unsigned int port;
  648.          opaque res<>;
  649.       };
  650.  
  651.    Port mapper procedures:
  652.  
  653.       program PMAP_PROG {
  654.          version PMAP_VERS {
  655.             void
  656.             PMAPPROC_NULL(void)         = 0;
  657.  
  658.             bool
  659.             PMAPPROC_SET(mapping)       = 1;
  660.  
  661.             bool
  662.             PMAPPROC_UNSET(mapping)     = 2;
  663.  
  664.             unsigned int
  665.             PMAPPROC_GETPORT(mapping)   = 3;
  666.  
  667.             pmaplist
  668.             PMAPPROC_DUMP(void)         = 4;
  669.  
  670.             call_result
  671.  
  672.  
  673.  
  674. Srinivasan                  Standards Track                    [Page 12]
  675.  
  676. RFC 1833        Binding Protocols for ONC RPC Version 2      August 1995
  677.  
  678.  
  679.             PMAPPROC_CALLIT(call_args)  = 5;
  680.          } = 2;
  681.       } = 100000;
  682.  
  683. 3.2 Port Mapper Operation
  684.  
  685.    The portmapper program currently supports two protocols (UDP and
  686.    TCP).  The portmapper is contacted by talking to it on assigned port
  687.    number 111 (SUNRPC) on either of these protocols.
  688.  
  689.    The following is a description of each of the portmapper procedures:
  690.  
  691.    PMAPPROC_NULL:
  692.  
  693.    This procedure does no work.  By convention, procedure zero of any
  694.    protocol takes no parameters and returns no results.
  695.  
  696.    PMAPPROC_SET:
  697.  
  698.    When a program first becomes available on a machine, it registers
  699.    itself with the port mapper program on the same machine.  The program
  700.    passes its program number "prog", version number "vers", transport
  701.    protocol number "prot", and the port "port" on which it awaits
  702.    service request.  The procedure returns a boolean reply whose value
  703.    is "TRUE" if the procedure successfully established the mapping and
  704.    "FALSE" otherwise.  The procedure refuses to establish a mapping if
  705.    one already exists for the tuple "(prog, vers, prot)".
  706.  
  707.    PMAPPROC_UNSET:
  708.  
  709.    When a program becomes unavailable, it should unregister itself with
  710.    the port mapper program on the same machine.  The parameters and
  711.    results have meanings identical to those of "PMAPPROC_SET".  The
  712.    protocol and port number fields of the argument are ignored.
  713.  
  714.    PMAPPROC_GETPORT:
  715.  
  716.    Given a program number "prog", version number "vers", and transport
  717.    protocol number "prot", this procedure returns the port number on
  718.    which the program is awaiting call requests.  A port value of zeros
  719.    means the program has not been registered.  The "port" field of the
  720.    argument is ignored.
  721.  
  722.    PMAPPROC_DUMP:
  723.  
  724.    This procedure enumerates all entries in the port mapper's database.
  725.    The procedure takes no parameters and returns a list of program,
  726.    version, protocol, and port values.
  727.  
  728.  
  729.  
  730. Srinivasan                  Standards Track                    [Page 13]
  731.  
  732. RFC 1833        Binding Protocols for ONC RPC Version 2      August 1995
  733.  
  734.  
  735.    PMAPPROC_CALLIT:
  736.  
  737.    This procedure allows a client to call another remote procedure on
  738.    the same machine without knowing the remote procedure's port number.
  739.    It is intended for supporting broadcasts to arbitrary remote programs
  740.    via the well-known port mapper's port.  The parameters "prog",
  741.    "vers", "proc", and the bytes of "args" are the program number,
  742.    version number, procedure number, and parameters of the remote
  743.    procedure.  Note:
  744.  
  745.       (1) This procedure only sends a reply if the procedure was
  746.       successfully executed and is silent (no reply) otherwise.
  747.  
  748.       (2) The port mapper communicates with the remote program using UDP
  749.       only.
  750.  
  751.    The procedure returns the remote program's port number, and the reply
  752.    is the reply of the remote procedure.
  753.  
  754. References
  755.  
  756.    [1]  Srinivasan, R., "Remote Procedure Call Protocol Version 2",
  757.         RFC 1831, Sun Microsystems, Inc., August 1995.
  758.  
  759.    [2]  Srinivasan, R., "XDR: External Data Representation Standard",
  760.         RFC 1832, Sun Microsystems, Inc., August 1995.
  761.  
  762. Security Considerations
  763.  
  764.    Security issues are not discussed in this memo.
  765.  
  766. Author's Address
  767.  
  768.    Raj Srinivasan
  769.    Sun Microsystems, Inc.
  770.    ONC Technologies
  771.    2550 Garcia Avenue
  772.    M/S MTV-5-40
  773.    Mountain View, CA  94043
  774.    USA
  775.  
  776.    Phone: 415-336-2478
  777.    Fax:   415-336-6015
  778.    EMail: raj@eng.sun.com
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786. Srinivasan                  Standards Track                    [Page 14]
  787.  
  788.