1
0
Files
irix-657m-src/eoe/cmd/cu/altconn.c
2022-09-29 17:59:04 +03:00

93 lines
2.0 KiB
C

/* Copyright (c) 1984 AT&T */
/* All Rights Reserved */
/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T */
/* The copyright notice above does not evidence any */
/* actual or intended publication of such source code. */
#ident "$Revision: 1.7 $"
#include "uucp.h"
#ifdef sgi
extern int Modemctrl;
extern int getto(char *[]);
#else
static getto();
#endif
struct call { /* cu calling info-also in cu.c; */
/* make changes in both places!*/
char *speed; /* transmission baud rate */
char *line; /* device name for outgoing line */
char *telno; /* ptr to tel-no digit string */
char *class; /* class of call */
};
/*
* altconn - place a telephone call to system
* from cu when telephone number or direct line used
*
* return codes:
* FAIL - connection failed
* >0 - file no. - connect ok
* When a failure occurs, Uerror is set.
*/
altconn(call)
struct call *call;
{
int fn = FAIL;
char *alt[7];
extern char *Myline;
alt[F_NAME] = "dummy"; /* to replace the Systems file fields */
alt[F_TIME] = "Any"; /* needed for getto(); [F_TYPE] and */
alt[F_TYPE] = ""; /* [F_PHONE] assignment below */
alt[F_CLASS] = call->speed;
alt[F_PHONE] = "";
alt[F_LOGIN] = "";
alt[6] = NULL;
CDEBUG(4,"altconn called\r\n","");
/* cu -l dev ... */
/* if is "/dev/device", strip off "/dev/" because must */
/* exactly match entries in Devices file, which usually */
/* omit the "/dev/". if doesn't begin with "/dev/", */
/* either they've omitted the "/dev/" or it's a non- */
/* standard path name. in either case, leave it as is */
if(call->line != NULL ) {
if ( strncmp(call->line, "/dev/", 5) == 0 ) {
Myline = (call->line + 5);
} else {
Myline = call->line;
}
}
/* cu ... telno */
if(call->telno != NULL) {
alt[F_PHONE] = call->telno;
alt[F_TYPE] = "ACU";
}
/* cu direct line */
else {
alt[F_TYPE] = "Direct";
}
if (call->class != NULL)
alt[F_TYPE] = call->class;
#ifdef sgi
Modemctrl = TRUE; /* make the modem up */
#endif
fn = getto(alt);
CDEBUG(4, "getto ret %d\n", fn);
return(fn);
}