1 /* C K U P T Y . H -- Includes and definitions for ckupty.c */
4 Copyright 1995 by the Massachusetts Institute of Technology.
6 Modified for use in C-Kermit by:
8 Jeffrey E Altman <jaltman@secure-endpoints.com>
9 Secure Endpoints Inc., New York City
13 #include <sys/types.h>
15 /* #define WANT_UTMP */
16 /* We don't want all the utmp/wtmp stuff */
21 #endif /* HAVE_UTMP_H */
24 #endif /* HAVE_UTMPX_H */
25 #endif /* WANT_UTMP */
29 #endif /* HAVE_UNISTD_H */
31 #include <sys/unistd.h>
35 #endif /* HAVE_STDLIB_H */
41 #include <sys/ioctl.h>
47 #include <netinet/in.h>
51 #ifdef HAVE_SYS_LABEL_H
53 #include <sys/label.h>
54 #include <sys/audit.h>
56 #endif /* HAVE_SYS_LABEL_H */
61 #include <sys/ptyio.h>
68 /* I don't think we actually use this for anything */
69 /* and it kills Slackware builds, where there is no select.h. */
70 #ifndef NO_SYS_SELECT_H
71 #ifdef HAVE_SYS_SELECT_H
72 #include <sys/select.h>
73 #endif /* HAVE_SYS_SELECT_H */
74 #endif /* NO_SYS_SELECT_H */
78 #include <sys/stream.h>
79 #include <sys/stropts.h>
80 #endif /* HAVE_STREAMS */
88 #else /* POSIX_TERMIOS */
90 #endif /* POSIX_TERMIOS */
93 /* #include <syslog.h> */
97 /* #include <sys/param.h> */ /* (now done in ckcdeb.h) */
100 /* krlogin doesn't test sys/tty... */
101 #ifdef HAVE_SYS_TTY_H
103 #endif /* HAVE_SYS_TTY_H */
105 #ifdef HAVE_SYS_PTYVAR_H
106 /* Solaris actually uses packet mode, so the real macros are needed too */
107 #include <sys/ptyvar.h>
108 #endif /* HAVE_SYS_PTYVAR_H */
109 #endif /* HAVE_STREAMS */
112 /* This block moved to ckcdeb.h */
114 /* For NetBSD, see makefile */
121 #endif /* MACOSX10 */
122 #endif /* __FreeBSD__ */
123 #endif /* HAVE_OPENPTY */
124 #endif /* NO_OPENPTY */
128 #ifndef OPEN_CTTY_ONLY_ONCE
130 Breaks under Ultrix and others where you cannot get controlling
135 #endif /* OPEN_CTTY_ONLY_ONCE */
136 #endif /* HAVE_VHANGUP */
138 /* Internal functions */
139 _PROTOTYP(long ptyint_void_association,(void));
140 _PROTOTYP(long ptyint_open_ctty ,(char *, int *));
141 _PROTOTYP(VOID ptyint_vhangup, (void));
144 _PROTOTYP(long ptyint_update_wtmp, (struct utmp *, char *, char *));
145 #endif /* WANT_UTMP */
147 #define __PTY_INT_H__
148 #endif /* __PTY_INT_H__ */
153 /* Constants for pty_update_utmp */
154 #define PTY_LOGIN_PROCESS 0
155 #define PTY_USER_PROCESS 1
156 #define PTY_DEAD_PROCESS 2
157 #define PTY_TTYSLOT_USABLE (0x1) /* flags to update_utmp*/
158 #define PTY_UTMP_USERNAME_VALID (0x2)
159 #endif /* WANT_UTMP */
161 _PROTOTYP(long pty_init,(void));
162 _PROTOTYP(long pty_getpty, ( int *, char *, int));
163 _PROTOTYP(long pty_open_slave, (char *, int *, int));
164 _PROTOTYP(long pty_open_ctty, (char *, int *, int));
165 _PROTOTYP(long pty_initialize_slave, (int));
167 _PROTOTYP(long pty_update_utmp, (int, int, char *, char *, char *, int));
168 _PROTOTYP(long pty_logwtmp, (char *, char *, char *));
169 #endif /* WANT_UTMP */
170 _PROTOTYP(long pty_cleanup, (char *, int, int));
172 #define PTY_GETPTY_STREAMS (44806912L)
173 #define PTY_GETPTY_FSTAT (44806913L)
174 #define PTY_GETPTY_NOPTY (44806914L)
175 #define PTY_GETPTY_SLAVE_TOOLONG (44806915L)
176 #define PTY_OPEN_SLAVE_OPENFAIL (44806916L)
177 #define PTY_OPEN_SLAVE_CHMODFAIL (44806917L)
178 #define PTY_OPEN_SLAVE_NOCTTY (44806918L)
179 #define PTY_OPEN_SLAVE_CHOWNFAIL (44806919L)
180 #define PTY_OPEN_SLAVE_LINE_PUSHFAIL (44806920L)
181 #define PTY_OPEN_SLAVE_PUSH_FAIL (44806921L)
182 #define PTY_OPEN_SLAVE_REVOKEFAIL (44806922L)
184 #define PTY_UPDATE_UTMP_PROCTYPE_INVALID (44806923L)
185 #endif /* WANT_UTMP */
186 #define PTY_OPEN_SLAVE_TOOSHORT (44806924L)
187 #define ERROR_TABLE_BASE_pty (44806912L)
189 extern struct error_table et_pty_error_table;
192 #endif /* __LIBPTY_H__ */