libssh 0.4.8
|
00001 /* 00002 * This file is part of the SSH Library 00003 * 00004 * Copyright (c) 2003-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 _SCP_H 00023 #define _SCP_H 00024 00025 enum ssh_scp_states { 00026 SSH_SCP_NEW, //Data structure just created 00027 SSH_SCP_WRITE_INITED, //Gave our intention to write 00028 SSH_SCP_WRITE_WRITING,//File was opened and currently writing 00029 SSH_SCP_READ_INITED, //Gave our intention to read 00030 SSH_SCP_READ_REQUESTED, //We got a read request 00031 SSH_SCP_READ_READING, //File is opened and reading 00032 SSH_SCP_ERROR, //Something bad happened 00033 SSH_SCP_TERMINATED //Transfer finished 00034 }; 00035 00036 struct ssh_scp_struct { 00037 ssh_session session; 00038 int mode; 00039 int recursive; 00040 ssh_channel channel; 00041 char *location; 00042 enum ssh_scp_states state; 00043 size_t filelen; 00044 size_t processed; 00045 enum ssh_scp_request_types request_type; 00046 char *request_name; 00047 char *warning; 00048 int request_mode; 00049 }; 00050 00051 int ssh_scp_read_string(ssh_scp scp, char *buffer, size_t len); 00052 int ssh_scp_integer_mode(const char *mode); 00053 char *ssh_scp_string_mode(int mode); 00054 int ssh_scp_response(ssh_scp scp, char **response); 00055 00056 #endif