pcnfs patches for scotty-2.0.2

Doug Hughes (Doug.Hughes@Eng.Auburn.EDU)
Tue, 14 Nov 1995 18:44:54 -0600

This is a multimedia message in MIME format. If you are reading this
prefix, your mail reader does not understand MIME or is not currently
configured to parse MIME messages. You may wish to look into
upgrading to a mail reader that does.

--jfbabfaaeccg-netman.eng.auburn.edu-10760-0
Content-Type: text/plain; charset=us-ascii

Well, I finally got around to getting the 2.0.2 patches installed and
making my list of patches so that you can do pcnfs with scotty. I've
added a subset of PCNFS functionality. But it should be easily modifiable
to add more functionality following the examples given in sunrpcextra.c.

All source files are included below as MIME attachments:

Contents:
diffs to sunrpc.c
source for sunrpcextra.c
pcnfsd.x
tcpip/Makefile.in diffs

you'll need to add this source to the tcpip directory (This
is the guts of the PCNFS stuff - included as MIME attachments).

pcnfsd.x:
run 'rpcgen' on it to generate a client stub, a header file, and a server
stub. You can delete the server stub (pcnfsd_srvr.c)
(ignore the path discrepancies in the below attachments, they really
are scotty-2.0.2 compatible)

Now, with all these pieces (attached below) you'll most likely need
to do a reconfigure in the top level to generate the Makefile from
the Makefile.in (or copy over the few relative changes to your existing
makefile)

Then run make.
Now you can do commands like this:

scotty>sunrpc pcnfs help
bad option "help": should be info, status, auth, queue, or printers
scotty>sunrpc pcnfs info solar
{@(#)pcnfsd_v2.c 1.6 - rpc.pcnfsd V2.0 (c) 1991 Sun Technology Enterprises, Inc.} {No comment} {{NULL Proc} Fast } {Info Fast } {{PR Init} Fast } {{PR Start} Slow } {{PR List} Fast } {{PR Queue} Slow } {{PR Status} Slow } {{PR Cancel} Slow } {{PR Admin} Unsupported } {{PR Requeue} Unsupported } {{PR Hold} Unsupported } {{PR Release} Unsupported } {{Map ID} Fast } {Auth Fast } {Alert Fast }
scotty>sunrpc pcnfs status solar pebble
Available Printing {} {}
scotty>sunrpc pcnfs queue solar pebble
{No comment 0 jobs queued
}
scotty>sunrpc pcnfs auth solar doug fakepass pc10
failure
scotty>sunrpc pcnfs printers solar
{pebble {-}} {rainbow rainbow.lps {on rainbow.lps as rainbow}} {duc_plotter duc_plotter.lps {on duc_plotter.lps as duc_plotter}}
scotty>sunrpc nfsnull solar
scotty>sunrpc nfsnull lab21
Program not registered
scotty>

(nfsnull proc is just a simplification of what is already available via
scotty and returns 0 on success but 1 on failure if the server supports
NFS and it is running - particularly useful in a catch expression)

--
____________________________________________________________________________
Doug Hughes					Engineering Network Services
System/Net Admin  				Auburn University
			doug@eng.auburn.edu
	Apple T-shirt on Win95 - "Been there, done that"

--jfbabfaaeccg-netman.eng.auburn.edu-10760-0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Content-Description: Diffs for sunrpc.c

*** sunrpc.c.sav Tue Nov 14 18:15:07 1995 --- sunrpc.c Tue Nov 14 18:11:48 1995 *************** *** 715,720 **** --- 715,728 ---- return SunrpcExports (interp, argv[2]); + } else if ((argc == 3) && (strcmp (argv[1], "nfsnull") == 0)) { + + return SunrpcNFSNULL (interp, argv[2]); + + } else if (strcmp (argv[1], "pcnfs") == 0) { + + return SunrpcPcnfs (interp, argc, argv); + } else if (strcmp (argv[1], "probe") == 0) { int program, version; *************** *** 771,777 **** } else { Tcl_AppendResult (interp, "bad option \"", argv[1], "\": should be info, probe, ", ! "mount, exports, stat, or ether", (char *) NULL); } --- 779,785 ---- } else { Tcl_AppendResult (interp, "bad option \"", argv[1], "\": should be info, probe, ", ! "pcnfs, mount, exports, stat, or ether", (char *) NULL); }

