} backoff = *optarg == 'e'; break; case 'd': debug = TRUE; break; case 'h': mode = SLAVEMODE; break; case 'm': if (*optarg != 's' && *optarg != 'e') { fprintf(stderr, "call: invalid argument for option '-m'\n");
} port = argv[optind];  if (ax25_config_load_ports() == 0) { fprintf(stderr, "call: no AX.25 port data configured\n");
int main(int argc, char **argv){    int p;    int mode = TALKMODE;    while ((p = getopt(argc, argv, "b:dhm:p:rtvw:")) != -1) {	switch (p) {	case 'b':	    if (*optarg != 'e' && *optarg != 'l') {		fprintf(stderr, "call: invalid argument for option '-b'\n");		return 1;	    }	    backoff = *optarg == 'e';	    break;	case 'd':	    debug = TRUE;	    break;	case 'h':	    mode = SLAVEMODE;	    break;	case 'm':	    if (*optarg != 's' && *optarg != 'e') {		fprintf(stderr, "call: invalid argument for option '-m'\n");		return 1;	    }	    ax25mode = *optarg == 'e';	    break;	case 'p':	    if ((paclen = atoi(optarg)) == 0) {		fprintf(stderr, "call: option '-p' requires a numeric argument\n");		return 1;	    }	    if (paclen < 1 || paclen > 500) {		fprintf(stderr, "call: paclen must be between 1 and 500\n");		return 1;	    }	    break;	case 'r':	    mode = RAWMODE;	    break;	case 't':	    mode = TALKMODE;	    break;	case 'v':	    printf("call: %s\n", VERSION);	    return 0;	case 'w':	    if ((window = atoi(optarg)) == 0) {		fprintf(stderr, "call: option '-w' requires a numeric argument\n");		return 1;	    }	    if (ax25mode) {		if (window < 1 || window > 63) {		    fprintf(stderr, "call: window must be between 1 and 63 frames\n");		    return 1;		}	    } else {		if (window < 1 || window > 7) {		    fprintf(stderr, "call: window must be between 1 and 7 frames\n");		    return 1;		}	    }	    break;	case '?':	case ':':	    fprintf(stderr, "usage: call [-b l|e] [-d] [-h] [-m s|e] [-p paclen] [-r] [-t] [-v] [-w window] port callsign [[via] digipeaters...]\n");	    return 1;	}    }    if (optind == argc || optind == argc - 1) {	fprintf(stderr, "usage: call [-b l|e] [-d] [-h] [-m s|e] [-p paclen] [-r] [-t] [-v] [-w window] port callsign [[via] digipeaters...]\n");	return 1;    }    port = argv[optind];    if (ax25_config_load_ports() == 0) {	fprintf(stderr, "call: no AX.25 port data configured\n");	return 1;    }    if (ax25_config_get_addr(port) == NULL) {	nr_config_load_ports();	if (nr_config_get_addr(port) == NULL) {	    rs_config_load_ports();	    if (rs_config_get_addr(port) == NULL) {		fprintf(stderr, "call: invalid port setting\n");		return 1;	    } else {		af_mode = AF_ROSE;	    }	} else {	    af_mode = AF_NETROM;	}    } else {	af_mode = AF_AX25;    }    switch (af_mode) {    case AF_ROSE:	paclen = rs_config_get_paclen(port);	break;    case AF_NETROM:	if (paclen == 0)	    paclen = nr_config_get_paclen(port);	break;    case AF_AX25:	if (window == 0)	    window = ax25_config_get_window(port);	if (paclen == 0)	    paclen = ax25_config_get_paclen(port);	break;    }    printf("GW4PTS AX.25 Connect v1.11\n");    while (cmd_call(argv + optind + 1, mode)) {	printf("Wait 60 sec before reconnect\n");	sleep(60);    }    return 0;}