Home | History | Annotate | Line # | Download | only in rpc.pcnfsd
      1  1.7     sevan /*	$NetBSD: pcnfsd.x,v 1.7 2018/01/23 21:27:20 sevan Exp $	*/
      2  1.2       gwr 
      3  1.1       jtc /* The maximum number of bytes in a user name argument */
      4  1.1       jtc const IDENTLEN = 32;
      5  1.1       jtc /*  The maximum number of bytes in a password argument  */
      6  1.1       jtc const PASSWORDLEN = 64;
      7  1.1       jtc /*  The maximum number of bytes in a print client name argument  */
      8  1.1       jtc const CLIENTLEN = 64;
      9  1.1       jtc /*  The maximum number of bytes in a printer name argument  */
     10  1.1       jtc const PRINTERNAMELEN = 64;
     11  1.1       jtc /*  The maximum number of bytes in a print user name argument  */
     12  1.1       jtc const USERNAMELEN = 64;
     13  1.1       jtc /*  The maximum number of bytes in a print spool file name argument  */
     14  1.1       jtc const SPOOLNAMELEN = 64;
     15  1.1       jtc /*  The maximum number of bytes in a print options argument  */
     16  1.1       jtc const OPTIONSLEN = 64;
     17  1.1       jtc /*  The maximum number of bytes in a print spool directory path  */
     18  1.1       jtc const SPOOLDIRLEN = 255;
     19  1.1       jtc /*   The maximum number of secondary GIDs returned by a V2 AUTH  */
     20  1.1       jtc const EXTRAGIDLEN = 16;
     21  1.1       jtc /*   The  maximum number of bytes in a home directory spec  */
     22  1.1       jtc const HOMEDIRLEN = 255;
     23  1.1       jtc /*   The maximum number of bytes in a misc. comments string */
     24  1.1       jtc const COMMENTLEN = 255;
     25  1.1       jtc /*   The maximum number of bytes in a print job id */
     26  1.1       jtc const PRINTJOBIDLEN = 255;
     27  1.1       jtc /*   The maximum number of printers returned by a LIST operation */
     28  1.1       jtc const PRLISTMAX = 32;
     29  1.1       jtc /*   The maximum number of print jobs returned by a QUEUE operation */
     30  1.1       jtc const PRQUEUEMAX = 128;
     31  1.1       jtc /*   The maximum number of entries in the facilities list */
     32  1.1       jtc const FACILITIESMAX = 32;
     33  1.1       jtc /*   The maximum length of an operator message */
     34  1.1       jtc const MESSAGELEN = 512;
     35  1.1       jtc 
     36  1.1       jtc 
     37  1.1       jtc 
     38  1.1       jtc typedef string ident<IDENTLEN>;
     39  1.1       jtc /*
     40  1.1       jtc ** The type ident is used for passing an encoded user name for
     41  1.1       jtc ** authentication. The server should decode the string by replacing each
     42  1.1       jtc ** octet with the value formed by performing an exclusive-or of the octet
     43  1.1       jtc ** value with the value 0x5b and and'ing the result with 0x7f.
     44  1.1       jtc */
     45  1.1       jtc 
     46  1.1       jtc typedef string message<MESSAGELEN>;
     47  1.1       jtc /*
     48  1.1       jtc ** The type message is used for passing an alert message to the
     49  1.1       jtc ** system operator on the server. The text may include newlines.
     50  1.1       jtc */
     51  1.1       jtc 
     52  1.1       jtc typedef string password<PASSWORDLEN>;
     53  1.1       jtc /*
     54  1.1       jtc ** The type password is used for passing an encode password for
     55  1.1       jtc ** authentication.  The server should decode the password as described
     56  1.1       jtc ** above.
     57  1.1       jtc */
     58  1.1       jtc 
     59  1.1       jtc typedef string client<CLIENTLEN>;
     60  1.1       jtc /*
     61  1.1       jtc ** The type client is used for passing the hostname of a client for
     62  1.1       jtc ** printing. The server may use this name in constructing the spool
     63  1.1       jtc ** directory name.
     64  1.1       jtc */
     65  1.1       jtc 
     66  1.1       jtc typedef string printername<PRINTERNAMELEN>;
     67  1.1       jtc /*
     68  1.1       jtc ** The type printername is used for passing the name of a printer on which
     69  1.1       jtc ** the client wishes to print.
     70  1.1       jtc */
     71  1.1       jtc 
     72  1.1       jtc typedef string username<USERNAMELEN>;
     73  1.1       jtc /*
     74  1.1       jtc ** The type username is used for passing the user name for a print job.
     75  1.1       jtc ** The server may use this in any way it chooses: it may attempt to change
     76  1.1       jtc ** the effective identity with which it is running to username or may
     77  1.1       jtc ** simply arrange for the text to be printed on the banner page.
     78  1.1       jtc */
     79  1.1       jtc 
     80  1.1       jtc typedef string comment<COMMENTLEN>;
     81  1.1       jtc /*
     82  1.1       jtc ** The type comment is used to pass an uninterpreted text string which
     83  1.1       jtc ** may be used by displayed to a human user or used for custom
     84  1.1       jtc ** extensions to the PCNFSD service. If you elect to extend PCNFSD
     85  1.1       jtc ** service in this way, please do so in a way which will avoid
     86  1.1       jtc ** problems if your client attempts to interoperate with a server
     87  1.1       jtc ** which does not support your extension. One way to do this is to
     88  1.1       jtc ** use the
     89  1.1       jtc */
     90  1.1       jtc 
     91  1.1       jtc typedef string spoolname<SPOOLNAMELEN>;
     92  1.1       jtc /*
     93  1.1       jtc ** The type spoolname is used for passing the name of a print spool file
     94  1.1       jtc ** (a simple filename not a pathname) within the spool directory.
     95  1.1       jtc */
     96  1.1       jtc 
     97  1.1       jtc typedef string printjobid<PRINTJOBIDLEN>;
     98  1.1       jtc /*
     99  1.1       jtc ** The type printjobid is used for passing the id of a print job.
    100  1.1       jtc */
    101  1.1       jtc 
    102  1.1       jtc typedef string homedir<OPTIONSLEN>;
    103  1.1       jtc /*
    104  1.1       jtc ** The type homedir is used to return the home directory for the user.
    105  1.1       jtc ** If present, it should be in the form "hostname:path", where hostname
    106  1.1       jtc ** and path are in a suitable form for communicating with the mount server.
    107  1.1       jtc */
    108  1.1       jtc 
    109  1.1       jtc typedef string options<OPTIONSLEN>;
    110  1.1       jtc /*
    111  1.1       jtc ** The type options is used for passing implementation-specific print
    112  1.1       jtc ** control information.  The option string is a set of printable ASCII
    113  1.1       jtc ** characters.  The first character should be ignored by the server; it is
    114  1.1       jtc ** reserved for client use. The second character specifies the type of
    115  1.1       jtc ** data in the print file.  The following types are defined (an
    116  1.1       jtc ** implementation may define additional values):
    117  1.1       jtc **
    118  1.1       jtc **  p - PostScript data. The client will ensure that a valid
    119  1.1       jtc **      PostScript header is included.
    120  1.1       jtc **  d - Diablo 630 data.
    121  1.1       jtc **  x - Generic printable ASCII text. The client will have filtered
    122  1.1       jtc **      out all non-printable characters other than CR, LF, TAB,
    123  1.1       jtc **      BS and VT.
    124  1.1       jtc **  r - Raw print data. The client performs no filtering.
    125  1.1       jtc **  u - User-defined. Reserved for custom extensions. A vanilla
    126  1.1       jtc **      pcnfsd server will treat this as equivalent to "r"
    127  1.1       jtc **
    128  1.1       jtc ** If diablo data (type 'd') is specified, a formatting specification
    129  1.1       jtc ** string will be appended. This has the form:
    130  1.1       jtc ** 	ppnnnbbb
    131  1.1       jtc **         pp
    132  1.1       jtc ** Pitch - 10, 12 or 15.
    133  1.1       jtc **           nnn
    134  1.1       jtc ** The ``normal'' font to be used - encoded as follows:
    135  1.1       jtc **             Courier                    crn
    136  1.1       jtc **             Courier-Bold               crb
    137  1.1       jtc **             Courier-Oblique            con
    138  1.1       jtc **             Courier-BoldObliqu         cob
    139  1.1       jtc **             Helvetica                  hrn
    140  1.1       jtc **             Helvetica-Bold             hrb
    141  1.1       jtc **             Helvetica-Oblique          hon
    142  1.1       jtc **             Helvetica-BoldOblique      hob
    143  1.1       jtc **             Times-Roman                trn
    144  1.1       jtc **             Times-Bold                 trb
    145  1.1       jtc **             Times-Italic               ton
    146  1.1       jtc **             Times-BoldItalic           tob
    147  1.1       jtc **              bbb
    148  1.1       jtc ** The ``bold'' font to be used - encoded in the same way.  For example,
    149  1.1       jtc ** the string ``nd10hrbcob'' specifies that the print data is in Diablo
    150  1.1       jtc ** 630 format, it should be printed at 10 pitch, ``normal'' text should be
    151  1.1       jtc ** printed in Helvetica-Bold, and ``bold'' text should be printed in
    152  1.1       jtc ** Courier-BoldOblique.
    153  1.1       jtc */
    154  1.1       jtc 
    155  1.1       jtc enum arstat {
    156  1.1       jtc         AUTH_RES_OK = 0,
    157  1.1       jtc         AUTH_RES_FAKE = 1,
    158  1.1       jtc         AUTH_RES_FAIL = 2
    159  1.1       jtc };
    160  1.1       jtc /*
    161  1.1       jtc ** The type arstat is returned by PCNFSD_AUTH. A value of AUTH_RES_OK
    162  1.1       jtc ** indicates that the server was able to verify the ident and password
    163  1.1       jtc ** successfully.AUTH_RES_FAIL is returned if a verification failure
    164  1.1       jtc ** occurred. The value AUTH_RES_FAKE may be used if the server wishes to
    165  1.1       jtc ** indicate that the verification failed, but that the server has
    166  1.1       jtc ** synthesised acceptable values for uid and gid which the client may use
    167  1.1       jtc ** if it wishes.
    168  1.1       jtc */
    169  1.1       jtc 
    170  1.1       jtc enum alrstat {
    171  1.1       jtc         ALERT_RES_OK = 0,
    172  1.1       jtc         ALERT_RES_FAIL = 1
    173  1.1       jtc };
    174  1.1       jtc /*
    175  1.1       jtc ** The type alrstat is returned by PCNFSD_ALERT. A value of ALERT_RES_OK
    176  1.1       jtc ** indicates that the server was able to notify the system operator
    177  1.1       jtc ** successfully. ALERT_RES_FAIL is returned if a failure occurred
    178  1.1       jtc */
    179  1.1       jtc enum pirstat {
    180  1.1       jtc         PI_RES_OK = 0,
    181  1.1       jtc         PI_RES_NO_SUCH_PRINTER = 1,
    182  1.1       jtc         PI_RES_FAIL = 2
    183  1.1       jtc };
    184  1.1       jtc /*
    185  1.1       jtc ** The type pirstat is returned by a number of print operations. PI_RES_OK
    186  1.1       jtc ** indicates that the operation was performed successfully. PI_RES_FAIL
    187  1.1       jtc ** indicates that the printer name was valid, but the operation could
    188  1.1       jtc ** not be performed. PI_RES_NO_SUCH_PRINTER indicates that the printer
    189  1.1       jtc ** name was not recognised.
    190  1.1       jtc */
    191  1.1       jtc 
    192  1.1       jtc enum pcrstat {
    193  1.1       jtc         PC_RES_OK = 0,
    194  1.1       jtc         PC_RES_NO_SUCH_PRINTER = 1,
    195  1.1       jtc         PC_RES_NO_SUCH_JOB = 2,
    196  1.1       jtc         PC_RES_NOT_OWNER = 3,
    197  1.1       jtc         PC_RES_FAIL = 4
    198  1.1       jtc };
    199  1.1       jtc /*
    200  1.1       jtc ** The type pcrstat is returned by a CANCEL, REQUEUE, HOLD, or RELEASE
    201  1.1       jtc ** print operation.
    202  1.1       jtc ** PC_RES_OK indicates that the operation was performed successfully.
    203  1.1       jtc ** PC_RES_NO_SUCH_PRINTER indicates that the printer name was not recognised.
    204  1.1       jtc ** PC_RES_NO_SUCH_JOB means that the job does not exist, or is not
    205  1.1       jtc ** associated with the specified printer.
    206  1.1       jtc ** PC_RES_NOT_OWNER means that the user does not have permission to
    207  1.1       jtc ** manipulate the job.
    208  1.1       jtc ** PC_RES_FAIL means that the job could not be manipulated for an unknown
    209  1.1       jtc ** reason.
    210  1.1       jtc */
    211  1.1       jtc 
    212  1.1       jtc 
    213  1.1       jtc enum psrstat {
    214  1.1       jtc         PS_RES_OK = 0,
    215  1.1       jtc         PS_RES_ALREADY = 1,
    216  1.1       jtc         PS_RES_NULL = 2,
    217  1.1       jtc         PS_RES_NO_FILE = 3,
    218  1.1       jtc         PS_RES_FAIL = 4
    219  1.1       jtc };
    220  1.1       jtc /*
    221  1.1       jtc ** The type psrstat is returned by PCNFSD_PR_START. A value of PS_RES_OK
    222  1.1       jtc ** indicates that the server has started printing the job. It is possible
    223  1.1       jtc ** that the reply from a PCNFSD_PR_START call may be lost, in which case
    224  1.1       jtc ** the client will repeat the call. If the spool file is still in
    225  1.1       jtc ** existence, the server will return PS_RES_ALREADY indicating that it has
    226  1.1       jtc ** already started printing. If the file cannot be found, PS_RES_NO_FILE
    227  1.1       jtc ** is returned.  PS_RES_NULL indicates that the spool file was empty,
    228  1.1       jtc ** while PS_RES_FAIL denotes a general failure.  PI_RES_FAIL is returned
    229  1.1       jtc ** if spool directory could not be created. The value
    230  1.1       jtc ** PI_RES_NO_SUCH_PRINTER indicates that the printer name was not
    231  1.1       jtc ** recognised.
    232  1.1       jtc */
    233  1.1       jtc 
    234  1.1       jtc enum mapreq {
    235  1.1       jtc         MAP_REQ_UID = 0,
    236  1.1       jtc         MAP_REQ_GID = 1,
    237  1.1       jtc         MAP_REQ_UNAME = 2,
    238  1.1       jtc         MAP_REQ_GNAME = 3
    239  1.1       jtc };
    240  1.1       jtc /*
    241  1.1       jtc ** The type mapreq identifies the type of a mapping request.
    242  1.1       jtc ** MAP_REQ_UID requests that the server treat the value in the
    243  1.1       jtc ** id field as a uid and return the corresponding username in name.
    244  1.1       jtc ** MAP_REQ_GID requests that the server treat the value in the
    245  1.1       jtc ** id field as a gid and return the corresponding groupname in name.
    246  1.1       jtc ** MAP_REQ_UNAME requests that the server treat the value in the
    247  1.1       jtc ** name field as a username and return the corresponding uid in id.
    248  1.1       jtc ** MAP_REQ_GNAME requests that the server treat the value in the
    249  1.1       jtc ** name field as a groupname and return the corresponding gid in id.
    250  1.1       jtc */
    251  1.1       jtc 
    252  1.1       jtc enum maprstat {
    253  1.1       jtc         MAP_RES_OK = 0,
    254  1.1       jtc         MAP_RES_UNKNOWN = 1,
    255  1.1       jtc         MAP_RES_DENIED = 2
    256  1.1       jtc };
    257  1.1       jtc /*
    258  1.1       jtc ** The type maprstat indicates the success or failure of
    259  1.1       jtc ** an individual mapping request.
    260  1.1       jtc */
    261  1.1       jtc 
    262  1.1       jtc /*
    263  1.1       jtc **********************************************************
    264  1.1       jtc ** Version 1 of the PCNFSD protocol.
    265  1.1       jtc **********************************************************
    266  1.1       jtc */
    267  1.1       jtc struct auth_args {
    268  1.1       jtc         ident           id;
    269  1.1       jtc         password        pw;
    270  1.1       jtc };
    271  1.1       jtc struct auth_results {
    272  1.1       jtc         arstat          stat;
    273  1.1       jtc         unsigned int    uid;
    274  1.1       jtc         unsigned int    gid;
    275  1.1       jtc };
    276  1.1       jtc 
    277  1.1       jtc struct pr_init_args {
    278  1.1       jtc         client          system;
    279  1.1       jtc         printername     pn;
    280  1.1       jtc };
    281  1.1       jtc struct pr_init_results {
    282  1.1       jtc         pirstat         stat;
    283  1.1       jtc         spoolname       dir;
    284  1.1       jtc };
    285  1.1       jtc 
    286  1.1       jtc struct pr_start_args {
    287  1.1       jtc         client          system;
    288  1.1       jtc         printername     pn;
    289  1.1       jtc         username        user;
    290  1.1       jtc         spoolname       file;
    291  1.1       jtc         options         opts;
    292  1.1       jtc };
    293  1.1       jtc struct pr_start_results {
    294  1.1       jtc         psrstat         stat;
    295  1.1       jtc };
    296  1.1       jtc 
    297  1.1       jtc 
    298  1.1       jtc /*
    299  1.1       jtc **********************************************************
    300  1.1       jtc ** Version 2 of the PCNFSD protocol.
    301  1.1       jtc **********************************************************
    302  1.1       jtc */
    303  1.1       jtc 
    304  1.1       jtc struct v2_info_args {
    305  1.1       jtc         comment         vers;
    306  1.1       jtc         comment         cm;
    307  1.1       jtc };
    308  1.1       jtc 
    309  1.1       jtc struct v2_info_results {
    310  1.1       jtc         comment         vers;
    311  1.1       jtc         comment         cm;
    312  1.1       jtc 	int             facilities<FACILITIESMAX>;
    313  1.1       jtc };
    314  1.1       jtc 
    315  1.1       jtc struct v2_pr_init_args {
    316  1.1       jtc         client          system;
    317  1.1       jtc         printername     pn;
    318  1.1       jtc         comment         cm;
    319  1.1       jtc };
    320  1.1       jtc struct v2_pr_init_results {
    321  1.1       jtc         pirstat         stat;
    322  1.1       jtc         spoolname       dir;
    323  1.1       jtc         comment         cm;
    324  1.1       jtc };
    325  1.1       jtc 
    326  1.1       jtc struct v2_pr_start_args {
    327  1.1       jtc         client          system;
    328  1.1       jtc         printername     pn;
    329  1.1       jtc         username        user;
    330  1.1       jtc         spoolname       file;
    331  1.1       jtc         options         opts;
    332  1.1       jtc 	int             copies;
    333  1.1       jtc         comment         cm;
    334  1.1       jtc };
    335  1.1       jtc struct v2_pr_start_results {
    336  1.1       jtc         psrstat         stat;
    337  1.1       jtc         printjobid      id;
    338  1.1       jtc         comment         cm;
    339  1.1       jtc };
    340  1.1       jtc 
    341  1.1       jtc 
    342  1.1       jtc 
    343  1.1       jtc typedef struct pr_list_item *pr_list;
    344  1.1       jtc 
    345  1.1       jtc struct pr_list_item {
    346  1.1       jtc         printername    pn;
    347  1.1       jtc         printername    device;
    348  1.1       jtc         client         remhost; /* empty if local */
    349  1.1       jtc         comment        cm;
    350  1.1       jtc         pr_list        pr_next;
    351  1.1       jtc };
    352  1.1       jtc 
    353  1.1       jtc struct v2_pr_list_results {
    354  1.1       jtc         comment        cm;
    355  1.1       jtc         pr_list        printers;
    356  1.1       jtc };
    357  1.1       jtc 
    358  1.1       jtc struct v2_pr_queue_args {
    359  1.1       jtc         printername     pn;
    360  1.1       jtc         client          system;
    361  1.1       jtc         username        user;
    362  1.1       jtc         bool            just_mine;
    363  1.1       jtc         comment         cm;
    364  1.1       jtc };
    365  1.1       jtc 
    366  1.1       jtc typedef struct pr_queue_item *pr_queue;
    367  1.1       jtc 
    368  1.1       jtc struct pr_queue_item {
    369  1.1       jtc         int            position;
    370  1.1       jtc         printjobid     id;
    371  1.1       jtc         comment        size;
    372  1.1       jtc         comment        status;
    373  1.1       jtc         client         system;
    374  1.1       jtc         username       user;
    375  1.1       jtc         spoolname      file;
    376  1.1       jtc         comment        cm;
    377  1.1       jtc         pr_queue       pr_next;
    378  1.1       jtc };
    379  1.1       jtc 
    380  1.1       jtc struct v2_pr_queue_results {
    381  1.1       jtc         pirstat        stat;
    382  1.1       jtc         comment        cm;
    383  1.1       jtc         bool           just_yours;
    384  1.1       jtc         int            qlen;
    385  1.1       jtc         int            qshown;
    386  1.1       jtc         pr_queue       jobs;
    387  1.1       jtc };
    388  1.1       jtc 
    389  1.1       jtc 
    390  1.1       jtc struct v2_pr_cancel_args {
    391  1.1       jtc         printername     pn;
    392  1.1       jtc         client          system;
    393  1.1       jtc         username        user;
    394  1.1       jtc         printjobid      id;
    395  1.1       jtc         comment         cm;
    396  1.1       jtc };
    397  1.1       jtc struct v2_pr_cancel_results {
    398  1.1       jtc         pcrstat        stat;
    399  1.1       jtc         comment        cm;
    400  1.1       jtc };
    401  1.1       jtc 
    402  1.1       jtc 
    403  1.1       jtc struct v2_pr_status_args {
    404  1.1       jtc         printername     pn;
    405  1.1       jtc         comment         cm;
    406  1.1       jtc };
    407  1.1       jtc struct v2_pr_status_results {
    408  1.1       jtc         pirstat        stat;
    409  1.1       jtc         bool           avail;
    410  1.1       jtc         bool           printing;
    411  1.1       jtc 	int            qlen;
    412  1.1       jtc         bool           needs_operator;
    413  1.1       jtc 	comment        status;
    414  1.1       jtc         comment        cm;
    415  1.1       jtc };
    416  1.1       jtc 
    417  1.1       jtc struct v2_pr_admin_args {
    418  1.1       jtc         client          system;
    419  1.1       jtc         username        user;
    420  1.1       jtc         printername     pn;
    421  1.1       jtc         comment         cm;
    422  1.1       jtc };
    423  1.1       jtc struct v2_pr_admin_results {
    424  1.1       jtc         pirstat         stat;
    425  1.1       jtc         comment         cm;
    426  1.1       jtc };
    427  1.1       jtc 
    428  1.1       jtc struct v2_pr_requeue_args {
    429  1.1       jtc         printername     pn;
    430  1.1       jtc         client          system;
    431  1.1       jtc         username        user;
    432  1.1       jtc         printjobid      id;
    433  1.1       jtc 	int             qpos;
    434  1.1       jtc         comment         cm;
    435  1.1       jtc };
    436  1.1       jtc 
    437  1.1       jtc struct v2_pr_requeue_results {
    438  1.1       jtc         pcrstat        stat;
    439  1.1       jtc         comment        cm;
    440  1.1       jtc };
    441  1.1       jtc 
    442  1.1       jtc struct v2_pr_hold_args {
    443  1.1       jtc         printername     pn;
    444  1.1       jtc         client          system;
    445  1.1       jtc         username        user;
    446  1.1       jtc         printjobid      id;
    447  1.1       jtc         comment         cm;
    448  1.1       jtc };
    449  1.1       jtc struct v2_pr_hold_results {
    450  1.1       jtc         pcrstat        stat;
    451  1.1       jtc         comment        cm;
    452  1.1       jtc };
    453  1.1       jtc 
    454  1.1       jtc struct v2_pr_release_args {
    455  1.1       jtc         printername     pn;
    456  1.1       jtc         client          system;
    457  1.1       jtc         username        user;
    458  1.1       jtc         printjobid      id;
    459  1.1       jtc         comment         cm;
    460  1.1       jtc };
    461  1.1       jtc struct v2_pr_release_results {
    462  1.1       jtc         pcrstat        stat;
    463  1.1       jtc         comment        cm;
    464  1.1       jtc };
    465  1.1       jtc 
    466  1.1       jtc 
    467  1.1       jtc typedef struct mapreq_arg_item *mapreq_arg;
    468  1.1       jtc 
    469  1.1       jtc struct mapreq_arg_item {
    470  1.1       jtc 	mapreq           req;
    471  1.1       jtc         int              id;
    472  1.1       jtc         username         name;
    473  1.1       jtc         mapreq_arg       mapreq_next;
    474  1.1       jtc };
    475  1.1       jtc 
    476  1.1       jtc typedef struct mapreq_res_item *mapreq_res;
    477  1.1       jtc 
    478  1.1       jtc struct mapreq_res_item {
    479  1.1       jtc 	mapreq           req;
    480  1.1       jtc 	maprstat         stat;
    481  1.1       jtc         int              id;
    482  1.1       jtc         username         name;
    483  1.1       jtc         mapreq_res       mapreq_next;
    484  1.1       jtc };
    485  1.1       jtc 
    486  1.1       jtc struct v2_mapid_args {
    487  1.1       jtc         comment         cm;
    488  1.1       jtc         mapreq_arg      req_list;
    489  1.1       jtc };
    490  1.1       jtc 
    491  1.1       jtc 
    492  1.1       jtc struct v2_mapid_results {
    493  1.1       jtc         comment         cm;
    494  1.1       jtc         mapreq_res      res_list;
    495  1.1       jtc };
    496  1.1       jtc 
    497  1.1       jtc struct v2_auth_args {
    498  1.1       jtc         client          system;
    499  1.1       jtc         ident           id;
    500  1.1       jtc         password        pw;
    501  1.1       jtc         comment         cm;
    502  1.1       jtc };
    503  1.1       jtc struct v2_auth_results {
    504  1.1       jtc         arstat          stat;
    505  1.1       jtc         unsigned int    uid;
    506  1.1       jtc         unsigned int    gid;
    507  1.1       jtc         unsigned int    gids<EXTRAGIDLEN>;
    508  1.1       jtc         homedir         home;
    509  1.1       jtc         int             def_umask;
    510  1.1       jtc         comment         cm;
    511  1.1       jtc };
    512  1.1       jtc 
    513  1.1       jtc struct v2_alert_args {
    514  1.1       jtc         client          system;
    515  1.1       jtc         printername     pn;
    516  1.1       jtc         username        user;
    517  1.1       jtc         message         msg;
    518  1.1       jtc };
    519  1.1       jtc struct v2_alert_results {
    520  1.1       jtc         alrstat          stat;
    521  1.1       jtc         comment         cm;
    522  1.1       jtc };
    523  1.1       jtc 
    524  1.1       jtc 
    525  1.1       jtc /*
    526  1.1       jtc **********************************************************
    527  1.1       jtc ** Protocol description for the PCNFSD program
    528  1.1       jtc **********************************************************
    529  1.1       jtc */
    530  1.1       jtc /*
    531  1.1       jtc ** Version 1 of the PCNFSD protocol.
    532  1.1       jtc **
    533  1.1       jtc ** -- PCNFSD_NULL() = 0
    534  1.1       jtc **	Null procedure - standard for all RPC programs.
    535  1.1       jtc **
    536  1.1       jtc ** -- PCNFSD_AUTH() = 1
    537  1.1       jtc **	Perform user authentication - map username, password into uid, gid.
    538  1.1       jtc **
    539  1.1       jtc ** -- PCNFSD_PR_INIT() = 2
    540  1.1       jtc **	Prepare for remote printing: identify exporting spool directory.
    541  1.1       jtc **
    542  1.1       jtc ** -- PCNFSD_PR_START() = 3
    543  1.1       jtc **	Submit a spooled print job for printing: the print data is
    544  1.1       jtc **	in a file created in the spool directory.
    545  1.1       jtc **
    546  1.1       jtc ** Version 2 of the -- PCNFSD protocol.
    547  1.1       jtc **
    548  1.1       jtc ** -- PCNFSD2_NULL() = 0
    549  1.1       jtc **	Null procedure - standard for all RPC programs.
    550  1.1       jtc **
    551  1.1       jtc ** -- PCNFSD2_INFO() = 1
    552  1.1       jtc **	Determine which services are supported by this implementation
    553  1.1       jtc **	of PCNFSD.
    554  1.1       jtc **
    555  1.1       jtc ** -- PCNFSD2_PR_INIT() = 2
    556  1.1       jtc **	 Prepare for remote printing: identify exporting spool directory.
    557  1.1       jtc **
    558  1.1       jtc ** -- PCNFSD2_PR_START() = 3
    559  1.1       jtc **	Submit a spooled print job for printing: the print data is
    560  1.1       jtc **      in a file created in the spool directory.
    561  1.1       jtc **
    562  1.1       jtc ** -- PCNFSD2_PR_LIST() = 4
    563  1.1       jtc **	List all printers known on the server.
    564  1.1       jtc **
    565  1.1       jtc ** -- PCNFSD2_PR_QUEUE() = 5
    566  1.1       jtc **	List all or part of the queued jobs for a printer.
    567  1.1       jtc **
    568  1.1       jtc ** -- PCNFSD2_PR_STATUS() = 6
    569  1.1       jtc **	Determine the status of a printer.
    570  1.1       jtc **
    571  1.1       jtc ** -- PCNFSD2_PR_CANCEL() = 7
    572  1.1       jtc **	Cancel a print job.
    573  1.1       jtc **
    574  1.1       jtc ** -- PCNFSD2_PR_ADMIN() = 8
    575  1.1       jtc **	Perform an implementation-dependent printer administration
    576  1.1       jtc **	operation.
    577  1.1       jtc **
    578  1.1       jtc ** -- PCNFSD2_PR_REQUEUE() = 9
    579  1.1       jtc **	Change the queue position of a previously-submitted print job.
    580  1.1       jtc **
    581  1.1       jtc ** -- PCNFSD2_PR_HOLD() = 10
    582  1.1       jtc **	Place a "hold" on a previously-submitted print job. The job
    583  1.1       jtc **	will remain in the queue, but will not be printed.
    584  1.1       jtc **
    585  1.1       jtc ** -- PCNFSD2_PR_RELEASE() = 11
    586  1.1       jtc **	Release the "hold" on a previously-held print job.
    587  1.1       jtc **
    588  1.1       jtc ** -- PCNFSD2_MAPID() = 12
    589  1.1       jtc **	Perform one or more translations between user and group
    590  1.1       jtc **	names and IDs.
    591  1.1       jtc **
    592  1.1       jtc ** -- PCNFSD2_AUTH() = 13
    593  1.1       jtc **	Perform user authentication - map username, password into uid, gid;
    594  1.1       jtc **	may also return secondary gids, home directory, umask.
    595  1.1       jtc **
    596  1.1       jtc ** -- PCNFSD2_ALERT() = 14
    597  1.1       jtc **	Send a message to the system operator.
    598  1.1       jtc */
    599  1.1       jtc program PCNFSDPROG {
    600  1.1       jtc         version PCNFSDVERS {
    601  1.1       jtc                 void             PCNFSD_NULL(void) = 0;
    602  1.1       jtc                 auth_results     PCNFSD_AUTH(auth_args) = 1;
    603  1.1       jtc                 pr_init_results  PCNFSD_PR_INIT(pr_init_args) = 2;
    604  1.1       jtc                 pr_start_results PCNFSD_PR_START(pr_start_args) = 3;
    605  1.1       jtc         } = 1;
    606  1.1       jtc /*
    607  1.1       jtc ** Version 2 of the PCNFSD protocol.
    608  1.1       jtc */
    609  1.1       jtc         version PCNFSDV2 {
    610  1.1       jtc                 void                   PCNFSD2_NULL(void) = 0;
    611  1.1       jtc                 v2_info_results        PCNFSD2_INFO(v2_info_args) = 1;
    612  1.1       jtc                 v2_pr_init_results     PCNFSD2_PR_INIT(v2_pr_init_args) = 2;
    613  1.1       jtc                 v2_pr_start_results    PCNFSD2_PR_START(v2_pr_start_args) = 3;
    614  1.1       jtc                 v2_pr_list_results     PCNFSD2_PR_LIST(void) = 4;
    615  1.1       jtc                 v2_pr_queue_results    PCNFSD2_PR_QUEUE(v2_pr_queue_args) = 5;
    616  1.1       jtc                 v2_pr_status_results   PCNFSD2_PR_STATUS(v2_pr_status_args) = 6;
    617  1.1       jtc                 v2_pr_cancel_results   PCNFSD2_PR_CANCEL(v2_pr_cancel_args) = 7;
    618  1.1       jtc                 v2_pr_admin_results    PCNFSD2_PR_ADMIN(v2_pr_admin_args) = 8;
    619  1.1       jtc                 v2_pr_requeue_results  PCNFSD2_PR_REQUEUE(v2_pr_requeue_args) = 9;
    620  1.1       jtc                 v2_pr_hold_results     PCNFSD2_PR_HOLD(v2_pr_hold_args) = 10;
    621  1.1       jtc                 v2_pr_release_results  PCNFSD2_PR_RELEASE(v2_pr_release_args) = 11;
    622  1.1       jtc                 v2_mapid_results       PCNFSD2_MAPID(v2_mapid_args) = 12;
    623  1.1       jtc                 v2_auth_results        PCNFSD2_AUTH(v2_auth_args) = 13;
    624  1.1       jtc                 v2_alert_results       PCNFSD2_ALERT(v2_alert_args) = 14;
    625  1.1       jtc         } = 2;
    626  1.1       jtc 
    627  1.1       jtc } = 150001;
    628  1.1       jtc 
    629  1.1       jtc /*
    630  1.1       jtc ** The following forces a publically-visible msg_out()
    631  1.1       jtc */
    632  1.1       jtc %#if RPC_SVC
    633  1.7     sevan % static void _msgout(const char *);
    634  1.6     lukem % void msg_out(msg) const char *msg; {_msgout(msg);}
    635  1.1       jtc %#endif
    636  1.1       jtc %#if RPC_HDR
    637  1.7     sevan % extern void msg_out(const char *);
    638  1.1       jtc %#endif
    639  1.5  dholland 
    640  1.5  dholland /*
    641  1.5  dholland ** This allows initialization prior to running the service. (see PR 12758)
    642  1.5  dholland */
    643  1.5  dholland %#if RPC_SVC
    644  1.5  dholland %#define main mymain
    645  1.5  dholland %#endif
    646