libssh 0.4.8

include/libssh/channels.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 CHANNELS_H_
00023 #define CHANNELS_H_
00024 #include "libssh/priv.h"
00025 
00026 struct ssh_channel_struct {
00027     struct ssh_channel_struct *prev;
00028     struct ssh_channel_struct *next;
00029     ssh_session session; /* SSH_SESSION pointer */
00030     uint32_t local_channel;
00031     uint32_t local_window;
00032     int local_eof;
00033     uint32_t local_maxpacket;
00034 
00035     uint32_t remote_channel;
00036     uint32_t remote_window;
00037     int remote_eof; /* end of file received */
00038     uint32_t remote_maxpacket;
00039     int open; /* shows if the channel is still opened */
00040     int delayed_close;
00041     ssh_buffer stdout_buffer;
00042     ssh_buffer stderr_buffer;
00043     void *userarg;
00044     int version;
00045     int blocking;
00046     int exit_status;
00047 };
00048 
00049 void channel_handle(ssh_session session, int type);
00050 ssh_channel channel_new(ssh_session session);
00051 int channel_default_bufferize(ssh_channel channel, void *data, int len,
00052         int is_stderr);
00053 uint32_t ssh_channel_new_id(ssh_session session);
00054 ssh_channel ssh_channel_from_local(ssh_session session, uint32_t id);
00055 int channel_write_common(ssh_channel channel, const void *data,
00056     uint32_t len, int is_stderr);
00057 
00058 #endif /* CHANNELS_H_ */