--jfbabfaaeccg-netman.eng.auburn.edu-10760-0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Content-Description: Extra rpc source for pcnfs calls

#include "scotty.h"

#include <rpc/rpc.h> #include <rpc/pmap_prot.h> #include <rpc/pmap_clnt.h>

#include "nfs_prot.h"

/* PCNFS includes */ #include "pcnfsd.h"

/* PCNFS defines */ #define zchar 0x5b #define QUICK 100 #define SLOW 2000 #define UNSUPPORTED -1

static char str[1024];

/* * SunrpcNFSNULL() sends and receives and NFS null procedure * to the remote host */ int SunrpcNFSNULL (interp, host) Tcl_Interp *interp; char *host; { struct timeval timeout; enum clnt_stat res; CLIENT *clnt;

if ((host = SunrpcGetHostname (interp, host)) == (char *) NULL) { return TCL_ERROR; }

clnt = clnt_create(host, NFS_PROGRAM, NFS_VERSION, "udp"); if (! clnt) { SunrpcCreateError(interp); return TCL_ERROR; } timeout.tv_sec = 5; timeout.tv_usec = 0; res = clnt_call(clnt, NFSPROC_NULL, xdr_void, (char*) 0, xdr_void, (char *) 0, timeout); clnt_destroy(clnt); if (res != RPC_SUCCESS) { SunrpcError (interp, res); return TCL_ERROR; }

return TCL_OK; }

/* * This routine is for scrambling PCNFS auth info before * being passed over a network. Trivial isn't it? */

void scramble(s1, s2, n) char *s1; char *s2; { register int i=0;

while (*s1 && i < n) { *s2++ = (*s1 ^ zchar) & 0x7f; s1++; i++; } *s2 = 0; }

/* * Get SUNRPC info about all available PCNFS services on server */

static int PcnfsInfo (interp, host) Tcl_Interp *interp; char *host; { struct timeval timeout; CLIENT *clnt; v2_info_args a; v2_info_results *res; int i; int *fp; char *fac_names[15] = { "{NULL Proc}", "Info", "{PR Init}", "{PR Start}", "{PR List}", "{PR Queue}", "{PR Status}", "{PR Cancel}", "{PR Admin}", "{PR Requeue}", "{PR Hold}", "{PR Release}", "{Map ID}", "Auth", "Alert"};

a.vers = "Sun Microsystems PCNFSD test subsystem V1"; a.cm = "-";

if ((host = SunrpcGetHostname (interp, host)) == (char *) NULL) { return TCL_ERROR; }

clnt = clnt_create(host, PCNFSDPROG, PCNFSDV2, "udp"); if (! clnt) { SunrpcCreateError(interp); return TCL_ERROR; } timeout.tv_sec = 5; timeout.tv_usec = 0; res = pcnfsd2_info_2(&a, clnt); clnt_destroy(clnt); if (res == NULL) { SunrpcError (interp, res); return TCL_ERROR; } Tcl_AppendElement (interp, res->vers); Tcl_AppendElement (interp, res->cm);

fp = res->facilities.facilities_val; for (i = 0; i < res->facilities.facilities_len; i++) { switch(*fp) { case QUICK: sprintf(str, "%s Fast ", fac_names[i]); break; case SLOW: sprintf(str, "%s Slow ", fac_names[i]); break; case UNSUPPORTED: sprintf(str, "%s Unsupported ", fac_names[i]); break; } Tcl_AppendElement (interp, str); fp++; }

return TCL_OK; }

