Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!tut.cis.ohio-state.edu!dsac.dla.mil!dsacg3.dsac.dla.mil!dsacg4.dsac.dla.mil!nol2321 From: nol2321@dsacg4.dsac.dla.mil (Jim Dunn) Newsgroups: comp.protocols.nfs Subject: Re: PC-NFS Wish List (Re: Enduring PC-NFS Annoyances) Message-ID: <2683@dsacg4.dsac.dla.mil> Date: 2 Nov 90 19:51:30 GMT References: <1990Oct31.102026.20561@cs.eur.nl> <90305.173430TOMIII@MTUS5.BITNET> Distribution: usa Organization: Defense Logistics Agency Systems Automation Center, Columbus Lines: 202 Well, as far as your wish list goes, I second the motion... But you'll find that if you wait for Sun to do them... well, nevermind... However, I've found an EXCELLENT alternative to PC-NFS' telnet.exe and a tn3270.exe program... Try using the clarkson drivers. This means that instead of having all the PC-NFS drivers in your config.sys, you'll have a few less, substitute a couple of the clarkson's and WALAH! You can still have PC-NFS compatibility as well as ALSO having the Clarkson NCSA TELNET, CUTCP TELNET AND TN3270!!! My config.sys before clarkson: device=pcnfs.sys device=sockdrv.sys device=vecie6.sys device=?????.sys After clarkson: device=pcnfs.sys device=sockdrv.sys device=pktd.sys And my autoexec.bat has to also have this with clarkson's drivers: 3c503.com 0x7e 5 0x300 (for my 3com board) or wd8003e.com 0x7e 5 0x300 (for a western digital board) And there you have it... the clarkson equivelant (sp) for the sun hardware drivers... (you can find all these drivers on the clarkson "sun" and "omnigate" ftp file servers... 128.153.12.3, 128.153.4.2, 125.153.4.10, I think...) Also, here's a little PC source, for compiling with the Microsoft C PC-NFS toolkit, to give you an "rdate.exe" function on your PC: ---Cut Here--- /* * rdate - get date from remote machine * * Copyright (c) 1988 by Sun Microsystems Inc. * * "rdate" sets the date and time, obtaining a timestamp froma * network host via the tcp/time socket. Since this returns * a value in seconds since Jan 1, 1900, we must * subtract 86400(365*70 + 17) to convert this to the time * since Jan 1, 1970. (Note that to avoid Microsoft C 4.0 * compiler glitches we must compute this at run time.) * * This program is supplied as an example of how to use the PC-NFS * Programmer's Toolkit to port typical socket-based network applications * from Unix systems to PCs running PC-NFS and DOS. It is supplied * "as is" with no warranty or support. * * The binary (rdate.exe) was built using Microsoft C 5.10 and the * "small model" Toolkit libraries using the following batch file: * * cl /AS /Ox /Ze rdate.c ; * echo rdate + > lf * echo ..\toolkit\tcpypobj\syp_rtns.obj ..\toolkit\tcpypobj\sprotrtn.obj >> lf * echo rdate.exe >> lf * echo rdate /m >> lf * echo ..\toolkit\slibtk.lib >> lf * link /ST:16384 @lf * */ #include #include #include #include #include #define _SIZE_T_DEFINED #include extern int errno; main(argc, argv) int argc; char **argv; { struct sockaddr_in server; struct sockaddr from; int s, i, p, q; u_long t; u_long toff; struct servent *sp; struct protoent *pp; struct hostent *hp; struct timeval timestruct; if (argc != 2) { fprintf(stderr, "usage: rdate host\n"); exit(1); } if ((hp = gethostbyname(argv[1])) == NULL) { fprintf(stderr, "rdate: unknown host %s\n", argv[1]); exit(1); } if ((sp = getservbyname("time", "tcp")) != NULL) p = sp->s_port; else p = 37; /* default from Assigned Numbers RFC */ if ((pp = getprotobyname("tcp")) != NULL) q = pp->p_proto; else q = 6; /* default from Assigned Numbers */ if ((s = socket(AF_INET, SOCK_STREAM, q)) == 0) { perror("rdate: socket"); exit(1); } bzero((char *)&server, sizeof (server)); bcopy(hp->h_addr, (char *)&server.sin_addr, hp->h_length); server.sin_family = hp->h_addrtype; server.sin_port = p; if (connect(s, &server, sizeof (server)) < 0) { perror("rdate: connect"); exit(1); } if (read(s, (char *)&t, sizeof (long)) != sizeof (long)) { perror("rdate: read"); exit(1); } t = (u_long)ntohl(t); /* begin hack to avoid MSC problem */ toff = 86400L; toff = toff * 25567L; /* end hack */ if (t < toff) { fprintf(stderr, "rdate: %s returned an unreasonable time\n", argv[1]); exit(1); } t -= toff; i = setdostime(t); if (i == -1) perror("rdate: unable to set time of day"); else printf("%s", ctime(&t)); exit(0); } #include /* * setdostime (t) sets the PC DOS date and time values according to * the timestamp in t. We first call "localtime" to obtain the * individual year, month, day, hour, minute and second values and * then use the DOS "set time" and "set date" functions. Note that * for "localtime" to operate properly, the "TZ" environment variable * must be correct. */ setdostime(t) u_long t; { struct tm *tp; union REGS inregs; union REGS outregs; tp = localtime(&t); inregs.h.ah = 0x2d; /* set time */ inregs.h.ch = tp->tm_hour; inregs.h.dh = tp->tm_sec; inregs.h.cl = tp->tm_min; inregs.h.dl = 0; intdos(&inregs, &outregs); if (outregs.h.al) return(-1); inregs.h.ah = 0x2b; /*set date */ inregs.x.cx = tp->tm_year + 1900; inregs.h.dh = tp->tm_mon + 1; inregs.h.dl = tp->tm_mday; intdos(&inregs, &outregs); if (outregs.h.al) return(-1); return(0); } ---Cut Here--- Enjoy, and please, no support... :) Jim, jdunn@dsac.dla.mil