From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10d4db,e5b3b6994991ce9e X-Google-Attributes: gid10d4db,public From: terryt@ren.pc.athabascau.ca (Terry Tanski) Subject: Re: Full featured Win95 dialup to Linux Date: 1996/01/09 Message-ID: X-Deja-AN: 134912901 references: followup-to: comp.os.linux.networking content-type: text/plain; charset=ISO-8859-1 organization: Athabasca University mime-version: 1.0 reply-to: terryt@cs.athabascau.ca newsgroups: comp.os.linux.announce -----BEGIN PGP SIGNED MESSAGE----- Christoph Lameter (clameter@fuller.edu) wrote: > Short Guide on How to run a Win95 Connection with PPPD > - ------------------------------------------------------ [stuff deleted] Hi, For additional functionality, apply the following patch to pppd-2.2.0d which will add the ability to autoconfigure WINS server addresses. Christoph's 3A instruction should then include: Add a line wins-addr x.x.x.x to your /etc/ppp/options file. Be sure to replace x.x.x.x with a valid WINS server address. P.S. The wins patch was posted to comp.protocols.smb by John Paul Morrison, jmorriso@ConcordPacific.com - ---Cut here--- diff -ur ppp-2.2.0d.old/pppd/Makefile.linux ppp-2.2.0d/pppd/Makefile.linux - --- ppp-2.2.0d.old/pppd/Makefile.linux Wed Dec 13 20:18:18 1995 +++ ppp-2.2.0d/pppd/Makefile.linux Sun Dec 24 16:53:23 1995 @@ -23,9 +23,10 @@ # CC = gcc # DEBUG_FLAGS = -DDEBUGALL COMPILE_FLAGS = -D_linux_=1 -DHAVE_PATHS_H - -COPTS = -g # -O2 +COPTS = -O2 VER = 0.2.8 LIBS = -lbsd +USE_MS_DNS = 1 CFLAGS= $(COPTS) $(DEBUG_FLAGS) $(COMPILE_FLAGS) SOURCE= RELNOTES Makefile.linux $(PPPDSRCS) $(HEADERS) $(MANPAGES) diff -ur ppp-2.2.0d.old/pppd/ipcp.c ppp-2.2.0d/pppd/ipcp.c - --- ppp-2.2.0d.old/pppd/ipcp.c Thu Nov 23 16:00:37 1995 +++ ppp-2.2.0d/pppd/ipcp.c Tue Dec 26 02:50:32 1995 @@ -137,6 +137,8 @@ #ifdef USE_MS_DNS wo->dnsaddr[0] = wo->dnsaddr[1] = 0; + wo->winsaddr[0] = + wo->winsaddr[1] = 0; #endif wo->neg_vj = 1; @@ -888,6 +890,24 @@ } break; + case CI_MS_WINS1: + IPCPDEBUG((LOG_INFO, "ipcp: received WINS Request ")); + + /* If we do not have a WINS address then we cannot send it */ + if (wo->winsaddr[0] == 0 || + cilen != CILEN_ADDR) { /* Check CI length */ + orc = CONFREJ; /* Reject CI */ + break; + } + GETLONG(tl,p); + if (htonl(tl) != wo->winsaddr[0]) { + DECPTR(sizeof (long),p); + tl = ntohl(wo->winsaddr[0]); + PUTLONG(tl, p); + orc = CONFNAK; + } + break; + case CI_MS_DNS2: IPCPDEBUG((LOG_INFO, "ipcp: received DNS Request ")); @@ -901,6 +921,24 @@ if (htonl(tl) != wo->dnsaddr[1]) { /* and this is the 2nd one */ DECPTR(sizeof (long),p); tl = ntohl(wo->dnsaddr[1]); + PUTLONG(tl, p); + orc = CONFNAK; + } + break; + + case CI_MS_WINS2: + IPCPDEBUG((LOG_INFO, "ipcp: received WINS Request ")); + + /* If we do not have a WINS address then we cannot send it */ + if (wo->winsaddr[0] == 0 || /* Yes, this is the first one! */ + cilen != CILEN_ADDR) { /* Check CI length */ + orc = CONFREJ; /* Reject CI */ + break; + } + GETLONG(tl,p); + if (htonl(tl) != wo->winsaddr[1]) { /* and this is the 2nd one */ + DECPTR(sizeof (long),p); + tl = ntohl(wo->winsaddr[1]); PUTLONG(tl, p); orc = CONFNAK; } diff -ur ppp-2.2.0d.old/pppd/ipcp.h ppp-2.2.0d/pppd/ipcp.h - --- ppp-2.2.0d.old/pppd/ipcp.h Thu Nov 23 16:01:55 1995 +++ ppp-2.2.0d/pppd/ipcp.h Tue Dec 26 02:35:44 1995 @@ -27,7 +27,9 @@ #define CI_ADDR 3 #define CI_MS_DNS1 129 /* Primary DNS value */ +#define CI_MS_WINS1 130 /* Primary WINS value */ #define CI_MS_DNS2 131 /* Secondary DNS value */ +#define CI_MS_WINS2 132 /* Secondary WINS value */ #define MAX_STATES 16 /* from slcompress.h */ @@ -55,6 +57,7 @@ u_int32_t ouraddr, hisaddr; /* Addresses in NETWORK BYTE ORDER */ #ifdef USE_MS_DNS u_int32_t dnsaddr[2]; /* Primary and secondary DNS entries */ + u_int32_t winsaddr[2]; /* Primary and secondary WINS entries */ #endif } ipcp_options; diff -ur ppp-2.2.0d.old/pppd/options.c ppp-2.2.0d/pppd/options.c - --- ppp-2.2.0d.old/pppd/options.c Thu Nov 23 16:00:35 1995 +++ ppp-2.2.0d/pppd/options.c Tue Dec 26 02:52:48 1995 @@ -201,6 +201,7 @@ #ifdef USE_MS_DNS static int setdnsaddr __P((char **)); +static int setwinsaddr __P((char **)); #endif static int number_option __P((char *, u_int32_t *, int)); @@ -318,6 +319,7 @@ #ifdef USE_MS_DNS {"dns-addr", 1, setdnsaddr}, /* DNS address(es) for the peer's use */ + {"wins-addr", 1, setwinsaddr}, /* WINS address(es) for the peer's use */ #endif {NULL, 0, NULL} @@ -2036,4 +2038,32 @@ return (1); } + +/* + * setwinsaddr - set the wins address(es) + */ + +static int +setwinsaddr(argv) + char **argv; +{ + u_long wins; + + wins = inet_addr(*argv); + if (wins == -1) { + fprintf(stderr, "Invalid WINS Address %s\n", *argv); + return 0; + } + + if (ipcp_wantoptions[0].winsaddr[0] == 0) { + ipcp_wantoptions[0].winsaddr[0] = wins; + ipcp_allowoptions[0].winsaddr[0] = wins; + } else { + ipcp_wantoptions[0].winsaddr[1] = wins; + ipcp_allowoptions[0].winsaddr[1] = wins; + } + + return (1); + } + #endif /* USE_MS_DNS */ diff -ur ppp-2.2.0d.old/pppd/sys-linux.c ppp-2.2.0d/pppd/sys-linux.c - --- ppp-2.2.0d.old/pppd/sys-linux.c Wed Nov 22 05:51:41 1995 +++ ppp-2.2.0d/pppd/sys-linux.c Tue Dec 26 13:38:13 1995 @@ -1661,7 +1661,7 @@ * This code is derived from chat.c. */ - -#define LOCK_PREFIX "/var/lock/LCK.." +#define LOCK_PREFIX "/var/spool/uucp/LCK.." /* * lock - create a lock file for the named device @@ -1695,8 +1695,13 @@ fd = open(lock_file, O_EXCL | O_CREAT | O_RDWR, 0644); if (fd >= 0) { +#ifdef PIDSTRING sprintf(hdb_lock_buffer, "%010d\n", getpid()); write(fd, hdb_lock_buffer, 11); +#else + pid = getpid(); + write(fd, &pid, sizeof(pid)); +#endif close(fd); return 0; } @@ -1716,7 +1721,11 @@ } /* Read the lock file to find out who has the device locked */ +#ifdef PIDSTRING n = read (fd, hdb_lock_buffer, 11); +#else + n = read (fd, &pid, sizeof(pid)); +#endif close (fd); if (n < 0) { @@ -1727,8 +1736,10 @@ /* See the process still exists. */ if (n > 0) { +#ifdef PIDSTRING hdb_lock_buffer[n] = '\0'; sscanf (hdb_lock_buffer, " %d", &pid); +#endif if (kill(pid, 0) == -1 && errno == ESRCH) { n = 0; Terry - -- ********* Terry Tanski, B.Sc. ********** . **** Computing Services Phone: (403) 675-6339 .. **** Athabasca University FAX: (403) 675-6333 .... **** Box 10,000 Email: terryt@cs.athabascau.ca ..........**** Athabasca, AB CANADA Web: http://www.athabascau.ca -----BEGIN PGP SIGNATURE----- Version: 2.6.2i iQCVAwUBMPLFYoQRll5MupLRAQHSnQP6Ayd1YLR/ieKoVU2FeOVFZ/MvaPdXRThL fqvD+W/mzV2AGUvaqBNy76R3EeccoseRp7c6E2aWaJlVBQv4pjDfj9KV4H0An8GZ zdcnMZSkkxWMzoIx1gb1M2K7l2fFq8FSD1qaSK25XCb8raTzrVTbsKqCQ6Z3OsIl ZWb39+5pXkA= =wFch -----END PGP SIGNATURE----- -- This article has been digitally signed by the moderator, using PGP. Finger wirzeniu@kruuna.helsinki.fi for PGP key needed for validating signature. Send submissions for comp.os.linux.announce to: linux-announce@news.ornl.gov PLEASE remember a short description of the software and the LOCATION.