/* * Get printer queue via PCNFSD */ static int PcnfsQueue(interp, host, pname) Tcl_Interp *interp; char *host; char *pname; { CLIENT *clnt; v2_pr_queue_results *pr_qr; v2_pr_queue_args pr_args; pr_queue_item *pr_qi;

pr_args.pn = pname; pr_args.system = host; pr_args.user = "doug"; pr_args.just_mine = FALSE; pr_args.cm = (char *) NULL;

if ((host = SunrpcGetHostname (interp, host)) == (char *) NULL) { return TCL_ERROR; }

clnt = clnt_create(host, PCNFSDPROG, PCNFSDV2, "udp"); if (! clnt) { SunrpcCreateError(interp); return TCL_ERROR; } pr_qr = pcnfsd2_pr_queue_2(&pr_args, clnt); clnt_destroy(clnt); if (pr_qr == NULL) { SunrpcError (interp, pr_qr); return TCL_ERROR; }

switch(pr_qr->stat) { case PI_RES_NO_SUCH_PRINTER: Tcl_AppendElement(interp, "No such printer"); break; case PI_RES_FAIL: Tcl_AppendElement(interp, "failure contacting pcnfsd"); break; case PI_RES_OK: sprintf(str, "%s %d jobs queued\n", pr_qr->cm, pr_qr->qlen); Tcl_AppendElement(interp, str); pr_qi = pr_qr->jobs; while (pr_qi != NULL) { sprintf(str, "%d %s %s %s %s %s %s {%s}\n", pr_qi->position, pr_qi->id, pr_qi->size, pr_qi->status, pr_qi->system, pr_qi->user, pr_qi->file, pr_qi->cm); Tcl_AppendElement(interp, str); pr_qi = pr_qi->pr_next; } }

return TCL_OK; }

/* * Get list of printers supported via PCNFS */

static int PcnfsList(interp, host) Tcl_Interp *interp; char *host; { CLIENT *clnt; v2_pr_list_results *pr_ls; pr_list_item *pr_item;

if ((host = SunrpcGetHostname (interp, host)) == (char *) NULL) { return TCL_ERROR; } clnt = clnt_create(host, PCNFSDPROG, PCNFSDV2, "udp"); if (! clnt) { SunrpcCreateError(interp); return TCL_ERROR; }

pr_ls = pcnfsd2_pr_list_2(NULL, clnt); clnt_destroy(clnt); if (pr_ls == NULL) { SunrpcError (interp, pr_ls); return TCL_ERROR; }

pr_item = pr_ls->printers; while (pr_item != NULL) { sprintf(str, "%s %s {%s}", pr_item->pn, pr_item->remhost, pr_item->cm); Tcl_AppendElement(interp, str); pr_item = pr_item->pr_next; }

return TCL_OK; } /* * Do Pcnfs Authorization check */ static int PcnfsAuth(interp, host, uname, pw, pcname) Tcl_Interp *interp; char *host; char *uname; char *pw; char *pcname; { CLIENT *clnt; char uname_new[32]; char pw_new[64]; v2_auth_results *res; v2_auth_args a;

if ((host = SunrpcGetHostname (interp, host)) == (char *) NULL) { return TCL_ERROR; } clnt = clnt_create(host, PCNFSDPROG, PCNFSDV2, "udp"); if (! clnt) { SunrpcCreateError(interp); return TCL_ERROR; } scramble(uname, uname_new, 31); scramble(pw, pw_new, 63);

a.system = pcname; a.id = uname_new; a.pw = pw_new; a.cm = "-";

res = pcnfsd2_auth_2(&a, clnt); clnt_destroy(clnt); if (res == NULL) { SunrpcError (interp, res); return TCL_ERROR; }

switch(res->stat) { case AUTH_RES_OK: Tcl_AppendElement(interp, "success"); break; case AUTH_RES_FAKE: Tcl_AppendElement(interp, "fake"); break; case AUTH_RES_FAIL: Tcl_AppendElement(interp, "failure"); break; }

return TCL_OK; }

/* * Get printer status via PCNFSD */

static int PcnfsStatus(interp, host, pname) Tcl_Interp *interp; char *host; char *pname; { CLIENT *clnt; v2_pr_status_args pr_stat; v2_pr_status_results *pr_sr; pr_stat.pn = pname; pr_stat.cm = "Just a comment"; if ((host = SunrpcGetHostname (interp, host)) == (char *) NULL) { return TCL_ERROR; }

clnt = clnt_create(host, PCNFSDPROG, PCNFSDV2, "udp"); if (! clnt) { SunrpcCreateError(interp); return TCL_ERROR; } pr_sr = pcnfsd2_pr_status_2(&pr_stat, clnt); clnt_destroy(clnt); if (pr_sr == NULL) { SunrpcError (interp, pr_sr); return TCL_ERROR; } switch(pr_sr->stat) { case PI_RES_NO_SUCH_PRINTER: Tcl_AppendElement(interp, "No such printer"); break; case PI_RES_FAIL: Tcl_AppendElement(interp, "failure contacting pcnfsd"); break; case PI_RES_OK: if (pr_sr->avail) Tcl_AppendElement(interp, "Available"); else Tcl_AppendElement(interp, "Not Available"); if (pr_sr->printing) Tcl_AppendElement(interp, "Printing"); else Tcl_AppendElement(interp, "Not Printing"); if (pr_sr->needs_operator) Tcl_AppendElement(interp, "Needs Operator"); else Tcl_AppendElement(interp, ""); Tcl_AppendElement(interp, pr_sr->status); break; }

return TCL_OK; }

