uucp.h revision 462be471126495414a94f9fa35e16c02dc462c04
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
#ifndef _UUCP_H
#define _UUCP_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <locale.h>
#include <wchar.h>
#include <widec.h>
#include <wctype.h>
#include <ulimit.h>
#include <values.h>
#include "parms.h"
#ifdef ATTSV
#define ATTSVKILL
#define ATTSVTTY
#define UNAME
#ifdef ATTSVR4
#define ATTSVR3
#endif /*ATTSVR4*/
#endif /*ATTSV*/
#ifdef BSD4_3
#define BSD4_2
#define BSDINETD
#endif /*BSD4_3 */
#ifdef DIAL
#define EXTERN static
#define GLOBAL static
#else
#define EXTERN extern
#define GLOBAL
#endif
#ifdef BSD4_2
#define V7
#define ATTSVKILL
#endif /* BSD4_2 */
#ifdef V8
#define V7
#define ATTSVKILL
#define UNAME
#endif /* V8 */
#ifdef FASTTIMER
#endif
#include <stdio.h>
#include <ctype.h>
#include <setjmp.h>
/*
*/
#ifdef V7
#ifdef ATTSVTTY
#include <termio.h>
#else /* ATTSVTTY */
#include <sgtty.h>
#endif /* ATTSVTTY */
#ifdef BSD4_2
#include <fcntl.h>
#endif /* BSD4_2 */
#else /* !V7 */
#include <termio.h>
#include <signal.h>
#include <fcntl.h>
#endif /* V7 */
#include <utime.h>
#include <dirent.h>
#ifdef BSD4_2
#else /* !BSD4_2 */
#include <time.h>
#endif /* BSD4_2 */
#include <errno.h>
#ifdef ATTSV
#ifdef ATTSVR4
#else /* !ATTSVR4 */
#include <sys/sysmacros.h>
#endif /* ATTSVR4 */
#endif /* ATTSV */
#ifdef RT
#endif /* RT */
#include <sysexits.h>
#ifndef ATTSVR4
#define const
#endif /* ATTSVR4 */
/* what mode should user files be allowed to have upon creation? */
/* NOTE: This does not allow setuid or execute bits on transfer. */
/* what mode should public files have upon creation? */
/* what mode should log files have upon creation? */
/* what mode should C. files have upon creation? */
/* what mode should D. files have upon creation? */
/* define the value of PUBMASK, used for creating "public" directories */
/* what mode should public directories have upon creation? */
/* define the value of DIRMASK, used for creating "system" subdirectories */
/* define the last characters for ACU (used for 801/212 dialers) */
#define ACULAST "<"
/* caution - the fillowing names are also in Makefile
* any changes here have to also be made there
*
* it's a good idea to make directories .foo, since this ensures
* that they'll be ignored by processes that search subdirectories in SPOOL
*
*
*/
/* where to put the STST. files? */
/* where should logfiles be kept? */
#define CORRUPTDIR "/var/spool/uucp/.Corrupt"
/* how much of a system name can we print in a [CX]. file? */
/* MAXBASENAME - 1 (pre) - 1 ('.') - 1 (grade) - 4 (sequence number) */
#ifdef USRSPOOLLOCKS
#else /*!USRSPOOLLOCKS*/
#endif /* USRSPOOLLOCKS */
#define PERMISSIONS "/etc/uucp/Permissions"
#define SYSNAMEFILE "/etc/uucp/Sysname"
#define X_LOCKTIME 3600
#ifdef USRSPOOLLOCKS
#else /*!USRSPOOLLOCKS*/
#endif /* USRSPOOLLOCKS */
#define S_LOCKPRE "LCK.S"
/*
* Note: this should be "/usr/spool/uucppublic", not "/var/spool/uucppublic",
* because if a Permissions file entry doesn't explicitly list directories to
* which and from which files can be copied you can only copy files to and from
* PUBDIR, and most systems out there will think PUBDIR is
* "/usr/spool/uucppublic" not "/var/spool/uucppublic" (i.e., if you change
* this, other systems may be rudely surprised when they try to get things from
* or to PUBDIR).
*/
#define PUBDIR "/usr/spool/uucppublic"
#define CLEANUPLOGFILE "/var/uucp/.Admin/uucleanup"
/*
* WORKSPACE should be in the same filesystem as SPOOL so that "mv"
* between the two will work. Otherwise, the file must be copied
* and a window exists during which the file is mode 666.
*/
#define SQTIME 60
/*
* CDEBUG is for communication line debugging
* DEBUG is for program debugging
* #define SMALL to compile without the DEBUG code
*/
#ifndef DIAL
#else
#define CDEBUG(l, f, s)
#define SMALL
#endif
#ifndef SMALL
#else
#define DEBUG(l, f, s)
#endif /* SMALL */
/*
* VERBOSE is used by cu and ct to inform the user of progress
* In other programs, the Value of Verbose is always 0.
*/
#define SAME 0
#define ANYREAD 04
#define ANYWRITE 02
#define FAIL -1
#define SUCCESS 0
#define NULLCHAR '\0'
#define CNULL ((void *) 0)
#define MASTER 1
#define SLAVE 0
#define MAXFULLNAME BUFSIZ
#define CONNECTTIME 30
#define EXPECTTIME 45
#define MSGTIME 60
#define EOTMSG "\004\n\004\n"
#define CALLBACK 1
/* manifests for sysfiles.c's sysaccess() */
/* check file access for REAL user id */
#define ACCESS_SYSTEMS 1
#define ACCESS_DEVICES 2
#define ACCESS_DIALERS 3
/* check file access for EFFECTIVE user id */
#define EACCESS_SYSTEMS 4
#define EACCESS_DEVICES 5
#define EACCESS_DIALERS 6
/* manifest for chkpth flag */
#define CK_READ 0
#define CK_WRITE 1
/*
* commands
*/
#define MAIL "mail"
/* system status stuff */
#define SS_OK 0
#define SS_NO_DEVICE 1
#define SS_TIME_WRONG 2
#define SS_INPROGRESS 3
#define SS_CONVERSATION 4
#define SS_SEQBAD 5
#define SS_LOGIN_FAILED 6
#define SS_DIAL_FAILED 7
#define SS_BAD_LOG_MCH 8
#define SS_LOCKED_DEVICE 9
#define SS_ASSERT_ERROR 10
#define SS_BADSYSTEM 11
#define SS_CANT_ACCESS_DEVICE 12
#define SS_WRONG_MCH 14
#define SS_CALLBACK 15
#define SS_RLOCKED 16
#define SS_RUNKNOWN 17
#define SS_RLOGIN 18
#define SS_UNKNOWN_RESPONSE 19
#define SS_STARTUP 20
#define SS_CHAT_FAILED 21
#define SS_CALLBACK_LOOP 22
#define TRUE 1
#define FALSE 0
#define NAMEBUF 32
struct call {
char *speed; /* transmission baud rate */
char *line; /* device name for outgoing line */
char *telno; /* ptr to tel-no digit string */
char *type; /* type of device to use for call. */
};
/* structure of an Systems file line */
#define F_NAME 0
#define F_TIME 1
#define F_TYPE 2
#define F_PHONE 4
#define F_LOGIN 5
/* structure of an Devices file line */
#define D_TYPE 0
#define D_LINE 1
#define D_CALLDEV 2
#define D_CLASS 3
#define D_CALLER 4
#define D_ARG 5
#define D_ACU 1
#define D_DIRECT 2
#define D_PROT 4
/* past here, local changes are not recommended */
#define CMDPRE 'C'
#define DATAPRE 'D'
#define XQTPRE 'X'
/*
* stuff for command execution
*/
#define X_RQDFILE 'F'
#define X_STDIN 'I'
#define X_STDOUT 'O'
#define X_STDERR 'E'
#define X_CMD 'C'
#define X_USER 'U'
#define X_BRINGBACK 'B'
#define X_MAILF 'M'
#define X_RETADDR 'R'
#define X_COMMENT '#'
#define X_NONZERO 'Z'
#define X_SENDNOTHING 'N'
#define X_SENDZERO 'n'
#define X_JOBID 'J'
/* This structure describes call routines */
struct caller {
char *CA_type;
int (*CA_caller)();
};
/* structure for a saved C file */
struct cs_struct {
char grade;
long jsize;
};
/* This structure describes dialing routines */
struct dialer {
char *DI_type;
int (*DI_dialer)();
};
struct nstat {
int t_ndial; /* # of dials */
int t_nlogs; /* # of login trys */
};
/* This structure describes the values from Limits file */
struct limits {
int totalmax; /* overall limit */
int sitemax; /* limit per site */
};
/* external declarations */
#if defined(__STDC__)
#else
#endif
#define UTEXT(x) UerrorText[x]
/* things get kind of tricky beyond this point -- please stay out */
#ifdef ATTSV
#else /*!ATTSV*/
#endif /*ATTSV*/
#ifdef BSD4_2
extern void bcopy();
#else
#ifndef ATTSVR4
extern char *memcpy();
#endif
#endif
/* uucp functions and subroutine */
extern char *_uu_setlocale(); /* getargs.c */
extern void _uu_resetlocale(); /* getargs.c */
extern char *next_token(); /* permission.c */
extern char *nextarg(); /* permission.c */
extern int getuline(); /* permission.c */
extern void commandlog(); /* logent.c */
extern unsigned long getfilesize(); /* statlog.c */
extern void putfilesize(); /* statlog.c */
extern int noSpool(); /* permission.c */
extern void myName(); /* permission.c */
extern void uucpname(); /* uucpname.c */
#ifdef ATTSV
void setbuf();
#else /* !ATTSV */
char *mktemp();
#endif /*ATTSV*/
#ifdef UNAME
#endif /* UNAME */
#ifndef NOUSTAT
#ifdef V7USTAT
struct ustat {
};
#else /* !NOUSTAT && !V7USTAT */
#ifdef STATFS
#else
#include <ustat.h>
#endif /* STATFS */
#endif /* V7USTAT */
#endif /* NOUSTAT */
#ifdef BSD4_2
int gethostname();
#endif /* BSD4_2 */
/* messages */
EXTERN char *Ct_ALLOCATE;
EXTERN char *Ct_CORRUPT;
#ifdef __cplusplus
}
#endif
#endif /* _UUCP_H */