X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Foptions.c;h=54810965f7a069c032cca0dafe0bf1684d1f7628;hb=44e1777caa7658b455b5269f895734a5c33d2246;hp=db132afd07091ec258d08f7e2c86fd8a930ea883;hpb=9ad11d4b9e99a8f338080897e30e62608e2bdbba;p=ppp.git diff --git a/pppd/options.c b/pppd/options.c index db132af..5481096 100644 --- a/pppd/options.c +++ b/pppd/options.c @@ -18,7 +18,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: options.c,v 1.38 1997/04/30 05:55:54 paulus Exp $"; +static char rcsid[] = "$Id: options.c,v 1.43 1998/09/04 18:49:15 christos Exp $"; #endif #include @@ -159,7 +159,7 @@ static int setescape __P((char **)); static int setmru __P((char **)); static int setmtu __P((char **)); #ifdef CBCP_SUPPORT -static int setcbcp __P((char *)); +static int setcbcp __P((char **)); #endif static int nomru __P((char **)); static int nopcomp __P((char **)); @@ -171,8 +171,10 @@ static int setdomain __P((char **)); static int setnetmask __P((char **)); static int setcrtscts __P((char **)); static int setnocrtscts __P((char **)); +static int setcdtrcts __P((char **)); static int setxonxoff __P((char **)); static int setnodetach __P((char **)); +static int setupdetach __P((char **)); static int setmodem __P((char **)); static int setlocal __P((char **)); static int setlock __P((char **)); @@ -215,6 +217,7 @@ static int setbsdcomp __P((char **)); static int setnobsdcomp __P((char **)); static int setdeflate __P((char **)); static int setnodeflate __P((char **)); +static int setnodeflatedraft __P((char **)); static int setdemand __P((char **)); static int setpred1comp __P((char **)); static int setnopred1comp __P((char **)); @@ -250,7 +253,7 @@ static int setipxcpfails __P((char **)); #endif /* IPX_CHANGE */ #ifdef MSLANMAN -static int setmslanman __P((void)); +static int setmslanman __P((char **)); #endif static int number_option __P((char *, u_int32_t *, int)); @@ -274,6 +277,7 @@ static struct cmd { {"-d", 0, setdebug}, /* Increase debugging level */ {"nodetach", 0, setnodetach}, /* Don't detach from controlling tty */ {"-detach", 0, setnodetach}, /* don't fork */ + {"updetach", 0, setupdetach}, /* Detach once an NP has come up */ {"noip", 0, noip}, /* Disable IP and IPCP */ {"-ip", 0, noip}, /* Disable IP and IPCP */ {"nomagic", 0, nomagicnumber}, /* Disable magic number negotiation */ @@ -308,6 +312,9 @@ static struct cmd { {"crtscts", 0, setcrtscts}, /* set h/w flow control */ {"nocrtscts", 0, setnocrtscts}, /* clear h/w flow control */ {"-crtscts", 0, setnocrtscts}, /* clear h/w flow control */ + {"cdtrcts", 0, setcdtrcts}, /* set alternate h/w flow control */ + {"nocdtrcts", 0, setnocrtscts}, /* clear h/w flow control */ + {"-cdtrcts", 0, setnocrtscts}, /* clear h/w flow control */ {"xonxoff", 0, setxonxoff}, /* set s/w flow control */ {"debug", 0, setdebug}, /* Increase debugging level */ {"kdebug", 1, setkdebug}, /* Enable kernel-level debugging */ @@ -368,6 +375,7 @@ static struct cmd { {"deflate", 1, setdeflate}, /* request Deflate compression */ {"nodeflate", 0, setnodeflate}, /* don't allow Deflate compression */ {"-deflate", 0, setnodeflate}, /* don't allow Deflate compression */ + {"nodeflatedraft", 0, setnodeflatedraft}, /* don't use draft deflate # */ {"predictor1", 0, setpred1comp}, /* request Predictor-1 */ {"nopredictor1", 0, setnopred1comp},/* don't allow Predictor-1 */ {"-predictor1", 0, setnopred1comp}, /* don't allow Predictor-1 */ @@ -431,6 +439,7 @@ Usage: %s [ options ], where options are:\n\ auth Require authentication from peer\n\ connect

Invoke shell command

to set up the serial line\n\ crtscts Use hardware RTS/CTS flow control\n\ + cdtrcts Use hardware DTR/CTS flow control (if supported)\n\ defaultroute Add default route through interface\n\ file Take options from file \n\ modem Use modem control lines\n\ @@ -1829,6 +1838,7 @@ setnetmask(argv) return 0; } + netmask = mask; return (1); } @@ -1848,6 +1858,14 @@ setnocrtscts(argv) return (1); } +static int +setcdtrcts(argv) + char **argv; +{ + crtscts = 2; + return (1); +} + static int setxonxoff(argv) char **argv; @@ -1867,6 +1885,14 @@ setnodetach(argv) return (1); } +static int +setupdetach(argv) + char **argv; +{ + nodetach = -1; + return (1); +} + static int setdemand(argv) char **argv; @@ -2248,6 +2274,15 @@ setnodeflate(argv) return 1; } +static int +setnodeflatedraft(argv) + char **argv; +{ + ccp_wantoptions[0].deflate_draft = 0; + ccp_allowoptions[0].deflate_draft = 0; + return 1; +} + static int setpred1comp(argv) char **argv; @@ -2319,11 +2354,12 @@ setdnsaddr(argv) dns = *(u_int32_t *)hp->h_addr; } - if (ipcp_allowoptions[0].dnsaddr[0] == 0) { + /* if there is no primary then update it. */ + if (ipcp_allowoptions[0].dnsaddr[0] == 0) ipcp_allowoptions[0].dnsaddr[0] = dns; - } else { - ipcp_allowoptions[0].dnsaddr[1] = dns; - } + + /* always set the secondary address value to the same value. */ + ipcp_allowoptions[0].dnsaddr[1] = dns; return (1); } @@ -2350,11 +2386,12 @@ setwinsaddr(argv) wins = *(u_int32_t *)hp->h_addr; } - if (ipcp_allowoptions[0].winsaddr[0] == 0) { + /* if there is no primary then update it. */ + if (ipcp_allowoptions[0].winsaddr[0] == 0) ipcp_allowoptions[0].winsaddr[0] = wins; - } else { - ipcp_allowoptions[0].winsaddr[1] = wins; - } + + /* always set the secondary address value to the same value. */ + ipcp_allowoptions[0].winsaddr[1] = wins; return (1); } @@ -2450,6 +2487,7 @@ setipxanet(argv) { ipxcp_wantoptions[0].accept_network = 1; ipxcp_allowoptions[0].accept_network = 1; + return 1; } static int @@ -2458,6 +2496,7 @@ setipxalcl(argv) { ipxcp_wantoptions[0].accept_local = 1; ipxcp_allowoptions[0].accept_local = 1; + return 1; } static int @@ -2466,6 +2505,7 @@ setipxarmt(argv) { ipxcp_wantoptions[0].accept_remote = 1; ipxcp_allowoptions[0].accept_remote = 1; + return 1; } static u_char * @@ -2543,7 +2583,8 @@ resetipxproto(argv) #ifdef MSLANMAN static int -setmslanman() +setmslanman(argv) + char **argv; { ms_lanman = 1; return (1);