/* * send off to other procs */

SunrpcPcnfs(interp, argc, argv) Tcl_Interp *interp; int argc; char **argv; { if (strcmp (argv[2], "info") == 0) { if (argc != 4) { Tcl_AppendResult (interp, "wrong # args: should be \"", argv[0], " pcnfs info host\"", (char *) NULL); return TCL_ERROR; }

return PcnfsInfo (interp, argv[3]);

} else if (strcmp (argv[2], "printers") == 0) { if (argc != 4) { Tcl_AppendResult (interp, "wrong # args: should be \"", argv[0], " pcnfs printers host\"", (char *) NULL); return TCL_ERROR; } return PcnfsList (interp, argv[3]);

} else if (strcmp (argv[2], "auth") == 0) { if (argc != 7) { Tcl_AppendResult (interp, "wrong # args: should be \"", argv[0], " pcnfs auth host username passwd pcname\"", (char *) NULL); return TCL_ERROR; }

return PcnfsAuth (interp, argv[3], argv[4], argv[5], argv[6]);

} else if (strcmp (argv[2], "status") == 0) { if (argc != 5) { Tcl_AppendResult (interp, "wrong # args: should be \"", argv[0], " pcnfs status host printer\"", (char *) NULL); return TCL_ERROR; }

return PcnfsStatus (interp, argv[3], argv[4]);

} else if (strcmp (argv[2], "queue") == 0) { if (argc != 5) { Tcl_AppendResult (interp, "wrong # args: should be \"", argv[0], " pcnfs queue host printer\"", (char *) NULL); return TCL_ERROR; }

return PcnfsQueue (interp, argv[3], argv[4]);

} else { Tcl_AppendResult (interp, "bad option \"", argv[2], "\": should be info, status, ", "auth, queue, or printers", (char *) NULL); return TCL_ERROR; } }

--jfbabfaaeccg-netman.eng.auburn.edu-10760-0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Content-Description: pcnfsd.x - run rpcgen on it

/* The maximum number of bytes in a user name argument */ const IDENTLEN = 32; /* The maximum number of bytes in a password argument */ const PASSWORDLEN = 64; /* The maximum number of bytes in a print client name argument */ const CLIENTLEN = 64; /* The maximum number of bytes in a printer name argument */ const PRINTERNAMELEN = 64; /* The maximum number of bytes in a print user name argument */ const USERNAMELEN = 64; /* The maximum number of bytes in a print spool file name argument */ const SPOOLNAMELEN = 64; /* The maximum number of bytes in a print options argument */ const OPTIONSLEN = 64; /* The maximum number of bytes in a print spool directory path */ const SPOOLDIRLEN = 255; /* The maximum number of secondary GIDs returned by a V2 AUTH */ const EXTRAGIDLEN = 16; /* The maximum number of bytes in a home directory spec */ const HOMEDIRLEN = 255; /* The maximum number of bytes in a misc. comments string */ const COMMENTLEN = 255; /* The maximum number of bytes in a print job id */ const PRINTJOBIDLEN = 255; /* The maximum number of printers returned by a LIST operation */ const PRLISTMAX = 32; /* The maximum number of print jobs returned by a QUEUE operation */ const PRQUEUEMAX = 128; /* The maximum number of entries in the facilities list */ const FACILITIESMAX = 32; /* The maximum length of an operator message */ const MESSAGELEN = 512;

typedef string ident<IDENTLEN>; /* ** The type ident is used for passing an encoded user name for ** authentication. The server should decode the string by replacing each ** octet with the value formed by performing an exclusive-or of the octet ** value with the value 0x5b and and'ing the result with 0x7f. */

typedef string message<MESSAGELEN>; /* ** The type message is used for passing an alert message to the ** system operator on the server. The text may include newlines. */

