xref: /titanic_44/usr/src/cmd/ssh/include/altprivsep.h (revision 55553f719b521a0bb4deab6efc944cd30c1a56aa)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  *
22  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 #ifndef	_ALTPRIVSEP_H
27 #define	_ALTPRIVSEP_H
28 
29 #pragma ident	"%Z%%M%	%I%	%E% SMI"
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
35 #include <sys/types.h>
36 #include "auth.h"
37 #include "kex.h"
38 
39 #define	APS_MSG_NEWKEYS_REQ	0
40 #define	APS_MSG_NEWKEYS_REP	1
41 #define	APS_MSG_RECORD_LOGIN	2
42 #define	APS_MSG_RECORD_LOGOUT	3
43 
44 pid_t	altprivsep_start_monitor(Authctxt *authctxt);
45 
46 void	altprivsep_do_monitor(Authctxt *authctxt, pid_t child_pid);
47 int	altprivsep_get_pipe_fd(void);
48 int	altprivsep_is_monitor(void);
49 int	altprivsep_started(void);
50 
51 /* child-side handler of re-key packets */
52 void	altprivsep_rekey(int type, u_int32_t seq, void *ctxt);
53 
54 /* monitor-side fatal_cleanup callbacks */
55 void	altprivsep_shutdown_sock(void *arg);
56 
57 /* Calls _to_ monitor from unprivileged process */
58 void	altprivsep_process_input(Kex *kex, fd_set *rset);
59 void	altprivsep_get_newkeys(enum kex_modes mode);
60 void	altprivsep_record_login(pid_t pid, const char *ttyname);
61 void	altprivsep_record_logout(pid_t pid);
62 
63 /* Functions for use in the monitor */
64 void	aps_input_altpriv_msg(int type, u_int32_t seq, void *ctxt);
65 
66 #ifdef __cplusplus
67 }
68 #endif
69 
70 #endif /* _ALTPRIVSEP_H */
71