xref: /onnv-gate/usr/src/cmd/ssh/include/altprivsep.h (revision 7574:e19e13b485fa)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
56375Sjp161948  * Common Development and Distribution License (the "License").
66375Sjp161948  * You may not use this file except in compliance with the License.
70Sstevel@tonic-gate  *
80Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate  * See the License for the specific language governing permissions
110Sstevel@tonic-gate  * and limitations under the License.
120Sstevel@tonic-gate  *
130Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate  *
190Sstevel@tonic-gate  * CDDL HEADER END
200Sstevel@tonic-gate  *
216375Sjp161948  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
220Sstevel@tonic-gate  * Use is subject to license terms.
230Sstevel@tonic-gate  */
240Sstevel@tonic-gate 
250Sstevel@tonic-gate #ifndef	_ALTPRIVSEP_H
260Sstevel@tonic-gate #define	_ALTPRIVSEP_H
270Sstevel@tonic-gate 
280Sstevel@tonic-gate #ifdef __cplusplus
290Sstevel@tonic-gate extern "C" {
300Sstevel@tonic-gate #endif
310Sstevel@tonic-gate 
320Sstevel@tonic-gate #include <sys/types.h>
330Sstevel@tonic-gate #include "auth.h"
340Sstevel@tonic-gate #include "kex.h"
350Sstevel@tonic-gate 
360Sstevel@tonic-gate #define	APS_MSG_NEWKEYS_REQ	0
370Sstevel@tonic-gate #define	APS_MSG_NEWKEYS_REP	1
380Sstevel@tonic-gate #define	APS_MSG_RECORD_LOGIN	2
390Sstevel@tonic-gate #define	APS_MSG_RECORD_LOGOUT	3
406375Sjp161948 #define	APS_MSG_START_REKEX	4
41*7574SJan.Pechanec@Sun.COM #define	APS_MSG_AUTH_CONTEXT	5
420Sstevel@tonic-gate 
43*7574SJan.Pechanec@Sun.COM void	altprivsep_start_and_do_monitor(int use_engine, int inetd, int newsock,
44*7574SJan.Pechanec@Sun.COM 		int statup_pipe);
450Sstevel@tonic-gate int	altprivsep_get_pipe_fd(void);
460Sstevel@tonic-gate 
470Sstevel@tonic-gate /* child-side handler of re-key packets */
480Sstevel@tonic-gate void	altprivsep_rekey(int type, u_int32_t seq, void *ctxt);
490Sstevel@tonic-gate 
500Sstevel@tonic-gate /* Calls _to_ monitor from unprivileged process */
516375Sjp161948 void	altprivsep_process_input(fd_set *rset);
520Sstevel@tonic-gate void	altprivsep_record_login(pid_t pid, const char *ttyname);
530Sstevel@tonic-gate void	altprivsep_record_logout(pid_t pid);
546375Sjp161948 void	altprivsep_start_rekex(void);
55*7574SJan.Pechanec@Sun.COM void	altprivsep_send_auth_context(Authctxt *authctxt);
560Sstevel@tonic-gate 
570Sstevel@tonic-gate /* Functions for use in the monitor */
580Sstevel@tonic-gate void	aps_input_altpriv_msg(int type, u_int32_t seq, void *ctxt);
590Sstevel@tonic-gate 
600Sstevel@tonic-gate #ifdef __cplusplus
610Sstevel@tonic-gate }
620Sstevel@tonic-gate #endif
630Sstevel@tonic-gate 
640Sstevel@tonic-gate #endif /* _ALTPRIVSEP_H */
65