typedef string password<PASSWORDLEN>; /* ** The type password is used for passing an encode password for ** authentication. The server should decode the password as described ** above. */

typedef string client<CLIENTLEN>; /* ** The type client is used for passing the hostname of a client for ** printing. The server may use this name in constructing the spool ** directory name. */

typedef string printername<PRINTERNAMELEN>; /* ** The type printername is used for passing the name of a printer on which ** the client wishes to print. */

typedef string username<USERNAMELEN>; /* ** The type username is used for passing the user name for a print job. ** The server may use this in any way it chooses: it may attempt to change ** the effective identity with which it is running to username or may ** simply arrange for the text to be printed on the banner page. */

typedef string comment<COMMENTLEN>; /* ** The type comment is used to pass an uninterpreted text string which ** may be used by displayed to a human user or used for custom ** extensions to the PCNFSD service. If you elect to extend PCNFSD ** service in this way, please do so in a way which will avoid ** problems if your client attempts to interoperate with a server ** which does not support your extension. One way to do this is to ** use the */

typedef string spoolname<SPOOLNAMELEN>; /* ** The type spoolname is used for passing the name of a print spool file ** (a simple filename not a pathname) within the spool directory. */

typedef string printjobid<PRINTJOBIDLEN>; /* ** The type printjobid is used for passing the id of a print job. */

typedef string homedir<OPTIONSLEN>; /* ** The type homedir is used to return the home directory for the user. ** If present, it should be in the form "hostname:path", where hostname ** and path are in a suitable form for communicating with the mount server. */

typedef string options<OPTIONSLEN>; /* ** The type options is used for passing implementation-specific print ** control information. The option string is a set of printable ASCII ** characters. The first character should be ignored by the server; it is ** reserved for client use. The second character specifies the type of ** data in the print file. The following types are defined (an ** implementation may define additional values): ** ** p - PostScript data. The client will ensure that a valid ** PostScript header is included. ** d - Diablo 630 data. ** x - Generic printable ASCII text. The client will have filtered ** out all non-printable characters other than CR, LF, TAB, ** BS and VT. ** r - Raw print data. The client performs no filtering. ** u - User-defined. Reserved for custom extensions. A vanilla ** pcnfsd server will treat this as equivalent to "r" ** ** If diablo data (type 'd') is specified, a formatting specification ** string will be appended. This has the form: ** ppnnnbbb ** pp ** Pitch - 10, 12 or 15. ** nnn ** The ``normal'' font to be used - encoded as follows: ** Courier crn ** Courier-Bold crb ** Courier-Oblique con ** Courier-BoldObliqu cob ** Helvetica hrn ** Helvetica-Bold hrb ** Helvetica-Oblique hon ** Helvetica-BoldOblique hob ** Times-Roman trn ** Times-Bold trb ** Times-Italic ton ** Times-BoldItalic tob ** bbb ** The ``bold'' font to be used - encoded in the same way. For example, ** the string ``nd10hrbcob'' specifies that the print data is in Diablo ** 630 format, it should be printed at 10 pitch, ``normal'' text should be ** printed in Helvetica-Bold, and ``bold'' text should be printed in ** Courier-BoldOblique. */

enum arstat { AUTH_RES_OK = 0, AUTH_RES_FAKE = 1, AUTH_RES_FAIL = 2 }; /* ** The type arstat is returned by PCNFSD_AUTH. A value of AUTH_RES_OK ** indicates that the server was able to verify the ident and password ** successfully.AUTH_RES_FAIL is returned if a verification failure ** occurred. The value AUTH_RES_FAKE may be used if the server wishes to ** indicate that the verification failed, but that the server has ** synthesised acceptable values for uid and gid which the client may use ** if it wishes. */

enum alrstat { ALERT_RES_OK = 0, ALERT_RES_FAIL = 1 }; /* ** The type alrstat is returned by PCNFSD_ALERT. A value of ALERT_RES_OK ** indicates that the server was able to notify the system operator ** successfully. ALERT_RES_FAIL is returned if a failure occurred */ enum pirstat { PI_RES_OK = 0, PI_RES_NO_SUCH_PRINTER = 1, PI_RES_FAIL = 2 }; /* ** The type pirstat is returned by a number of print operations. PI_RES_OK ** indicates that the operation was performed successfully. PI_RES_FAIL ** indicates that the printer name was valid, but the operation could ** not be performed. PI_RES_NO_SUCH_PRINTER indicates that the printer ** name was not recognised. */

