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.7 1994/05/18 06:34:15 paulus Exp $";
34 #include <sys/types.h>
36 #include <netinet/in.h>
40 #include "pathnames.h"
41 #include "patchlevel.h"
52 char *strdup __ARGS((char *));
55 #if defined(ultrix) || defined(sun)
56 #define GETGROUPS_TYPE int
58 #define GETGROUPS_TYPE gid_t
64 static int setdebug __ARGS((void));
65 static int setkdebug __ARGS((char **));
66 static int setpassive __ARGS((void));
67 static int setsilent __ARGS((void));
68 static int noopt __ARGS((void));
69 static int setnovj __ARGS((void));
70 static int reqpap __ARGS((void));
71 static int nopap __ARGS((void));
72 static int setupapfile __ARGS((char **));
73 static int nochap __ARGS((void));
74 static int reqchap __ARGS((void));
75 static int setspeed __ARGS((char *));
76 static int noaccomp __ARGS((void));
77 static int noasyncmap __ARGS((void));
78 static int noipaddr __ARGS((void));
79 static int nomagicnumber __ARGS((void));
80 static int setasyncmap __ARGS((char **));
81 static int setescape __ARGS((char **));
82 static int setmru __ARGS((char **));
83 static int setmtu __ARGS((char **));
84 static int nomru __ARGS((void));
85 static int nopcomp __ARGS((void));
86 static int setconnector __ARGS((char **));
87 static int setdisconnector __ARGS((char **));
88 static int setdomain __ARGS((char **));
89 static int setnetmask __ARGS((char **));
90 static int setcrtscts __ARGS((void));
91 static int setnodetach __ARGS((void));
92 static int setmodem __ARGS((void));
93 static int setlocal __ARGS((void));
94 static int setlock __ARGS((void));
95 static int setname __ARGS((char **));
96 static int setuser __ARGS((char **));
97 static int setremote __ARGS((char **));
98 static int setauth __ARGS((void));
99 static int readfile __ARGS((char **));
100 static int setdefaultroute __ARGS((void));
101 static int setproxyarp __ARGS((void));
102 static int setpersist __ARGS((void));
103 static int setdologin __ARGS((void));
104 static int setusehostname __ARGS((void));
105 static int setnoipdflt __ARGS((void));
106 static int setlcptimeout __ARGS((char **));
107 static int setlcpterm __ARGS((char **));
108 static int setlcpconf __ARGS((char **));
109 static int setlcpfails __ARGS((char **));
110 static int setipcptimeout __ARGS((char **));
111 static int setipcpterm __ARGS((char **));
112 static int setipcpconf __ARGS((char **));
113 static int setipcpfails __ARGS((char **));
114 static int setpaptimeout __ARGS((char **));
115 static int setpapreqs __ARGS((char **));
116 static int setchaptimeout __ARGS((char **));
117 static int setchapchal __ARGS((char **));
118 static int setchapintv __ARGS((char **));
119 static int setipcpaccl __ARGS((void));
120 static int setipcpaccr __ARGS((void));
122 static int number_option __ARGS((char *, long *, int));
123 static int readable __ARGS((int fd));
128 extern char *progname;
130 extern int kdebugflag;
135 extern char *connector;
136 extern char *disconnector;
138 extern char devname[];
139 extern int default_device;
140 extern u_long netmask;
143 extern char passwd[];
144 extern int auth_required;
148 extern char our_name[];
149 extern char remote_name[];
151 int disable_defaultip;
161 "-all", 0, noopt, /* Don't request/allow any options */
162 "-ac", 0, noaccomp, /* Disable Address/Control compress */
163 "-am", 0, noasyncmap, /* Disable asyncmap negotiation */
164 "-as", 1, setasyncmap, /* set the desired async map */
165 "-d", 0, setdebug, /* Increase debugging level */
166 "-detach", 0, setnodetach, /* don't fork */
167 "-ip", 0, noipaddr, /* Disable IP address negotiation */
168 "-mn", 0, nomagicnumber, /* Disable magic number negotiation */
169 "-mru", 0, nomru, /* Disable mru negotiation */
170 "-p", 0, setpassive, /* Set passive mode */
171 "-pc", 0, nopcomp, /* Disable protocol field compress */
172 "+ua", 1, setupapfile, /* Get PAP user and password from file */
173 "+pap", 0, reqpap, /* Require PAP auth from peer */
174 "-pap", 0, nopap, /* Don't allow UPAP authentication with peer */
175 "+chap", 0, reqchap, /* Require CHAP authentication from peer */
176 "-chap", 0, nochap, /* Don't allow CHAP authentication with peer */
177 "-vj", 0, setnovj, /* disable VJ compression */
178 "asyncmap", 1, setasyncmap, /* set the desired async map */
179 "escape", 1, setescape, /* set chars to escape on transmission */
180 "connect", 1, setconnector, /* A program to set up a connection */
181 "disconnect", 1, setdisconnector, /* program to disconnect serial dev. */
182 "crtscts", 0, setcrtscts, /* set h/w flow control */
183 "debug", 0, setdebug, /* Increase debugging level */
184 "kdebug", 1, setkdebug, /* Enable kernel-level debugging */
185 "domain", 1, setdomain, /* Add given domain name to hostname*/
186 "mru", 1, setmru, /* Set MRU value for negotiation */
187 "mtu", 1, setmtu, /* Set our MTU */
188 "netmask", 1, setnetmask, /* set netmask */
189 "passive", 0, setpassive, /* Set passive mode */
190 "silent", 0, setsilent, /* Set silent mode */
191 "modem", 0, setmodem, /* Use modem control lines */
192 "local", 0, setlocal, /* Don't use modem control lines */
193 "lock", 0, setlock, /* Lock serial device (with lock file) */
194 "name", 1, setname, /* Set local name for authentication */
195 "user", 1, setuser, /* Set username for PAP auth with peer */
196 "usehostname", 0, setusehostname, /* Must use hostname for auth. */
197 "remotename", 1, setremote, /* Set remote name for authentication */
198 "auth", 0, setauth, /* Require authentication from peer */
199 "file", 1, readfile, /* Take options from a file */
200 "defaultroute", 0, setdefaultroute, /* Add default route */
201 "proxyarp", 0, setproxyarp, /* Add proxy ARP entry */
202 "persist", 0, setpersist, /* Keep on reopening connection after close */
203 "login", 0, setdologin, /* Use system password database for UPAP */
204 "noipdefault", 0, setnoipdflt, /* Don't use name for default IP adrs */
205 "lcp-restart", 1, setlcptimeout, /* Set timeout for LCP */
206 "lcp-max-terminate", 1, setlcpterm, /* Set max #xmits for term-reqs */
207 "lcp-max-configure", 1, setlcpconf, /* Set max #xmits for conf-reqs */
208 "lcp-max-failure", 1, setlcpfails, /* Set max #conf-naks for LCP */
209 "ipcp-restart", 1, setipcptimeout, /* Set timeout for IPCP */
210 "ipcp-max-terminate", 1, setipcpterm, /* Set max #xmits for term-reqs */
211 "ipcp-max-configure", 1, setipcpconf, /* Set max #xmits for conf-reqs */
212 "ipcp-max-failure", 1, setipcpfails, /* Set max #conf-naks for IPCP */
213 "pap-restart", 1, setpaptimeout, /* Set timeout for UPAP */
214 "pap-max-authreq", 1, setpapreqs, /* Set max #xmits for auth-reqs */
215 "chap-restart", 1, setchaptimeout, /* Set timeout for CHAP */
216 "chap-max-challenge", 1, setchapchal, /* Set max #xmits for challenge */
217 "chap-interval", 1, setchapintv, /* Set interval for rechallenge */
218 "ipcp-accept-local", 0, setipcpaccl, /* Accept peer's address for us */
219 "ipcp-accept-remote", 0, setipcpaccr, /* Accept peer's address for it */
224 static char *usage_string = "\
225 pppd version %s patch level %d\n\
226 Usage: %s [ arguments ], where arguments are:\n\
227 <device> Communicate over the named device\n\
228 <speed> Set the baud rate to <speed>\n\
229 <loc>:<rem> Set the local and/or remote interface IP\n\
230 addresses. Either one may be omitted.\n\
231 asyncmap <n> Set the desired async map to hex <n>\n\
232 auth Require authentication from peer\n\
233 connect <p> Invoke shell command <p> to set up the serial line\n\
234 crtscts Use hardware RTS/CTS flow control\n\
235 defaultroute Add default route through interface\n\
236 file <f> Take options from file <f>\n\
237 modem Use modem control lines\n\
238 mru <n> Set MRU value to <n> for negotiation\n\
239 netmask <n> Set interface netmask to <n>\n\
240 See pppd(8) for more options.\n\
245 * parse_args - parse a string of arguments, from the command
246 * line or from a file.
249 parse_args(argc, argv)
262 * First see if it's a command.
264 for (cmdp = cmds; cmdp->cmd_name; cmdp++)
265 if (!strcmp(arg, cmdp->cmd_name))
268 if (cmdp->cmd_name != NULL) {
269 if (argc < cmdp->num_args) {
270 fprintf(stderr, "Too few parameters for command %s\n", arg);
273 if (!(*cmdp->cmd_func)(argv))
275 argc -= cmdp->num_args;
276 argv += cmdp->num_args;
280 * Maybe a tty name, speed or IP address?
282 if ((ret = setdevname(arg)) == 0
283 && (ret = setspeed(arg)) == 0
284 && (ret = setipaddr(arg)) == 0) {
285 fprintf(stderr, "%s: unrecognized command\n", arg);
289 if (ret < 0) /* error */
297 * usage - print out a message telling how to use the program.
301 fprintf(stderr, usage_string, VERSION, PATCHLEVEL, progname);
305 * options_from_file - Read a string of options from a file,
306 * and interpret them.
309 options_from_file(filename, must_exist, check_prot)
318 char args[MAXARGS][MAXWORDLEN];
319 char cmd[MAXWORDLEN];
321 if ((f = fopen(filename, "r")) == NULL) {
322 if (!must_exist && errno == ENOENT)
327 if (check_prot && !readable(fileno(f))) {
328 fprintf(stderr, "%s: access denied\n", filename);
333 while (getword(f, cmd, &newline, filename)) {
335 * First see if it's a command.
337 for (cmdp = cmds; cmdp->cmd_name; cmdp++)
338 if (!strcmp(cmd, cmdp->cmd_name))
341 if (cmdp->cmd_name != NULL) {
342 for (i = 0; i < cmdp->num_args; ++i) {
343 if (!getword(f, args[i], &newline, filename)) {
345 "In file %s: too few parameters for command %s\n",
352 if (!(*cmdp->cmd_func)(argv)) {
359 * Maybe a tty name, speed or IP address?
361 if ((ret = setdevname(cmd)) == 0
362 && (ret = setspeed(cmd)) == 0
363 && (ret = setipaddr(cmd)) == 0) {
364 fprintf(stderr, "In file %s: unrecognized command %s\n",
369 if (ret < 0) /* error */
377 * options_from_user - See if the use has a ~/.ppprc file,
378 * and if so, interpret options from it.
383 char *user, *path, *file;
387 pw = getpwuid(getuid());
388 if (pw == NULL || (user = pw->pw_dir) == NULL || user[0] == 0)
390 file = _PATH_USEROPT;
391 path = malloc(strlen(user) + strlen(file) + 2);
393 novm("init file name");
397 ret = options_from_file(path, 0, 1);
403 * options_for_tty - See if an options file exists for the serial
404 * device, and if so, interpret options from it.
412 dev = strrchr(devname, '/');
417 if (strcmp(dev, "tty") == 0)
418 return 1; /* don't look for /etc/ppp/options.tty */
419 path = malloc(strlen(_PATH_TTYOPT) + strlen(dev) + 1);
421 novm("tty init file name");
422 strcpy(path, _PATH_TTYOPT);
424 ret = options_from_file(path, 0, 0);
430 * readable - check if a file is readable by the real user.
439 GETGROUPS_TYPE groups[NGROUPS_MAX];
444 if (fstat(fd, &sbuf) != 0)
446 if (sbuf.st_uid == uid)
447 return sbuf.st_mode & S_IRUSR;
448 if (sbuf.st_gid == getgid())
449 return sbuf.st_mode & S_IRGRP;
450 ngroups = getgroups(NGROUPS_MAX, groups);
451 for (i = 0; i < ngroups; ++i)
452 if (sbuf.st_gid == groups[i])
453 return sbuf.st_mode & S_IRGRP;
454 return sbuf.st_mode & S_IROTH;
458 * Read a word from a file.
459 * Words are delimited by white-space or by quotes (").
460 * Quotes, white-space and \ may be escaped with \.
461 * \<newline> is ignored.
464 getword(f, word, newlinep, filename)
479 * First skip white-space and comments
481 while ((c = getc(f)) != EOF) {
484 * \<newline> is ignored; \ followed by anything else
487 if ((c = getc(f)) == '\n')
494 *newlinep = 1; /* next word starts a line */
496 /* comment - ignore until EOF or \n */
497 while ((c = getc(f)) != EOF && c != '\n')
502 } else if (!isspace(c))
507 * End of file or error - fail
519 * Is this character escaped by \ ?
523 --len; /* ignore \<newline> */
524 else if (c == '"' || isspace(c) || c == '\\')
525 word[len-1] = c; /* put special char in word */
527 if (len < MAXWORDLEN-1)
532 } else if (c == '"') {
534 } else if (!quoted && (isspace(c) || c == '#')) {
538 if (len < MAXWORDLEN-1)
544 if ((c = getc(f)) == EOF)
553 if (len >= MAXWORDLEN) {
554 word[MAXWORDLEN-1] = 0;
555 fprintf(stderr, "%s: warning: word in file %s too long (%.20s...)\n",
556 progname, filename, word);
564 * number_option - parse a numeric parameter for an option
567 number_option(str, valp, base)
574 *valp = strtol(str, &ptr, base);
576 fprintf(stderr, "%s: invalid number: %s\n", progname, str);
584 * int_option - like number_option, but valp is int *,
585 * the base is assumed to be 0, and *valp is not changed
586 * if there is an error.
589 int_option(str, valp)
595 if (!number_option(str, &v, 0))
603 * The following procedures execute commands.
607 * readfile - take commands from a file.
613 return options_from_file(*argv, 1, 1);
617 * setdebug - Set debug (command line argument).
627 * setkdebug - Set kernel debugging level.
633 return int_option(*argv, &kdebugflag);
637 * noopt - Disable all options.
642 BZERO((char *) &lcp_wantoptions[0], sizeof (struct lcp_options));
643 BZERO((char *) &lcp_allowoptions[0], sizeof (struct lcp_options));
644 BZERO((char *) &ipcp_wantoptions[0], sizeof (struct ipcp_options));
645 BZERO((char *) &ipcp_allowoptions[0], sizeof (struct ipcp_options));
650 * noaccomp - Disable Address/Control field compression negotiation.
655 lcp_wantoptions[0].neg_accompression = 0;
656 lcp_allowoptions[0].neg_accompression = 0;
662 * noasyncmap - Disable async map negotiation.
667 lcp_wantoptions[0].neg_asyncmap = 0;
668 lcp_allowoptions[0].neg_asyncmap = 0;
674 * noipaddr - Disable IP address negotiation.
679 ipcp_wantoptions[0].neg_addr = 0;
680 ipcp_allowoptions[0].neg_addr = 0;
686 * nomagicnumber - Disable magic number negotiation.
691 lcp_wantoptions[0].neg_magicnumber = 0;
692 lcp_allowoptions[0].neg_magicnumber = 0;
698 * nomru - Disable mru negotiation.
703 lcp_wantoptions[0].neg_mru = 0;
704 lcp_allowoptions[0].neg_mru = 0;
710 * setmru - Set MRU for negotiation.
718 if (!number_option(*argv, &mru, 0))
720 lcp_wantoptions[0].mru = mru;
721 lcp_wantoptions[0].neg_mru = 1;
727 * setmru - Set the largest MTU we'll use.
735 if (!number_option(*argv, &mtu, 0))
737 if (mtu < MINMRU || mtu > MAXMRU) {
738 fprintf(stderr, "mtu option value of %d is too %s\n", mtu,
739 (mtu < MINMRU? "small": "large"));
742 lcp_allowoptions[0].mru = mtu;
748 * nopcomp - Disable Protocol field compression negotiation.
753 lcp_wantoptions[0].neg_pcompression = 0;
754 lcp_allowoptions[0].neg_pcompression = 0;
760 * setpassive - Set passive mode (don't give up if we time out sending
761 * LCP configure-requests).
766 lcp_wantoptions[0].passive = 1;
772 * setsilent - Set silent mode (don't start sending LCP configure-requests
773 * until we get one from the peer).
778 lcp_wantoptions[0].silent = 1;
784 * nopap - Disable PAP authentication with peer.
789 lcp_allowoptions[0].neg_upap = 0;
795 * reqpap - Require PAP authentication from peer.
800 lcp_wantoptions[0].neg_upap = 1;
806 * setupapfile - specifies UPAP info for authenticating with peer.
815 lcp_allowoptions[0].neg_upap = 1;
817 /* open user info file */
818 if ((ufile = fopen(*argv, "r")) == NULL) {
819 fprintf(stderr, "unable to open user login data file %s\n", *argv);
822 check_access(ufile, *argv);
825 if (fgets(user, MAXNAMELEN - 1, ufile) == NULL
826 || fgets(passwd, MAXSECRETLEN - 1, ufile) == NULL){
827 fprintf(stderr, "Unable to read user login data file %s.\n", *argv);
832 /* get rid of newlines */
834 if (l > 0 && user[l-1] == '\n')
837 if (l > 0 && passwd[l-1] == '\n')
845 * nochap - Disable CHAP authentication with peer.
850 lcp_allowoptions[0].neg_chap = 0;
856 * reqchap - Require CHAP authentication from peer.
861 lcp_wantoptions[0].neg_chap = 1;
868 * setnovj - diable vj compression
873 ipcp_wantoptions[0].neg_vj = 0;
874 ipcp_allowoptions[0].neg_vj = 0;
879 * setconnector - Set a program to connect to a serial line
885 connector = strdup(*argv);
886 if (connector == NULL)
887 novm("connector string");
893 * setdisconnector - Set a program to disconnect from the serial line
896 setdisconnector(argv)
899 disconnector = strdup(*argv);
900 if (disconnector == NULL)
901 novm("disconnector string");
908 * setdomain - Set domain name to append to hostname
914 strncat(hostname, *argv, MAXNAMELEN - strlen(hostname));
915 hostname[MAXNAMELEN-1] = 0;
921 * setasyncmap - add bits to asyncmap (what we request peer to escape).
929 if (!number_option(*argv, &asyncmap, 16))
931 lcp_wantoptions[0].asyncmap |= asyncmap;
932 lcp_wantoptions[0].neg_asyncmap = 1;
938 * setescape - add chars to the set we escape on transmission.
950 n = strtol(p, &endp, 16);
952 fprintf(stderr, "%s: invalid hex number: %s\n", progname, p);
956 if (n < 0 || 0x20 <= n && n <= 0x3F || n == 0x5E || n > 0xFF) {
957 fprintf(stderr, "%s: can't escape character 0x%x\n", n);
960 xmit_accm[0][n >> 5] |= 1 << (n & 0x1F);
961 while (*p == ',' || *p == ' ')
969 * setspeed - Set the speed.
978 spd = strtol(arg, &ptr, 0);
979 if (ptr == arg || *ptr != 0 || spd == 0)
987 * setdevname - Set the device name.
994 char *tty, *ttyname();
995 char dev[MAXPATHLEN];
997 if (strncmp("/dev/", cp, 5) != 0) {
998 strcpy(dev, "/dev/");
999 strncat(dev, cp, MAXPATHLEN - 5);
1000 dev[MAXPATHLEN-1] = 0;
1005 * Check if there is a device by this name.
1007 if (stat(cp, &statbuf) < 0) {
1008 if (errno == ENOENT)
1010 syslog(LOG_ERR, cp);
1014 (void) strncpy(devname, cp, MAXPATHLEN);
1015 devname[MAXPATHLEN-1] = 0;
1016 default_device = FALSE;
1023 * setipaddr - Set the IP address
1030 char *colon, *index();
1031 u_long local, remote;
1032 ipcp_options *wo = &ipcp_wantoptions[0];
1035 * IP address pair separated by ":".
1037 if ((colon = index(arg, ':')) == NULL)
1041 * If colon first character, then no local addr.
1045 if ((local = inet_addr(arg)) == -1) {
1046 if ((hp = gethostbyname(arg)) == NULL) {
1047 fprintf(stderr, "unknown host: %s\n", arg);
1050 local = *(long *)hp->h_addr;
1051 if (our_name[0] == 0) {
1052 strncpy(our_name, arg, MAXNAMELEN);
1053 our_name[MAXNAMELEN-1] = 0;
1057 if (bad_ip_adrs(local)) {
1058 fprintf(stderr, "bad local IP address %s\n", ip_ntoa(local));
1062 wo->ouraddr = local;
1067 * If colon last character, then no remote addr.
1069 if (*++colon != '\0') {
1070 if ((remote = inet_addr(colon)) == -1) {
1071 if ((hp = gethostbyname(colon)) == NULL) {
1072 fprintf(stderr, "unknown host: %s\n", colon);
1075 remote = *(long *)hp->h_addr;
1076 if (remote_name[0] == 0) {
1077 strncpy(remote_name, colon, MAXNAMELEN);
1078 remote_name[MAXNAMELEN-1] = 0;
1082 if (bad_ip_adrs(remote)) {
1083 fprintf(stderr, "bad remote IP address %s\n", ip_ntoa(remote));
1087 wo->hisaddr = remote;
1095 * setnoipdflt - disable setipdefault()
1100 disable_defaultip = 1;
1106 * setipcpaccl - accept peer's idea of our address
1111 ipcp_wantoptions[0].accept_local = 1;
1117 * setipcpaccr - accept peer's idea of its address
1122 ipcp_wantoptions[0].accept_remote = 1;
1128 * setipdefault - default our local IP address based on our hostname.
1135 ipcp_options *wo = &ipcp_wantoptions[0];
1138 * If local IP address already given, don't bother.
1140 if (wo->ouraddr != 0 || disable_defaultip)
1144 * Look up our hostname (possibly with domain name appended)
1145 * and take the first IP address as our local IP address.
1146 * If there isn't an IP address for our hostname, too bad.
1148 wo->accept_local = 1; /* don't insist on this default value */
1149 if ((hp = gethostbyname(hostname)) == NULL)
1151 local = *(long *)hp->h_addr;
1152 if (local != 0 && !bad_ip_adrs(local))
1153 wo->ouraddr = local;
1158 * setnetmask - set the netmask to be used on the interface.
1166 if ((mask = inet_addr(*argv)) == -1 || (netmask & ~mask) != 0) {
1167 fprintf(stderr, "Invalid netmask %s\n", *argv);
1176 * Return user specified netmask. A value of zero means no netmask has
1234 if (our_name[0] == 0) {
1235 strncpy(our_name, argv[0], MAXNAMELEN);
1236 our_name[MAXNAMELEN-1] = 0;
1245 strncpy(user, argv[0], MAXNAMELEN);
1246 user[MAXNAMELEN-1] = 0;
1254 strncpy(remote_name, argv[0], MAXNAMELEN);
1255 remote_name[MAXNAMELEN-1] = 0;
1269 ipcp_wantoptions[0].default_route = 1;
1276 ipcp_wantoptions[0].proxy_arp = 1;
1295 * Functions to set timeouts, max transmits, etc.
1301 return int_option(*argv, &lcp_fsm[0].timeouttime, 0);
1304 static int setlcpterm(argv)
1307 return int_option(*argv, &lcp_fsm[0].maxtermtransmits, 0);
1310 static int setlcpconf(argv)
1313 return int_option(*argv, &lcp_fsm[0].maxconfreqtransmits, 0);
1316 static int setlcpfails(argv)
1319 return int_option(*argv, &lcp_fsm[0].maxnakloops, 0);
1322 static int setipcptimeout(argv)
1325 return int_option(*argv, &ipcp_fsm[0].timeouttime, 0);
1328 static int setipcpterm(argv)
1331 return int_option(*argv, &ipcp_fsm[0].maxtermtransmits, 0);
1334 static int setipcpconf(argv)
1337 return int_option(*argv, &ipcp_fsm[0].maxconfreqtransmits, 0);
1340 static int setipcpfails(argv)
1343 return int_option(*argv, &lcp_fsm[0].maxnakloops, 0);
1346 static int setpaptimeout(argv)
1349 return int_option(*argv, &upap[0].us_timeouttime, 0);
1352 static int setpapreqs(argv)
1355 return int_option(*argv, &upap[0].us_maxtransmits, 0);
1358 static int setchaptimeout(argv)
1361 return int_option(*argv, &chap[0].timeouttime, 0);
1364 static int setchapchal(argv)
1367 return int_option(*argv, &chap[0].max_transmits, 0);
1370 static int setchapintv(argv)
1373 return int_option(*argv, &chap[0].chal_interval, 0);