2 * options.c - handles option processing for PPP.
4 * Copyright (c) 1989 Carnegie Mellon University.
7 * Redistribution and use in source and binary forms are permitted
8 * provided that the above copyright notice and this paragraph are
9 * duplicated in all such forms and that any documentation,
10 * advertising materials, and other materials related to such
11 * distribution and use acknowledge that the software was developed
12 * by Carnegie Mellon University. The name of the
13 * University may not be used to endorse or promote products derived
14 * from this software without specific prior written permission.
15 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
16 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
17 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21 static char rcsid[] = "$Id: options.c,v 1.8 1994/05/24 11:24:32 paulus Exp $";
33 #include <sys/types.h>
35 #include <netinet/in.h>
39 #include "pathnames.h"
40 #include "patchlevel.h"
51 char *strdup __ARGS((char *));
55 #define GIDSET_TYPE int
61 static int setdebug __ARGS((void));
62 static int setkdebug __ARGS((char **));
63 static int setpassive __ARGS((void));
64 static int setsilent __ARGS((void));
65 static int noopt __ARGS((void));
66 static int setnovj __ARGS((void));
67 static int reqpap __ARGS((void));
68 static int nopap __ARGS((void));
69 static int setupapfile __ARGS((char **));
70 static int nochap __ARGS((void));
71 static int reqchap __ARGS((void));
72 static int setspeed __ARGS((char *));
73 static int noaccomp __ARGS((void));
74 static int noasyncmap __ARGS((void));
75 static int noipaddr __ARGS((void));
76 static int nomagicnumber __ARGS((void));
77 static int setasyncmap __ARGS((char **));
78 static int setescape __ARGS((char **));
79 static int setmru __ARGS((char **));
80 static int setmtu __ARGS((char **));
81 static int nomru __ARGS((void));
82 static int nopcomp __ARGS((void));
83 static int setconnector __ARGS((char **));
84 static int setdisconnector __ARGS((char **));
85 static int setdomain __ARGS((char **));
86 static int setnetmask __ARGS((char **));
87 static int setcrtscts __ARGS((void));
88 static int setxonxoff __ARGS((void));
89 static int setnodetach __ARGS((void));
90 static int setmodem __ARGS((void));
91 static int setlocal __ARGS((void));
92 static int setlock __ARGS((void));
93 static int setname __ARGS((char **));
94 static int setuser __ARGS((char **));
95 static int setremote __ARGS((char **));
96 static int setauth __ARGS((void));
97 static int readfile __ARGS((char **));
98 static int setdefaultroute __ARGS((void));
99 static int setproxyarp __ARGS((void));
100 static int setpersist __ARGS((void));
101 static int setdologin __ARGS((void));
102 static int setusehostname __ARGS((void));
103 static int setnoipdflt __ARGS((void));
104 static int setlcptimeout __ARGS((char **));
105 static int setlcpterm __ARGS((char **));
106 static int setlcpconf __ARGS((char **));
107 static int setlcpfails __ARGS((char **));
108 static int setipcptimeout __ARGS((char **));
109 static int setipcpterm __ARGS((char **));
110 static int setipcpconf __ARGS((char **));
111 static int setipcpfails __ARGS((char **));
112 static int setpaptimeout __ARGS((char **));
113 static int setpapreqs __ARGS((char **));
114 static int setchaptimeout __ARGS((char **));
115 static int setchapchal __ARGS((char **));
116 static int setchapintv __ARGS((char **));
117 static int setipcpaccl __ARGS((void));
118 static int setipcpaccr __ARGS((void));
119 static int setlcpechointerval __ARGS((char **));
120 static int setlcpechofails __ARGS((char **));
121 static int setslots __ARGS((char **));
123 static int number_option __ARGS((char *, long *, int));
124 static int readable __ARGS((int fd));
129 extern char *progname;
131 extern int kdebugflag;
136 extern char *connector;
137 extern char *disconnector;
139 extern char devname[];
140 extern int default_device;
141 extern u_long netmask;
144 extern char passwd[];
145 extern int auth_required;
150 extern u_long lcp_echo_interval;
151 extern u_long lcp_echo_fails;
152 extern char our_name[];
153 extern char remote_name[];
155 int disable_defaultip;
165 "-all", 0, noopt, /* Don't request/allow any options */
166 "-ac", 0, noaccomp, /* Disable Address/Control compress */
167 "-am", 0, noasyncmap, /* Disable asyncmap negotiation */
168 "-as", 1, setasyncmap, /* set the desired async map */
169 "-d", 0, setdebug, /* Increase debugging level */
170 "-detach", 0, setnodetach, /* don't fork */
171 "-ip", 0, noipaddr, /* Disable IP address negotiation */
172 "-mn", 0, nomagicnumber, /* Disable magic number negotiation */
173 "-mru", 0, nomru, /* Disable mru negotiation */
174 "-p", 0, setpassive, /* Set passive mode */
175 "-pc", 0, nopcomp, /* Disable protocol field compress */
176 "+ua", 1, setupapfile, /* Get PAP user and password from file */
177 "+pap", 0, reqpap, /* Require PAP auth from peer */
178 "-pap", 0, nopap, /* Don't allow UPAP authentication with peer */
179 "+chap", 0, reqchap, /* Require CHAP authentication from peer */
180 "-chap", 0, nochap, /* Don't allow CHAP authentication with peer */
181 "-vj", 0, setnovj, /* disable VJ compression */
182 "asyncmap", 1, setasyncmap, /* set the desired async map */
183 "escape", 1, setescape, /* set chars to escape on transmission */
184 "connect", 1, setconnector, /* A program to set up a connection */
185 "disconnect", 1, setdisconnector, /* program to disconnect serial dev. */
186 "crtscts", 0, setcrtscts, /* set h/w flow control */
187 "xonxoff", 0, setxonxoff, /* set s/w flow control */
188 "-crtscts", 0, setxonxoff, /* another name for xonxoff */
189 "debug", 0, setdebug, /* Increase debugging level */
190 "kdebug", 1, setkdebug, /* Enable kernel-level debugging */
191 "domain", 1, setdomain, /* Add given domain name to hostname*/
192 "mru", 1, setmru, /* Set MRU value for negotiation */
193 "mtu", 1, setmtu, /* Set our MTU */
194 "netmask", 1, setnetmask, /* set netmask */
195 "passive", 0, setpassive, /* Set passive mode */
196 "silent", 0, setsilent, /* Set silent mode */
197 "modem", 0, setmodem, /* Use modem control lines */
198 "local", 0, setlocal, /* Don't use modem control lines */
199 "lock", 0, setlock, /* Lock serial device (with lock file) */
200 "name", 1, setname, /* Set local name for authentication */
201 "user", 1, setuser, /* Set username for PAP auth with peer */
202 "usehostname", 0, setusehostname, /* Must use hostname for auth. */
203 "remotename", 1, setremote, /* Set remote name for authentication */
204 "auth", 0, setauth, /* Require authentication from peer */
205 "file", 1, readfile, /* Take options from a file */
206 "defaultroute", 0, setdefaultroute, /* Add default route */
207 "proxyarp", 0, setproxyarp, /* Add proxy ARP entry */
208 "persist", 0, setpersist, /* Keep on reopening connection after close */
209 "login", 0, setdologin, /* Use system password database for UPAP */
210 "noipdefault", 0, setnoipdflt, /* Don't use name for default IP adrs */
211 "lcp-echo-failure", 1, setlcpechofails, /* consecutive echo failures */
212 "lcp-echo-interval", 1, setlcpechointerval, /* time for lcp echo events */
213 "lcp-restart", 1, setlcptimeout, /* Set timeout for LCP */
214 "lcp-max-terminate", 1, setlcpterm, /* Set max #xmits for term-reqs */
215 "lcp-max-configure", 1, setlcpconf, /* Set max #xmits for conf-reqs */
216 "lcp-max-failure", 1, setlcpfails, /* Set max #conf-naks for LCP */
217 "ipcp-restart", 1, setipcptimeout, /* Set timeout for IPCP */
218 "ipcp-max-terminate", 1, setipcpterm, /* Set max #xmits for term-reqs */
219 "ipcp-max-configure", 1, setipcpconf, /* Set max #xmits for conf-reqs */
220 "ipcp-max-failure", 1, setipcpfails, /* Set max #conf-naks for IPCP */
221 "ipcp-max-slots", 1, setslots, /* Set maximum vj header slots */
222 "pap-restart", 1, setpaptimeout, /* Set timeout for UPAP */
223 "pap-max-authreq", 1, setpapreqs, /* Set max #xmits for auth-reqs */
224 "chap-restart", 1, setchaptimeout, /* Set timeout for CHAP */
225 "chap-max-challenge", 1, setchapchal, /* Set max #xmits for challenge */
226 "chap-interval", 1, setchapintv, /* Set interval for rechallenge */
227 "ipcp-accept-local", 0, setipcpaccl, /* Accept peer's address for us */
228 "ipcp-accept-remote", 0, setipcpaccr, /* Accept peer's address for it */
233 #ifndef IMPLEMENTATION
234 #define IMPLEMENTATION ""
237 static char *usage_string = "\
238 pppd version %s patch level %d%s\n\
239 Usage: %s [ arguments ], where arguments are:\n\
240 <device> Communicate over the named device\n\
241 <speed> Set the baud rate to <speed>\n\
242 <loc>:<rem> Set the local and/or remote interface IP\n\
243 addresses. Either one may be omitted.\n\
244 asyncmap <n> Set the desired async map to hex <n>\n\
245 auth Require authentication from peer\n\
246 connect <p> Invoke shell command <p> to set up the serial line\n\
247 crtscts Use hardware RTS/CTS flow control\n\
248 defaultroute Add default route through interface\n\
249 file <f> Take options from file <f>\n\
250 modem Use modem control lines\n\
251 mru <n> Set MRU value to <n> for negotiation\n\
252 netmask <n> Set interface netmask to <n>\n\
253 See pppd(8) for more options.\n\
258 * parse_args - parse a string of arguments, from the command
259 * line or from a file.
262 parse_args(argc, argv)
275 * First see if it's a command.
277 for (cmdp = cmds; cmdp->cmd_name; cmdp++)
278 if (!strcmp(arg, cmdp->cmd_name))
281 if (cmdp->cmd_name != NULL) {
282 if (argc < cmdp->num_args) {
283 fprintf(stderr, "Too few parameters for command %s\n", arg);
286 if (!(*cmdp->cmd_func)(argv))
288 argc -= cmdp->num_args;
289 argv += cmdp->num_args;
293 * Maybe a tty name, speed or IP address?
295 if ((ret = setdevname(arg)) == 0
296 && (ret = setspeed(arg)) == 0
297 && (ret = setipaddr(arg)) == 0) {
298 fprintf(stderr, "%s: unrecognized command\n", arg);
302 if (ret < 0) /* error */
310 * usage - print out a message telling how to use the program.
314 fprintf(stderr, usage_string, VERSION, PATCHLEVEL, IMPLEMENTATION,
319 * options_from_file - Read a string of options from a file,
320 * and interpret them.
323 options_from_file(filename, must_exist, check_prot)
332 char args[MAXARGS][MAXWORDLEN];
333 char cmd[MAXWORDLEN];
335 if ((f = fopen(filename, "r")) == NULL) {
336 if (!must_exist && errno == ENOENT)
341 if (check_prot && !readable(fileno(f))) {
342 fprintf(stderr, "%s: access denied\n", filename);
347 while (getword(f, cmd, &newline, filename)) {
349 * First see if it's a command.
351 for (cmdp = cmds; cmdp->cmd_name; cmdp++)
352 if (!strcmp(cmd, cmdp->cmd_name))
355 if (cmdp->cmd_name != NULL) {
356 for (i = 0; i < cmdp->num_args; ++i) {
357 if (!getword(f, args[i], &newline, filename)) {
359 "In file %s: too few parameters for command %s\n",
366 if (!(*cmdp->cmd_func)(argv)) {
373 * Maybe a tty name, speed or IP address?
375 if ((ret = setdevname(cmd)) == 0
376 && (ret = setspeed(cmd)) == 0
377 && (ret = setipaddr(cmd)) == 0) {
378 fprintf(stderr, "In file %s: unrecognized command %s\n",
383 if (ret < 0) /* error */
391 * options_from_user - See if the use has a ~/.ppprc file,
392 * and if so, interpret options from it.
397 char *user, *path, *file;
401 pw = getpwuid(getuid());
402 if (pw == NULL || (user = pw->pw_dir) == NULL || user[0] == 0)
404 file = _PATH_USEROPT;
405 path = malloc(strlen(user) + strlen(file) + 2);
407 novm("init file name");
411 ret = options_from_file(path, 0, 1);
417 * options_for_tty - See if an options file exists for the serial
418 * device, and if so, interpret options from it.
426 dev = strrchr(devname, '/');
431 if (strcmp(dev, "tty") == 0)
432 return 1; /* don't look for /etc/ppp/options.tty */
433 path = malloc(strlen(_PATH_TTYOPT) + strlen(dev) + 1);
435 novm("tty init file name");
436 strcpy(path, _PATH_TTYOPT);
438 ret = options_from_file(path, 0, 0);
444 * readable - check if a file is readable by the real user.
453 GIDSET_TYPE groups[NGROUPS_MAX];
458 if (fstat(fd, &sbuf) != 0)
460 if (sbuf.st_uid == uid)
461 return sbuf.st_mode & S_IRUSR;
462 if (sbuf.st_gid == getgid())
463 return sbuf.st_mode & S_IRGRP;
464 ngroups = getgroups(NGROUPS_MAX, groups);
465 for (i = 0; i < ngroups; ++i)
466 if (sbuf.st_gid == groups[i])
467 return sbuf.st_mode & S_IRGRP;
468 return sbuf.st_mode & S_IROTH;
472 * Read a word from a file.
473 * Words are delimited by white-space or by quotes (").
474 * Quotes, white-space and \ may be escaped with \.
475 * \<newline> is ignored.
478 getword(f, word, newlinep, filename)
493 * First skip white-space and comments
495 while ((c = getc(f)) != EOF) {
498 * \<newline> is ignored; \ followed by anything else
501 if ((c = getc(f)) == '\n')
508 *newlinep = 1; /* next word starts a line */
510 /* comment - ignore until EOF or \n */
511 while ((c = getc(f)) != EOF && c != '\n')
516 } else if (!isspace(c))
521 * End of file or error - fail
533 * Is this character escaped by \ ?
537 --len; /* ignore \<newline> */
538 else if (c == '"' || isspace(c) || c == '\\')
539 word[len-1] = c; /* put special char in word */
541 if (len < MAXWORDLEN-1)
546 } else if (c == '"') {
548 } else if (!quoted && (isspace(c) || c == '#')) {
552 if (len < MAXWORDLEN-1)
558 if ((c = getc(f)) == EOF)
567 if (len >= MAXWORDLEN) {
568 word[MAXWORDLEN-1] = 0;
569 fprintf(stderr, "%s: warning: word in file %s too long (%.20s...)\n",
570 progname, filename, word);
578 * number_option - parse a numeric parameter for an option
581 number_option(str, valp, base)
588 *valp = strtol(str, &ptr, base);
590 fprintf(stderr, "%s: invalid number: %s\n", progname, str);
598 * int_option - like number_option, but valp is int *,
599 * the base is assumed to be 0, and *valp is not changed
600 * if there is an error.
603 int_option(str, valp)
609 if (!number_option(str, &v, 0))
617 * The following procedures execute commands.
621 * readfile - take commands from a file.
627 return options_from_file(*argv, 1, 1);
631 * setdebug - Set debug (command line argument).
641 * setkdebug - Set kernel debugging level.
647 return int_option(*argv, &kdebugflag);
651 * noopt - Disable all options.
656 BZERO((char *) &lcp_wantoptions[0], sizeof (struct lcp_options));
657 BZERO((char *) &lcp_allowoptions[0], sizeof (struct lcp_options));
658 BZERO((char *) &ipcp_wantoptions[0], sizeof (struct ipcp_options));
659 BZERO((char *) &ipcp_allowoptions[0], sizeof (struct ipcp_options));
664 * noaccomp - Disable Address/Control field compression negotiation.
669 lcp_wantoptions[0].neg_accompression = 0;
670 lcp_allowoptions[0].neg_accompression = 0;
676 * noasyncmap - Disable async map negotiation.
681 lcp_wantoptions[0].neg_asyncmap = 0;
682 lcp_allowoptions[0].neg_asyncmap = 0;
688 * noipaddr - Disable IP address negotiation.
693 ipcp_wantoptions[0].neg_addr = 0;
694 ipcp_allowoptions[0].neg_addr = 0;
700 * nomagicnumber - Disable magic number negotiation.
705 lcp_wantoptions[0].neg_magicnumber = 0;
706 lcp_allowoptions[0].neg_magicnumber = 0;
712 * nomru - Disable mru negotiation.
717 lcp_wantoptions[0].neg_mru = 0;
718 lcp_allowoptions[0].neg_mru = 0;
724 * setmru - Set MRU for negotiation.
732 if (!number_option(*argv, &mru, 0))
734 lcp_wantoptions[0].mru = mru;
735 lcp_wantoptions[0].neg_mru = 1;
741 * setmru - Set the largest MTU we'll use.
749 if (!number_option(*argv, &mtu, 0))
751 if (mtu < MINMRU || mtu > MAXMRU) {
752 fprintf(stderr, "mtu option value of %d is too %s\n", mtu,
753 (mtu < MINMRU? "small": "large"));
756 lcp_allowoptions[0].mru = mtu;
762 * nopcomp - Disable Protocol field compression negotiation.
767 lcp_wantoptions[0].neg_pcompression = 0;
768 lcp_allowoptions[0].neg_pcompression = 0;
774 * setpassive - Set passive mode (don't give up if we time out sending
775 * LCP configure-requests).
780 lcp_wantoptions[0].passive = 1;
786 * setsilent - Set silent mode (don't start sending LCP configure-requests
787 * until we get one from the peer).
792 lcp_wantoptions[0].silent = 1;
798 * nopap - Disable PAP authentication with peer.
803 lcp_allowoptions[0].neg_upap = 0;
809 * reqpap - Require PAP authentication from peer.
814 lcp_wantoptions[0].neg_upap = 1;
820 * setupapfile - specifies UPAP info for authenticating with peer.
829 lcp_allowoptions[0].neg_upap = 1;
831 /* open user info file */
832 if ((ufile = fopen(*argv, "r")) == NULL) {
833 fprintf(stderr, "unable to open user login data file %s\n", *argv);
836 check_access(ufile, *argv);
839 if (fgets(user, MAXNAMELEN - 1, ufile) == NULL
840 || fgets(passwd, MAXSECRETLEN - 1, ufile) == NULL){
841 fprintf(stderr, "Unable to read user login data file %s.\n", *argv);
846 /* get rid of newlines */
848 if (l > 0 && user[l-1] == '\n')
851 if (l > 0 && passwd[l-1] == '\n')
859 * nochap - Disable CHAP authentication with peer.
864 lcp_allowoptions[0].neg_chap = 0;
870 * reqchap - Require CHAP authentication from peer.
875 lcp_wantoptions[0].neg_chap = 1;
882 * setnovj - diable vj compression
887 ipcp_wantoptions[0].neg_vj = 0;
888 ipcp_allowoptions[0].neg_vj = 0;
893 * setconnector - Set a program to connect to a serial line
899 connector = strdup(*argv);
900 if (connector == NULL)
901 novm("connector string");
907 * setdisconnector - Set a program to disconnect from the serial line
910 setdisconnector(argv)
913 disconnector = strdup(*argv);
914 if (disconnector == NULL)
915 novm("disconnector string");
922 * setdomain - Set domain name to append to hostname
928 strncat(hostname, *argv, MAXNAMELEN - strlen(hostname));
929 hostname[MAXNAMELEN-1] = 0;
935 * setasyncmap - add bits to asyncmap (what we request peer to escape).
943 if (!number_option(*argv, &asyncmap, 16))
945 lcp_wantoptions[0].asyncmap |= asyncmap;
946 lcp_wantoptions[0].neg_asyncmap = 1;
952 * setescape - add chars to the set we escape on transmission.
964 n = strtol(p, &endp, 16);
966 fprintf(stderr, "%s: invalid hex number: %s\n", progname, p);
970 if (n < 0 || 0x20 <= n && n <= 0x3F || n == 0x5E || n > 0xFF) {
971 fprintf(stderr, "%s: can't escape character 0x%x\n", n);
974 xmit_accm[0][n >> 5] |= 1 << (n & 0x1F);
975 while (*p == ',' || *p == ' ')
983 * setspeed - Set the speed.
992 spd = strtol(arg, &ptr, 0);
993 if (ptr == arg || *ptr != 0 || spd == 0)
1001 * setdevname - Set the device name.
1007 struct stat statbuf;
1008 char *tty, *ttyname();
1009 char dev[MAXPATHLEN];
1011 if (strncmp("/dev/", cp, 5) != 0) {
1012 strcpy(dev, "/dev/");
1013 strncat(dev, cp, MAXPATHLEN - 5);
1014 dev[MAXPATHLEN-1] = 0;
1019 * Check if there is a device by this name.
1021 if (stat(cp, &statbuf) < 0) {
1022 if (errno == ENOENT)
1024 syslog(LOG_ERR, cp);
1028 (void) strncpy(devname, cp, MAXPATHLEN);
1029 devname[MAXPATHLEN-1] = 0;
1030 default_device = FALSE;
1037 * setipaddr - Set the IP address
1044 char *colon, *index();
1045 u_long local, remote;
1046 ipcp_options *wo = &ipcp_wantoptions[0];
1049 * IP address pair separated by ":".
1051 if ((colon = index(arg, ':')) == NULL)
1055 * If colon first character, then no local addr.
1059 if ((local = inet_addr(arg)) == -1) {
1060 if ((hp = gethostbyname(arg)) == NULL) {
1061 fprintf(stderr, "unknown host: %s\n", arg);
1064 local = *(long *)hp->h_addr;
1065 if (our_name[0] == 0) {
1066 strncpy(our_name, arg, MAXNAMELEN);
1067 our_name[MAXNAMELEN-1] = 0;
1071 if (bad_ip_adrs(local)) {
1072 fprintf(stderr, "bad local IP address %s\n", ip_ntoa(local));
1076 wo->ouraddr = local;
1081 * If colon last character, then no remote addr.
1083 if (*++colon != '\0') {
1084 if ((remote = inet_addr(colon)) == -1) {
1085 if ((hp = gethostbyname(colon)) == NULL) {
1086 fprintf(stderr, "unknown host: %s\n", colon);
1089 remote = *(long *)hp->h_addr;
1090 if (remote_name[0] == 0) {
1091 strncpy(remote_name, colon, MAXNAMELEN);
1092 remote_name[MAXNAMELEN-1] = 0;
1096 if (bad_ip_adrs(remote)) {
1097 fprintf(stderr, "bad remote IP address %s\n", ip_ntoa(remote));
1101 wo->hisaddr = remote;
1109 * setnoipdflt - disable setipdefault()
1114 disable_defaultip = 1;
1120 * setipcpaccl - accept peer's idea of our address
1125 ipcp_wantoptions[0].accept_local = 1;
1131 * setipcpaccr - accept peer's idea of its address
1136 ipcp_wantoptions[0].accept_remote = 1;
1142 * setipdefault - default our local IP address based on our hostname.
1149 ipcp_options *wo = &ipcp_wantoptions[0];
1152 * If local IP address already given, don't bother.
1154 if (wo->ouraddr != 0 || disable_defaultip)
1158 * Look up our hostname (possibly with domain name appended)
1159 * and take the first IP address as our local IP address.
1160 * If there isn't an IP address for our hostname, too bad.
1162 wo->accept_local = 1; /* don't insist on this default value */
1163 if ((hp = gethostbyname(hostname)) == NULL)
1165 local = *(long *)hp->h_addr;
1166 if (local != 0 && !bad_ip_adrs(local))
1167 wo->ouraddr = local;
1172 * setnetmask - set the netmask to be used on the interface.
1180 if ((mask = inet_addr(*argv)) == -1 || (netmask & ~mask) != 0) {
1181 fprintf(stderr, "Invalid netmask %s\n", *argv);
1190 * Return user specified netmask. A value of zero means no netmask has
1255 if (our_name[0] == 0) {
1256 strncpy(our_name, argv[0], MAXNAMELEN);
1257 our_name[MAXNAMELEN-1] = 0;
1266 strncpy(user, argv[0], MAXNAMELEN);
1267 user[MAXNAMELEN-1] = 0;
1275 strncpy(remote_name, argv[0], MAXNAMELEN);
1276 remote_name[MAXNAMELEN-1] = 0;
1290 ipcp_wantoptions[0].default_route = 1;
1297 ipcp_wantoptions[0].proxy_arp = 1;
1316 * Functions to set the echo interval for modem-less monitors
1319 static int setlcpechointerval(argv)
1322 return int_option(*argv, &lcp_echo_interval, 0);
1325 static int setlcpechofails(argv)
1328 return int_option(*argv, &lcp_echo_fails, 0);
1332 * Functions to set timeouts, max transmits, etc.
1338 return int_option(*argv, &lcp_fsm[0].timeouttime, 0);
1341 static int setlcpterm(argv)
1344 return int_option(*argv, &lcp_fsm[0].maxtermtransmits, 0);
1347 static int setlcpconf(argv)
1350 return int_option(*argv, &lcp_fsm[0].maxconfreqtransmits, 0);
1353 static int setlcpfails(argv)
1356 return int_option(*argv, &lcp_fsm[0].maxnakloops, 0);
1359 static int setipcptimeout(argv)
1362 return int_option(*argv, &ipcp_fsm[0].timeouttime, 0);
1365 static int setipcpterm(argv)
1368 return int_option(*argv, &ipcp_fsm[0].maxtermtransmits, 0);
1371 static int setipcpconf(argv)
1374 return int_option(*argv, &ipcp_fsm[0].maxconfreqtransmits, 0);
1377 static int setipcpfails(argv)
1380 return int_option(*argv, &lcp_fsm[0].maxnakloops, 0);
1383 static int setpaptimeout(argv)
1386 return int_option(*argv, &upap[0].us_timeouttime, 0);
1389 static int setpapreqs(argv)
1392 return int_option(*argv, &upap[0].us_maxtransmits, 0);
1395 static int setchaptimeout(argv)
1398 return int_option(*argv, &chap[0].timeouttime, 0);
1401 static int setchapchal(argv)
1404 return int_option(*argv, &chap[0].max_transmits, 0);
1407 static int setchapintv(argv)
1410 return int_option(*argv, &chap[0].chal_interval, 0);
1413 static int setslots(argv)
1417 int answer = int_option(*argv, &value, 0);
1419 if (answer == 1 && value > 1 && value < 17) {
1420 ipcp_wantoptions [0].maxslotindex =
1421 ipcp_allowoptions[0].maxslotindex = value - 1;