enum pcrstat { PC_RES_OK = 0, PC_RES_NO_SUCH_PRINTER = 1, PC_RES_NO_SUCH_JOB = 2, PC_RES_NOT_OWNER = 3, PC_RES_FAIL = 4 }; /* ** The type pcrstat is returned by a CANCEL, REQUEUE, HOLD, or RELEASE ** print operation. ** PC_RES_OK indicates that the operation was performed successfully. ** PC_RES_NO_SUCH_PRINTER indicates that the printer name was not recognised. ** PC_RES_NO_SUCH_JOB means that the job does not exist, or is not ** associated with the specified printer. ** PC_RES_NOT_OWNER means that the user does not have permission to ** manipulate the job. ** PC_RES_FAIL means that the job could not be manipulated for an unknown ** reason. */

enum psrstat { PS_RES_OK = 0, PS_RES_ALREADY = 1, PS_RES_NULL = 2, PS_RES_NO_FILE = 3, PS_RES_FAIL = 4 }; /* ** The type psrstat is returned by PCNFSD_PR_START. A value of PS_RES_OK ** indicates that the server has started printing the job. It is possible ** that the reply from a PCNFSD_PR_START call may be lost, in which case ** the client will repeat the call. If the spool file is still in ** existence, the server will return PS_RES_ALREADY indicating that it has ** already started printing. If the file cannot be found, PS_RES_NO_FILE ** is returned. PS_RES_NULL indicates that the spool file was empty, ** while PS_RES_FAIL denotes a general failure. PI_RES_FAIL is returned ** if spool directory could not be created. The value ** PI_RES_NO_SUCH_PRINTER indicates that the printer name was not ** recognised. */

enum mapreq { MAP_REQ_UID = 0, MAP_REQ_GID = 1, MAP_REQ_UNAME = 2, MAP_REQ_GNAME = 3 }; /* ** The type mapreq identifies the type of a mapping request. ** MAP_REQ_UID requests that the server treat the value in the ** id field as a uid and return the corresponding username in name. ** MAP_REQ_GID requests that the server treat the value in the ** id field as a gid and return the corresponding groupname in name. ** MAP_REQ_UNAME requests that the server treat the value in the ** name field as a username and return the corresponding uid in id. ** MAP_REQ_GNAME requests that the server treat the value in the ** name field as a groupname and return the corresponding gid in id. */

enum maprstat { MAP_RES_OK = 0, MAP_RES_UNKNOWN = 1, MAP_RES_DENIED = 2 }; /* ** The type maprstat indicates the success or failure of ** an individual mapping request. */

/* ********************************************************** ** Version 1 of the PCNFSD protocol. ********************************************************** */ struct auth_args { ident id; password pw; }; struct auth_results { arstat stat; unsigned int uid; unsigned int gid; };

struct pr_init_args { client system; printername pn; }; struct pr_init_results { pirstat stat; spoolname dir; };

struct pr_start_args { client system; printername pn; username user; spoolname file; options opts; }; struct pr_start_results { psrstat stat; };

/* ********************************************************** ** Version 2 of the PCNFSD protocol. ********************************************************** */

struct v2_info_args { comment vers; comment cm; };

struct v2_info_results { comment vers; comment cm; int facilities<FACILITIESMAX>; };

struct v2_pr_init_args { client system; printername pn; comment cm; }; struct v2_pr_init_results { pirstat stat; spoolname dir; comment cm; }; struct v2_pr_start_args { client system; printername pn; username user; spoolname file; options opts; int copies; comment cm; }; struct v2_pr_start_results { psrstat stat; printjobid id; comment cm; };

typedef struct pr_list_item *pr_list;

struct pr_list_item { printername pn; printername device; client remhost; /* empty if local */ comment cm; pr_list pr_next; };

struct v2_pr_list_results { comment cm; pr_list printers; }; struct v2_pr_queue_args { printername pn; client system; username user; bool just_mine; comment cm; };

typedef struct pr_queue_item *pr_queue;

