5e346b8f70
SVN-Revision: 145
3429 lines
118 KiB
Diff
3429 lines
118 KiB
Diff
diff -ruN ppp-2.4.2/TODO ppp-cvs-20040427/TODO
|
|
--- ppp-2.4.2/TODO 1970-01-01 01:00:00.000000000 +0100
|
|
+++ ppp-cvs-20040427/TODO 1999-03-22 07:38:09.000000000 +0100
|
|
@@ -0,0 +1,16 @@
|
|
+* Things to do *
|
|
+
|
|
+- How should we handle the case where MTU > MRU?
|
|
+ Should we reduce the IP MTU to the link MRU (so TCP MSS is correct)?
|
|
+
|
|
+- Provide ways to:
|
|
+ + set the IP address, possibly based on the peer's identity
|
|
+ + have external checking of PAP user/password, CHAP response
|
|
+ + supply the PAP user/password, CHAP secret
|
|
+ + decide which tty to use (locking, DTR issues)
|
|
+
|
|
+- Integrate callback stuff?
|
|
+
|
|
+- Implement link quality monitoring
|
|
+
|
|
+- Implement other network control protocols
|
|
diff -ruN ppp-2.4.2/chat/chat.c ppp-cvs-20040427/chat/chat.c
|
|
--- ppp-2.4.2/chat/chat.c 2003-03-30 10:23:48.000000000 +0200
|
|
+++ ppp-cvs-20040427/chat/chat.c 2004-01-17 06:50:11.000000000 +0100
|
|
@@ -87,7 +87,7 @@
|
|
#endif
|
|
|
|
#ifndef lint
|
|
-static const char rcsid[] = "$Id: chat.c,v 1.29 2003/03/04 06:17:21 fcusack Exp $";
|
|
+static const char rcsid[] = "$Id: chat.c,v 1.30 2004/01/17 05:47:55 carlsonj Exp $";
|
|
#endif
|
|
|
|
#include <stdio.h>
|
|
@@ -213,7 +213,7 @@
|
|
void *copy_of __P((char *s));
|
|
char *grow __P((char *s, char **p, size_t len));
|
|
void usage __P((void));
|
|
-void logf __P((const char *fmt, ...));
|
|
+void msgf __P((const char *fmt, ...));
|
|
void fatal __P((int code, const char *fmt, ...));
|
|
SIGTYPE sigalrm __P((int signo));
|
|
SIGTYPE sigint __P((int signo));
|
|
@@ -495,7 +495,7 @@
|
|
/*
|
|
* Send a message to syslog and/or stderr.
|
|
*/
|
|
-void logf __V((const char *fmt, ...))
|
|
+void msgf __V((const char *fmt, ...))
|
|
{
|
|
va_list args;
|
|
|
|
@@ -558,7 +558,7 @@
|
|
fatal(2, "Can't set file mode flags on stdin: %m");
|
|
|
|
if (verbose)
|
|
- logf("alarm");
|
|
+ msgf("alarm");
|
|
}
|
|
|
|
void unalarm()
|
|
@@ -1001,9 +1001,9 @@
|
|
* The expectation did not occur. This is terminal.
|
|
*/
|
|
if (fail_reason)
|
|
- logf("Failed (%s)", fail_reason);
|
|
+ msgf("Failed (%s)", fail_reason);
|
|
else
|
|
- logf("Failed");
|
|
+ msgf("Failed");
|
|
terminate(exit_code);
|
|
}
|
|
|
|
@@ -1079,7 +1079,7 @@
|
|
abort_string[n_aborts++] = s1;
|
|
|
|
if (verbose)
|
|
- logf("abort on (%v)", s);
|
|
+ msgf("abort on (%v)", s);
|
|
return;
|
|
}
|
|
|
|
@@ -1105,7 +1105,7 @@
|
|
pack++;
|
|
n_aborts--;
|
|
if (verbose)
|
|
- logf("clear abort on (%v)", s);
|
|
+ msgf("clear abort on (%v)", s);
|
|
}
|
|
}
|
|
free(s1);
|
|
@@ -1129,7 +1129,7 @@
|
|
report_string[n_reports++] = s1;
|
|
|
|
if (verbose)
|
|
- logf("report (%v)", s);
|
|
+ msgf("report (%v)", s);
|
|
return;
|
|
}
|
|
|
|
@@ -1155,7 +1155,7 @@
|
|
pack++;
|
|
n_reports--;
|
|
if (verbose)
|
|
- logf("clear report (%v)", s);
|
|
+ msgf("clear report (%v)", s);
|
|
}
|
|
}
|
|
free(s1);
|
|
@@ -1173,7 +1173,7 @@
|
|
timeout = DEFAULT_CHAT_TIMEOUT;
|
|
|
|
if (verbose)
|
|
- logf("timeout set to %d seconds", timeout);
|
|
+ msgf("timeout set to %d seconds", timeout);
|
|
|
|
return;
|
|
}
|
|
@@ -1236,7 +1236,7 @@
|
|
return ((int)c & 0x7F);
|
|
|
|
default:
|
|
- logf("warning: read() on stdin returned %d", status);
|
|
+ msgf("warning: read() on stdin returned %d", status);
|
|
|
|
case -1:
|
|
if ((status = fcntl(0, F_GETFL, 0)) == -1)
|
|
@@ -1264,7 +1264,7 @@
|
|
return (0);
|
|
|
|
default:
|
|
- logf("warning: write() on stdout returned %d", status);
|
|
+ msgf("warning: write() on stdout returned %d", status);
|
|
|
|
case -1:
|
|
if ((status = fcntl(0, F_GETFL, 0)) == -1)
|
|
@@ -1286,9 +1286,9 @@
|
|
|
|
if (verbose) {
|
|
if (errno == EINTR || errno == EWOULDBLOCK)
|
|
- logf(" -- write timed out");
|
|
+ msgf(" -- write timed out");
|
|
else
|
|
- logf(" -- write failed: %m");
|
|
+ msgf(" -- write failed: %m");
|
|
}
|
|
return (0);
|
|
}
|
|
@@ -1303,9 +1303,9 @@
|
|
|
|
if (verbose) {
|
|
if (quiet)
|
|
- logf("send (??????)");
|
|
+ msgf("send (??????)");
|
|
else
|
|
- logf("send (%v)", s);
|
|
+ msgf("send (%v)", s);
|
|
}
|
|
|
|
alarm(timeout); alarmed = 0;
|
|
@@ -1392,17 +1392,17 @@
|
|
minlen = (len > sizeof(fail_buffer)? len: sizeof(fail_buffer)) - 1;
|
|
|
|
if (verbose)
|
|
- logf("expect (%v)", string);
|
|
+ msgf("expect (%v)", string);
|
|
|
|
if (len > STR_LEN) {
|
|
- logf("expect string is too long");
|
|
+ msgf("expect string is too long");
|
|
exit_code = 1;
|
|
return 0;
|
|
}
|
|
|
|
if (len == 0) {
|
|
if (verbose)
|
|
- logf("got it");
|
|
+ msgf("got it");
|
|
return (1);
|
|
}
|
|
|
|
@@ -1416,16 +1416,16 @@
|
|
echo_stderr(c);
|
|
if (verbose && c == '\n') {
|
|
if (s == logged)
|
|
- logf(""); /* blank line */
|
|
+ msgf(""); /* blank line */
|
|
else
|
|
- logf("%0.*v", s - logged, logged);
|
|
+ msgf("%0.*v", s - logged, logged);
|
|
logged = s + 1;
|
|
}
|
|
|
|
*s++ = c;
|
|
|
|
if (verbose && s >= logged + 80) {
|
|
- logf("%0.*v", s - logged, logged);
|
|
+ msgf("%0.*v", s - logged, logged);
|
|
logged = s;
|
|
}
|
|
|
|
@@ -1470,8 +1470,8 @@
|
|
strncmp(s - len, string, len) == 0) {
|
|
if (verbose) {
|
|
if (s > logged)
|
|
- logf("%0.*v", s - logged, logged);
|
|
- logf(" -- got it\n");
|
|
+ msgf("%0.*v", s - logged, logged);
|
|
+ msgf(" -- got it\n");
|
|
}
|
|
|
|
alarm(0);
|
|
@@ -1484,8 +1484,8 @@
|
|
strncmp(s - abort_len, abort_string[n], abort_len) == 0) {
|
|
if (verbose) {
|
|
if (s > logged)
|
|
- logf("%0.*v", s - logged, logged);
|
|
- logf(" -- failed");
|
|
+ msgf("%0.*v", s - logged, logged);
|
|
+ msgf(" -- failed");
|
|
}
|
|
|
|
alarm(0);
|
|
@@ -1499,7 +1499,7 @@
|
|
if (s >= end) {
|
|
if (logged < s - minlen) {
|
|
if (verbose)
|
|
- logf("%0.*v", s - logged, logged);
|
|
+ msgf("%0.*v", s - logged, logged);
|
|
logged = s;
|
|
}
|
|
s -= minlen;
|
|
@@ -1509,16 +1509,16 @@
|
|
}
|
|
|
|
if (alarmed && verbose)
|
|
- logf("warning: alarm synchronization problem");
|
|
+ msgf("warning: alarm synchronization problem");
|
|
}
|
|
|
|
alarm(0);
|
|
|
|
if (verbose && printed) {
|
|
if (alarmed)
|
|
- logf(" -- read timed out");
|
|
+ msgf(" -- read timed out");
|
|
else
|
|
- logf(" -- read failed: %m");
|
|
+ msgf(" -- read failed: %m");
|
|
}
|
|
|
|
exit_code = 3;
|
|
diff -ruN ppp-2.4.2/configure ppp-cvs-20040427/configure
|
|
--- ppp-2.4.2/configure 2002-11-09 12:24:41.000000000 +0100
|
|
+++ ppp-cvs-20040427/configure 2004-01-17 06:50:11.000000000 +0100
|
|
@@ -1,5 +1,5 @@
|
|
#!/bin/sh
|
|
-# $Id: configure,v 1.30 2002/11/02 19:48:12 carlsonj Exp $
|
|
+# $Id: configure,v 1.31 2004/01/17 05:47:55 carlsonj Exp $
|
|
|
|
# if [ -d /NextApps ]; then
|
|
# system="NeXTStep"
|
|
@@ -27,7 +27,7 @@
|
|
esac;;
|
|
5.[1-6]*) state="known"; ksrc="solaris"; makext="sol2";;
|
|
esac
|
|
- if [ -x /opt/SUNWspro/bin/cc ] &&
|
|
+ if [ -x /opt/SUNWspro/bin/cc -a "$1" != "gcc" ] &&
|
|
/opt/SUNWspro/bin/cc -flags >/dev/null 2>&1; then
|
|
: # use Sun WorkShop compiler
|
|
elif gcc --version >/dev/null 2>&1; then
|
|
diff -ruN ppp-2.4.2/contrib/pppgetpass/Makefile.linux ppp-cvs-20040427/contrib/pppgetpass/Makefile.linux
|
|
--- ppp-2.4.2/contrib/pppgetpass/Makefile.linux 1999-11-15 05:08:24.000000000 +0100
|
|
+++ ppp-cvs-20040427/contrib/pppgetpass/Makefile.linux 1970-01-01 01:00:00.000000000 +0100
|
|
@@ -1,16 +0,0 @@
|
|
-all: pppgetpass.vt pppgetpass.gtk
|
|
-
|
|
-pppgetpass.vt: pppgetpass.vt.o
|
|
-
|
|
-pppgetpass.gtk: pppgetpass.gtk.o
|
|
- $(CC) $(LDFLAGS) pppgetpass.gtk.o `gtk-config --libs` -o pppgetpass.gtk
|
|
-pppgetpass.gtk.o: pppgetpass.gtk.c
|
|
- $(CC) $(CFLAGS) -c pppgetpass.gtk.c `gtk-config --cflags`
|
|
-
|
|
-install: all
|
|
- install -m 755 pppgetpass.sh /usr/bin/pppgetpass
|
|
- install -m 4755 -o root -g root pppgetpass.vt /usr/bin/
|
|
- install -m 755 -o root -g root pppgetpass.gtk /usr/X11/bin/
|
|
-
|
|
-clean:
|
|
- rm -f *.o pppgetpass.gtk pppgetpass.vt core
|
|
diff -ruN ppp-2.4.2/contrib/pppgetpass/pppgetpass.8 ppp-cvs-20040427/contrib/pppgetpass/pppgetpass.8
|
|
--- ppp-2.4.2/contrib/pppgetpass/pppgetpass.8 1999-11-15 05:08:24.000000000 +0100
|
|
+++ ppp-cvs-20040427/contrib/pppgetpass/pppgetpass.8 1970-01-01 01:00:00.000000000 +0100
|
|
@@ -1,18 +0,0 @@
|
|
-.TH PPPGETPASS 8 "26 Sep 1999"
|
|
-.SH NAME
|
|
-pppgetpass \- prompt for PAP password
|
|
-.SH SYNOPSIS
|
|
-.B pppgetpass
|
|
-.I client server fd
|
|
-.SH DESCRIPTION
|
|
-.B pppgetpass
|
|
-the outer half of a plugin for PAP password prompting in pppd.
|
|
-If the peer requires PAP, and the
|
|
-.B passprompt.so
|
|
-plugin is loaded into pppd, it will run
|
|
-.B /usr/sbin/pppgetpass
|
|
-(or another program specified by the
|
|
-.B promptprog
|
|
-option) to prompt the user for the password.
|
|
-.SH SEE ALSO
|
|
-pppd(8)
|
|
diff -ruN ppp-2.4.2/contrib/pppgetpass/pppgetpass.gtk.c ppp-cvs-20040427/contrib/pppgetpass/pppgetpass.gtk.c
|
|
--- ppp-2.4.2/contrib/pppgetpass/pppgetpass.gtk.c 1999-11-15 05:08:24.000000000 +0100
|
|
+++ ppp-cvs-20040427/contrib/pppgetpass/pppgetpass.gtk.c 1970-01-01 01:00:00.000000000 +0100
|
|
@@ -1,92 +0,0 @@
|
|
-#include <glib.h>
|
|
-#include <gdk/gdk.h>
|
|
-#include <gtk/gtkwindow.h>
|
|
-#include <gtk/gtkmain.h>
|
|
-#include <gtk/gtkbutton.h>
|
|
-#include <gtk/gtkvbox.h>
|
|
-#include <gtk/gtklabel.h>
|
|
-#include <gtk/gtkentry.h>
|
|
-#include <gtk/gtksignal.h>
|
|
-
|
|
-#include <stdio.h>
|
|
-#include <string.h>
|
|
-#include <stdlib.h>
|
|
-#include <unistd.h>
|
|
-#include <syslog.h>
|
|
-
|
|
-int outfd;
|
|
-int err;
|
|
-
|
|
-static void okpressed(void *widget, void *clientdata)
|
|
-{
|
|
- GtkWidget *answer=clientdata;
|
|
- gchar *pass;
|
|
- int passlen;
|
|
- ssize_t wrote;
|
|
- (void)widget;
|
|
-
|
|
- pass=gtk_entry_get_text(GTK_ENTRY(answer));
|
|
-
|
|
- passlen=strlen(pass);
|
|
- if(!passlen)
|
|
- return;
|
|
-
|
|
- if((wrote=write(outfd, pass, passlen))!=passlen) {
|
|
- if(wrote<0)
|
|
- syslog(LOG_ERR, "write error on outpipe: %m");
|
|
- else
|
|
- syslog(LOG_ERR, "short write on outpipe");
|
|
- err=1;
|
|
- }
|
|
- gtk_main_quit();
|
|
-}
|
|
-
|
|
-int main(int argc, char **argv)
|
|
-{
|
|
- GtkWidget *mainwindow, *vbox, *question, *answer, *ok;
|
|
- char buf[1024];
|
|
- gtk_init(&argc, &argv);
|
|
-
|
|
- openlog(argv[0], LOG_PID, LOG_DAEMON);
|
|
- if(argc!=4) {
|
|
- syslog(LOG_WARNING, "Usage error");
|
|
- return 1;
|
|
- }
|
|
- outfd=atoi(argv[3]);
|
|
- mainwindow=gtk_window_new(GTK_WINDOW_TOPLEVEL);
|
|
- gtk_window_set_title(GTK_WINDOW(mainwindow), "pppgetpass");
|
|
- gtk_signal_connect(GTK_OBJECT(mainwindow), "destroy",
|
|
- GTK_SIGNAL_FUNC(gtk_main_quit), 0);
|
|
-
|
|
- vbox=gtk_vbox_new(FALSE, 5);
|
|
- gtk_container_add(GTK_CONTAINER(mainwindow), vbox);
|
|
- gtk_widget_show(vbox);
|
|
-
|
|
- if(argv[1][0] && argv[2][0])
|
|
- snprintf(buf, sizeof buf, "Password for PPP client %s on server %s: ", argv[1], argv[2]);
|
|
- else if(argv[1][0] && !argv[2][0])
|
|
- snprintf(buf, sizeof buf, "Password for PPP client %s: ", argv[1]);
|
|
- else if(!argv[1][0] && argv[2][0])
|
|
- snprintf(buf, sizeof buf, "Password for PPP on server %s: ", argv[2]);
|
|
- else
|
|
- snprintf(buf, sizeof buf, "Enter PPP password: ");
|
|
- question=gtk_label_new(buf);
|
|
- gtk_box_pack_start(GTK_BOX(vbox), question, FALSE, TRUE, 0);
|
|
- gtk_widget_show(question);
|
|
-
|
|
- answer=gtk_entry_new();
|
|
- gtk_entry_set_visibility(GTK_ENTRY(answer), 0);
|
|
- gtk_box_pack_start(GTK_BOX(vbox), answer, FALSE, TRUE, 0);
|
|
- gtk_widget_show(answer);
|
|
-
|
|
- ok=gtk_button_new_with_label("OK");
|
|
- gtk_box_pack_start(GTK_BOX(vbox), ok, FALSE, TRUE, 0);
|
|
- gtk_signal_connect(GTK_OBJECT(ok), "clicked",
|
|
- GTK_SIGNAL_FUNC(okpressed), answer);
|
|
- gtk_widget_show(ok);
|
|
-
|
|
- gtk_widget_show(mainwindow);
|
|
- gtk_main();
|
|
-
|
|
- return err;
|
|
-}
|
|
diff -ruN ppp-2.4.2/contrib/pppgetpass/pppgetpass.sh ppp-cvs-20040427/contrib/pppgetpass/pppgetpass.sh
|
|
--- ppp-2.4.2/contrib/pppgetpass/pppgetpass.sh 1999-11-15 05:08:24.000000000 +0100
|
|
+++ ppp-cvs-20040427/contrib/pppgetpass/pppgetpass.sh 1970-01-01 01:00:00.000000000 +0100
|
|
@@ -1,7 +0,0 @@
|
|
-#!/bin/sh
|
|
-
|
|
-if [ -z "$DISPLAY" ]; then
|
|
- exec pppgetpass.vt "$@"
|
|
-else
|
|
- exec pppgetpass.gtk "$@"
|
|
-fi
|
|
diff -ruN ppp-2.4.2/contrib/pppgetpass/pppgetpass.vt.c ppp-cvs-20040427/contrib/pppgetpass/pppgetpass.vt.c
|
|
--- ppp-2.4.2/contrib/pppgetpass/pppgetpass.vt.c 1999-11-15 05:08:24.000000000 +0100
|
|
+++ ppp-cvs-20040427/contrib/pppgetpass/pppgetpass.vt.c 1970-01-01 01:00:00.000000000 +0100
|
|
@@ -1,218 +0,0 @@
|
|
-#include <stdio.h>
|
|
-#include <string.h>
|
|
-#include <stdlib.h>
|
|
-#include <errno.h>
|
|
-#include <unistd.h>
|
|
-#include <fcntl.h>
|
|
-#include <sys/stat.h>
|
|
-#include <sys/ioctl.h>
|
|
-#include <syslog.h>
|
|
-#include <termios.h>
|
|
-#include <sys/vt.h>
|
|
-
|
|
-static int console_owner(uid_t, int);
|
|
-
|
|
-int main(int argc, char **argv)
|
|
-{
|
|
- int console;
|
|
- uid_t uid;
|
|
- struct vt_stat origstate;
|
|
- int openvtnum;
|
|
- char openvtname[256];
|
|
- int openvt;
|
|
- gid_t gid;
|
|
- int chowned;
|
|
- FILE *fp;
|
|
- struct termios t;
|
|
- char pass[256], *nl;
|
|
- int outfd, passlen;
|
|
- ssize_t wrote;
|
|
- console=open("/dev/console", O_RDWR);
|
|
-
|
|
- uid=getuid();
|
|
- gid=getgid();
|
|
- seteuid(uid);
|
|
-
|
|
- openlog(argv[0], LOG_PID, LOG_DAEMON);
|
|
-
|
|
- if(argc!=4) {
|
|
- syslog(LOG_WARNING, "Usage error");
|
|
- return 1;
|
|
- }
|
|
-
|
|
- if(console<0) {
|
|
- syslog(LOG_ERR, "open(/dev/console): %m");
|
|
- return 1;
|
|
- }
|
|
-
|
|
- if(ioctl(console, VT_GETSTATE, &origstate)<0) {
|
|
- syslog(LOG_ERR, "VT_GETSTATE: %m");
|
|
- return 1;
|
|
- }
|
|
-
|
|
- if(uid) {
|
|
- if(!console_owner(uid, origstate.v_active)) {
|
|
- int i;
|
|
- for(i=0;i<64;++i) {
|
|
- if(i!=origstate.v_active && console_owner(uid, i))
|
|
- break;
|
|
- }
|
|
- if(i==64) {
|
|
- syslog(LOG_WARNING, "run by uid %lu not at console", (unsigned long)uid);
|
|
- return 1;
|
|
- }
|
|
- }
|
|
- }
|
|
-
|
|
- if(ioctl(console, VT_OPENQRY, &openvtnum)<0) {
|
|
- syslog(LOG_ERR, "VT_OPENQRY: %m");
|
|
- return 1;
|
|
- }
|
|
- if(openvtnum==-1) {
|
|
- syslog(LOG_ERR, "No free VTs");
|
|
- return 1;
|
|
- }
|
|
-
|
|
- snprintf(openvtname, sizeof openvtname, "/dev/tty%d", openvtnum);
|
|
- seteuid(0);
|
|
- openvt=open(openvtname, O_RDWR);
|
|
- if(openvt<0) {
|
|
- seteuid(uid);
|
|
- syslog(LOG_ERR, "open(%s): %m", openvtname);
|
|
- return 1;
|
|
- }
|
|
-
|
|
- chowned=fchown(openvt, uid, gid);
|
|
- if(chowned<0) {
|
|
- seteuid(uid);
|
|
- syslog(LOG_ERR, "fchown(%s): %m", openvtname);
|
|
- return 1;
|
|
- }
|
|
-
|
|
- close(console);
|
|
-
|
|
- if(ioctl(openvt, VT_ACTIVATE, openvtnum)<0) {
|
|
- seteuid(uid);
|
|
- syslog(LOG_ERR, "VT_ACTIVATE(%d): %m", openvtnum);
|
|
- return 1;
|
|
- }
|
|
-
|
|
- while(ioctl(openvt, VT_WAITACTIVE, openvtnum)<0) {
|
|
- if(errno!=EINTR) {
|
|
- ioctl(openvt, VT_ACTIVATE, origstate.v_active);
|
|
- seteuid(uid);
|
|
- syslog(LOG_ERR, "VT_WAITACTIVE(%d): %m", openvtnum);
|
|
- return 1;
|
|
- }
|
|
- }
|
|
-
|
|
- seteuid(uid);
|
|
- fp=fdopen(openvt, "r+");
|
|
- if(!fp) {
|
|
- seteuid(0);
|
|
- ioctl(openvt, VT_ACTIVATE, origstate.v_active);
|
|
- seteuid(uid);
|
|
- syslog(LOG_ERR, "fdopen(%s): %m", openvtname);
|
|
- return 1;
|
|
- }
|
|
-
|
|
- if(tcgetattr(openvt, &t)<0) {
|
|
- seteuid(0);
|
|
- ioctl(openvt, VT_ACTIVATE, origstate.v_active);
|
|
- seteuid(uid);
|
|
- syslog(LOG_ERR, "tcgetattr(%s): %m", openvtname);
|
|
- return 1;
|
|
- }
|
|
- t.c_lflag &= ~ECHO;
|
|
- if(tcsetattr(openvt, TCSANOW, &t)<0) {
|
|
- seteuid(0);
|
|
- ioctl(openvt, VT_ACTIVATE, origstate.v_active);
|
|
- seteuid(uid);
|
|
- syslog(LOG_ERR, "tcsetattr(%s): %m", openvtname);
|
|
- return 1;
|
|
- }
|
|
-
|
|
- if(fprintf(fp, "\033[2J\033[H")<0) {
|
|
- seteuid(0);
|
|
- ioctl(openvt, VT_ACTIVATE, origstate.v_active);
|
|
- seteuid(uid);
|
|
- syslog(LOG_ERR, "write error on %s: %m", openvtname);
|
|
- return 1;
|
|
- }
|
|
- if(argv[1][0] && argv[2][0]) {
|
|
- if(fprintf(fp, "Password for PPP client %s on server %s: ", argv[1], argv[2])<0) {
|
|
- seteuid(0);
|
|
- ioctl(openvt, VT_ACTIVATE, origstate.v_active);
|
|
- seteuid(uid);
|
|
- syslog(LOG_ERR, "write error on %s: %m", openvtname);
|
|
- return 1;
|
|
- }
|
|
- } else if(argv[1][0] && !argv[2][0]) {
|
|
- if(fprintf(fp, "Password for PPP client %s: ", argv[1])<0) {
|
|
- syslog(LOG_ERR, "write error on %s: %m", openvtname);
|
|
- seteuid(0);
|
|
- ioctl(openvt, VT_ACTIVATE, origstate.v_active);
|
|
- seteuid(uid);
|
|
- return 1;
|
|
- }
|
|
- } else if(!argv[1][0] && argv[2][0]) {
|
|
- if(fprintf(fp, "Password for PPP on server %s: ", argv[2])<0) {
|
|
- seteuid(0);
|
|
- ioctl(openvt, VT_ACTIVATE, origstate.v_active);
|
|
- seteuid(uid);
|
|
- syslog(LOG_ERR, "write error on %s: %m", openvtname);
|
|
- return 1;
|
|
- }
|
|
- } else {
|
|
- if(fprintf(fp, "Enter PPP password: ")<0) {
|
|
- seteuid(0);
|
|
- ioctl(openvt, VT_ACTIVATE, origstate.v_active);
|
|
- seteuid(uid);
|
|
- syslog(LOG_ERR, "write error on %s: %m", openvtname);
|
|
- return 1;
|
|
- }
|
|
- }
|
|
-
|
|
- if(!fgets(pass, sizeof pass, fp)) {
|
|
- seteuid(0);
|
|
- ioctl(openvt, VT_ACTIVATE, origstate.v_active);
|
|
- seteuid(uid);
|
|
- if(ferror(fp)) {
|
|
- syslog(LOG_ERR, "read error on %s: %m", openvtname);
|
|
- }
|
|
- return 1;
|
|
- }
|
|
- if((nl=strchr(pass, '\n')))
|
|
- *nl=0;
|
|
- passlen=strlen(pass);
|
|
-
|
|
- outfd=atoi(argv[3]);
|
|
- if((wrote=write(outfd, pass, passlen))!=passlen) {
|
|
- seteuid(0);
|
|
- ioctl(openvt, VT_ACTIVATE, origstate.v_active);
|
|
- seteuid(uid);
|
|
- if(wrote<0)
|
|
- syslog(LOG_ERR, "write error on outpipe: %m");
|
|
- else
|
|
- syslog(LOG_ERR, "short write on outpipe");
|
|
- return 1;
|
|
- }
|
|
-
|
|
- seteuid(0);
|
|
- ioctl(openvt, VT_ACTIVATE, origstate.v_active);
|
|
- seteuid(uid);
|
|
- return 0;
|
|
-}
|
|
-
|
|
-static int console_owner(uid_t uid, int cons)
|
|
-{
|
|
- char name[256];
|
|
- struct stat st;
|
|
- snprintf(name, sizeof name, "/dev/tty%d", cons);
|
|
- if(stat(name, &st)<0) {
|
|
- if(errno!=ENOENT)
|
|
- syslog(LOG_ERR, "stat(%s): %m", name);
|
|
- return 0;
|
|
- }
|
|
- return uid==st.st_uid;
|
|
-}
|
|
diff -ruN ppp-2.4.2/include/linux/if_ether.h ppp-cvs-20040427/include/linux/if_ether.h
|
|
--- ppp-2.4.2/include/linux/if_ether.h 2001-05-21 05:31:50.000000000 +0200
|
|
+++ ppp-cvs-20040427/include/linux/if_ether.h 1970-01-01 01:00:00.000000000 +0100
|
|
@@ -1,99 +0,0 @@
|
|
-/*
|
|
- * INET An implementation of the TCP/IP protocol suite for the LINUX
|
|
- * operating system. INET is implemented using the BSD Socket
|
|
- * interface as the means of communication with the user level.
|
|
- *
|
|
- * Global definitions for the Ethernet IEEE 802.3 interface.
|
|
- *
|
|
- * Version: @(#)if_ether.h 1.0.1a 02/08/94
|
|
- *
|
|
- * Author: Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
|
|
- * Donald Becker, <becker@super.org>
|
|
- * Alan Cox, <alan@redhat.com>
|
|
- * Steve Whitehouse, <gw7rrm@eeshack3.swan.ac.uk>
|
|
- *
|
|
- * This program is free software; you can redistribute it and/or
|
|
- * modify it under the terms of the GNU General Public License
|
|
- * as published by the Free Software Foundation; either version
|
|
- * 2 of the License, or (at your option) any later version.
|
|
- */
|
|
-
|
|
-#ifndef _LINUX_IF_ETHER_H
|
|
-#define _LINUX_IF_ETHER_H
|
|
-
|
|
-/*
|
|
- * IEEE 802.3 Ethernet magic constants. The frame sizes omit the preamble
|
|
- * and FCS/CRC (frame check sequence).
|
|
- */
|
|
-
|
|
-#define ETH_ALEN 6 /* Octets in one ethernet addr */
|
|
-#define ETH_HLEN 14 /* Total octets in header. */
|
|
-#define ETH_ZLEN 60 /* Min. octets in frame sans FCS */
|
|
-#define ETH_DATA_LEN 1500 /* Max. octets in payload */
|
|
-#define ETH_FRAME_LEN 1514 /* Max. octets in frame sans FCS */
|
|
-
|
|
-/*
|
|
- * These are the defined Ethernet Protocol ID's.
|
|
- */
|
|
-
|
|
-#define ETH_P_LOOP 0x0060 /* Ethernet Loopback packet */
|
|
-#define ETH_P_PUP 0x0200 /* Xerox PUP packet */
|
|
-#define ETH_P_PUPAT 0x0201 /* Xerox PUP Addr Trans packet */
|
|
-#define ETH_P_IP 0x0800 /* Internet Protocol packet */
|
|
-#define ETH_P_X25 0x0805 /* CCITT X.25 */
|
|
-#define ETH_P_ARP 0x0806 /* Address Resolution packet */
|
|
-#define ETH_P_BPQ 0x08FF /* G8BPQ AX.25 Ethernet Packet [ NOT AN OFFICIALLY REGISTERED ID ] */
|
|
-#define ETH_P_IEEEPUP 0x0a00 /* Xerox IEEE802.3 PUP packet */
|
|
-#define ETH_P_IEEEPUPAT 0x0a01 /* Xerox IEEE802.3 PUP Addr Trans packet */
|
|
-#define ETH_P_DEC 0x6000 /* DEC Assigned proto */
|
|
-#define ETH_P_DNA_DL 0x6001 /* DEC DNA Dump/Load */
|
|
-#define ETH_P_DNA_RC 0x6002 /* DEC DNA Remote Console */
|
|
-#define ETH_P_DNA_RT 0x6003 /* DEC DNA Routing */
|
|
-#define ETH_P_LAT 0x6004 /* DEC LAT */
|
|
-#define ETH_P_DIAG 0x6005 /* DEC Diagnostics */
|
|
-#define ETH_P_CUST 0x6006 /* DEC Customer use */
|
|
-#define ETH_P_SCA 0x6007 /* DEC Systems Comms Arch */
|
|
-#define ETH_P_RARP 0x8035 /* Reverse Addr Res packet */
|
|
-#define ETH_P_ATALK 0x809B /* Appletalk DDP */
|
|
-#define ETH_P_AARP 0x80F3 /* Appletalk AARP */
|
|
-#define ETH_P_IPX 0x8137 /* IPX over DIX */
|
|
-#define ETH_P_IPV6 0x86DD /* IPv6 over bluebook */
|
|
-#define ETH_P_PPP_DISC 0x8863 /* PPPoE discovery messages */
|
|
-#define ETH_P_PPP_SES 0x8864 /* PPPoE session messages */
|
|
-#define ETH_P_ATMMPOA 0x884c /* MultiProtocol Over ATM */
|
|
-#define ETH_P_ATMFATE 0x8884 /* Frame-based ATM Transport
|
|
- * over Ethernet
|
|
- */
|
|
-
|
|
-/*
|
|
- * Non DIX types. Won't clash for 1500 types.
|
|
- */
|
|
-
|
|
-#define ETH_P_802_3 0x0001 /* Dummy type for 802.3 frames */
|
|
-#define ETH_P_AX25 0x0002 /* Dummy protocol id for AX.25 */
|
|
-#define ETH_P_ALL 0x0003 /* Every packet (be careful!!!) */
|
|
-#define ETH_P_802_2 0x0004 /* 802.2 frames */
|
|
-#define ETH_P_SNAP 0x0005 /* Internal only */
|
|
-#define ETH_P_DDCMP 0x0006 /* DEC DDCMP: Internal only */
|
|
-#define ETH_P_WAN_PPP 0x0007 /* Dummy type for WAN PPP frames*/
|
|
-#define ETH_P_PPP_MP 0x0008 /* Dummy type for PPP MP frames */
|
|
-#define ETH_P_LOCALTALK 0x0009 /* Localtalk pseudo type */
|
|
-#define ETH_P_PPPTALK 0x0010 /* Dummy type for Atalk over PPP*/
|
|
-#define ETH_P_TR_802_2 0x0011 /* 802.2 frames */
|
|
-#define ETH_P_MOBITEX 0x0015 /* Mobitex (kaz@cafe.net) */
|
|
-#define ETH_P_CONTROL 0x0016 /* Card specific control frames */
|
|
-#define ETH_P_IRDA 0x0017 /* Linux-IrDA */
|
|
-#define ETH_P_ECONET 0x0018 /* Acorn Econet */
|
|
-
|
|
-/*
|
|
- * This is an Ethernet frame header.
|
|
- */
|
|
-
|
|
-struct ethhdr
|
|
-{
|
|
- unsigned char h_dest[ETH_ALEN]; /* destination eth addr */
|
|
- unsigned char h_source[ETH_ALEN]; /* source ether addr */
|
|
- unsigned short h_proto; /* packet type ID field */
|
|
-};
|
|
-
|
|
-#endif /* _LINUX_IF_ETHER_H */
|
|
diff -ruN ppp-2.4.2/include/pcap-int.h ppp-cvs-20040427/include/pcap-int.h
|
|
--- ppp-2.4.2/include/pcap-int.h 2000-08-01 03:37:24.000000000 +0200
|
|
+++ ppp-cvs-20040427/include/pcap-int.h 2000-08-01 03:37:24.000000000 +0200
|
|
@@ -30,7 +30,7 @@
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
* SUCH DAMAGE.
|
|
*
|
|
- * @(#) $Header: /data/cvs/ppp/include/pcap-int.h,v 1.1 2000/08/01 01:37:24 paulus Exp $ (LBL)
|
|
+ * @(#) $Header: /cvsroot/ppp/include/pcap-int.h,v 1.1 2000/08/01 01:37:24 paulus Exp $ (LBL)
|
|
*/
|
|
|
|
#ifndef pcap_int_h
|
|
diff -ruN ppp-2.4.2/modules/bsd-comp.c ppp-cvs-20040427/modules/bsd-comp.c
|
|
--- ppp-2.4.2/modules/bsd-comp.c 1998-03-19 06:59:01.000000000 +0100
|
|
+++ ppp-cvs-20040427/modules/bsd-comp.c 2004-01-17 06:50:11.000000000 +0100
|
|
@@ -41,7 +41,7 @@
|
|
* This version is for use with STREAMS under SunOS 4.x,
|
|
* Digital UNIX, AIX 4.x, and SVR4 systems including Solaris 2.
|
|
*
|
|
- * $Id: bsd-comp.c,v 1.20 1996/08/28 06:31:57 paulus Exp $
|
|
+ * $Id: bsd-comp.c,v 1.21 2004/01/17 05:47:55 carlsonj Exp $
|
|
*/
|
|
|
|
#ifdef AIX4
|
|
@@ -66,6 +66,10 @@
|
|
#define BSD_LITTLE_ENDIAN
|
|
#endif
|
|
|
|
+#ifdef SOL2
|
|
+#include <sys/sunddi.h>
|
|
+#endif
|
|
+
|
|
#define PACKETPTR mblk_t *
|
|
#include <net/ppp-comp.h>
|
|
|
|
diff -ruN ppp-2.4.2/modules/deflate.c ppp-cvs-20040427/modules/deflate.c
|
|
--- ppp-2.4.2/modules/deflate.c 2002-12-06 10:49:15.000000000 +0100
|
|
+++ ppp-cvs-20040427/modules/deflate.c 2004-01-17 06:50:11.000000000 +0100
|
|
@@ -35,7 +35,7 @@
|
|
* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
|
|
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
*
|
|
- * $Id: deflate.c,v 1.11 2002/12/06 09:49:15 paulus Exp $
|
|
+ * $Id: deflate.c,v 1.12 2004/01/17 05:47:55 carlsonj Exp $
|
|
*/
|
|
|
|
#ifdef AIX4
|
|
@@ -56,6 +56,10 @@
|
|
#include "../common/zlib.h"
|
|
#endif
|
|
|
|
+#ifdef SOL2
|
|
+#include <sys/sunddi.h>
|
|
+#endif
|
|
+
|
|
#if DO_DEFLATE
|
|
|
|
#define DEFLATE_DEBUG 1
|
|
diff -ruN ppp-2.4.2/modules/vjcompress.c ppp-cvs-20040427/modules/vjcompress.c
|
|
--- ppp-2.4.2/modules/vjcompress.c 1999-09-17 04:03:56.000000000 +0200
|
|
+++ ppp-cvs-20040427/modules/vjcompress.c 2004-01-17 06:50:11.000000000 +0100
|
|
@@ -29,7 +29,7 @@
|
|
* This version is used under SunOS 4.x, Digital UNIX, AIX 4.x,
|
|
* and SVR4 systems including Solaris 2.
|
|
*
|
|
- * $Id: vjcompress.c,v 1.10 1999/09/15 23:49:06 masputra Exp $
|
|
+ * $Id: vjcompress.c,v 1.11 2004/01/17 05:47:55 carlsonj Exp $
|
|
*/
|
|
|
|
#include <sys/types.h>
|
|
@@ -56,6 +56,10 @@
|
|
#include <netinet/in_systm.h>
|
|
#endif
|
|
|
|
+#ifdef SOL2
|
|
+#include <sys/sunddi.h>
|
|
+#endif
|
|
+
|
|
#include <netinet/ip.h>
|
|
#include <netinet/tcp.h>
|
|
|
|
diff -ruN ppp-2.4.2/ppp.texi ppp-cvs-20040427/ppp.texi
|
|
--- ppp-2.4.2/ppp.texi 1970-01-01 01:00:00.000000000 +0100
|
|
+++ ppp-cvs-20040427/ppp.texi 1996-08-28 08:30:33.000000000 +0200
|
|
@@ -0,0 +1,561 @@
|
|
+\input texinfo @c -*-texinfo-*-
|
|
+@setfilename ppp.info
|
|
+@settitle PPP
|
|
+
|
|
+@iftex
|
|
+@finalout
|
|
+@end iftex
|
|
+
|
|
+@ifinfo
|
|
+@format
|
|
+START-INFO-DIR-ENTRY
|
|
+* PPP: (ppp). Point-to-Point Protocol.
|
|
+END-INFO-DIR-ENTRY
|
|
+@end format
|
|
+
|
|
+@titlepage
|
|
+@title PPP-2.x Users' Guide
|
|
+@author by Paul Mackerras
|
|
+@end titlepage
|
|
+
|
|
+@node Top, Introduction, (dir), (dir)
|
|
+
|
|
+@ifinfo
|
|
+This file documents how to use the ppp-2.x package to set up network
|
|
+links over serial lines with the Point-to-Point Protocol.
|
|
+
|
|
+@end ifinfo
|
|
+
|
|
+@menu
|
|
+* Introduction:: Basic concepts of the Point-to-Point
|
|
+ Protocol and the ppp-2.x package.
|
|
+* Installation:: How to compile and install the software.
|
|
+* Configuration:: How to set up your system for
|
|
+ establishing a link to another system.
|
|
+* Security:: Avoid creating security holes.
|
|
+* Compression:: Using compression of various kinds
|
|
+ to improve throughput.
|
|
+@end menu
|
|
+
|
|
+@node Introduction, Installation, Top, Top
|
|
+@chapter Introduction
|
|
+
|
|
+The Point-to-Point Protocol (PPP) is the protocol of choice for
|
|
+establishing network links over serial lines. This package (ppp-2.x)
|
|
+provides an implementation of PPP which supports the Internet Protocols
|
|
+(TCP/IP, UDP/IP, etc.) and which runs on a range of Unix workstations.
|
|
+
|
|
+A typical use of PPP is to provide a network connection, via a modem,
|
|
+between a workstation and an Internet Service Provider (ISP). When this
|
|
+connection is established, the workstation is connected to the internet,
|
|
+and applications running on the workstation can then make connections to
|
|
+other hosts anywhere on the internet. This package can be used at
|
|
+either or both ends of such a link.
|
|
+
|
|
+Features of PPP include:
|
|
+@itemize @bullet
|
|
+@item
|
|
+Multi-protocol support. The PPP packet encapsulation includes a
|
|
+protocol field, allowing packets from many different protocols to be
|
|
+multiplexed across a single link.
|
|
+@item
|
|
+Negotiation of link characteristics. During link establishment, the two
|
|
+systems negotiate about the link configuration parameters, such as the
|
|
+IP addresses of each end of the link.
|
|
+@item
|
|
+Authentication. Optionally, each system can be configured to require the
|
|
+other system to authenticate itself. In this way, access can be
|
|
+restricted to authorized systems.
|
|
+@item
|
|
+Transparency. On asynchronous serial lines, PPP can be configured to
|
|
+transmit certain characters as a two-character escape sequence.
|
|
+@item
|
|
+Compression. PPP includes support for various kinds of compression to
|
|
+be applied to the packets before they are transmitted.
|
|
+@end itemize
|
|
+
|
|
+The ppp-2.x software consists of two parts:
|
|
+
|
|
+@itemize @bullet
|
|
+
|
|
+@item
|
|
+Kernel code, which establishes a network interface and passes packets
|
|
+between the serial port, the kernel networking code and the PPP daemon
|
|
+(@file{pppd}). This code is implemented using STREAMS modules on
|
|
+Solaris 2, SunOS 4.x, AIX 4.1 and OSF/1, and as a tty line discipline
|
|
+under Ultrix, NextStep, NetBSD, FreeBSD, and Linux.
|
|
+
|
|
+@item
|
|
+The PPP daemon (@file{pppd}), which negotiates with the peer to
|
|
+establish the link and sets up the ppp network interface. Pppd includes
|
|
+support for authentication. It can authenticate itself to the other
|
|
+system and/or require the other system to authenticate itself, so that
|
|
+you can control which other systems may make a PPP connection and what
|
|
+IP addresses they may use.
|
|
+@end itemize
|
|
+
|
|
+@menu
|
|
+* PPP Concepts:: Basic concepts and terms used with PPP.
|
|
+* PPP packet format:: How data is packaged up for transmission.
|
|
+* LCP negotiation:: The parameters which are negotiated
|
|
+ using the Link Control Protocol.
|
|
+* IPCP negotiation:: The parameters which are negotiated
|
|
+ using the IP Control Protocol.
|
|
+@end menu
|
|
+
|
|
+@node PPP Concepts, PPP packet format, Introduction, Introduction
|
|
+@section PPP Concepts
|
|
+
|
|
+To use PPP to provide a network connection between two machines, there
|
|
+must be some way that a stream of bytes, or characters, can be passed
|
|
+from one to the other, in both directions independently. We refer to
|
|
+this as the ``serial link''. Very often the serial link involves
|
|
+asynchronous communications ports and modems, but other kinds of serial
|
|
+link are possible.
|
|
+
|
|
+The serial link must transmit (at least) 8 bits per character; PPP
|
|
+cannot work over a serial link which transmits only 7 bits per
|
|
+character. However, it need not transmit all byte values transparently.
|
|
+PPP has a mechanism to avoid sending certain characters if it is known
|
|
+that the some element of the serial link interprets them specially. For
|
|
+example, the DC1 and DC3 ASCII characters (control-Q and control-S) may
|
|
+be trapped by a modem if it is set for ``software'' flow control. PPP
|
|
+can send these characters as a two-character ``escape'' sequence. The
|
|
+set of characters which are to be transmitted as an escape sequence is
|
|
+represented in an ``async control character map'' (ACCM). The ``async''
|
|
+part refers to the fact that this facility is used for asynchronous
|
|
+serial links. For synchronous serial connections, the HDLC bit-stuffing
|
|
+procedure is used instead.
|
|
+
|
|
+The two systems connected by the serial link are called ``peers''. When
|
|
+we are talking from the point of view of one of the systems, the other
|
|
+is often referred to as ``the peer''. Sometimes we may refer to one
|
|
+system as a ``client'' and the other as a ``server''. This distinction
|
|
+refers mainly to the way the serial link is set up; usually the client
|
|
+is the peer that initiates the connection, for example by dialling the
|
|
+server with its modem.
|
|
+
|
|
+During the lifetime of a PPP connection, it proceeds through several
|
|
+phases:
|
|
+
|
|
+@enumerate
|
|
+@item
|
|
+Serial link establishment. In this phase, the serial link is set up and
|
|
+PPP protocol software is attached to each end of the serial link. The
|
|
+precise steps involved in doing this vary greatly, depending on the
|
|
+nature of the serial link. For the common case of modems connected
|
|
+through the telephone network, this involves first sending commands to
|
|
+the modem to cause it to dial the remote system. When the remote system
|
|
+answers, the local system usually has to supply a username and password,
|
|
+and then issue a command to invoke PPP software on the remote system.
|
|
+The ``chat'' program supplied with ppp-2.x provides a way to automate a
|
|
+dialog with the modem and the remote system. This phase is not
|
|
+standardized; it is outside the scope of the PPP protocol
|
|
+specifications.
|
|
+
|
|
+@item
|
|
+Link Control Protocol (LCP) negotiation. In this phase, the peers send
|
|
+LCP packets to each other to negotiate various parameters of the
|
|
+connection, such as the ACCM to be used in each direction, whether
|
|
+authentication is required, and whether or not to use various forms of
|
|
+compression. When the peers reach agreement on these parameters, LCP is
|
|
+said to be ``up''.
|
|
+
|
|
+@item
|
|
+Authentication. If one (or both) of the peers requires the other
|
|
+peer to authenticate itself, that occurs next. If one of the peers
|
|
+cannot successfully authenticate itself, the other peer terminates the
|
|
+link.
|
|
+
|
|
+@item
|
|
+Network Control Protocol (NCP) negotiation. PPP can potentially support
|
|
+several different network protocols, although IP is the only network
|
|
+protocol (NP) supported by the ppp-2.x package. Each NP has an
|
|
+associated NCP defined for it, which is used to negotiate the specific
|
|
+parameters which affect that NP. For example, the IP Control Protocol
|
|
+(IPCP) is used to negotiate the IP addresses for each end of the link,
|
|
+and whether the TCP header compression method described by Van Jacobsen
|
|
+in RFC 1144 (``VJ compression'') is to be used.
|
|
+
|
|
+@item
|
|
+Network communication. When each NCP has successfully negotiated the
|
|
+parameters for its NP, that NCP is said to be ``up''. At that point,
|
|
+the PPP link is made available for data traffic from that NP. For
|
|
+example, when IPCP comes up, the PPP link is then available for carrying
|
|
+IP packets (which of course includes packets from those protocols which
|
|
+are layered above IP, such as TCP, UDP, etc.)
|
|
+
|
|
+@item
|
|
+Termination. When the link is no longer required, it is terminated.
|
|
+Usually this involves an exchange of LCP packets so that one peer can
|
|
+notify the other that it is shutting down the link, enabling both peers
|
|
+to shut down in an orderly manner. But of course there are occasions
|
|
+when the link terminates because the serial link is interrupted, for
|
|
+example, when a modem loses carrier and hangs up.
|
|
+
|
|
+@end enumerate
|
|
+
|
|
+The protocols in the PPP family are produced by the Point-to-Point
|
|
+Working Group of the Internet Engineering Task Force, and are specified
|
|
+in RFC (Request for Comments) documents, available by anonymous FTP from
|
|
+several sites.
|
|
+
|
|
+PPP is defined in several RFCs, in
|
|
+particular RFCs 1661, 1662, and 1334. IPCP is defined in RFC 1332.
|
|
+Other RFCs describe the control protocols for other network protocols
|
|
+(e.g., DECnet, OSI, Appletalk). RFCs are available by anonymous FTP
|
|
+from several sites including nic.ddn.mil, nnsc.nsf.net, nic.nordu.net,
|
|
+ftp.nisc.sri.com, and munnari.oz.au.
|
|
+
|
|
+@node PPP packet format, LCP negotiation, PPP Concepts, Introduction
|
|
+@section PPP packet format
|
|
+
|
|
+PPP transmits packets over the serial link using a simple encapsulation
|
|
+scheme. First, a two-byte PPP Protocol field is inserted before the
|
|
+data to be sent. The value in this field identifies
|
|
+which higher-level protocol (either a network protocol such as IP or a
|
|
+PPP control protocol such as LCP) should receive the data in the packet.
|
|
+By default, a one-byte Address field with the value 0xFF, and a one-byte
|
|
+Control field with the value 0x03, are inserted before the PPP Protocol
|
|
+field (apparently this is supposed to provide compatibility with HDLC,
|
|
+in case there is a synchronous to asynchronous converter in the serial
|
|
+link).
|
|
+
|
|
+On slow serial links, these fields can be compressed down to one byte in
|
|
+most cases. The PPP Address and Control fields are compressed by simply
|
|
+omitting them (``address/control compression''). The PPP Protocol field
|
|
+values are chosen so that bit 0 (the least-significant bit) of the first
|
|
+(most significant) byte is always 0, and bit 0 of the second byte is
|
|
+always 1. The PPP Protocol field can be compressed by omitting the
|
|
+first byte, provided that it is 0 (``protocol compression''). The
|
|
+values for this field are assigned so that the first byte is zero for
|
|
+all of the commonly-used network protocols. For example, the PPP
|
|
+Protocol field value for IP is 0x21.
|
|
+
|
|
+For asynchronous serial links, which do not provide any packet framing
|
|
+or transparency, a further encapsulation is used as follows. First a
|
|
+16-bit Frame Check Sequence (FCS) is computed over the packet to be
|
|
+sent, and appended as two bytes to the end of the packet.
|
|
+
|
|
+Then each byte of the packet is examined, and if it contains one of the
|
|
+characters which are to be escaped, it is replaced by a two byte
|
|
+sequence: the 0x7d character '}', followed by the character with bit 5
|
|
+inverted. For example, the control-C character (0x03) could be replaced
|
|
+by the two-byte sequence 0x7d, 0x23 ('}#'). The 0x7d and 0x7e ('~')
|
|
+characters are always escaped, and the 0x5e ('^') character may not be
|
|
+escaped.
|
|
+
|
|
+Finally, a ``flag'' character (0x7e, '~') is inserted at the beginning
|
|
+and end of the packet to mark the packet boundaries. The initial flag
|
|
+may be omitted if this packet immediately follows another packet, as the
|
|
+ending flag for the previous packet can serve as the beginning flag of
|
|
+this packet.
|
|
+
|
|
+@node LCP negotiation, IPCP negotiation, PPP packet format, Introduction
|
|
+@section LCP negotiation
|
|
+
|
|
+The LCP negotiation process actually involves two sets of negotiations,
|
|
+one for each direction of the PPP connection. Thus A will send B
|
|
+packets (``Configure-Requests'') describing what characteristics A would
|
|
+like to have apply to the B -> A direction of the link, that is, to the
|
|
+packets that A will receive. Similarly B will send A packets describing
|
|
+the characteristics it would like to have apply to the packets it will
|
|
+be receiving. These characteristics need not necessarily be the same in
|
|
+both directions.
|
|
+
|
|
+The parameters which are negotiated for each direction of the connection
|
|
+using LCP are:
|
|
+
|
|
+@itemize @bullet
|
|
+@item
|
|
+Maximum Receive Unit (MRU): indicates the maximum packet size which we
|
|
+are prepared to receive (specifically the maximum size of the
|
|
+data portion of the packet). The default value is 1500, but on
|
|
+slow serial links, smaller values give better response. The choice of
|
|
+MRU is discussed below (see xxx).
|
|
+
|
|
+@item
|
|
+Async Control Character Map (ACCM): indicates the set of control
|
|
+characters (characters with ASCII values in the range 0 - 31) which we
|
|
+wish to receive in escaped form. The default is that the sender should
|
|
+escape all characters in the range 0 - 31.
|
|
+
|
|
+@item
|
|
+Authentication Protocol: indicates which protocol we would like the peer
|
|
+to use to authenticate itself. Common choices are the Password
|
|
+Authentication Protocol (PAP) and the Cryptographic Handshake
|
|
+Authentication Protocol (CHAP).
|
|
+
|
|
+@item
|
|
+Quality Protocol: indicates which protocol which we would like the peer
|
|
+to use to send us link quality reports. The ppp-2.x package does not
|
|
+currently support link quality reports.
|
|
+
|
|
+@item
|
|
+Magic Number: a randomly-chosen number, different from the peer's magic
|
|
+number. If we persistently receive our own magic number in the peer's
|
|
+configure-request packets, then we can conclude that the serial link is
|
|
+looped back.
|
|
+
|
|
+@item
|
|
+Protocol Field Compression: indicates that we wish the peer to compress
|
|
+the PPP Protocol field to one byte, where possible, in the packets it
|
|
+sends.
|
|
+
|
|
+@item
|
|
+Address/Control Field Compression: indicates that we wish the peer to
|
|
+compress the PPP Address/Control fields (by simply omitting them) in the
|
|
+packets it sends.
|
|
+@end itemize
|
|
+
|
|
+@node IPCP negotiation, , LCP negotiation, Introduction
|
|
+@section IPCP negotiation
|
|
+
|
|
+The IPCP negotiation process is very similar to the LCP negotiation
|
|
+process, except that of course different parameters are negotiated.
|
|
+The parameters which are negotiated using IPCP are:
|
|
+
|
|
+@itemize @bullet
|
|
+@item
|
|
+IP Address: the IP address (32-bit host IP number) which we plan to use
|
|
+as the local address for our end of the link.
|
|
+
|
|
+@item
|
|
+TCP header compression: indicates (a) that we wish the peer to compress
|
|
+the TCP/IP headers of TCP/IP packets that it sends, using the Van
|
|
+Jacobson algorithm as described in RFC1144; (b) the maximum slot ID that
|
|
+we wish the peer to use, and (c) whether we are prepared to accept
|
|
+packets with the slot ID field compressed (omitted).
|
|
+
|
|
+With Van Jacobson (VJ) compression, the receiver and transmitter (for
|
|
+one direction of the connection) both keep a table, with a certain
|
|
+number of ``slots'', where each slot holds the TCP/IP header of the most
|
|
+recently transmitted packet for one TCP connection. If a packet is to
|
|
+be transmitted for a TCP connection which does not have a slot currently
|
|
+allocated, the VJ scheme will allocate one of the slots and send the
|
|
+entire TCP/IP header, together with the slot number. For many packets,
|
|
+there will be a slot already allocated for the TCP connection, and the
|
|
+VJ scheme will then often be able to replace the entire TCP/IP header
|
|
+with a much smaller compressed header (typically only 3 - 7 bytes)
|
|
+describing which fields of the TCP/IP header have changed, and by how
|
|
+much. If there are many more active connections than slots, the
|
|
+efficiency of the VJ scheme will drop, because it will not be able to
|
|
+send compressed headers as often.
|
|
+
|
|
+Usually the compressed header includes a one-byte slot index, indicating
|
|
+which TCP connection the packet is for. It is possible to reduce the
|
|
+header size by omitting the slot index when the packet has the same slot
|
|
+index as the previous packet. However, this introduces a danger if the
|
|
+lower levels of the PPP software can sometimes drop damaged packets
|
|
+without informing the VJ decompressor, as it may then assume the wrong
|
|
+slot index for packets which have the slot index field omitted. With
|
|
+the ppp-2.x software, however, the probability of this happening is
|
|
+generally very small (see xxx).
|
|
+
|
|
+@end itemize
|
|
+
|
|
+@node Installation, Configuration, Introduction, Top
|
|
+@chapter Installation
|
|
+
|
|
+Because ppp-2.x includes code which must be incorporated into the
|
|
+kernel, its installation process is necessarily quite heavily
|
|
+system-dependent. In addition, you will require super-user privileges
|
|
+(root access) to install the code.
|
|
+
|
|
+Some systems provide a ``modload'' facility, which allows you to load
|
|
+new code into a running kernel without relinking the kernel or
|
|
+rebooting. Under Solaris 2, SunOS 4.x, Linux, OSF/1 and NextStep, this
|
|
+is the recommended (or only) way to install the kernel portion of the
|
|
+ppp-2.x package.
|
|
+
|
|
+Under the remaining supported operating systems (NetBSD, FreeBSD,
|
|
+Ultrix), it is necessary to go through the process of creating a new
|
|
+kernel image and reboot. (Note that NetBSD and FreeBSD have a modload
|
|
+facility, but ppp-2.x is currently not configured to take advantage of
|
|
+it.)
|
|
+
|
|
+Detailed installation instructions for each operating system are
|
|
+contained in the README files in the ppp-2.x distribution. In general,
|
|
+the process involves executing the commands @samp{./configure},
|
|
+@samp{make} and (as root) @samp{make install} in the ppp-2.x
|
|
+distribution directory. (The Linux port requires the installation of
|
|
+some header files before compiling; see README.linux for details.)
|
|
+
|
|
+@node Configuration, Security, Installation, Top
|
|
+@chapter Configuration
|
|
+
|
|
+Once the ppp-2.x software is installed, you need to configure your
|
|
+system for the particular PPP connections you wish to allow. Typically,
|
|
+the elements you need to configure are:
|
|
+
|
|
+@itemize @bullet
|
|
+@item
|
|
+How the serial link is established and how pppd gets invoked.
|
|
+@item
|
|
+Setting up syslog to log messages from pppd to the console and/or
|
|
+system log files.
|
|
+@item
|
|
+Pppd options to be used.
|
|
+@item
|
|
+Authentication secrets to use in authenticating us to the peer
|
|
+and/or the peer to us.
|
|
+@item
|
|
+The IP addresses for each end of the link.
|
|
+@end itemize
|
|
+
|
|
+In most cases, the system you are configuring will either be a
|
|
+@dfn{client} system, actively initiating a PPP connection on user
|
|
+request, or it will be a @dfn{server} system, passively waiting for
|
|
+connections from client systems. Other arrangements are possible, but
|
|
+the instructions in this system assume that you are configuring either a
|
|
+client or a server.
|
|
+
|
|
+These instructions also assume that the serial link involves a serial
|
|
+communications port (that is, a tty device), since pppd requires a
|
|
+serial port.
|
|
+
|
|
+@menu
|
|
+* Client machines::
|
|
+* Server machines::
|
|
+* Setting up syslog::
|
|
+* Pppd options::
|
|
+* Authentication secrets files::
|
|
+* IP Addresses::
|
|
+@end menu
|
|
+
|
|
+@node Client machines, Server machines, Configuration, Configuration
|
|
+@section Client machines
|
|
+
|
|
+On a client machine, the way that the user requests that a connection be
|
|
+established is by running pppd, either directly or through a shell
|
|
+script. Pppd should be given the name of the serial port to use as an
|
|
+option. In this mode, pppd will fork and detach itself from its
|
|
+controlling terminal, so that the shell will return to its prompt. (If
|
|
+this behaviour is not desired, use the -detach option.)
|
|
+
|
|
+Usually, the connect option should also be used. The connect option
|
|
+takes an argument which is a command to run to establish the serial link
|
|
+and invoke PPP software on the remote machine. This command is run with
|
|
+its standard input and standard output connected to the serial port.
|
|
+Giving the connect option to pppd also has the side-effect of causing
|
|
+pppd to open the serial port without waiting for the modem carrier
|
|
+detect signal.
|
|
+
|
|
+The process of establishing the serial link often involves a dialog. If
|
|
+the serial port is connected to a modem, we first need to send some
|
|
+commands to the modem to configure it and dial the remote system. Often
|
|
+there is then a dialog with the remote system to supply a username and
|
|
+password. The @file{chat} program supplied with the ppp-2.x package is
|
|
+useful for automating such dialogs. Chat uses a @dfn{script} consisting
|
|
+of alternately strings to expect to receive on the serial port, and
|
|
+strings to send on the serial port. The script can also specify strings
|
|
+which indicate an error and abort the dialog.
|
|
+
|
|
+@node Server machines, , Client machines, Configuration
|
|
+@section Server machines
|
|
+
|
|
+There are generally three ways in which a server machine can be set up
|
|
+to allow client machines to establish a PPP link:
|
|
+
|
|
+@enumerate
|
|
+@item
|
|
+Client machines log in as regular users (often via a serial port
|
|
+connected to a modem, but possibly through a telnet or rlogin session)
|
|
+and then run pppd as a shell command.
|
|
+@item
|
|
+Client machines log in using a username whose login shell is pppd
|
|
+or a script which runs pppd.
|
|
+@item
|
|
+Client machines connect to a serial port which has a pppd running
|
|
+permanently on it (instead of a "getty" or other program providing a
|
|
+login service).
|
|
+@end enumerate
|
|
+
|
|
+Method 1 is very simple to set up, and is useful where existing users of
|
|
+a system have remote machines (for example at home) from which they want
|
|
+to establish a PPP connection from time to time. Methods 2 and 3
|
|
+possibly have a security advantage in that they do not allow PPP client
|
|
+systems access to a shell. Method 2 allows regular logins and PPP
|
|
+connections on the same port, while with method 3, would-be crackers may
|
|
+well be frustrated (unless they speak fluent PPP).
|
|
+
|
|
+With any of these methods, I strongly recommend that you configure PPP
|
|
+to require authentication from the client, by including the `auth'
|
|
+option in the /etc/ppp/options file.
|
|
+
|
|
+@node Setting up syslog, , Server machines, Configuration
|
|
+@section Setting up syslog
|
|
+
|
|
+Pppd uses the @file{syslog} facility to report information about the
|
|
+state of the connection, as does @file{chat}. It is useful to set up
|
|
+syslog to print some of these messages on the console, and to record
|
|
+most of them to a file. The messages from pppd are logged with facility
|
|
+@samp{daemon} and one of three levels:
|
|
+@itemize @bullet
|
|
+@item
|
|
+@samp{notice} for messages about important events such as the
|
|
+connection becoming available for IP traffic and the local and remote IP
|
|
+addresses in use.
|
|
+@item
|
|
+@samp{info} for messages about less important events, such as
|
|
+detecting a modem hangup.
|
|
+@item
|
|
+@samp{debug} for messages which are of use in working out why the
|
|
+connection is not working properly.
|
|
+@end itemize
|
|
+
|
|
+The messages from chat are logged with facility @samp{local2} and level
|
|
+@samp{debug}.
|
|
+
|
|
+Syslog is controlled by the syslog configuration file
|
|
+@file{/etc/syslog.conf}. Generally the standard configuration will log
|
|
+facility @samp{daemon} messages with level @samp{notice} and above to a
|
|
+system log file such as @file{/var/log/syslog} (the name may vary on
|
|
+different systems). I find it useful to have the notice level messages
|
|
+from pppd displayed on the console, and all messages from pppd and chat
|
|
+logged to a file such as @file{/etc/ppp/log}. To achieve this,
|
|
+find the line in /etc/syslog.conf which has /dev/console
|
|
+on the right-hand side, and add `daemon.notice' on the left. This
|
|
+line should end up something like this:
|
|
+
|
|
+@example
|
|
+*.err;kern.debug;auth.notice;mail.crit;daemon.notice /dev/console
|
|
+@end example
|
|
+
|
|
+And add a line like this:
|
|
+
|
|
+@example
|
|
+daemon,local2.debug /etc/ppp/log
|
|
+@end example
|
|
+
|
|
+The space between the left and right hand sides is one or more tabs, not
|
|
+spaces, and there are no tabs or spaces at the beginning of the line.
|
|
+
|
|
+You will need to create an empty @file{/etc/ppp/log} file; syslogd will
|
|
+not create it. Once you have modified @file{/etc/syslog.conf}, you need
|
|
+to either reboot or notify syslogd to re-read the file. On most
|
|
+systems, you notify syslogd by sending it a SIGHUP signal. Syslogd's
|
|
+process ID is usually stored in a file such as @file{/etc/syslogd.pid}
|
|
+or @file{/var/run/syslog.pid}. Thus you can notify syslogd to re-read
|
|
+the file by executing a command such as:
|
|
+
|
|
+@example
|
|
+kill -HUP `cat /etc/syslogd.pid`
|
|
+@end example
|
|
+
|
|
+@node Pppd options, , Setting up syslog, Configuration
|
|
+@section Pppd options
|
|
+
|
|
+@node Authentication secrets files, , Pppd options, Configuration
|
|
+@section Authentication secrets files
|
|
+
|
|
+@node IP Addresses, , Authentication secrets files, Configuration
|
|
+@section IP Addresses
|
|
+
|
|
+@node Security, Compression, Configuration, Top
|
|
+@chapter Security
|
|
+
|
|
+@node Compression, , Security, Top
|
|
+@chapter Compression
|
|
+
|
|
+@bye
|
|
diff -ruN ppp-2.4.2/pppd/Makefile.sol2 ppp-cvs-20040427/pppd/Makefile.sol2
|
|
--- ppp-2.4.2/pppd/Makefile.sol2 2003-11-27 22:25:25.000000000 +0100
|
|
+++ ppp-cvs-20040427/pppd/Makefile.sol2 2002-11-02 20:50:09.000000000 +0100
|
|
@@ -1,6 +1,6 @@
|
|
#
|
|
# Makefile for pppd under Solaris 2.
|
|
-# $Id: Makefile.sol2,v 1.24 2003/11/27 21:25:25 paulus Exp $
|
|
+# $Id: Makefile.sol2,v 1.23 2002/11/02 19:48:12 carlsonj Exp $
|
|
#
|
|
|
|
include ../Makedefs.com
|
|
@@ -8,8 +8,8 @@
|
|
CFLAGS = -I../include -DSVR4 -DSOL2 $(COPTS)
|
|
LIBS = -lsocket -lnsl
|
|
|
|
-OBJS = main.o magic.o fsm.o lcp.o ipcp.o upap.o chap-new.o eap.o md5.o \
|
|
- tty.o ccp.o ecp.o auth.o options.o demand.o utils.o sys-solaris.o
|
|
+OBJS = main.o magic.o fsm.o lcp.o ipcp.o upap.o chap.o eap.o md5.o tty.o \
|
|
+ ccp.o ecp.o auth.o options.o demand.o utils.o sys-solaris.o
|
|
|
|
#
|
|
# uncomment the following to enable plugins
|
|
diff -ruN ppp-2.4.2/pppd/Makefile.sunos4 ppp-cvs-20040427/pppd/Makefile.sunos4
|
|
--- ppp-2.4.2/pppd/Makefile.sunos4 2003-11-27 22:25:25.000000000 +0100
|
|
+++ ppp-cvs-20040427/pppd/Makefile.sunos4 2002-11-02 20:50:09.000000000 +0100
|
|
@@ -1,6 +1,6 @@
|
|
#
|
|
# Makefile for pppd under SunOS 4.
|
|
-# $Id: Makefile.sunos4,v 1.14 2003/11/27 21:25:25 paulus Exp $
|
|
+# $Id: Makefile.sunos4,v 1.13 2002/11/02 19:48:12 carlsonj Exp $
|
|
#
|
|
|
|
include ../sunos4/Makedefs
|
|
@@ -12,7 +12,7 @@
|
|
|
|
all: pppd
|
|
|
|
-OBJS = main.o magic.o fsm.o lcp.o ipcp.o upap.o chap-new.o md5.o ccp.o ecp.o \
|
|
+OBJS = main.o magic.o fsm.o lcp.o ipcp.o upap.o chap.o md5.o ccp.o ecp.o \
|
|
auth.o options.o demand.o utils.o sys-sunos4.o tty.o eap.o
|
|
|
|
pppd: $(OBJS)
|
|
diff -ruN ppp-2.4.2/pppd/chap-new.c ppp-cvs-20040427/pppd/chap-new.c
|
|
--- ppp-2.4.2/pppd/chap-new.c 2003-11-27 23:22:36.000000000 +0100
|
|
+++ ppp-cvs-20040427/pppd/chap-new.c 2004-01-17 06:50:11.000000000 +0100
|
|
@@ -33,7 +33,7 @@
|
|
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
*/
|
|
|
|
-#define RCSID "$Id: chap-new.c,v 1.3 2003/11/27 22:22:36 paulus Exp $"
|
|
+#define RCSID "$Id: chap-new.c,v 1.4 2004/01/17 05:47:55 carlsonj Exp $"
|
|
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
@@ -49,7 +49,7 @@
|
|
int (*chap_verify_hook)(char *name, char *ourname, int id,
|
|
struct chap_digest_type *digest,
|
|
unsigned char *challenge, unsigned char *response,
|
|
- unsigned char *message, int message_space) = NULL;
|
|
+ char *message, int message_space) = NULL;
|
|
|
|
/*
|
|
* Option variables.
|
|
@@ -119,7 +119,7 @@
|
|
static int chap_verify_response(char *name, char *ourname, int id,
|
|
struct chap_digest_type *digest,
|
|
unsigned char *challenge, unsigned char *response,
|
|
- unsigned char *message, int message_space);
|
|
+ char *message, int message_space);
|
|
static void chap_respond(struct chap_client_state *cs, int id,
|
|
unsigned char *pkt, int len);
|
|
static void chap_handle_status(struct chap_client_state *cs, int code, int id,
|
|
@@ -306,11 +306,11 @@
|
|
{
|
|
int response_len, ok, mlen;
|
|
unsigned char *response, *p;
|
|
- unsigned char *name = NULL; /* initialized to shut gcc up */
|
|
+ char *name = NULL; /* initialized to shut gcc up */
|
|
int (*verifier)(char *, char *, int, struct chap_digest_type *,
|
|
- unsigned char *, unsigned char *, unsigned char *, int);
|
|
+ unsigned char *, unsigned char *, char *, int);
|
|
char rname[MAXNAMELEN+1];
|
|
- unsigned char message[256];
|
|
+ char message[256];
|
|
|
|
if ((ss->flags & LOWERUP) == 0)
|
|
return;
|
|
@@ -322,7 +322,7 @@
|
|
response = pkt;
|
|
GETCHAR(response_len, pkt);
|
|
len -= response_len + 1; /* length of name */
|
|
- name = pkt + response_len;
|
|
+ name = (char *)pkt + response_len;
|
|
if (len < 0)
|
|
return;
|
|
|
|
@@ -391,14 +391,14 @@
|
|
chap_verify_response(char *name, char *ourname, int id,
|
|
struct chap_digest_type *digest,
|
|
unsigned char *challenge, unsigned char *response,
|
|
- unsigned char *message, int message_space)
|
|
+ char *message, int message_space)
|
|
{
|
|
int ok;
|
|
- char secret[MAXSECRETLEN];
|
|
+ unsigned char secret[MAXSECRETLEN];
|
|
int secret_len;
|
|
|
|
/* Get the secret that the peer is supposed to know */
|
|
- if (!get_secret(0, name, ourname, secret, &secret_len, 1)) {
|
|
+ if (!get_secret(0, name, ourname, (char *)secret, &secret_len, 1)) {
|
|
error("No CHAP secret found for authenticating %q", name);
|
|
return 0;
|
|
}
|
|
diff -ruN ppp-2.4.2/pppd/chap-new.h ppp-cvs-20040427/pppd/chap-new.h
|
|
--- ppp-2.4.2/pppd/chap-new.h 2003-06-11 14:47:31.000000000 +0200
|
|
+++ ppp-cvs-20040427/pppd/chap-new.h 2004-01-17 06:50:12.000000000 +0100
|
|
@@ -123,7 +123,7 @@
|
|
extern int (*chap_verify_hook)(char *name, char *ourname, int id,
|
|
struct chap_digest_type *digest,
|
|
unsigned char *challenge, unsigned char *response,
|
|
- unsigned char *message, int message_space);
|
|
+ char *message, int message_space);
|
|
|
|
/* Called by digest code to register a digest type */
|
|
extern void chap_register_digest(struct chap_digest_type *);
|
|
diff -ruN ppp-2.4.2/pppd/chap_ms.c ppp-cvs-20040427/pppd/chap_ms.c
|
|
--- ppp-2.4.2/pppd/chap_ms.c 2003-11-18 11:42:56.000000000 +0100
|
|
+++ ppp-cvs-20040427/pppd/chap_ms.c 2004-04-14 04:40:21.000000000 +0200
|
|
@@ -74,7 +74,7 @@
|
|
*
|
|
*/
|
|
|
|
-#define RCSID "$Id: chap_ms.c,v 1.30 2003/07/10 17:59:33 fcusack Exp $"
|
|
+#define RCSID "$Id: chap_ms.c,v 1.31 2004/04/14 02:39:39 carlsonj Exp $"
|
|
|
|
#ifdef CHAPMS
|
|
|
|
@@ -164,9 +164,11 @@
|
|
chapms_generate_challenge(unsigned char *challenge)
|
|
{
|
|
*challenge++ = 8;
|
|
+#ifdef DEBUGMPPEKEY
|
|
if (mschap_challenge && strlen(mschap_challenge) == 8)
|
|
memcpy(challenge, mschap_challenge, 8);
|
|
else
|
|
+#endif
|
|
random_bytes(challenge, 8);
|
|
}
|
|
|
|
@@ -174,9 +176,11 @@
|
|
chapms2_generate_challenge(unsigned char *challenge)
|
|
{
|
|
*challenge++ = 16;
|
|
+#ifdef DEBUGMPPEKEY
|
|
if (mschap_challenge && strlen(mschap_challenge) == 16)
|
|
memcpy(challenge, mschap_challenge, 16);
|
|
else
|
|
+#endif
|
|
random_bytes(challenge, 16);
|
|
}
|
|
|
|
@@ -207,7 +211,7 @@
|
|
#endif
|
|
|
|
/* Generate the expected response. */
|
|
- ChapMS(challenge, secret, secret_len, &md);
|
|
+ ChapMS(challenge, (char *)secret, secret_len, &md);
|
|
|
|
#ifdef MSLANMAN
|
|
/* Determine which part of response to verify against */
|
|
@@ -250,8 +254,8 @@
|
|
|
|
/* Generate the expected response and our mutual auth. */
|
|
ChapMS2(challenge, rmd->PeerChallenge, name,
|
|
- secret, secret_len, &md,
|
|
- saresponse, MS_CHAP2_AUTHENTICATOR);
|
|
+ (char *)secret, secret_len, &md,
|
|
+ (unsigned char *)saresponse, MS_CHAP2_AUTHENTICATOR);
|
|
|
|
/* compare MDs and send the appropriate status */
|
|
/*
|
|
@@ -326,8 +330,13 @@
|
|
{
|
|
challenge++; /* skip length, should be 16 */
|
|
*response++ = MS_CHAP2_RESPONSE_LEN;
|
|
- ChapMS2(challenge, mschap2_peer_challenge, our_name,
|
|
- secret, secret_len,
|
|
+ ChapMS2(challenge,
|
|
+#ifdef DEBUGMPPEKEY
|
|
+ mschap2_peer_challenge,
|
|
+#else
|
|
+ NULL,
|
|
+#endif
|
|
+ our_name, secret, secret_len,
|
|
(MS_Chap2Response *) response, private,
|
|
MS_CHAP2_AUTHENTICATEE);
|
|
}
|
|
@@ -335,7 +344,8 @@
|
|
static int
|
|
chapms2_check_success(unsigned char *msg, int len, unsigned char *private)
|
|
{
|
|
- if ((len < MS_AUTH_RESPONSE_LENGTH + 2) || strncmp(msg, "S=", 2)) {
|
|
+ if ((len < MS_AUTH_RESPONSE_LENGTH + 2) ||
|
|
+ strncmp((char *)msg, "S=", 2) != 0) {
|
|
/* Packet does not start with "S=" */
|
|
error("MS-CHAPv2 Success packet is badly formed.");
|
|
return 0;
|
|
@@ -351,7 +361,7 @@
|
|
/* Authenticator Response matches. */
|
|
msg += MS_AUTH_RESPONSE_LENGTH; /* Eat it */
|
|
len -= MS_AUTH_RESPONSE_LENGTH;
|
|
- if ((len >= 3) && !strncmp(msg, " M=", 3)) {
|
|
+ if ((len >= 3) && !strncmp((char *)msg, " M=", 3)) {
|
|
msg += 3; /* Eat the delimiter */
|
|
} else if (len) {
|
|
/* Packet has extra text which does not begin " M=" */
|
|
@@ -477,7 +487,7 @@
|
|
SHA1_Init(&sha1Context);
|
|
SHA1_Update(&sha1Context, PeerChallenge, 16);
|
|
SHA1_Update(&sha1Context, rchallenge, 16);
|
|
- SHA1_Update(&sha1Context, user, strlen(user));
|
|
+ SHA1_Update(&sha1Context, (unsigned char *)user, strlen(user));
|
|
SHA1_Final(sha1Hash, &sha1Context);
|
|
|
|
BCOPY(sha1Hash, Challenge, 8);
|
|
@@ -512,7 +522,7 @@
|
|
MD4_CTX md4Context;
|
|
|
|
MD4Init(&md4Context);
|
|
- MD4Update(&md4Context, secret, mdlen);
|
|
+ MD4Update(&md4Context, (unsigned char *)secret, mdlen);
|
|
MD4Final(hash, &md4Context);
|
|
|
|
}
|
|
@@ -526,7 +536,7 @@
|
|
|
|
/* Hash the Unicode version of the secret (== password). */
|
|
ascii2unicode(secret, secret_len, unicodePassword);
|
|
- NTPasswordHash(unicodePassword, secret_len * 2, PasswordHash);
|
|
+ NTPasswordHash((char *)unicodePassword, secret_len * 2, PasswordHash);
|
|
|
|
ChallengeResponse(rchallenge, PasswordHash, NTResponse);
|
|
}
|
|
@@ -539,11 +549,12 @@
|
|
u_char PasswordHash[MD4_SIGNATURE_SIZE];
|
|
u_char Challenge[8];
|
|
|
|
- ChallengeHash(PeerChallenge, rchallenge, username, Challenge);
|
|
+ ChallengeHash(PeerChallenge, (unsigned char *)rchallenge, username,
|
|
+ Challenge);
|
|
|
|
/* Hash the Unicode version of the secret (== password). */
|
|
ascii2unicode(secret, secret_len, unicodePassword);
|
|
- NTPasswordHash(unicodePassword, secret_len * 2, PasswordHash);
|
|
+ NTPasswordHash((char *)unicodePassword, secret_len * 2, PasswordHash);
|
|
|
|
ChallengeResponse(Challenge, PasswordHash, NTResponse);
|
|
}
|
|
@@ -603,8 +614,9 @@
|
|
|
|
/* Hash (x2) the Unicode version of the secret (== password). */
|
|
ascii2unicode(secret, secret_len, unicodePassword);
|
|
- NTPasswordHash(unicodePassword, secret_len * 2, PasswordHash);
|
|
- NTPasswordHash(PasswordHash, sizeof(PasswordHash), PasswordHashHash);
|
|
+ NTPasswordHash((char *)unicodePassword, secret_len * 2, PasswordHash);
|
|
+ NTPasswordHash((char *)PasswordHash, sizeof(PasswordHash),
|
|
+ PasswordHashHash);
|
|
|
|
SHA1_Init(&sha1Context);
|
|
SHA1_Update(&sha1Context, PasswordHashHash, sizeof(PasswordHashHash));
|
|
@@ -622,7 +634,7 @@
|
|
|
|
/* Convert to ASCII hex string. */
|
|
for (i = 0; i < MAX((MS_AUTH_RESPONSE_LENGTH / 2), sizeof(Digest)); i++)
|
|
- sprintf(&authResponse[i * 2], "%02X", Digest[i]);
|
|
+ sprintf((char *)&authResponse[i * 2], "%02X", Digest[i]);
|
|
}
|
|
|
|
|
|
@@ -825,7 +837,7 @@
|
|
sizeof(response->PeerChallenge));
|
|
|
|
/* Generate the NT-Response */
|
|
- ChapMS2_NT(rchallenge, response->PeerChallenge, user,
|
|
+ ChapMS2_NT((char *)rchallenge, response->PeerChallenge, user,
|
|
secret, secret_len, response->NTResp);
|
|
|
|
/* Generate the Authenticator Response. */
|
|
diff -ruN ppp-2.4.2/pppd/fsm.c ppp-cvs-20040427/pppd/fsm.c
|
|
--- ppp-2.4.2/pppd/fsm.c 2003-06-29 12:06:14.000000000 +0200
|
|
+++ ppp-cvs-20040427/pppd/fsm.c 2004-02-02 05:00:11.000000000 +0100
|
|
@@ -40,7 +40,7 @@
|
|
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
*/
|
|
|
|
-#define RCSID "$Id: fsm.c,v 1.20 2003/06/29 10:06:14 paulus Exp $"
|
|
+#define RCSID "$Id: fsm.c,v 1.22 2004/02/02 03:57:19 carlsonj Exp $"
|
|
|
|
/*
|
|
* TODO:
|
|
@@ -201,6 +201,44 @@
|
|
}
|
|
}
|
|
|
|
+/*
|
|
+ * terminate_layer - Start process of shutting down the FSM
|
|
+ *
|
|
+ * Cancel any timeout running, notify upper layers we're done, and
|
|
+ * send a terminate-request message as configured.
|
|
+ */
|
|
+static void
|
|
+terminate_layer(f, nextstate)
|
|
+ fsm *f;
|
|
+ int nextstate;
|
|
+{
|
|
+ if( f->state != OPENED )
|
|
+ UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */
|
|
+ else if( f->callbacks->down )
|
|
+ (*f->callbacks->down)(f); /* Inform upper layers we're down */
|
|
+
|
|
+ /* Init restart counter and send Terminate-Request */
|
|
+ f->retransmits = f->maxtermtransmits;
|
|
+ fsm_sdata(f, TERMREQ, f->reqid = ++f->id,
|
|
+ (u_char *) f->term_reason, f->term_reason_len);
|
|
+
|
|
+ if (f->retransmits == 0) {
|
|
+ /*
|
|
+ * User asked for no terminate requests at all; just close it.
|
|
+ * We've already fired off one Terminate-Request just to be nice
|
|
+ * to the peer, but we're not going to wait for a reply.
|
|
+ */
|
|
+ f->state = nextstate == CLOSING ? CLOSED : STOPPED;
|
|
+ if( f->callbacks->finished )
|
|
+ (*f->callbacks->finished)(f);
|
|
+ return;
|
|
+ }
|
|
+
|
|
+ TIMEOUT(fsm_timeout, f, f->timeouttime);
|
|
+ --f->retransmits;
|
|
+
|
|
+ f->state = nextstate;
|
|
+}
|
|
|
|
/*
|
|
* fsm_close - Start closing connection.
|
|
@@ -230,19 +268,7 @@
|
|
case ACKRCVD:
|
|
case ACKSENT:
|
|
case OPENED:
|
|
- if( f->state != OPENED )
|
|
- UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */
|
|
- else if( f->callbacks->down )
|
|
- (*f->callbacks->down)(f); /* Inform upper layers we're down */
|
|
-
|
|
- /* Init restart counter, send Terminate-Request */
|
|
- f->retransmits = f->maxtermtransmits;
|
|
- fsm_sdata(f, TERMREQ, f->reqid = ++f->id,
|
|
- (u_char *) f->term_reason, f->term_reason_len);
|
|
- TIMEOUT(fsm_timeout, f, f->timeouttime);
|
|
- --f->retransmits;
|
|
-
|
|
- f->state = CLOSING;
|
|
+ terminate_layer(f, CLOSING);
|
|
break;
|
|
}
|
|
}
|
|
@@ -689,17 +715,7 @@
|
|
break;
|
|
|
|
case OPENED:
|
|
- if( f->callbacks->down )
|
|
- (*f->callbacks->down)(f);
|
|
-
|
|
- /* Init restart counter, send Terminate-Request */
|
|
- f->retransmits = f->maxtermtransmits;
|
|
- fsm_sdata(f, TERMREQ, f->reqid = ++f->id,
|
|
- (u_char *) f->term_reason, f->term_reason_len);
|
|
- TIMEOUT(fsm_timeout, f, f->timeouttime);
|
|
- --f->retransmits;
|
|
-
|
|
- f->state = STOPPING;
|
|
+ terminate_layer(f, STOPPING);
|
|
break;
|
|
|
|
default:
|
|
diff -ruN ppp-2.4.2/pppd/main.c ppp-cvs-20040427/pppd/main.c
|
|
--- ppp-2.4.2/pppd/main.c 2004-01-13 05:00:34.000000000 +0100
|
|
+++ ppp-cvs-20040427/pppd/main.c 2004-04-12 13:25:19.000000000 +0200
|
|
@@ -40,7 +40,7 @@
|
|
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
*/
|
|
|
|
-#define RCSID "$Id: main.c,v 1.131 2004/01/13 04:00:34 paulus Exp $"
|
|
+#define RCSID "$Id: main.c,v 1.136 2004/04/12 11:20:19 paulus Exp $"
|
|
|
|
#include <stdio.h>
|
|
#include <ctype.h>
|
|
@@ -150,6 +150,7 @@
|
|
int got_sigterm;
|
|
int got_sighup;
|
|
|
|
+static sigset_t signals_handled;
|
|
static int waiting;
|
|
static sigjmp_buf sigjmp;
|
|
|
|
@@ -648,16 +649,15 @@
|
|
handle_events()
|
|
{
|
|
struct timeval timo;
|
|
- sigset_t mask;
|
|
|
|
kill_link = open_ccp_flag = 0;
|
|
if (sigsetjmp(sigjmp, 1) == 0) {
|
|
- sigprocmask(SIG_BLOCK, &mask, NULL);
|
|
+ sigprocmask(SIG_BLOCK, &signals_handled, NULL);
|
|
if (got_sighup || got_sigterm || got_sigusr2 || got_sigchld) {
|
|
- sigprocmask(SIG_UNBLOCK, &mask, NULL);
|
|
+ sigprocmask(SIG_UNBLOCK, &signals_handled, NULL);
|
|
} else {
|
|
waiting = 1;
|
|
- sigprocmask(SIG_UNBLOCK, &mask, NULL);
|
|
+ sigprocmask(SIG_UNBLOCK, &signals_handled, NULL);
|
|
wait_input(timeleft(&timo));
|
|
}
|
|
}
|
|
@@ -692,19 +692,18 @@
|
|
setup_signals()
|
|
{
|
|
struct sigaction sa;
|
|
- sigset_t mask;
|
|
|
|
/*
|
|
* Compute mask of all interesting signals and install signal handlers
|
|
* for each. Only one signal handler may be active at a time. Therefore,
|
|
* all other signals should be masked when any handler is executing.
|
|
*/
|
|
- sigemptyset(&mask);
|
|
- sigaddset(&mask, SIGHUP);
|
|
- sigaddset(&mask, SIGINT);
|
|
- sigaddset(&mask, SIGTERM);
|
|
- sigaddset(&mask, SIGCHLD);
|
|
- sigaddset(&mask, SIGUSR2);
|
|
+ sigemptyset(&signals_handled);
|
|
+ sigaddset(&signals_handled, SIGHUP);
|
|
+ sigaddset(&signals_handled, SIGINT);
|
|
+ sigaddset(&signals_handled, SIGTERM);
|
|
+ sigaddset(&signals_handled, SIGCHLD);
|
|
+ sigaddset(&signals_handled, SIGUSR2);
|
|
|
|
#define SIGNAL(s, handler) do { \
|
|
sa.sa_handler = handler; \
|
|
@@ -712,7 +711,7 @@
|
|
fatal("Couldn't establish signal handler (%d): %m", s); \
|
|
} while (0)
|
|
|
|
- sa.sa_mask = mask;
|
|
+ sa.sa_mask = signals_handled;
|
|
sa.sa_flags = 0;
|
|
SIGNAL(SIGHUP, hup); /* Hangup */
|
|
SIGNAL(SIGINT, term); /* Interrupt */
|
|
@@ -1173,6 +1172,7 @@
|
|
info("Connect time %d.%d minutes.", t/10, t%10);
|
|
info("Sent %u bytes, received %u bytes.",
|
|
link_stats.bytes_out, link_stats.bytes_in);
|
|
+ link_stats_valid = 0;
|
|
}
|
|
}
|
|
|
|
@@ -1329,6 +1329,7 @@
|
|
|
|
/*
|
|
* kill_my_pg - send a signal to our process group, and ignore it ourselves.
|
|
+ * We assume that sig is currently blocked.
|
|
*/
|
|
static void
|
|
kill_my_pg(sig)
|
|
@@ -1336,10 +1337,22 @@
|
|
{
|
|
struct sigaction act, oldact;
|
|
|
|
+ sigemptyset(&act.sa_mask); /* unnecessary in fact */
|
|
act.sa_handler = SIG_IGN;
|
|
act.sa_flags = 0;
|
|
- sigaction(sig, &act, &oldact);
|
|
kill(0, sig);
|
|
+ /*
|
|
+ * The kill() above made the signal pending for us, as well as
|
|
+ * the rest of our process group, but we don't want it delivered
|
|
+ * to us. It is blocked at the moment. Setting it to be ignored
|
|
+ * will cause the pending signal to be discarded. If we did the
|
|
+ * kill() after setting the signal to be ignored, it is unspecified
|
|
+ * (by POSIX) whether the signal is immediately discarded or left
|
|
+ * pending, and in fact Linux would leave it pending, and so it
|
|
+ * would be delivered after the current signal handler exits,
|
|
+ * leading to an infinite loop.
|
|
+ */
|
|
+ sigaction(sig, &act, &oldact);
|
|
sigaction(sig, &oldact, NULL);
|
|
}
|
|
|
|
diff -ruN ppp-2.4.2/pppd/plugins/Makefile ppp-cvs-20040427/pppd/plugins/Makefile
|
|
--- ppp-2.4.2/pppd/plugins/Makefile 2004-01-13 04:56:24.000000000 +0100
|
|
+++ ppp-cvs-20040427/pppd/plugins/Makefile 1970-01-01 01:00:00.000000000 +0100
|
|
@@ -1,38 +0,0 @@
|
|
-CC = gcc
|
|
-COPTS = -O2 -g
|
|
-CFLAGS = $(COPTS) -I.. -I../../include -fPIC
|
|
-LDFLAGS = -shared
|
|
-INSTALL = install -o root
|
|
-
|
|
-SUBDIRS := rp-pppoe
|
|
-# Uncomment the next line to include the radius authentication plugin
|
|
-# SUBDIRS += radius
|
|
-PLUGINS := minconn.so passprompt.so passwordfd.so
|
|
-
|
|
-# include dependencies if present
|
|
-ifeq (.depend,$(wildcard .depend))
|
|
-include .depend
|
|
-endif
|
|
-
|
|
-all: $(PLUGINS)
|
|
- for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d all; done
|
|
-
|
|
-%.so: %.c
|
|
- $(CC) -o $@ $(LDFLAGS) $(CFLAGS) $^
|
|
-
|
|
-VERSION = $(shell awk -F '"' '/VERSION/ { print $$2; }' ../patchlevel.h)
|
|
-LIBDIR = $(DESTDIR)/usr/lib/pppd/$(VERSION)
|
|
-
|
|
-install: $(PLUGINS)
|
|
- $(INSTALL) -d $(LIBDIR)
|
|
- $(INSTALL) $? $(LIBDIR)
|
|
- for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d INSTALL=$(INSTALL) \
|
|
- LIBDIR=$(LIBDIR) install; done
|
|
-
|
|
-clean:
|
|
- rm -f *.o *.so *.a
|
|
- for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d clean; done
|
|
-
|
|
-depend:
|
|
- $(CPP) -M $(CFLAGS) *.c >.depend
|
|
- for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d depend; done
|
|
diff -ruN ppp-2.4.2/pppd/plugins/radius/CVS/Entries ppp-cvs-20040427/pppd/plugins/radius/CVS/Entries
|
|
--- ppp-2.4.2/pppd/plugins/radius/CVS/Entries 2002-12-04 22:49:09.000000000 +0100
|
|
+++ ppp-cvs-20040427/pppd/plugins/radius/CVS/Entries 1970-01-01 01:00:00.000000000 +0100
|
|
@@ -1,7 +0,0 @@
|
|
-/pppd-radattr.8/1.1/Tue Jan 22 16:03:00 2002//
|
|
-/pppd-radius.8/1.4/Tue Apr 2 13:55:00 2002//
|
|
-/radattr.c/1.1/Tue Jan 22 16:03:00 2002//
|
|
-D/radiusclient////
|
|
-/Makefile.linux/1.5/Sat Nov 9 11:24:42 2002//
|
|
-/radrealms.c/1.1/Sat Oct 5 04:35:24 2002//
|
|
-/radius.c/1.18/Wed Dec 4 21:49:09 2002//
|
|
diff -ruN ppp-2.4.2/pppd/plugins/radius/CVS/Repository ppp-cvs-20040427/pppd/plugins/radius/CVS/Repository
|
|
--- ppp-2.4.2/pppd/plugins/radius/CVS/Repository 2002-09-07 12:37:51.000000000 +0200
|
|
+++ ppp-cvs-20040427/pppd/plugins/radius/CVS/Repository 1970-01-01 01:00:00.000000000 +0100
|
|
@@ -1 +0,0 @@
|
|
-ppp/pppd/plugins/radius
|
|
diff -ruN ppp-2.4.2/pppd/plugins/radius/CVS/Root ppp-cvs-20040427/pppd/plugins/radius/CVS/Root
|
|
--- ppp-2.4.2/pppd/plugins/radius/CVS/Root 2002-09-07 12:37:51.000000000 +0200
|
|
+++ ppp-cvs-20040427/pppd/plugins/radius/CVS/Root 1970-01-01 01:00:00.000000000 +0100
|
|
@@ -1 +0,0 @@
|
|
-samba.org:/data/cvs
|
|
diff -ruN ppp-2.4.2/pppd/plugins/radius/Makefile ppp-cvs-20040427/pppd/plugins/radius/Makefile
|
|
--- ppp-2.4.2/pppd/plugins/radius/Makefile 2002-11-09 12:24:42.000000000 +0100
|
|
+++ ppp-cvs-20040427/pppd/plugins/radius/Makefile 1970-01-01 01:00:00.000000000 +0100
|
|
@@ -1,74 +0,0 @@
|
|
-# Makefile for RADIUS plugin
|
|
-#
|
|
-# Copyright 2002 Roaring Penguin Software Inc.
|
|
-#
|
|
-
|
|
-MANDIR=/usr/man
|
|
-PLUGIN=radius.so radattr.so radrealms.so
|
|
-CFLAGS=-I../.. -I../../../include -Iradiusclient/include -O2
|
|
-
|
|
-# Uncomment the next line to include support for Microsoft's
|
|
-# MS-CHAP authentication protocol.
|
|
-CHAPMS=y
|
|
-# Uncomment the next line to include support for MPPE.
|
|
-MPPE=y
|
|
-# Uncomment the next lint to include support for traffic limiting
|
|
-MAXOCTETS=y
|
|
-
|
|
-ifdef CHAPMS
|
|
-CFLAGS += -DCHAPMS=1
|
|
-ifdef MPPE
|
|
-CFLAGS += -DMPPE=1
|
|
-endif
|
|
-endif
|
|
-ifdef MAXOCTETS
|
|
-CFLAGS += -DMAXOCTETS=1
|
|
-endif
|
|
-
|
|
-all: $(PLUGIN)
|
|
-
|
|
-install: all
|
|
- $(MAKE) $(MFLAGS) -C radiusclient install
|
|
- $(INSTALL) -d -m 755 $(LIBDIR)
|
|
- $(INSTALL) -s -c -m 755 radius.so $(LIBDIR)
|
|
- $(INSTALL) -s -c -m 755 radattr.so $(LIBDIR)
|
|
- $(INSTALL) -s -c -m 755 radrealms.so $(LIBDIR)
|
|
- $(INSTALL) -c -m 444 pppd-radius.8 $(MANDIR)/man8
|
|
- $(INSTALL) -c -m 444 pppd-radattr.8 $(MANDIR)/man8
|
|
-
|
|
-radius.so: radiusclient/lib/.libs/libradiusclient.a radius.o
|
|
- gcc -o radius.so -shared radius.o radiusclient/lib/.libs/libradiusclient.a
|
|
-
|
|
-radattr.so: radattr.o
|
|
- gcc -o radattr.so -shared radattr.o
|
|
-
|
|
-radrealms.so: radrealms.o
|
|
- gcc -o radrealms.so -shared radrealms.o
|
|
-
|
|
-radius.o: radius.c
|
|
- gcc $(CFLAGS) -c -o radius.o -fPIC radius.c
|
|
-
|
|
-radattr.o: radattr.c
|
|
- gcc $(CFLAGS) -c -o radattr.o -fPIC radattr.c
|
|
-
|
|
-radrealms.o: radrealms.c
|
|
- gcc $(CFLAGS) -c -o radrealms.o -fPIC radrealms.c
|
|
-
|
|
-radiusclient/lib/.libs/libradiusclient.a:
|
|
- test -r radiusclient/Makefile || \
|
|
- (cd radiusclient; \
|
|
- ./configure --prefix=/usr \
|
|
- --sysconfdir=/etc \
|
|
- --enable-shared \
|
|
- --enable-static)
|
|
- $(MAKE) -C radiusclient
|
|
-
|
|
-clean:
|
|
- $(MAKE) $(MFLAGS) -C radiusclient clean
|
|
- rm -f *.o *.so
|
|
-
|
|
-distclean:
|
|
- rm -f *.o *.so
|
|
- $(MAKE) $(MFLAGS) -C radiusclient distclean
|
|
-
|
|
-dist-clean: distclean
|
|
diff -ruN ppp-2.4.2/pppd/plugins/radius/pppd-radius.8 ppp-cvs-20040427/pppd/plugins/radius/pppd-radius.8
|
|
--- ppp-2.4.2/pppd/plugins/radius/pppd-radius.8 2002-04-02 15:55:00.000000000 +0200
|
|
+++ ppp-cvs-20040427/pppd/plugins/radius/pppd-radius.8 2004-03-26 14:30:16.000000000 +0100
|
|
@@ -1,5 +1,5 @@
|
|
.\" manual page [] for RADIUS plugin for pppd 2.4
|
|
-.\" $Id: pppd-radius.8,v 1.4 2002/04/02 13:55:00 dfs Exp $
|
|
+.\" $Id: pppd-radius.8,v 1.5 2004/03/26 13:27:17 kad Exp $
|
|
.\" SH section heading
|
|
.\" SS subsection heading
|
|
.\" LP paragraph
|
|
@@ -40,6 +40,15 @@
|
|
used, then the plugin uses
|
|
.I /etc/radiusclient/radiusclient.conf
|
|
as the configuration file.
|
|
+.TP
|
|
+.BI "avpair " attribute=value
|
|
+Adds an Attribute-Value pair to be passed on to the RADIUS server on each request.
|
|
+.TP
|
|
+.BI map-to-ifname
|
|
+Sets Radius NAS-Port attribute to number equal to interface name (Default)
|
|
+.TP
|
|
+.BI map-to-ttyname
|
|
+Sets Radius NAS-Port attribute value via libradiusclient library
|
|
|
|
.SH USAGE
|
|
To use the plugin, simply supply the
|
|
diff -ruN ppp-2.4.2/pppd/plugins/radius/radius.c ppp-cvs-20040427/pppd/plugins/radius/radius.c
|
|
--- ppp-2.4.2/pppd/plugins/radius/radius.c 2004-01-13 03:26:11.000000000 +0100
|
|
+++ ppp-cvs-20040427/pppd/plugins/radius/radius.c 2004-04-12 07:20:16.000000000 +0200
|
|
@@ -24,7 +24,7 @@
|
|
*
|
|
***********************************************************************/
|
|
static char const RCSID[] =
|
|
-"$Id: radius.c,v 1.22 2004/01/11 08:01:30 paulus Exp $";
|
|
+"$Id: radius.c,v 1.25 2004/04/12 05:16:37 kad Exp $";
|
|
|
|
#include "pppd.h"
|
|
#include "chap-new.h"
|
|
@@ -52,10 +52,15 @@
|
|
char *vpstr;
|
|
struct avpopt *next;
|
|
} *avpopt = NULL;
|
|
+static bool portnummap = 0;
|
|
|
|
static option_t Options[] = {
|
|
{ "radius-config-file", o_string, &config_file },
|
|
{ "avpair", o_special, add_avp },
|
|
+ { "map-to-ttyname", o_bool, &portnummap,
|
|
+ "Set Radius NAS-Port attribute value via libradiusclient library", OPT_PRIO | 1 },
|
|
+ { "map-to-ifname", o_bool, &portnummap,
|
|
+ "Set Radius NAS-Port attribute to number as in interface name (Default)", OPT_PRIOSUB | 0 },
|
|
{ NULL }
|
|
};
|
|
|
|
@@ -264,7 +269,7 @@
|
|
|
|
/* Hack... the "port" is the ppp interface number. Should really be
|
|
the tty */
|
|
- rstate.client_port = get_client_port(ifname);
|
|
+ rstate.client_port = get_client_port(portnummap ? devnam : ifname);
|
|
|
|
av_type = PW_FRAMED;
|
|
rc_avpair_add(&send, PW_SERVICE_TYPE, &av_type, 0, VENDOR_NONE);
|
|
@@ -363,7 +368,7 @@
|
|
/* Put user with potentially realm added in rstate.user */
|
|
if (!rstate.done_chap_once) {
|
|
make_username_realm(user);
|
|
- rstate.client_port = get_client_port (ifname);
|
|
+ rstate.client_port = get_client_port (portnummap ? devnam : ifname);
|
|
if (radius_pre_auth_hook) {
|
|
radius_pre_auth_hook(rstate.user,
|
|
&rstate.authserver,
|
|
@@ -881,7 +886,7 @@
|
|
rc_avpair_add(&send, PW_ACCT_AUTHENTIC, &av_type, 0, VENDOR_NONE);
|
|
|
|
|
|
- av_type = PW_ASYNC;
|
|
+ av_type = ( using_pty ? PW_VIRTUAL : ( sync_serial ? PW_SYNC : PW_ASYNC ) );
|
|
rc_avpair_add(&send, PW_NAS_PORT_TYPE, &av_type, 0, VENDOR_NONE);
|
|
|
|
hisaddr = ho->hisaddr;
|
|
@@ -981,9 +986,56 @@
|
|
remote_number, 0, VENDOR_NONE);
|
|
}
|
|
|
|
- av_type = PW_ASYNC;
|
|
+ av_type = ( using_pty ? PW_VIRTUAL : ( sync_serial ? PW_SYNC : PW_ASYNC ) );
|
|
rc_avpair_add(&send, PW_NAS_PORT_TYPE, &av_type, 0, VENDOR_NONE);
|
|
|
|
+ av_type = PW_NAS_ERROR;
|
|
+ switch( status ) {
|
|
+ case EXIT_OK:
|
|
+ case EXIT_USER_REQUEST:
|
|
+ av_type = PW_USER_REQUEST;
|
|
+ break;
|
|
+
|
|
+ case EXIT_HANGUP:
|
|
+ case EXIT_PEER_DEAD:
|
|
+ case EXIT_CONNECT_FAILED:
|
|
+ av_type = PW_LOST_CARRIER;
|
|
+ break;
|
|
+
|
|
+ case EXIT_INIT_FAILED:
|
|
+ case EXIT_OPEN_FAILED:
|
|
+ case EXIT_LOCK_FAILED:
|
|
+ case EXIT_PTYCMD_FAILED:
|
|
+ av_type = PW_PORT_ERROR;
|
|
+ break;
|
|
+
|
|
+ case EXIT_PEER_AUTH_FAILED:
|
|
+ case EXIT_AUTH_TOPEER_FAILED:
|
|
+ case EXIT_NEGOTIATION_FAILED:
|
|
+ case EXIT_CNID_AUTH_FAILED:
|
|
+ av_type = PW_SERVICE_UNAVAILABLE;
|
|
+ break;
|
|
+
|
|
+ case EXIT_IDLE_TIMEOUT:
|
|
+ av_type = PW_ACCT_IDLE_TIMEOUT;
|
|
+ break;
|
|
+
|
|
+ case EXIT_CONNECT_TIME:
|
|
+ av_type = PW_ACCT_SESSION_TIMEOUT;
|
|
+ break;
|
|
+
|
|
+#ifdef MAXOCTETS
|
|
+ case EXIT_TRAFFIC_LIMIT:
|
|
+ av_type = PW_NAS_REQUEST;
|
|
+ break;
|
|
+#endif
|
|
+
|
|
+ default:
|
|
+ av_type = PW_NAS_ERROR;
|
|
+ break;
|
|
+ }
|
|
+ rc_avpair_add(&send, PW_ACCT_TERMINATE_CAUSE, &av_type, 0, VENDOR_NONE);
|
|
+
|
|
hisaddr = ho->hisaddr;
|
|
av_type = htonl(hisaddr);
|
|
rc_avpair_add(&send, PW_FRAMED_IP_ADDRESS , &av_type , 0, VENDOR_NONE);
|
|
@@ -1077,7 +1129,7 @@
|
|
remote_number, 0, VENDOR_NONE);
|
|
}
|
|
|
|
- av_type = PW_ASYNC;
|
|
+ av_type = ( using_pty ? PW_VIRTUAL : ( sync_serial ? PW_SYNC : PW_ASYNC ) );
|
|
rc_avpair_add(&send, PW_NAS_PORT_TYPE, &av_type, 0, VENDOR_NONE);
|
|
|
|
hisaddr = ho->hisaddr;
|
|
diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/CVS/Entries ppp-cvs-20040427/pppd/plugins/radius/radiusclient/CVS/Entries
|
|
--- ppp-2.4.2/pppd/plugins/radius/radiusclient/CVS/Entries 2002-09-07 12:37:54.000000000 +0200
|
|
+++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/CVS/Entries 1970-01-01 01:00:00.000000000 +0100
|
|
@@ -1,28 +0,0 @@
|
|
-/BUGS/1.1/Tue Jan 22 16:03:00 2002//
|
|
-/CHANGES/1.1/Tue Jan 22 16:03:00 2002//
|
|
-/COPYRIGHT/1.1/Tue Jan 22 16:03:00 2002//
|
|
-/Makefile.am/1.1/Tue Jan 22 16:03:00 2002//
|
|
-/Makefile.in/1.1/Tue Jan 22 16:03:00 2002//
|
|
-/README/1.1/Tue Jan 22 16:03:00 2002//
|
|
-/README.radexample/1.1/Tue Jan 22 16:03:00 2002//
|
|
-/acconfig.h/1.1/Tue Jan 22 16:03:00 2002//
|
|
-/aclocal.m4/1.2/Mon Jun 24 12:57:15 2002//
|
|
-/config.guess/1.1/Tue Jan 22 16:03:00 2002//
|
|
-/config.h.in/1.3/Thu Jul 25 16:29:16 2002//
|
|
-/config.sub/1.1/Tue Jan 22 16:03:00 2002//
|
|
-/configure/1.1/Tue Jan 22 16:03:00 2002//
|
|
-/configure.in/1.1/Tue Jan 22 16:03:00 2002//
|
|
-/install-sh/1.1/Tue Jan 22 16:03:00 2002//
|
|
-/ltconfig/1.1/Tue Jan 22 16:03:00 2002//
|
|
-/ltmain.sh/1.1/Tue Jan 22 16:03:00 2002//
|
|
-/missing/1.1/Tue Jan 22 16:03:00 2002//
|
|
-/mkinstalldirs/1.1/Tue Jan 22 16:03:00 2002//
|
|
-/stamp-h.in/1.1/Tue Jan 22 16:03:00 2002//
|
|
-D/doc////
|
|
-D/etc////
|
|
-D/include////
|
|
-D/lib////
|
|
-D/login.radius////
|
|
-D/man////
|
|
-D/patches////
|
|
-D/src////
|
|
diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/CVS/Repository ppp-cvs-20040427/pppd/plugins/radius/radiusclient/CVS/Repository
|
|
--- ppp-2.4.2/pppd/plugins/radius/radiusclient/CVS/Repository 2002-09-07 12:37:51.000000000 +0200
|
|
+++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/CVS/Repository 1970-01-01 01:00:00.000000000 +0100
|
|
@@ -1 +0,0 @@
|
|
-ppp/pppd/plugins/radius/radiusclient
|
|
diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/CVS/Root ppp-cvs-20040427/pppd/plugins/radius/radiusclient/CVS/Root
|
|
--- ppp-2.4.2/pppd/plugins/radius/radiusclient/CVS/Root 2002-09-07 12:37:51.000000000 +0200
|
|
+++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/CVS/Root 1970-01-01 01:00:00.000000000 +0100
|
|
@@ -1 +0,0 @@
|
|
-samba.org:/data/cvs
|
|
diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/doc/CVS/Entries ppp-cvs-20040427/pppd/plugins/radius/radiusclient/doc/CVS/Entries
|
|
--- ppp-2.4.2/pppd/plugins/radius/radiusclient/doc/CVS/Entries 2002-09-07 12:37:52.000000000 +0200
|
|
+++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/doc/CVS/Entries 1970-01-01 01:00:00.000000000 +0100
|
|
@@ -1,4 +0,0 @@
|
|
-/Makefile.am/1.1/Tue Jan 22 16:03:01 2002//
|
|
-/Makefile.in/1.1/Tue Jan 22 16:03:01 2002//
|
|
-/instop.html/1.1/Tue Jan 22 16:03:01 2002//
|
|
-D
|
|
diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/doc/CVS/Repository ppp-cvs-20040427/pppd/plugins/radius/radiusclient/doc/CVS/Repository
|
|
--- ppp-2.4.2/pppd/plugins/radius/radiusclient/doc/CVS/Repository 2002-09-07 12:37:52.000000000 +0200
|
|
+++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/doc/CVS/Repository 1970-01-01 01:00:00.000000000 +0100
|
|
@@ -1 +0,0 @@
|
|
-ppp/pppd/plugins/radius/radiusclient/doc
|
|
diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/doc/CVS/Root ppp-cvs-20040427/pppd/plugins/radius/radiusclient/doc/CVS/Root
|
|
--- ppp-2.4.2/pppd/plugins/radius/radiusclient/doc/CVS/Root 2002-09-07 12:37:52.000000000 +0200
|
|
+++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/doc/CVS/Root 1970-01-01 01:00:00.000000000 +0100
|
|
@@ -1 +0,0 @@
|
|
-samba.org:/data/cvs
|
|
diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/etc/CVS/Entries ppp-cvs-20040427/pppd/plugins/radius/radiusclient/etc/CVS/Entries
|
|
--- ppp-2.4.2/pppd/plugins/radius/radiusclient/etc/CVS/Entries 2002-11-09 12:24:42.000000000 +0100
|
|
+++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/etc/CVS/Entries 1970-01-01 01:00:00.000000000 +0100
|
|
@@ -1,13 +0,0 @@
|
|
-/dictionary.ascend/1.1/Tue Jan 22 16:03:01 2002//
|
|
-/dictionary.compat/1.1/Tue Jan 22 16:03:01 2002//
|
|
-/dictionary.merit/1.1/Tue Jan 22 16:03:01 2002//
|
|
-/dictionary.microsoft/1.1/Wed Mar 6 13:23:09 2002//
|
|
-/issue/1.1/Tue Jan 22 16:03:01 2002//
|
|
-/port-id-map/1.1/Tue Jan 22 16:03:01 2002//
|
|
-/servers/1.1/Tue Jan 22 16:03:01 2002//
|
|
-/Makefile.am/1.4/Sat Nov 9 11:24:42 2002//
|
|
-/Makefile.in/1.5/Sat Nov 9 11:24:42 2002//
|
|
-/dictionary/1.9/Sat Nov 9 11:24:42 2002//
|
|
-/radiusclient.conf.in/1.2/Sat Nov 9 11:24:42 2002//
|
|
-/realms/1.1/Sat Oct 5 04:35:24 2002//
|
|
-D
|
|
diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/etc/CVS/Repository ppp-cvs-20040427/pppd/plugins/radius/radiusclient/etc/CVS/Repository
|
|
--- ppp-2.4.2/pppd/plugins/radius/radiusclient/etc/CVS/Repository 2002-09-07 12:37:52.000000000 +0200
|
|
+++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/etc/CVS/Repository 1970-01-01 01:00:00.000000000 +0100
|
|
@@ -1 +0,0 @@
|
|
-ppp/pppd/plugins/radius/radiusclient/etc
|
|
diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/etc/CVS/Root ppp-cvs-20040427/pppd/plugins/radius/radiusclient/etc/CVS/Root
|
|
--- ppp-2.4.2/pppd/plugins/radius/radiusclient/etc/CVS/Root 2002-09-07 12:37:52.000000000 +0200
|
|
+++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/etc/CVS/Root 1970-01-01 01:00:00.000000000 +0100
|
|
@@ -1 +0,0 @@
|
|
-samba.org:/data/cvs
|
|
diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/include/CVS/Entries ppp-cvs-20040427/pppd/plugins/radius/radiusclient/include/CVS/Entries
|
|
--- ppp-2.4.2/pppd/plugins/radius/radiusclient/include/CVS/Entries 2002-12-04 22:49:09.000000000 +0100
|
|
+++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/include/CVS/Entries 1970-01-01 01:00:00.000000000 +0100
|
|
@@ -1,7 +0,0 @@
|
|
-/Makefile.am/1.1/Tue Jan 22 16:03:01 2002//
|
|
-/Makefile.in/1.1/Tue Jan 22 16:03:01 2002//
|
|
-/includes.h/1.2/Wed Feb 27 15:51:19 2002//
|
|
-/messages.h/1.2/Wed Feb 27 15:51:19 2002//
|
|
-/pathnames.h/1.2/Wed Feb 27 15:51:19 2002//
|
|
-/radiusclient.h/1.9/Wed Dec 4 21:49:09 2002//
|
|
-D
|
|
diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/include/CVS/Repository ppp-cvs-20040427/pppd/plugins/radius/radiusclient/include/CVS/Repository
|
|
--- ppp-2.4.2/pppd/plugins/radius/radiusclient/include/CVS/Repository 2002-09-07 12:37:52.000000000 +0200
|
|
+++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/include/CVS/Repository 1970-01-01 01:00:00.000000000 +0100
|
|
@@ -1 +0,0 @@
|
|
-ppp/pppd/plugins/radius/radiusclient/include
|
|
diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/include/CVS/Root ppp-cvs-20040427/pppd/plugins/radius/radiusclient/include/CVS/Root
|
|
--- ppp-2.4.2/pppd/plugins/radius/radiusclient/include/CVS/Root 2002-09-07 12:37:52.000000000 +0200
|
|
+++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/include/CVS/Root 1970-01-01 01:00:00.000000000 +0100
|
|
@@ -1 +0,0 @@
|
|
-samba.org:/data/cvs
|
|
diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/lib/CVS/Entries ppp-cvs-20040427/pppd/plugins/radius/radiusclient/lib/CVS/Entries
|
|
--- ppp-2.4.2/pppd/plugins/radius/radiusclient/lib/CVS/Entries 2002-12-04 22:49:09.000000000 +0100
|
|
+++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/lib/CVS/Entries 1970-01-01 01:00:00.000000000 +0100
|
|
@@ -1,20 +0,0 @@
|
|
-/Makefile.am/1.1/Tue Jan 22 16:03:02 2002//
|
|
-/Makefile.in/1.2/Wed Feb 20 02:22:35 2002//
|
|
-/clientid.c/1.2/Wed Feb 27 15:51:20 2002//
|
|
-/dict.c/1.2/Tue Mar 5 15:14:06 2002//
|
|
-/env.c/1.2/Wed Feb 27 15:51:20 2002//
|
|
-/ip_util.c/1.2/Wed Feb 27 15:51:20 2002//
|
|
-/lock.c/1.2/Wed Feb 27 15:51:20 2002//
|
|
-/log.c/1.2/Wed Feb 27 15:51:20 2002//
|
|
-/md5.c/1.2/Wed Feb 27 15:51:20 2002//
|
|
-/memcmp.c/1.2/Wed Feb 27 15:51:20 2002//
|
|
-/sendserver.c/1.4/Tue Apr 2 14:09:35 2002//
|
|
-/strcasecmp.c/1.2/Wed Feb 27 15:51:20 2002//
|
|
-/strdup.c/1.2/Wed Feb 27 15:51:20 2002//
|
|
-/strerror.c/1.2/Wed Feb 27 15:51:20 2002//
|
|
-/util.c/1.2/Wed Feb 27 15:51:20 2002//
|
|
-/buildreq.c/1.4/Sat Nov 9 11:24:43 2002//
|
|
-/config.c/1.3/Sat Nov 9 11:24:43 2002//
|
|
-/options.h/1.2/Sat Nov 9 11:24:43 2002//
|
|
-/avpair.c/1.3/Wed Dec 4 21:49:09 2002//
|
|
-D
|
|
diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/lib/CVS/Repository ppp-cvs-20040427/pppd/plugins/radius/radiusclient/lib/CVS/Repository
|
|
--- ppp-2.4.2/pppd/plugins/radius/radiusclient/lib/CVS/Repository 2002-09-07 12:37:53.000000000 +0200
|
|
+++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/lib/CVS/Repository 1970-01-01 01:00:00.000000000 +0100
|
|
@@ -1 +0,0 @@
|
|
-ppp/pppd/plugins/radius/radiusclient/lib
|
|
diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/lib/CVS/Root ppp-cvs-20040427/pppd/plugins/radius/radiusclient/lib/CVS/Root
|
|
--- ppp-2.4.2/pppd/plugins/radius/radiusclient/lib/CVS/Root 2002-09-07 12:37:53.000000000 +0200
|
|
+++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/lib/CVS/Root 1970-01-01 01:00:00.000000000 +0100
|
|
@@ -1 +0,0 @@
|
|
-samba.org:/data/cvs
|
|
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
|
|
--- ppp-2.4.2/pppd/plugins/radius/radiusclient/login.radius/CVS/Entries 2002-09-07 12:37:54.000000000 +0200
|
|
+++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/login.radius/CVS/Entries 1970-01-01 01:00:00.000000000 +0100
|
|
@@ -1,5 +0,0 @@
|
|
-/Makefile.am/1.1/Tue Jan 22 16:03:02 2002//
|
|
-/Makefile.in/1.1/Tue Jan 22 16:03:02 2002//
|
|
-/README/1.1/Tue Jan 22 16:03:02 2002//
|
|
-/login.radius/1.1/Tue Jan 22 16:03:02 2002//
|
|
-D/migs////
|
|
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
|
|
--- ppp-2.4.2/pppd/plugins/radius/radiusclient/login.radius/CVS/Repository 2002-09-07 12:37:53.000000000 +0200
|
|
+++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/login.radius/CVS/Repository 1970-01-01 01:00:00.000000000 +0100
|
|
@@ -1 +0,0 @@
|
|
-ppp/pppd/plugins/radius/radiusclient/login.radius
|
|
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
|
|
--- ppp-2.4.2/pppd/plugins/radius/radiusclient/login.radius/CVS/Root 2002-09-07 12:37:53.000000000 +0200
|
|
+++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/login.radius/CVS/Root 1970-01-01 01:00:00.000000000 +0100
|
|
@@ -1 +0,0 @@
|
|
-samba.org:/data/cvs
|
|
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
|
|
--- ppp-2.4.2/pppd/plugins/radius/radiusclient/login.radius/migs/CVS/Entries 2002-09-07 12:37:53.000000000 +0200
|
|
+++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/login.radius/migs/CVS/Entries 1970-01-01 01:00:00.000000000 +0100
|
|
@@ -1,7 +0,0 @@
|
|
-/Makefile.am/1.1/Tue Jan 22 16:03:02 2002//
|
|
-/Makefile.in/1.1/Tue Jan 22 16:03:02 2002//
|
|
-/README/1.1/Tue Jan 22 16:03:02 2002//
|
|
-/ip-down/1.1/Tue Jan 22 16:03:02 2002//
|
|
-/ip-up/1.1/Tue Jan 22 16:03:02 2002//
|
|
-/login.radius/1.1/Tue Jan 22 16:03:02 2002//
|
|
-D
|
|
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
|
|
--- ppp-2.4.2/pppd/plugins/radius/radiusclient/login.radius/migs/CVS/Repository 2002-09-07 12:37:53.000000000 +0200
|
|
+++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/login.radius/migs/CVS/Repository 1970-01-01 01:00:00.000000000 +0100
|
|
@@ -1 +0,0 @@
|
|
-ppp/pppd/plugins/radius/radiusclient/login.radius/migs
|
|
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
|
|
--- ppp-2.4.2/pppd/plugins/radius/radiusclient/login.radius/migs/CVS/Root 2002-09-07 12:37:53.000000000 +0200
|
|
+++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/login.radius/migs/CVS/Root 1970-01-01 01:00:00.000000000 +0100
|
|
@@ -1 +0,0 @@
|
|
-samba.org:/data/cvs
|
|
diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/man/CVS/Entries ppp-cvs-20040427/pppd/plugins/radius/radiusclient/man/CVS/Entries
|
|
--- ppp-2.4.2/pppd/plugins/radius/radiusclient/man/CVS/Entries 2002-09-07 12:37:53.000000000 +0200
|
|
+++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/man/CVS/Entries 1970-01-01 01:00:00.000000000 +0100
|
|
@@ -1,3 +0,0 @@
|
|
-/Makefile.am/1.1/Tue Jan 22 16:03:02 2002//
|
|
-/Makefile.in/1.1/Tue Jan 22 16:03:02 2002//
|
|
-D
|
|
diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/man/CVS/Repository ppp-cvs-20040427/pppd/plugins/radius/radiusclient/man/CVS/Repository
|
|
--- ppp-2.4.2/pppd/plugins/radius/radiusclient/man/CVS/Repository 2002-09-07 12:37:53.000000000 +0200
|
|
+++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/man/CVS/Repository 1970-01-01 01:00:00.000000000 +0100
|
|
@@ -1 +0,0 @@
|
|
-ppp/pppd/plugins/radius/radiusclient/man
|
|
diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/man/CVS/Root ppp-cvs-20040427/pppd/plugins/radius/radiusclient/man/CVS/Root
|
|
--- ppp-2.4.2/pppd/plugins/radius/radiusclient/man/CVS/Root 2002-09-07 12:37:53.000000000 +0200
|
|
+++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/man/CVS/Root 1970-01-01 01:00:00.000000000 +0100
|
|
@@ -1 +0,0 @@
|
|
-samba.org:/data/cvs
|
|
diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/patches/CVS/Entries ppp-cvs-20040427/pppd/plugins/radius/radiusclient/patches/CVS/Entries
|
|
--- ppp-2.4.2/pppd/plugins/radius/radiusclient/patches/CVS/Entries 2002-09-07 12:37:53.000000000 +0200
|
|
+++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/patches/CVS/Entries 1970-01-01 01:00:00.000000000 +0100
|
|
@@ -1,7 +0,0 @@
|
|
-/Makefile.am/1.1/Tue Jan 22 16:03:03 2002//
|
|
-/Makefile.in/1.1/Tue Jan 22 16:03:03 2002//
|
|
-/README/1.1/Tue Jan 22 16:03:03 2002//
|
|
-/merit-2.4.21-CHAP.diff/1.1/Tue Jan 22 16:03:04 2002//
|
|
-/radiusd-1.16.accounting.diff/1.1/Tue Jan 22 16:03:04 2002//
|
|
-/radiusd-1.16.shadow.diff/1.1/Tue Jan 22 16:03:04 2002//
|
|
-D
|
|
diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/patches/CVS/Repository ppp-cvs-20040427/pppd/plugins/radius/radiusclient/patches/CVS/Repository
|
|
--- ppp-2.4.2/pppd/plugins/radius/radiusclient/patches/CVS/Repository 2002-09-07 12:37:53.000000000 +0200
|
|
+++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/patches/CVS/Repository 1970-01-01 01:00:00.000000000 +0100
|
|
@@ -1 +0,0 @@
|
|
-ppp/pppd/plugins/radius/radiusclient/patches
|
|
diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/patches/CVS/Root ppp-cvs-20040427/pppd/plugins/radius/radiusclient/patches/CVS/Root
|
|
--- ppp-2.4.2/pppd/plugins/radius/radiusclient/patches/CVS/Root 2002-09-07 12:37:53.000000000 +0200
|
|
+++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/patches/CVS/Root 1970-01-01 01:00:00.000000000 +0100
|
|
@@ -1 +0,0 @@
|
|
-samba.org:/data/cvs
|
|
diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/src/CVS/Entries ppp-cvs-20040427/pppd/plugins/radius/radiusclient/src/CVS/Entries
|
|
--- ppp-2.4.2/pppd/plugins/radius/radiusclient/src/CVS/Entries 2002-09-07 12:37:53.000000000 +0200
|
|
+++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/src/CVS/Entries 1970-01-01 01:00:00.000000000 +0100
|
|
@@ -1,11 +0,0 @@
|
|
-/Makefile.am/1.1/Tue Jan 22 16:03:04 2002//
|
|
-/Makefile.in/1.1/Tue Jan 22 16:03:04 2002//
|
|
-/local.c/1.1/Tue Jan 22 16:03:04 2002//
|
|
-/radacct.c/1.1/Tue Jan 22 16:03:04 2002//
|
|
-/radexample-debug/1.1/Tue Jan 22 16:03:04 2002//
|
|
-/radexample.c/1.2/Tue Apr 2 14:09:35 2002//
|
|
-/radius.c/1.2/Tue Apr 2 14:09:35 2002//
|
|
-/radlogin.c/1.1/Tue Jan 22 16:03:04 2002//
|
|
-/radlogin.h/1.1/Tue Jan 22 16:03:05 2002//
|
|
-/radstatus.c/1.1/Tue Jan 22 16:03:05 2002//
|
|
-D
|
|
diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/src/CVS/Repository ppp-cvs-20040427/pppd/plugins/radius/radiusclient/src/CVS/Repository
|
|
--- ppp-2.4.2/pppd/plugins/radius/radiusclient/src/CVS/Repository 2002-09-07 12:37:53.000000000 +0200
|
|
+++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/src/CVS/Repository 1970-01-01 01:00:00.000000000 +0100
|
|
@@ -1 +0,0 @@
|
|
-ppp/pppd/plugins/radius/radiusclient/src
|
|
diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/src/CVS/Root ppp-cvs-20040427/pppd/plugins/radius/radiusclient/src/CVS/Root
|
|
--- ppp-2.4.2/pppd/plugins/radius/radiusclient/src/CVS/Root 2002-09-07 12:37:53.000000000 +0200
|
|
+++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/src/CVS/Root 1970-01-01 01:00:00.000000000 +0100
|
|
@@ -1 +0,0 @@
|
|
-samba.org:/data/cvs
|
|
diff -ruN ppp-2.4.2/pppd/plugins/rp-pppoe/CVS/Entries ppp-cvs-20040427/pppd/plugins/rp-pppoe/CVS/Entries
|
|
--- ppp-2.4.2/pppd/plugins/rp-pppoe/CVS/Entries 2002-09-07 12:37:54.000000000 +0200
|
|
+++ ppp-cvs-20040427/pppd/plugins/rp-pppoe/CVS/Entries 1970-01-01 01:00:00.000000000 +0100
|
|
@@ -1,9 +0,0 @@
|
|
-/Makefile.linux/1.1/Fri Dec 14 02:55:20 2001//
|
|
-/common.c/1.1/Fri Dec 14 02:55:20 2001//
|
|
-/config.h/1.1/Fri Dec 14 02:55:20 2001//
|
|
-/debug.c/1.1/Fri Dec 14 02:55:20 2001//
|
|
-/discovery.c/1.1/Fri Dec 14 02:55:20 2001//
|
|
-/if.c/1.1/Fri Dec 14 02:55:20 2001//
|
|
-/plugin.c/1.7/Tue Apr 2 13:11:00 2002//
|
|
-/pppoe.h/1.1/Fri Dec 14 02:55:20 2001//
|
|
-D
|
|
diff -ruN ppp-2.4.2/pppd/plugins/rp-pppoe/CVS/Repository ppp-cvs-20040427/pppd/plugins/rp-pppoe/CVS/Repository
|
|
--- ppp-2.4.2/pppd/plugins/rp-pppoe/CVS/Repository 2002-09-07 12:37:53.000000000 +0200
|
|
+++ ppp-cvs-20040427/pppd/plugins/rp-pppoe/CVS/Repository 1970-01-01 01:00:00.000000000 +0100
|
|
@@ -1 +0,0 @@
|
|
-ppp/pppd/plugins/rp-pppoe
|
|
diff -ruN ppp-2.4.2/pppd/plugins/rp-pppoe/CVS/Root ppp-cvs-20040427/pppd/plugins/rp-pppoe/CVS/Root
|
|
--- ppp-2.4.2/pppd/plugins/rp-pppoe/CVS/Root 2002-09-07 12:37:53.000000000 +0200
|
|
+++ ppp-cvs-20040427/pppd/plugins/rp-pppoe/CVS/Root 1970-01-01 01:00:00.000000000 +0100
|
|
@@ -1 +0,0 @@
|
|
-samba.org:/data/cvs
|
|
diff -ruN ppp-2.4.2/pppd/plugins/rp-pppoe/Makefile ppp-cvs-20040427/pppd/plugins/rp-pppoe/Makefile
|
|
--- ppp-2.4.2/pppd/plugins/rp-pppoe/Makefile 2004-01-13 04:57:55.000000000 +0100
|
|
+++ ppp-cvs-20040427/pppd/plugins/rp-pppoe/Makefile 1970-01-01 01:00:00.000000000 +0100
|
|
@@ -1,50 +0,0 @@
|
|
-# Generated automatically from Makefile.in by configure.
|
|
-#***********************************************************************
|
|
-#
|
|
-# Makefile
|
|
-#
|
|
-# Makefile for Roaring Penguin's Linux PPPoE plugin.
|
|
-#
|
|
-# Copyright (C) 2001 Roaring Penguin Software Inc.
|
|
-#
|
|
-# This program may be distributed according to the terms of the GNU
|
|
-# General Public License, version 2 or (at your option) any later version.
|
|
-#
|
|
-# $Id: Makefile.linux,v 1.2 2004/01/13 03:57:55 paulus Exp $
|
|
-#***********************************************************************
|
|
-
|
|
-# Version is set ONLY IN THE MAKEFILE! Don't delete this!
|
|
-VERSION=3.3
|
|
-
|
|
-COPTS=-O2 -g
|
|
-CFLAGS=$(COPTS) -I../../../include/linux
|
|
-all: rp-pppoe.so
|
|
-
|
|
-rp-pppoe.so: libplugin.a plugin.o
|
|
- gcc -o rp-pppoe.so -shared plugin.o libplugin.a
|
|
-
|
|
-install: all
|
|
- $(INSTALL) -d -m 755 $(LIBDIR)
|
|
- $(INSTALL) -s -c -m 4550 rp-pppoe.so $(LIBDIR)
|
|
-
|
|
-clean:
|
|
- rm -f *.o *.so
|
|
-
|
|
-plugin.o: plugin.c
|
|
- gcc '-DRP_VERSION="$(VERSION)"' $(CFLAGS) -I../../.. -c -o plugin.o -fPIC plugin.c
|
|
-
|
|
-libplugin.a: discovery.o if.o common.o debug.o
|
|
- ar -rc $@ $^
|
|
-
|
|
-discovery.o: discovery.c
|
|
- gcc $(CFLAGS) '-DVERSION="$(VERSION)"' -c -o discovery.o -fPIC discovery.c
|
|
-
|
|
-if.o: if.c
|
|
- gcc $(CFLAGS) '-DVERSION="$(VERSION)"' -c -o if.o -fPIC if.c
|
|
-
|
|
-debug.o: debug.c
|
|
- gcc $(CFLAGS) '-DVERSION="$(VERSION)"' -c -o debug.o -fPIC debug.c
|
|
-
|
|
-common.o: common.c
|
|
- gcc $(CFLAGS) '-DVERSION="$(VERSION)"' -c -o common.o -fPIC common.c
|
|
-
|
|
diff -ruN ppp-2.4.2/pppd/pppd.8 ppp-cvs-20040427/pppd/pppd.8
|
|
--- ppp-2.4.2/pppd/pppd.8 2004-01-15 06:09:00.000000000 +0100
|
|
+++ ppp-cvs-20040427/pppd/pppd.8 2004-04-27 20:25:12.000000000 +0200
|
|
@@ -1,5 +1,5 @@
|
|
.\" manual page [] for pppd 2.4
|
|
-.\" $Id: pppd.8,v 1.76 2004/01/15 05:09:00 paulus Exp $
|
|
+.\" $Id: pppd.8,v 1.77 2004/04/27 18:22:58 fcusack Exp $
|
|
.\" SH section heading
|
|
.\" SS subsection heading
|
|
.\" LP paragraph
|
|
@@ -955,11 +955,11 @@
|
|
Require the use of MPPE, with 128\-bit encryption.
|
|
.TP
|
|
.B require-mschap
|
|
-Require the peer to authenticate itself using MS-CHAP [Microsft Challenge
|
|
+Require the peer to authenticate itself using MS-CHAP [Microsoft Challenge
|
|
Handshake Authentication Protocol] authentication.
|
|
.TP
|
|
.B require-mschap-v2
|
|
-Require the peer to authenticate itself using MS-CHAPv2 [Microsft Challenge
|
|
+Require the peer to authenticate itself using MS-CHAPv2 [Microsoft Challenge
|
|
Handshake Authentication Protocol, Version 2] authentication.
|
|
.TP
|
|
.B require-eap
|
|
diff -ruN ppp-2.4.2/pppd/tty.c ppp-cvs-20040427/pppd/tty.c
|
|
--- ppp-2.4.2/pppd/tty.c 2004-01-13 05:17:59.000000000 +0100
|
|
+++ ppp-cvs-20040427/pppd/tty.c 2004-01-17 06:50:12.000000000 +0100
|
|
@@ -73,7 +73,7 @@
|
|
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
*/
|
|
|
|
-#define RCSID "$Id: tty.c,v 1.13 2004/01/13 04:17:59 paulus Exp $"
|
|
+#define RCSID "$Id: tty.c,v 1.14 2004/01/17 05:47:55 carlsonj Exp $"
|
|
|
|
#include <stdio.h>
|
|
#include <ctype.h>
|
|
@@ -512,7 +512,9 @@
|
|
{
|
|
char *connector;
|
|
int fdflags;
|
|
+#ifndef __linux__
|
|
struct stat statbuf;
|
|
+#endif
|
|
char numbuf[16];
|
|
|
|
/*
|
|
diff -ruN ppp-2.4.2/pppdump/bsd-comp.c ppp-cvs-20040427/pppdump/bsd-comp.c
|
|
--- ppp-2.4.2/pppdump/bsd-comp.c 1999-04-16 13:34:42.000000000 +0200
|
|
+++ ppp-cvs-20040427/pppdump/bsd-comp.c 2004-01-17 06:50:12.000000000 +0100
|
|
@@ -38,12 +38,14 @@
|
|
*/
|
|
|
|
/*
|
|
- * $Id: bsd-comp.c,v 1.3 1999/04/16 11:35:59 paulus Exp $
|
|
+ * $Id: bsd-comp.c,v 1.4 2004/01/17 05:47:55 carlsonj Exp $
|
|
*/
|
|
|
|
#include <sys/types.h>
|
|
+#include <stdio.h>
|
|
#include <stddef.h>
|
|
#include <stdlib.h>
|
|
+#include <string.h>
|
|
#include "ppp_defs.h"
|
|
#include "ppp-comp.h"
|
|
|
|
diff -ruN ppp-2.4.2/pppdump/deflate.c ppp-cvs-20040427/pppdump/deflate.c
|
|
--- ppp-2.4.2/pppdump/deflate.c 2002-12-06 10:49:16.000000000 +0100
|
|
+++ ppp-cvs-20040427/pppdump/deflate.c 2004-01-17 06:50:12.000000000 +0100
|
|
@@ -33,12 +33,14 @@
|
|
* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
|
|
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
*
|
|
- * $Id: deflate.c,v 1.4 2002/12/06 09:49:16 paulus Exp $
|
|
+ * $Id: deflate.c,v 1.5 2004/01/17 05:47:55 carlsonj Exp $
|
|
*/
|
|
|
|
#include <sys/types.h>
|
|
+#include <stdio.h>
|
|
#include <stddef.h>
|
|
#include <stdlib.h>
|
|
+#include <string.h>
|
|
#include "ppp_defs.h"
|
|
#include "ppp-comp.h"
|
|
#include "zlib.h"
|
|
diff -ruN ppp-2.4.2/pppdump/pppdump.c ppp-cvs-20040427/pppdump/pppdump.c
|
|
--- ppp-2.4.2/pppdump/pppdump.c 2002-12-06 10:17:02.000000000 +0100
|
|
+++ ppp-cvs-20040427/pppdump/pppdump.c 2004-01-17 06:50:12.000000000 +0100
|
|
@@ -35,6 +35,7 @@
|
|
*/
|
|
#include <stdio.h>
|
|
#include <unistd.h>
|
|
+#include <stdlib.h>
|
|
#include <time.h>
|
|
#include <sys/types.h>
|
|
#include "ppp_defs.h"
|
|
@@ -53,6 +54,12 @@
|
|
extern int optind;
|
|
extern char *optarg;
|
|
|
|
+void dumplog();
|
|
+void dumpppp();
|
|
+void show_time();
|
|
+void handle_ccp();
|
|
+
|
|
+int
|
|
main(ac, av)
|
|
int ac;
|
|
char **av;
|
|
@@ -105,6 +112,7 @@
|
|
exit(0);
|
|
}
|
|
|
|
+void
|
|
dumplog(f)
|
|
FILE *f;
|
|
{
|
|
@@ -244,6 +252,7 @@
|
|
|
|
unsigned char dbuf[8192];
|
|
|
|
+void
|
|
dumpppp(f)
|
|
FILE *f;
|
|
{
|
|
@@ -429,6 +438,7 @@
|
|
NULL
|
|
};
|
|
|
|
+void
|
|
handle_ccp(cp, dp, len)
|
|
struct pkt *cp;
|
|
u_char *dp;
|
|
@@ -485,6 +495,7 @@
|
|
}
|
|
}
|
|
|
|
+void
|
|
show_time(f, c)
|
|
FILE *f;
|
|
int c;
|
|
diff -ruN ppp-2.4.2/scripts/callback ppp-cvs-20040427/scripts/callback
|
|
--- ppp-2.4.2/scripts/callback 1995-08-09 04:49:51.000000000 +0200
|
|
+++ ppp-cvs-20040427/scripts/callback 2004-04-12 07:30:11.000000000 +0200
|
|
@@ -33,7 +33,7 @@
|
|
ABORT '\nNO ANSWER\r' \
|
|
ABORT '\nRINGING\r\n\r\nRINGING\r' \
|
|
'' AT \
|
|
- 'OK-+++\c-OK' 'AT&C0&D2S0=0H0 \
|
|
+ 'OK-+++\c-OK' 'AT&C0&D2S0=0H0' \
|
|
TIMEOUT 30 \
|
|
OK ATDT$TELEPHONE \
|
|
CONNECT '' \
|
|
diff -ruN ppp-2.4.2/scripts/ipv6-down.sample ppp-cvs-20040427/scripts/ipv6-down.sample
|
|
--- ppp-2.4.2/scripts/ipv6-down.sample 1999-08-23 08:07:07.000000000 +0200
|
|
+++ ppp-cvs-20040427/scripts/ipv6-down.sample 2004-04-12 07:45:18.000000000 +0200
|
|
@@ -8,24 +8,24 @@
|
|
# Kill the router advertisement daemon on this interface.
|
|
# The killing procedure is copied from RedHat 6.0 initscripts.
|
|
|
|
-DEVICE=$1
|
|
+DEVICE="$1"
|
|
|
|
-PIDFILE=/var/run/radvd-$DEVICE.pid
|
|
+PIDFILE="/var/run/radvd-$DEVICE.pid"
|
|
|
|
-[ -f $PIDFILE ] || exit 0
|
|
+[ -f "$PIDFILE" ] || exit 0
|
|
|
|
-PID=`cat $PIDFILE`
|
|
+PID="$(cat "$PIDFILE")"
|
|
if [ "$PID" != "" ]; then
|
|
- if ps h $PID >/dev/null 2>&1; then
|
|
- kill -TERM $PID
|
|
+ if ps h "$PID" >/dev/null 2>&1; then
|
|
+ kill -TERM "$PID"
|
|
usleep 10000
|
|
- if ps h $PID >/dev/null 2>&1; then
|
|
+ if ps h "$PID" >/dev/null 2>&1; then
|
|
sleep 1
|
|
- if ps h $PID >/dev/null 2>&1; then
|
|
- kill -KILL $PID
|
|
+ if ps h "$PID" >/dev/null 2>&1; then
|
|
+ kill -KILL "$PID"
|
|
fi
|
|
fi
|
|
fi
|
|
fi
|
|
|
|
-rm -f $PIDFILE
|
|
+rm -f "$PIDFILE"
|
|
diff -ruN ppp-2.4.2/scripts/ipv6-up.sample ppp-cvs-20040427/scripts/ipv6-up.sample
|
|
--- ppp-2.4.2/scripts/ipv6-up.sample 1999-08-23 08:07:07.000000000 +0200
|
|
+++ ppp-cvs-20040427/scripts/ipv6-up.sample 2004-04-12 07:45:18.000000000 +0200
|
|
@@ -8,26 +8,27 @@
|
|
# Start router advertisements on this link.
|
|
# Based on radvd 0.5.0 behaviour
|
|
|
|
-DEVICE=$1
|
|
+DEVICE="$1"
|
|
|
|
-CFGFILE=/usr/inet6/etc/radvd.conf-$DEVICE
|
|
-PIDFILE=/var/run/radvd-$DEVICE.pid
|
|
+CFGFILE="/etc/radvd.conf-$DEVICE"
|
|
+PIDFILE="/var/run/radvd-$DEVICE.pid"
|
|
+EXEFILE="/usr/sbin/radvd"
|
|
|
|
-if [ -x /usr/inet6/sbin/radvd && -f $CFGFILE ]; then
|
|
- touch $PIDFILE
|
|
- if [ ! -f $PIDFILE ]; then
|
|
+if [ -x "$EXEFILE" -a -f "$CFGFILE" ]; then
|
|
+ touch "$PIDFILE"
|
|
+ if [ ! -f "$PIDFILE" ]; then
|
|
echo "error: $PIDFILE is not a regular file. Aborting"
|
|
exit 0
|
|
fi
|
|
|
|
- PID=`cat $PIDFILE`
|
|
- if [ "$PID" != "" ]; then
|
|
- ps h $PID >/dev/null 2>&1 && exit 0
|
|
+ PID="$(cat "$PIDFILE")"
|
|
+ if [ -n "$PID" ]; then
|
|
+ ps h "$PID" >/dev/null 2>&1 && exit 0
|
|
fi
|
|
|
|
# radvd 0.5.0 doesn't write a pid-file so we do it here
|
|
# enabling debugging keeps radvd in foreground, putting it
|
|
# on background gives us the PID.
|
|
- /usr/inet6/sbin/radvd -d 1 -C $CFGFILE &
|
|
- echo $! >$PIDFILE
|
|
+ "$EXEFILE" -d 1 -C "$CFGFILE" &
|
|
+ echo $! >"$PIDFILE"
|
|
fi
|
|
diff -ruN ppp-2.4.2/scripts/pon ppp-cvs-20040427/scripts/pon
|
|
--- ppp-2.4.2/scripts/pon 2002-11-25 00:30:44.000000000 +0100
|
|
+++ ppp-cvs-20040427/scripts/pon 2004-04-12 07:45:18.000000000 +0200
|
|
@@ -1,10 +1,12 @@
|
|
#!/bin/sh
|
|
|
|
+PPP_ON_BOOT=/etc/ppp/ppp_on_boot
|
|
+
|
|
case "$1" in
|
|
-*) echo "
|
|
Usage: pon [provider] [arguments]
|
|
|
|
-If pon is invoked without arguments, /etc/ppp/ppp_on_boot file will be
|
|
+If pon is invoked without arguments, $PPP_ON_BOOT file will be
|
|
run, presuming it exists and is executable. Otherwise, a PPP connection
|
|
will be started using settings from /etc/ppp/peers/provider.
|
|
If you specify one argument, a PPP connection will be started using
|
|
@@ -16,8 +18,8 @@
|
|
;;
|
|
esac
|
|
|
|
-if [ -z "$1" -a -x /etc/ppp/ppp_on_boot ]; then
|
|
- exec /etc/ppp/ppp_on_boot
|
|
+if [ -z "$1" -a -x "$PPP_ON_BOOT" ]; then
|
|
+ exec "$PPP_ON_BOOT"
|
|
fi
|
|
|
|
if [ -z "$1" -a ! -f /etc/ppp/peers/provider ]; then
|
|
diff -ruN ppp-2.4.2/svr4/Makedefs ppp-cvs-20040427/svr4/Makedefs
|
|
--- ppp-2.4.2/svr4/Makedefs 1970-01-01 01:00:00.000000000 +0100
|
|
+++ ppp-cvs-20040427/svr4/Makedefs 2000-06-09 03:36:34.000000000 +0200
|
|
@@ -0,0 +1,16 @@
|
|
+#
|
|
+# defines common to several Makefiles
|
|
+#
|
|
+
|
|
+INSTALL= /usr/sbin/install
|
|
+
|
|
+BINDIR = /usr/local/bin
|
|
+MANDIR = /usr/local/man
|
|
+ETCDIR = /etc/ppp
|
|
+
|
|
+COPTS = -O -Xa
|
|
+
|
|
+# For compiling with gcc, comment out the COPTS definition above and
|
|
+# uncomment the next 2 definitions.
|
|
+#CC = gcc
|
|
+#COPTS = -O2
|
|
diff -ruN ppp-2.4.2/svr4/Makedefs.sol2 ppp-cvs-20040427/svr4/Makedefs.sol2
|
|
--- ppp-2.4.2/svr4/Makedefs.sol2 1970-01-01 01:00:00.000000000 +0100
|
|
+++ ppp-cvs-20040427/svr4/Makedefs.sol2 1999-09-21 22:50:31.000000000 +0200
|
|
@@ -0,0 +1,59 @@
|
|
+#
|
|
+# Generic make definitions for Solaris 2
|
|
+#
|
|
+# $Id: Makedefs.sol2,v 1.3 1999/09/21 20:37:20 masputra Exp $
|
|
+#
|
|
+
|
|
+include ../svr4/Makedefs
|
|
+
|
|
+CPPFLAGS = -D_KERNEL -DSVR4 -DSOL2 -DPRIOQ -DDEBUG -I../include
|
|
+CFLAGS = $(CPPFLAGS) $(COPTS)
|
|
+
|
|
+# lint-specific variables
|
|
+LINT = lint
|
|
+LINT_OPT_32 =
|
|
+LINT_OPT_64 = -Xarch=v9 -errchk=longptr64
|
|
+
|
|
+LINT_32 =
|
|
+LINT_32 += -erroff=E_BAD_PTR_CAST_ALIGN
|
|
+LINT_32 += -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
|
|
+LINT_32 += -erroff=E_SUSPICIOUS_COMPARISON
|
|
+LINT_32 += -erroff=E_CAST_UINT_TO_SIGNED_INT
|
|
+LINT_32 += -erroff=E_PASS_UINT_TO_SIGNED_INT
|
|
+LINT_32 += -erroff=E_INVALID_ANNOTATION_NAME
|
|
+LINT_32 += -erroff=E_FUNC_ARG_UNUSED
|
|
+# This might be needed, but zlib.c and vjcompress.c will squawk
|
|
+# when not ignored
|
|
+LINT_32 += -erroff=E_CASE_FALLTHRU
|
|
+LINT_32 += -erroff=E_RET_INT_IMPLICITLY
|
|
+LINT_32 += -erroff=E_FUNC_NO_RET_VAL
|
|
+# Some STREAMS macros will be noisy too when this isn't ignored
|
|
+LINT_32 += -erroff=E_CONSTANT_CONDITION
|
|
+LINT_32 += -erroff=E_CONST_EXPR
|
|
+
|
|
+# Extra noise suppressant for 64-bit
|
|
+EXTRA_OFF =
|
|
+EXTRA_OFF += -erroff=E_CAST_INT_TO_SMALL_INT
|
|
+EXTRA_OFF += -erroff=E_CAST_INT_CONST_TO_SMALL_INT
|
|
+EXTRA_OFF += -erroff=E_CAST_TO_PTR_FROM_INT
|
|
+EXTRA_OFF += -erroff=E_ASSIGN_INT_TO_SMALL_INT
|
|
+EXTRA_OFF += -erroff=E_ASSIGN_INT_FROM_BIG_CONST
|
|
+EXTRA_OFF += -erroff=E_CONST_PROMOTED_UNSIGNED_LL
|
|
+EXTRA_OFF += -erroff=E_CONST_PROMOTED_LONG_LONG
|
|
+EXTRA_OFF += -erroff=E_CONST_TRUNCATED_BY_ASSIGN
|
|
+EXTRA_OFF += -erroff=E_PASS_INT_FROM_BIG_CONST
|
|
+EXTRA_OFF += -erroff=E_COMP_INT_WITH_LARGE_INT
|
|
+EXTRA_OFF += -erroff=E_ASSIGN_UINT_TO_SIGNED_INT
|
|
+EXTRA_OFF += -erroff=E_ASSIGN_NARROW_CONV
|
|
+EXTRA_OFF += -erroff=E_PASS_INT_TO_SMALL_INT
|
|
+EXTRA_OFF += -erroff=E_PTR_CONV_LOSES_BITS
|
|
+
|
|
+LINT_64 = $(LINT_32)
|
|
+LINT_64 += $(EXTRA_OFF)
|
|
+
|
|
+LINTFLAGS64 = -Xa -nsxmuF -errtags=yes $(LINT_OPT_64) $(LINT_64)
|
|
+LINT64 = $(LINT) -c $(LINTFLAGS64) $(CPPFLAGS)
|
|
+
|
|
+LINTFLAGS32 = -Xa -nsxmuF -errtags=yes $(LINT_OPT_32) $(LINT_32)
|
|
+LINT32 = $(LINT) -c $(LINTFLAGS32) $(CPPFLAGS)
|
|
+
|
|
diff -ruN ppp-2.4.2/svr4/Makefile.sol2 ppp-cvs-20040427/svr4/Makefile.sol2
|
|
--- ppp-2.4.2/svr4/Makefile.sol2 1970-01-01 01:00:00.000000000 +0100
|
|
+++ ppp-cvs-20040427/svr4/Makefile.sol2 1999-09-21 22:50:32.000000000 +0200
|
|
@@ -0,0 +1,66 @@
|
|
+#
|
|
+# Makefile for STREAMS modules for Solaris 2.
|
|
+#
|
|
+# $Id: Makefile.sol2,v 1.18 1999/09/21 20:37:20 masputra Exp $
|
|
+#
|
|
+
|
|
+include Makedefs.sol2
|
|
+
|
|
+COPTS += -xO2 -xspace -W0,-Lt
|
|
+
|
|
+COMP_OBJS = ppp_comp.o bsd-comp.o deflate.o zlib.o vjcompress.o \
|
|
+ ppp_comp_mod.o
|
|
+
|
|
+all: ppp ppp_ahdl ppp_comp
|
|
+
|
|
+ppp: ppp.o ppp_mod.o
|
|
+ ld -r -o $@ ppp.o ppp_mod.o
|
|
+ chmod +x $@
|
|
+
|
|
+ppp_ahdl: ppp_ahdlc.o ppp_ahdlc_mod.o
|
|
+ ld -r -o $@ ppp_ahdlc.o ppp_ahdlc_mod.o
|
|
+ chmod +x $@
|
|
+
|
|
+ppp_comp: $(COMP_OBJS)
|
|
+ ld -r -o $@ $(COMP_OBJS)
|
|
+ chmod +x $@
|
|
+
|
|
+bsd-comp.o: ../modules/bsd-comp.c
|
|
+ $(CC) $(CFLAGS) -c $?
|
|
+deflate.o: ../modules/deflate.c
|
|
+ $(CC) $(CFLAGS) -c $?
|
|
+ppp.o: ../modules/ppp.c
|
|
+ $(CC) $(CFLAGS) -c $?
|
|
+ppp_mod.o: ppp_mod.c
|
|
+ $(CC) $(CFLAGS) -c $?
|
|
+ppp_ahdlc_mod.o: ppp_ahdlc_mod.c
|
|
+ $(CC) $(CFLAGS) -c $?
|
|
+ppp_ahdlc.o: ../modules/ppp_ahdlc.c
|
|
+ $(CC) $(CFLAGS) -c $?
|
|
+ppp_comp.o: ../modules/ppp_comp.c
|
|
+ $(CC) $(CFLAGS) -c $?
|
|
+ppp_comp_mod.o: ppp_comp_mod.c
|
|
+ $(CC) $(CFLAGS) -c $?
|
|
+vjcompress.o: ../modules/vjcompress.c
|
|
+ $(CC) $(CFLAGS) -c $?
|
|
+zlib.o: ../common/zlib.c
|
|
+ $(CC) $(CFLAGS) -c $?
|
|
+
|
|
+install:
|
|
+ cp ppp ppp.conf /kernel/drv
|
|
+ cp ppp_comp ppp_ahdl /kernel/strmod
|
|
+ if grep clone:ppp /etc/minor_perm; then :; else \
|
|
+ echo clone:ppp 0644 root sys >>/etc/minor_perm; fi
|
|
+ /usr/sbin/rem_drv ppp 2>/dev/null || true
|
|
+ /usr/sbin/add_drv ppp
|
|
+
|
|
+SRCS = ../modules/ppp.c ppp_mod.c ../modules/ppp_ahdlc.c ppp_ahdlc_mod.c \
|
|
+ ../modules/ppp_comp.c ../modules/bsd-comp.c ../modules/deflate.c \
|
|
+ ../common/zlib.c ../modules/vjcompress.c ppp_comp_mod.c
|
|
+
|
|
+lint:
|
|
+ $(LINT32) $(SRCS)
|
|
+
|
|
+clean:
|
|
+ rm -f ppp ppp_comp ppp_ahdl *.o *~ core
|
|
+ rm -f *.ln
|
|
diff -ruN ppp-2.4.2/svr4/Makefile.sol2-64 ppp-cvs-20040427/svr4/Makefile.sol2-64
|
|
--- ppp-2.4.2/svr4/Makefile.sol2-64 1970-01-01 01:00:00.000000000 +0100
|
|
+++ ppp-cvs-20040427/svr4/Makefile.sol2-64 1999-09-21 22:50:33.000000000 +0200
|
|
@@ -0,0 +1,85 @@
|
|
+#
|
|
+# Makefile for 64-bit STREAMS modules for Solaris 2.
|
|
+#
|
|
+# $Id: Makefile.sol2-64,v 1.3 1999/09/21 20:37:20 masputra Exp $
|
|
+#
|
|
+
|
|
+include Makedefs.sol2
|
|
+
|
|
+# Sun's cc flag for LP64 compilation / linkage
|
|
+COPTS += -xchip=ultra -xarch=v9 -Wc,-xcode=abs32 -Wc,-Qiselect-regsym=0 -xO3 -xspace -W0,-Lt
|
|
+
|
|
+# subdirectory where 64-bit objects / binaries will be placed
|
|
+LP64DIR = sparcv9
|
|
+
|
|
+# Name of legacy Makefile (for 32-bit binaries)
|
|
+STD_MAKE = Makefile.sol2
|
|
+
|
|
+COMP_OBJS = $(LP64DIR)/ppp_comp.o $(LP64DIR)/bsd-comp.o \
|
|
+ $(LP64DIR)/deflate.o $(LP64DIR)/zlib.o $(LP64DIR)/vjcompress.o \
|
|
+ $(LP64DIR)/ppp_comp_mod.o
|
|
+
|
|
+all: std_objs $(LP64DIR) ppp ppp_ahdl ppp_comp
|
|
+
|
|
+std_objs:
|
|
+ $(MAKE) -f $(STD_MAKE) all
|
|
+
|
|
+ppp: $(LP64DIR)/ppp.o $(LP64DIR)/ppp_mod.o
|
|
+ ld -r -o $(LP64DIR)/$@ $(LP64DIR)/ppp.o $(LP64DIR)/ppp_mod.o
|
|
+ chmod +x $(LP64DIR)/$@
|
|
+
|
|
+ppp_ahdl: $(LP64DIR)/ppp_ahdlc.o $(LP64DIR)/ppp_ahdlc_mod.o
|
|
+ ld -r -o $(LP64DIR)/$@ $(LP64DIR)/ppp_ahdlc.o $(LP64DIR)/ppp_ahdlc_mod.o
|
|
+ chmod +x $(LP64DIR)/$@
|
|
+
|
|
+ppp_comp: $(COMP_OBJS)
|
|
+ ld -r -o $(LP64DIR)/$@ $(COMP_OBJS)
|
|
+ chmod +x $(LP64DIR)/$@
|
|
+
|
|
+$(LP64DIR)/bsd-comp.o: ../modules/bsd-comp.c
|
|
+ $(CC) $(CFLAGS) -c $? -o $@
|
|
+$(LP64DIR)/deflate.o: ../modules/deflate.c
|
|
+ $(CC) $(CFLAGS) -c $? -o $@
|
|
+$(LP64DIR)/ppp.o: ../modules/ppp.c
|
|
+ $(CC) $(CFLAGS) -c $? -o $@
|
|
+$(LP64DIR)/ppp_mod.o: ppp_mod.c
|
|
+ $(CC) $(CFLAGS) -c $? -o $@
|
|
+$(LP64DIR)/ppp_ahdlc_mod.o: ppp_ahdlc_mod.c
|
|
+ $(CC) $(CFLAGS) -c $? -o $@
|
|
+$(LP64DIR)/ppp_ahdlc.o: ../modules/ppp_ahdlc.c
|
|
+ $(CC) $(CFLAGS) -c $? -o $@
|
|
+$(LP64DIR)/ppp_comp.o: ../modules/ppp_comp.c
|
|
+ $(CC) $(CFLAGS) -c $? -o $@
|
|
+$(LP64DIR)/ppp_comp_mod.o: ppp_comp_mod.c
|
|
+ $(CC) $(CFLAGS) -c $? -o $@
|
|
+$(LP64DIR)/vjcompress.o: ../modules/vjcompress.c
|
|
+ $(CC) $(CFLAGS) -c $? -o $@
|
|
+$(LP64DIR)/zlib.o: ../common/zlib.c
|
|
+ $(CC) $(CFLAGS) -c $? -o $@
|
|
+
|
|
+$(LP64DIR):
|
|
+ mkdir -m 755 -p $@
|
|
+
|
|
+install:
|
|
+ cp ppp ppp.conf /kernel/drv
|
|
+ cp ppp_comp ppp_ahdl /kernel/strmod
|
|
+ cp $(LP64DIR)/ppp /kernel/drv/$(LP64DIR)
|
|
+ cp $(LP64DIR)/ppp_comp $(LP64DIR)/ppp_ahdl /kernel/strmod/$(LP64DIR)
|
|
+ if grep clone:ppp /etc/minor_perm; then :; else \
|
|
+ echo clone:ppp 0644 root sys >>/etc/minor_perm; fi
|
|
+ /usr/sbin/rem_drv ppp 2>/dev/null || true
|
|
+ /usr/sbin/add_drv ppp
|
|
+
|
|
+SRCS = ../modules/ppp.c ppp_mod.c ../modules/ppp_ahdlc.c ppp_ahdlc_mod.c \
|
|
+ ../modules/ppp_comp.c ../modules/bsd-comp.c ../modules/deflate.c \
|
|
+ ../common/zlib.c ../modules/vjcompress.c ppp_comp_mod.c
|
|
+
|
|
+lint:
|
|
+ $(LINT64) $(SRCS)
|
|
+
|
|
+lint-32:
|
|
+ $(LINT32) $(SRCS)
|
|
+
|
|
+clean:
|
|
+ $(MAKE) -f $(STD_MAKE) clean
|
|
+ rm -f $(LP64DIR)/ppp $(LP64DIR)/ppp_comp $(LP64DIR)/ppp_ahdl $(LP64DIR)/*.o $(LP64DIR)/*~ $(LP64DIR)/core
|
|
diff -ruN ppp-2.4.2/svr4/Makefile.top ppp-cvs-20040427/svr4/Makefile.top
|
|
--- ppp-2.4.2/svr4/Makefile.top 1970-01-01 01:00:00.000000000 +0100
|
|
+++ ppp-cvs-20040427/svr4/Makefile.top 1999-04-01 14:37:44.000000000 +0200
|
|
@@ -0,0 +1,50 @@
|
|
+#
|
|
+# ppp top level makefile for SVR4 and Solaris 2
|
|
+#
|
|
+# $Id: Makefile.top,v 1.8 1999/04/01 11:44:55 paulus Exp $
|
|
+#
|
|
+
|
|
+include svr4/Makedefs
|
|
+
|
|
+all:
|
|
+ cd chat; $(MAKE) all
|
|
+ cd pppd; $(MAKE) all
|
|
+ cd pppstats; $(MAKE) all
|
|
+ cd pppdump; $(MAKE) all
|
|
+ cd svr4; $(MAKE) all
|
|
+
|
|
+install: $(BINDIR) $(MANDIR)/man8 install-progs install-etcppp
|
|
+
|
|
+install-progs:
|
|
+ cd chat; $(MAKE) install
|
|
+ cd pppd; $(MAKE) install
|
|
+ cd pppstats; $(MAKE) install
|
|
+ cd pppdump; $(MAKE) install
|
|
+ cd svr4; $(MAKE) install
|
|
+
|
|
+install-etcppp: $(ETCDIR) $(ETCDIR)/options $(ETCDIR)/pap-secrets \
|
|
+ $(ETCDIR)/chap-secrets
|
|
+
|
|
+$(ETCDIR)/options:
|
|
+ cp etc.ppp/options $@
|
|
+ chmod go-w $@
|
|
+$(ETCDIR)/pap-secrets:
|
|
+ $(INSTALL) -f $(ETCDIR) -m 600 etc.ppp/pap-secrets
|
|
+$(ETCDIR)/chap-secrets:
|
|
+ $(INSTALL) -f $(ETCDIR) -m 600 etc.ppp/chap-secrets
|
|
+
|
|
+$(BINDIR):
|
|
+ mkdir -m 755 -p $@
|
|
+$(MANDIR)/man8:
|
|
+ mkdir -m 755 -p $@
|
|
+$(ETCDIR):
|
|
+ mkdir -m 755 -p $@
|
|
+
|
|
+clean:
|
|
+ rm -f *~
|
|
+ cd chat; $(MAKE) clean
|
|
+ cd pppd; $(MAKE) clean
|
|
+ cd pppstats; $(MAKE) clean
|
|
+ cd pppdump; $(MAKE) clean
|
|
+ cd svr4; $(MAKE) clean
|
|
+
|
|
diff -ruN ppp-2.4.2/svr4/ppp.Master ppp-cvs-20040427/svr4/ppp.Master
|
|
--- ppp-2.4.2/svr4/ppp.Master 1970-01-01 01:00:00.000000000 +0100
|
|
+++ ppp-cvs-20040427/svr4/ppp.Master 1995-10-27 04:58:28.000000000 +0100
|
|
@@ -0,0 +1 @@
|
|
+ppp - Sciof ppp 0 0 1 128 -1
|
|
diff -ruN ppp-2.4.2/svr4/ppp.Node ppp-cvs-20040427/svr4/ppp.Node
|
|
--- ppp-2.4.2/svr4/ppp.Node 1970-01-01 01:00:00.000000000 +0100
|
|
+++ ppp-cvs-20040427/svr4/ppp.Node 1995-10-27 04:58:36.000000000 +0100
|
|
@@ -0,0 +1 @@
|
|
+clone ppp c ppp
|
|
diff -ruN ppp-2.4.2/svr4/ppp.System ppp-cvs-20040427/svr4/ppp.System
|
|
--- ppp-2.4.2/svr4/ppp.System 1970-01-01 01:00:00.000000000 +0100
|
|
+++ ppp-cvs-20040427/svr4/ppp.System 1995-10-27 04:58:37.000000000 +0100
|
|
@@ -0,0 +1 @@
|
|
+ppp Y 1 0 0 0 0 0 0 0
|
|
diff -ruN ppp-2.4.2/svr4/ppp.conf ppp-cvs-20040427/svr4/ppp.conf
|
|
--- ppp-2.4.2/svr4/ppp.conf 1970-01-01 01:00:00.000000000 +0100
|
|
+++ ppp-cvs-20040427/svr4/ppp.conf 1995-06-01 06:39:00.000000000 +0200
|
|
@@ -0,0 +1 @@
|
|
+name="ppp" parent="pseudo" instance=0;
|
|
diff -ruN ppp-2.4.2/svr4/ppp_ahdl.Master ppp-cvs-20040427/svr4/ppp_ahdl.Master
|
|
--- ppp-2.4.2/svr4/ppp_ahdl.Master 1970-01-01 01:00:00.000000000 +0100
|
|
+++ ppp-cvs-20040427/svr4/ppp_ahdl.Master 1995-10-27 04:58:32.000000000 +0100
|
|
@@ -0,0 +1 @@
|
|
+ppp_ahdl - iSf phdl 0 0 1 1 -1
|
|
diff -ruN ppp-2.4.2/svr4/ppp_ahdl.System ppp-cvs-20040427/svr4/ppp_ahdl.System
|
|
--- ppp-2.4.2/svr4/ppp_ahdl.System 1970-01-01 01:00:00.000000000 +0100
|
|
+++ ppp-cvs-20040427/svr4/ppp_ahdl.System 1995-10-27 04:58:38.000000000 +0100
|
|
@@ -0,0 +1 @@
|
|
+ppp_ahdl Y 1 0 0 0 0 0 0 0
|
|
diff -ruN ppp-2.4.2/svr4/ppp_ahdlc_mod.c ppp-cvs-20040427/svr4/ppp_ahdlc_mod.c
|
|
--- ppp-2.4.2/svr4/ppp_ahdlc_mod.c 1970-01-01 01:00:00.000000000 +0100
|
|
+++ ppp-cvs-20040427/svr4/ppp_ahdlc_mod.c 1995-12-11 06:21:02.000000000 +0100
|
|
@@ -0,0 +1,49 @@
|
|
+#include <sys/types.h>
|
|
+#include <sys/param.h>
|
|
+#include <sys/conf.h>
|
|
+#include <sys/modctl.h>
|
|
+#include <sys/sunddi.h>
|
|
+
|
|
+extern struct streamtab ppp_ahdlcinfo;
|
|
+
|
|
+static struct fmodsw fsw = {
|
|
+ "ppp_ahdl",
|
|
+ &ppp_ahdlcinfo,
|
|
+ D_NEW | D_MP | D_MTQPAIR
|
|
+};
|
|
+
|
|
+extern struct mod_ops mod_strmodops;
|
|
+
|
|
+static struct modlstrmod modlstrmod = {
|
|
+ &mod_strmodops,
|
|
+ "PPP async HDLC module",
|
|
+ &fsw
|
|
+};
|
|
+
|
|
+static struct modlinkage modlinkage = {
|
|
+ MODREV_1,
|
|
+ (void *) &modlstrmod,
|
|
+ NULL
|
|
+};
|
|
+
|
|
+/*
|
|
+ * Entry points for modloading.
|
|
+ */
|
|
+int
|
|
+_init(void)
|
|
+{
|
|
+ return mod_install(&modlinkage);
|
|
+}
|
|
+
|
|
+int
|
|
+_fini(void)
|
|
+{
|
|
+ return mod_remove(&modlinkage);
|
|
+}
|
|
+
|
|
+int
|
|
+_info(mip)
|
|
+ struct modinfo *mip;
|
|
+{
|
|
+ return mod_info(&modlinkage, mip);
|
|
+}
|
|
diff -ruN ppp-2.4.2/svr4/ppp_comp.Master ppp-cvs-20040427/svr4/ppp_comp.Master
|
|
--- ppp-2.4.2/svr4/ppp_comp.Master 1970-01-01 01:00:00.000000000 +0100
|
|
+++ ppp-cvs-20040427/svr4/ppp_comp.Master 1995-10-27 04:58:34.000000000 +0100
|
|
@@ -0,0 +1 @@
|
|
+ppp_comp - iSf pcmp 0 0 1 1 -1
|
|
diff -ruN ppp-2.4.2/svr4/ppp_comp.System ppp-cvs-20040427/svr4/ppp_comp.System
|
|
--- ppp-2.4.2/svr4/ppp_comp.System 1970-01-01 01:00:00.000000000 +0100
|
|
+++ ppp-cvs-20040427/svr4/ppp_comp.System 1995-10-27 04:58:40.000000000 +0100
|
|
@@ -0,0 +1 @@
|
|
+ppp_comp Y 1 0 0 0 0 0 0 0
|
|
diff -ruN ppp-2.4.2/svr4/ppp_comp_mod.c ppp-cvs-20040427/svr4/ppp_comp_mod.c
|
|
--- ppp-2.4.2/svr4/ppp_comp_mod.c 1970-01-01 01:00:00.000000000 +0100
|
|
+++ ppp-cvs-20040427/svr4/ppp_comp_mod.c 2002-12-06 10:50:10.000000000 +0100
|
|
@@ -0,0 +1,89 @@
|
|
+/*
|
|
+ * ppp_comp_mod.c - modload support for PPP compression STREAMS module.
|
|
+ *
|
|
+ * Copyright (c) 1994 Paul Mackerras. All rights reserved.
|
|
+ *
|
|
+ * Redistribution and use in source and binary forms, with or without
|
|
+ * modification, are permitted provided that the following conditions
|
|
+ * are met:
|
|
+ *
|
|
+ * 1. Redistributions of source code must retain the above copyright
|
|
+ * notice, this list of conditions and the following disclaimer.
|
|
+ *
|
|
+ * 2. Redistributions in binary form must reproduce the above copyright
|
|
+ * notice, this list of conditions and the following disclaimer in
|
|
+ * the documentation and/or other materials provided with the
|
|
+ * distribution.
|
|
+ *
|
|
+ * 3. The name(s) of the authors of this software must not be used to
|
|
+ * endorse or promote products derived from this software without
|
|
+ * prior written permission.
|
|
+ *
|
|
+ * 4. Redistributions of any form whatsoever must retain the following
|
|
+ * acknowledgment:
|
|
+ * "This product includes software developed by Paul Mackerras
|
|
+ * <paulus@samba.org>".
|
|
+ *
|
|
+ * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO
|
|
+ * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
+ * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
|
|
+ * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
|
|
+ * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
|
|
+ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
+ *
|
|
+ * $Id: ppp_comp_mod.c,v 1.3 2002/12/06 09:49:16 paulus Exp $
|
|
+ */
|
|
+
|
|
+/*
|
|
+ * This file is used under Solaris 2.
|
|
+ */
|
|
+#include <sys/types.h>
|
|
+#include <sys/param.h>
|
|
+#include <sys/conf.h>
|
|
+#include <sys/modctl.h>
|
|
+#include <sys/sunddi.h>
|
|
+
|
|
+extern struct streamtab ppp_compinfo;
|
|
+
|
|
+static struct fmodsw fsw = {
|
|
+ "ppp_comp",
|
|
+ &ppp_compinfo,
|
|
+ D_NEW | D_MP | D_MTQPAIR
|
|
+};
|
|
+
|
|
+extern struct mod_ops mod_strmodops;
|
|
+
|
|
+static struct modlstrmod modlstrmod = {
|
|
+ &mod_strmodops,
|
|
+ "PPP compression module",
|
|
+ &fsw
|
|
+};
|
|
+
|
|
+static struct modlinkage modlinkage = {
|
|
+ MODREV_1,
|
|
+ (void *) &modlstrmod,
|
|
+ NULL
|
|
+};
|
|
+
|
|
+/*
|
|
+ * Entry points for modloading.
|
|
+ */
|
|
+int
|
|
+_init(void)
|
|
+{
|
|
+ return mod_install(&modlinkage);
|
|
+}
|
|
+
|
|
+int
|
|
+_fini(void)
|
|
+{
|
|
+ return mod_remove(&modlinkage);
|
|
+}
|
|
+
|
|
+int
|
|
+_info(mip)
|
|
+ struct modinfo *mip;
|
|
+{
|
|
+ return mod_info(&modlinkage, mip);
|
|
+}
|
|
diff -ruN ppp-2.4.2/svr4/ppp_mod.c ppp-cvs-20040427/svr4/ppp_mod.c
|
|
--- ppp-2.4.2/svr4/ppp_mod.c 1970-01-01 01:00:00.000000000 +0100
|
|
+++ ppp-cvs-20040427/svr4/ppp_mod.c 2002-12-06 10:50:10.000000000 +0100
|
|
@@ -0,0 +1,182 @@
|
|
+/*
|
|
+ * ppp_mod.c - modload support for PPP pseudo-device driver.
|
|
+ *
|
|
+ * Copyright (c) 1994 Paul Mackerras. All rights reserved.
|
|
+ *
|
|
+ * Redistribution and use in source and binary forms, with or without
|
|
+ * modification, are permitted provided that the following conditions
|
|
+ * are met:
|
|
+ *
|
|
+ * 1. Redistributions of source code must retain the above copyright
|
|
+ * notice, this list of conditions and the following disclaimer.
|
|
+ *
|
|
+ * 2. Redistributions in binary form must reproduce the above copyright
|
|
+ * notice, this list of conditions and the following disclaimer in
|
|
+ * the documentation and/or other materials provided with the
|
|
+ * distribution.
|
|
+ *
|
|
+ * 3. The name(s) of the authors of this software must not be used to
|
|
+ * endorse or promote products derived from this software without
|
|
+ * prior written permission.
|
|
+ *
|
|
+ * 4. Redistributions of any form whatsoever must retain the following
|
|
+ * acknowledgment:
|
|
+ * "This product includes software developed by Paul Mackerras
|
|
+ * <paulus@samba.org>".
|
|
+ *
|
|
+ * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO
|
|
+ * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
+ * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
|
|
+ * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
|
|
+ * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
|
|
+ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
+ *
|
|
+ * $Id: ppp_mod.c,v 1.4 2002/12/06 09:49:16 paulus Exp $
|
|
+ */
|
|
+
|
|
+/*
|
|
+ * This file is used under Solaris 2.
|
|
+ */
|
|
+
|
|
+#include <sys/types.h>
|
|
+#include <sys/param.h>
|
|
+#include <sys/stat.h>
|
|
+#include <sys/conf.h>
|
|
+#include <sys/modctl.h>
|
|
+#include <sys/sunddi.h>
|
|
+#include <sys/ksynch.h>
|
|
+
|
|
+#ifdef __STDC__
|
|
+#define __P(x) x
|
|
+#else
|
|
+#define __P(x) ()
|
|
+#endif
|
|
+
|
|
+static int ppp_identify __P((dev_info_t *));
|
|
+static int ppp_attach __P((dev_info_t *, ddi_attach_cmd_t));
|
|
+static int ppp_detach __P((dev_info_t *, ddi_detach_cmd_t));
|
|
+static int ppp_devinfo __P((dev_info_t *, ddi_info_cmd_t, void *, void **));
|
|
+
|
|
+extern struct streamtab pppinfo;
|
|
+extern krwlock_t ppp_lower_lock;
|
|
+
|
|
+static dev_info_t *ppp_dip;
|
|
+
|
|
+static struct cb_ops cb_ppp_ops = {
|
|
+ nulldev, nulldev, nodev, nodev, /* cb_open, ... */
|
|
+ nodev, nodev, nodev, nodev, /* cb_dump, ... */
|
|
+ nodev, nodev, nodev, nochpoll, /* cb_devmap, ... */
|
|
+ ddi_prop_op, /* cb_prop_op */
|
|
+ &pppinfo, /* cb_stream */
|
|
+ D_NEW|D_MP|D_MTQPAIR|D_MTOUTPERIM|D_MTOCEXCL /* cb_flag */
|
|
+};
|
|
+
|
|
+static struct dev_ops ppp_ops = {
|
|
+ DEVO_REV, /* devo_rev */
|
|
+ 0, /* devo_refcnt */
|
|
+ ppp_devinfo, /* devo_getinfo */
|
|
+ ppp_identify, /* devo_identify */
|
|
+ nulldev, /* devo_probe */
|
|
+ ppp_attach, /* devo_attach */
|
|
+ ppp_detach, /* devo_detach */
|
|
+ nodev, /* devo_reset */
|
|
+ &cb_ppp_ops, /* devo_cb_ops */
|
|
+ NULL /* devo_bus_ops */
|
|
+};
|
|
+
|
|
+/*
|
|
+ * Module linkage information
|
|
+ */
|
|
+
|
|
+static struct modldrv modldrv = {
|
|
+ &mod_driverops, /* says this is a pseudo driver */
|
|
+ "PPP-2.3 multiplexing driver",
|
|
+ &ppp_ops /* driver ops */
|
|
+};
|
|
+
|
|
+static struct modlinkage modlinkage = {
|
|
+ MODREV_1,
|
|
+ (void *) &modldrv,
|
|
+ NULL
|
|
+};
|
|
+
|
|
+int
|
|
+_init(void)
|
|
+{
|
|
+ return mod_install(&modlinkage);
|
|
+}
|
|
+
|
|
+int
|
|
+_fini(void)
|
|
+{
|
|
+ return mod_remove(&modlinkage);
|
|
+}
|
|
+
|
|
+int
|
|
+_info(mip)
|
|
+ struct modinfo *mip;
|
|
+{
|
|
+ return mod_info(&modlinkage, mip);
|
|
+}
|
|
+
|
|
+static int
|
|
+ppp_identify(dip)
|
|
+ dev_info_t *dip;
|
|
+{
|
|
+ return strcmp(ddi_get_name(dip), "ppp") == 0? DDI_IDENTIFIED:
|
|
+ DDI_NOT_IDENTIFIED;
|
|
+}
|
|
+
|
|
+static int
|
|
+ppp_attach(dip, cmd)
|
|
+ dev_info_t *dip;
|
|
+ ddi_attach_cmd_t cmd;
|
|
+{
|
|
+
|
|
+ if (cmd != DDI_ATTACH)
|
|
+ return DDI_FAILURE;
|
|
+ if (ddi_create_minor_node(dip, "ppp", S_IFCHR, 0, DDI_PSEUDO, CLONE_DEV)
|
|
+ == DDI_FAILURE) {
|
|
+ ddi_remove_minor_node(dip, NULL);
|
|
+ return DDI_FAILURE;
|
|
+ }
|
|
+ rw_init(&ppp_lower_lock, NULL, RW_DRIVER, NULL);
|
|
+ return DDI_SUCCESS;
|
|
+}
|
|
+
|
|
+static int
|
|
+ppp_detach(dip, cmd)
|
|
+ dev_info_t *dip;
|
|
+ ddi_detach_cmd_t cmd;
|
|
+{
|
|
+ rw_destroy(&ppp_lower_lock);
|
|
+ ddi_remove_minor_node(dip, NULL);
|
|
+ return DDI_SUCCESS;
|
|
+}
|
|
+
|
|
+static int
|
|
+ppp_devinfo(dip, cmd, arg, result)
|
|
+ dev_info_t *dip;
|
|
+ ddi_info_cmd_t cmd;
|
|
+ void *arg;
|
|
+ void **result;
|
|
+{
|
|
+ int error;
|
|
+
|
|
+ error = DDI_SUCCESS;
|
|
+ switch (cmd) {
|
|
+ case DDI_INFO_DEVT2DEVINFO:
|
|
+ if (ppp_dip == NULL)
|
|
+ error = DDI_FAILURE;
|
|
+ else
|
|
+ *result = (void *) ppp_dip;
|
|
+ break;
|
|
+ case DDI_INFO_DEVT2INSTANCE:
|
|
+ *result = NULL;
|
|
+ break;
|
|
+ default:
|
|
+ error = DDI_FAILURE;
|
|
+ }
|
|
+ return error;
|
|
+}
|