session.h revision 98675
151078Speter/* $OpenBSD: session.h,v 1.17 2002/03/29 18:59:32 markus Exp $ */ 251078Speter 351078Speter/* 451078Speter * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved. 551078Speter * 651078Speter * Redistribution and use in source and binary forms, with or without 751078Speter * modification, are permitted provided that the following conditions 851078Speter * are met: 951078Speter * 1. Redistributions of source code must retain the above copyright 1051078Speter * notice, this list of conditions and the following disclaimer. 1151078Speter * 2. Redistributions in binary form must reproduce the above copyright 1251078Speter * notice, this list of conditions and the following disclaimer in the 1351078Speter * documentation and/or other materials provided with the distribution. 1451078Speter * 1551078Speter * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 1651078Speter * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 1751078Speter * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 1851078Speter * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 1951078Speter * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 2051078Speter * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 2151078Speter * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 2251078Speter * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 2351078Speter * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 2451078Speter * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 2551078Speter */ 2651078Speter#ifndef SESSION_H 2751078Speter#define SESSION_H 2851078Speter 2951078Speter#define TTYSZ 64 3051078Spetertypedef struct Session Session; 3151078Speterstruct Session { 3251078Speter int used; 3351078Speter int self; 3451078Speter struct passwd *pw; 3551078Speter Authctxt *authctxt; 3651078Speter pid_t pid; 3751078Speter /* tty */ 3851078Speter char *term; 3951078Speter int ptyfd, ttyfd, ptymaster; 4051078Speter int row, col, xpixel, ypixel; 4151078Speter char tty[TTYSZ]; 4254386Simp /* last login */ 4358885Simp char hostname[MAXHOSTNAMELEN]; 4451078Speter time_t last_login_time; 4551078Speter /* X11 */ 4651078Speter int display_number; 4751078Speter char *display; 4851078Speter int screen; 4951078Speter char *auth_display; 5051078Speter char *auth_proto; 5151078Speter char *auth_data; 5251078Speter int single_connection; 5351078Speter /* proto 2 */ 5451078Speter int chanid; 5576166Smarkm int is_subsystem; 5665822Sjhb}; 5776166Smarkm 5851078Spetervoid do_authenticated(Authctxt *); 5951078Speter 6051078Speterint session_open(Authctxt*, int); 6151078Speterint session_input_channel_req(Channel *, const char *); 6251078Spetervoid session_close_by_pid(pid_t, int); 6376166Smarkmvoid session_close_by_channel(int, void *); 6476166Smarkmvoid session_destroy_all(void (*)(Session *)); 6576166Smarkmvoid session_pty_cleanup2(void *); 6676166Smarkm 6776166SmarkmSession *session_new(void); 6876166SmarkmSession *session_by_tty(char *); 6976166Smarkmvoid session_close(Session *); 7051078Spetervoid do_setusercontext(struct passwd *); 7176166Smarkm#endif 7260471Snyan