struct pr_queue_item { int position; printjobid id; comment size; comment status; client system; username user; spoolname file; comment cm; pr_queue pr_next; }; struct v2_pr_queue_results { pirstat stat; comment cm; bool just_yours; int qlen; int qshown; pr_queue jobs; };

struct v2_pr_cancel_args { printername pn; client system; username user; printjobid id; comment cm; }; struct v2_pr_cancel_results { pcrstat stat; comment cm; };

struct v2_pr_status_args { printername pn; comment cm; }; struct v2_pr_status_results { pirstat stat; bool avail; bool printing; int qlen; bool needs_operator; comment status; comment cm; }; struct v2_pr_admin_args { client system; username user; printername pn; comment cm; }; struct v2_pr_admin_results { pirstat stat; comment cm; };

struct v2_pr_requeue_args { printername pn; client system; username user; printjobid id; int qpos; comment cm; };

struct v2_pr_requeue_results { pcrstat stat; comment cm; };

struct v2_pr_hold_args { printername pn; client system; username user; printjobid id; comment cm; }; struct v2_pr_hold_results { pcrstat stat; comment cm; }; struct v2_pr_release_args { printername pn; client system; username user; printjobid id; comment cm; }; struct v2_pr_release_results { pcrstat stat; comment cm; };

typedef struct mapreq_arg_item *mapreq_arg;

struct mapreq_arg_item { mapreq req; int id; username name; mapreq_arg mapreq_next; };

typedef struct mapreq_res_item *mapreq_res;

struct mapreq_res_item { mapreq req; maprstat stat; int id; username name; mapreq_res mapreq_next; };

struct v2_mapid_args { comment cm; mapreq_arg req_list; };

struct v2_mapid_results { comment cm; mapreq_res res_list; }; struct v2_auth_args { client system; ident id; password pw; comment cm; }; struct v2_auth_results { arstat stat; unsigned int uid; unsigned int gid; unsigned int gids<EXTRAGIDLEN>; homedir home; int def_umask; comment cm; };

struct v2_alert_args { client system; printername pn; username user; message msg; }; struct v2_alert_results { alrstat stat; comment cm; };

/* ********************************************************** ** Protocol description for the PCNFSD program ********************************************************** */ /* ** Version 1 of the PCNFSD protocol. ** ** -- PCNFSD_NULL() = 0 ** Null procedure - standard for all RPC programs. ** ** -- PCNFSD_AUTH() = 1 ** Perform user authentication - map username, password into uid, gid. ** ** -- PCNFSD_PR_INIT() = 2 ** Prepare for remote printing: identify exporting spool directory. ** ** -- PCNFSD_PR_START() = 3 ** Submit a spooled print job for printing: the print data is ** in a file created in the spool directory. ** ** Version 2 of the -- PCNFSD protocol. ** ** -- PCNFSD2_NULL() = 0 ** Null procedure - standard for all RPC programs. ** ** -- PCNFSD2_INFO() = 1 ** Determine which services are supported by this implementation ** of PCNFSD. ** ** -- PCNFSD2_PR_INIT() = 2 ** Prepare for remote printing: identify exporting spool directory. ** ** -- PCNFSD2_PR_START() = 3 ** Submit a spooled print job for printing: the print data is ** in a file created in the spool directory. ** ** -- PCNFSD2_PR_LIST() = 4 ** List all printers known on the server. ** ** -- PCNFSD2_PR_QUEUE() = 5 ** List all or part of the queued jobs for a printer. ** ** -- PCNFSD2_PR_STATUS() = 6 ** Determine the status of a printer. ** ** -- PCNFSD2_PR_CANCEL() = 7 ** Cancel a print job. ** ** -- PCNFSD2_PR_ADMIN() = 8 ** Perform an implementation-dependent printer administration ** operation. ** ** -- PCNFSD2_PR_REQUEUE() = 9 ** Change the queue position of a previously-submitted print job. ** ** -- PCNFSD2_PR_HOLD() = 10 ** Place a "hold" on a previously-submitted print job. The job ** will remain in the queue, but will not be printed. ** ** -- PCNFSD2_PR_RELEASE() = 11 ** Release the "hold" on a previously-held print job. ** ** -- PCNFSD2_MAPID() = 12 ** Perform one or more translations between user and group ** names and IDs. ** ** -- PCNFSD2_AUTH() = 13 ** Perform user authentication - map username, password into uid, gid; ** may also return secondary gids, home directory, umask. ** ** -- PCNFSD2_ALERT() = 14 ** Send a message to the system operator. */ program PCNFSDPROG { version PCNFSDVERS { void PCNFSD_NULL(void) = 0; auth_results PCNFSD_AUTH(auth_args) = 1; pr_init_results PCNFSD_PR_INIT(pr_init_args) = 2; pr_start_results PCNFSD_PR_START(pr_start_args) = 3; } = 1; /* ** Version 2 of the PCNFSD protocol. */ version PCNFSDV2 { void PCNFSD2_NULL(void) = 0; v2_info_results PCNFSD2_INFO(v2_info_args) = 1; v2_pr_init_results PCNFSD2_PR_INIT(v2_pr_init_args) = 2; v2_pr_start_results PCNFSD2_PR_START(v2_pr_start_args) = 3; v2_pr_list_results PCNFSD2_PR_LIST(void) = 4; v2_pr_queue_results PCNFSD2_PR_QUEUE(v2_pr_queue_args) = 5; v2_pr_status_results PCNFSD2_PR_STATUS(v2_pr_status_args) = 6; v2_pr_cancel_results PCNFSD2_PR_CANCEL(v2_pr_cancel_args) = 7; v2_pr_admin_results PCNFSD2_PR_ADMIN(v2_pr_admin_args) = 8; v2_pr_requeue_results PCNFSD2_PR_REQUEUE(v2_pr_requeue_args) = 9; v2_pr_hold_results PCNFSD2_PR_HOLD(v2_pr_hold_args) = 10; v2_pr_release_results PCNFSD2_PR_RELEASE(v2_pr_release_args) = 11; v2_mapid_results PCNFSD2_MAPID(v2_mapid_args) = 12; v2_auth_results PCNFSD2_AUTH(v2_auth_args) = 13; v2_alert_results PCNFSD2_ALERT(v2_alert_args) = 14; } = 2;

} = 150001;

