fix svn patch breakage in glib
[openwrt/svn-archive/archive.git] / obsolete-buildroot / sources / openwrt / patches / ppp / 000_ppp-2.4.2-cvs-20040427.patch
1 diff -ruN ppp-2.4.2/TODO ppp-cvs-20040427/TODO
2 --- ppp-2.4.2/TODO 1970-01-01 01:00:00.000000000 +0100
3 +++ ppp-cvs-20040427/TODO 1999-03-22 07:38:09.000000000 +0100
4 @@ -0,0 +1,16 @@
5 +* Things to do *
6 +
7 +- How should we handle the case where MTU > MRU?
8 + Should we reduce the IP MTU to the link MRU (so TCP MSS is correct)?
9 +
10 +- Provide ways to:
11 + + set the IP address, possibly based on the peer's identity
12 + + have external checking of PAP user/password, CHAP response
13 + + supply the PAP user/password, CHAP secret
14 + + decide which tty to use (locking, DTR issues)
15 +
16 +- Integrate callback stuff?
17 +
18 +- Implement link quality monitoring
19 +
20 +- Implement other network control protocols
21 diff -ruN ppp-2.4.2/chat/chat.c ppp-cvs-20040427/chat/chat.c
22 --- ppp-2.4.2/chat/chat.c 2003-03-30 10:23:48.000000000 +0200
23 +++ ppp-cvs-20040427/chat/chat.c 2004-01-17 06:50:11.000000000 +0100
24 @@ -87,7 +87,7 @@
25 #endif
26
27 #ifndef lint
28 -static const char rcsid[] = "$Id: chat.c,v 1.29 2003/03/04 06:17:21 fcusack Exp $";
29 +static const char rcsid[] = "$Id: chat.c,v 1.30 2004/01/17 05:47:55 carlsonj Exp $";
30 #endif
31
32 #include <stdio.h>
33 @@ -213,7 +213,7 @@
34 void *copy_of __P((char *s));
35 char *grow __P((char *s, char **p, size_t len));
36 void usage __P((void));
37 -void logf __P((const char *fmt, ...));
38 +void msgf __P((const char *fmt, ...));
39 void fatal __P((int code, const char *fmt, ...));
40 SIGTYPE sigalrm __P((int signo));
41 SIGTYPE sigint __P((int signo));
42 @@ -495,7 +495,7 @@
43 /*
44 * Send a message to syslog and/or stderr.
45 */
46 -void logf __V((const char *fmt, ...))
47 +void msgf __V((const char *fmt, ...))
48 {
49 va_list args;
50
51 @@ -558,7 +558,7 @@
52 fatal(2, "Can't set file mode flags on stdin: %m");
53
54 if (verbose)
55 - logf("alarm");
56 + msgf("alarm");
57 }
58
59 void unalarm()
60 @@ -1001,9 +1001,9 @@
61 * The expectation did not occur. This is terminal.
62 */
63 if (fail_reason)
64 - logf("Failed (%s)", fail_reason);
65 + msgf("Failed (%s)", fail_reason);
66 else
67 - logf("Failed");
68 + msgf("Failed");
69 terminate(exit_code);
70 }
71
72 @@ -1079,7 +1079,7 @@
73 abort_string[n_aborts++] = s1;
74
75 if (verbose)
76 - logf("abort on (%v)", s);
77 + msgf("abort on (%v)", s);
78 return;
79 }
80
81 @@ -1105,7 +1105,7 @@
82 pack++;
83 n_aborts--;
84 if (verbose)
85 - logf("clear abort on (%v)", s);
86 + msgf("clear abort on (%v)", s);
87 }
88 }
89 free(s1);
90 @@ -1129,7 +1129,7 @@
91 report_string[n_reports++] = s1;
92
93 if (verbose)
94 - logf("report (%v)", s);
95 + msgf("report (%v)", s);
96 return;
97 }
98
99 @@ -1155,7 +1155,7 @@
100 pack++;
101 n_reports--;
102 if (verbose)
103 - logf("clear report (%v)", s);
104 + msgf("clear report (%v)", s);
105 }
106 }
107 free(s1);
108 @@ -1173,7 +1173,7 @@
109 timeout = DEFAULT_CHAT_TIMEOUT;
110
111 if (verbose)
112 - logf("timeout set to %d seconds", timeout);
113 + msgf("timeout set to %d seconds", timeout);
114
115 return;
116 }
117 @@ -1236,7 +1236,7 @@
118 return ((int)c & 0x7F);
119
120 default:
121 - logf("warning: read() on stdin returned %d", status);
122 + msgf("warning: read() on stdin returned %d", status);
123
124 case -1:
125 if ((status = fcntl(0, F_GETFL, 0)) == -1)
126 @@ -1264,7 +1264,7 @@
127 return (0);
128
129 default:
130 - logf("warning: write() on stdout returned %d", status);
131 + msgf("warning: write() on stdout returned %d", status);
132
133 case -1:
134 if ((status = fcntl(0, F_GETFL, 0)) == -1)
135 @@ -1286,9 +1286,9 @@
136
137 if (verbose) {
138 if (errno == EINTR || errno == EWOULDBLOCK)
139 - logf(" -- write timed out");
140 + msgf(" -- write timed out");
141 else
142 - logf(" -- write failed: %m");
143 + msgf(" -- write failed: %m");
144 }
145 return (0);
146 }
147 @@ -1303,9 +1303,9 @@
148
149 if (verbose) {
150 if (quiet)
151 - logf("send (??????)");
152 + msgf("send (??????)");
153 else
154 - logf("send (%v)", s);
155 + msgf("send (%v)", s);
156 }
157
158 alarm(timeout); alarmed = 0;
159 @@ -1392,17 +1392,17 @@
160 minlen = (len > sizeof(fail_buffer)? len: sizeof(fail_buffer)) - 1;
161
162 if (verbose)
163 - logf("expect (%v)", string);
164 + msgf("expect (%v)", string);
165
166 if (len > STR_LEN) {
167 - logf("expect string is too long");
168 + msgf("expect string is too long");
169 exit_code = 1;
170 return 0;
171 }
172
173 if (len == 0) {
174 if (verbose)
175 - logf("got it");
176 + msgf("got it");
177 return (1);
178 }
179
180 @@ -1416,16 +1416,16 @@
181 echo_stderr(c);
182 if (verbose && c == '\n') {
183 if (s == logged)
184 - logf(""); /* blank line */
185 + msgf(""); /* blank line */
186 else
187 - logf("%0.*v", s - logged, logged);
188 + msgf("%0.*v", s - logged, logged);
189 logged = s + 1;
190 }
191
192 *s++ = c;
193
194 if (verbose && s >= logged + 80) {
195 - logf("%0.*v", s - logged, logged);
196 + msgf("%0.*v", s - logged, logged);
197 logged = s;
198 }
199
200 @@ -1470,8 +1470,8 @@
201 strncmp(s - len, string, len) == 0) {
202 if (verbose) {
203 if (s > logged)
204 - logf("%0.*v", s - logged, logged);
205 - logf(" -- got it\n");
206 + msgf("%0.*v", s - logged, logged);
207 + msgf(" -- got it\n");
208 }
209
210 alarm(0);
211 @@ -1484,8 +1484,8 @@
212 strncmp(s - abort_len, abort_string[n], abort_len) == 0) {
213 if (verbose) {
214 if (s > logged)
215 - logf("%0.*v", s - logged, logged);
216 - logf(" -- failed");
217 + msgf("%0.*v", s - logged, logged);
218 + msgf(" -- failed");
219 }
220
221 alarm(0);
222 @@ -1499,7 +1499,7 @@
223 if (s >= end) {
224 if (logged < s - minlen) {
225 if (verbose)
226 - logf("%0.*v", s - logged, logged);
227 + msgf("%0.*v", s - logged, logged);
228 logged = s;
229 }
230 s -= minlen;
231 @@ -1509,16 +1509,16 @@
232 }
233
234 if (alarmed && verbose)
235 - logf("warning: alarm synchronization problem");
236 + msgf("warning: alarm synchronization problem");
237 }
238
239 alarm(0);
240
241 if (verbose && printed) {
242 if (alarmed)
243 - logf(" -- read timed out");
244 + msgf(" -- read timed out");
245 else
246 - logf(" -- read failed: %m");
247 + msgf(" -- read failed: %m");
248 }
249
250 exit_code = 3;
251 diff -ruN ppp-2.4.2/configure ppp-cvs-20040427/configure
252 --- ppp-2.4.2/configure 2002-11-09 12:24:41.000000000 +0100
253 +++ ppp-cvs-20040427/configure 2004-01-17 06:50:11.000000000 +0100
254 @@ -1,5 +1,5 @@
255 #!/bin/sh
256 -# $Id: configure,v 1.30 2002/11/02 19:48:12 carlsonj Exp $
257 +# $Id: configure,v 1.31 2004/01/17 05:47:55 carlsonj Exp $
258
259 # if [ -d /NextApps ]; then
260 # system="NeXTStep"
261 @@ -27,7 +27,7 @@
262 esac;;
263 5.[1-6]*) state="known"; ksrc="solaris"; makext="sol2";;
264 esac
265 - if [ -x /opt/SUNWspro/bin/cc ] &&
266 + if [ -x /opt/SUNWspro/bin/cc -a "$1" != "gcc" ] &&
267 /opt/SUNWspro/bin/cc -flags >/dev/null 2>&1; then
268 : # use Sun WorkShop compiler
269 elif gcc --version >/dev/null 2>&1; then
270 diff -ruN ppp-2.4.2/contrib/pppgetpass/Makefile.linux ppp-cvs-20040427/contrib/pppgetpass/Makefile.linux
271 --- ppp-2.4.2/contrib/pppgetpass/Makefile.linux 1999-11-15 05:08:24.000000000 +0100
272 +++ ppp-cvs-20040427/contrib/pppgetpass/Makefile.linux 1970-01-01 01:00:00.000000000 +0100
273 @@ -1,16 +0,0 @@
274 -all: pppgetpass.vt pppgetpass.gtk
275 -
276 -pppgetpass.vt: pppgetpass.vt.o
277 -
278 -pppgetpass.gtk: pppgetpass.gtk.o
279 - $(CC) $(LDFLAGS) pppgetpass.gtk.o `gtk-config --libs` -o pppgetpass.gtk
280 -pppgetpass.gtk.o: pppgetpass.gtk.c
281 - $(CC) $(CFLAGS) -c pppgetpass.gtk.c `gtk-config --cflags`
282 -
283 -install: all
284 - install -m 755 pppgetpass.sh /usr/bin/pppgetpass
285 - install -m 4755 -o root -g root pppgetpass.vt /usr/bin/
286 - install -m 755 -o root -g root pppgetpass.gtk /usr/X11/bin/
287 -
288 -clean:
289 - rm -f *.o pppgetpass.gtk pppgetpass.vt core
290 diff -ruN ppp-2.4.2/contrib/pppgetpass/pppgetpass.8 ppp-cvs-20040427/contrib/pppgetpass/pppgetpass.8
291 --- ppp-2.4.2/contrib/pppgetpass/pppgetpass.8 1999-11-15 05:08:24.000000000 +0100
292 +++ ppp-cvs-20040427/contrib/pppgetpass/pppgetpass.8 1970-01-01 01:00:00.000000000 +0100
293 @@ -1,18 +0,0 @@
294 -.TH PPPGETPASS 8 "26 Sep 1999"
295 -.SH NAME
296 -pppgetpass \- prompt for PAP password
297 -.SH SYNOPSIS
298 -.B pppgetpass
299 -.I client server fd
300 -.SH DESCRIPTION
301 -.B pppgetpass
302 -the outer half of a plugin for PAP password prompting in pppd.
303 -If the peer requires PAP, and the
304 -.B passprompt.so
305 -plugin is loaded into pppd, it will run
306 -.B /usr/sbin/pppgetpass
307 -(or another program specified by the
308 -.B promptprog
309 -option) to prompt the user for the password.
310 -.SH SEE ALSO
311 -pppd(8)
312 diff -ruN ppp-2.4.2/contrib/pppgetpass/pppgetpass.gtk.c ppp-cvs-20040427/contrib/pppgetpass/pppgetpass.gtk.c
313 --- ppp-2.4.2/contrib/pppgetpass/pppgetpass.gtk.c 1999-11-15 05:08:24.000000000 +0100
314 +++ ppp-cvs-20040427/contrib/pppgetpass/pppgetpass.gtk.c 1970-01-01 01:00:00.000000000 +0100
315 @@ -1,92 +0,0 @@
316 -#include <glib.h>
317 -#include <gdk/gdk.h>
318 -#include <gtk/gtkwindow.h>
319 -#include <gtk/gtkmain.h>
320 -#include <gtk/gtkbutton.h>
321 -#include <gtk/gtkvbox.h>
322 -#include <gtk/gtklabel.h>
323 -#include <gtk/gtkentry.h>
324 -#include <gtk/gtksignal.h>
325 -
326 -#include <stdio.h>
327 -#include <string.h>
328 -#include <stdlib.h>
329 -#include <unistd.h>
330 -#include <syslog.h>
331 -
332 -int outfd;
333 -int err;
334 -
335 -static void okpressed(void *widget, void *clientdata)
336 -{
337 - GtkWidget *answer=clientdata;
338 - gchar *pass;
339 - int passlen;
340 - ssize_t wrote;
341 - (void)widget;
342 -
343 - pass=gtk_entry_get_text(GTK_ENTRY(answer));
344 -
345 - passlen=strlen(pass);
346 - if(!passlen)
347 - return;
348 -
349 - if((wrote=write(outfd, pass, passlen))!=passlen) {
350 - if(wrote<0)
351 - syslog(LOG_ERR, "write error on outpipe: %m");
352 - else
353 - syslog(LOG_ERR, "short write on outpipe");
354 - err=1;
355 - }
356 - gtk_main_quit();
357 -}
358 -
359 -int main(int argc, char **argv)
360 -{
361 - GtkWidget *mainwindow, *vbox, *question, *answer, *ok;
362 - char buf[1024];
363 - gtk_init(&argc, &argv);
364 -
365 - openlog(argv[0], LOG_PID, LOG_DAEMON);
366 - if(argc!=4) {
367 - syslog(LOG_WARNING, "Usage error");
368 - return 1;
369 - }
370 - outfd=atoi(argv[3]);
371 - mainwindow=gtk_window_new(GTK_WINDOW_TOPLEVEL);
372 - gtk_window_set_title(GTK_WINDOW(mainwindow), "pppgetpass");
373 - gtk_signal_connect(GTK_OBJECT(mainwindow), "destroy",
374 - GTK_SIGNAL_FUNC(gtk_main_quit), 0);
375 -
376 - vbox=gtk_vbox_new(FALSE, 5);
377 - gtk_container_add(GTK_CONTAINER(mainwindow), vbox);
378 - gtk_widget_show(vbox);
379 -
380 - if(argv[1][0] && argv[2][0])
381 - snprintf(buf, sizeof buf, "Password for PPP client %s on server %s: ", argv[1], argv[2]);
382 - else if(argv[1][0] && !argv[2][0])
383 - snprintf(buf, sizeof buf, "Password for PPP client %s: ", argv[1]);
384 - else if(!argv[1][0] && argv[2][0])
385 - snprintf(buf, sizeof buf, "Password for PPP on server %s: ", argv[2]);
386 - else
387 - snprintf(buf, sizeof buf, "Enter PPP password: ");
388 - question=gtk_label_new(buf);
389 - gtk_box_pack_start(GTK_BOX(vbox), question, FALSE, TRUE, 0);
390 - gtk_widget_show(question);
391 -
392 - answer=gtk_entry_new();
393 - gtk_entry_set_visibility(GTK_ENTRY(answer), 0);
394 - gtk_box_pack_start(GTK_BOX(vbox), answer, FALSE, TRUE, 0);
395 - gtk_widget_show(answer);
396 -
397 - ok=gtk_button_new_with_label("OK");
398 - gtk_box_pack_start(GTK_BOX(vbox), ok, FALSE, TRUE, 0);
399 - gtk_signal_connect(GTK_OBJECT(ok), "clicked",
400 - GTK_SIGNAL_FUNC(okpressed), answer);
401 - gtk_widget_show(ok);
402 -
403 - gtk_widget_show(mainwindow);
404 - gtk_main();
405 -
406 - return err;
407 -}
408 diff -ruN ppp-2.4.2/contrib/pppgetpass/pppgetpass.sh ppp-cvs-20040427/contrib/pppgetpass/pppgetpass.sh
409 --- ppp-2.4.2/contrib/pppgetpass/pppgetpass.sh 1999-11-15 05:08:24.000000000 +0100
410 +++ ppp-cvs-20040427/contrib/pppgetpass/pppgetpass.sh 1970-01-01 01:00:00.000000000 +0100
411 @@ -1,7 +0,0 @@
412 -#!/bin/sh
413 -
414 -if [ -z "$DISPLAY" ]; then
415 - exec pppgetpass.vt "$@"
416 -else
417 - exec pppgetpass.gtk "$@"
418 -fi
419 diff -ruN ppp-2.4.2/contrib/pppgetpass/pppgetpass.vt.c ppp-cvs-20040427/contrib/pppgetpass/pppgetpass.vt.c
420 --- ppp-2.4.2/contrib/pppgetpass/pppgetpass.vt.c 1999-11-15 05:08:24.000000000 +0100
421 +++ ppp-cvs-20040427/contrib/pppgetpass/pppgetpass.vt.c 1970-01-01 01:00:00.000000000 +0100
422 @@ -1,218 +0,0 @@
423 -#include <stdio.h>
424 -#include <string.h>
425 -#include <stdlib.h>
426 -#include <errno.h>
427 -#include <unistd.h>
428 -#include <fcntl.h>
429 -#include <sys/stat.h>
430 -#include <sys/ioctl.h>
431 -#include <syslog.h>
432 -#include <termios.h>
433 -#include <sys/vt.h>
434 -
435 -static int console_owner(uid_t, int);
436 -
437 -int main(int argc, char **argv)
438 -{
439 - int console;
440 - uid_t uid;
441 - struct vt_stat origstate;
442 - int openvtnum;
443 - char openvtname[256];
444 - int openvt;
445 - gid_t gid;
446 - int chowned;
447 - FILE *fp;
448 - struct termios t;
449 - char pass[256], *nl;
450 - int outfd, passlen;
451 - ssize_t wrote;
452 - console=open("/dev/console", O_RDWR);
453 -
454 - uid=getuid();
455 - gid=getgid();
456 - seteuid(uid);
457 -
458 - openlog(argv[0], LOG_PID, LOG_DAEMON);
459 -
460 - if(argc!=4) {
461 - syslog(LOG_WARNING, "Usage error");
462 - return 1;
463 - }
464 -
465 - if(console<0) {
466 - syslog(LOG_ERR, "open(/dev/console): %m");
467 - return 1;
468 - }
469 -
470 - if(ioctl(console, VT_GETSTATE, &origstate)<0) {
471 - syslog(LOG_ERR, "VT_GETSTATE: %m");
472 - return 1;
473 - }
474 -
475 - if(uid) {
476 - if(!console_owner(uid, origstate.v_active)) {
477 - int i;
478 - for(i=0;i<64;++i) {
479 - if(i!=origstate.v_active && console_owner(uid, i))
480 - break;
481 - }
482 - if(i==64) {
483 - syslog(LOG_WARNING, "run by uid %lu not at console", (unsigned long)uid);
484 - return 1;
485 - }
486 - }
487 - }
488 -
489 - if(ioctl(console, VT_OPENQRY, &openvtnum)<0) {
490 - syslog(LOG_ERR, "VT_OPENQRY: %m");
491 - return 1;
492 - }
493 - if(openvtnum==-1) {
494 - syslog(LOG_ERR, "No free VTs");
495 - return 1;
496 - }
497 -
498 - snprintf(openvtname, sizeof openvtname, "/dev/tty%d", openvtnum);
499 - seteuid(0);
500 - openvt=open(openvtname, O_RDWR);
501 - if(openvt<0) {
502 - seteuid(uid);
503 - syslog(LOG_ERR, "open(%s): %m", openvtname);
504 - return 1;
505 - }
506 -
507 - chowned=fchown(openvt, uid, gid);
508 - if(chowned<0) {
509 - seteuid(uid);
510 - syslog(LOG_ERR, "fchown(%s): %m", openvtname);
511 - return 1;
512 - }
513 -
514 - close(console);
515 -
516 - if(ioctl(openvt, VT_ACTIVATE, openvtnum)<0) {
517 - seteuid(uid);
518 - syslog(LOG_ERR, "VT_ACTIVATE(%d): %m", openvtnum);
519 - return 1;
520 - }
521 -
522 - while(ioctl(openvt, VT_WAITACTIVE, openvtnum)<0) {
523 - if(errno!=EINTR) {
524 - ioctl(openvt, VT_ACTIVATE, origstate.v_active);
525 - seteuid(uid);
526 - syslog(LOG_ERR, "VT_WAITACTIVE(%d): %m", openvtnum);
527 - return 1;
528 - }
529 - }
530 -
531 - seteuid(uid);
532 - fp=fdopen(openvt, "r+");
533 - if(!fp) {
534 - seteuid(0);
535 - ioctl(openvt, VT_ACTIVATE, origstate.v_active);
536 - seteuid(uid);
537 - syslog(LOG_ERR, "fdopen(%s): %m", openvtname);
538 - return 1;
539 - }
540 -
541 - if(tcgetattr(openvt, &t)<0) {
542 - seteuid(0);
543 - ioctl(openvt, VT_ACTIVATE, origstate.v_active);
544 - seteuid(uid);
545 - syslog(LOG_ERR, "tcgetattr(%s): %m", openvtname);
546 - return 1;
547 - }
548 - t.c_lflag &= ~ECHO;
549 - if(tcsetattr(openvt, TCSANOW, &t)<0) {
550 - seteuid(0);
551 - ioctl(openvt, VT_ACTIVATE, origstate.v_active);
552 - seteuid(uid);
553 - syslog(LOG_ERR, "tcsetattr(%s): %m", openvtname);
554 - return 1;
555 - }
556 -
557 - if(fprintf(fp, "\033[2J\033[H")<0) {
558 - seteuid(0);
559 - ioctl(openvt, VT_ACTIVATE, origstate.v_active);
560 - seteuid(uid);
561 - syslog(LOG_ERR, "write error on %s: %m", openvtname);
562 - return 1;
563 - }
564 - if(argv[1][0] && argv[2][0]) {
565 - if(fprintf(fp, "Password for PPP client %s on server %s: ", argv[1], argv[2])<0) {
566 - seteuid(0);
567 - ioctl(openvt, VT_ACTIVATE, origstate.v_active);
568 - seteuid(uid);
569 - syslog(LOG_ERR, "write error on %s: %m", openvtname);
570 - return 1;
571 - }
572 - } else if(argv[1][0] && !argv[2][0]) {
573 - if(fprintf(fp, "Password for PPP client %s: ", argv[1])<0) {
574 - syslog(LOG_ERR, "write error on %s: %m", openvtname);
575 - seteuid(0);
576 - ioctl(openvt, VT_ACTIVATE, origstate.v_active);
577 - seteuid(uid);
578 - return 1;
579 - }
580 - } else if(!argv[1][0] && argv[2][0]) {
581 - if(fprintf(fp, "Password for PPP on server %s: ", argv[2])<0) {
582 - seteuid(0);
583 - ioctl(openvt, VT_ACTIVATE, origstate.v_active);
584 - seteuid(uid);
585 - syslog(LOG_ERR, "write error on %s: %m", openvtname);
586 - return 1;
587 - }
588 - } else {
589 - if(fprintf(fp, "Enter PPP password: ")<0) {
590 - seteuid(0);
591 - ioctl(openvt, VT_ACTIVATE, origstate.v_active);
592 - seteuid(uid);
593 - syslog(LOG_ERR, "write error on %s: %m", openvtname);
594 - return 1;
595 - }
596 - }
597 -
598 - if(!fgets(pass, sizeof pass, fp)) {
599 - seteuid(0);
600 - ioctl(openvt, VT_ACTIVATE, origstate.v_active);
601 - seteuid(uid);
602 - if(ferror(fp)) {
603 - syslog(LOG_ERR, "read error on %s: %m", openvtname);
604 - }
605 - return 1;
606 - }
607 - if((nl=strchr(pass, '\n')))
608 - *nl=0;
609 - passlen=strlen(pass);
610 -
611 - outfd=atoi(argv[3]);
612 - if((wrote=write(outfd, pass, passlen))!=passlen) {
613 - seteuid(0);
614 - ioctl(openvt, VT_ACTIVATE, origstate.v_active);
615 - seteuid(uid);
616 - if(wrote<0)
617 - syslog(LOG_ERR, "write error on outpipe: %m");
618 - else
619 - syslog(LOG_ERR, "short write on outpipe");
620 - return 1;
621 - }
622 -
623 - seteuid(0);
624 - ioctl(openvt, VT_ACTIVATE, origstate.v_active);
625 - seteuid(uid);
626 - return 0;
627 -}
628 -
629 -static int console_owner(uid_t uid, int cons)
630 -{
631 - char name[256];
632 - struct stat st;
633 - snprintf(name, sizeof name, "/dev/tty%d", cons);
634 - if(stat(name, &st)<0) {
635 - if(errno!=ENOENT)
636 - syslog(LOG_ERR, "stat(%s): %m", name);
637 - return 0;
638 - }
639 - return uid==st.st_uid;
640 -}
641 diff -ruN ppp-2.4.2/include/linux/if_ether.h ppp-cvs-20040427/include/linux/if_ether.h
642 --- ppp-2.4.2/include/linux/if_ether.h 2001-05-21 05:31:50.000000000 +0200
643 +++ ppp-cvs-20040427/include/linux/if_ether.h 1970-01-01 01:00:00.000000000 +0100
644 @@ -1,99 +0,0 @@
645 -/*
646 - * INET An implementation of the TCP/IP protocol suite for the LINUX
647 - * operating system. INET is implemented using the BSD Socket
648 - * interface as the means of communication with the user level.
649 - *
650 - * Global definitions for the Ethernet IEEE 802.3 interface.
651 - *
652 - * Version: @(#)if_ether.h 1.0.1a 02/08/94
653 - *
654 - * Author: Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
655 - * Donald Becker, <becker@super.org>
656 - * Alan Cox, <alan@redhat.com>
657 - * Steve Whitehouse, <gw7rrm@eeshack3.swan.ac.uk>
658 - *
659 - * This program is free software; you can redistribute it and/or
660 - * modify it under the terms of the GNU General Public License
661 - * as published by the Free Software Foundation; either version
662 - * 2 of the License, or (at your option) any later version.
663 - */
664 -
665 -#ifndef _LINUX_IF_ETHER_H
666 -#define _LINUX_IF_ETHER_H
667 -
668 -/*
669 - * IEEE 802.3 Ethernet magic constants. The frame sizes omit the preamble
670 - * and FCS/CRC (frame check sequence).
671 - */
672 -
673 -#define ETH_ALEN 6 /* Octets in one ethernet addr */
674 -#define ETH_HLEN 14 /* Total octets in header. */
675 -#define ETH_ZLEN 60 /* Min. octets in frame sans FCS */
676 -#define ETH_DATA_LEN 1500 /* Max. octets in payload */
677 -#define ETH_FRAME_LEN 1514 /* Max. octets in frame sans FCS */
678 -
679 -/*
680 - * These are the defined Ethernet Protocol ID's.
681 - */
682 -
683 -#define ETH_P_LOOP 0x0060 /* Ethernet Loopback packet */
684 -#define ETH_P_PUP 0x0200 /* Xerox PUP packet */
685 -#define ETH_P_PUPAT 0x0201 /* Xerox PUP Addr Trans packet */
686 -#define ETH_P_IP 0x0800 /* Internet Protocol packet */
687 -#define ETH_P_X25 0x0805 /* CCITT X.25 */
688 -#define ETH_P_ARP 0x0806 /* Address Resolution packet */
689 -#define ETH_P_BPQ 0x08FF /* G8BPQ AX.25 Ethernet Packet [ NOT AN OFFICIALLY REGISTERED ID ] */
690 -#define ETH_P_IEEEPUP 0x0a00 /* Xerox IEEE802.3 PUP packet */
691 -#define ETH_P_IEEEPUPAT 0x0a01 /* Xerox IEEE802.3 PUP Addr Trans packet */
692 -#define ETH_P_DEC 0x6000 /* DEC Assigned proto */
693 -#define ETH_P_DNA_DL 0x6001 /* DEC DNA Dump/Load */
694 -#define ETH_P_DNA_RC 0x6002 /* DEC DNA Remote Console */
695 -#define ETH_P_DNA_RT 0x6003 /* DEC DNA Routing */
696 -#define ETH_P_LAT 0x6004 /* DEC LAT */
697 -#define ETH_P_DIAG 0x6005 /* DEC Diagnostics */
698 -#define ETH_P_CUST 0x6006 /* DEC Customer use */
699 -#define ETH_P_SCA 0x6007 /* DEC Systems Comms Arch */
700 -#define ETH_P_RARP 0x8035 /* Reverse Addr Res packet */
701 -#define ETH_P_ATALK 0x809B /* Appletalk DDP */
702 -#define ETH_P_AARP 0x80F3 /* Appletalk AARP */
703 -#define ETH_P_IPX 0x8137 /* IPX over DIX */
704 -#define ETH_P_IPV6 0x86DD /* IPv6 over bluebook */
705 -#define ETH_P_PPP_DISC 0x8863 /* PPPoE discovery messages */
706 -#define ETH_P_PPP_SES 0x8864 /* PPPoE session messages */
707 -#define ETH_P_ATMMPOA 0x884c /* MultiProtocol Over ATM */
708 -#define ETH_P_ATMFATE 0x8884 /* Frame-based ATM Transport
709 - * over Ethernet
710 - */
711 -
712 -/*
713 - * Non DIX types. Won't clash for 1500 types.
714 - */
715 -
716 -#define ETH_P_802_3 0x0001 /* Dummy type for 802.3 frames */
717 -#define ETH_P_AX25 0x0002 /* Dummy protocol id for AX.25 */
718 -#define ETH_P_ALL 0x0003 /* Every packet (be careful!!!) */
719 -#define ETH_P_802_2 0x0004 /* 802.2 frames */
720 -#define ETH_P_SNAP 0x0005 /* Internal only */
721 -#define ETH_P_DDCMP 0x0006 /* DEC DDCMP: Internal only */
722 -#define ETH_P_WAN_PPP 0x0007 /* Dummy type for WAN PPP frames*/
723 -#define ETH_P_PPP_MP 0x0008 /* Dummy type for PPP MP frames */
724 -#define ETH_P_LOCALTALK 0x0009 /* Localtalk pseudo type */
725 -#define ETH_P_PPPTALK 0x0010 /* Dummy type for Atalk over PPP*/
726 -#define ETH_P_TR_802_2 0x0011 /* 802.2 frames */
727 -#define ETH_P_MOBITEX 0x0015 /* Mobitex (kaz@cafe.net) */
728 -#define ETH_P_CONTROL 0x0016 /* Card specific control frames */
729 -#define ETH_P_IRDA 0x0017 /* Linux-IrDA */
730 -#define ETH_P_ECONET 0x0018 /* Acorn Econet */
731 -
732 -/*
733 - * This is an Ethernet frame header.
734 - */
735 -
736 -struct ethhdr
737 -{
738 - unsigned char h_dest[ETH_ALEN]; /* destination eth addr */
739 - unsigned char h_source[ETH_ALEN]; /* source ether addr */
740 - unsigned short h_proto; /* packet type ID field */
741 -};
742 -
743 -#endif /* _LINUX_IF_ETHER_H */
744 diff -ruN ppp-2.4.2/include/pcap-int.h ppp-cvs-20040427/include/pcap-int.h
745 --- ppp-2.4.2/include/pcap-int.h 2000-08-01 03:37:24.000000000 +0200
746 +++ ppp-cvs-20040427/include/pcap-int.h 2000-08-01 03:37:24.000000000 +0200
747 @@ -30,7 +30,7 @@
748 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
749 * SUCH DAMAGE.
750 *
751 - * @(#) $Header: /data/cvs/ppp/include/pcap-int.h,v 1.1 2000/08/01 01:37:24 paulus Exp $ (LBL)
752 + * @(#) $Header: /cvsroot/ppp/include/pcap-int.h,v 1.1 2000/08/01 01:37:24 paulus Exp $ (LBL)
753 */
754
755 #ifndef pcap_int_h
756 diff -ruN ppp-2.4.2/modules/bsd-comp.c ppp-cvs-20040427/modules/bsd-comp.c
757 --- ppp-2.4.2/modules/bsd-comp.c 1998-03-19 06:59:01.000000000 +0100
758 +++ ppp-cvs-20040427/modules/bsd-comp.c 2004-01-17 06:50:11.000000000 +0100
759 @@ -41,7 +41,7 @@
760 * This version is for use with STREAMS under SunOS 4.x,
761 * Digital UNIX, AIX 4.x, and SVR4 systems including Solaris 2.
762 *
763 - * $Id: bsd-comp.c,v 1.20 1996/08/28 06:31:57 paulus Exp $
764 + * $Id: bsd-comp.c,v 1.21 2004/01/17 05:47:55 carlsonj Exp $
765 */
766
767 #ifdef AIX4
768 @@ -66,6 +66,10 @@
769 #define BSD_LITTLE_ENDIAN
770 #endif
771
772 +#ifdef SOL2
773 +#include <sys/sunddi.h>
774 +#endif
775 +
776 #define PACKETPTR mblk_t *
777 #include <net/ppp-comp.h>
778
779 diff -ruN ppp-2.4.2/modules/deflate.c ppp-cvs-20040427/modules/deflate.c
780 --- ppp-2.4.2/modules/deflate.c 2002-12-06 10:49:15.000000000 +0100
781 +++ ppp-cvs-20040427/modules/deflate.c 2004-01-17 06:50:11.000000000 +0100
782 @@ -35,7 +35,7 @@
783 * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
784 * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
785 *
786 - * $Id: deflate.c,v 1.11 2002/12/06 09:49:15 paulus Exp $
787 + * $Id: deflate.c,v 1.12 2004/01/17 05:47:55 carlsonj Exp $
788 */
789
790 #ifdef AIX4
791 @@ -56,6 +56,10 @@
792 #include "../common/zlib.h"
793 #endif
794
795 +#ifdef SOL2
796 +#include <sys/sunddi.h>
797 +#endif
798 +
799 #if DO_DEFLATE
800
801 #define DEFLATE_DEBUG 1
802 diff -ruN ppp-2.4.2/modules/vjcompress.c ppp-cvs-20040427/modules/vjcompress.c
803 --- ppp-2.4.2/modules/vjcompress.c 1999-09-17 04:03:56.000000000 +0200
804 +++ ppp-cvs-20040427/modules/vjcompress.c 2004-01-17 06:50:11.000000000 +0100
805 @@ -29,7 +29,7 @@
806 * This version is used under SunOS 4.x, Digital UNIX, AIX 4.x,
807 * and SVR4 systems including Solaris 2.
808 *
809 - * $Id: vjcompress.c,v 1.10 1999/09/15 23:49:06 masputra Exp $
810 + * $Id: vjcompress.c,v 1.11 2004/01/17 05:47:55 carlsonj Exp $
811 */
812
813 #include <sys/types.h>
814 @@ -56,6 +56,10 @@
815 #include <netinet/in_systm.h>
816 #endif
817
818 +#ifdef SOL2
819 +#include <sys/sunddi.h>
820 +#endif
821 +
822 #include <netinet/ip.h>
823 #include <netinet/tcp.h>
824
825 diff -ruN ppp-2.4.2/ppp.texi ppp-cvs-20040427/ppp.texi
826 --- ppp-2.4.2/ppp.texi 1970-01-01 01:00:00.000000000 +0100
827 +++ ppp-cvs-20040427/ppp.texi 1996-08-28 08:30:33.000000000 +0200
828 @@ -0,0 +1,561 @@
829 +\input texinfo @c -*-texinfo-*-
830 +@setfilename ppp.info
831 +@settitle PPP
832 +
833 +@iftex
834 +@finalout
835 +@end iftex
836 +
837 +@ifinfo
838 +@format
839 +START-INFO-DIR-ENTRY
840 +* PPP: (ppp). Point-to-Point Protocol.
841 +END-INFO-DIR-ENTRY
842 +@end format
843 +
844 +@titlepage
845 +@title PPP-2.x Users' Guide
846 +@author by Paul Mackerras
847 +@end titlepage
848 +
849 +@node Top, Introduction, (dir), (dir)
850 +
851 +@ifinfo
852 +This file documents how to use the ppp-2.x package to set up network
853 +links over serial lines with the Point-to-Point Protocol.
854 +
855 +@end ifinfo
856 +
857 +@menu
858 +* Introduction:: Basic concepts of the Point-to-Point
859 + Protocol and the ppp-2.x package.
860 +* Installation:: How to compile and install the software.
861 +* Configuration:: How to set up your system for
862 + establishing a link to another system.
863 +* Security:: Avoid creating security holes.
864 +* Compression:: Using compression of various kinds
865 + to improve throughput.
866 +@end menu
867 +
868 +@node Introduction, Installation, Top, Top
869 +@chapter Introduction
870 +
871 +The Point-to-Point Protocol (PPP) is the protocol of choice for
872 +establishing network links over serial lines. This package (ppp-2.x)
873 +provides an implementation of PPP which supports the Internet Protocols
874 +(TCP/IP, UDP/IP, etc.) and which runs on a range of Unix workstations.
875 +
876 +A typical use of PPP is to provide a network connection, via a modem,
877 +between a workstation and an Internet Service Provider (ISP). When this
878 +connection is established, the workstation is connected to the internet,
879 +and applications running on the workstation can then make connections to
880 +other hosts anywhere on the internet. This package can be used at
881 +either or both ends of such a link.
882 +
883 +Features of PPP include:
884 +@itemize @bullet
885 +@item
886 +Multi-protocol support. The PPP packet encapsulation includes a
887 +protocol field, allowing packets from many different protocols to be
888 +multiplexed across a single link.
889 +@item
890 +Negotiation of link characteristics. During link establishment, the two
891 +systems negotiate about the link configuration parameters, such as the
892 +IP addresses of each end of the link.
893 +@item
894 +Authentication. Optionally, each system can be configured to require the
895 +other system to authenticate itself. In this way, access can be
896 +restricted to authorized systems.
897 +@item
898 +Transparency. On asynchronous serial lines, PPP can be configured to
899 +transmit certain characters as a two-character escape sequence.
900 +@item
901 +Compression. PPP includes support for various kinds of compression to
902 +be applied to the packets before they are transmitted.
903 +@end itemize
904 +
905 +The ppp-2.x software consists of two parts:
906 +
907 +@itemize @bullet
908 +
909 +@item
910 +Kernel code, which establishes a network interface and passes packets
911 +between the serial port, the kernel networking code and the PPP daemon
912 +(@file{pppd}). This code is implemented using STREAMS modules on
913 +Solaris 2, SunOS 4.x, AIX 4.1 and OSF/1, and as a tty line discipline
914 +under Ultrix, NextStep, NetBSD, FreeBSD, and Linux.
915 +
916 +@item
917 +The PPP daemon (@file{pppd}), which negotiates with the peer to
918 +establish the link and sets up the ppp network interface. Pppd includes
919 +support for authentication. It can authenticate itself to the other
920 +system and/or require the other system to authenticate itself, so that
921 +you can control which other systems may make a PPP connection and what
922 +IP addresses they may use.
923 +@end itemize
924 +
925 +@menu
926 +* PPP Concepts:: Basic concepts and terms used with PPP.
927 +* PPP packet format:: How data is packaged up for transmission.
928 +* LCP negotiation:: The parameters which are negotiated
929 + using the Link Control Protocol.
930 +* IPCP negotiation:: The parameters which are negotiated
931 + using the IP Control Protocol.
932 +@end menu
933 +
934 +@node PPP Concepts, PPP packet format, Introduction, Introduction
935 +@section PPP Concepts
936 +
937 +To use PPP to provide a network connection between two machines, there
938 +must be some way that a stream of bytes, or characters, can be passed
939 +from one to the other, in both directions independently. We refer to
940 +this as the ``serial link''. Very often the serial link involves
941 +asynchronous communications ports and modems, but other kinds of serial
942 +link are possible.
943 +
944 +The serial link must transmit (at least) 8 bits per character; PPP
945 +cannot work over a serial link which transmits only 7 bits per
946 +character. However, it need not transmit all byte values transparently.
947 +PPP has a mechanism to avoid sending certain characters if it is known
948 +that the some element of the serial link interprets them specially. For
949 +example, the DC1 and DC3 ASCII characters (control-Q and control-S) may
950 +be trapped by a modem if it is set for ``software'' flow control. PPP
951 +can send these characters as a two-character ``escape'' sequence. The
952 +set of characters which are to be transmitted as an escape sequence is
953 +represented in an ``async control character map'' (ACCM). The ``async''
954 +part refers to the fact that this facility is used for asynchronous
955 +serial links. For synchronous serial connections, the HDLC bit-stuffing
956 +procedure is used instead.
957 +
958 +The two systems connected by the serial link are called ``peers''. When
959 +we are talking from the point of view of one of the systems, the other
960 +is often referred to as ``the peer''. Sometimes we may refer to one
961 +system as a ``client'' and the other as a ``server''. This distinction
962 +refers mainly to the way the serial link is set up; usually the client
963 +is the peer that initiates the connection, for example by dialling the
964 +server with its modem.
965 +
966 +During the lifetime of a PPP connection, it proceeds through several
967 +phases:
968 +
969 +@enumerate
970 +@item
971 +Serial link establishment. In this phase, the serial link is set up and
972 +PPP protocol software is attached to each end of the serial link. The
973 +precise steps involved in doing this vary greatly, depending on the
974 +nature of the serial link. For the common case of modems connected
975 +through the telephone network, this involves first sending commands to
976 +the modem to cause it to dial the remote system. When the remote system
977 +answers, the local system usually has to supply a username and password,
978 +and then issue a command to invoke PPP software on the remote system.
979 +The ``chat'' program supplied with ppp-2.x provides a way to automate a
980 +dialog with the modem and the remote system. This phase is not
981 +standardized; it is outside the scope of the PPP protocol
982 +specifications.
983 +
984 +@item
985 +Link Control Protocol (LCP) negotiation. In this phase, the peers send
986 +LCP packets to each other to negotiate various parameters of the
987 +connection, such as the ACCM to be used in each direction, whether
988 +authentication is required, and whether or not to use various forms of
989 +compression. When the peers reach agreement on these parameters, LCP is
990 +said to be ``up''.
991 +
992 +@item
993 +Authentication. If one (or both) of the peers requires the other
994 +peer to authenticate itself, that occurs next. If one of the peers
995 +cannot successfully authenticate itself, the other peer terminates the
996 +link.
997 +
998 +@item
999 +Network Control Protocol (NCP) negotiation. PPP can potentially support
1000 +several different network protocols, although IP is the only network
1001 +protocol (NP) supported by the ppp-2.x package. Each NP has an
1002 +associated NCP defined for it, which is used to negotiate the specific
1003 +parameters which affect that NP. For example, the IP Control Protocol
1004 +(IPCP) is used to negotiate the IP addresses for each end of the link,
1005 +and whether the TCP header compression method described by Van Jacobsen
1006 +in RFC 1144 (``VJ compression'') is to be used.
1007 +
1008 +@item
1009 +Network communication. When each NCP has successfully negotiated the
1010 +parameters for its NP, that NCP is said to be ``up''. At that point,
1011 +the PPP link is made available for data traffic from that NP. For
1012 +example, when IPCP comes up, the PPP link is then available for carrying
1013 +IP packets (which of course includes packets from those protocols which
1014 +are layered above IP, such as TCP, UDP, etc.)
1015 +
1016 +@item
1017 +Termination. When the link is no longer required, it is terminated.
1018 +Usually this involves an exchange of LCP packets so that one peer can
1019 +notify the other that it is shutting down the link, enabling both peers
1020 +to shut down in an orderly manner. But of course there are occasions
1021 +when the link terminates because the serial link is interrupted, for
1022 +example, when a modem loses carrier and hangs up.
1023 +
1024 +@end enumerate
1025 +
1026 +The protocols in the PPP family are produced by the Point-to-Point
1027 +Working Group of the Internet Engineering Task Force, and are specified
1028 +in RFC (Request for Comments) documents, available by anonymous FTP from
1029 +several sites.
1030 +
1031 +PPP is defined in several RFCs, in
1032 +particular RFCs 1661, 1662, and 1334. IPCP is defined in RFC 1332.
1033 +Other RFCs describe the control protocols for other network protocols
1034 +(e.g., DECnet, OSI, Appletalk). RFCs are available by anonymous FTP
1035 +from several sites including nic.ddn.mil, nnsc.nsf.net, nic.nordu.net,
1036 +ftp.nisc.sri.com, and munnari.oz.au.
1037 +
1038 +@node PPP packet format, LCP negotiation, PPP Concepts, Introduction
1039 +@section PPP packet format
1040 +
1041 +PPP transmits packets over the serial link using a simple encapsulation
1042 +scheme. First, a two-byte PPP Protocol field is inserted before the
1043 +data to be sent. The value in this field identifies
1044 +which higher-level protocol (either a network protocol such as IP or a
1045 +PPP control protocol such as LCP) should receive the data in the packet.
1046 +By default, a one-byte Address field with the value 0xFF, and a one-byte
1047 +Control field with the value 0x03, are inserted before the PPP Protocol
1048 +field (apparently this is supposed to provide compatibility with HDLC,
1049 +in case there is a synchronous to asynchronous converter in the serial
1050 +link).
1051 +
1052 +On slow serial links, these fields can be compressed down to one byte in
1053 +most cases. The PPP Address and Control fields are compressed by simply
1054 +omitting them (``address/control compression''). The PPP Protocol field
1055 +values are chosen so that bit 0 (the least-significant bit) of the first
1056 +(most significant) byte is always 0, and bit 0 of the second byte is
1057 +always 1. The PPP Protocol field can be compressed by omitting the
1058 +first byte, provided that it is 0 (``protocol compression''). The
1059 +values for this field are assigned so that the first byte is zero for
1060 +all of the commonly-used network protocols. For example, the PPP
1061 +Protocol field value for IP is 0x21.
1062 +
1063 +For asynchronous serial links, which do not provide any packet framing
1064 +or transparency, a further encapsulation is used as follows. First a
1065 +16-bit Frame Check Sequence (FCS) is computed over the packet to be
1066 +sent, and appended as two bytes to the end of the packet.
1067 +
1068 +Then each byte of the packet is examined, and if it contains one of the
1069 +characters which are to be escaped, it is replaced by a two byte
1070 +sequence: the 0x7d character '}', followed by the character with bit 5
1071 +inverted. For example, the control-C character (0x03) could be replaced
1072 +by the two-byte sequence 0x7d, 0x23 ('}#'). The 0x7d and 0x7e ('~')
1073 +characters are always escaped, and the 0x5e ('^') character may not be
1074 +escaped.
1075 +
1076 +Finally, a ``flag'' character (0x7e, '~') is inserted at the beginning
1077 +and end of the packet to mark the packet boundaries. The initial flag
1078 +may be omitted if this packet immediately follows another packet, as the
1079 +ending flag for the previous packet can serve as the beginning flag of
1080 +this packet.
1081 +
1082 +@node LCP negotiation, IPCP negotiation, PPP packet format, Introduction
1083 +@section LCP negotiation
1084 +
1085 +The LCP negotiation process actually involves two sets of negotiations,
1086 +one for each direction of the PPP connection. Thus A will send B
1087 +packets (``Configure-Requests'') describing what characteristics A would
1088 +like to have apply to the B -> A direction of the link, that is, to the
1089 +packets that A will receive. Similarly B will send A packets describing
1090 +the characteristics it would like to have apply to the packets it will
1091 +be receiving. These characteristics need not necessarily be the same in
1092 +both directions.
1093 +
1094 +The parameters which are negotiated for each direction of the connection
1095 +using LCP are:
1096 +
1097 +@itemize @bullet
1098 +@item
1099 +Maximum Receive Unit (MRU): indicates the maximum packet size which we
1100 +are prepared to receive (specifically the maximum size of the
1101 +data portion of the packet). The default value is 1500, but on
1102 +slow serial links, smaller values give better response. The choice of
1103 +MRU is discussed below (see xxx).
1104 +
1105 +@item
1106 +Async Control Character Map (ACCM): indicates the set of control
1107 +characters (characters with ASCII values in the range 0 - 31) which we
1108 +wish to receive in escaped form. The default is that the sender should
1109 +escape all characters in the range 0 - 31.
1110 +
1111 +@item
1112 +Authentication Protocol: indicates which protocol we would like the peer
1113 +to use to authenticate itself. Common choices are the Password
1114 +Authentication Protocol (PAP) and the Cryptographic Handshake
1115 +Authentication Protocol (CHAP).
1116 +
1117 +@item
1118 +Quality Protocol: indicates which protocol which we would like the peer
1119 +to use to send us link quality reports. The ppp-2.x package does not
1120 +currently support link quality reports.
1121 +
1122 +@item
1123 +Magic Number: a randomly-chosen number, different from the peer's magic
1124 +number. If we persistently receive our own magic number in the peer's
1125 +configure-request packets, then we can conclude that the serial link is
1126 +looped back.
1127 +
1128 +@item
1129 +Protocol Field Compression: indicates that we wish the peer to compress
1130 +the PPP Protocol field to one byte, where possible, in the packets it
1131 +sends.
1132 +
1133 +@item
1134 +Address/Control Field Compression: indicates that we wish the peer to
1135 +compress the PPP Address/Control fields (by simply omitting them) in the
1136 +packets it sends.
1137 +@end itemize
1138 +
1139 +@node IPCP negotiation, , LCP negotiation, Introduction
1140 +@section IPCP negotiation
1141 +
1142 +The IPCP negotiation process is very similar to the LCP negotiation
1143 +process, except that of course different parameters are negotiated.
1144 +The parameters which are negotiated using IPCP are:
1145 +
1146 +@itemize @bullet
1147 +@item
1148 +IP Address: the IP address (32-bit host IP number) which we plan to use
1149 +as the local address for our end of the link.
1150 +
1151 +@item
1152 +TCP header compression: indicates (a) that we wish the peer to compress
1153 +the TCP/IP headers of TCP/IP packets that it sends, using the Van
1154 +Jacobson algorithm as described in RFC1144; (b) the maximum slot ID that
1155 +we wish the peer to use, and (c) whether we are prepared to accept
1156 +packets with the slot ID field compressed (omitted).
1157 +
1158 +With Van Jacobson (VJ) compression, the receiver and transmitter (for
1159 +one direction of the connection) both keep a table, with a certain
1160 +number of ``slots'', where each slot holds the TCP/IP header of the most
1161 +recently transmitted packet for one TCP connection. If a packet is to
1162 +be transmitted for a TCP connection which does not have a slot currently
1163 +allocated, the VJ scheme will allocate one of the slots and send the
1164 +entire TCP/IP header, together with the slot number. For many packets,
1165 +there will be a slot already allocated for the TCP connection, and the
1166 +VJ scheme will then often be able to replace the entire TCP/IP header
1167 +with a much smaller compressed header (typically only 3 - 7 bytes)
1168 +describing which fields of the TCP/IP header have changed, and by how
1169 +much. If there are many more active connections than slots, the
1170 +efficiency of the VJ scheme will drop, because it will not be able to
1171 +send compressed headers as often.
1172 +
1173 +Usually the compressed header includes a one-byte slot index, indicating
1174 +which TCP connection the packet is for. It is possible to reduce the
1175 +header size by omitting the slot index when the packet has the same slot
1176 +index as the previous packet. However, this introduces a danger if the
1177 +lower levels of the PPP software can sometimes drop damaged packets
1178 +without informing the VJ decompressor, as it may then assume the wrong
1179 +slot index for packets which have the slot index field omitted. With
1180 +the ppp-2.x software, however, the probability of this happening is
1181 +generally very small (see xxx).
1182 +
1183 +@end itemize
1184 +
1185 +@node Installation, Configuration, Introduction, Top
1186 +@chapter Installation
1187 +
1188 +Because ppp-2.x includes code which must be incorporated into the
1189 +kernel, its installation process is necessarily quite heavily
1190 +system-dependent. In addition, you will require super-user privileges
1191 +(root access) to install the code.
1192 +
1193 +Some systems provide a ``modload'' facility, which allows you to load
1194 +new code into a running kernel without relinking the kernel or
1195 +rebooting. Under Solaris 2, SunOS 4.x, Linux, OSF/1 and NextStep, this
1196 +is the recommended (or only) way to install the kernel portion of the
1197 +ppp-2.x package.
1198 +
1199 +Under the remaining supported operating systems (NetBSD, FreeBSD,
1200 +Ultrix), it is necessary to go through the process of creating a new
1201 +kernel image and reboot. (Note that NetBSD and FreeBSD have a modload
1202 +facility, but ppp-2.x is currently not configured to take advantage of
1203 +it.)
1204 +
1205 +Detailed installation instructions for each operating system are
1206 +contained in the README files in the ppp-2.x distribution. In general,
1207 +the process involves executing the commands @samp{./configure},
1208 +@samp{make} and (as root) @samp{make install} in the ppp-2.x
1209 +distribution directory. (The Linux port requires the installation of
1210 +some header files before compiling; see README.linux for details.)
1211 +
1212 +@node Configuration, Security, Installation, Top
1213 +@chapter Configuration
1214 +
1215 +Once the ppp-2.x software is installed, you need to configure your
1216 +system for the particular PPP connections you wish to allow. Typically,
1217 +the elements you need to configure are:
1218 +
1219 +@itemize @bullet
1220 +@item
1221 +How the serial link is established and how pppd gets invoked.
1222 +@item
1223 +Setting up syslog to log messages from pppd to the console and/or
1224 +system log files.
1225 +@item
1226 +Pppd options to be used.
1227 +@item
1228 +Authentication secrets to use in authenticating us to the peer
1229 +and/or the peer to us.
1230 +@item
1231 +The IP addresses for each end of the link.
1232 +@end itemize
1233 +
1234 +In most cases, the system you are configuring will either be a
1235 +@dfn{client} system, actively initiating a PPP connection on user
1236 +request, or it will be a @dfn{server} system, passively waiting for
1237 +connections from client systems. Other arrangements are possible, but
1238 +the instructions in this system assume that you are configuring either a
1239 +client or a server.
1240 +
1241 +These instructions also assume that the serial link involves a serial
1242 +communications port (that is, a tty device), since pppd requires a
1243 +serial port.
1244 +
1245 +@menu
1246 +* Client machines::
1247 +* Server machines::
1248 +* Setting up syslog::
1249 +* Pppd options::
1250 +* Authentication secrets files::
1251 +* IP Addresses::
1252 +@end menu
1253 +
1254 +@node Client machines, Server machines, Configuration, Configuration
1255 +@section Client machines
1256 +
1257 +On a client machine, the way that the user requests that a connection be
1258 +established is by running pppd, either directly or through a shell
1259 +script. Pppd should be given the name of the serial port to use as an
1260 +option. In this mode, pppd will fork and detach itself from its
1261 +controlling terminal, so that the shell will return to its prompt. (If
1262 +this behaviour is not desired, use the -detach option.)
1263 +
1264 +Usually, the connect option should also be used. The connect option
1265 +takes an argument which is a command to run to establish the serial link
1266 +and invoke PPP software on the remote machine. This command is run with
1267 +its standard input and standard output connected to the serial port.
1268 +Giving the connect option to pppd also has the side-effect of causing
1269 +pppd to open the serial port without waiting for the modem carrier
1270 +detect signal.
1271 +
1272 +The process of establishing the serial link often involves a dialog. If
1273 +the serial port is connected to a modem, we first need to send some
1274 +commands to the modem to configure it and dial the remote system. Often
1275 +there is then a dialog with the remote system to supply a username and
1276 +password. The @file{chat} program supplied with the ppp-2.x package is
1277 +useful for automating such dialogs. Chat uses a @dfn{script} consisting
1278 +of alternately strings to expect to receive on the serial port, and
1279 +strings to send on the serial port. The script can also specify strings
1280 +which indicate an error and abort the dialog.
1281 +
1282 +@node Server machines, , Client machines, Configuration
1283 +@section Server machines
1284 +
1285 +There are generally three ways in which a server machine can be set up
1286 +to allow client machines to establish a PPP link:
1287 +
1288 +@enumerate
1289 +@item
1290 +Client machines log in as regular users (often via a serial port
1291 +connected to a modem, but possibly through a telnet or rlogin session)
1292 +and then run pppd as a shell command.
1293 +@item
1294 +Client machines log in using a username whose login shell is pppd
1295 +or a script which runs pppd.
1296 +@item
1297 +Client machines connect to a serial port which has a pppd running
1298 +permanently on it (instead of a "getty" or other program providing a
1299 +login service).
1300 +@end enumerate
1301 +
1302 +Method 1 is very simple to set up, and is useful where existing users of
1303 +a system have remote machines (for example at home) from which they want
1304 +to establish a PPP connection from time to time. Methods 2 and 3
1305 +possibly have a security advantage in that they do not allow PPP client
1306 +systems access to a shell. Method 2 allows regular logins and PPP
1307 +connections on the same port, while with method 3, would-be crackers may
1308 +well be frustrated (unless they speak fluent PPP).
1309 +
1310 +With any of these methods, I strongly recommend that you configure PPP
1311 +to require authentication from the client, by including the `auth'
1312 +option in the /etc/ppp/options file.
1313 +
1314 +@node Setting up syslog, , Server machines, Configuration
1315 +@section Setting up syslog
1316 +
1317 +Pppd uses the @file{syslog} facility to report information about the
1318 +state of the connection, as does @file{chat}. It is useful to set up
1319 +syslog to print some of these messages on the console, and to record
1320 +most of them to a file. The messages from pppd are logged with facility
1321 +@samp{daemon} and one of three levels:
1322 +@itemize @bullet
1323 +@item
1324 +@samp{notice} for messages about important events such as the
1325 +connection becoming available for IP traffic and the local and remote IP
1326 +addresses in use.
1327 +@item
1328 +@samp{info} for messages about less important events, such as
1329 +detecting a modem hangup.
1330 +@item
1331 +@samp{debug} for messages which are of use in working out why the
1332 +connection is not working properly.
1333 +@end itemize
1334 +
1335 +The messages from chat are logged with facility @samp{local2} and level
1336 +@samp{debug}.
1337 +
1338 +Syslog is controlled by the syslog configuration file
1339 +@file{/etc/syslog.conf}. Generally the standard configuration will log
1340 +facility @samp{daemon} messages with level @samp{notice} and above to a
1341 +system log file such as @file{/var/log/syslog} (the name may vary on
1342 +different systems). I find it useful to have the notice level messages
1343 +from pppd displayed on the console, and all messages from pppd and chat
1344 +logged to a file such as @file{/etc/ppp/log}. To achieve this,
1345 +find the line in /etc/syslog.conf which has /dev/console
1346 +on the right-hand side, and add `daemon.notice' on the left. This
1347 +line should end up something like this:
1348 +
1349 +@example
1350 +*.err;kern.debug;auth.notice;mail.crit;daemon.notice /dev/console
1351 +@end example
1352 +
1353 +And add a line like this:
1354 +
1355 +@example
1356 +daemon,local2.debug /etc/ppp/log
1357 +@end example
1358 +
1359 +The space between the left and right hand sides is one or more tabs, not
1360 +spaces, and there are no tabs or spaces at the beginning of the line.
1361 +
1362 +You will need to create an empty @file{/etc/ppp/log} file; syslogd will
1363 +not create it. Once you have modified @file{/etc/syslog.conf}, you need
1364 +to either reboot or notify syslogd to re-read the file. On most
1365 +systems, you notify syslogd by sending it a SIGHUP signal. Syslogd's
1366 +process ID is usually stored in a file such as @file{/etc/syslogd.pid}
1367 +or @file{/var/run/syslog.pid}. Thus you can notify syslogd to re-read
1368 +the file by executing a command such as:
1369 +
1370 +@example
1371 +kill -HUP `cat /etc/syslogd.pid`
1372 +@end example
1373 +
1374 +@node Pppd options, , Setting up syslog, Configuration
1375 +@section Pppd options
1376 +
1377 +@node Authentication secrets files, , Pppd options, Configuration
1378 +@section Authentication secrets files
1379 +
1380 +@node IP Addresses, , Authentication secrets files, Configuration
1381 +@section IP Addresses
1382 +
1383 +@node Security, Compression, Configuration, Top
1384 +@chapter Security
1385 +
1386 +@node Compression, , Security, Top
1387 +@chapter Compression
1388 +
1389 +@bye
1390 diff -ruN ppp-2.4.2/pppd/Makefile.sol2 ppp-cvs-20040427/pppd/Makefile.sol2
1391 --- ppp-2.4.2/pppd/Makefile.sol2 2003-11-27 22:25:25.000000000 +0100
1392 +++ ppp-cvs-20040427/pppd/Makefile.sol2 2002-11-02 20:50:09.000000000 +0100
1393 @@ -1,6 +1,6 @@
1394 #
1395 # Makefile for pppd under Solaris 2.
1396 -# $Id: Makefile.sol2,v 1.24 2003/11/27 21:25:25 paulus Exp $
1397 +# $Id: Makefile.sol2,v 1.23 2002/11/02 19:48:12 carlsonj Exp $
1398 #
1399
1400 include ../Makedefs.com
1401 @@ -8,8 +8,8 @@
1402 CFLAGS = -I../include -DSVR4 -DSOL2 $(COPTS)
1403 LIBS = -lsocket -lnsl
1404
1405 -OBJS = main.o magic.o fsm.o lcp.o ipcp.o upap.o chap-new.o eap.o md5.o \
1406 - tty.o ccp.o ecp.o auth.o options.o demand.o utils.o sys-solaris.o
1407 +OBJS = main.o magic.o fsm.o lcp.o ipcp.o upap.o chap.o eap.o md5.o tty.o \
1408 + ccp.o ecp.o auth.o options.o demand.o utils.o sys-solaris.o
1409
1410 #
1411 # uncomment the following to enable plugins
1412 diff -ruN ppp-2.4.2/pppd/Makefile.sunos4 ppp-cvs-20040427/pppd/Makefile.sunos4
1413 --- ppp-2.4.2/pppd/Makefile.sunos4 2003-11-27 22:25:25.000000000 +0100
1414 +++ ppp-cvs-20040427/pppd/Makefile.sunos4 2002-11-02 20:50:09.000000000 +0100
1415 @@ -1,6 +1,6 @@
1416 #
1417 # Makefile for pppd under SunOS 4.
1418 -# $Id: Makefile.sunos4,v 1.14 2003/11/27 21:25:25 paulus Exp $
1419 +# $Id: Makefile.sunos4,v 1.13 2002/11/02 19:48:12 carlsonj Exp $
1420 #
1421
1422 include ../sunos4/Makedefs
1423 @@ -12,7 +12,7 @@
1424
1425 all: pppd
1426
1427 -OBJS = main.o magic.o fsm.o lcp.o ipcp.o upap.o chap-new.o md5.o ccp.o ecp.o \
1428 +OBJS = main.o magic.o fsm.o lcp.o ipcp.o upap.o chap.o md5.o ccp.o ecp.o \
1429 auth.o options.o demand.o utils.o sys-sunos4.o tty.o eap.o
1430
1431 pppd: $(OBJS)
1432 diff -ruN ppp-2.4.2/pppd/chap-new.c ppp-cvs-20040427/pppd/chap-new.c
1433 --- ppp-2.4.2/pppd/chap-new.c 2003-11-27 23:22:36.000000000 +0100
1434 +++ ppp-cvs-20040427/pppd/chap-new.c 2004-01-17 06:50:11.000000000 +0100
1435 @@ -33,7 +33,7 @@
1436 * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1437 */
1438
1439 -#define RCSID "$Id: chap-new.c,v 1.3 2003/11/27 22:22:36 paulus Exp $"
1440 +#define RCSID "$Id: chap-new.c,v 1.4 2004/01/17 05:47:55 carlsonj Exp $"
1441
1442 #include <stdlib.h>
1443 #include <string.h>
1444 @@ -49,7 +49,7 @@
1445 int (*chap_verify_hook)(char *name, char *ourname, int id,
1446 struct chap_digest_type *digest,
1447 unsigned char *challenge, unsigned char *response,
1448 - unsigned char *message, int message_space) = NULL;
1449 + char *message, int message_space) = NULL;
1450
1451 /*
1452 * Option variables.
1453 @@ -119,7 +119,7 @@
1454 static int chap_verify_response(char *name, char *ourname, int id,
1455 struct chap_digest_type *digest,
1456 unsigned char *challenge, unsigned char *response,
1457 - unsigned char *message, int message_space);
1458 + char *message, int message_space);
1459 static void chap_respond(struct chap_client_state *cs, int id,
1460 unsigned char *pkt, int len);
1461 static void chap_handle_status(struct chap_client_state *cs, int code, int id,
1462 @@ -306,11 +306,11 @@
1463 {
1464 int response_len, ok, mlen;
1465 unsigned char *response, *p;
1466 - unsigned char *name = NULL; /* initialized to shut gcc up */
1467 + char *name = NULL; /* initialized to shut gcc up */
1468 int (*verifier)(char *, char *, int, struct chap_digest_type *,
1469 - unsigned char *, unsigned char *, unsigned char *, int);
1470 + unsigned char *, unsigned char *, char *, int);
1471 char rname[MAXNAMELEN+1];
1472 - unsigned char message[256];
1473 + char message[256];
1474
1475 if ((ss->flags & LOWERUP) == 0)
1476 return;
1477 @@ -322,7 +322,7 @@
1478 response = pkt;
1479 GETCHAR(response_len, pkt);
1480 len -= response_len + 1; /* length of name */
1481 - name = pkt + response_len;
1482 + name = (char *)pkt + response_len;
1483 if (len < 0)
1484 return;
1485
1486 @@ -391,14 +391,14 @@
1487 chap_verify_response(char *name, char *ourname, int id,
1488 struct chap_digest_type *digest,
1489 unsigned char *challenge, unsigned char *response,
1490 - unsigned char *message, int message_space)
1491 + char *message, int message_space)
1492 {
1493 int ok;
1494 - char secret[MAXSECRETLEN];
1495 + unsigned char secret[MAXSECRETLEN];
1496 int secret_len;
1497
1498 /* Get the secret that the peer is supposed to know */
1499 - if (!get_secret(0, name, ourname, secret, &secret_len, 1)) {
1500 + if (!get_secret(0, name, ourname, (char *)secret, &secret_len, 1)) {
1501 error("No CHAP secret found for authenticating %q", name);
1502 return 0;
1503 }
1504 diff -ruN ppp-2.4.2/pppd/chap-new.h ppp-cvs-20040427/pppd/chap-new.h
1505 --- ppp-2.4.2/pppd/chap-new.h 2003-06-11 14:47:31.000000000 +0200
1506 +++ ppp-cvs-20040427/pppd/chap-new.h 2004-01-17 06:50:12.000000000 +0100
1507 @@ -123,7 +123,7 @@
1508 extern int (*chap_verify_hook)(char *name, char *ourname, int id,
1509 struct chap_digest_type *digest,
1510 unsigned char *challenge, unsigned char *response,
1511 - unsigned char *message, int message_space);
1512 + char *message, int message_space);
1513
1514 /* Called by digest code to register a digest type */
1515 extern void chap_register_digest(struct chap_digest_type *);
1516 diff -ruN ppp-2.4.2/pppd/chap_ms.c ppp-cvs-20040427/pppd/chap_ms.c
1517 --- ppp-2.4.2/pppd/chap_ms.c 2003-11-18 11:42:56.000000000 +0100
1518 +++ ppp-cvs-20040427/pppd/chap_ms.c 2004-04-14 04:40:21.000000000 +0200
1519 @@ -74,7 +74,7 @@
1520 *
1521 */
1522
1523 -#define RCSID "$Id: chap_ms.c,v 1.30 2003/07/10 17:59:33 fcusack Exp $"
1524 +#define RCSID "$Id: chap_ms.c,v 1.31 2004/04/14 02:39:39 carlsonj Exp $"
1525
1526 #ifdef CHAPMS
1527
1528 @@ -164,9 +164,11 @@
1529 chapms_generate_challenge(unsigned char *challenge)
1530 {
1531 *challenge++ = 8;
1532 +#ifdef DEBUGMPPEKEY
1533 if (mschap_challenge && strlen(mschap_challenge) == 8)
1534 memcpy(challenge, mschap_challenge, 8);
1535 else
1536 +#endif
1537 random_bytes(challenge, 8);
1538 }
1539
1540 @@ -174,9 +176,11 @@
1541 chapms2_generate_challenge(unsigned char *challenge)
1542 {
1543 *challenge++ = 16;
1544 +#ifdef DEBUGMPPEKEY
1545 if (mschap_challenge && strlen(mschap_challenge) == 16)
1546 memcpy(challenge, mschap_challenge, 16);
1547 else
1548 +#endif
1549 random_bytes(challenge, 16);
1550 }
1551
1552 @@ -207,7 +211,7 @@
1553 #endif
1554
1555 /* Generate the expected response. */
1556 - ChapMS(challenge, secret, secret_len, &md);
1557 + ChapMS(challenge, (char *)secret, secret_len, &md);
1558
1559 #ifdef MSLANMAN
1560 /* Determine which part of response to verify against */
1561 @@ -250,8 +254,8 @@
1562
1563 /* Generate the expected response and our mutual auth. */
1564 ChapMS2(challenge, rmd->PeerChallenge, name,
1565 - secret, secret_len, &md,
1566 - saresponse, MS_CHAP2_AUTHENTICATOR);
1567 + (char *)secret, secret_len, &md,
1568 + (unsigned char *)saresponse, MS_CHAP2_AUTHENTICATOR);
1569
1570 /* compare MDs and send the appropriate status */
1571 /*
1572 @@ -326,8 +330,13 @@
1573 {
1574 challenge++; /* skip length, should be 16 */
1575 *response++ = MS_CHAP2_RESPONSE_LEN;
1576 - ChapMS2(challenge, mschap2_peer_challenge, our_name,
1577 - secret, secret_len,
1578 + ChapMS2(challenge,
1579 +#ifdef DEBUGMPPEKEY
1580 + mschap2_peer_challenge,
1581 +#else
1582 + NULL,
1583 +#endif
1584 + our_name, secret, secret_len,
1585 (MS_Chap2Response *) response, private,
1586 MS_CHAP2_AUTHENTICATEE);
1587 }
1588 @@ -335,7 +344,8 @@
1589 static int
1590 chapms2_check_success(unsigned char *msg, int len, unsigned char *private)
1591 {
1592 - if ((len < MS_AUTH_RESPONSE_LENGTH + 2) || strncmp(msg, "S=", 2)) {
1593 + if ((len < MS_AUTH_RESPONSE_LENGTH + 2) ||
1594 + strncmp((char *)msg, "S=", 2) != 0) {
1595 /* Packet does not start with "S=" */
1596 error("MS-CHAPv2 Success packet is badly formed.");
1597 return 0;
1598 @@ -351,7 +361,7 @@
1599 /* Authenticator Response matches. */
1600 msg += MS_AUTH_RESPONSE_LENGTH; /* Eat it */
1601 len -= MS_AUTH_RESPONSE_LENGTH;
1602 - if ((len >= 3) && !strncmp(msg, " M=", 3)) {
1603 + if ((len >= 3) && !strncmp((char *)msg, " M=", 3)) {
1604 msg += 3; /* Eat the delimiter */
1605 } else if (len) {
1606 /* Packet has extra text which does not begin " M=" */
1607 @@ -477,7 +487,7 @@
1608 SHA1_Init(&sha1Context);
1609 SHA1_Update(&sha1Context, PeerChallenge, 16);
1610 SHA1_Update(&sha1Context, rchallenge, 16);
1611 - SHA1_Update(&sha1Context, user, strlen(user));
1612 + SHA1_Update(&sha1Context, (unsigned char *)user, strlen(user));
1613 SHA1_Final(sha1Hash, &sha1Context);
1614
1615 BCOPY(sha1Hash, Challenge, 8);
1616 @@ -512,7 +522,7 @@
1617 MD4_CTX md4Context;
1618
1619 MD4Init(&md4Context);
1620 - MD4Update(&md4Context, secret, mdlen);
1621 + MD4Update(&md4Context, (unsigned char *)secret, mdlen);
1622 MD4Final(hash, &md4Context);
1623
1624 }
1625 @@ -526,7 +536,7 @@
1626
1627 /* Hash the Unicode version of the secret (== password). */
1628 ascii2unicode(secret, secret_len, unicodePassword);
1629 - NTPasswordHash(unicodePassword, secret_len * 2, PasswordHash);
1630 + NTPasswordHash((char *)unicodePassword, secret_len * 2, PasswordHash);
1631
1632 ChallengeResponse(rchallenge, PasswordHash, NTResponse);
1633 }
1634 @@ -539,11 +549,12 @@
1635 u_char PasswordHash[MD4_SIGNATURE_SIZE];
1636 u_char Challenge[8];
1637
1638 - ChallengeHash(PeerChallenge, rchallenge, username, Challenge);
1639 + ChallengeHash(PeerChallenge, (unsigned char *)rchallenge, username,
1640 + Challenge);
1641
1642 /* Hash the Unicode version of the secret (== password). */
1643 ascii2unicode(secret, secret_len, unicodePassword);
1644 - NTPasswordHash(unicodePassword, secret_len * 2, PasswordHash);
1645 + NTPasswordHash((char *)unicodePassword, secret_len * 2, PasswordHash);
1646
1647 ChallengeResponse(Challenge, PasswordHash, NTResponse);
1648 }
1649 @@ -603,8 +614,9 @@
1650
1651 /* Hash (x2) the Unicode version of the secret (== password). */
1652 ascii2unicode(secret, secret_len, unicodePassword);
1653 - NTPasswordHash(unicodePassword, secret_len * 2, PasswordHash);
1654 - NTPasswordHash(PasswordHash, sizeof(PasswordHash), PasswordHashHash);
1655 + NTPasswordHash((char *)unicodePassword, secret_len * 2, PasswordHash);
1656 + NTPasswordHash((char *)PasswordHash, sizeof(PasswordHash),
1657 + PasswordHashHash);
1658
1659 SHA1_Init(&sha1Context);
1660 SHA1_Update(&sha1Context, PasswordHashHash, sizeof(PasswordHashHash));
1661 @@ -622,7 +634,7 @@
1662
1663 /* Convert to ASCII hex string. */
1664 for (i = 0; i < MAX((MS_AUTH_RESPONSE_LENGTH / 2), sizeof(Digest)); i++)
1665 - sprintf(&authResponse[i * 2], "%02X", Digest[i]);
1666 + sprintf((char *)&authResponse[i * 2], "%02X", Digest[i]);
1667 }
1668
1669
1670 @@ -825,7 +837,7 @@
1671 sizeof(response->PeerChallenge));
1672
1673 /* Generate the NT-Response */
1674 - ChapMS2_NT(rchallenge, response->PeerChallenge, user,
1675 + ChapMS2_NT((char *)rchallenge, response->PeerChallenge, user,
1676 secret, secret_len, response->NTResp);
1677
1678 /* Generate the Authenticator Response. */
1679 diff -ruN ppp-2.4.2/pppd/fsm.c ppp-cvs-20040427/pppd/fsm.c
1680 --- ppp-2.4.2/pppd/fsm.c 2003-06-29 12:06:14.000000000 +0200
1681 +++ ppp-cvs-20040427/pppd/fsm.c 2004-02-02 05:00:11.000000000 +0100
1682 @@ -40,7 +40,7 @@
1683 * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1684 */
1685
1686 -#define RCSID "$Id: fsm.c,v 1.20 2003/06/29 10:06:14 paulus Exp $"
1687 +#define RCSID "$Id: fsm.c,v 1.22 2004/02/02 03:57:19 carlsonj Exp $"
1688
1689 /*
1690 * TODO:
1691 @@ -201,6 +201,44 @@
1692 }
1693 }
1694
1695 +/*
1696 + * terminate_layer - Start process of shutting down the FSM
1697 + *
1698 + * Cancel any timeout running, notify upper layers we're done, and
1699 + * send a terminate-request message as configured.
1700 + */
1701 +static void
1702 +terminate_layer(f, nextstate)
1703 + fsm *f;
1704 + int nextstate;
1705 +{
1706 + if( f->state != OPENED )
1707 + UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */
1708 + else if( f->callbacks->down )
1709 + (*f->callbacks->down)(f); /* Inform upper layers we're down */
1710 +
1711 + /* Init restart counter and send Terminate-Request */
1712 + f->retransmits = f->maxtermtransmits;
1713 + fsm_sdata(f, TERMREQ, f->reqid = ++f->id,
1714 + (u_char *) f->term_reason, f->term_reason_len);
1715 +
1716 + if (f->retransmits == 0) {
1717 + /*
1718 + * User asked for no terminate requests at all; just close it.
1719 + * We've already fired off one Terminate-Request just to be nice
1720 + * to the peer, but we're not going to wait for a reply.
1721 + */
1722 + f->state = nextstate == CLOSING ? CLOSED : STOPPED;
1723 + if( f->callbacks->finished )
1724 + (*f->callbacks->finished)(f);
1725 + return;
1726 + }
1727 +
1728 + TIMEOUT(fsm_timeout, f, f->timeouttime);
1729 + --f->retransmits;
1730 +
1731 + f->state = nextstate;
1732 +}
1733
1734 /*
1735 * fsm_close - Start closing connection.
1736 @@ -230,19 +268,7 @@
1737 case ACKRCVD:
1738 case ACKSENT:
1739 case OPENED:
1740 - if( f->state != OPENED )
1741 - UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */
1742 - else if( f->callbacks->down )
1743 - (*f->callbacks->down)(f); /* Inform upper layers we're down */
1744 -
1745 - /* Init restart counter, send Terminate-Request */
1746 - f->retransmits = f->maxtermtransmits;
1747 - fsm_sdata(f, TERMREQ, f->reqid = ++f->id,
1748 - (u_char *) f->term_reason, f->term_reason_len);
1749 - TIMEOUT(fsm_timeout, f, f->timeouttime);
1750 - --f->retransmits;
1751 -
1752 - f->state = CLOSING;
1753 + terminate_layer(f, CLOSING);
1754 break;
1755 }
1756 }
1757 @@ -689,17 +715,7 @@
1758 break;
1759
1760 case OPENED:
1761 - if( f->callbacks->down )
1762 - (*f->callbacks->down)(f);
1763 -
1764 - /* Init restart counter, send Terminate-Request */
1765 - f->retransmits = f->maxtermtransmits;
1766 - fsm_sdata(f, TERMREQ, f->reqid = ++f->id,
1767 - (u_char *) f->term_reason, f->term_reason_len);
1768 - TIMEOUT(fsm_timeout, f, f->timeouttime);
1769 - --f->retransmits;
1770 -
1771 - f->state = STOPPING;
1772 + terminate_layer(f, STOPPING);
1773 break;
1774
1775 default:
1776 diff -ruN ppp-2.4.2/pppd/main.c ppp-cvs-20040427/pppd/main.c
1777 --- ppp-2.4.2/pppd/main.c 2004-01-13 05:00:34.000000000 +0100
1778 +++ ppp-cvs-20040427/pppd/main.c 2004-04-12 13:25:19.000000000 +0200
1779 @@ -40,7 +40,7 @@
1780 * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1781 */
1782
1783 -#define RCSID "$Id: main.c,v 1.131 2004/01/13 04:00:34 paulus Exp $"
1784 +#define RCSID "$Id: main.c,v 1.136 2004/04/12 11:20:19 paulus Exp $"
1785
1786 #include <stdio.h>
1787 #include <ctype.h>
1788 @@ -150,6 +150,7 @@
1789 int got_sigterm;
1790 int got_sighup;
1791
1792 +static sigset_t signals_handled;
1793 static int waiting;
1794 static sigjmp_buf sigjmp;
1795
1796 @@ -648,16 +649,15 @@
1797 handle_events()
1798 {
1799 struct timeval timo;
1800 - sigset_t mask;
1801
1802 kill_link = open_ccp_flag = 0;
1803 if (sigsetjmp(sigjmp, 1) == 0) {
1804 - sigprocmask(SIG_BLOCK, &mask, NULL);
1805 + sigprocmask(SIG_BLOCK, &signals_handled, NULL);
1806 if (got_sighup || got_sigterm || got_sigusr2 || got_sigchld) {
1807 - sigprocmask(SIG_UNBLOCK, &mask, NULL);
1808 + sigprocmask(SIG_UNBLOCK, &signals_handled, NULL);
1809 } else {
1810 waiting = 1;
1811 - sigprocmask(SIG_UNBLOCK, &mask, NULL);
1812 + sigprocmask(SIG_UNBLOCK, &signals_handled, NULL);
1813 wait_input(timeleft(&timo));
1814 }
1815 }
1816 @@ -692,19 +692,18 @@
1817 setup_signals()
1818 {
1819 struct sigaction sa;
1820 - sigset_t mask;
1821
1822 /*
1823 * Compute mask of all interesting signals and install signal handlers
1824 * for each. Only one signal handler may be active at a time. Therefore,
1825 * all other signals should be masked when any handler is executing.
1826 */
1827 - sigemptyset(&mask);
1828 - sigaddset(&mask, SIGHUP);
1829 - sigaddset(&mask, SIGINT);
1830 - sigaddset(&mask, SIGTERM);
1831 - sigaddset(&mask, SIGCHLD);
1832 - sigaddset(&mask, SIGUSR2);
1833 + sigemptyset(&signals_handled);
1834 + sigaddset(&signals_handled, SIGHUP);
1835 + sigaddset(&signals_handled, SIGINT);
1836 + sigaddset(&signals_handled, SIGTERM);
1837 + sigaddset(&signals_handled, SIGCHLD);
1838 + sigaddset(&signals_handled, SIGUSR2);
1839
1840 #define SIGNAL(s, handler) do { \
1841 sa.sa_handler = handler; \
1842 @@ -712,7 +711,7 @@
1843 fatal("Couldn't establish signal handler (%d): %m", s); \
1844 } while (0)
1845
1846 - sa.sa_mask = mask;
1847 + sa.sa_mask = signals_handled;
1848 sa.sa_flags = 0;
1849 SIGNAL(SIGHUP, hup); /* Hangup */
1850 SIGNAL(SIGINT, term); /* Interrupt */
1851 @@ -1173,6 +1172,7 @@
1852 info("Connect time %d.%d minutes.", t/10, t%10);
1853 info("Sent %u bytes, received %u bytes.",
1854 link_stats.bytes_out, link_stats.bytes_in);
1855 + link_stats_valid = 0;
1856 }
1857 }
1858
1859 @@ -1329,6 +1329,7 @@
1860
1861 /*
1862 * kill_my_pg - send a signal to our process group, and ignore it ourselves.
1863 + * We assume that sig is currently blocked.
1864 */
1865 static void
1866 kill_my_pg(sig)
1867 @@ -1336,10 +1337,22 @@
1868 {
1869 struct sigaction act, oldact;
1870
1871 + sigemptyset(&act.sa_mask); /* unnecessary in fact */
1872 act.sa_handler = SIG_IGN;
1873 act.sa_flags = 0;
1874 - sigaction(sig, &act, &oldact);
1875 kill(0, sig);
1876 + /*
1877 + * The kill() above made the signal pending for us, as well as
1878 + * the rest of our process group, but we don't want it delivered
1879 + * to us. It is blocked at the moment. Setting it to be ignored
1880 + * will cause the pending signal to be discarded. If we did the
1881 + * kill() after setting the signal to be ignored, it is unspecified
1882 + * (by POSIX) whether the signal is immediately discarded or left
1883 + * pending, and in fact Linux would leave it pending, and so it
1884 + * would be delivered after the current signal handler exits,
1885 + * leading to an infinite loop.
1886 + */
1887 + sigaction(sig, &act, &oldact);
1888 sigaction(sig, &oldact, NULL);
1889 }
1890
1891 diff -ruN ppp-2.4.2/pppd/plugins/Makefile ppp-cvs-20040427/pppd/plugins/Makefile
1892 --- ppp-2.4.2/pppd/plugins/Makefile 2004-01-13 04:56:24.000000000 +0100
1893 +++ ppp-cvs-20040427/pppd/plugins/Makefile 1970-01-01 01:00:00.000000000 +0100
1894 @@ -1,38 +0,0 @@
1895 -CC = gcc
1896 -COPTS = -O2 -g
1897 -CFLAGS = $(COPTS) -I.. -I../../include -fPIC
1898 -LDFLAGS = -shared
1899 -INSTALL = install -o root
1900 -
1901 -SUBDIRS := rp-pppoe
1902 -# Uncomment the next line to include the radius authentication plugin
1903 -# SUBDIRS += radius
1904 -PLUGINS := minconn.so passprompt.so passwordfd.so
1905 -
1906 -# include dependencies if present
1907 -ifeq (.depend,$(wildcard .depend))
1908 -include .depend
1909 -endif
1910 -
1911 -all: $(PLUGINS)
1912 - for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d all; done
1913 -
1914 -%.so: %.c
1915 - $(CC) -o $@ $(LDFLAGS) $(CFLAGS) $^
1916 -
1917 -VERSION = $(shell awk -F '"' '/VERSION/ { print $$2; }' ../patchlevel.h)
1918 -LIBDIR = $(DESTDIR)/usr/lib/pppd/$(VERSION)
1919 -
1920 -install: $(PLUGINS)
1921 - $(INSTALL) -d $(LIBDIR)
1922 - $(INSTALL) $? $(LIBDIR)
1923 - for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d INSTALL=$(INSTALL) \
1924 - LIBDIR=$(LIBDIR) install; done
1925 -
1926 -clean:
1927 - rm -f *.o *.so *.a
1928 - for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d clean; done
1929 -
1930 -depend:
1931 - $(CPP) -M $(CFLAGS) *.c >.depend
1932 - for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d depend; done
1933 diff -ruN ppp-2.4.2/pppd/plugins/radius/CVS/Entries ppp-cvs-20040427/pppd/plugins/radius/CVS/Entries
1934 --- ppp-2.4.2/pppd/plugins/radius/CVS/Entries 2002-12-04 22:49:09.000000000 +0100
1935 +++ ppp-cvs-20040427/pppd/plugins/radius/CVS/Entries 1970-01-01 01:00:00.000000000 +0100
1936 @@ -1,7 +0,0 @@
1937 -/pppd-radattr.8/1.1/Tue Jan 22 16:03:00 2002//
1938 -/pppd-radius.8/1.4/Tue Apr 2 13:55:00 2002//
1939 -/radattr.c/1.1/Tue Jan 22 16:03:00 2002//
1940 -D/radiusclient////
1941 -/Makefile.linux/1.5/Sat Nov 9 11:24:42 2002//
1942 -/radrealms.c/1.1/Sat Oct 5 04:35:24 2002//
1943 -/radius.c/1.18/Wed Dec 4 21:49:09 2002//
1944 diff -ruN ppp-2.4.2/pppd/plugins/radius/CVS/Repository ppp-cvs-20040427/pppd/plugins/radius/CVS/Repository
1945 --- ppp-2.4.2/pppd/plugins/radius/CVS/Repository 2002-09-07 12:37:51.000000000 +0200
1946 +++ ppp-cvs-20040427/pppd/plugins/radius/CVS/Repository 1970-01-01 01:00:00.000000000 +0100
1947 @@ -1 +0,0 @@
1948 -ppp/pppd/plugins/radius
1949 diff -ruN ppp-2.4.2/pppd/plugins/radius/CVS/Root ppp-cvs-20040427/pppd/plugins/radius/CVS/Root
1950 --- ppp-2.4.2/pppd/plugins/radius/CVS/Root 2002-09-07 12:37:51.000000000 +0200
1951 +++ ppp-cvs-20040427/pppd/plugins/radius/CVS/Root 1970-01-01 01:00:00.000000000 +0100
1952 @@ -1 +0,0 @@
1953 -samba.org:/data/cvs
1954 diff -ruN ppp-2.4.2/pppd/plugins/radius/Makefile ppp-cvs-20040427/pppd/plugins/radius/Makefile
1955 --- ppp-2.4.2/pppd/plugins/radius/Makefile 2002-11-09 12:24:42.000000000 +0100
1956 +++ ppp-cvs-20040427/pppd/plugins/radius/Makefile 1970-01-01 01:00:00.000000000 +0100
1957 @@ -1,74 +0,0 @@
1958 -# Makefile for RADIUS plugin
1959 -#
1960 -# Copyright 2002 Roaring Penguin Software Inc.
1961 -#
1962 -
1963 -MANDIR=/usr/man
1964 -PLUGIN=radius.so radattr.so radrealms.so
1965 -CFLAGS=-I../.. -I../../../include -Iradiusclient/include -O2
1966 -
1967 -# Uncomment the next line to include support for Microsoft's
1968 -# MS-CHAP authentication protocol.
1969 -CHAPMS=y
1970 -# Uncomment the next line to include support for MPPE.
1971 -MPPE=y
1972 -# Uncomment the next lint to include support for traffic limiting
1973 -MAXOCTETS=y
1974 -
1975 -ifdef CHAPMS
1976 -CFLAGS += -DCHAPMS=1
1977 -ifdef MPPE
1978 -CFLAGS += -DMPPE=1
1979 -endif
1980 -endif
1981 -ifdef MAXOCTETS
1982 -CFLAGS += -DMAXOCTETS=1
1983 -endif
1984 -
1985 -all: $(PLUGIN)
1986 -
1987 -install: all
1988 - $(MAKE) $(MFLAGS) -C radiusclient install
1989 - $(INSTALL) -d -m 755 $(LIBDIR)
1990 - $(INSTALL) -s -c -m 755 radius.so $(LIBDIR)
1991 - $(INSTALL) -s -c -m 755 radattr.so $(LIBDIR)
1992 - $(INSTALL) -s -c -m 755 radrealms.so $(LIBDIR)
1993 - $(INSTALL) -c -m 444 pppd-radius.8 $(MANDIR)/man8
1994 - $(INSTALL) -c -m 444 pppd-radattr.8 $(MANDIR)/man8
1995 -
1996 -radius.so: radiusclient/lib/.libs/libradiusclient.a radius.o
1997 - gcc -o radius.so -shared radius.o radiusclient/lib/.libs/libradiusclient.a
1998 -
1999 -radattr.so: radattr.o
2000 - gcc -o radattr.so -shared radattr.o
2001 -
2002 -radrealms.so: radrealms.o
2003 - gcc -o radrealms.so -shared radrealms.o
2004 -
2005 -radius.o: radius.c
2006 - gcc $(CFLAGS) -c -o radius.o -fPIC radius.c
2007 -
2008 -radattr.o: radattr.c
2009 - gcc $(CFLAGS) -c -o radattr.o -fPIC radattr.c
2010 -
2011 -radrealms.o: radrealms.c
2012 - gcc $(CFLAGS) -c -o radrealms.o -fPIC radrealms.c
2013 -
2014 -radiusclient/lib/.libs/libradiusclient.a:
2015 - test -r radiusclient/Makefile || \
2016 - (cd radiusclient; \
2017 - ./configure --prefix=/usr \
2018 - --sysconfdir=/etc \
2019 - --enable-shared \
2020 - --enable-static)
2021 - $(MAKE) -C radiusclient
2022 -
2023 -clean:
2024 - $(MAKE) $(MFLAGS) -C radiusclient clean
2025 - rm -f *.o *.so
2026 -
2027 -distclean:
2028 - rm -f *.o *.so
2029 - $(MAKE) $(MFLAGS) -C radiusclient distclean
2030 -
2031 -dist-clean: distclean
2032 diff -ruN ppp-2.4.2/pppd/plugins/radius/pppd-radius.8 ppp-cvs-20040427/pppd/plugins/radius/pppd-radius.8
2033 --- ppp-2.4.2/pppd/plugins/radius/pppd-radius.8 2002-04-02 15:55:00.000000000 +0200
2034 +++ ppp-cvs-20040427/pppd/plugins/radius/pppd-radius.8 2004-03-26 14:30:16.000000000 +0100
2035 @@ -1,5 +1,5 @@
2036 .\" manual page [] for RADIUS plugin for pppd 2.4
2037 -.\" $Id: pppd-radius.8,v 1.4 2002/04/02 13:55:00 dfs Exp $
2038 +.\" $Id: pppd-radius.8,v 1.5 2004/03/26 13:27:17 kad Exp $
2039 .\" SH section heading
2040 .\" SS subsection heading
2041 .\" LP paragraph
2042 @@ -40,6 +40,15 @@
2043 used, then the plugin uses
2044 .I /etc/radiusclient/radiusclient.conf
2045 as the configuration file.
2046 +.TP
2047 +.BI "avpair " attribute=value
2048 +Adds an Attribute-Value pair to be passed on to the RADIUS server on each request.
2049 +.TP
2050 +.BI map-to-ifname
2051 +Sets Radius NAS-Port attribute to number equal to interface name (Default)
2052 +.TP
2053 +.BI map-to-ttyname
2054 +Sets Radius NAS-Port attribute value via libradiusclient library
2055
2056 .SH USAGE
2057 To use the plugin, simply supply the
2058 diff -ruN ppp-2.4.2/pppd/plugins/radius/radius.c ppp-cvs-20040427/pppd/plugins/radius/radius.c
2059 --- ppp-2.4.2/pppd/plugins/radius/radius.c 2004-01-13 03:26:11.000000000 +0100
2060 +++ ppp-cvs-20040427/pppd/plugins/radius/radius.c 2004-04-12 07:20:16.000000000 +0200
2061 @@ -24,7 +24,7 @@
2062 *
2063 ***********************************************************************/
2064 static char const RCSID[] =
2065 -"$Id: radius.c,v 1.22 2004/01/11 08:01:30 paulus Exp $";
2066 +"$Id: radius.c,v 1.25 2004/04/12 05:16:37 kad Exp $";
2067
2068 #include "pppd.h"
2069 #include "chap-new.h"
2070 @@ -52,10 +52,15 @@
2071 char *vpstr;
2072 struct avpopt *next;
2073 } *avpopt = NULL;
2074 +static bool portnummap = 0;
2075
2076 static option_t Options[] = {
2077 { "radius-config-file", o_string, &config_file },
2078 { "avpair", o_special, add_avp },
2079 + { "map-to-ttyname", o_bool, &portnummap,
2080 + "Set Radius NAS-Port attribute value via libradiusclient library", OPT_PRIO | 1 },
2081 + { "map-to-ifname", o_bool, &portnummap,
2082 + "Set Radius NAS-Port attribute to number as in interface name (Default)", OPT_PRIOSUB | 0 },
2083 { NULL }
2084 };
2085
2086 @@ -264,7 +269,7 @@
2087
2088 /* Hack... the "port" is the ppp interface number. Should really be
2089 the tty */
2090 - rstate.client_port = get_client_port(ifname);
2091 + rstate.client_port = get_client_port(portnummap ? devnam : ifname);
2092
2093 av_type = PW_FRAMED;
2094 rc_avpair_add(&send, PW_SERVICE_TYPE, &av_type, 0, VENDOR_NONE);
2095 @@ -363,7 +368,7 @@
2096 /* Put user with potentially realm added in rstate.user */
2097 if (!rstate.done_chap_once) {
2098 make_username_realm(user);
2099 - rstate.client_port = get_client_port (ifname);
2100 + rstate.client_port = get_client_port (portnummap ? devnam : ifname);
2101 if (radius_pre_auth_hook) {
2102 radius_pre_auth_hook(rstate.user,
2103 &rstate.authserver,
2104 @@ -881,7 +886,7 @@
2105 rc_avpair_add(&send, PW_ACCT_AUTHENTIC, &av_type, 0, VENDOR_NONE);
2106
2107
2108 - av_type = PW_ASYNC;
2109 + av_type = ( using_pty ? PW_VIRTUAL : ( sync_serial ? PW_SYNC : PW_ASYNC ) );
2110 rc_avpair_add(&send, PW_NAS_PORT_TYPE, &av_type, 0, VENDOR_NONE);
2111
2112 hisaddr = ho->hisaddr;
2113 @@ -981,9 +986,56 @@
2114 remote_number, 0, VENDOR_NONE);
2115 }
2116
2117 - av_type = PW_ASYNC;
2118 + av_type = ( using_pty ? PW_VIRTUAL : ( sync_serial ? PW_SYNC : PW_ASYNC ) );
2119 rc_avpair_add(&send, PW_NAS_PORT_TYPE, &av_type, 0, VENDOR_NONE);
2120
2121 + av_type = PW_NAS_ERROR;
2122 + switch( status ) {
2123 + case EXIT_OK:
2124 + case EXIT_USER_REQUEST:
2125 + av_type = PW_USER_REQUEST;
2126 + break;
2127 +
2128 + case EXIT_HANGUP:
2129 + case EXIT_PEER_DEAD:
2130 + case EXIT_CONNECT_FAILED:
2131 + av_type = PW_LOST_CARRIER;
2132 + break;
2133 +
2134 + case EXIT_INIT_FAILED:
2135 + case EXIT_OPEN_FAILED:
2136 + case EXIT_LOCK_FAILED:
2137 + case EXIT_PTYCMD_FAILED:
2138 + av_type = PW_PORT_ERROR;
2139 + break;
2140 +
2141 + case EXIT_PEER_AUTH_FAILED:
2142 + case EXIT_AUTH_TOPEER_FAILED:
2143 + case EXIT_NEGOTIATION_FAILED:
2144 + case EXIT_CNID_AUTH_FAILED:
2145 + av_type = PW_SERVICE_UNAVAILABLE;
2146 + break;
2147 +
2148 + case EXIT_IDLE_TIMEOUT:
2149 + av_type = PW_ACCT_IDLE_TIMEOUT;
2150 + break;
2151 +
2152 + case EXIT_CONNECT_TIME:
2153 + av_type = PW_ACCT_SESSION_TIMEOUT;
2154 + break;
2155 +
2156 +#ifdef MAXOCTETS
2157 + case EXIT_TRAFFIC_LIMIT:
2158 + av_type = PW_NAS_REQUEST;
2159 + break;
2160 +#endif
2161 +
2162 + default:
2163 + av_type = PW_NAS_ERROR;
2164 + break;
2165 + }
2166 + rc_avpair_add(&send, PW_ACCT_TERMINATE_CAUSE, &av_type, 0, VENDOR_NONE);
2167 +
2168 hisaddr = ho->hisaddr;
2169 av_type = htonl(hisaddr);
2170 rc_avpair_add(&send, PW_FRAMED_IP_ADDRESS , &av_type , 0, VENDOR_NONE);
2171 @@ -1077,7 +1129,7 @@
2172 remote_number, 0, VENDOR_NONE);
2173 }
2174
2175 - av_type = PW_ASYNC;
2176 + av_type = ( using_pty ? PW_VIRTUAL : ( sync_serial ? PW_SYNC : PW_ASYNC ) );
2177 rc_avpair_add(&send, PW_NAS_PORT_TYPE, &av_type, 0, VENDOR_NONE);
2178
2179 hisaddr = ho->hisaddr;
2180 diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/CVS/Entries ppp-cvs-20040427/pppd/plugins/radius/radiusclient/CVS/Entries
2181 --- ppp-2.4.2/pppd/plugins/radius/radiusclient/CVS/Entries 2002-09-07 12:37:54.000000000 +0200
2182 +++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/CVS/Entries 1970-01-01 01:00:00.000000000 +0100
2183 @@ -1,28 +0,0 @@
2184 -/BUGS/1.1/Tue Jan 22 16:03:00 2002//
2185 -/CHANGES/1.1/Tue Jan 22 16:03:00 2002//
2186 -/COPYRIGHT/1.1/Tue Jan 22 16:03:00 2002//
2187 -/Makefile.am/1.1/Tue Jan 22 16:03:00 2002//
2188 -/Makefile.in/1.1/Tue Jan 22 16:03:00 2002//
2189 -/README/1.1/Tue Jan 22 16:03:00 2002//
2190 -/README.radexample/1.1/Tue Jan 22 16:03:00 2002//
2191 -/acconfig.h/1.1/Tue Jan 22 16:03:00 2002//
2192 -/aclocal.m4/1.2/Mon Jun 24 12:57:15 2002//
2193 -/config.guess/1.1/Tue Jan 22 16:03:00 2002//
2194 -/config.h.in/1.3/Thu Jul 25 16:29:16 2002//
2195 -/config.sub/1.1/Tue Jan 22 16:03:00 2002//
2196 -/configure/1.1/Tue Jan 22 16:03:00 2002//
2197 -/configure.in/1.1/Tue Jan 22 16:03:00 2002//
2198 -/install-sh/1.1/Tue Jan 22 16:03:00 2002//
2199 -/ltconfig/1.1/Tue Jan 22 16:03:00 2002//
2200 -/ltmain.sh/1.1/Tue Jan 22 16:03:00 2002//
2201 -/missing/1.1/Tue Jan 22 16:03:00 2002//
2202 -/mkinstalldirs/1.1/Tue Jan 22 16:03:00 2002//
2203 -/stamp-h.in/1.1/Tue Jan 22 16:03:00 2002//
2204 -D/doc////
2205 -D/etc////
2206 -D/include////
2207 -D/lib////
2208 -D/login.radius////
2209 -D/man////
2210 -D/patches////
2211 -D/src////
2212 diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/CVS/Repository ppp-cvs-20040427/pppd/plugins/radius/radiusclient/CVS/Repository
2213 --- ppp-2.4.2/pppd/plugins/radius/radiusclient/CVS/Repository 2002-09-07 12:37:51.000000000 +0200
2214 +++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/CVS/Repository 1970-01-01 01:00:00.000000000 +0100
2215 @@ -1 +0,0 @@
2216 -ppp/pppd/plugins/radius/radiusclient
2217 diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/CVS/Root ppp-cvs-20040427/pppd/plugins/radius/radiusclient/CVS/Root
2218 --- ppp-2.4.2/pppd/plugins/radius/radiusclient/CVS/Root 2002-09-07 12:37:51.000000000 +0200
2219 +++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/CVS/Root 1970-01-01 01:00:00.000000000 +0100
2220 @@ -1 +0,0 @@
2221 -samba.org:/data/cvs
2222 diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/doc/CVS/Entries ppp-cvs-20040427/pppd/plugins/radius/radiusclient/doc/CVS/Entries
2223 --- ppp-2.4.2/pppd/plugins/radius/radiusclient/doc/CVS/Entries 2002-09-07 12:37:52.000000000 +0200
2224 +++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/doc/CVS/Entries 1970-01-01 01:00:00.000000000 +0100
2225 @@ -1,4 +0,0 @@
2226 -/Makefile.am/1.1/Tue Jan 22 16:03:01 2002//
2227 -/Makefile.in/1.1/Tue Jan 22 16:03:01 2002//
2228 -/instop.html/1.1/Tue Jan 22 16:03:01 2002//
2229 -D
2230 diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/doc/CVS/Repository ppp-cvs-20040427/pppd/plugins/radius/radiusclient/doc/CVS/Repository
2231 --- ppp-2.4.2/pppd/plugins/radius/radiusclient/doc/CVS/Repository 2002-09-07 12:37:52.000000000 +0200
2232 +++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/doc/CVS/Repository 1970-01-01 01:00:00.000000000 +0100
2233 @@ -1 +0,0 @@
2234 -ppp/pppd/plugins/radius/radiusclient/doc
2235 diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/doc/CVS/Root ppp-cvs-20040427/pppd/plugins/radius/radiusclient/doc/CVS/Root
2236 --- ppp-2.4.2/pppd/plugins/radius/radiusclient/doc/CVS/Root 2002-09-07 12:37:52.000000000 +0200
2237 +++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/doc/CVS/Root 1970-01-01 01:00:00.000000000 +0100
2238 @@ -1 +0,0 @@
2239 -samba.org:/data/cvs
2240 diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/etc/CVS/Entries ppp-cvs-20040427/pppd/plugins/radius/radiusclient/etc/CVS/Entries
2241 --- ppp-2.4.2/pppd/plugins/radius/radiusclient/etc/CVS/Entries 2002-11-09 12:24:42.000000000 +0100
2242 +++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/etc/CVS/Entries 1970-01-01 01:00:00.000000000 +0100
2243 @@ -1,13 +0,0 @@
2244 -/dictionary.ascend/1.1/Tue Jan 22 16:03:01 2002//
2245 -/dictionary.compat/1.1/Tue Jan 22 16:03:01 2002//
2246 -/dictionary.merit/1.1/Tue Jan 22 16:03:01 2002//
2247 -/dictionary.microsoft/1.1/Wed Mar 6 13:23:09 2002//
2248 -/issue/1.1/Tue Jan 22 16:03:01 2002//
2249 -/port-id-map/1.1/Tue Jan 22 16:03:01 2002//
2250 -/servers/1.1/Tue Jan 22 16:03:01 2002//
2251 -/Makefile.am/1.4/Sat Nov 9 11:24:42 2002//
2252 -/Makefile.in/1.5/Sat Nov 9 11:24:42 2002//
2253 -/dictionary/1.9/Sat Nov 9 11:24:42 2002//
2254 -/radiusclient.conf.in/1.2/Sat Nov 9 11:24:42 2002//
2255 -/realms/1.1/Sat Oct 5 04:35:24 2002//
2256 -D
2257 diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/etc/CVS/Repository ppp-cvs-20040427/pppd/plugins/radius/radiusclient/etc/CVS/Repository
2258 --- ppp-2.4.2/pppd/plugins/radius/radiusclient/etc/CVS/Repository 2002-09-07 12:37:52.000000000 +0200
2259 +++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/etc/CVS/Repository 1970-01-01 01:00:00.000000000 +0100
2260 @@ -1 +0,0 @@
2261 -ppp/pppd/plugins/radius/radiusclient/etc
2262 diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/etc/CVS/Root ppp-cvs-20040427/pppd/plugins/radius/radiusclient/etc/CVS/Root
2263 --- ppp-2.4.2/pppd/plugins/radius/radiusclient/etc/CVS/Root 2002-09-07 12:37:52.000000000 +0200
2264 +++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/etc/CVS/Root 1970-01-01 01:00:00.000000000 +0100
2265 @@ -1 +0,0 @@
2266 -samba.org:/data/cvs
2267 diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/include/CVS/Entries ppp-cvs-20040427/pppd/plugins/radius/radiusclient/include/CVS/Entries
2268 --- ppp-2.4.2/pppd/plugins/radius/radiusclient/include/CVS/Entries 2002-12-04 22:49:09.000000000 +0100
2269 +++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/include/CVS/Entries 1970-01-01 01:00:00.000000000 +0100
2270 @@ -1,7 +0,0 @@
2271 -/Makefile.am/1.1/Tue Jan 22 16:03:01 2002//
2272 -/Makefile.in/1.1/Tue Jan 22 16:03:01 2002//
2273 -/includes.h/1.2/Wed Feb 27 15:51:19 2002//
2274 -/messages.h/1.2/Wed Feb 27 15:51:19 2002//
2275 -/pathnames.h/1.2/Wed Feb 27 15:51:19 2002//
2276 -/radiusclient.h/1.9/Wed Dec 4 21:49:09 2002//
2277 -D
2278 diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/include/CVS/Repository ppp-cvs-20040427/pppd/plugins/radius/radiusclient/include/CVS/Repository
2279 --- ppp-2.4.2/pppd/plugins/radius/radiusclient/include/CVS/Repository 2002-09-07 12:37:52.000000000 +0200
2280 +++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/include/CVS/Repository 1970-01-01 01:00:00.000000000 +0100
2281 @@ -1 +0,0 @@
2282 -ppp/pppd/plugins/radius/radiusclient/include
2283 diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/include/CVS/Root ppp-cvs-20040427/pppd/plugins/radius/radiusclient/include/CVS/Root
2284 --- ppp-2.4.2/pppd/plugins/radius/radiusclient/include/CVS/Root 2002-09-07 12:37:52.000000000 +0200
2285 +++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/include/CVS/Root 1970-01-01 01:00:00.000000000 +0100
2286 @@ -1 +0,0 @@
2287 -samba.org:/data/cvs
2288 diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/lib/CVS/Entries ppp-cvs-20040427/pppd/plugins/radius/radiusclient/lib/CVS/Entries
2289 --- ppp-2.4.2/pppd/plugins/radius/radiusclient/lib/CVS/Entries 2002-12-04 22:49:09.000000000 +0100
2290 +++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/lib/CVS/Entries 1970-01-01 01:00:00.000000000 +0100
2291 @@ -1,20 +0,0 @@
2292 -/Makefile.am/1.1/Tue Jan 22 16:03:02 2002//
2293 -/Makefile.in/1.2/Wed Feb 20 02:22:35 2002//
2294 -/clientid.c/1.2/Wed Feb 27 15:51:20 2002//
2295 -/dict.c/1.2/Tue Mar 5 15:14:06 2002//
2296 -/env.c/1.2/Wed Feb 27 15:51:20 2002//
2297 -/ip_util.c/1.2/Wed Feb 27 15:51:20 2002//
2298 -/lock.c/1.2/Wed Feb 27 15:51:20 2002//
2299 -/log.c/1.2/Wed Feb 27 15:51:20 2002//
2300 -/md5.c/1.2/Wed Feb 27 15:51:20 2002//
2301 -/memcmp.c/1.2/Wed Feb 27 15:51:20 2002//
2302 -/sendserver.c/1.4/Tue Apr 2 14:09:35 2002//
2303 -/strcasecmp.c/1.2/Wed Feb 27 15:51:20 2002//
2304 -/strdup.c/1.2/Wed Feb 27 15:51:20 2002//
2305 -/strerror.c/1.2/Wed Feb 27 15:51:20 2002//
2306 -/util.c/1.2/Wed Feb 27 15:51:20 2002//
2307 -/buildreq.c/1.4/Sat Nov 9 11:24:43 2002//
2308 -/config.c/1.3/Sat Nov 9 11:24:43 2002//
2309 -/options.h/1.2/Sat Nov 9 11:24:43 2002//
2310 -/avpair.c/1.3/Wed Dec 4 21:49:09 2002//
2311 -D
2312 diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/lib/CVS/Repository ppp-cvs-20040427/pppd/plugins/radius/radiusclient/lib/CVS/Repository
2313 --- ppp-2.4.2/pppd/plugins/radius/radiusclient/lib/CVS/Repository 2002-09-07 12:37:53.000000000 +0200
2314 +++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/lib/CVS/Repository 1970-01-01 01:00:00.000000000 +0100
2315 @@ -1 +0,0 @@
2316 -ppp/pppd/plugins/radius/radiusclient/lib
2317 diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/lib/CVS/Root ppp-cvs-20040427/pppd/plugins/radius/radiusclient/lib/CVS/Root
2318 --- ppp-2.4.2/pppd/plugins/radius/radiusclient/lib/CVS/Root 2002-09-07 12:37:53.000000000 +0200
2319 +++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/lib/CVS/Root 1970-01-01 01:00:00.000000000 +0100
2320 @@ -1 +0,0 @@
2321 -samba.org:/data/cvs
2322 diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/login.radius/CVS/Entries ppp-cvs-20040427/pppd/plugins/radius/radiusclient/login.radius/CVS/Entries
2323 --- ppp-2.4.2/pppd/plugins/radius/radiusclient/login.radius/CVS/Entries 2002-09-07 12:37:54.000000000 +0200
2324 +++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/login.radius/CVS/Entries 1970-01-01 01:00:00.000000000 +0100
2325 @@ -1,5 +0,0 @@
2326 -/Makefile.am/1.1/Tue Jan 22 16:03:02 2002//
2327 -/Makefile.in/1.1/Tue Jan 22 16:03:02 2002//
2328 -/README/1.1/Tue Jan 22 16:03:02 2002//
2329 -/login.radius/1.1/Tue Jan 22 16:03:02 2002//
2330 -D/migs////
2331 diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/login.radius/CVS/Repository ppp-cvs-20040427/pppd/plugins/radius/radiusclient/login.radius/CVS/Repository
2332 --- ppp-2.4.2/pppd/plugins/radius/radiusclient/login.radius/CVS/Repository 2002-09-07 12:37:53.000000000 +0200
2333 +++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/login.radius/CVS/Repository 1970-01-01 01:00:00.000000000 +0100
2334 @@ -1 +0,0 @@
2335 -ppp/pppd/plugins/radius/radiusclient/login.radius
2336 diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/login.radius/CVS/Root ppp-cvs-20040427/pppd/plugins/radius/radiusclient/login.radius/CVS/Root
2337 --- ppp-2.4.2/pppd/plugins/radius/radiusclient/login.radius/CVS/Root 2002-09-07 12:37:53.000000000 +0200
2338 +++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/login.radius/CVS/Root 1970-01-01 01:00:00.000000000 +0100
2339 @@ -1 +0,0 @@
2340 -samba.org:/data/cvs
2341 diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/login.radius/migs/CVS/Entries ppp-cvs-20040427/pppd/plugins/radius/radiusclient/login.radius/migs/CVS/Entries
2342 --- ppp-2.4.2/pppd/plugins/radius/radiusclient/login.radius/migs/CVS/Entries 2002-09-07 12:37:53.000000000 +0200
2343 +++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/login.radius/migs/CVS/Entries 1970-01-01 01:00:00.000000000 +0100
2344 @@ -1,7 +0,0 @@
2345 -/Makefile.am/1.1/Tue Jan 22 16:03:02 2002//
2346 -/Makefile.in/1.1/Tue Jan 22 16:03:02 2002//
2347 -/README/1.1/Tue Jan 22 16:03:02 2002//
2348 -/ip-down/1.1/Tue Jan 22 16:03:02 2002//
2349 -/ip-up/1.1/Tue Jan 22 16:03:02 2002//
2350 -/login.radius/1.1/Tue Jan 22 16:03:02 2002//
2351 -D
2352 diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/login.radius/migs/CVS/Repository ppp-cvs-20040427/pppd/plugins/radius/radiusclient/login.radius/migs/CVS/Repository
2353 --- ppp-2.4.2/pppd/plugins/radius/radiusclient/login.radius/migs/CVS/Repository 2002-09-07 12:37:53.000000000 +0200
2354 +++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/login.radius/migs/CVS/Repository 1970-01-01 01:00:00.000000000 +0100
2355 @@ -1 +0,0 @@
2356 -ppp/pppd/plugins/radius/radiusclient/login.radius/migs
2357 diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/login.radius/migs/CVS/Root ppp-cvs-20040427/pppd/plugins/radius/radiusclient/login.radius/migs/CVS/Root
2358 --- ppp-2.4.2/pppd/plugins/radius/radiusclient/login.radius/migs/CVS/Root 2002-09-07 12:37:53.000000000 +0200
2359 +++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/login.radius/migs/CVS/Root 1970-01-01 01:00:00.000000000 +0100
2360 @@ -1 +0,0 @@
2361 -samba.org:/data/cvs
2362 diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/man/CVS/Entries ppp-cvs-20040427/pppd/plugins/radius/radiusclient/man/CVS/Entries
2363 --- ppp-2.4.2/pppd/plugins/radius/radiusclient/man/CVS/Entries 2002-09-07 12:37:53.000000000 +0200
2364 +++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/man/CVS/Entries 1970-01-01 01:00:00.000000000 +0100
2365 @@ -1,3 +0,0 @@
2366 -/Makefile.am/1.1/Tue Jan 22 16:03:02 2002//
2367 -/Makefile.in/1.1/Tue Jan 22 16:03:02 2002//
2368 -D
2369 diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/man/CVS/Repository ppp-cvs-20040427/pppd/plugins/radius/radiusclient/man/CVS/Repository
2370 --- ppp-2.4.2/pppd/plugins/radius/radiusclient/man/CVS/Repository 2002-09-07 12:37:53.000000000 +0200
2371 +++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/man/CVS/Repository 1970-01-01 01:00:00.000000000 +0100
2372 @@ -1 +0,0 @@
2373 -ppp/pppd/plugins/radius/radiusclient/man
2374 diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/man/CVS/Root ppp-cvs-20040427/pppd/plugins/radius/radiusclient/man/CVS/Root
2375 --- ppp-2.4.2/pppd/plugins/radius/radiusclient/man/CVS/Root 2002-09-07 12:37:53.000000000 +0200
2376 +++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/man/CVS/Root 1970-01-01 01:00:00.000000000 +0100
2377 @@ -1 +0,0 @@
2378 -samba.org:/data/cvs
2379 diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/patches/CVS/Entries ppp-cvs-20040427/pppd/plugins/radius/radiusclient/patches/CVS/Entries
2380 --- ppp-2.4.2/pppd/plugins/radius/radiusclient/patches/CVS/Entries 2002-09-07 12:37:53.000000000 +0200
2381 +++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/patches/CVS/Entries 1970-01-01 01:00:00.000000000 +0100
2382 @@ -1,7 +0,0 @@
2383 -/Makefile.am/1.1/Tue Jan 22 16:03:03 2002//
2384 -/Makefile.in/1.1/Tue Jan 22 16:03:03 2002//
2385 -/README/1.1/Tue Jan 22 16:03:03 2002//
2386 -/merit-2.4.21-CHAP.diff/1.1/Tue Jan 22 16:03:04 2002//
2387 -/radiusd-1.16.accounting.diff/1.1/Tue Jan 22 16:03:04 2002//
2388 -/radiusd-1.16.shadow.diff/1.1/Tue Jan 22 16:03:04 2002//
2389 -D
2390 diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/patches/CVS/Repository ppp-cvs-20040427/pppd/plugins/radius/radiusclient/patches/CVS/Repository
2391 --- ppp-2.4.2/pppd/plugins/radius/radiusclient/patches/CVS/Repository 2002-09-07 12:37:53.000000000 +0200
2392 +++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/patches/CVS/Repository 1970-01-01 01:00:00.000000000 +0100
2393 @@ -1 +0,0 @@
2394 -ppp/pppd/plugins/radius/radiusclient/patches
2395 diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/patches/CVS/Root ppp-cvs-20040427/pppd/plugins/radius/radiusclient/patches/CVS/Root
2396 --- ppp-2.4.2/pppd/plugins/radius/radiusclient/patches/CVS/Root 2002-09-07 12:37:53.000000000 +0200
2397 +++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/patches/CVS/Root 1970-01-01 01:00:00.000000000 +0100
2398 @@ -1 +0,0 @@
2399 -samba.org:/data/cvs
2400 diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/src/CVS/Entries ppp-cvs-20040427/pppd/plugins/radius/radiusclient/src/CVS/Entries
2401 --- ppp-2.4.2/pppd/plugins/radius/radiusclient/src/CVS/Entries 2002-09-07 12:37:53.000000000 +0200
2402 +++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/src/CVS/Entries 1970-01-01 01:00:00.000000000 +0100
2403 @@ -1,11 +0,0 @@
2404 -/Makefile.am/1.1/Tue Jan 22 16:03:04 2002//
2405 -/Makefile.in/1.1/Tue Jan 22 16:03:04 2002//
2406 -/local.c/1.1/Tue Jan 22 16:03:04 2002//
2407 -/radacct.c/1.1/Tue Jan 22 16:03:04 2002//
2408 -/radexample-debug/1.1/Tue Jan 22 16:03:04 2002//
2409 -/radexample.c/1.2/Tue Apr 2 14:09:35 2002//
2410 -/radius.c/1.2/Tue Apr 2 14:09:35 2002//
2411 -/radlogin.c/1.1/Tue Jan 22 16:03:04 2002//
2412 -/radlogin.h/1.1/Tue Jan 22 16:03:05 2002//
2413 -/radstatus.c/1.1/Tue Jan 22 16:03:05 2002//
2414 -D
2415 diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/src/CVS/Repository ppp-cvs-20040427/pppd/plugins/radius/radiusclient/src/CVS/Repository
2416 --- ppp-2.4.2/pppd/plugins/radius/radiusclient/src/CVS/Repository 2002-09-07 12:37:53.000000000 +0200
2417 +++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/src/CVS/Repository 1970-01-01 01:00:00.000000000 +0100
2418 @@ -1 +0,0 @@
2419 -ppp/pppd/plugins/radius/radiusclient/src
2420 diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/src/CVS/Root ppp-cvs-20040427/pppd/plugins/radius/radiusclient/src/CVS/Root
2421 --- ppp-2.4.2/pppd/plugins/radius/radiusclient/src/CVS/Root 2002-09-07 12:37:53.000000000 +0200
2422 +++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/src/CVS/Root 1970-01-01 01:00:00.000000000 +0100
2423 @@ -1 +0,0 @@
2424 -samba.org:/data/cvs
2425 diff -ruN ppp-2.4.2/pppd/plugins/rp-pppoe/CVS/Entries ppp-cvs-20040427/pppd/plugins/rp-pppoe/CVS/Entries
2426 --- ppp-2.4.2/pppd/plugins/rp-pppoe/CVS/Entries 2002-09-07 12:37:54.000000000 +0200
2427 +++ ppp-cvs-20040427/pppd/plugins/rp-pppoe/CVS/Entries 1970-01-01 01:00:00.000000000 +0100
2428 @@ -1,9 +0,0 @@
2429 -/Makefile.linux/1.1/Fri Dec 14 02:55:20 2001//
2430 -/common.c/1.1/Fri Dec 14 02:55:20 2001//
2431 -/config.h/1.1/Fri Dec 14 02:55:20 2001//
2432 -/debug.c/1.1/Fri Dec 14 02:55:20 2001//
2433 -/discovery.c/1.1/Fri Dec 14 02:55:20 2001//
2434 -/if.c/1.1/Fri Dec 14 02:55:20 2001//
2435 -/plugin.c/1.7/Tue Apr 2 13:11:00 2002//
2436 -/pppoe.h/1.1/Fri Dec 14 02:55:20 2001//
2437 -D
2438 diff -ruN ppp-2.4.2/pppd/plugins/rp-pppoe/CVS/Repository ppp-cvs-20040427/pppd/plugins/rp-pppoe/CVS/Repository
2439 --- ppp-2.4.2/pppd/plugins/rp-pppoe/CVS/Repository 2002-09-07 12:37:53.000000000 +0200
2440 +++ ppp-cvs-20040427/pppd/plugins/rp-pppoe/CVS/Repository 1970-01-01 01:00:00.000000000 +0100
2441 @@ -1 +0,0 @@
2442 -ppp/pppd/plugins/rp-pppoe
2443 diff -ruN ppp-2.4.2/pppd/plugins/rp-pppoe/CVS/Root ppp-cvs-20040427/pppd/plugins/rp-pppoe/CVS/Root
2444 --- ppp-2.4.2/pppd/plugins/rp-pppoe/CVS/Root 2002-09-07 12:37:53.000000000 +0200
2445 +++ ppp-cvs-20040427/pppd/plugins/rp-pppoe/CVS/Root 1970-01-01 01:00:00.000000000 +0100
2446 @@ -1 +0,0 @@
2447 -samba.org:/data/cvs
2448 diff -ruN ppp-2.4.2/pppd/plugins/rp-pppoe/Makefile ppp-cvs-20040427/pppd/plugins/rp-pppoe/Makefile
2449 --- ppp-2.4.2/pppd/plugins/rp-pppoe/Makefile 2004-01-13 04:57:55.000000000 +0100
2450 +++ ppp-cvs-20040427/pppd/plugins/rp-pppoe/Makefile 1970-01-01 01:00:00.000000000 +0100
2451 @@ -1,50 +0,0 @@
2452 -# Generated automatically from Makefile.in by configure.
2453 -#***********************************************************************
2454 -#
2455 -# Makefile
2456 -#
2457 -# Makefile for Roaring Penguin's Linux PPPoE plugin.
2458 -#
2459 -# Copyright (C) 2001 Roaring Penguin Software Inc.
2460 -#
2461 -# This program may be distributed according to the terms of the GNU
2462 -# General Public License, version 2 or (at your option) any later version.
2463 -#
2464 -# $Id: Makefile.linux,v 1.2 2004/01/13 03:57:55 paulus Exp $
2465 -#***********************************************************************
2466 -
2467 -# Version is set ONLY IN THE MAKEFILE! Don't delete this!
2468 -VERSION=3.3
2469 -
2470 -COPTS=-O2 -g
2471 -CFLAGS=$(COPTS) -I../../../include/linux
2472 -all: rp-pppoe.so
2473 -
2474 -rp-pppoe.so: libplugin.a plugin.o
2475 - gcc -o rp-pppoe.so -shared plugin.o libplugin.a
2476 -
2477 -install: all
2478 - $(INSTALL) -d -m 755 $(LIBDIR)
2479 - $(INSTALL) -s -c -m 4550 rp-pppoe.so $(LIBDIR)
2480 -
2481 -clean:
2482 - rm -f *.o *.so
2483 -
2484 -plugin.o: plugin.c
2485 - gcc '-DRP_VERSION="$(VERSION)"' $(CFLAGS) -I../../.. -c -o plugin.o -fPIC plugin.c
2486 -
2487 -libplugin.a: discovery.o if.o common.o debug.o
2488 - ar -rc $@ $^
2489 -
2490 -discovery.o: discovery.c
2491 - gcc $(CFLAGS) '-DVERSION="$(VERSION)"' -c -o discovery.o -fPIC discovery.c
2492 -
2493 -if.o: if.c
2494 - gcc $(CFLAGS) '-DVERSION="$(VERSION)"' -c -o if.o -fPIC if.c
2495 -
2496 -debug.o: debug.c
2497 - gcc $(CFLAGS) '-DVERSION="$(VERSION)"' -c -o debug.o -fPIC debug.c
2498 -
2499 -common.o: common.c
2500 - gcc $(CFLAGS) '-DVERSION="$(VERSION)"' -c -o common.o -fPIC common.c
2501 -
2502 diff -ruN ppp-2.4.2/pppd/pppd.8 ppp-cvs-20040427/pppd/pppd.8
2503 --- ppp-2.4.2/pppd/pppd.8 2004-01-15 06:09:00.000000000 +0100
2504 +++ ppp-cvs-20040427/pppd/pppd.8 2004-04-27 20:25:12.000000000 +0200
2505 @@ -1,5 +1,5 @@
2506 .\" manual page [] for pppd 2.4
2507 -.\" $Id: pppd.8,v 1.76 2004/01/15 05:09:00 paulus Exp $
2508 +.\" $Id: pppd.8,v 1.77 2004/04/27 18:22:58 fcusack Exp $
2509 .\" SH section heading
2510 .\" SS subsection heading
2511 .\" LP paragraph
2512 @@ -955,11 +955,11 @@
2513 Require the use of MPPE, with 128\-bit encryption.
2514 .TP
2515 .B require-mschap
2516 -Require the peer to authenticate itself using MS-CHAP [Microsft Challenge
2517 +Require the peer to authenticate itself using MS-CHAP [Microsoft Challenge
2518 Handshake Authentication Protocol] authentication.
2519 .TP
2520 .B require-mschap-v2
2521 -Require the peer to authenticate itself using MS-CHAPv2 [Microsft Challenge
2522 +Require the peer to authenticate itself using MS-CHAPv2 [Microsoft Challenge
2523 Handshake Authentication Protocol, Version 2] authentication.
2524 .TP
2525 .B require-eap
2526 diff -ruN ppp-2.4.2/pppd/tty.c ppp-cvs-20040427/pppd/tty.c
2527 --- ppp-2.4.2/pppd/tty.c 2004-01-13 05:17:59.000000000 +0100
2528 +++ ppp-cvs-20040427/pppd/tty.c 2004-01-17 06:50:12.000000000 +0100
2529 @@ -73,7 +73,7 @@
2530 * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
2531 */
2532
2533 -#define RCSID "$Id: tty.c,v 1.13 2004/01/13 04:17:59 paulus Exp $"
2534 +#define RCSID "$Id: tty.c,v 1.14 2004/01/17 05:47:55 carlsonj Exp $"
2535
2536 #include <stdio.h>
2537 #include <ctype.h>
2538 @@ -512,7 +512,9 @@
2539 {
2540 char *connector;
2541 int fdflags;
2542 +#ifndef __linux__
2543 struct stat statbuf;
2544 +#endif
2545 char numbuf[16];
2546
2547 /*
2548 diff -ruN ppp-2.4.2/pppdump/bsd-comp.c ppp-cvs-20040427/pppdump/bsd-comp.c
2549 --- ppp-2.4.2/pppdump/bsd-comp.c 1999-04-16 13:34:42.000000000 +0200
2550 +++ ppp-cvs-20040427/pppdump/bsd-comp.c 2004-01-17 06:50:12.000000000 +0100
2551 @@ -38,12 +38,14 @@
2552 */
2553
2554 /*
2555 - * $Id: bsd-comp.c,v 1.3 1999/04/16 11:35:59 paulus Exp $
2556 + * $Id: bsd-comp.c,v 1.4 2004/01/17 05:47:55 carlsonj Exp $
2557 */
2558
2559 #include <sys/types.h>
2560 +#include <stdio.h>
2561 #include <stddef.h>
2562 #include <stdlib.h>
2563 +#include <string.h>
2564 #include "ppp_defs.h"
2565 #include "ppp-comp.h"
2566
2567 diff -ruN ppp-2.4.2/pppdump/deflate.c ppp-cvs-20040427/pppdump/deflate.c
2568 --- ppp-2.4.2/pppdump/deflate.c 2002-12-06 10:49:16.000000000 +0100
2569 +++ ppp-cvs-20040427/pppdump/deflate.c 2004-01-17 06:50:12.000000000 +0100
2570 @@ -33,12 +33,14 @@
2571 * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
2572 * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
2573 *
2574 - * $Id: deflate.c,v 1.4 2002/12/06 09:49:16 paulus Exp $
2575 + * $Id: deflate.c,v 1.5 2004/01/17 05:47:55 carlsonj Exp $
2576 */
2577
2578 #include <sys/types.h>
2579 +#include <stdio.h>
2580 #include <stddef.h>
2581 #include <stdlib.h>
2582 +#include <string.h>
2583 #include "ppp_defs.h"
2584 #include "ppp-comp.h"
2585 #include "zlib.h"
2586 diff -ruN ppp-2.4.2/pppdump/pppdump.c ppp-cvs-20040427/pppdump/pppdump.c
2587 --- ppp-2.4.2/pppdump/pppdump.c 2002-12-06 10:17:02.000000000 +0100
2588 +++ ppp-cvs-20040427/pppdump/pppdump.c 2004-01-17 06:50:12.000000000 +0100
2589 @@ -35,6 +35,7 @@
2590 */
2591 #include <stdio.h>
2592 #include <unistd.h>
2593 +#include <stdlib.h>
2594 #include <time.h>
2595 #include <sys/types.h>
2596 #include "ppp_defs.h"
2597 @@ -53,6 +54,12 @@
2598 extern int optind;
2599 extern char *optarg;
2600
2601 +void dumplog();
2602 +void dumpppp();
2603 +void show_time();
2604 +void handle_ccp();
2605 +
2606 +int
2607 main(ac, av)
2608 int ac;
2609 char **av;
2610 @@ -105,6 +112,7 @@
2611 exit(0);
2612 }
2613
2614 +void
2615 dumplog(f)
2616 FILE *f;
2617 {
2618 @@ -244,6 +252,7 @@
2619
2620 unsigned char dbuf[8192];
2621
2622 +void
2623 dumpppp(f)
2624 FILE *f;
2625 {
2626 @@ -429,6 +438,7 @@
2627 NULL
2628 };
2629
2630 +void
2631 handle_ccp(cp, dp, len)
2632 struct pkt *cp;
2633 u_char *dp;
2634 @@ -485,6 +495,7 @@
2635 }
2636 }
2637
2638 +void
2639 show_time(f, c)
2640 FILE *f;
2641 int c;
2642 diff -ruN ppp-2.4.2/scripts/callback ppp-cvs-20040427/scripts/callback
2643 --- ppp-2.4.2/scripts/callback 1995-08-09 04:49:51.000000000 +0200
2644 +++ ppp-cvs-20040427/scripts/callback 2004-04-12 07:30:11.000000000 +0200
2645 @@ -33,7 +33,7 @@
2646 ABORT '\nNO ANSWER\r' \
2647 ABORT '\nRINGING\r\n\r\nRINGING\r' \
2648 '' AT \
2649 - 'OK-+++\c-OK' 'AT&C0&D2S0=0H0 \
2650 + 'OK-+++\c-OK' 'AT&C0&D2S0=0H0' \
2651 TIMEOUT 30 \
2652 OK ATDT$TELEPHONE \
2653 CONNECT '' \
2654 diff -ruN ppp-2.4.2/scripts/ipv6-down.sample ppp-cvs-20040427/scripts/ipv6-down.sample
2655 --- ppp-2.4.2/scripts/ipv6-down.sample 1999-08-23 08:07:07.000000000 +0200
2656 +++ ppp-cvs-20040427/scripts/ipv6-down.sample 2004-04-12 07:45:18.000000000 +0200
2657 @@ -8,24 +8,24 @@
2658 # Kill the router advertisement daemon on this interface.
2659 # The killing procedure is copied from RedHat 6.0 initscripts.
2660
2661 -DEVICE=$1
2662 +DEVICE="$1"
2663
2664 -PIDFILE=/var/run/radvd-$DEVICE.pid
2665 +PIDFILE="/var/run/radvd-$DEVICE.pid"
2666
2667 -[ -f $PIDFILE ] || exit 0
2668 +[ -f "$PIDFILE" ] || exit 0
2669
2670 -PID=`cat $PIDFILE`
2671 +PID="$(cat "$PIDFILE")"
2672 if [ "$PID" != "" ]; then
2673 - if ps h $PID >/dev/null 2>&1; then
2674 - kill -TERM $PID
2675 + if ps h "$PID" >/dev/null 2>&1; then
2676 + kill -TERM "$PID"
2677 usleep 10000
2678 - if ps h $PID >/dev/null 2>&1; then
2679 + if ps h "$PID" >/dev/null 2>&1; then
2680 sleep 1
2681 - if ps h $PID >/dev/null 2>&1; then
2682 - kill -KILL $PID
2683 + if ps h "$PID" >/dev/null 2>&1; then
2684 + kill -KILL "$PID"
2685 fi
2686 fi
2687 fi
2688 fi
2689
2690 -rm -f $PIDFILE
2691 +rm -f "$PIDFILE"
2692 diff -ruN ppp-2.4.2/scripts/ipv6-up.sample ppp-cvs-20040427/scripts/ipv6-up.sample
2693 --- ppp-2.4.2/scripts/ipv6-up.sample 1999-08-23 08:07:07.000000000 +0200
2694 +++ ppp-cvs-20040427/scripts/ipv6-up.sample 2004-04-12 07:45:18.000000000 +0200
2695 @@ -8,26 +8,27 @@
2696 # Start router advertisements on this link.
2697 # Based on radvd 0.5.0 behaviour
2698
2699 -DEVICE=$1
2700 +DEVICE="$1"
2701
2702 -CFGFILE=/usr/inet6/etc/radvd.conf-$DEVICE
2703 -PIDFILE=/var/run/radvd-$DEVICE.pid
2704 +CFGFILE="/etc/radvd.conf-$DEVICE"
2705 +PIDFILE="/var/run/radvd-$DEVICE.pid"
2706 +EXEFILE="/usr/sbin/radvd"
2707
2708 -if [ -x /usr/inet6/sbin/radvd && -f $CFGFILE ]; then
2709 - touch $PIDFILE
2710 - if [ ! -f $PIDFILE ]; then
2711 +if [ -x "$EXEFILE" -a -f "$CFGFILE" ]; then
2712 + touch "$PIDFILE"
2713 + if [ ! -f "$PIDFILE" ]; then
2714 echo "error: $PIDFILE is not a regular file. Aborting"
2715 exit 0
2716 fi
2717
2718 - PID=`cat $PIDFILE`
2719 - if [ "$PID" != "" ]; then
2720 - ps h $PID >/dev/null 2>&1 && exit 0
2721 + PID="$(cat "$PIDFILE")"
2722 + if [ -n "$PID" ]; then
2723 + ps h "$PID" >/dev/null 2>&1 && exit 0
2724 fi
2725
2726 # radvd 0.5.0 doesn't write a pid-file so we do it here
2727 # enabling debugging keeps radvd in foreground, putting it
2728 # on background gives us the PID.
2729 - /usr/inet6/sbin/radvd -d 1 -C $CFGFILE &
2730 - echo $! >$PIDFILE
2731 + "$EXEFILE" -d 1 -C "$CFGFILE" &
2732 + echo $! >"$PIDFILE"
2733 fi
2734 diff -ruN ppp-2.4.2/scripts/pon ppp-cvs-20040427/scripts/pon
2735 --- ppp-2.4.2/scripts/pon 2002-11-25 00:30:44.000000000 +0100
2736 +++ ppp-cvs-20040427/scripts/pon 2004-04-12 07:45:18.000000000 +0200
2737 @@ -1,10 +1,12 @@
2738 #!/bin/sh
2739
2740 +PPP_ON_BOOT=/etc/ppp/ppp_on_boot
2741 +
2742 case "$1" in
2743 -*) echo "
2744 Usage: pon [provider] [arguments]
2745
2746 -If pon is invoked without arguments, /etc/ppp/ppp_on_boot file will be
2747 +If pon is invoked without arguments, $PPP_ON_BOOT file will be
2748 run, presuming it exists and is executable. Otherwise, a PPP connection
2749 will be started using settings from /etc/ppp/peers/provider.
2750 If you specify one argument, a PPP connection will be started using
2751 @@ -16,8 +18,8 @@
2752 ;;
2753 esac
2754
2755 -if [ -z "$1" -a -x /etc/ppp/ppp_on_boot ]; then
2756 - exec /etc/ppp/ppp_on_boot
2757 +if [ -z "$1" -a -x "$PPP_ON_BOOT" ]; then
2758 + exec "$PPP_ON_BOOT"
2759 fi
2760
2761 if [ -z "$1" -a ! -f /etc/ppp/peers/provider ]; then
2762 diff -ruN ppp-2.4.2/svr4/Makedefs ppp-cvs-20040427/svr4/Makedefs
2763 --- ppp-2.4.2/svr4/Makedefs 1970-01-01 01:00:00.000000000 +0100
2764 +++ ppp-cvs-20040427/svr4/Makedefs 2000-06-09 03:36:34.000000000 +0200
2765 @@ -0,0 +1,16 @@
2766 +#
2767 +# defines common to several Makefiles
2768 +#
2769 +
2770 +INSTALL= /usr/sbin/install
2771 +
2772 +BINDIR = /usr/local/bin
2773 +MANDIR = /usr/local/man
2774 +ETCDIR = /etc/ppp
2775 +
2776 +COPTS = -O -Xa
2777 +
2778 +# For compiling with gcc, comment out the COPTS definition above and
2779 +# uncomment the next 2 definitions.
2780 +#CC = gcc
2781 +#COPTS = -O2
2782 diff -ruN ppp-2.4.2/svr4/Makedefs.sol2 ppp-cvs-20040427/svr4/Makedefs.sol2
2783 --- ppp-2.4.2/svr4/Makedefs.sol2 1970-01-01 01:00:00.000000000 +0100
2784 +++ ppp-cvs-20040427/svr4/Makedefs.sol2 1999-09-21 22:50:31.000000000 +0200
2785 @@ -0,0 +1,59 @@
2786 +#
2787 +# Generic make definitions for Solaris 2
2788 +#
2789 +# $Id: Makedefs.sol2,v 1.3 1999/09/21 20:37:20 masputra Exp $
2790 +#
2791 +
2792 +include ../svr4/Makedefs
2793 +
2794 +CPPFLAGS = -D_KERNEL -DSVR4 -DSOL2 -DPRIOQ -DDEBUG -I../include
2795 +CFLAGS = $(CPPFLAGS) $(COPTS)
2796 +
2797 +# lint-specific variables
2798 +LINT = lint
2799 +LINT_OPT_32 =
2800 +LINT_OPT_64 = -Xarch=v9 -errchk=longptr64
2801 +
2802 +LINT_32 =
2803 +LINT_32 += -erroff=E_BAD_PTR_CAST_ALIGN
2804 +LINT_32 += -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
2805 +LINT_32 += -erroff=E_SUSPICIOUS_COMPARISON
2806 +LINT_32 += -erroff=E_CAST_UINT_TO_SIGNED_INT
2807 +LINT_32 += -erroff=E_PASS_UINT_TO_SIGNED_INT
2808 +LINT_32 += -erroff=E_INVALID_ANNOTATION_NAME
2809 +LINT_32 += -erroff=E_FUNC_ARG_UNUSED
2810 +# This might be needed, but zlib.c and vjcompress.c will squawk
2811 +# when not ignored
2812 +LINT_32 += -erroff=E_CASE_FALLTHRU
2813 +LINT_32 += -erroff=E_RET_INT_IMPLICITLY
2814 +LINT_32 += -erroff=E_FUNC_NO_RET_VAL
2815 +# Some STREAMS macros will be noisy too when this isn't ignored
2816 +LINT_32 += -erroff=E_CONSTANT_CONDITION
2817 +LINT_32 += -erroff=E_CONST_EXPR
2818 +
2819 +# Extra noise suppressant for 64-bit
2820 +EXTRA_OFF =
2821 +EXTRA_OFF += -erroff=E_CAST_INT_TO_SMALL_INT
2822 +EXTRA_OFF += -erroff=E_CAST_INT_CONST_TO_SMALL_INT
2823 +EXTRA_OFF += -erroff=E_CAST_TO_PTR_FROM_INT
2824 +EXTRA_OFF += -erroff=E_ASSIGN_INT_TO_SMALL_INT
2825 +EXTRA_OFF += -erroff=E_ASSIGN_INT_FROM_BIG_CONST
2826 +EXTRA_OFF += -erroff=E_CONST_PROMOTED_UNSIGNED_LL
2827 +EXTRA_OFF += -erroff=E_CONST_PROMOTED_LONG_LONG
2828 +EXTRA_OFF += -erroff=E_CONST_TRUNCATED_BY_ASSIGN
2829 +EXTRA_OFF += -erroff=E_PASS_INT_FROM_BIG_CONST
2830 +EXTRA_OFF += -erroff=E_COMP_INT_WITH_LARGE_INT
2831 +EXTRA_OFF += -erroff=E_ASSIGN_UINT_TO_SIGNED_INT
2832 +EXTRA_OFF += -erroff=E_ASSIGN_NARROW_CONV
2833 +EXTRA_OFF += -erroff=E_PASS_INT_TO_SMALL_INT
2834 +EXTRA_OFF += -erroff=E_PTR_CONV_LOSES_BITS
2835 +
2836 +LINT_64 = $(LINT_32)
2837 +LINT_64 += $(EXTRA_OFF)
2838 +
2839 +LINTFLAGS64 = -Xa -nsxmuF -errtags=yes $(LINT_OPT_64) $(LINT_64)
2840 +LINT64 = $(LINT) -c $(LINTFLAGS64) $(CPPFLAGS)
2841 +
2842 +LINTFLAGS32 = -Xa -nsxmuF -errtags=yes $(LINT_OPT_32) $(LINT_32)
2843 +LINT32 = $(LINT) -c $(LINTFLAGS32) $(CPPFLAGS)
2844 +
2845 diff -ruN ppp-2.4.2/svr4/Makefile.sol2 ppp-cvs-20040427/svr4/Makefile.sol2
2846 --- ppp-2.4.2/svr4/Makefile.sol2 1970-01-01 01:00:00.000000000 +0100
2847 +++ ppp-cvs-20040427/svr4/Makefile.sol2 1999-09-21 22:50:32.000000000 +0200
2848 @@ -0,0 +1,66 @@
2849 +#
2850 +# Makefile for STREAMS modules for Solaris 2.
2851 +#
2852 +# $Id: Makefile.sol2,v 1.18 1999/09/21 20:37:20 masputra Exp $
2853 +#
2854 +
2855 +include Makedefs.sol2
2856 +
2857 +COPTS += -xO2 -xspace -W0,-Lt
2858 +
2859 +COMP_OBJS = ppp_comp.o bsd-comp.o deflate.o zlib.o vjcompress.o \
2860 + ppp_comp_mod.o
2861 +
2862 +all: ppp ppp_ahdl ppp_comp
2863 +
2864 +ppp: ppp.o ppp_mod.o
2865 + ld -r -o $@ ppp.o ppp_mod.o
2866 + chmod +x $@
2867 +
2868 +ppp_ahdl: ppp_ahdlc.o ppp_ahdlc_mod.o
2869 + ld -r -o $@ ppp_ahdlc.o ppp_ahdlc_mod.o
2870 + chmod +x $@
2871 +
2872 +ppp_comp: $(COMP_OBJS)
2873 + ld -r -o $@ $(COMP_OBJS)
2874 + chmod +x $@
2875 +
2876 +bsd-comp.o: ../modules/bsd-comp.c
2877 + $(CC) $(CFLAGS) -c $?
2878 +deflate.o: ../modules/deflate.c
2879 + $(CC) $(CFLAGS) -c $?
2880 +ppp.o: ../modules/ppp.c
2881 + $(CC) $(CFLAGS) -c $?
2882 +ppp_mod.o: ppp_mod.c
2883 + $(CC) $(CFLAGS) -c $?
2884 +ppp_ahdlc_mod.o: ppp_ahdlc_mod.c
2885 + $(CC) $(CFLAGS) -c $?
2886 +ppp_ahdlc.o: ../modules/ppp_ahdlc.c
2887 + $(CC) $(CFLAGS) -c $?
2888 +ppp_comp.o: ../modules/ppp_comp.c
2889 + $(CC) $(CFLAGS) -c $?
2890 +ppp_comp_mod.o: ppp_comp_mod.c
2891 + $(CC) $(CFLAGS) -c $?
2892 +vjcompress.o: ../modules/vjcompress.c
2893 + $(CC) $(CFLAGS) -c $?
2894 +zlib.o: ../common/zlib.c
2895 + $(CC) $(CFLAGS) -c $?
2896 +
2897 +install:
2898 + cp ppp ppp.conf /kernel/drv
2899 + cp ppp_comp ppp_ahdl /kernel/strmod
2900 + if grep clone:ppp /etc/minor_perm; then :; else \
2901 + echo clone:ppp 0644 root sys >>/etc/minor_perm; fi
2902 + /usr/sbin/rem_drv ppp 2>/dev/null || true
2903 + /usr/sbin/add_drv ppp
2904 +
2905 +SRCS = ../modules/ppp.c ppp_mod.c ../modules/ppp_ahdlc.c ppp_ahdlc_mod.c \
2906 + ../modules/ppp_comp.c ../modules/bsd-comp.c ../modules/deflate.c \
2907 + ../common/zlib.c ../modules/vjcompress.c ppp_comp_mod.c
2908 +
2909 +lint:
2910 + $(LINT32) $(SRCS)
2911 +
2912 +clean:
2913 + rm -f ppp ppp_comp ppp_ahdl *.o *~ core
2914 + rm -f *.ln
2915 diff -ruN ppp-2.4.2/svr4/Makefile.sol2-64 ppp-cvs-20040427/svr4/Makefile.sol2-64
2916 --- ppp-2.4.2/svr4/Makefile.sol2-64 1970-01-01 01:00:00.000000000 +0100
2917 +++ ppp-cvs-20040427/svr4/Makefile.sol2-64 1999-09-21 22:50:33.000000000 +0200
2918 @@ -0,0 +1,85 @@
2919 +#
2920 +# Makefile for 64-bit STREAMS modules for Solaris 2.
2921 +#
2922 +# $Id: Makefile.sol2-64,v 1.3 1999/09/21 20:37:20 masputra Exp $
2923 +#
2924 +
2925 +include Makedefs.sol2
2926 +
2927 +# Sun's cc flag for LP64 compilation / linkage
2928 +COPTS += -xchip=ultra -xarch=v9 -Wc,-xcode=abs32 -Wc,-Qiselect-regsym=0 -xO3 -xspace -W0,-Lt
2929 +
2930 +# subdirectory where 64-bit objects / binaries will be placed
2931 +LP64DIR = sparcv9
2932 +
2933 +# Name of legacy Makefile (for 32-bit binaries)
2934 +STD_MAKE = Makefile.sol2
2935 +
2936 +COMP_OBJS = $(LP64DIR)/ppp_comp.o $(LP64DIR)/bsd-comp.o \
2937 + $(LP64DIR)/deflate.o $(LP64DIR)/zlib.o $(LP64DIR)/vjcompress.o \
2938 + $(LP64DIR)/ppp_comp_mod.o
2939 +
2940 +all: std_objs $(LP64DIR) ppp ppp_ahdl ppp_comp
2941 +
2942 +std_objs:
2943 + $(MAKE) -f $(STD_MAKE) all
2944 +
2945 +ppp: $(LP64DIR)/ppp.o $(LP64DIR)/ppp_mod.o
2946 + ld -r -o $(LP64DIR)/$@ $(LP64DIR)/ppp.o $(LP64DIR)/ppp_mod.o
2947 + chmod +x $(LP64DIR)/$@
2948 +
2949 +ppp_ahdl: $(LP64DIR)/ppp_ahdlc.o $(LP64DIR)/ppp_ahdlc_mod.o
2950 + ld -r -o $(LP64DIR)/$@ $(LP64DIR)/ppp_ahdlc.o $(LP64DIR)/ppp_ahdlc_mod.o
2951 + chmod +x $(LP64DIR)/$@
2952 +
2953 +ppp_comp: $(COMP_OBJS)
2954 + ld -r -o $(LP64DIR)/$@ $(COMP_OBJS)
2955 + chmod +x $(LP64DIR)/$@
2956 +
2957 +$(LP64DIR)/bsd-comp.o: ../modules/bsd-comp.c
2958 + $(CC) $(CFLAGS) -c $? -o $@
2959 +$(LP64DIR)/deflate.o: ../modules/deflate.c
2960 + $(CC) $(CFLAGS) -c $? -o $@
2961 +$(LP64DIR)/ppp.o: ../modules/ppp.c
2962 + $(CC) $(CFLAGS) -c $? -o $@
2963 +$(LP64DIR)/ppp_mod.o: ppp_mod.c
2964 + $(CC) $(CFLAGS) -c $? -o $@
2965 +$(LP64DIR)/ppp_ahdlc_mod.o: ppp_ahdlc_mod.c
2966 + $(CC) $(CFLAGS) -c $? -o $@
2967 +$(LP64DIR)/ppp_ahdlc.o: ../modules/ppp_ahdlc.c
2968 + $(CC) $(CFLAGS) -c $? -o $@
2969 +$(LP64DIR)/ppp_comp.o: ../modules/ppp_comp.c
2970 + $(CC) $(CFLAGS) -c $? -o $@
2971 +$(LP64DIR)/ppp_comp_mod.o: ppp_comp_mod.c
2972 + $(CC) $(CFLAGS) -c $? -o $@
2973 +$(LP64DIR)/vjcompress.o: ../modules/vjcompress.c
2974 + $(CC) $(CFLAGS) -c $? -o $@
2975 +$(LP64DIR)/zlib.o: ../common/zlib.c
2976 + $(CC) $(CFLAGS) -c $? -o $@
2977 +
2978 +$(LP64DIR):
2979 + mkdir -m 755 -p $@
2980 +
2981 +install:
2982 + cp ppp ppp.conf /kernel/drv
2983 + cp ppp_comp ppp_ahdl /kernel/strmod
2984 + cp $(LP64DIR)/ppp /kernel/drv/$(LP64DIR)
2985 + cp $(LP64DIR)/ppp_comp $(LP64DIR)/ppp_ahdl /kernel/strmod/$(LP64DIR)
2986 + if grep clone:ppp /etc/minor_perm; then :; else \
2987 + echo clone:ppp 0644 root sys >>/etc/minor_perm; fi
2988 + /usr/sbin/rem_drv ppp 2>/dev/null || true
2989 + /usr/sbin/add_drv ppp
2990 +
2991 +SRCS = ../modules/ppp.c ppp_mod.c ../modules/ppp_ahdlc.c ppp_ahdlc_mod.c \
2992 + ../modules/ppp_comp.c ../modules/bsd-comp.c ../modules/deflate.c \
2993 + ../common/zlib.c ../modules/vjcompress.c ppp_comp_mod.c
2994 +
2995 +lint:
2996 + $(LINT64) $(SRCS)
2997 +
2998 +lint-32:
2999 + $(LINT32) $(SRCS)
3000 +
3001 +clean:
3002 + $(MAKE) -f $(STD_MAKE) clean
3003 + rm -f $(LP64DIR)/ppp $(LP64DIR)/ppp_comp $(LP64DIR)/ppp_ahdl $(LP64DIR)/*.o $(LP64DIR)/*~ $(LP64DIR)/core
3004 diff -ruN ppp-2.4.2/svr4/Makefile.top ppp-cvs-20040427/svr4/Makefile.top
3005 --- ppp-2.4.2/svr4/Makefile.top 1970-01-01 01:00:00.000000000 +0100
3006 +++ ppp-cvs-20040427/svr4/Makefile.top 1999-04-01 14:37:44.000000000 +0200
3007 @@ -0,0 +1,50 @@
3008 +#
3009 +# ppp top level makefile for SVR4 and Solaris 2
3010 +#
3011 +# $Id: Makefile.top,v 1.8 1999/04/01 11:44:55 paulus Exp $
3012 +#
3013 +
3014 +include svr4/Makedefs
3015 +
3016 +all:
3017 + cd chat; $(MAKE) all
3018 + cd pppd; $(MAKE) all
3019 + cd pppstats; $(MAKE) all
3020 + cd pppdump; $(MAKE) all
3021 + cd svr4; $(MAKE) all
3022 +
3023 +install: $(BINDIR) $(MANDIR)/man8 install-progs install-etcppp
3024 +
3025 +install-progs:
3026 + cd chat; $(MAKE) install
3027 + cd pppd; $(MAKE) install
3028 + cd pppstats; $(MAKE) install
3029 + cd pppdump; $(MAKE) install
3030 + cd svr4; $(MAKE) install
3031 +
3032 +install-etcppp: $(ETCDIR) $(ETCDIR)/options $(ETCDIR)/pap-secrets \
3033 + $(ETCDIR)/chap-secrets
3034 +
3035 +$(ETCDIR)/options:
3036 + cp etc.ppp/options $@
3037 + chmod go-w $@
3038 +$(ETCDIR)/pap-secrets:
3039 + $(INSTALL) -f $(ETCDIR) -m 600 etc.ppp/pap-secrets
3040 +$(ETCDIR)/chap-secrets:
3041 + $(INSTALL) -f $(ETCDIR) -m 600 etc.ppp/chap-secrets
3042 +
3043 +$(BINDIR):
3044 + mkdir -m 755 -p $@
3045 +$(MANDIR)/man8:
3046 + mkdir -m 755 -p $@
3047 +$(ETCDIR):
3048 + mkdir -m 755 -p $@
3049 +
3050 +clean:
3051 + rm -f *~
3052 + cd chat; $(MAKE) clean
3053 + cd pppd; $(MAKE) clean
3054 + cd pppstats; $(MAKE) clean
3055 + cd pppdump; $(MAKE) clean
3056 + cd svr4; $(MAKE) clean
3057 +
3058 diff -ruN ppp-2.4.2/svr4/ppp.Master ppp-cvs-20040427/svr4/ppp.Master
3059 --- ppp-2.4.2/svr4/ppp.Master 1970-01-01 01:00:00.000000000 +0100
3060 +++ ppp-cvs-20040427/svr4/ppp.Master 1995-10-27 04:58:28.000000000 +0100
3061 @@ -0,0 +1 @@
3062 +ppp - Sciof ppp 0 0 1 128 -1
3063 diff -ruN ppp-2.4.2/svr4/ppp.Node ppp-cvs-20040427/svr4/ppp.Node
3064 --- ppp-2.4.2/svr4/ppp.Node 1970-01-01 01:00:00.000000000 +0100
3065 +++ ppp-cvs-20040427/svr4/ppp.Node 1995-10-27 04:58:36.000000000 +0100
3066 @@ -0,0 +1 @@
3067 +clone ppp c ppp
3068 diff -ruN ppp-2.4.2/svr4/ppp.System ppp-cvs-20040427/svr4/ppp.System
3069 --- ppp-2.4.2/svr4/ppp.System 1970-01-01 01:00:00.000000000 +0100
3070 +++ ppp-cvs-20040427/svr4/ppp.System 1995-10-27 04:58:37.000000000 +0100
3071 @@ -0,0 +1 @@
3072 +ppp Y 1 0 0 0 0 0 0 0
3073 diff -ruN ppp-2.4.2/svr4/ppp.conf ppp-cvs-20040427/svr4/ppp.conf
3074 --- ppp-2.4.2/svr4/ppp.conf 1970-01-01 01:00:00.000000000 +0100
3075 +++ ppp-cvs-20040427/svr4/ppp.conf 1995-06-01 06:39:00.000000000 +0200
3076 @@ -0,0 +1 @@
3077 +name="ppp" parent="pseudo" instance=0;
3078 diff -ruN ppp-2.4.2/svr4/ppp_ahdl.Master ppp-cvs-20040427/svr4/ppp_ahdl.Master
3079 --- ppp-2.4.2/svr4/ppp_ahdl.Master 1970-01-01 01:00:00.000000000 +0100
3080 +++ ppp-cvs-20040427/svr4/ppp_ahdl.Master 1995-10-27 04:58:32.000000000 +0100
3081 @@ -0,0 +1 @@
3082 +ppp_ahdl - iSf phdl 0 0 1 1 -1
3083 diff -ruN ppp-2.4.2/svr4/ppp_ahdl.System ppp-cvs-20040427/svr4/ppp_ahdl.System
3084 --- ppp-2.4.2/svr4/ppp_ahdl.System 1970-01-01 01:00:00.000000000 +0100
3085 +++ ppp-cvs-20040427/svr4/ppp_ahdl.System 1995-10-27 04:58:38.000000000 +0100
3086 @@ -0,0 +1 @@
3087 +ppp_ahdl Y 1 0 0 0 0 0 0 0
3088 diff -ruN ppp-2.4.2/svr4/ppp_ahdlc_mod.c ppp-cvs-20040427/svr4/ppp_ahdlc_mod.c
3089 --- ppp-2.4.2/svr4/ppp_ahdlc_mod.c 1970-01-01 01:00:00.000000000 +0100
3090 +++ ppp-cvs-20040427/svr4/ppp_ahdlc_mod.c 1995-12-11 06:21:02.000000000 +0100
3091 @@ -0,0 +1,49 @@
3092 +#include <sys/types.h>
3093 +#include <sys/param.h>
3094 +#include <sys/conf.h>
3095 +#include <sys/modctl.h>
3096 +#include <sys/sunddi.h>
3097 +
3098 +extern struct streamtab ppp_ahdlcinfo;
3099 +
3100 +static struct fmodsw fsw = {
3101 + "ppp_ahdl",
3102 + &ppp_ahdlcinfo,
3103 + D_NEW | D_MP | D_MTQPAIR
3104 +};
3105 +
3106 +extern struct mod_ops mod_strmodops;
3107 +
3108 +static struct modlstrmod modlstrmod = {
3109 + &mod_strmodops,
3110 + "PPP async HDLC module",
3111 + &fsw
3112 +};
3113 +
3114 +static struct modlinkage modlinkage = {
3115 + MODREV_1,
3116 + (void *) &modlstrmod,
3117 + NULL
3118 +};
3119 +
3120 +/*
3121 + * Entry points for modloading.
3122 + */
3123 +int
3124 +_init(void)
3125 +{
3126 + return mod_install(&modlinkage);
3127 +}
3128 +
3129 +int
3130 +_fini(void)
3131 +{
3132 + return mod_remove(&modlinkage);
3133 +}
3134 +
3135 +int
3136 +_info(mip)
3137 + struct modinfo *mip;
3138 +{
3139 + return mod_info(&modlinkage, mip);
3140 +}
3141 diff -ruN ppp-2.4.2/svr4/ppp_comp.Master ppp-cvs-20040427/svr4/ppp_comp.Master
3142 --- ppp-2.4.2/svr4/ppp_comp.Master 1970-01-01 01:00:00.000000000 +0100
3143 +++ ppp-cvs-20040427/svr4/ppp_comp.Master 1995-10-27 04:58:34.000000000 +0100
3144 @@ -0,0 +1 @@
3145 +ppp_comp - iSf pcmp 0 0 1 1 -1
3146 diff -ruN ppp-2.4.2/svr4/ppp_comp.System ppp-cvs-20040427/svr4/ppp_comp.System
3147 --- ppp-2.4.2/svr4/ppp_comp.System 1970-01-01 01:00:00.000000000 +0100
3148 +++ ppp-cvs-20040427/svr4/ppp_comp.System 1995-10-27 04:58:40.000000000 +0100
3149 @@ -0,0 +1 @@
3150 +ppp_comp Y 1 0 0 0 0 0 0 0
3151 diff -ruN ppp-2.4.2/svr4/ppp_comp_mod.c ppp-cvs-20040427/svr4/ppp_comp_mod.c
3152 --- ppp-2.4.2/svr4/ppp_comp_mod.c 1970-01-01 01:00:00.000000000 +0100
3153 +++ ppp-cvs-20040427/svr4/ppp_comp_mod.c 2002-12-06 10:50:10.000000000 +0100
3154 @@ -0,0 +1,89 @@
3155 +/*
3156 + * ppp_comp_mod.c - modload support for PPP compression STREAMS module.
3157 + *
3158 + * Copyright (c) 1994 Paul Mackerras. All rights reserved.
3159 + *
3160 + * Redistribution and use in source and binary forms, with or without
3161 + * modification, are permitted provided that the following conditions
3162 + * are met:
3163 + *
3164 + * 1. Redistributions of source code must retain the above copyright
3165 + * notice, this list of conditions and the following disclaimer.
3166 + *
3167 + * 2. Redistributions in binary form must reproduce the above copyright
3168 + * notice, this list of conditions and the following disclaimer in
3169 + * the documentation and/or other materials provided with the
3170 + * distribution.
3171 + *
3172 + * 3. The name(s) of the authors of this software must not be used to
3173 + * endorse or promote products derived from this software without
3174 + * prior written permission.
3175 + *
3176 + * 4. Redistributions of any form whatsoever must retain the following
3177 + * acknowledgment:
3178 + * "This product includes software developed by Paul Mackerras
3179 + * <paulus@samba.org>".
3180 + *
3181 + * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO
3182 + * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
3183 + * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
3184 + * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
3185 + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
3186 + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
3187 + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
3188 + *
3189 + * $Id: ppp_comp_mod.c,v 1.3 2002/12/06 09:49:16 paulus Exp $
3190 + */
3191 +
3192 +/*
3193 + * This file is used under Solaris 2.
3194 + */
3195 +#include <sys/types.h>
3196 +#include <sys/param.h>
3197 +#include <sys/conf.h>
3198 +#include <sys/modctl.h>
3199 +#include <sys/sunddi.h>
3200 +
3201 +extern struct streamtab ppp_compinfo;
3202 +
3203 +static struct fmodsw fsw = {
3204 + "ppp_comp",
3205 + &ppp_compinfo,
3206 + D_NEW | D_MP | D_MTQPAIR
3207 +};
3208 +
3209 +extern struct mod_ops mod_strmodops;
3210 +
3211 +static struct modlstrmod modlstrmod = {
3212 + &mod_strmodops,
3213 + "PPP compression module",
3214 + &fsw
3215 +};
3216 +
3217 +static struct modlinkage modlinkage = {
3218 + MODREV_1,
3219 + (void *) &modlstrmod,
3220 + NULL
3221 +};
3222 +
3223 +/*
3224 + * Entry points for modloading.
3225 + */
3226 +int
3227 +_init(void)
3228 +{
3229 + return mod_install(&modlinkage);
3230 +}
3231 +
3232 +int
3233 +_fini(void)
3234 +{
3235 + return mod_remove(&modlinkage);
3236 +}
3237 +
3238 +int
3239 +_info(mip)
3240 + struct modinfo *mip;
3241 +{
3242 + return mod_info(&modlinkage, mip);
3243 +}
3244 diff -ruN ppp-2.4.2/svr4/ppp_mod.c ppp-cvs-20040427/svr4/ppp_mod.c
3245 --- ppp-2.4.2/svr4/ppp_mod.c 1970-01-01 01:00:00.000000000 +0100
3246 +++ ppp-cvs-20040427/svr4/ppp_mod.c 2002-12-06 10:50:10.000000000 +0100
3247 @@ -0,0 +1,182 @@
3248 +/*
3249 + * ppp_mod.c - modload support for PPP pseudo-device driver.
3250 + *
3251 + * Copyright (c) 1994 Paul Mackerras. All rights reserved.
3252 + *
3253 + * Redistribution and use in source and binary forms, with or without
3254 + * modification, are permitted provided that the following conditions
3255 + * are met:
3256 + *
3257 + * 1. Redistributions of source code must retain the above copyright
3258 + * notice, this list of conditions and the following disclaimer.
3259 + *
3260 + * 2. Redistributions in binary form must reproduce the above copyright
3261 + * notice, this list of conditions and the following disclaimer in
3262 + * the documentation and/or other materials provided with the
3263 + * distribution.
3264 + *
3265 + * 3. The name(s) of the authors of this software must not be used to
3266 + * endorse or promote products derived from this software without
3267 + * prior written permission.
3268 + *
3269 + * 4. Redistributions of any form whatsoever must retain the following
3270 + * acknowledgment:
3271 + * "This product includes software developed by Paul Mackerras
3272 + * <paulus@samba.org>".
3273 + *
3274 + * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO
3275 + * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
3276 + * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
3277 + * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
3278 + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
3279 + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
3280 + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
3281 + *
3282 + * $Id: ppp_mod.c,v 1.4 2002/12/06 09:49:16 paulus Exp $
3283 + */
3284 +
3285 +/*
3286 + * This file is used under Solaris 2.
3287 + */
3288 +
3289 +#include <sys/types.h>
3290 +#include <sys/param.h>
3291 +#include <sys/stat.h>
3292 +#include <sys/conf.h>
3293 +#include <sys/modctl.h>
3294 +#include <sys/sunddi.h>
3295 +#include <sys/ksynch.h>
3296 +
3297 +#ifdef __STDC__
3298 +#define __P(x) x
3299 +#else
3300 +#define __P(x) ()
3301 +#endif
3302 +
3303 +static int ppp_identify __P((dev_info_t *));
3304 +static int ppp_attach __P((dev_info_t *, ddi_attach_cmd_t));
3305 +static int ppp_detach __P((dev_info_t *, ddi_detach_cmd_t));
3306 +static int ppp_devinfo __P((dev_info_t *, ddi_info_cmd_t, void *, void **));
3307 +
3308 +extern struct streamtab pppinfo;
3309 +extern krwlock_t ppp_lower_lock;
3310 +
3311 +static dev_info_t *ppp_dip;
3312 +
3313 +static struct cb_ops cb_ppp_ops = {
3314 + nulldev, nulldev, nodev, nodev, /* cb_open, ... */
3315 + nodev, nodev, nodev, nodev, /* cb_dump, ... */
3316 + nodev, nodev, nodev, nochpoll, /* cb_devmap, ... */
3317 + ddi_prop_op, /* cb_prop_op */
3318 + &pppinfo, /* cb_stream */
3319 + D_NEW|D_MP|D_MTQPAIR|D_MTOUTPERIM|D_MTOCEXCL /* cb_flag */
3320 +};
3321 +
3322 +static struct dev_ops ppp_ops = {
3323 + DEVO_REV, /* devo_rev */
3324 + 0, /* devo_refcnt */
3325 + ppp_devinfo, /* devo_getinfo */
3326 + ppp_identify, /* devo_identify */
3327 + nulldev, /* devo_probe */
3328 + ppp_attach, /* devo_attach */
3329 + ppp_detach, /* devo_detach */
3330 + nodev, /* devo_reset */
3331 + &cb_ppp_ops, /* devo_cb_ops */
3332 + NULL /* devo_bus_ops */
3333 +};
3334 +
3335 +/*
3336 + * Module linkage information
3337 + */
3338 +
3339 +static struct modldrv modldrv = {
3340 + &mod_driverops, /* says this is a pseudo driver */
3341 + "PPP-2.3 multiplexing driver",
3342 + &ppp_ops /* driver ops */
3343 +};
3344 +
3345 +static struct modlinkage modlinkage = {
3346 + MODREV_1,
3347 + (void *) &modldrv,
3348 + NULL
3349 +};
3350 +
3351 +int
3352 +_init(void)
3353 +{
3354 + return mod_install(&modlinkage);
3355 +}
3356 +
3357 +int
3358 +_fini(void)
3359 +{
3360 + return mod_remove(&modlinkage);
3361 +}
3362 +
3363 +int
3364 +_info(mip)
3365 + struct modinfo *mip;
3366 +{
3367 + return mod_info(&modlinkage, mip);
3368 +}
3369 +
3370 +static int
3371 +ppp_identify(dip)
3372 + dev_info_t *dip;
3373 +{
3374 + return strcmp(ddi_get_name(dip), "ppp") == 0? DDI_IDENTIFIED:
3375 + DDI_NOT_IDENTIFIED;
3376 +}
3377 +
3378 +static int
3379 +ppp_attach(dip, cmd)
3380 + dev_info_t *dip;
3381 + ddi_attach_cmd_t cmd;
3382 +{
3383 +
3384 + if (cmd != DDI_ATTACH)
3385 + return DDI_FAILURE;
3386 + if (ddi_create_minor_node(dip, "ppp", S_IFCHR, 0, DDI_PSEUDO, CLONE_DEV)
3387 + == DDI_FAILURE) {
3388 + ddi_remove_minor_node(dip, NULL);
3389 + return DDI_FAILURE;
3390 + }
3391 + rw_init(&ppp_lower_lock, NULL, RW_DRIVER, NULL);
3392 + return DDI_SUCCESS;
3393 +}
3394 +
3395 +static int
3396 +ppp_detach(dip, cmd)
3397 + dev_info_t *dip;
3398 + ddi_detach_cmd_t cmd;
3399 +{
3400 + rw_destroy(&ppp_lower_lock);
3401 + ddi_remove_minor_node(dip, NULL);
3402 + return DDI_SUCCESS;
3403 +}
3404 +
3405 +static int
3406 +ppp_devinfo(dip, cmd, arg, result)
3407 + dev_info_t *dip;
3408 + ddi_info_cmd_t cmd;
3409 + void *arg;
3410 + void **result;
3411 +{
3412 + int error;
3413 +
3414 + error = DDI_SUCCESS;
3415 + switch (cmd) {
3416 + case DDI_INFO_DEVT2DEVINFO:
3417 + if (ppp_dip == NULL)
3418 + error = DDI_FAILURE;
3419 + else
3420 + *result = (void *) ppp_dip;
3421 + break;
3422 + case DDI_INFO_DEVT2INSTANCE:
3423 + *result = NULL;
3424 + break;
3425 + default:
3426 + error = DDI_FAILURE;
3427 + }
3428 + return error;
3429 +}