include/libssh/server.h

00001 /*
00002 Copyright 2004 Aris Adamantiadis
00003 
00004 This file is part of the SSH Library
00005 
00006 The SSH Library is free software; you can redistribute it and/or modify
00007 it under the terms of the GNU Lesser General Public License as published by
00008 the Free Software Foundation; either version 2.1 of the License, or (at your
00009 option) any later version.
00010 
00011 The SSH Library is distributed in the hope that it will be useful, but
00012 WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
00013 or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
00014 License for more details.
00015 
00016 You should have received a copy of the GNU Lesser General Public License
00017 along with the SSH Library; see the file COPYING.  If not, write to
00018 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
00019 MA 02111-1307, USA. */
00020 
00021 #ifndef SERVER_H
00022 #define SERVER_H
00023 
00024 #include "libssh/libssh.h"
00025 #define SERVERBANNER CLIENTBANNER
00026 
00027 typedef struct ssh_bind_struct SSH_BIND;
00028 
00029 SSH_BIND *ssh_bind_new();
00030 void ssh_bind_set_options(SSH_BIND *ssh_bind, SSH_OPTIONS *options);
00031 int ssh_bind_listen(SSH_BIND *ssh_bind);
00032 void ssh_bind_set_blocking(SSH_BIND *ssh_bind,int blocking);
00033 int ssh_bind_get_fd(SSH_BIND *ssh_bind);
00034 int ssh_bind_set_toaccept(SSH_BIND *ssh_bind);
00035 SSH_SESSION *ssh_bind_accept(SSH_BIND *ssh_bind);
00036 void ssh_bind_free(SSH_BIND *ssh_bind);
00037 int ssh_accept(SSH_SESSION *session);
00038 
00039 /* messages.c */
00040 
00041 #define SSH_AUTH_REQUEST 1
00042 #define SSH_CHANNEL_REQUEST_OPEN 2
00043 #define SSH_CHANNEL_REQUEST 3
00044 
00045 #define SSH_AUTH_NONE (1<<0)
00046 #define SSH_AUTH_PASSWORD (1<<1)
00047 #define SSH_AUTH_HOSTBASED (1<<2)
00048 #define SSH_AUTH_PUBLICKEY (1<<3)
00049 #define SSH_AUTH_KEYBINT (1<<4)
00050 #define SSH_AUTH_UNKNOWN 0
00051 
00052 #define SSH_CHANNEL_SESSION 1
00053 #define SSH_CHANNEL_TCPIP 2
00054 #define SSH_CHANNEL_X11 3
00055 #define SSH_CHANNEL_UNKNOWN 4
00056 
00057 #define SSH_CHANNEL_REQUEST_PTY 1
00058 #define SSH_CHANNEL_REQUEST_EXEC 2
00059 #define SSH_CHANNEL_REQUEST_SHELL 3
00060 #define SSH_CHANNEL_REQUEST_ENV 4
00061 #define SSH_CHANNEL_REQUEST_SUBSYSTEM 5
00062 #define SSH_CHANNEL_REQUEST_WINDOW_CHANGE 6
00063 #define SSH_CHANNEL_REQUEST_UNKNOWN 7
00064 
00065 typedef struct ssh_message SSH_MESSAGE;
00066 
00067 SSH_MESSAGE *ssh_message_get(SSH_SESSION *session);
00068 int ssh_message_type(SSH_MESSAGE *msg);
00069 int ssh_message_subtype(SSH_MESSAGE *msg);
00070 int ssh_message_reply_default(SSH_MESSAGE *msg);
00071 void ssh_message_free(SSH_MESSAGE *msg);
00072 
00073 char *ssh_message_auth_user(SSH_MESSAGE *msg);
00074 char *ssh_message_auth_password(SSH_MESSAGE *msg);
00075 int ssh_message_auth_reply_success(SSH_MESSAGE *msg,int partial);
00076 void ssh_message_auth_set_methods(SSH_MESSAGE *msg, int methods);
00077 
00078 CHANNEL *ssh_message_channel_request_open_reply_accept(SSH_MESSAGE *msg);
00079 
00080 CHANNEL *ssh_message_channel_request_channel(SSH_MESSAGE *msg);
00081 // returns the TERM env variable
00082 char *ssh_message_channel_request_pty_term(SSH_MESSAGE *msg);
00083 char *ssh_message_channel_request_subsystem(SSH_MESSAGE *msg);
00084 int ssh_message_channel_request_reply_success(SSH_MESSAGE *msg);
00085 
00086 #endif

Generated on Thu Aug 16 16:17:23 2007 for libssh by  doxygen 1.5.3