⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rfc1833.txt

📁 RFC 的详细文档!
💻 TXT
📖 第 1 页 / 共 2 页
字号:

RFC 1833        Binding Protocols for ONC RPC Version 2      August 1995


 version RPCBVERS4 {
     bool
     RPCBPROC_SET(rpcb) = 1;

     bool
     RPCBPROC_UNSET(rpcb) = 2;

     string
     RPCBPROC_GETADDR(rpcb) = 3;

     rpcblist_ptr
     RPCBPROC_DUMP(void) = 4;

     /*
      * NOTE: RPCBPROC_BCAST has the same functionality as CALLIT;
      * the new name is intended to indicate that this
      * procedure should be used for broadcast RPC, and
      * RPCBPROC_INDIRECT should be used for indirect calls.
      */
     rpcb_rmtcallres
     RPCBPROC_BCAST(rpcb_rmtcallargs) = RPCBPROC_CALLIT;

     unsigned int

     RPCBPROC_GETTIME(void) = 6;

     netbuf
     RPCBPROC_UADDR2TADDR(string) = 7;

     string
     RPCBPROC_TADDR2UADDR(netbuf) = 8;

     string
     RPCBPROC_GETVERSADDR(rpcb) = 9;

     rpcb_rmtcallres
     RPCBPROC_INDIRECT(rpcb_rmtcallargs) = 10;

     rpcb_entry_list_ptr
     RPCBPROC_GETADDRLIST(rpcb) = 11;

     rpcb_stat_byvers
     RPCBPROC_GETSTAT(void) = 12;
 } = 4;
} = 100000;






Srinivasan                  Standards Track                     [Page 8]

RFC 1833        Binding Protocols for ONC RPC Version 2      August 1995


2.2 RPCBIND Operation

   RPCBIND is contacted by way of an assigned address specific to the
   transport being used.  For TCP/IP and UDP/IP, for example, it is port
   number 111.  Each transport has such an assigned, well-known address.
   The following is a description of each of the procedures supported by
   RPCBIND.

2.2.1 RPCBIND Version 3

   RPCBPROC_SET:

   When a program first becomes available on a machine, it registers
   itself with RPCBIND running on the same machine.  The program passes
   its program number "r_prog", version number "r_vers", network
   identifier "r_netid", universal address "r_addr", and the owner of
   the service "r_owner".  The procedure returns a boolean response
   whose value is TRUE if the procedure successfully established the
   mapping and FALSE otherwise.  The procedure refuses to establish a
   mapping if one already exists for the ordered set ("r_prog",
   "r_vers", "r_netid").  Note that neither "r_netid" nor "r_addr" can
   be NULL, and that "r_netid" should be a valid network identifier on
   the machine making the call.

   RPCBPROC_UNSET:

   When a program becomes unavailable, it should unregister itself with
   the RPCBIND program on the same machine.  The parameters and results
   have meanings identical to those of RPCBPROC_SET.  The mapping of the
   ("r_prog", "r_vers", "r_netid") tuple with "r_addr" is deleted.  If
   "r_netid" is NULL, all mappings specified by the ordered set
   ("r_prog", "r_vers", *) and the corresponding universal addresses are
   deleted.  Only the owner of the service or the super-user is allowed
   to unset a service.

   RPCBPROC_GETADDR:

   Given a program number "r_prog", version number "r_vers", and network
   identifier  "r_netid", this procedure returns the universal address
   on which the program is awaiting call requests.  The "r_netid" field
   of the argument is ignored and the "r_netid" is inferred from the
   network identifier of the transport on which the request came in.

   RPCBPROC_DUMP:

   This procedure lists all entries in RPCBIND's database.  The
   procedure takes no parameters and returns a list of program, version,
   network identifier, and universal addresses.



Srinivasan                  Standards Track                     [Page 9]

RFC 1833        Binding Protocols for ONC RPC Version 2      August 1995


   RPCBPROC_CALLIT:

   This procedure allows a caller to call another remote procedure on
   the same machine without knowing the remote procedure's universal
   address.  It is intended for supporting broadcasts to arbitrary
   remote programs via RPCBIND's universal address.  The parameters
   "prog", "vers", "proc", and args are the program number, version
   number, procedure number, and parameters of the remote procedure.

   Note - This procedure only sends a response if the procedure was
   successfully executed and is silent (no response) otherwise.

   The procedure returns the remote program's universal address, and the
   results of the remote procedure.

   RPCBPROC_GETTIME:

   This procedure returns the local time on its own machine in seconds
   since the midnight of the First day of January, 1970.

   RPCBPROC_UADDR2TADDR:

   This procedure converts universal addresses to transport specific
   addresses.

   RPCBPROC_TADDR2UADDR:

   This procedure converts transport specific addresses to universal
   addresses.

2.2.2 RPCBIND, Version 4

   Version 4 of the RPCBIND protocol includes all of the above
   procedures, and adds several additional ones.

   RPCBPROC_BCAST:

   This procedure is identical to the version 3 RPCBPROC_CALLIT
   procedure.  The new name indicates that the procedure should be used
   for broadcast RPCs only.  RPCBPROC_INDIRECT, defined below, should be
   used for indirect RPC calls.

   RPCBPROC_GETVERSADDR:

   This procedure is similar to RPCBPROC_GETADDR.  The difference is the
   "r_vers" field of the rpcb structure can be used to specify the
   version of interest.  If that version is not registered, no address
   is returned.



Srinivasan                  Standards Track                    [Page 10]

