2008-11-29 11:39:56 -05:00
|
|
|
#ifndef HEADER_CURL_SSH_H
|
|
|
|
#define HEADER_CURL_SSH_H
|
2006-11-02 16:56:40 -05:00
|
|
|
/***************************************************************************
|
|
|
|
* _ _ ____ _
|
|
|
|
* Project ___| | | | _ \| |
|
|
|
|
* / __| | | | |_) | |
|
|
|
|
* | (__| |_| | _ <| |___
|
|
|
|
* \___|\___/|_| \_\_____|
|
|
|
|
*
|
2009-05-09 11:32:59 -04:00
|
|
|
* Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
|
2006-11-02 16:56:40 -05:00
|
|
|
*
|
|
|
|
* This software is licensed as described in the file COPYING, which
|
|
|
|
* you should have received as part of this distribution. The terms
|
|
|
|
* are also available at http://curl.haxx.se/docs/copyright.html.
|
|
|
|
*
|
|
|
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
|
|
|
* copies of the Software, and permit persons to whom the Software is
|
|
|
|
* furnished to do so, under the terms of the COPYING file.
|
|
|
|
*
|
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
* KIND, either express or implied.
|
|
|
|
*
|
|
|
|
* $Id$
|
|
|
|
***************************************************************************/
|
|
|
|
|
|
|
|
#ifdef USE_LIBSSH2
|
2008-11-29 11:39:56 -05:00
|
|
|
|
|
|
|
#if !defined(LIBSSH2_VERSION_NUM) || (LIBSSH2_VERSION_NUM < 0x001000)
|
|
|
|
# error "SCP/SFTP protocols require libssh2 0.16 or later"
|
|
|
|
#endif
|
|
|
|
|
2009-05-09 11:32:59 -04:00
|
|
|
#if defined(LIBSSH2_VERSION_NUM) && (LIBSSH2_VERSION_NUM >= 0x010000)
|
2008-12-22 08:21:23 -05:00
|
|
|
/* libssh2_sftp_seek64() has only ever been provided by libssh2 1.0 or
|
|
|
|
later */
|
|
|
|
# define HAVE_LIBSSH2_SFTP_SEEK64 1
|
|
|
|
#else
|
2008-12-22 13:46:12 -05:00
|
|
|
# undef HAVE_LIBSSH2_SFTP_SEEK64
|
2008-12-22 08:21:23 -05:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2007-10-12 09:36:37 -04:00
|
|
|
extern const struct Curl_handler Curl_handler_scp;
|
|
|
|
extern const struct Curl_handler Curl_handler_sftp;
|
2006-11-02 16:56:40 -05:00
|
|
|
|
2006-11-24 17:14:39 -05:00
|
|
|
ssize_t Curl_scp_send(struct connectdata *conn, int sockindex,
|
2008-05-09 07:27:54 -04:00
|
|
|
const void *mem, size_t len);
|
2006-11-24 17:14:39 -05:00
|
|
|
ssize_t Curl_scp_recv(struct connectdata *conn, int sockindex,
|
|
|
|
char *mem, size_t len);
|
2006-11-02 16:56:40 -05:00
|
|
|
|
2006-11-24 17:14:39 -05:00
|
|
|
ssize_t Curl_sftp_send(struct connectdata *conn, int sockindex,
|
2008-05-09 07:27:54 -04:00
|
|
|
const void *mem, size_t len);
|
2006-11-24 17:14:39 -05:00
|
|
|
ssize_t Curl_sftp_recv(struct connectdata *conn, int sockindex,
|
|
|
|
char *mem, size_t len);
|
2008-06-20 06:43:32 -04:00
|
|
|
|
|
|
|
#define Curl_ssh_enabled(conn,prot) (conn->protocol & prot)
|
|
|
|
|
|
|
|
#else /* USE_LIBSSH2 */
|
2009-05-09 11:32:59 -04:00
|
|
|
|
2008-06-20 06:43:32 -04:00
|
|
|
#define Curl_ssh_enabled(x,y) 0
|
|
|
|
#define Curl_scp_send(a,b,c,d) 0
|
|
|
|
#define Curl_sftp_send(a,b,c,d) 0
|
|
|
|
#define Curl_scp_recv(a,b,c,d) 0
|
|
|
|
#define Curl_sftp_recv(a,b,c,d) 0
|
2007-07-10 18:26:32 -04:00
|
|
|
|
2006-11-02 16:56:40 -05:00
|
|
|
#endif /* USE_LIBSSH2 */
|
2006-11-24 17:14:39 -05:00
|
|
|
|
2008-11-29 11:39:56 -05:00
|
|
|
#endif /* HEADER_CURL_SSH_H */
|