home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1999 March B
/
SCO_CASTOR4RRT.iso
/
nsu
/
root
/
usr
/
include
/
dial.h
/
dial
Wrap
Text File
|
1998-08-19
|
6KB
|
172 lines
/*
* Copyright (c) 1998 The Santa Cruz Operation, Inc.. All Rights Reserved.
*
* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF THE
* SANTA CRUZ OPERATION INC.
*
* The copyright notice above does not evidence any actual or intended
* publication of such source code.
*/
/* copyright "%c%" */
#ident "@(#)dial.h 1.10"
#ifndef _DIAL_H
#define _DIAL_H
#ifdef __cplusplus
extern "C" {
#endif
#include <sys/termios.h> /* SVR4COMPAT */
/* uucico routines need these */
/*#define DIAL */
/* The following are no longer used by dial() and may be out of date. */
/* They are included here only to maintain source compatibility. */
#define STANDALONE
#define DEVDIR "/dev/" /* device path */
#define LOCK "/var/spool/uucp/LCK.." /* lock file semaphore */
#define DVC_LEN 80 /* max NO of chars in TTY-device path name */
/* End of unused definitions */
/* error mnemonics */
#define TRUE 1
#define FALSE 0
#define INTRPT (-1) /* interrupt occured */
#define D_HUNG (-2) /* dialer hung (no return from write) */
#define NO_ANS (-3) /* no answer (caller script failed) */
#define ILL_BD (-4) /* illegal baud-rate */
#define A_PROB (-5) /* acu problem (open() failure) */
#define L_PROB (-6) /* line problem (open() failure) */
#define NO_Ldv (-7) /* can't open Devices file */
#define DV_NT_A (-8) /* requested device not available */
#define DV_NT_K (-9) /* requested device not known */
#define NO_BD_A (-10) /* no device available at requested baud */
#define NO_BD_K (-11) /* no device known at requested baud */
#define DV_NT_E (-12) /* requested speed does not match */
#define BAD_SYS (-13) /* system not in Systems file */
#define CS_PROB (-14) /* connection server related error */
#define DV_W_TM (-15) /* wrong time to call */
/* dialer return codes */
#define D_DIALER_ERR (-16) /* dialer error */
#define D_LINE_IN_USE (-17) /* phone line is in use */
#define D_ABORTED (-18) /* dialer aborted */
#define D_BAD_ARGS (-19) /* bad arguments passed to the dialer */
#define D_BAD_PHONE_NUM (-20) /* bad phone number given to the dialer */
#define D_BAD_BAUD_RATE (-21) /* bad baud rate */
#define D_CANT_OPEN_LINE (-22) /* dialer cannot open device */
#define D_IOCTL_ERR (-23) /* dialer got bad ioctl call */
#define D_TIMED_OUT (-24) /* dialer timed out */
#define D_NO_DIAL_TONE (-25) /* no dial tone found */
#define D_PHONE_BUSY (-26) /* phone line is busy */
#define D_NO_CARRIER (-27) /* carrier not detected */
#define D_NO_ANSWER (-28) /* remote system did not answer */
#define D_UNKNOWN (-99) /* unknown dialer error occured */
typedef struct{
int version; /* for future modifications to structure format */
char *service; /* name of service to use(default = "cu") */
#ifndef __cplusplus
char *class; /* "class" of device to use */
#else
char *dev_class; /* "class" of device to use */
#endif
char *protocol; /* returns the protocol string for the connection made */
char *reserved1; /* reserved for future expansion */
} CALL_EXT;
typedef struct {
struct termio *attr; /* ptr to termio attribute struct */
int baud; /* unused */
int speed; /* 212A modem: low=300, high=1200 */
char *line; /* device name for out-going line */
char *telno; /* ptr to tel-no/system name string */
int modem; /* unused */
char *device; /* pointer to a CALL_EXT structure */
/* this was unused previously */
int dev_len; /* unused */
} CALL;
/* bit fields for line function */
#define FUNC_NULL 0x00 /* default function only */
#define FUNC_CHAT 0x80 /* want to run chat scripts */
#define FUNC_TX 0x40 /* want to perform file transfers */
#define FUNC_INBOUND 0x20 /* want to perform inbound setup */
/* standard masks for cu, uucico and ct services */
#define F_UUCICO FUNC_CHAT|FUNC_TX
#define F_CU FUNC_NULL
#define F_CT FUNC_NULL
struct calls_s {
long flags; /* for future use */
struct termios *attr; /* ptr to termios attribute struct */
int speed; /* eg 9600 */
char *device_name; /* device name for out-going line */
char *telno; /* ptr to tel-no string */
char *caller_telno; /* ptr to tel-no string of caller */
char *sysname; /* ptr to system name */
unsigned short function; /* bit field for FUNC_ masks */
char *class; /* class field in Devices file */
char *protocol; /* protocol string for the connection made */
int pinfo_len; /* size of pinfo structure (in bytes) */
void *pinfo; /* ptr to pinfo structure */
};
typedef struct calls_s calls_t;
typedef enum dial_service {
DIAL_NULL, /* service not defined */
DIAL_ACU, /* data over modem */
DIAL_ISDN_SYNC, /* synchronous isdn */
DIAL_ISDN_ASYNC,/* asynchronous isdn */
DIAL_TCP, /* tcp */
DIAL_DIRECT, /* direct serial line, dedicated line */
DIAL_ACU_FAX, /* fax over modem */
DIAL_ISDN_FAX, /* fax over isdn */
DIAL_ISDN_VOICE, /* voice over isdn */
DIAL_ISDN_VIDEO /* video over isdn */
} dial_service_t;
typedef struct {
int status_code; /* dialer status, error mnemonics as above */
dial_service_t dial_service; /* dialer service got */
} dial_status_t;
typedef struct {
char *caller_id; /* caller ID */
dial_service_t type; /* incoming service requested */
int speed; /* eg 9600 */
char *device_name; /* device name for out-going line */
int pinfo_len; /* size of protocol specific data */
void *pinfo; /* pointer to protocol specific data */
} service_info_t;
#if defined(__STDC__)
extern int dial(CALL);
extern int dials(calls_t *i_call, calls_t **r_call, dial_status_t *dstatus);
extern void undial(int);
extern void undials(int fd, calls_t *r_call);
#else
extern int dial();
extern int dials();
extern void undial();
extern void undials();
#endif
#ifdef __cplusplus
}
#endif
#endif /* _DIAL_H */