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 5*6375Sjp161948 * Common Development and Distribution License (the "License"). 6*6375Sjp161948 * 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 * 21*6375Sjp161948 * 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 #pragma ident "%Z%%M% %I% %E% SMI" 290Sstevel@tonic-gate 300Sstevel@tonic-gate #ifdef __cplusplus 310Sstevel@tonic-gate extern "C" { 320Sstevel@tonic-gate #endif 330Sstevel@tonic-gate 340Sstevel@tonic-gate #include <sys/types.h> 350Sstevel@tonic-gate #include "auth.h" 360Sstevel@tonic-gate #include "kex.h" 370Sstevel@tonic-gate 380Sstevel@tonic-gate #define APS_MSG_NEWKEYS_REQ 0 390Sstevel@tonic-gate #define APS_MSG_NEWKEYS_REP 1 400Sstevel@tonic-gate #define APS_MSG_RECORD_LOGIN 2 410Sstevel@tonic-gate #define APS_MSG_RECORD_LOGOUT 3 42*6375Sjp161948 #define APS_MSG_START_REKEX 4 430Sstevel@tonic-gate 440Sstevel@tonic-gate pid_t altprivsep_start_monitor(Authctxt *authctxt); 450Sstevel@tonic-gate 460Sstevel@tonic-gate void altprivsep_do_monitor(Authctxt *authctxt, pid_t child_pid); 470Sstevel@tonic-gate int altprivsep_get_pipe_fd(void); 480Sstevel@tonic-gate int altprivsep_is_monitor(void); 490Sstevel@tonic-gate int altprivsep_started(void); 500Sstevel@tonic-gate 510Sstevel@tonic-gate /* child-side handler of re-key packets */ 520Sstevel@tonic-gate void altprivsep_rekey(int type, u_int32_t seq, void *ctxt); 530Sstevel@tonic-gate 540Sstevel@tonic-gate /* monitor-side fatal_cleanup callbacks */ 550Sstevel@tonic-gate void altprivsep_shutdown_sock(void *arg); 560Sstevel@tonic-gate 570Sstevel@tonic-gate /* Calls _to_ monitor from unprivileged process */ 58*6375Sjp161948 void altprivsep_process_input(fd_set *rset); 590Sstevel@tonic-gate void altprivsep_get_newkeys(enum kex_modes mode); 600Sstevel@tonic-gate void altprivsep_record_login(pid_t pid, const char *ttyname); 610Sstevel@tonic-gate void altprivsep_record_logout(pid_t pid); 62*6375Sjp161948 void altprivsep_start_rekex(void); 630Sstevel@tonic-gate 640Sstevel@tonic-gate /* Functions for use in the monitor */ 650Sstevel@tonic-gate void aps_input_altpriv_msg(int type, u_int32_t seq, void *ctxt); 660Sstevel@tonic-gate 670Sstevel@tonic-gate #ifdef __cplusplus 680Sstevel@tonic-gate } 690Sstevel@tonic-gate #endif 700Sstevel@tonic-gate 710Sstevel@tonic-gate #endif /* _ALTPRIVSEP_H */ 72