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 */
40 #include <sys/ioctl.h>
45 #include <netinet/in.h>
49 #ifdef HAVE_SYS_LABEL_H
51 #include <sys/label.h>
52 #include <sys/audit.h>
54 #endif /* HAVE_SYS_LABEL_H */
59 #include <sys/ptyio.h>
66 /* I don't think we actually use this for anything */
67 /* and it kills Slackware builds, where there is no select.h. */
68 #ifndef NO_SYS_SELECT_H
69 #ifdef HAVE_SYS_SELECT_H
70 #include <sys/select.h>
71 #endif /* HAVE_SYS_SELECT_H */
72 #endif /* NO_SYS_SELECT_H */
76 #include <sys/stream.h>
77 #include <sys/stropts.h>
78 #endif /* HAVE_STREAMS */
86 #else /* POSIX_TERMIOS */
88 #endif /* POSIX_TERMIOS */
91 /* #include <syslog.h> */
95 /* #include <sys/param.h> */ /* (now done in ckcdeb.h) */
98 /* krlogin doesn't test sys/tty... */
101 #endif /* HAVE_SYS_TTY_H */
103 #ifdef HAVE_SYS_PTYVAR_H
104 /* Solaris actually uses packet mode, so the real macros are needed too */
105 #include <sys/ptyvar.h>
106 #endif /* HAVE_SYS_PTYVAR_H */
107 #endif /* HAVE_STREAMS */
110 #ifndef OPEN_CTTY_ONLY_ONCE
112 Breaks under Ultrix and others where you cannot get controlling
117 #endif /* OPEN_CTTY_ONLY_ONCE */
118 #endif /* HAVE_VHANGUP */
120 /* Internal functions */
121 _PROTOTYP(long ptyint_void_association,(void));
122 _PROTOTYP(long ptyint_open_ctty ,(char *, int *));
123 _PROTOTYP(VOID ptyint_vhangup, (void));
126 _PROTOTYP(long ptyint_update_wtmp, (struct utmp *, char *, char *));
127 #endif /* WANT_UTMP */
129 #define __PTY_INT_H__
130 #endif /* __PTY_INT_H__ */
135 /* Constants for pty_update_utmp */
136 #define PTY_LOGIN_PROCESS 0
137 #define PTY_USER_PROCESS 1
138 #define PTY_DEAD_PROCESS 2
139 #define PTY_TTYSLOT_USABLE (0x1) /* flags to update_utmp*/
140 #define PTY_UTMP_USERNAME_VALID (0x2)
141 #endif /* WANT_UTMP */
143 _PROTOTYP(long pty_init,(void));
144 _PROTOTYP(long pty_getpty, ( int *, char *, int));
145 _PROTOTYP(long pty_open_slave, (char *, int *));
146 _PROTOTYP(long pty_open_ctty, (char *, int *));
147 _PROTOTYP(long pty_initialize_slave, (int));
149 _PROTOTYP(long pty_update_utmp, (int, int, char *, char *, char *, int));
150 _PROTOTYP(long pty_logwtmp, (char *, char *, char *));
151 #endif /* WANT_UTMP */
152 _PROTOTYP(long pty_cleanup, (char *, int, int));
154 #define PTY_GETPTY_STREAMS (44806912L)
155 #define PTY_GETPTY_FSTAT (44806913L)
156 #define PTY_GETPTY_NOPTY (44806914L)
157 #define PTY_GETPTY_SLAVE_TOOLONG (44806915L)
158 #define PTY_OPEN_SLAVE_OPENFAIL (44806916L)
159 #define PTY_OPEN_SLAVE_CHMODFAIL (44806917L)
160 #define PTY_OPEN_SLAVE_NOCTTY (44806918L)
161 #define PTY_OPEN_SLAVE_CHOWNFAIL (44806919L)
162 #define PTY_OPEN_SLAVE_LINE_PUSHFAIL (44806920L)
163 #define PTY_OPEN_SLAVE_PUSH_FAIL (44806921L)
164 #define PTY_OPEN_SLAVE_REVOKEFAIL (44806922L)
166 #define PTY_UPDATE_UTMP_PROCTYPE_INVALID (44806923L)
167 #endif /* WANT_UTMP */
168 #define PTY_OPEN_SLAVE_TOOSHORT (44806924L)
169 #define ERROR_TABLE_BASE_pty (44806912L)
171 extern struct error_table et_pty_error_table;
174 #endif /* __LIBPTY_H__ */