libssh 0.4.8

include/libssh/messages.h

00001 /*
00002  * This file is part of the SSH Library
00003  *
00004  * Copyright (c) 2009 by Aris Adamantiadis
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 
00022 #ifndef MESSAGES_H_
00023 #define MESSAGES_H_
00024 
00025 #include "config.h"
00026 
00027 struct ssh_auth_request {
00028     char *username;
00029     int method;
00030     char *password;
00031     struct ssh_public_key_struct *public_key;
00032     char signature_state;
00033 };
00034 
00035 struct ssh_channel_request_open {
00036     int type;
00037     uint32_t sender;
00038     uint32_t window;
00039     uint32_t packet_size;
00040     char *originator;
00041     uint16_t originator_port;
00042     char *destination;
00043     uint16_t destination_port;
00044 };
00045 
00046 struct ssh_service_request {
00047     char *service;
00048 };
00049 
00050 struct ssh_channel_request {
00051     int type;
00052     ssh_channel channel;
00053     uint8_t want_reply;
00054     /* pty-req type specifics */
00055     char *TERM;
00056     uint32_t width;
00057     uint32_t height;
00058     uint32_t pxwidth;
00059     uint32_t pxheight;
00060     ssh_string modes;
00061 
00062     /* env type request */
00063     char *var_name;
00064     char *var_value;
00065     /* exec type request */
00066     char *command;
00067     /* subsystem */
00068     char *subsystem;
00069 };
00070 
00071 struct ssh_message_struct {
00072     ssh_session session;
00073     int type;
00074     struct ssh_auth_request auth_request;
00075     struct ssh_channel_request_open channel_request_open;
00076     struct ssh_channel_request channel_request;
00077     struct ssh_service_request service_request;
00078 };
00079 
00080 
00081 void message_handle(ssh_session session, uint32_t type);
00082 int ssh_execute_message_callbacks(ssh_session session);
00083 
00084 #endif /* MESSAGES_H_ */