/* ** The following forces a publically-visible msg_out() */ %#if RPC_SVC % void msg_out(msg) char *msg; {_msgout(msg);} %#endif %#if RPC_HDR % extern void msg_out(); %#endif

--jfbabfaaeccg-netman.eng.auburn.edu-10760-0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Content-Description: diffs for Makefile.in

*** Makefile.in.sav Tue Nov 14 18:02:17 1995 --- Makefile.in Tue Nov 14 18:03:12 1995 *************** *** 129,141 **** SRCS = clock.c uevent.c job.c ined.c syslog.c icmp.c dns.c \ tcp.c udp.c sunrpc.c ntp.c rpc.c http.c netdb.c \ ! init.c OBJS = clock.o uevent.o job.o ined.o syslog.o icmp.o dns.o \ tcp.o udp.o sunrpc.o ntp.o rpc.o http.o netdb.o \ mount_clnt.o mount_xdr.o ether_clnt.o ether_xdr.o \ ! rstat_clnt.o rstat_xdr.o \ ! init.o SOBJS = clock.so uevent.so job.so ined.so syslog.so icmp.so dns.so \ tcp.so udp.so sunrpc.so ntp.so rpc.so http.so netdb.so \ --- 129,141 ---- SRCS = clock.c uevent.c job.c ined.c syslog.c icmp.c dns.c \ tcp.c udp.c sunrpc.c ntp.c rpc.c http.c netdb.c \ ! init.c sunexptrarpc.c OBJS = clock.o uevent.o job.o ined.o syslog.o icmp.o dns.o \ tcp.o udp.o sunrpc.o ntp.o rpc.o http.o netdb.o \ mount_clnt.o mount_xdr.o ether_clnt.o ether_xdr.o \ ! rstat_clnt.o rstat_xdr.o nfs_prot_clnt.o nfs_prot_xdr.o \ ! init.o sunextrarpc.o pcnfsd_clnt.o pcnfsd_xdr.o SOBJS = clock.so uevent.so job.so ined.so syslog.so icmp.so dns.so \ tcp.so udp.so sunrpc.so ntp.so rpc.so http.so netdb.so \

--jfbabfaaeccg-netman.eng.auburn.edu-10760-0--

DO NOT DELETE the above boundary line. Anything placed after this line will be ignored by MIME readers.