*/
#ifndef lint
-static char rcsid[] = "$Id: options.c,v 1.13 1994/09/01 00:13:16 paulus Exp $";
+static char rcsid[] = "$Id: options.c,v 1.15 1994/09/16 02:34:52 paulus Exp $";
#endif
#include <stdio.h>
static int setdomain __ARGS((char **));
static int setnetmask __ARGS((char **));
static int setcrtscts __ARGS((void));
+static int setnocrtscts __ARGS((void));
static int setxonxoff __ARGS((void));
static int setnodetach __ARGS((void));
static int setmodem __ARGS((void));
{"connect", 1, setconnector}, /* A program to set up a connection */
{"disconnect", 1, setdisconnector}, /* program to disconnect serial dev. */
{"crtscts", 0, setcrtscts}, /* set h/w flow control */
+ {"-crtscts", 0, setnocrtscts}, /* clear h/w flow control */
{"xonxoff", 0, setxonxoff}, /* set s/w flow control */
- {"-crtscts", 0, setxonxoff}, /* another name for xonxoff */
{"debug", 0, setdebug}, /* Increase debugging level */
{"kdebug", 1, setkdebug}, /* Enable kernel-level debugging */
{"domain", 1, setdomain}, /* Add given domain name to hostname*/
return (1);
}
+static int
+setnocrtscts()
+{
+ crtscts = -1;
+ return (1);
+}
+
static int
setxonxoff()
{
static int setbsdcomp(argv)
char **argv;
{
- int bits;
+ int rbits, abits;
+ char *str, *endp;
- if (!int_option(*argv, &bits))
+ str = *argv;
+ abits = rbits = strtol(str, &endp, 0);
+ if (endp != str && *endp == ',') {
+ str = endp + 1;
+ abits = strtol(str, &endp, 0);
+ }
+ if (*endp != 0 || endp == str) {
+ fprintf(stderr, "%s: invalid argument format for bsdcomp option\n",
+ progname);
return 0;
- ccp_wantoptions[0].bsd_compress = 1;
- ccp_wantoptions[0].bsd_bits = bits;
+ }
+ if (rbits != 0 && (rbits < MIN_BSD_BITS || rbits > MAX_BSD_BITS)
+ || abits != 0 && (abits < MIN_BSD_BITS || abits > MAX_BSD_BITS)) {
+ fprintf(stderr, "%s: bsdcomp option values must be 0 or %d .. %d\n",
+ progname, MIN_BSD_BITS, MAX_BSD_BITS);
+ return 0;
+ }
+ if (rbits > 0) {
+ ccp_wantoptions[0].bsd_compress = 1;
+ ccp_wantoptions[0].bsd_bits = rbits;
+ } else
+ ccp_wantoptions[0].bsd_compress = 0;
+ if (abits > 0) {
+ ccp_allowoptions[0].bsd_compress = 1;
+ ccp_allowoptions[0].bsd_bits = abits;
+ } else
+ ccp_allowoptions[0].bsd_compress = 0;
return 1;
}
static int setnobsdcomp()
{
+ ccp_wantoptions[0].bsd_compress = 0;
ccp_allowoptions[0].bsd_compress = 0;
}