


RAPGEN(1)                                               RAPGEN(1)


NNAAMMEE
       rapgen - RPC/RAP protocol compiler

SSYYNNOOPPSSIISS
       rraappggeenn [ --ddllrrppOOPPAA ] [ --aa | --MM ] [ --tt _u_d_p|_t_c_p ]* iinnffiillee

       rraappggeenn [ --ddllrrppOOPPAA ] { --cc | --ss | --hh | --xx } [ --oo _o_u_t_f_i_l_e ]
              [ iinnffiillee ]

       rraappggeenn [ --ddPPAA ] { --CC | --SS } [ --tt _u_d_p|_t_c_p ]* [ --oo _o_u_t_f_i_l_e ]
              [ iinnffiillee ]

DDEESSCCRRIIPPTTIIOONN
       The rraappggeenn command is an  adaptation  of  Sun's  rrppccggeenn(1)
       command.   The  rraappggeenn  command  has several features that
       make it a bit more usable than rpcgen, and  a  rap  option
       that currently allows the same transport to be used by the
       RAP protocol and the protcol being compiled, but may even-
       tually produce RAP registration code in the server and RAP
       lookup and binding in the client.

       The original rpcgen generates the following files for  the
       input file _p_r_o_t_o.x:

       _p_r_o_t_o_svc.c    Service program, stub procedures, and optional main().
       _p_r_o_t_o_clnt.c   Client stubs.
       _p_r_o_t_o_xdr.c    Data structure encode/decode routines.
       _p_r_o_t_o.h        Data structure and constant declarations.

       The  rraappggeenn command produces these same output files, how-
       ever, the service main() routine is written to a  separate
       file.   The  following  summarizes  the  additional output
       files generated by rraappggeenn:

       _p_r_o_t_o.c        The client's main() function.
       _p_r_o_t_od.c       The service main().
       Makefile       Build rules.

       By   default,   rraappggeenn    generates    the    _p_r_o_t_o_svc.c,
       _p_r_o_t_o_clnt.c, _p_r_o_t_o_xdr.c and _p_r_o_t_o.h files.

       See  the SYNTAX section below for syntax changes recogized
       by rraappggeenn but not by rrppccggeenn.

OOPPTTIIOONNSS
       --aa      Produce all modules.

       --cc      Produce client stubs (_p_r_o_t_o_clnt.c file).

       --ss      Produce service stubs (_p_r_o_t_o_svc.c file).

       --hh      Produce include file (_p_r_o_t_o.h file).

       --xx      Produce xdr routines (_p_r_o_t_o_xdr.c file).



UNRELEASED                March 08, 2000                        1





RAPGEN(1)                                               RAPGEN(1)


       --CC      Produce client main (_p_r_o_t_o.c file).

       --SS      Produce service main (_p_r_o_t_od.c file).

       --MM      Produce Makefile.

       --ll      Produce a library of xdr, client stub, and  server
               stub routines.

       --OO      Optimize xdr output (try to inline simple routines
               that are ordinarily procedure calls).

       --PP      Generate ANSI function prototypes (default depends
               on the default compiler for a given platform).

       --AA      Generate  ANSI  C  (use  const  and uL, and assume
               standard ANSI include files).

       --oo _n_a_m_e Output file name (default output file name depends
               on  the  option given; see the DESCRIPTION section
               for default names).

       --tt _u_d_p  Force the use of the UDP tranport (default  allows
               all known transports).

       --tt _t_c_p  Force the use of the TCP transport (default allows
               all known transports).

       --dd      Include debugging in output files.

       --pp      Generate calls to svc routines such that a pointer
               to the return value is passed as the final parame-
               ter, after the struct svc_req parameter.   Without
               this  option, the svc routine must allocate static
               space for the return value.

       --rr      Include RAP support in output files.  This  allows
               the  same  transport handle the same client and/or
               service routines to be use for not only the proto-
               col  specified  in  the  _p_r_o_t_o.x file, but the RAP
               protocol as well, saving kernel network resources.

SSYYNNTTAAXX
       The  syntax recognized by rraappggeenn is a superset of the syn-
       tax recognized by rrppccggeenn.  The following  additional  fea-
       tures are supported:

       +o  Procedures   can   include   multiple   parameters  and
          (optional) parameter names.   Single-indirect  pointers
          are  also  recognized  (parameter  types  with one star
          (``*'')).

       +o  Each procedure can  include  an  authentication  flavor
          list.



UNRELEASED                March 08, 2000                        2





RAPGEN(1)                                               RAPGEN(1)


       +o  Program can include authentication flavor list.

       +o  Unions can include multiple fields in a single discrim-
          inated arm.

       The following rules summarize the syntax changes:

       decl_spec ::=      type name;

       decl_list ::=      decl_spec*

       procedure_spec ::= type
                          name "(" decl_list ")" "=" number
                          ["authentication" name [, name]* ]* ";"

       program_spec ::=   "program" name "{" [version_spec]* "}" "=" number
                          ["authentication" name [, name]* ]* ";"

       union_spec ::=     "union" name "switch (" type [name] ")" "{"
                          ["case" name ":" decl_list* ]*
                          ["default" ":" decl_list* ]*
                          "}" ";"

SSEEEE AALLSSOO
       ccpppp(1), rrppccggeenn(1), rrppcc(3)

BBUUGGSS
       The support for authentication flavors is untested.

       The RAP option, --rr, should generate more  code  when  used
       with the --CC or --SS options.


























UNRELEASED                March 08, 2000                        3


