This patch is by David Newall <davidn@rebel.net.au>.  It modifies uugetty
(getty_ps.2.0.7h) to permit it detect incoming PPP sessions and then to
invoke the ppp daemon.  The change was substantially taken from mgetty.

--- ./funcs.c.orig	Mon Aug  3 18:01:12 1998
+++ ./funcs.c	Sun Aug  2 19:32:45 1998
@@ -49,4 +49,10 @@
 
+#ifdef FIDO
 extern char *fido;
 extern char *emsi;
+#endif /* FIDO */
+
+#ifdef AUTO_PPP
+extern char *ppp;
+#endif /* AUTO_PPP */
 
@@ -591,3 +597,3 @@
 **	Returns int value indicating success.
-**	If a fido-protocol is detected, return the name of the protocol.
+**	If a ppp or fido-protocol is detected, return the name of the protocol.
 */
@@ -608,2 +614,7 @@
 
+/* taken from mgetty */
+#ifdef AUTO_PPP
+	static int ppp_level = 0;
+#endif
+
 #ifdef	MY_ERASE
@@ -658,2 +669,35 @@
 #endif
+
+/* taken from mgetty */
+#ifdef AUTO_PPP
+        /* Accept the following sequences as start of PPP packet:
+           PPP_FRAME, PPP_STATION, PPP_ESCAPE, PPP_CONTROL_ESCAPED (normal)
+           PPP_FRAME, PPP_STATION, PPP_CONTROL           (deviant from RFC)
+        
+           Odds are pretty low of hitting this by accident.
+           See RFC1662 for more information.
+
+	   Contributed by Erik 'PPP' Olson, <eriko@wrq.com>.
+         */
+
+	if (ppp)
+        if (ch == (char) PPP_FRAME) {
+            ppp_level = 1;
+        } else if (ch == (char) PPP_STATION && ppp_level == 1) {
+            ppp_level = 2;
+        } else if (ch == (char) PPP_ESCAPE && ppp_level == 2) {
+            ppp_level = 3;
+        } else if ((ch == (char) PPP_CONTROL && ppp_level == 2)
+                   || (ch == (char) PPP_CONTROL_ESCAPED && ppp_level == 3)) {
+	    ppp_level = 4;
+	} else if (ch == (char) PPP_LCP_HI && ppp_level == 4) {
+	    ppp_level = 5;
+	} else if (ch == (char) PPP_LCP_LOW && ppp_level == 5)
+	{
+            strcpy (name, "/AutoPPP/");
+	    return(PPPCALL);
+        } else {
+            ppp_level = 0;
+        }
+#endif
 		if (!(lflag & ECHO)) {
@@ -734,3 +778,2 @@
 	}
-
 	debug(D_RUN, "returned (SUCCESS), name=(%s)", name);
--- ./funcs.h.orig	Mon Aug  3 18:01:12 1998
+++ ./funcs.h	Sun Aug  2 16:25:55 1998
@@ -30,2 +30,3 @@
 #define	FIDOCALL 4
+#define PPPCALL  5
 
@@ -44,2 +45,11 @@
 #define	YOOHOO	((char)0xF1)
+
+/* from mgetty: defines for auto detection of incoming PPP calls (->PAP/CHAP) */
+#define PPP_FRAME           0x7e  /* PPP Framing character */
+#define PPP_STATION         0xff  /* "All Station" character */
+#define PPP_ESCAPE          0x7d  /* Escape Character */
+#define PPP_CONTROL         0x03  /* PPP Control Field */
+#define PPP_CONTROL_ESCAPED 0x23  /* PPP Control Field, escaped */
+#define PPP_LCP_HI          0xc0  /* LCP protocol - high byte */
+#define PPP_LCP_LOW         0x21  /* LCP protocol - low byte */
 
--- ./main.c.orig	Mon Aug  3 18:01:13 1998
+++ ./main.c	Sun Aug  2 18:11:33 1998
@@ -115,2 +115,6 @@
 
+#ifdef AUTO_PPP
+	ppp = 		(char *) NULL;		/* ppp daemon */
+#endif /* AUTO_PPP */
+
 #ifdef SCHED
@@ -367,2 +371,6 @@
 
+#ifdef AUTO_PPP
+	ppp = defvalue(def, "PPP");
+#endif /* AUTO_PPP */
+
 #ifdef SCHED
@@ -944,4 +952,4 @@
 		switch(getlogname(&termio, buf, MAXLINE)) {
-#ifdef FIDO
-			case FIDOCALL:
+#ifdef AUTO_PPP
+			case PPPCALL:
 				(void) signal(SIGALRM, SIG_DFL);
@@ -949,2 +957,20 @@
 
+				logerr("PPP Call Detected");
+#ifdef SETTERM
+				setenv("TERM", term, TRUE);
+#endif /* SETTERM */
+				debug(D_RUN, "execing pppd");
+				(void) execl(ppp,
+					"pppd", "login", (char *)NULL);
+				debug(D_RUN, 
+				  "exec failed: %s; trying with /bin/sh",
+				  strerror(errno));
+				(void) execl("/bin/sh", "sh", "-c", ppp,
+				  "login", (char *) NULL);
+				logerr("exec of %s failed: %s", ppp,
+				       strerror(errno));
+				exit(FAIL);
+#endif /* AUTO_PPP */
+#ifdef FIDO
+			case FIDOCALL:
 				login = fido;
@@ -960,7 +986,2 @@
 				(void) alarm(0);
-
-				if(TimeOut > 0) {
-					(void) alarm((unsigned) 0);
-					(void) signal(SIGALRM, SIG_DFL);
-				}
 
--- ./main.h.orig	Mon Aug  3 18:01:13 1998
+++ ./main.h	Sun Aug  2 16:36:40 1998
@@ -115,2 +115,6 @@
 
+#ifdef AUTO_PPP
+EXTERN char		*ppp;		/* ppp daemon */
+#endif /* AUTO_PPP */
+
 #ifdef SCHED
--- ./tune.h.orig	Mon Aug  3 18:01:13 1998
+++ ./tune.h	Sun Aug  2 16:32:35 1998
@@ -35,2 +35,3 @@
 #define	FIDO				/* allow fido logins */
+#define AUTO_PPP			/* allow auto-detection of ppp chap */
 #define SYSLOG				/* log everything via syslog */
--- ./man/getty.1.orig	Mon Aug  3 18:01:13 1998
+++ ./man/getty.1	Sun Aug  2 17:06:45 1998
@@ -498,2 +498,8 @@
 If set to \fIyes\fR, scan the input for FidoNet EMSI sequences.
+.TP
+PPP=\fIstring\fR
+This line specifies the path to the PPP daemon (usually pppd).
+Undefined by default.
+If a PPP frame sequence is detected, the ppp daemon is invoked to complete
+the login.
 .P