RFC 1833        Binding Protocols for ONC RPC Version 2      August 1995


   RPCBPROC_INDIRECT:

   Similar to RPCBPROC_CALLIT.  Instead of being silent about errors
   (such as the program not being registered on the system), this
   procedure returns an indication of the error.  This procedure should
   not be used for broadcast RPC. It is intended to be used with
   indirect RPC calls only.

   RPCBPROC_GETADDRLIST:

   This procedure returns a list of addresses for the given rpcb entry.
   The client may be able use the results to determine alternate
   transports that it can use to communicate with the server.

   RPCBPROC_GETSTAT:

   This procedure returns statistics on the activity of the RPCBIND
   server.  The information lists the number and kind of requests the
   server has received.

   Note - All procedures except RPCBPROC_SET and RPCBPROC_UNSET can be
   called by clients running on a machine other than a machine on which
   RPCBIND is running.  RPCBIND only accepts RPCBPROC_SET and
   RPCBPROC_UNSET requests by clients running on the same machine as the
   RPCBIND program.

3. Port Mapper Program Protocol

   The port mapper program maps RPC program and version numbers to
   transport- specific port numbers.  This program makes dynamic binding
   of remote programs possible.  The port mapper protocol differs from
   the newer RPCBIND protocols in that it is transport specific in its
   address handling.

3.1 Port Mapper Protocol Specification (in RPC Language)

      const PMAP_PORT = 111;      /* portmapper port number */

   A mapping of (program, version, protocol) to port number:

      struct mapping {
         unsigned int prog;
         unsigned int vers;
         unsigned int prot;
         unsigned int port;
      };





Srinivasan                  Standards Track                    [Page 11]

RFC 1833        Binding Protocols for ONC RPC Version 2      August 1995


   Supported values for the "prot" field:

      const IPPROTO_TCP = 6;      /* protocol number for TCP/IP */
      const IPPROTO_UDP = 17;     /* protocol number for UDP/IP */

   A list of mappings:

      struct *pmaplist {
         mapping map;
         pmaplist next;
      };

   Arguments to callit:

      struct call_args {
         unsigned int prog;
         unsigned int vers;
         unsigned int proc;
         opaque args<>;
      };

   Results of callit:

      struct call_result {
         unsigned int port;
         opaque res<>;
      };

   Port mapper procedures:

      program PMAP_PROG {
         version PMAP_VERS {
            void
            PMAPPROC_NULL(void)         = 0;

            bool
            PMAPPROC_SET(mapping)       = 1;

            bool
            PMAPPROC_UNSET(mapping)     = 2;

            unsigned int
            PMAPPROC_GETPORT(mapping)   = 3;

            pmaplist
            PMAPPROC_DUMP(void)         = 4;

            call_result



Srinivasan                  Standards Track                    [Page 12]

RFC 1833        Binding Protocols for ONC RPC Version 2      August 1995


            PMAPPROC_CALLIT(call_args)  = 5;
         } = 2;
      } = 100000;

3.2 Port Mapper Operation

   The portmapper program currently supports two protocols (UDP and
   TCP).  The portmapper is contacted by talking to it on assigned port
   number 111 (SUNRPC) on either of these protocols.

   The following is a description of each of the portmapper procedures:

   PMAPPROC_NULL:

   This procedure does no work.  By convention, procedure zero of any
   protocol takes no parameters and returns no results.

   PMAPPROC_SET:

   When a program first becomes available on a machine, it registers
   itself with the port mapper program on the same machine.  The program
   passes its program number "prog", version number "vers", transport
   protocol number "prot", and the port "port" on which it awaits
   service request.  The procedure returns a boolean reply whose value
   is "TRUE" if the procedure successfully established the mapping and
   "FALSE" otherwise.  The procedure refuses to establish a mapping if
   one already exists for the tuple "(prog, vers, prot)".

   PMAPPROC_UNSET:

   When a program becomes unavailable, it should unregister itself with
   the port mapper program on the same machine.  The parameters and
   results have meanings identical to those of "PMAPPROC_SET".  The
   protocol and port number fields of the argument are ignored.

   PMAPPROC_GETPORT:

   Given a program number "prog", version number "vers", and transport
   protocol number "prot", this procedure returns the port number on
   which the program is awaiting call requests.  A port value of zeros
   means the program has not been registered.  The "port" field of the
   argument is ignored.

   PMAPPROC_DUMP:

   This procedure enumerates all entries in the port mapper's database.
   The procedure takes no parameters and returns a list of program,
   version, protocol, and port values.



Srinivasan                  Standards Track                    [Page 13]

RFC 1833        Binding Protocols for ONC RPC Version 2      August 1995


   PMAPPROC_CALLIT:

   This procedure allows a client to call another remote procedure on
   the same machine without knowing the remote procedure's port number.
   It is intended for supporting broadcasts to arbitrary remote programs
   via the well-known port mapper's port.  The parameters "prog",
   "vers", "proc", and the bytes of "args" are the program number,
   version number, procedure number, and parameters of the remote
   procedure.  Note:

      (1) This procedure only sends a reply if the procedure was
      successfully executed and is silent (no reply) otherwise.

      (2) The port mapper communicates with the remote program using UDP
      only.

   The procedure returns the remote program's port number, and the reply
   is the reply of the remote procedure.

References

   [1]  Srinivasan, R., "Remote Procedure Call Protocol Version 2",
        RFC 1831, Sun Microsystems, Inc., August 1995.

   [2]  Srinivasan, R., "XDR: External Data Representation Standard",
        RFC 1832, Sun Microsystems, Inc., August 1995.

Security Considerations

   Security issues are not discussed in this memo.

Author's Address

   Raj Srinivasan
   Sun Microsystems, Inc.
   ONC Technologies
   2550 Garcia Avenue
   M/S MTV-5-40
   Mountain View, CA  94043
   USA

   Phone: 415-336-2478
   Fax:   415-336-6015
   EMail: raj@eng.sun.com







Srinivasan                  Standards Track                    [Page 14]


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -