aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJordan K. Hubbard <jkh@FreeBSD.org>1999-05-19 10:49:46 +0000
committerJordan K. Hubbard <jkh@FreeBSD.org>1999-05-19 10:49:46 +0000
commitd06edb61fadd3ed5275a256b9ecff5c264946134 (patch)
treef873890721f20eda13ae7413cfd879829a8c61aa
parent71e13b47ac064410867e3db6543ce9adbd815b8d (diff)
downloadsrc-d06edb61fadd3ed5275a256b9ecff5c264946134.tar.gz
src-d06edb61fadd3ed5275a256b9ecff5c264946134.zip
Add CHAP/PAP question to the ppp setup dialog, simplifying things considerably
for some. Submitted by: Jack O'Neill <jack@germanium.xtalwind.net>
Notes
Notes: svn path=/head/; revision=47323
-rw-r--r--release/sysinstall/help/network_device.hlp16
-rw-r--r--release/sysinstall/network.c44
-rw-r--r--usr.sbin/sysinstall/help/network_device.hlp16
-rw-r--r--usr.sbin/sysinstall/network.c44
4 files changed, 86 insertions, 34 deletions
diff --git a/release/sysinstall/help/network_device.hlp b/release/sysinstall/help/network_device.hlp
index 5d7a8486de94..a65467bf6394 100644
--- a/release/sysinstall/help/network_device.hlp
+++ b/release/sysinstall/help/network_device.hlp
@@ -21,13 +21,15 @@ speed for a hardwired cable).
If you're using a modem then PPP is almost certainly your only choice.
Make sure that you have your service provider's information handy as
you'll need to know it fairly early in the installation process. You
-will need to know, at the minimum, your service provider's IP address
-and possibly your own (though you can also leave it blank and allow
-PPP to negotiate it with your ISP if your ISP supports such dynamic
-negotiation). You will also need to know how to use the various "AT
-commands" to dial the ISP with your particular brand of modem as the
-PPP dialer provides only a very simple terminal emulator and has no
-"modem capabilities database".
+will need to know your service provider's IP address, the IP address
+of your provider's DNS server, and possibly your own IP address unless
+your ISP supports dynamic negotiation, most do. If you do not choose
+a PAP or CHAP login you will also need to know how to use the various
+"AT commands" to dial the ISP with your particular brand of modem as
+the PPP dialer provides only a very simple terminal emulator and has no
+"modem capabilities database". If you choose a PAP or CHAP login you
+can simply enter `dial' (without the quotes) at the ppp prompt if your
+modem uses the Hayes compatible AT command set.
If a hard-wired connection to another FreeBSD (2.0R or later) machine
is available, you might also consider installing over a "laplink"
diff --git a/release/sysinstall/network.c b/release/sysinstall/network.c
index f789bcd5a912..9be31176ddfd 100644
--- a/release/sysinstall/network.c
+++ b/release/sysinstall/network.c
@@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated to essentially a complete rewrite.
*
- * $Id: network.c,v 1.34 1999/02/05 22:15:51 jkh Exp $
+ * $Id: network.c,v 1.35 1999/03/11 18:22:23 brian Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -186,11 +186,12 @@ mediaShutdownNetwork(Device *dev)
static pid_t
startPPP(Device *devp)
{
- int fd2;
+ int fd2, pulse;
FILE *fp;
char *val;
pid_t pid = 0;
- char myaddr[16], provider[16], speed[16];
+ char myaddr[16], provider[16], speed[16], authname[32], authkey[16];
+ char phone[16];
/* These are needed to make ppp work */
Mkdir("/var/log");
@@ -249,6 +250,21 @@ startPPP(Device *devp)
msgConfirm("Couldn't open /etc/ppp/ppp.conf file! This isn't going to work");
return 0;
}
+ authname[0] = '\0';
+ pulse = 0;
+ dialog_clear_norefresh();
+ if (!dialog_yesno("", "Does your ISP support PAP or CHAP ppp logins?", -1, -1)) {
+ val = msgGetInput(NULL, "Enter the name you use to login to your provider.");
+ SAFE_STRCPY(authname, val);
+ dialog_clear_norefresh();
+ val = msgGetInput(NULL, "Enter the password you use to login to your provider.");
+ SAFE_STRCPY(authkey, val);
+ dialog_clear_norefresh();
+ val = msgGetInput(NULL, "Enter the your provider's login phone number.");
+ SAFE_STRCPY(phone, val);
+ dialog_clear_norefresh();
+ pulse = dialog_yesno("", "Does your telephone line support tone dialing?", -1, -1);
+ }
fprintf(fp, "default:\n");
fprintf(fp, " set speed %s\n", speed);
fprintf(fp, " set device %s\n", devp->devname);
@@ -256,6 +272,13 @@ startPPP(Device *devp)
fprintf(fp, " set timeout 0\n");
fprintf(fp, " enable dns\n");
fprintf(fp, " set log local phase\n");
+ if(authname[0] != '\0'){
+ fprintf(fp, " set dial \"ABORT BUSY ABORT NO\\\\sCARRIER TIMEOUT 5 \\\"\\\" AT OK-AT-OK ATE1Q0 OK \\\\dATD%c\\\\T TIMEOUT 40 CONNECT\"\n", pulse ? 'P' : 'T');
+ fprintf(fp, " set login\n");
+ fprintf(fp, " set authname %s\n", authname);
+ fprintf(fp, " set authkey %s\n", authkey);
+ fprintf(fp, " set phone %s\n", phone);
+ }
if (fchmod(fileno(fp), 0640) != 0)
msgConfirm("Warning: Failed to fix permissions on /etc/ppp/ppp.conf !");
fclose(fp);
@@ -299,13 +322,14 @@ startPPP(Device *devp)
else {
dialog_clear_norefresh();
msgConfirm("NOTICE: The PPP command is now started on VTY3 (type ALT-F3 to\n"
- "interact with it, ALT-F1 to switch back here). The only command\n"
- "you'll probably want or need to use is the \"term\" command\n"
- "which starts a terminal emulator you can use to talk to your\n"
- "modem and dial the service provider. Once you're connected,\n"
- "come back to this screen and press return.\n\n"
- "DO NOT PRESS [ENTER] HERE UNTIL THE CONNECTION IS FULLY\n"
- "ESTABLISHED!");
+ "interact with it, ALT-F1 to switch back here). If you are using\n"
+ "a PAP or CHAP login simply enter \"dial\" otherwise you'll need\n"
+ "need to use is the \"term\" command which starts a terminal\n"
+ "emulator you can use to talk to your modem and dial the service\n"
+ "provider. Once you're connected, come back to this screen and\n"
+ "press return.\n\n"
+ "DO NOT PRESS [ENTER] HERE UNTIL THE CONNECTION IS FULLY\n"
+ "ESTABLISHED!");
}
return pid;
}
diff --git a/usr.sbin/sysinstall/help/network_device.hlp b/usr.sbin/sysinstall/help/network_device.hlp
index 5d7a8486de94..a65467bf6394 100644
--- a/usr.sbin/sysinstall/help/network_device.hlp
+++ b/usr.sbin/sysinstall/help/network_device.hlp
@@ -21,13 +21,15 @@ speed for a hardwired cable).
If you're using a modem then PPP is almost certainly your only choice.
Make sure that you have your service provider's information handy as
you'll need to know it fairly early in the installation process. You
-will need to know, at the minimum, your service provider's IP address
-and possibly your own (though you can also leave it blank and allow
-PPP to negotiate it with your ISP if your ISP supports such dynamic
-negotiation). You will also need to know how to use the various "AT
-commands" to dial the ISP with your particular brand of modem as the
-PPP dialer provides only a very simple terminal emulator and has no
-"modem capabilities database".
+will need to know your service provider's IP address, the IP address
+of your provider's DNS server, and possibly your own IP address unless
+your ISP supports dynamic negotiation, most do. If you do not choose
+a PAP or CHAP login you will also need to know how to use the various
+"AT commands" to dial the ISP with your particular brand of modem as
+the PPP dialer provides only a very simple terminal emulator and has no
+"modem capabilities database". If you choose a PAP or CHAP login you
+can simply enter `dial' (without the quotes) at the ppp prompt if your
+modem uses the Hayes compatible AT command set.
If a hard-wired connection to another FreeBSD (2.0R or later) machine
is available, you might also consider installing over a "laplink"
diff --git a/usr.sbin/sysinstall/network.c b/usr.sbin/sysinstall/network.c
index f789bcd5a912..9be31176ddfd 100644
--- a/usr.sbin/sysinstall/network.c
+++ b/usr.sbin/sysinstall/network.c
@@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated to essentially a complete rewrite.
*
- * $Id: network.c,v 1.34 1999/02/05 22:15:51 jkh Exp $
+ * $Id: network.c,v 1.35 1999/03/11 18:22:23 brian Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -186,11 +186,12 @@ mediaShutdownNetwork(Device *dev)
static pid_t
startPPP(Device *devp)
{
- int fd2;
+ int fd2, pulse;
FILE *fp;
char *val;
pid_t pid = 0;
- char myaddr[16], provider[16], speed[16];
+ char myaddr[16], provider[16], speed[16], authname[32], authkey[16];
+ char phone[16];
/* These are needed to make ppp work */
Mkdir("/var/log");
@@ -249,6 +250,21 @@ startPPP(Device *devp)
msgConfirm("Couldn't open /etc/ppp/ppp.conf file! This isn't going to work");
return 0;
}
+ authname[0] = '\0';
+ pulse = 0;
+ dialog_clear_norefresh();
+ if (!dialog_yesno("", "Does your ISP support PAP or CHAP ppp logins?", -1, -1)) {
+ val = msgGetInput(NULL, "Enter the name you use to login to your provider.");
+ SAFE_STRCPY(authname, val);
+ dialog_clear_norefresh();
+ val = msgGetInput(NULL, "Enter the password you use to login to your provider.");
+ SAFE_STRCPY(authkey, val);
+ dialog_clear_norefresh();
+ val = msgGetInput(NULL, "Enter the your provider's login phone number.");
+ SAFE_STRCPY(phone, val);
+ dialog_clear_norefresh();
+ pulse = dialog_yesno("", "Does your telephone line support tone dialing?", -1, -1);
+ }
fprintf(fp, "default:\n");
fprintf(fp, " set speed %s\n", speed);
fprintf(fp, " set device %s\n", devp->devname);
@@ -256,6 +272,13 @@ startPPP(Device *devp)
fprintf(fp, " set timeout 0\n");
fprintf(fp, " enable dns\n");
fprintf(fp, " set log local phase\n");
+ if(authname[0] != '\0'){
+ fprintf(fp, " set dial \"ABORT BUSY ABORT NO\\\\sCARRIER TIMEOUT 5 \\\"\\\" AT OK-AT-OK ATE1Q0 OK \\\\dATD%c\\\\T TIMEOUT 40 CONNECT\"\n", pulse ? 'P' : 'T');
+ fprintf(fp, " set login\n");
+ fprintf(fp, " set authname %s\n", authname);
+ fprintf(fp, " set authkey %s\n", authkey);
+ fprintf(fp, " set phone %s\n", phone);
+ }
if (fchmod(fileno(fp), 0640) != 0)
msgConfirm("Warning: Failed to fix permissions on /etc/ppp/ppp.conf !");
fclose(fp);
@@ -299,13 +322,14 @@ startPPP(Device *devp)
else {
dialog_clear_norefresh();
msgConfirm("NOTICE: The PPP command is now started on VTY3 (type ALT-F3 to\n"
- "interact with it, ALT-F1 to switch back here). The only command\n"
- "you'll probably want or need to use is the \"term\" command\n"
- "which starts a terminal emulator you can use to talk to your\n"
- "modem and dial the service provider. Once you're connected,\n"
- "come back to this screen and press return.\n\n"
- "DO NOT PRESS [ENTER] HERE UNTIL THE CONNECTION IS FULLY\n"
- "ESTABLISHED!");
+ "interact with it, ALT-F1 to switch back here). If you are using\n"
+ "a PAP or CHAP login simply enter \"dial\" otherwise you'll need\n"
+ "need to use is the \"term\" command which starts a terminal\n"
+ "emulator you can use to talk to your modem and dial the service\n"
+ "provider. Once you're connected, come back to this screen and\n"
+ "press return.\n\n"
+ "DO NOT PRESS [ENTER] HERE UNTIL THE CONNECTION IS FULLY\n"
+ "ESTABLISHED!");
}
return pid;
}