Building the libssh2 and including a script to build it as UB
authorRobert Sesek <rsesek@bluestatic.org>
Tue, 26 Feb 2008 04:00:08 +0000 (23:00 -0500)
committerRobert Sesek <rsesek@bluestatic.org>
Tue, 26 Feb 2008 04:00:08 +0000 (23:00 -0500)
65 files changed:
Vendor/build-libssh2.sh [new file with mode: 0755]
Vendor/libssh2-0.18.tar.gz [new file with mode: 0644]
libssh2/include/libssh2.h [new file with mode: 0644]
libssh2/include/libssh2_publickey.h [new file with mode: 0644]
libssh2/include/libssh2_sftp.h [new file with mode: 0644]
libssh2/lib/libssh2.a [new file with mode: 0644]
libssh2/lib/libssh2.la [new file with mode: 0755]
libssh2/share/man/man3/libssh2_banner_set.3 [new file with mode: 0644]
libssh2/share/man/man3/libssh2_channel_close.3 [new file with mode: 0644]
libssh2/share/man/man3/libssh2_channel_direct_tcpip_ex.3 [new file with mode: 0644]
libssh2/share/man/man3/libssh2_channel_eof.3 [new file with mode: 0644]
libssh2/share/man/man3/libssh2_channel_flush_ex.3 [new file with mode: 0644]
libssh2/share/man/man3/libssh2_channel_forward_accept.3 [new file with mode: 0644]
libssh2/share/man/man3/libssh2_channel_forward_cancel.3 [new file with mode: 0644]
libssh2/share/man/man3/libssh2_channel_forward_listen_ex.3 [new file with mode: 0644]
libssh2/share/man/man3/libssh2_channel_free.3 [new file with mode: 0644]
libssh2/share/man/man3/libssh2_channel_get_exit_status.3 [new file with mode: 0644]
libssh2/share/man/man3/libssh2_channel_handle_extended_data.3 [new file with mode: 0644]
libssh2/share/man/man3/libssh2_channel_handle_extended_data2.3 [new file with mode: 0644]
libssh2/share/man/man3/libssh2_channel_open_ex.3 [new file with mode: 0644]
libssh2/share/man/man3/libssh2_channel_process_startup.3 [new file with mode: 0644]
libssh2/share/man/man3/libssh2_channel_read_ex.3 [new file with mode: 0644]
libssh2/share/man/man3/libssh2_channel_request_pty_ex.3 [new file with mode: 0644]
libssh2/share/man/man3/libssh2_channel_send_eof.3 [new file with mode: 0644]
libssh2/share/man/man3/libssh2_channel_set_blocking.3 [new file with mode: 0644]
libssh2/share/man/man3/libssh2_channel_setenv_ex.3 [new file with mode: 0644]
libssh2/share/man/man3/libssh2_channel_wait_eof.3 [new file with mode: 0644]
libssh2/share/man/man3/libssh2_channel_x11_req_ex.3 [new file with mode: 0644]
libssh2/share/man/man3/libssh2_hostkey_hash.3 [new file with mode: 0644]
libssh2/share/man/man3/libssh2_poll.3 [new file with mode: 0644]
libssh2/share/man/man3/libssh2_poll_channel_read.3 [new file with mode: 0644]
libssh2/share/man/man3/libssh2_scp_recv.3 [new file with mode: 0644]
libssh2/share/man/man3/libssh2_scp_send_ex.3 [new file with mode: 0644]
libssh2/share/man/man3/libssh2_session_abstract.3 [new file with mode: 0644]
libssh2/share/man/man3/libssh2_session_callback_set.3 [new file with mode: 0644]
libssh2/share/man/man3/libssh2_session_disconnect_ex.3 [new file with mode: 0644]
libssh2/share/man/man3/libssh2_session_free.3 [new file with mode: 0644]
libssh2/share/man/man3/libssh2_session_init.3 [new file with mode: 0644]
libssh2/share/man/man3/libssh2_session_last_errno.3 [new file with mode: 0644]
libssh2/share/man/man3/libssh2_session_last_error.3 [new file with mode: 0644]
libssh2/share/man/man3/libssh2_session_method_pref.3 [new file with mode: 0644]
libssh2/share/man/man3/libssh2_session_methods.3 [new file with mode: 0644]
libssh2/share/man/man3/libssh2_session_set_blocking.3 [new file with mode: 0644]
libssh2/share/man/man3/libssh2_session_startup.3 [new file with mode: 0644]
libssh2/share/man/man3/libssh2_sftp_close_handle.3 [new file with mode: 0644]
libssh2/share/man/man3/libssh2_sftp_fstat_ex.3 [new file with mode: 0644]
libssh2/share/man/man3/libssh2_sftp_init.3 [new file with mode: 0644]
libssh2/share/man/man3/libssh2_sftp_last_error.3 [new file with mode: 0644]
libssh2/share/man/man3/libssh2_sftp_mkdir_ex.3 [new file with mode: 0644]
libssh2/share/man/man3/libssh2_sftp_open_ex.3 [new file with mode: 0644]
libssh2/share/man/man3/libssh2_sftp_read.3 [new file with mode: 0644]
libssh2/share/man/man3/libssh2_sftp_readdir.3 [new file with mode: 0644]
libssh2/share/man/man3/libssh2_sftp_rename_ex.3 [new file with mode: 0644]
libssh2/share/man/man3/libssh2_sftp_rmdir_ex.3 [new file with mode: 0644]
libssh2/share/man/man3/libssh2_sftp_seek.3 [new file with mode: 0644]
libssh2/share/man/man3/libssh2_sftp_shutdown.3 [new file with mode: 0644]
libssh2/share/man/man3/libssh2_sftp_stat_ex.3 [new file with mode: 0644]
libssh2/share/man/man3/libssh2_sftp_symlink_ex.3 [new file with mode: 0644]
libssh2/share/man/man3/libssh2_sftp_tell.3 [new file with mode: 0644]
libssh2/share/man/man3/libssh2_sftp_unlink_ex.3 [new file with mode: 0644]
libssh2/share/man/man3/libssh2_sftp_write.3 [new file with mode: 0644]
libssh2/share/man/man3/libssh2_userauth_authenticated.3 [new file with mode: 0644]
libssh2/share/man/man3/libssh2_userauth_list.3 [new file with mode: 0644]
libssh2/share/man/man3/libssh2_userauth_password_ex.3 [new file with mode: 0644]
libssh2/share/man/man3/libssh2_userauth_publickey_fromfile.3 [new file with mode: 0644]

diff --git a/Vendor/build-libssh2.sh b/Vendor/build-libssh2.sh
new file mode 100755 (executable)
index 0000000..470691f
--- /dev/null
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+NAME=libssh2-0.18
+DEST=`cd ..; pwd`/libssh2
+CONFIG="--prefix=$DEST --disable-shared --enable-static"
+
+# unzip
+tar xzvf $NAME.tar.gz
+cd $NAME
+
+# build ppc
+./configure $CONFIG CFLAGS="-arch ppc"
+make
+mv src/.libs src/libs-ppc
+
+make clean
+
+# build i386
+./configure $CONFIG
+make
+mv src/.libs/libssh2.a src/libssh2-i386.a
+
+# make universal
+lipo -create src/libs-ppc/libssh2.a src/libssh2-i386.a -output src/.libs/libssh2.a
+
+# put it in the right place
+make install
+ranlib $DEST/lib/libssh2.a
+
+# cleanup
+cd ..
+rm -rf $NAME
\ No newline at end of file
diff --git a/Vendor/libssh2-0.18.tar.gz b/Vendor/libssh2-0.18.tar.gz
new file mode 100644 (file)
index 0000000..096afb6
Binary files /dev/null and b/Vendor/libssh2-0.18.tar.gz differ
diff --git a/libssh2/include/libssh2.h b/libssh2/include/libssh2.h
new file mode 100644 (file)
index 0000000..cd7553d
--- /dev/null
@@ -0,0 +1,476 @@
+/* Copyright (c) 2004-2007, Sara Golemon <sarag@libssh2.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms,
+ * with or without modification, are permitted provided
+ * that the following conditions are met:
+ *
+ *   Redistributions of source code must retain the above
+ *   copyright notice, this list of conditions and the
+ *   following disclaimer.
+ *
+ *   Redistributions in binary form must reproduce the above
+ *   copyright notice, this list of conditions and the following
+ *   disclaimer in the documentation and/or other materials
+ *   provided with the distribution.
+ *
+ *   Neither the name of the copyright holder nor the names
+ *   of any other contributors may be used to endorse or
+ *   promote products derived from this software without
+ *   specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+ * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
+ * OF SUCH DAMAGE.
+ */
+
+#ifndef LIBSSH2_H
+#define LIBSSH2_H 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stddef.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+
+/* Allow alternate API prefix from CFLAGS or calling app */
+#ifndef LIBSSH2_API
+# ifdef LIBSSH2_WIN32
+#  ifdef LIBSSH2_LIBRARY
+#   define LIBSSH2_API __declspec(dllexport)
+#  else
+#   define LIBSSH2_API __declspec(dllimport)
+#  endif /* LIBSSH2_LIBRARY */
+# else /* !LIBSSH2_WIN32 */
+#  define LIBSSH2_API
+# endif /* LIBSSH2_WIN32 */
+#endif /* LIBSSH2_API */
+
+#if defined(LIBSSH2_DARWIN) || (defined(LIBSSH2_WIN32) && !defined(_MSC_VER) && !defined(__MINGW32__))
+# include <sys/uio.h>
+#endif
+
+#if (defined(NETWARE) && !defined(__NOVELL_LIBC__))
+# include <sys/bsdskt.h>
+typedef unsigned int uint32_t;
+#endif
+
+#if defined(LIBSSH2_WIN32) && defined(_MSC_VER) && (_MSC_VER <= 1400)
+typedef unsigned __int64 libssh2_uint64_t;
+typedef __int64 libssh2_int64_t;
+typedef unsigned int uint32_t;
+#ifndef _SSIZE_T_DEFINED
+typedef int ssize_t;
+#define _SSIZE_T_DEFINED
+#endif
+#else
+typedef unsigned long long libssh2_uint64_t;
+typedef long long libssh2_int64_t;
+#endif
+
+#define LIBSSH2_VERSION "0.18"
+
+/* The numeric version number is also available "in parts" by using these
+   defines: */
+#define LIBSSH2_VERSION_MAJOR 0
+#define LIBSSH2_VERSION_MINOR 18
+#define LIBSSH2_VERSION_PATCH 
+
+/* This is the numeric version of the libssh2 version number, meant for easier
+   parsing and comparions by programs. The LIBSSH2_VERSION_NUM define will
+   always follow this syntax:
+
+         0xXXYYZZ
+
+   Where XX, YY and ZZ are the main version, release and patch numbers in
+   hexadecimal (using 8 bits each). All three numbers are always represented
+   using two digits.  1.2 would appear as "0x010200" while version 9.11.7
+   appears as "0x090b07".
+
+   This 6-digit (24 bits) hexadecimal number does not show pre-release number,
+   and it is always a greater number in a more recent release. It makes
+   comparisons with greater than and less than work.
+*/
+#define LIBSSH2_VERSION_NUM 0x001200
+
+/*
+ * This is the date and time when the full source package was created. The
+ * timestamp is not stored in CVS, as the timestamp is properly set in the
+ * tarballs by the maketgz script.
+ *
+ * The format of the date should follow this template:
+ *
+ * "Mon Feb 12 11:35:33 UTC 2007"
+ */
+#define LIBSSH2_TIMESTAMP "Sun Nov 11 10:41:38 UTC 2007"
+
+/* Part of every banner, user specified or not */
+#define LIBSSH2_SSH_BANNER                  "SSH-2.0-libssh2_" LIBSSH2_VERSION
+
+/* We *could* add a comment here if we so chose */
+#define LIBSSH2_SSH_DEFAULT_BANNER                  LIBSSH2_SSH_BANNER
+#define LIBSSH2_SSH_DEFAULT_BANNER_WITH_CRLF        LIBSSH2_SSH_DEFAULT_BANNER "\r\n"
+
+/* Default generate and safe prime sizes for diffie-hellman-group-exchange-sha1 */
+#define LIBSSH2_DH_GEX_MINGROUP     1024
+#define LIBSSH2_DH_GEX_OPTGROUP     1536
+#define LIBSSH2_DH_GEX_MAXGROUP     2048
+
+/* Defaults for pty requests */
+#define LIBSSH2_TERM_WIDTH      80
+#define LIBSSH2_TERM_HEIGHT     24
+#define LIBSSH2_TERM_WIDTH_PX   0
+#define LIBSSH2_TERM_HEIGHT_PX  0
+
+/* 1/4 second */
+#define LIBSSH2_SOCKET_POLL_UDELAY      250000
+/* 0.25 * 120 == 30 seconds */
+#define LIBSSH2_SOCKET_POLL_MAXLOOPS    120
+
+/* Maximum size to allow a payload to compress to, plays it safe by falling short of spec limits */
+#define LIBSSH2_PACKET_MAXCOMP      32000
+
+/* Maximum size to allow a payload to deccompress to, plays it safe by allowing more than spec requires */
+#define LIBSSH2_PACKET_MAXDECOMP    40000
+
+/* Maximum size for an inbound compressed payload, plays it safe by overshooting spec limits */
+#define LIBSSH2_PACKET_MAXPAYLOAD   40000
+
+/* Malloc callbacks */
+#define LIBSSH2_ALLOC_FUNC(name)                    void *name(size_t count, void **abstract)
+#define LIBSSH2_REALLOC_FUNC(name)                  void *name(void *ptr, size_t count, void **abstract)
+#define LIBSSH2_FREE_FUNC(name)                     void name(void *ptr, void **abstract)
+
+typedef struct _LIBSSH2_USERAUTH_KBDINT_PROMPT
+{
+    char* text;
+    unsigned int length;
+    unsigned char echo;
+} LIBSSH2_USERAUTH_KBDINT_PROMPT;
+
+typedef struct _LIBSSH2_USERAUTH_KBDINT_RESPONSE
+{
+    char* text;
+    unsigned int length;
+} LIBSSH2_USERAUTH_KBDINT_RESPONSE;
+
+/* 'keyboard-interactive' authentication callback */
+#define LIBSSH2_USERAUTH_KBDINT_RESPONSE_FUNC(name_) void name_(const char* name, int name_len, const char* instruction, int instruction_len, int num_prompts, const LIBSSH2_USERAUTH_KBDINT_PROMPT* prompts, LIBSSH2_USERAUTH_KBDINT_RESPONSE* responses, void **abstract)
+
+/* Callbacks for special SSH packets */
+#define LIBSSH2_IGNORE_FUNC(name)                   void name(LIBSSH2_SESSION *session, const char *message, int message_len, void **abstract)
+#define LIBSSH2_DEBUG_FUNC(name)                    void name(LIBSSH2_SESSION *session, int always_display, const char *message, int message_len, const char *language, int language_len,void **abstract)
+#define LIBSSH2_DISCONNECT_FUNC(name)               void name(LIBSSH2_SESSION *session, int reason, const char *message, int message_len, const char *language, int language_len, void **abstract)
+#define LIBSSH2_PASSWD_CHANGEREQ_FUNC(name)         void name(LIBSSH2_SESSION *session, char **newpw, int *newpw_len, void **abstract)
+#define LIBSSH2_MACERROR_FUNC(name)                 int  name(LIBSSH2_SESSION *session, const char *packet, int packet_len, void **abstract)
+#define LIBSSH2_X11_OPEN_FUNC(name)                 void name(LIBSSH2_SESSION *session, LIBSSH2_CHANNEL *channel, const char *shost, int sport, void **abstract)
+
+#define LIBSSH2_CHANNEL_CLOSE_FUNC(name)            void name(LIBSSH2_SESSION *session, void **session_abstract, LIBSSH2_CHANNEL *channel, void **channel_abstract)
+
+/* libssh2_session_callback_set() constants */
+#define LIBSSH2_CALLBACK_IGNORE             0
+#define LIBSSH2_CALLBACK_DEBUG              1
+#define LIBSSH2_CALLBACK_DISCONNECT         2
+#define LIBSSH2_CALLBACK_MACERROR           3
+#define LIBSSH2_CALLBACK_X11                4
+
+/* libssh2_session_method_pref() constants */
+#define LIBSSH2_METHOD_KEX          0
+#define LIBSSH2_METHOD_HOSTKEY      1
+#define LIBSSH2_METHOD_CRYPT_CS     2
+#define LIBSSH2_METHOD_CRYPT_SC     3
+#define LIBSSH2_METHOD_MAC_CS       4
+#define LIBSSH2_METHOD_MAC_SC       5
+#define LIBSSH2_METHOD_COMP_CS      6
+#define LIBSSH2_METHOD_COMP_SC      7
+#define LIBSSH2_METHOD_LANG_CS      8
+#define LIBSSH2_METHOD_LANG_SC      9
+
+/* session.flags bits */
+#define LIBSSH2_FLAG_SIGPIPE        0x00000001
+
+typedef struct _LIBSSH2_SESSION                     LIBSSH2_SESSION;
+typedef struct _LIBSSH2_CHANNEL                     LIBSSH2_CHANNEL;
+typedef struct _LIBSSH2_LISTENER                    LIBSSH2_LISTENER;
+
+typedef struct _LIBSSH2_POLLFD {
+    unsigned char type; /* LIBSSH2_POLLFD_* below */
+
+    union {
+        int socket; /* File descriptors -- examined with system select() call */
+        LIBSSH2_CHANNEL *channel; /* Examined by checking internal state */
+        LIBSSH2_LISTENER *listener; /* Read polls only -- are inbound connections waiting to be accepted? */
+    } fd;
+
+    unsigned long events; /* Requested Events */
+    unsigned long revents; /* Returned Events */
+} LIBSSH2_POLLFD;
+
+/* Poll FD Descriptor Types */
+#define LIBSSH2_POLLFD_SOCKET       1
+#define LIBSSH2_POLLFD_CHANNEL      2
+#define LIBSSH2_POLLFD_LISTENER     3
+
+/* Note: Win32 Doesn't actually have a poll() implementation, so some of these values are faked with select() data */
+/* Poll FD events/revents -- Match sys/poll.h where possible */
+#define LIBSSH2_POLLFD_POLLIN           0x0001      /* Data available to be read or connection available -- All */
+#define LIBSSH2_POLLFD_POLLPRI          0x0002      /* Priority data available to be read -- Socket only */
+#define LIBSSH2_POLLFD_POLLEXT          0x0002      /* Extended data available to be read -- Channel only */
+#define LIBSSH2_POLLFD_POLLOUT          0x0004      /* Can may be written -- Socket/Channel */
+/* revents only */
+#define LIBSSH2_POLLFD_POLLERR          0x0008      /* Error Condition -- Socket */
+#define LIBSSH2_POLLFD_POLLHUP          0x0010      /* HangUp/EOF -- Socket */
+#define LIBSSH2_POLLFD_SESSION_CLOSED   0x0010      /* Session Disconnect */
+#define LIBSSH2_POLLFD_POLLNVAL         0x0020      /* Invalid request -- Socket Only */
+#define LIBSSH2_POLLFD_POLLEX           0x0040      /* Exception Condition -- Socket/Win32 */
+#define LIBSSH2_POLLFD_CHANNEL_CLOSED   0x0080      /* Channel Disconnect */
+#define LIBSSH2_POLLFD_LISTENER_CLOSED  0x0080      /* Listener Disconnect */
+
+/* Hash Types */
+#define LIBSSH2_HOSTKEY_HASH_MD5                            1
+#define LIBSSH2_HOSTKEY_HASH_SHA1                           2
+
+/* Disconnect Codes (defined by SSH protocol) */
+#define SSH_DISCONNECT_HOST_NOT_ALLOWED_TO_CONNECT          1
+#define SSH_DISCONNECT_PROTOCOL_ERROR                       2
+#define SSH_DISCONNECT_KEY_EXCHANGE_FAILED                  3
+#define SSH_DISCONNECT_RESERVED                             4
+#define SSH_DISCONNECT_MAC_ERROR                            5
+#define SSH_DISCONNECT_COMPRESSION_ERROR                    6
+#define SSH_DISCONNECT_SERVICE_NOT_AVAILABLE                7
+#define SSH_DISCONNECT_PROTOCOL_VERSION_NOT_SUPPORTED       8
+#define SSH_DISCONNECT_HOST_KEY_NOT_VERIFIABLE              9
+#define SSH_DISCONNECT_CONNECTION_LOST                      10
+#define SSH_DISCONNECT_BY_APPLICATION                       11
+#define SSH_DISCONNECT_TOO_MANY_CONNECTIONS                 12
+#define SSH_DISCONNECT_AUTH_CANCELLED_BY_USER               13
+#define SSH_DISCONNECT_NO_MORE_AUTH_METHODS_AVAILABLE       14
+#define SSH_DISCONNECT_ILLEGAL_USER_NAME                    15
+
+/* Error Codes (defined by libssh2) */
+#define LIBSSH2_ERROR_NONE                      0
+#define LIBSSH2_ERROR_SOCKET_NONE               -1
+#define LIBSSH2_ERROR_BANNER_NONE               -2
+#define LIBSSH2_ERROR_BANNER_SEND               -3
+#define LIBSSH2_ERROR_INVALID_MAC               -4
+#define LIBSSH2_ERROR_KEX_FAILURE               -5
+#define LIBSSH2_ERROR_ALLOC                     -6
+#define LIBSSH2_ERROR_SOCKET_SEND               -7
+#define LIBSSH2_ERROR_KEY_EXCHANGE_FAILURE      -8
+#define LIBSSH2_ERROR_TIMEOUT                   -9
+#define LIBSSH2_ERROR_HOSTKEY_INIT              -10
+#define LIBSSH2_ERROR_HOSTKEY_SIGN              -11
+#define LIBSSH2_ERROR_DECRYPT                   -12
+#define LIBSSH2_ERROR_SOCKET_DISCONNECT         -13
+#define LIBSSH2_ERROR_PROTO                     -14
+#define LIBSSH2_ERROR_PASSWORD_EXPIRED          -15
+#define LIBSSH2_ERROR_FILE                      -16
+#define LIBSSH2_ERROR_METHOD_NONE               -17
+#define LIBSSH2_ERROR_PUBLICKEY_UNRECOGNIZED    -18
+#define LIBSSH2_ERROR_PUBLICKEY_UNVERIFIED      -19
+#define LIBSSH2_ERROR_CHANNEL_OUTOFORDER        -20
+#define LIBSSH2_ERROR_CHANNEL_FAILURE           -21
+#define LIBSSH2_ERROR_CHANNEL_REQUEST_DENIED    -22
+#define LIBSSH2_ERROR_CHANNEL_UNKNOWN           -23
+#define LIBSSH2_ERROR_CHANNEL_WINDOW_EXCEEDED   -24
+#define LIBSSH2_ERROR_CHANNEL_PACKET_EXCEEDED   -25
+#define LIBSSH2_ERROR_CHANNEL_CLOSED            -26
+#define LIBSSH2_ERROR_CHANNEL_EOF_SENT          -27
+#define LIBSSH2_ERROR_SCP_PROTOCOL              -28
+#define LIBSSH2_ERROR_ZLIB                      -29
+#define LIBSSH2_ERROR_SOCKET_TIMEOUT            -30
+#define LIBSSH2_ERROR_SFTP_PROTOCOL             -31
+#define LIBSSH2_ERROR_REQUEST_DENIED            -32
+#define LIBSSH2_ERROR_METHOD_NOT_SUPPORTED      -33
+#define LIBSSH2_ERROR_INVAL                     -34
+#define LIBSSH2_ERROR_INVALID_POLL_TYPE         -35
+#define LIBSSH2_ERROR_PUBLICKEY_PROTOCOL        -36
+#define LIBSSH2_ERROR_EAGAIN                    -37
+
+/* Session API */
+LIBSSH2_API LIBSSH2_SESSION *libssh2_session_init_ex(LIBSSH2_ALLOC_FUNC((*my_alloc)), LIBSSH2_FREE_FUNC((*my_free)), LIBSSH2_REALLOC_FUNC((*my_realloc)), void *abstract);
+#define libssh2_session_init()                      libssh2_session_init_ex(NULL, NULL, NULL, NULL)
+LIBSSH2_API void **libssh2_session_abstract(LIBSSH2_SESSION *session);
+
+LIBSSH2_API void *libssh2_session_callback_set(LIBSSH2_SESSION *session, int cbtype, void *callback);
+LIBSSH2_API int libssh2_banner_set(LIBSSH2_SESSION *session, const char *banner);
+
+LIBSSH2_API int libssh2_session_startup(LIBSSH2_SESSION *session, int sock);
+LIBSSH2_API int libssh2_session_disconnect_ex(LIBSSH2_SESSION *session, int reason, const char *description, const char *lang);
+#define libssh2_session_disconnect(session, description)    libssh2_session_disconnect_ex((session), SSH_DISCONNECT_BY_APPLICATION, (description), "")
+LIBSSH2_API int libssh2_session_free(LIBSSH2_SESSION *session);
+
+LIBSSH2_API const char *libssh2_hostkey_hash(LIBSSH2_SESSION *session, int hash_type);
+
+LIBSSH2_API int libssh2_session_method_pref(LIBSSH2_SESSION *session, int method_type, const char *prefs);
+LIBSSH2_API const char *libssh2_session_methods(LIBSSH2_SESSION *session, int method_type);
+LIBSSH2_API int libssh2_session_last_error(LIBSSH2_SESSION *session, char **errmsg, int *errmsg_len, int want_buf);
+LIBSSH2_API int libssh2_session_last_errno(LIBSSH2_SESSION *session);
+
+LIBSSH2_API int libssh2_session_flag(LIBSSH2_SESSION *session, int flag, int value);
+
+/* Userauth API */
+LIBSSH2_API char *libssh2_userauth_list(LIBSSH2_SESSION *session, const char *username, unsigned int username_len);
+LIBSSH2_API int libssh2_userauth_authenticated(LIBSSH2_SESSION *session);
+LIBSSH2_API int libssh2_userauth_password_ex(LIBSSH2_SESSION *session, const char *username, unsigned int username_len, const char *password, unsigned int password_len, LIBSSH2_PASSWD_CHANGEREQ_FUNC((*passwd_change_cb)));
+#define libssh2_userauth_password(session, username, password)  libssh2_userauth_password_ex((session), (username), strlen(username), (password), strlen(password), NULL)
+
+LIBSSH2_API int libssh2_userauth_publickey_fromfile_ex(LIBSSH2_SESSION *session, const char *username, unsigned int username_len,
+                                                                                 const char *publickey, const char *privatekey,
+                                                                                 const char *passphrase);
+#define libssh2_userauth_publickey_fromfile(session, username, publickey, privatekey, passphrase)   \
+        libssh2_userauth_publickey_fromfile_ex((session), (username), strlen(username), (publickey), (privatekey), (passphrase))
+LIBSSH2_API int libssh2_userauth_hostbased_fromfile_ex(LIBSSH2_SESSION *session, const char *username, unsigned int username_len,
+                                                                                 const char *publickey, const char *privatekey,
+                                                                                 const char *passphrase,
+                                                                                 const char *hostname, unsigned int hostname_len,
+                                                                                 const char *local_username, unsigned int local_username_len);
+#define libssh2_userauth_hostbased_fromfile(session, username, publickey, privatekey, passphrase, hostname) \
+        libssh2_userauth_hostbased_fromfile_ex((session), (username), strlen(username), (publickey), (privatekey), (passphrase), (hostname), strlen(hostname), (username), strlen(username))
+
+/*
+ * response_callback is provided with filled by library prompts array,
+ * but client must allocate and fill individual responses. Responses
+ * array is already allocated. Responses data will be freed by libssh2
+ * after callback return, but before subsequent callback invokation.
+ */
+LIBSSH2_API int libssh2_userauth_keyboard_interactive_ex(LIBSSH2_SESSION* session, const char *username, unsigned int username_len,
+                                                         LIBSSH2_USERAUTH_KBDINT_RESPONSE_FUNC((*response_callback)));
+#define libssh2_userauth_keyboard_interactive(session, username, response_callback) \
+        libssh2_userauth_keyboard_interactive_ex((session), (username), strlen(username), (response_callback))
+
+LIBSSH2_API int libssh2_poll(LIBSSH2_POLLFD *fds, unsigned int nfds, long timeout);
+
+/* Channel API */
+#define LIBSSH2_CHANNEL_WINDOW_DEFAULT  65536
+#define LIBSSH2_CHANNEL_PACKET_DEFAULT  16384
+#define LIBSSH2_CHANNEL_MINADJUST       1024
+
+/* Extended Data Handling */
+#define LIBSSH2_CHANNEL_EXTENDED_DATA_NORMAL        0
+#define LIBSSH2_CHANNEL_EXTENDED_DATA_IGNORE        1
+#define LIBSSH2_CHANNEL_EXTENDED_DATA_MERGE         2
+
+#define SSH_EXTENDED_DATA_STDERR 1
+
+/* Returned by any function that would block during a read/write opperation */
+#define LIBSSH2CHANNEL_EAGAIN LIBSSH2_ERROR_EAGAIN
+
+LIBSSH2_API LIBSSH2_CHANNEL *libssh2_channel_open_ex(LIBSSH2_SESSION *session, const char *channel_type, unsigned int channel_type_len, unsigned int window_size, unsigned int packet_size, const char *message, unsigned int message_len);
+#define libssh2_channel_open_session(session)   libssh2_channel_open_ex((session), "session", sizeof("session") - 1, LIBSSH2_CHANNEL_WINDOW_DEFAULT, LIBSSH2_CHANNEL_PACKET_DEFAULT, NULL, 0)
+
+LIBSSH2_API LIBSSH2_CHANNEL *libssh2_channel_direct_tcpip_ex(LIBSSH2_SESSION *session, const char *host, int port, const char *shost, int sport);
+#define libssh2_channel_direct_tcpip(session, host, port)   libssh2_channel_direct_tcpip_ex((session), (host), (port), "127.0.0.1", 22)
+
+LIBSSH2_API LIBSSH2_LISTENER *libssh2_channel_forward_listen_ex(LIBSSH2_SESSION *session, const char *host, int port, int *bound_port, int queue_maxsize);
+#define libssh2_channel_forward_listen(session, port)           libssh2_channel_forward_listen_ex((session), NULL, (port), NULL, 16)
+
+LIBSSH2_API int libssh2_channel_forward_cancel(LIBSSH2_LISTENER *listener);
+
+LIBSSH2_API LIBSSH2_CHANNEL *libssh2_channel_forward_accept(LIBSSH2_LISTENER *listener);
+
+LIBSSH2_API int libssh2_channel_setenv_ex(LIBSSH2_CHANNEL *channel, const char *varname, unsigned int varname_len, const char *value, unsigned int value_len);
+#define libssh2_channel_setenv(channel, varname, value) libssh2_channel_setenv_ex((channel), (varname), strlen(varname), (value), strlen(value))
+
+LIBSSH2_API int libssh2_channel_request_pty_ex(LIBSSH2_CHANNEL *channel, const char *term, unsigned int term_len, const char *modes, unsigned int modes_len, int width, int height, int width_px, int height_px);
+#define libssh2_channel_request_pty(channel, term)  libssh2_channel_request_pty_ex((channel), (term), strlen(term), NULL, 0, LIBSSH2_TERM_WIDTH, LIBSSH2_TERM_HEIGHT, LIBSSH2_TERM_WIDTH_PX, LIBSSH2_TERM_HEIGHT_PX)
+
+LIBSSH2_API int libssh2_channel_x11_req_ex(LIBSSH2_CHANNEL *channel, int single_connection, const char *auth_proto, const char *auth_cookie, int screen_number);
+#define libssh2_channel_x11_req(channel, screen_number) libssh2_channel_x11_req_ex((channel), 0, NULL, NULL, (screen_number))
+
+LIBSSH2_API int libssh2_channel_process_startup(LIBSSH2_CHANNEL *channel, const char *request, unsigned int request_len, const char *message, unsigned int message_len);
+#define libssh2_channel_shell(channel)                  libssh2_channel_process_startup((channel), "shell", sizeof("shell") - 1, NULL, 0)
+#define libssh2_channel_exec(channel, command)          libssh2_channel_process_startup((channel), "exec", sizeof("exec") - 1, (command), strlen(command))
+#define libssh2_channel_subsystem(channel, subsystem)   libssh2_channel_process_startup((channel), "subsystem", sizeof("subsystem") - 1, (subsystem), strlen(subsystem))
+
+LIBSSH2_API ssize_t libssh2_channel_read_ex(LIBSSH2_CHANNEL *channel, int stream_id, char *buf, size_t buflen);
+#define libssh2_channel_read(channel, buf, buflen) \
+                                libssh2_channel_read_ex((channel), 0, (buf), (buflen))
+#define libssh2_channel_read_stderr(channel, buf, buflen) \
+                                libssh2_channel_read_ex((channel), SSH_EXTENDED_DATA_STDERR, (buf), (buflen))
+
+LIBSSH2_API int libssh2_poll_channel_read(LIBSSH2_CHANNEL *channel, int extended);
+
+LIBSSH2_API unsigned long libssh2_channel_window_read_ex(LIBSSH2_CHANNEL *channel, unsigned long *read_avail, unsigned long *window_size_initial);
+#define libssh2_channel_window_read(channel) \
+            libssh2_channel_window_read_ex((channel), NULL, NULL)
+
+LIBSSH2_API unsigned long libssh2_channel_receive_window_adjust(LIBSSH2_CHANNEL *channel, unsigned long adjustment, unsigned char force);
+
+LIBSSH2_API ssize_t libssh2_channel_write_ex(LIBSSH2_CHANNEL *channel, int stream_id, const char *buf, size_t buflen);
+
+#define libssh2_channel_write(channel, buf, buflen) \
+                                libssh2_channel_write_ex((channel), 0, (buf), (buflen))
+#define libssh2_channel_write_stderr(channel, buf, buflen)  \
+                                libssh2_channel_write_ex((channel), SSH_EXTENDED_DATA_STDERR, (buf), (buflen))
+
+LIBSSH2_API unsigned long libssh2_channel_window_write_ex(LIBSSH2_CHANNEL *channel, unsigned long *window_size_initial);
+#define libssh2_channel_window_write(channel)           libssh2_channel_window_write_ex((channel), NULL)
+
+LIBSSH2_API void libssh2_session_set_blocking(LIBSSH2_SESSION* session, int blocking);
+LIBSSH2_API int libssh2_session_get_blocking(LIBSSH2_SESSION* session);
+
+LIBSSH2_API void libssh2_channel_set_blocking(LIBSSH2_CHANNEL *channel, int blocking);
+
+LIBSSH2_API void libssh2_channel_handle_extended_data(LIBSSH2_CHANNEL *channel, int ignore_mode);
+LIBSSH2_API int libssh2_channel_handle_extended_data2(LIBSSH2_CHANNEL *channel, int ignore_mode);
+/* libssh2_channel_ignore_extended_data() is defined below for BC with version 0.1
+ * Future uses should use libssh2_channel_handle_extended_data() directly
+ * if LIBSSH2_CHANNEL_EXTENDED_DATA_MERGE is passed, extended data will be read (FIFO) from the standard data channel
+ */
+/* DEPRECATED */
+#define libssh2_channel_ignore_extended_data(channel, ignore)       libssh2_channel_handle_extended_data((channel), (ignore) ? LIBSSH2_CHANNEL_EXTENDED_DATA_IGNORE : LIBSSH2_CHANNEL_EXTENDED_DATA_NORMAL )
+
+#define LIBSSH2_CHANNEL_FLUSH_EXTENDED_DATA     -1
+#define LIBSSH2_CHANNEL_FLUSH_ALL               -2
+LIBSSH2_API int libssh2_channel_flush_ex(LIBSSH2_CHANNEL *channel, int streamid);
+#define libssh2_channel_flush(channel)          libssh2_channel_flush_ex((channel), 0)
+#define libssh2_channel_flush_stderr(channel)   libssh2_channel_flush_ex((channel), SSH_EXTENDED_DATA_STDERR)
+LIBSSH2_API int libssh2_channel_get_exit_status(LIBSSH2_CHANNEL* channel);
+
+LIBSSH2_API int libssh2_channel_send_eof(LIBSSH2_CHANNEL *channel);
+LIBSSH2_API int libssh2_channel_eof(LIBSSH2_CHANNEL *channel);
+LIBSSH2_API int libssh2_channel_wait_eof(LIBSSH2_CHANNEL *channel);
+LIBSSH2_API int libssh2_channel_close(LIBSSH2_CHANNEL *channel);
+LIBSSH2_API int libssh2_channel_wait_closed(LIBSSH2_CHANNEL *channel);
+LIBSSH2_API int libssh2_channel_free(LIBSSH2_CHANNEL *channel);
+
+LIBSSH2_API LIBSSH2_CHANNEL *libssh2_scp_recv(LIBSSH2_SESSION *session, const char *path, struct stat *sb);
+LIBSSH2_API LIBSSH2_CHANNEL *libssh2_scp_send_ex(LIBSSH2_SESSION *session, const char *path, int mode, size_t size, long mtime, long atime);
+#define libssh2_scp_send(session, path, mode, size)                 libssh2_scp_send_ex((session), (path), (mode), (size), 0, 0)
+
+LIBSSH2_API int libssh2_base64_decode(LIBSSH2_SESSION *session, char **dest, unsigned int *dest_len, const char *src, unsigned int src_len);
+
+/* NOTE NOTE NOTE
+   libssh2_trace() has no function in builds that aren't built with debug
+   enabled
+ */
+LIBSSH2_API int libssh2_trace(LIBSSH2_SESSION *session, int bitmask);
+#define LIBSSH2_TRACE_TRANS (1<<1)
+#define LIBSSH2_TRACE_KEX   (1<<2)
+#define LIBSSH2_TRACE_AUTH  (1<<3)
+#define LIBSSH2_TRACE_CONN  (1<<4)
+#define LIBSSH2_TRACE_SCP   (1<<5)
+#define LIBSSH2_TRACE_SFTP  (1<<6)
+#define LIBSSH2_TRACE_ERROR (1<<7)
+#define LIBSSH2_TRACE_PUBLICKEY (1<<8)
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* LIBSSH2_H */
diff --git a/libssh2/include/libssh2_publickey.h b/libssh2/include/libssh2_publickey.h
new file mode 100644 (file)
index 0000000..1adc3ce
--- /dev/null
@@ -0,0 +1,101 @@
+/* Copyright (c) 2004-2006, Sara Golemon <sarag@libssh2.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms,
+ * with or without modification, are permitted provided
+ * that the following conditions are met:
+ *
+ *   Redistributions of source code must retain the above
+ *   copyright notice, this list of conditions and the
+ *   following disclaimer.
+ *
+ *   Redistributions in binary form must reproduce the above
+ *   copyright notice, this list of conditions and the following
+ *   disclaimer in the documentation and/or other materials
+ *   provided with the distribution.
+ *
+ *   Neither the name of the copyright holder nor the names
+ *   of any other contributors may be used to endorse or
+ *   promote products derived from this software without
+ *   specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+ * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
+ * OF SUCH DAMAGE.
+ */
+
+/* Note: This include file is only needed for using the
+ * publickey SUBSYSTEM which is not the same as publickey
+ * authentication.  For authentication you only need libssh2.h
+ *
+ * For more information on the publickey subsystem,
+ * refer to IETF draft: secsh-publickey
+ */
+
+#ifndef LIBSSH2_PUBLICKEY_H
+#define LIBSSH2_PUBLICKEY_H 1
+
+typedef struct _LIBSSH2_PUBLICKEY               LIBSSH2_PUBLICKEY;
+
+typedef struct _libssh2_publickey_attribute {
+    const char *name;
+    unsigned long name_len;
+    const char *value;
+    unsigned long value_len;
+    char mandatory;
+} libssh2_publickey_attribute;
+
+typedef struct _libssh2_publickey_list {
+    unsigned char *packet; /* For freeing */
+
+    const unsigned char *name;
+    unsigned long name_len;
+    const unsigned char *blob;
+    unsigned long blob_len;
+    unsigned long num_attrs;
+    libssh2_publickey_attribute *attrs; /* free me */
+} libssh2_publickey_list;
+
+/* Generally use the first macro here, but if both name and value are string literals, you can use _fast() to take advantage of preprocessing */
+#define libssh2_publickey_attribute(name, value, mandatory)         { (name), strlen(name), (value), strlen(value), (mandatory) },
+#define libssh2_publickey_attribute_fast(name, value, mandatory)    { (name), sizeof(name) - 1, (value), sizeof(value) - 1, (mandatory) },
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Publickey Subsystem */
+LIBSSH2_API LIBSSH2_PUBLICKEY *libssh2_publickey_init(LIBSSH2_SESSION *session);
+
+LIBSSH2_API int libssh2_publickey_add_ex(LIBSSH2_PUBLICKEY *pkey, const unsigned char *name, unsigned long name_len,
+                                                            const unsigned char *blob, unsigned long blob_len, char overwrite,
+                                                            unsigned long num_attrs, const libssh2_publickey_attribute attrs[]);
+#define libssh2_publickey_add(pkey, name, blob, blob_len, overwrite, num_attrs, attrs) \
+        libssh2_publickey_add_ex((pkey), (name), strlen(name), (blob), (blob_len), (overwrite), (num_attrs), (attrs))
+
+LIBSSH2_API int libssh2_publickey_remove_ex(LIBSSH2_PUBLICKEY *pkey, const unsigned char *name, unsigned long name_len,
+                                                            const unsigned char *blob, unsigned long blob_len);
+#define libssh2_publickey_remove(pkey, name, blob, blob_len) \
+        libssh2_publickey_remove_ex((pkey), (name), strlen(name), (blob), (blob_len))
+
+LIBSSH2_API int libssh2_publickey_list_fetch(LIBSSH2_PUBLICKEY *pkey, unsigned long *num_keys, libssh2_publickey_list **pkey_list);
+LIBSSH2_API void libssh2_publickey_list_free(LIBSSH2_PUBLICKEY *pkey, libssh2_publickey_list *pkey_list);
+
+LIBSSH2_API int libssh2_publickey_shutdown(LIBSSH2_PUBLICKEY *pkey);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* ndef: LIBSSH2_PUBLICKEY_H */
diff --git a/libssh2/include/libssh2_sftp.h b/libssh2/include/libssh2_sftp.h
new file mode 100644 (file)
index 0000000..596eb0b
--- /dev/null
@@ -0,0 +1,249 @@
+/* Copyright (c) 2004-2007, Sara Golemon <sarag@libssh2.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms,
+ * with or without modification, are permitted provided
+ * that the following conditions are met:
+ *
+ *   Redistributions of source code must retain the above
+ *   copyright notice, this list of conditions and the
+ *   following disclaimer.
+ *
+ *   Redistributions in binary form must reproduce the above
+ *   copyright notice, this list of conditions and the following
+ *   disclaimer in the documentation and/or other materials
+ *   provided with the distribution.
+ *
+ *   Neither the name of the copyright holder nor the names
+ *   of any other contributors may be used to endorse or
+ *   promote products derived from this software without
+ *   specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+ * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
+ * OF SUCH DAMAGE.
+ */
+
+#ifndef LIBSSH2_SFTP_H
+#define LIBSSH2_SFTP_H 1
+
+#ifndef WIN32
+#include <unistd.h>
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Note: Version 6 was documented at the time of writing
+ * However it was marked as "DO NOT IMPLEMENT" due to pending changes
+ *
+ * Let's start with Version 3 (The version found in OpenSSH) and go from there
+ */
+#define LIBSSH2_SFTP_VERSION        3
+#define LIBSSH2_SFTP_PACKET_MAXLEN  40000
+
+typedef struct _LIBSSH2_SFTP                LIBSSH2_SFTP;
+typedef struct _LIBSSH2_SFTP_HANDLE         LIBSSH2_SFTP_HANDLE;
+typedef struct _LIBSSH2_SFTP_ATTRIBUTES     LIBSSH2_SFTP_ATTRIBUTES;
+
+/* Flags for open_ex() */
+#define LIBSSH2_SFTP_OPENFILE           0
+#define LIBSSH2_SFTP_OPENDIR            1
+
+/* Flags for rename_ex() */
+#define LIBSSH2_SFTP_RENAME_OVERWRITE   0x00000001
+#define LIBSSH2_SFTP_RENAME_ATOMIC      0x00000002
+#define LIBSSH2_SFTP_RENAME_NATIVE      0x00000004
+
+/* Flags for stat_ex() */
+#define LIBSSH2_SFTP_STAT               0
+#define LIBSSH2_SFTP_LSTAT              1
+#define LIBSSH2_SFTP_SETSTAT            2
+
+/* Flags for symlink_ex() */
+#define LIBSSH2_SFTP_SYMLINK            0
+#define LIBSSH2_SFTP_READLINK           1
+#define LIBSSH2_SFTP_REALPATH           2
+
+/* SFTP attribute flag bits */
+#define LIBSSH2_SFTP_ATTR_SIZE              0x00000001
+#define LIBSSH2_SFTP_ATTR_UIDGID            0x00000002
+#define LIBSSH2_SFTP_ATTR_PERMISSIONS       0x00000004
+#define LIBSSH2_SFTP_ATTR_ACMODTIME         0x00000008
+#define LIBSSH2_SFTP_ATTR_EXTENDED          0x80000000
+
+struct _LIBSSH2_SFTP_ATTRIBUTES {
+    /* If flags & ATTR_* bit is set, then the value in this struct will be meaningful
+     * Otherwise it should be ignored
+     */
+    unsigned long flags;
+
+    libssh2_uint64_t filesize;
+    unsigned long uid, gid;
+    unsigned long permissions;
+    unsigned long atime, mtime;
+};
+
+/* SFTP filetypes */
+#define LIBSSH2_SFTP_TYPE_REGULAR           1
+#define LIBSSH2_SFTP_TYPE_DIRECTORY         2
+#define LIBSSH2_SFTP_TYPE_SYMLINK           3
+#define LIBSSH2_SFTP_TYPE_SPECIAL           4
+#define LIBSSH2_SFTP_TYPE_UNKNOWN           5
+#define LIBSSH2_SFTP_TYPE_SOCKET            6
+#define LIBSSH2_SFTP_TYPE_CHAR_DEVICE       7
+#define LIBSSH2_SFTP_TYPE_BLOCK_DEVICE      8
+#define LIBSSH2_SFTP_TYPE_FIFO              9
+
+/*
+ * Reproduce the POSIX file modes here for systems that are not
+ * POSIX compliant.  
+ *
+ * These is used in "permissions" of "struct _LIBSSH2_SFTP_ATTRIBUTES"
+ */
+/* File type */
+#define LIBSSH2_SFTP_S_IFMT         0170000     /* type of file mask */
+#define LIBSSH2_SFTP_S_IFIFO        0010000     /* named pipe (fifo) */
+#define LIBSSH2_SFTP_S_IFCHR        0020000     /* character special */
+#define LIBSSH2_SFTP_S_IFDIR        0040000     /* directory */
+#define LIBSSH2_SFTP_S_IFBLK        0060000     /* block special */
+#define LIBSSH2_SFTP_S_IFREG        0100000     /* regular */
+#define LIBSSH2_SFTP_S_IFLNK        0120000     /* symbolic link */
+#define LIBSSH2_SFTP_S_IFSOCK       0140000     /* socket */
+
+/* File mode */
+/* Read, write, execute/search by owner */
+#define LIBSSH2_SFTP_S_IRWXU        0000700     /* RWX mask for owner */
+#define LIBSSH2_SFTP_S_IRUSR        0000400     /* R for owner */
+#define LIBSSH2_SFTP_S_IWUSR        0000200     /* W for owner */
+#define LIBSSH2_SFTP_S_IXUSR        0000100     /* X for owner */
+/* Read, write, execute/search by group */
+#define LIBSSH2_SFTP_S_IRWXG        0000070     /* RWX mask for group */
+#define LIBSSH2_SFTP_S_IRGRP        0000040     /* R for group */
+#define LIBSSH2_SFTP_S_IWGRP        0000020     /* W for group */
+#define LIBSSH2_SFTP_S_IXGRP        0000010     /* X for group */
+/* Read, write, execute/search by others */
+#define LIBSSH2_SFTP_S_IRWXO        0000007     /* RWX mask for other */
+#define LIBSSH2_SFTP_S_IROTH        0000004     /* R for other */
+#define LIBSSH2_SFTP_S_IWOTH        0000002     /* W for other */
+#define LIBSSH2_SFTP_S_IXOTH        0000001     /* X for other */
+
+/* SFTP File Transfer Flags -- (e.g. flags parameter to sftp_open())
+ * Danger will robinson... APPEND doesn't have any effect on OpenSSH servers */
+#define LIBSSH2_FXF_READ                        0x00000001
+#define LIBSSH2_FXF_WRITE                       0x00000002
+#define LIBSSH2_FXF_APPEND                      0x00000004
+#define LIBSSH2_FXF_CREAT                       0x00000008
+#define LIBSSH2_FXF_TRUNC                       0x00000010
+#define LIBSSH2_FXF_EXCL                        0x00000020
+
+/* SFTP Status Codes (returned by libssh2_sftp_last_error() ) */
+#define LIBSSH2_FX_OK                       0
+#define LIBSSH2_FX_EOF                      1
+#define LIBSSH2_FX_NO_SUCH_FILE             2
+#define LIBSSH2_FX_PERMISSION_DENIED        3
+#define LIBSSH2_FX_FAILURE                  4
+#define LIBSSH2_FX_BAD_MESSAGE              5
+#define LIBSSH2_FX_NO_CONNECTION            6
+#define LIBSSH2_FX_CONNECTION_LOST          7
+#define LIBSSH2_FX_OP_UNSUPPORTED           8
+#define LIBSSH2_FX_INVALID_HANDLE           9
+#define LIBSSH2_FX_NO_SUCH_PATH             10
+#define LIBSSH2_FX_FILE_ALREADY_EXISTS      11
+#define LIBSSH2_FX_WRITE_PROTECT            12
+#define LIBSSH2_FX_NO_MEDIA                 13
+#define LIBSSH2_FX_NO_SPACE_ON_FILESYSTEM   14
+#define LIBSSH2_FX_QUOTA_EXCEEDED           15
+#define LIBSSH2_FX_UNKNOWN_PRINCIPLE        16 /* Initial mis-spelling */
+#define LIBSSH2_FX_UNKNOWN_PRINCIPAL        16
+#define LIBSSH2_FX_LOCK_CONFlICT            17 /* Initial mis-spelling */
+#define LIBSSH2_FX_LOCK_CONFLICT            17
+#define LIBSSH2_FX_DIR_NOT_EMPTY            18
+#define LIBSSH2_FX_NOT_A_DIRECTORY          19
+#define LIBSSH2_FX_INVALID_FILENAME         20
+#define LIBSSH2_FX_LINK_LOOP                21
+
+/* Returned by any function that would block during a read/write opperation */
+#define LIBSSH2SFTP_EAGAIN LIBSSH2_ERROR_EAGAIN
+
+/* SFTP API */
+LIBSSH2_API LIBSSH2_SFTP *libssh2_sftp_init(LIBSSH2_SESSION *session);
+LIBSSH2_API int libssh2_sftp_shutdown(LIBSSH2_SFTP *sftp);
+LIBSSH2_API unsigned long libssh2_sftp_last_error(LIBSSH2_SFTP *sftp);
+
+/* File / Directory Ops */
+LIBSSH2_API LIBSSH2_SFTP_HANDLE *libssh2_sftp_open_ex(LIBSSH2_SFTP *sftp, const char *filename, unsigned int filename_len,
+                                                      unsigned long flags, long mode, int open_type);
+#define libssh2_sftp_open(sftp, filename, flags, mode) \
+                    libssh2_sftp_open_ex((sftp), (filename), strlen(filename), (flags), (mode), LIBSSH2_SFTP_OPENFILE)
+#define libssh2_sftp_opendir(sftp, path) \
+                    libssh2_sftp_open_ex((sftp), (path), strlen(path), 0, 0, LIBSSH2_SFTP_OPENDIR)
+
+LIBSSH2_API ssize_t libssh2_sftp_read(LIBSSH2_SFTP_HANDLE *handle, char *buffer, size_t buffer_maxlen);
+
+LIBSSH2_API int libssh2_sftp_readdir_ex(LIBSSH2_SFTP_HANDLE *handle, char *buffer, size_t buffer_maxlen, 
+                                        char *longentry, size_t longentry_maxlen, 
+                                        LIBSSH2_SFTP_ATTRIBUTES *attrs);
+#define libssh2_sftp_readdir(handle, buffer, buffer_maxlen, attrs) \
+                    libssh2_sftp_readdir_ex((handle), (buffer), (buffer_maxlen), NULL, 0, (attrs))
+
+LIBSSH2_API ssize_t libssh2_sftp_write(LIBSSH2_SFTP_HANDLE *handle, const char *buffer, size_t count);
+
+LIBSSH2_API int libssh2_sftp_close_handle(LIBSSH2_SFTP_HANDLE *handle);
+#define libssh2_sftp_close(handle)                  libssh2_sftp_close_handle(handle)
+#define libssh2_sftp_closedir(handle)               libssh2_sftp_close_handle(handle)
+
+LIBSSH2_API void libssh2_sftp_seek(LIBSSH2_SFTP_HANDLE *handle, size_t offset);
+#define libssh2_sftp_rewind(handle)         libssh2_sftp_seek((handle), 0)
+
+LIBSSH2_API size_t libssh2_sftp_tell(LIBSSH2_SFTP_HANDLE *handle);
+
+LIBSSH2_API int libssh2_sftp_fstat_ex(LIBSSH2_SFTP_HANDLE *handle, LIBSSH2_SFTP_ATTRIBUTES *attrs, int setstat);
+#define libssh2_sftp_fstat(handle, attrs)               libssh2_sftp_fstat_ex((handle), (attrs), 0)
+#define libssh2_sftp_fsetstat(handle, attrs)            libssh2_sftp_fstat_ex((handle), (attrs), 1)
+
+
+
+/* Miscellaneous Ops */
+LIBSSH2_API int libssh2_sftp_rename_ex(LIBSSH2_SFTP *sftp,  const char *source_filename,    unsigned int srouce_filename_len,
+                                                            const char *dest_filename,      unsigned int dest_filename_len,
+                                                            long flags);
+#define libssh2_sftp_rename(sftp, sourcefile, destfile)     libssh2_sftp_rename_ex((sftp), (sourcefile), strlen(sourcefile), (destfile), strlen(destfile), \
+                                                            LIBSSH2_SFTP_RENAME_OVERWRITE | LIBSSH2_SFTP_RENAME_ATOMIC | LIBSSH2_SFTP_RENAME_NATIVE)
+
+LIBSSH2_API int libssh2_sftp_unlink_ex(LIBSSH2_SFTP *sftp, const char *filename, unsigned int filename_len);
+#define libssh2_sftp_unlink(sftp, filename)                 libssh2_sftp_unlink_ex((sftp), (filename), strlen(filename))
+
+LIBSSH2_API int libssh2_sftp_mkdir_ex(LIBSSH2_SFTP *sftp, const char *path, unsigned int path_len, long mode);
+#define libssh2_sftp_mkdir(sftp, path, mode)                libssh2_sftp_mkdir_ex((sftp), (path), strlen(path), (mode))
+
+LIBSSH2_API int libssh2_sftp_rmdir_ex(LIBSSH2_SFTP *sftp, const char *path, unsigned int path_len);
+#define libssh2_sftp_rmdir(sftp, path)                      libssh2_sftp_rmdir_ex((sftp), (path), strlen(path))
+
+LIBSSH2_API int libssh2_sftp_stat_ex(LIBSSH2_SFTP *sftp, const char *path, unsigned int path_len, int stat_type, LIBSSH2_SFTP_ATTRIBUTES *attrs);
+#define libssh2_sftp_stat(sftp, path, attrs)                libssh2_sftp_stat_ex((sftp), (path), strlen(path), LIBSSH2_SFTP_STAT, (attrs))
+#define libssh2_sftp_lstat(sftp, path, attrs)               libssh2_sftp_stat_ex((sftp), (path), strlen(path), LIBSSH2_SFTP_LSTAT, (attrs))
+#define libssh2_sftp_setstat(sftp, path, attrs)             libssh2_sftp_stat_ex((sftp), (path), strlen(path), LIBSSH2_SFTP_SETSTAT, (attrs))
+
+LIBSSH2_API int libssh2_sftp_symlink_ex(LIBSSH2_SFTP *sftp, const char *path, unsigned int path_len, char *target, unsigned int target_len, int link_type);
+#define libssh2_sftp_symlink(sftp, orig, linkpath)          libssh2_sftp_symlink_ex((sftp), (orig), strlen(orig), (linkpath), strlen(linkpath), LIBSSH2_SFTP_SYMLINK)
+#define libssh2_sftp_readlink(sftp, path, target, maxlen)   libssh2_sftp_symlink_ex((sftp), (path), strlen(path), (target), (maxlen), LIBSSH2_SFTP_READLINK)
+#define libssh2_sftp_realpath(sftp, path, target, maxlen)   libssh2_sftp_symlink_ex((sftp), (path), strlen(path), (target), (maxlen), LIBSSH2_SFTP_REALPATH)
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* LIBSSH2_SFTP_H */
diff --git a/libssh2/lib/libssh2.a b/libssh2/lib/libssh2.a
new file mode 100644 (file)
index 0000000..b2be511
Binary files /dev/null and b/libssh2/lib/libssh2.a differ
diff --git a/libssh2/lib/libssh2.la b/libssh2/lib/libssh2.la
new file mode 100755 (executable)
index 0000000..8c97f0d
--- /dev/null
@@ -0,0 +1,35 @@
+# libssh2.la - a libtool library file
+# Generated by ltmain.sh - GNU libtool 1.5.24 Debian 1.5.24-1 (1.1220.2.456 2007/06/24 02:25:32)
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname=''
+
+# Names of this library.
+library_names=''
+
+# The name of the static archive.
+old_library='libssh2.a'
+
+# Libraries that this one depends upon.
+dependency_libs=' -L/usr/lib -lcrypto -lz'
+
+# Version information for libssh2.
+current=1
+age=0
+revision=0
+
+# Is this an already installed library?
+installed=yes
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=no
+
+# Files to dlopen/dlpreopen
+dlopen=''
+dlpreopen=''
+
+# Directory that this library needs to be installed in:
+libdir='/Users/rsesek/Projects/PrintDrop/libssh2/lib'
diff --git a/libssh2/share/man/man3/libssh2_banner_set.3 b/libssh2/share/man/man3/libssh2_banner_set.3
new file mode 100644 (file)
index 0000000..e5c286f
--- /dev/null
@@ -0,0 +1,32 @@
+.\" $Id: libssh2_banner_set.3,v 1.1 2007/06/13 17:03:38 jehousley Exp $
+.\"
+.TH libssh2_banner_set 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
+.SH NAME
+libssh2_banner_set - set the SSH prococol banner for the local client
+.SH SYNOPSIS
+#include <libssh2.h>
+
+int 
+libssh2_banner_set(LIBSSH2_SESSION *session, const char *banner);
+
+.SH DESCRIPTION
+\fIsession\fP - Session instance as returned by 
+.BR libssh2_session_init(3)
+
+\fIbanner\fP - A pointer to a user defined banner
+
+Set the banner that will be sent to the remote host when the SSH session is 
+started with 
+.BR libssh2_session_startup(3)
+.  This is optional; a banner corresponding to the protocol and libssh2 version will be sent by default.
+
+.SH RETURN VALUE
+Return 0 on success or negative on failure.  It returns
+LIBSSH2_ERROR_EAGAIN when it would otherwise block. While
+LIBSSH2_ERROR_EAGAIN is a negative number, it isn't really a failure per se.
+
+.SH ERRORS
+\fILIBSSH2_ERROR_ALLOC\fP -  An internal memory allocation call failed.
+
+.SH SEE ALSO
+.BR libssh2_session_startup(3)
diff --git a/libssh2/share/man/man3/libssh2_channel_close.3 b/libssh2/share/man/man3/libssh2_channel_close.3
new file mode 100644 (file)
index 0000000..f12d25f
--- /dev/null
@@ -0,0 +1,31 @@
+.\" $Id: libssh2_channel_close.3,v 1.1 2007/06/13 17:03:38 jehousley Exp $
+.\"
+.TH libssh2_channel_close 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
+.SH NAME
+libssh2_channel_close - close a channel<
+.SH SYNOPSIS
+#include <libssh2.h>
+
+int 
+libssh2_channel_close(LIBSSH2_CHANNEL *channel);
+
+.SH DESCRIPTION
+\fIchannel\fP - active channel stream to set closed status on.
+
+Close an active data channel. In practice this means sending an SSH_MSG_CLOSE 
+packet to the remote host which serves as instruction that no further data 
+will be sent to it. The remote host may still send data back until it sends 
+its own close message in response. To wait for the remote end to close its 
+connection as well, follow this command with 
+.BR libssh2_channel_wait_closed(3)
+
+.SH RETURN VALUE
+Return 0 on success or negative on failure.  It returns
+LIBSSH2_ERROR_EAGAIN when it would otherwise block. While
+LIBSSH2_ERROR_EAGAIN is a negative number, it isn't really a failure per se.
+
+.SH ERRORS
+\fILIBSSH2_ERROR_SOCKET_SEND\fP - Unable to send data on socket.
+
+.SH SEE ALSO
+.BR libssh2_channel_open(3)
diff --git a/libssh2/share/man/man3/libssh2_channel_direct_tcpip_ex.3 b/libssh2/share/man/man3/libssh2_channel_direct_tcpip_ex.3
new file mode 100644 (file)
index 0000000..09e6077
--- /dev/null
@@ -0,0 +1,39 @@
+.\" $Id: libssh2_channel_direct_tcpip_ex.3,v 1.1 2007/06/13 17:22:15 jehousley Exp $
+.\"
+.TH libssh2_channel_direct_tcpip_ex 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
+.SH NAME
+libssh2_channel_direct_tcpip_ex - Tunnel a TCP connection through an SSH session
+.SH SYNOPSIS
+#include <libssh2.h>
+
+LIBSSH2_CHANNEL * 
+libssh2_channel_direct_tcpip_ex(LIBSSH2_SESSION *session, const char *host, int port, const char *shost, int sport);
+
+LIBSSH2_CHANNEL * 
+libssh2_channel_direct_tcpip(LIBSSH2_SESSION *session, const char *host, int port);
+
+.SH DESCRIPTION
+/fIsession/fP - Session instance as returned by 
+.BR libssh2_session_init(3)
+
+/fIhost/fP - Third party host to connect to using the SSH host as a proxy.
+
+/fIport/fP - Port on third party host to connect to.
+
+/fIshost/fP - Host to tell the SSH server the connection originated on.
+
+/fIsport/fP - Port to tell the SSH server the connection originated from.
+
+Tunnel a TCP/IP connection through the SSH transport via the remote host to 
+a third party. Communication from the client to the SSH server remains 
+encrypted, communication from the server to the 3rd party host travels 
+in cleartext.
+
+.SH RETURN VALUE
+Pointer to a newly allocated LIBSSH2_CHANNEL instance, or NULL on errors.
+
+.SH ERRORS
+\fILIBSSH2_ERROR_ALLOC\fP -  An internal memory allocation call failed.
+
+.SH SEE ALSO
+.BR libssh2_session_init(3)
diff --git a/libssh2/share/man/man3/libssh2_channel_eof.3 b/libssh2/share/man/man3/libssh2_channel_eof.3
new file mode 100644 (file)
index 0000000..5066731
--- /dev/null
@@ -0,0 +1,18 @@
+.\" $Id: libssh2_channel_eof.3,v 1.1 2007/06/13 17:22:15 jehousley Exp $
+.\"
+.TH libssh2_channel_eof 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
+.SH NAME
+libssh2_channel_eof - check a channel's EOF status
+.SH SYNOPSIS
+#include <libssh2.h>
+
+int 
+libssh2_channel_eof(LIBSSH2_CHANNEL *channel);
+
+.SH DESCRIPTION
+\fIchannel\fP - active channel stream to set closed status on.
+
+Check if the remote host has sent an EOF status for the selected stream.
+
+.SH RETURN VALUE
+Returns 1 if the remote host has sent EOF, otherwise 0.
diff --git a/libssh2/share/man/man3/libssh2_channel_flush_ex.3 b/libssh2/share/man/man3/libssh2_channel_flush_ex.3
new file mode 100644 (file)
index 0000000..67de921
--- /dev/null
@@ -0,0 +1,34 @@
+.\" $Id: libssh2_channel_flush_ex.3,v 1.1 2007/06/13 19:53:09 jehousley Exp $
+.\"
+.TH libssh2_channel_flush_ex 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
+.SH NAME
+libssh2_channel_flush_ex - flush a channel
+.SH SYNOPSIS
+#include <libssh2.h>
+
+int 
+libssh2_channel_flush_ex(LIBSSH2_CHANNEL *channel, int streamid);
+
+int 
+libssh2_channel_flush(LIBSSH2_CHANNEL *channel);
+
+int 
+libssh2_channel_flush_stderr(LIBSSH2_CHANNEL *channel);
+
+.SH DESCRIPTION
+\fIchannel\fP - Active channel stream to flush.
+
+\fIstreamid\fP - Specific substream number to flush. Groups of substreams may 
+be flushed by passing on of the following Constants.
+.br
+\fBLIBSSH2_CHANNEL_FLUSH_EXTENDED_DATA\fP: Flush all extended data substreams
+.br
+\fBLIBSSH2_CHANNEL_FLUSH_ALL\fP: Flush all substreams
+
+Flush the read buffer for a given channel instance. Individual substreams may 
+be flushed by number or using one of the provided macros.
+
+.SH RETURN VALUE
+Return 0 on success or negative on failure.  It returns
+LIBSSH2_ERROR_EAGAIN when it would otherwise block. While
+LIBSSH2_ERROR_EAGAIN is a negative number, it isn't really a failure per se.
diff --git a/libssh2/share/man/man3/libssh2_channel_forward_accept.3 b/libssh2/share/man/man3/libssh2_channel_forward_accept.3
new file mode 100644 (file)
index 0000000..43232e5
--- /dev/null
@@ -0,0 +1,21 @@
+.\" $Id: libssh2_channel_forward_accept.3,v 1.5 2007/06/13 16:41:33 jehousley Exp $
+.\"
+.TH libssh2_channel_forward_accept 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
+.SH NAME
+libssh2_channel_forward_accept - accept a queued connection
+.SH SYNOPSIS
+#include <libssh2.h>
+
+LIBSSH2_CHANNEL *
+libssh2_channel_forward_accept(LIBSSH2_LISTENER *listener);
+
+.SH DESCRIPTION
+\fIlistener\fP is a forwarding listener instance as returned by
+\fBlibssh2_channel_forward_listen(3)\fP.
+.SH RETURN VALUE
+A newly allocated channel instance or NULL on failure.
+.SH ERRORS
+\fILIBSSH2_ERROR_EAGAIN\fP - Marked for non-blocking I/O but the call 
+would block.
+.SH SEE ALSO
+.BR libssh2_channel_forward_listen(3)
diff --git a/libssh2/share/man/man3/libssh2_channel_forward_cancel.3 b/libssh2/share/man/man3/libssh2_channel_forward_cancel.3
new file mode 100644 (file)
index 0000000..822e008
--- /dev/null
@@ -0,0 +1,29 @@
+.\" $Id: libssh2_channel_forward_cancel.3,v 1.1 2007/06/13 19:53:09 jehousley Exp $
+.\"
+.TH libssh2_channel_forward_cancel 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
+.SH NAME
+libssh2_channel_forward_cancel - cancel a forwarded TCP port
+.SH SYNOPSIS
+#include <libssh2.h>
+
+int 
+libssh2_channel_forward_cancel(LIBSSH2_LISTENER *listener);
+
+.SH DESCRIPTION
+/fIlistener/fP - Forwarding listener instance as returned by 
+.BR libssh2_channel_forward_listen(3)
+
+Instruct the remote host to stop listening for new connections on a previously requested host/port.
+
+.SH RETURN VALUE
+Return 0 on success or negative on failure.  It returns
+LIBSSH2_ERROR_EAGAIN when it would otherwise block. While
+LIBSSH2_ERROR_EAGAIN is a negative number, it isn't really a failure per se.
+
+.SH ERRORS
+\fILIBSSH2_ERROR_ALLOC\fP -  An internal memory allocation call failed.
+
+\fILIBSSH2_ERROR_SOCKET_SEND\fP - Unable to send data on socket.
+
+.SH SEE ALSO
+.BR libssh2_channel_forward_listen(3)
diff --git a/libssh2/share/man/man3/libssh2_channel_forward_listen_ex.3 b/libssh2/share/man/man3/libssh2_channel_forward_listen_ex.3
new file mode 100644 (file)
index 0000000..a719c9d
--- /dev/null
@@ -0,0 +1,48 @@
+.\" $Id: libssh2_channel_forward_listen_ex.3,v 1.7 2007/06/13 16:41:33 jehousley Exp $
+.\"
+.TH libssh2_channel_forward_listen_ex 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
+.SH NAME
+libssh2_channel_forward_listen_ex - listen to inbound connections
+.SH SYNOPSIS
+#include <libssh2.h>
+
+LIBSSH2_LISTENER * 
+libssh2_channel_forward_listen_ex(LIBSSH2_SESSION *session, char *host, int port, int *bound_port, int queue_maxsize);
+
+LIBSSH2_LISTENER * 
+libssh2_channel_forward_listen(LIBSSH2_SESSION *session, int port);
+
+.SH DESCRIPTION
+Instruct the remote SSH server to begin listening for inbound TCP/IP
+connections. New connections will be queued by the library until accepted by
+\fIlibssh2_channel_forward_accept(3)\fP.
+
+\fIsession\fP - instance as returned by libssh2_session_init(). 
+
+\fIhost\fP - specific address to bind to on the remote host. Binding to
+0.0.0.0 (default when NULL is passed) will bind to all available addresses.
+
+\fIport\fP - port to bind to on the remote host. When 0 is passed, the remote
+host will select the first available dynamic port.
+
+\fIbound_port\fP - Populated with the actual port bound on the remote
+host. Useful when requesting dynamic port numbers.
+
+\fIqueue_maxsize\fP - Maximum number of pending connections to queue before
+rejecting further attempts.
+
+\fIlibssh2_channel_forward_listen(3)\fP is a macro.
+.SH RETURN VALUE
+A newly allocated LIBSSH2_LISTENER instance or NULL on failure.
+.SH ERRORS
+\fILIBSSH2_ERROR_ALLOC\fP - An internal memory allocation call failed.
+
+\fILIBSSH2_ERROR_SOCKET_SEND\fP - Unable to send data on socket.
+
+\fILIBSSH2_ERROR_PROTO\fP - An invalid SSH protocol response was received on the socket.
+
+\fILIBSSH2_ERROR_REQUEST_DENIED\fP - The remote server refused the request.
+
+\fILIBSSH2_ERROR_EAGAIN\fP - Marked for non-blocking I/O but the call would block.
+.SH SEE ALSO
+.BR libssh2_channel_forward_accept(3)
diff --git a/libssh2/share/man/man3/libssh2_channel_free.3 b/libssh2/share/man/man3/libssh2_channel_free.3
new file mode 100644 (file)
index 0000000..73f8e1a
--- /dev/null
@@ -0,0 +1,27 @@
+.\" $Id: libssh2_channel_free.3,v 1.1 2007/06/13 20:09:15 jehousley Exp $
+.\"
+.TH libssh2_channel_free 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
+.SH NAME
+libssh2_channel_free - free all resources associated with a channel
+.SH SYNOPSIS
+#include <libssh2.h>
+
+int 
+libssh2_channel_free(LIBSSH2_CHANNEL *channel);
+
+.SH DESCRIPTION
+\fIchannel\fP - Channel stream to free.
+
+Release all resources associated with a channel stream. If the channel has 
+not yet been closed with 
+.BR libssh2_channel_close(3)
+, it will be called automatically so that the remote end may know that it 
+can safely free its own resources.
+
+.SH RETURN VALUE
+Return 0 on success or negative on failure.  It returns
+LIBSSH2_ERROR_EAGAIN when it would otherwise block. While
+LIBSSH2_ERROR_EAGAIN is a negative number, it isn't really a failure per se.
+
+.SH SEE ALSO
+.BR libssh2_channel_close(3)
diff --git a/libssh2/share/man/man3/libssh2_channel_get_exit_status.3 b/libssh2/share/man/man3/libssh2_channel_get_exit_status.3
new file mode 100644 (file)
index 0000000..ee070da
--- /dev/null
@@ -0,0 +1,20 @@
+.\" $Id: libssh2_channel_get_exit_status.3,v 1.1 2007/06/15 10:53:04 jehousley Exp $
+.\"
+.TH libssh2_channel_get_exit_status 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
+.SH NAME
+libssh2_channel_get_exit_status - get the remote exit code
+.SH SYNOPSIS
+#include <libssh2.h>
+
+int 
+libssh2_channel_get_exit_status(LIBSSH2_CHANNEL* channel)
+
+.SH DESCRIPTION
+\fIchannel\fP - Closed channel stream to retreive exit status from.
+
+Returns the exit code raised by the process running on the remote host at 
+the other end of the named channel. Note that the exit status may not be 
+available if the remote end has not yet set its status to closed.
+
+.SH RETURN VALUE
+Returns 0 on failure, otherwise the \fIExit Status\fP reported by remote host
diff --git a/libssh2/share/man/man3/libssh2_channel_handle_extended_data.3 b/libssh2/share/man/man3/libssh2_channel_handle_extended_data.3
new file mode 100644 (file)
index 0000000..9f556eb
--- /dev/null
@@ -0,0 +1,37 @@
+.\" $Id: libssh2_channel_handle_extended_data.3,v 1.1 2007/06/13 20:09:15 jehousley Exp $
+.\"
+.TH libssh2_channel_handle_extended_data 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
+.SH NAME
+libssh2_channel_handle_extended_data - set extended data handling mode
+.SH SYNOPSIS
+#include <libssh2.h>
+
+void 
+libssh2_channel_handle_extended_data(LIBSSH2_CHANNEL *channel, int ignore_mode);
+
+.SH DESCRIPTION
+\fIchannel\fP - Active channel stream to change extended data handling on.
+
+\fIignore_mode\fP - One of the three LIBSSH2_CHANNEL_EXTENDED_DATA_* Constants.
+.br
+\fBLIBSSH2_CHANNEL_EXTENDED_DATA_NORMAL\fP: Queue extended data for eventual 
+reading
+.br
+\fBLIBSSH2_CHANNEL_EXTENDED_DATA_MERGE\fP: Treat extended data and ordinary 
+data the same. Merge all substreams such that calls to 
+.BR libssh2_channel_read(3)
+will pull from all substreams on a first-in/first-out basis.
+.br
+\fBLIBSSH2_CHANNEL_EXTENDED_DATA_IGNORE\fP: Discard all extended data as it 
+arrives.
+
+Change how a channel deals with extended data packets. By default all 
+extended data is queued until read by 
+.BR libssh2_channel_read_ex(3)
+
+.SH RETURN VALUE
+None.
+
+.SH SEE ALSO
+.BR libssh2_channel_handle_extended_data2(3)
+.BR libssh2_channel_read_ex(3)
diff --git a/libssh2/share/man/man3/libssh2_channel_handle_extended_data2.3 b/libssh2/share/man/man3/libssh2_channel_handle_extended_data2.3
new file mode 100644 (file)
index 0000000..97d4fd0
--- /dev/null
@@ -0,0 +1,37 @@
+.\" $Id: libssh2_channel_handle_extended_data2.3,v 1.1 2007/06/13 20:09:15 jehousley Exp $
+.\"
+.TH libssh2_channel_handle_extended_data2 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
+.SH NAME
+libssh2_channel_handle_extended_data2 - set extended data handling mode
+.SH SYNOPSIS
+#include <libssh2.h>
+
+int 
+libssh2_channel_handle_extended_data2(LIBSSH2_CHANNEL *channel, int ignore_mode);
+
+.SH DESCRIPTION
+\fIchannel\fP - Active channel stream to change extended data handling on.
+
+\fIignore_mode\fP - One of the three LIBSSH2_CHANNEL_EXTENDED_DATA_* Constants.
+.br
+\fBLIBSSH2_CHANNEL_EXTENDED_DATA_NORMAL\fP: Queue extended data for eventual 
+reading
+.br
+\fBLIBSSH2_CHANNEL_EXTENDED_DATA_MERGE\fP: Treat extended data and ordinary 
+data the same. Merge all substreams such that calls to 
+.BR libssh2_channel_read(3)
+will pull from all substreams on a first-in/first-out basis.
+.br
+\fBLIBSSH2_CHANNEL_EXTENDED_DATA_IGNORE\fP: Discard all extended data as it 
+arrives.
+
+Change how a channel deals with extended data packets. By default all 
+extended data is queued until read by 
+.BR libssh2_channel_read_ex(3)
+
+.SH RETURN VALUE
+Return 0 on success or LIBSSH2_ERROR_EAGAIN when it would otherwise block.
+
+.SH SEE ALSO
+.BR libssh2_channel_handle_extended_data(3)
+.BR libssh2_channel_read_ex(3)
diff --git a/libssh2/share/man/man3/libssh2_channel_open_ex.3 b/libssh2/share/man/man3/libssh2_channel_open_ex.3
new file mode 100644 (file)
index 0000000..e152fb8
--- /dev/null
@@ -0,0 +1,56 @@
+.\" $Id: libssh2_channel_open_ex.3,v 1.1 2007/06/13 20:54:25 jehousley Exp $
+.\"
+.TH libssh2_channel_open_ex 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
+.SH NAME
+libssh2_channel_open_ex - establish a generic session channel
+.SH SYNOPSIS
+#include <libssh2.h>
+
+LIBSSH2_CHANNEL *
+libssh2_channel_open_ex(LIBSSH2_SESSION *session, const char *channel_type, unsigned int channel_type_len, unsigned int window_size, unsigned int packet_size, const char *message, unsigned int message_len);
+
+LIBSSH2_CHANNEL *
+libssh2_channel_open_session(session);
+
+.SH DESCRIPTION
+\fIsession\fP - Session instance as returned by 
+.BR libssh2_session_init(3)
+
+\fIchannel_type\fP - Channel type to open. Typically one of session, 
+direct-tcpip, or tcpip-forward. The SSH2 protocol allowed for additional 
+types including local, custom channel types.
+
+\fIchannel_type_len\fP - Length of channel_type
+
+\fIwindow_size\fP - Maximum amount of unacknowledged data remote host is 
+allowed to send before receiving an SSH_MSG_CHANNEL_WINDOW_ADJUST packet.
+
+\fIpacket_size\fP - Maximum number of bytes remote host is allowed to send 
+in a single SSH_MSG_CHANNEL_DATA or SSG_MSG_CHANNEL_EXTENDED_DATA packet.
+
+\fImessage\fP - Additional data as required by the selected channel_type.
+
+\fImessage_len\fP - Length of message parameter.
+
+Allocate a new channel for exchanging data with the server. This method is 
+typically called through its macroized form: 
+.BR libssh2_channel_open_session(3)
+or via 
+.BR libssh2_channel_direct_tcpip(3)
+or
+.BR libssh2_channel_forward_listen(3)
+
+.SH RETURN VALUE
+Pointer to a newly allocated LIBSSH2_CHANNEL instance, or NULL on errors.
+
+.SH ERRORS
+\fILIBSSH2_ERROR_ALLOC\fP -  An internal memory allocation call failed.
+
+\fILIBSSH2_ERROR_SOCKET_SEND\fP - Unable to send data on socket.
+
+\fILIBSSH2_ERROR_CHANNEL_FAILURE\fP - 
+
+\fILIBSSH2_ERROR_EAGAIN\fP - Marked for non-blocking I/O but the call would block.
+
+.SH SEE ALSO
+Add related functions
diff --git a/libssh2/share/man/man3/libssh2_channel_process_startup.3 b/libssh2/share/man/man3/libssh2_channel_process_startup.3
new file mode 100644 (file)
index 0000000..99342fd
--- /dev/null
@@ -0,0 +1,49 @@
+.\" $Id: libssh2_channel_process_startup.3,v 1.1 2007/06/13 20:54:25 jehousley Exp $
+.\"
+.TH libssh2_channel_process_startup 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
+.SH NAME
+libssh2_channel_process_startup - request a shell on a channel
+.SH SYNOPSIS
+#include <libssh2.h>
+
+int
+libssh2_channel_process_startup(LIBSSH2_CHANNEL *channel, const char *request, unsigned int request_len, const char *message, unsigned int message_len);
+
+int
+libssh2_channel_shell(LIBSSH2_CHANNEL *channel);
+
+int
+libssh2_channel_exec(LIBSSH2_CHANNEL *channel, const char *message);
+
+int
+libssh2_channel_subsystem(LIBSSH2_CHANNEL *channel, const char *message);
+
+.SH DESCRIPTION
+\fIchannel\fP - Active session channel instance.
+
+\fIrequest\fP - Type of process to startup. The SSH2 protocol currently 
+defines shell, exec, and subsystem as standard process services.
+
+\fIrequest_len\fP - Length of request parameter.
+
+\fImessage\fP - Request specific message data to include.
+
+\fImessage_len\fP - Length of message parameter.
+
+Initiate a request on a session type channel such as returned by 
+.BR libssh2_channel_open_session(3)
+
+.SH RETURN VALUE
+Return 0 on success or negative on failure.  It returns
+LIBSSH2_ERROR_EAGAIN when it would otherwise block. While
+LIBSSH2_ERROR_EAGAIN is a negative number, it isn't really a failure per se.
+
+.SH ERRORS
+\fILIBSSH2_ERROR_ALLOC\fP -  An internal memory allocation call failed.
+
+\fILIBSSH2_ERROR_SOCKET_SEND\fP - Unable to send data on socket.
+
+\fILIBSSH2_ERROR_CHANNEL_REQUEST_DENIED\fP - 
+
+.SH SEE ALSO
+.BR libssh2_channel_open_session(3)
diff --git a/libssh2/share/man/man3/libssh2_channel_read_ex.3 b/libssh2/share/man/man3/libssh2_channel_read_ex.3
new file mode 100644 (file)
index 0000000..4ecc6af
--- /dev/null
@@ -0,0 +1,44 @@
+.\" $Id: libssh2_channel_read_ex.3,v 1.10 2007/06/13 16:41:33 jehousley Exp $
+.\"
+.TH libssh2_channel_read_ex 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
+.SH NAME
+libssh2_channel_read_ex - read data from a channel stream
+.SH SYNOPSIS
+#include <libssh2.h>
+
+ssize_t
+libssh2_channel_read_ex(LIBSSH2_CHANNEL *channel, int stream_id, char *buf, size_t buflen);
+
+ssize_t
+libssh2_channel_read(LIBSSH2_CHANNEL *channel, char *buf, size_t buflen);
+
+ssize_t
+libssh2_channel_read_stderr(LIBSSH2_CHANNEL *channel, char *buf, size_t buflen);
+
+.SH DESCRIPTION
+Attempt to read data from an active channel stream. All channel streams have
+one standard I/O substream (stream_id == 0), and may have up to 2^32 extended
+data streams as identified by the selected \fIstream_id\fP. The SSH2 protocol
+currently defines a stream ID of 1 to be the stderr substream.
+
+\fIchannel\fP - active channel stream to read from. 
+
+\fIstream_id\fP - substream ID number (e.g. 0 or SSH_EXTENDED_DATA_STDERR) 
+
+\fIbuf\fP - pointer to storage buffer to read data into
+
+\fIbuflen\fP - size of the buf storage
+
+\fIlibssh2_channel_read(3)\fP and \fIlibssh2_channel_read_stderr(3)\fP are
+macros.
+.SH RETURN VALUE
+Actual number of bytes read or negative on failure. It returns
+LIBSSH2_ERROR_EAGAIN when it would otherwise block. While
+LIBSSH2_ERROR_EAGAIN is a negative number, it isn't really a failure per se.
+.SH ERRORS
+\fILIBSSH2_ERROR_SOCKET_SEND\fP - Unable to send data on socket.
+
+\fILIBSSH2_ERROR_CHANNEL_CLOSED\fP - The channel has been closed.
+
+.SH SEE ALSO
+.BR libssh2_poll_channel_read(3)
diff --git a/libssh2/share/man/man3/libssh2_channel_request_pty_ex.3 b/libssh2/share/man/man3/libssh2_channel_request_pty_ex.3
new file mode 100644 (file)
index 0000000..ba69a2d
--- /dev/null
@@ -0,0 +1,52 @@
+.\" $Id: libssh2_channel_request_pty_ex.3,v 1.1 2007/06/13 21:07:59 jehousley Exp $
+.\"
+.TH libssh2_channel_request_pty_ex 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
+.SH NAME
+libssh2_channel_request_pty_ex - short function description
+.SH SYNOPSIS
+#include <libssh2.h>
+
+int 
+libssh2_channel_request_pty_ex(LIBSSH2_CHANNEL *channel, const char *term, unsigned int term_len, const char *modes, unsigned int modes_len, int width, int height, int width_px, int height_px);
+
+int 
+libssh2_channel_request_pty(LIBSSH2_CHANNEL *channel, char *term);
+
+.SH DESCRIPTION
+\fIchannel\fP - Previously opened channel instance such as returned by 
+.BR libssh2_channel_open_session(3)
+
+\fIterm\fP - Terminal emulation (e.g. vt102, ansi, etc...)
+
+\fIterm_len\fP - Length of term parameter
+
+\fImodes\fP - Terminal mode modifier values
+
+\fImodes_len\fP - Length of modes parameter.
+
+\fIwidth\fP - Width of pty in characters
+
+\fIheight\fP - Height of pty in characters
+
+\fIwidth_px\fP - Width of pty in pixels
+
+\fIheight_px\fP - Height of pty in pixels
+
+Request a PTY on an established channel. Note that this does not make sense 
+for all channel types and may be ignored by the server despite returning 
+success.
+
+.SH RETURN VALUE
+Return 0 on success or negative on failure.  It returns
+LIBSSH2_ERROR_EAGAIN when it would otherwise block. While
+LIBSSH2_ERROR_EAGAIN is a negative number, it isn't really a failure per se.
+
+.SH ERRORS
+\fILIBSSH2_ERROR_ALLOC\fP -  An internal memory allocation call failed.
+
+\fILIBSSH2_ERROR_SOCKET_SEND\fP - Unable to send data on socket.
+
+\fILIBSSH2_ERROR_CHANNEL_REQUEST_DENIED\fP - 
+
+.SH SEE ALSO
+.BR libssh2_channel_open_session(3)
diff --git a/libssh2/share/man/man3/libssh2_channel_send_eof.3 b/libssh2/share/man/man3/libssh2_channel_send_eof.3
new file mode 100644 (file)
index 0000000..60bc55e
--- /dev/null
@@ -0,0 +1,26 @@
+.\" $Id: libssh2_channel_send_eof.3,v 1.1 2007/06/13 21:07:59 jehousley Exp $
+.\"
+.TH libssh2_channel_send_eof 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
+.SH NAME
+libssh2_channel_send_eof - send EOF to remote server
+.SH SYNOPSIS
+#include <libssh2.h>
+
+int 
+libssh2_channel_send_eof(LIBSSH2_CHANNEL *channel);
+
+.SH DESCRIPTION
+Tell the remote host that no further data will be sent on the specified 
+channel. Processes typically interpret this as a closed stdin descriptor.
+
+.SH RETURN VALUE
+Return 0 on success or negative on failure.  It returns
+LIBSSH2_ERROR_EAGAIN when it would otherwise block. While
+LIBSSH2_ERROR_EAGAIN is a negative number, it isn't really a failure per se.
+
+.SH ERRORS
+\fILIBSSH2_ERROR_SOCKET_SEND\fP - Unable to send data on socket.
+
+.SH SEE ALSO
+.BR libssh2_channel_wait_eof(3)
+.BR libssh2_channel_eof(3)
diff --git a/libssh2/share/man/man3/libssh2_channel_set_blocking.3 b/libssh2/share/man/man3/libssh2_channel_set_blocking.3
new file mode 100644 (file)
index 0000000..db2cc40
--- /dev/null
@@ -0,0 +1,28 @@
+.\" $Id: libssh2_channel_set_blocking.3,v 1.5 2007/06/14 17:23:13 jehousley Exp $
+.\"
+.TH libssh2_channel_set_blocking 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
+.SH NAME
+libssh2_channel_set_blocking - set or clear blocking mode on channel
+.SH SYNOPSIS
+#include <libssh2.h>
+
+void 
+libssh2_channel_set_blocking(LIBSSH2_CHANNEL *channel, int blocking);
+
+.SH DESCRIPTION
+\fIchannel\fP - channel stream to set or clean blocking status on.
+
+\fIblocking\fP - Set to a non-zero value to make the channel block, or zero to
+make it non-blocking.
+
+Currently this is just a short cut call to 
+.BR libssh2_session_set_blocking(3)
+and therefore will affect the session and all channels.
+
+.SH RETURN VALUE
+None
+
+.SH SEE ALSO
+.BR libssh2_session_set_blocking(3)
+.BR libssh2_channel_read_ex(3)
+.BR libssh2_channel_write_ex(3)
diff --git a/libssh2/share/man/man3/libssh2_channel_setenv_ex.3 b/libssh2/share/man/man3/libssh2_channel_setenv_ex.3
new file mode 100644 (file)
index 0000000..7688903
--- /dev/null
@@ -0,0 +1,43 @@
+.\" $Id: libssh2_channel_setenv_ex.3,v 1.1 2007/06/13 21:30:15 jehousley Exp $
+.\"
+.TH libssh2_channel_setenv_ex 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
+.SH NAME
+libssh2_channel_setenv_ex - set an environment variable on the channel
+.SH SYNOPSIS
+#include <libssh2.h>
+
+int
+libssh2_channel_setenv_ex(LIBSSH2_CHANNEL *channel, char *varname, unsigned int varname_len, const char *value, unsigned int value_len);
+
+int
+libssh2_channel_setenv(LIBSSH2_CHANNEL *channel, char *varname, const char *value);
+
+.SH DESCRIPTION
+\fIchannel\fP - Previously opened channel instance such as returned by 
+.BR libssh2_channel_open_session(3)
+
+\fIvarname\fP - Name of environment variable to set on the remote 
+channel instance.
+
+\fIvarname_len\fP - Length of passed varname parameter.
+
+\fIvalue\fP - Value to set varname to.
+
+\fIvalue_len\fP - Length of value parameter.
+
+Set an environment variable in the remote channel's process space. Note that this does not make sense for all channel types and may be ignored by the server despite returning success.
+
+.SH RETURN VALUE
+Return 0 on success or negative on failure.  It returns
+LIBSSH2_ERROR_EAGAIN when it would otherwise block. While
+LIBSSH2_ERROR_EAGAIN is a negative number, it isn't really a failure per se.
+
+.SH ERRORS
+\fILIBSSH2_ERROR_ALLOC\fP -  An internal memory allocation call failed.
+
+\fILIBSSH2_ERROR_SOCKET_SEND\fP - Unable to send data on socket.
+
+\fILIBSSH2_ERROR_CHANNEL_REQUEST_DENIED\fP - 
+
+.SH SEE ALSO
+.BR libssh2_channel_open_session(3)
diff --git a/libssh2/share/man/man3/libssh2_channel_wait_eof.3 b/libssh2/share/man/man3/libssh2_channel_wait_eof.3
new file mode 100644 (file)
index 0000000..fbe1c13
--- /dev/null
@@ -0,0 +1,21 @@
+.\" $Id: libssh2_channel_wait_eof.3,v 1.5 2007/06/13 16:41:33 jehousley Exp $
+.\"
+.TH libssh2_channel_wait_eof 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
+.SH NAME
+libssh2_channel_wait_eof - wait for the remote to reply to an EOF request
+.SH SYNOPSIS
+#include <libssh2.h>
+
+int 
+libssh2_channel_wait_eof(LIBSSH2_CHANNEL *channel);
+
+.SH DESCRIPTION
+Wait for the remote end to acknowledge an EOF request.
+
+.SH RETURN VALUE
+Return 0 on success or negative on failure. It returns
+LIBSSH2_ERROR_EAGAIN when it would otherwise block. While
+LIBSSH2_ERROR_EAGAIN is a negative number, it isn't really a failure per se.
+.SH SEE ALSO
+.BR libssh2_channel_send_eof(3)
+.BR libssh2_channel_eof(3)
diff --git a/libssh2/share/man/man3/libssh2_channel_x11_req_ex.3 b/libssh2/share/man/man3/libssh2_channel_x11_req_ex.3
new file mode 100644 (file)
index 0000000..7a45722
--- /dev/null
@@ -0,0 +1,46 @@
+.\" $Id: libssh2_channel_x11_req_ex.3,v 1.1 2007/06/13 21:30:15 jehousley Exp $
+.\"
+.TH libssh2_channel_x11_req_ex 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
+.SH NAME
+libssh2_channel_x11_req_ex - request an X11 forwarding channel
+.SH SYNOPSIS
+#include <libssh2.h>
+
+int
+libssh2_channel_x11_req_ex(LIBSSH2_CHANNEL *channel, int single_connection, const char *auth_proto, const char *auth_cookie, int screen_number);
+
+int
+libssh2_channel_x11_req(LIBSSH2_CHANNEL *channel, int screen_number);
+
+.SH DESCRIPTION
+\fIchannel\fP - Previously opened channel instance such as returned by 
+.BR libssh2_channel_open_session(3)
+
+\fIsingle_connection\fP - non-zero to only forward a single connection.
+
+\fIauth_proto\fP - X11 authentication protocol to use
+
+\fIauth_cookie\fP - the cookie (hexadecimal encoded).
+
+\fIscreen_number\fP - the XLL screen to forward
+
+Request an X11 forwarding on \fIchannel\fP. To use X11 forwarding, 
+.BR libssh2_session_callback_set(3)
+must first be called to set \fBLIBSSH2_CALLBACK_X11/fP. This callback will 
+be invoked when the remote host accepts the X11 forwarding.
+
+.SH RETURN VALUE
+Return 0 on success or negative on failure.  It returns
+LIBSSH2_ERROR_EAGAIN when it would otherwise block. While
+LIBSSH2_ERROR_EAGAIN is a negative number, it isn't really a failure per se.
+
+.SH ERRORS
+\fILIBSSH2_ERROR_ALLOC\fP -  An internal memory allocation call failed.
+
+\fILIBSSH2_ERROR_SOCKET_SEND\fP - Unable to send data on socket.
+
+\fILIBSSH2_ERROR_CHANNEL_REQUEST_DENIED\fP - 
+
+.SH SEE ALSO
+.BR libssh2_channel_open_session(3)
+.BR libssh2_session_callback_set(3)
diff --git a/libssh2/share/man/man3/libssh2_hostkey_hash.3 b/libssh2/share/man/man3/libssh2_hostkey_hash.3
new file mode 100644 (file)
index 0000000..0345d28
--- /dev/null
@@ -0,0 +1,29 @@
+.\" $Id: libssh2_hostkey_hash.3,v 1.1 2007/06/14 14:56:32 jehousley Exp $
+.\"
+.TH libssh2_hostkey_hash 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
+.SH NAME
+libssh2_hostkey_hash - return a hash of the remote host's key
+.SH SYNOPSIS
+#include <libssh2.h>
+
+const char *
+libssh2_hostkey_hash(LIBSSH2_SESSION *session, int hash_type);
+
+.SH DESCRIPTION
+\fIsession\fP - Session instance as returned by 
+.BR libssh2_session_init(3)
+
+\fIhash_type\fP - One of: \fBLIBSSH2_HOSTKEY_HASH_MD5\fP or 
+\fBLIBSSH2_HOSTKEY_HASH_SHA1\fP.
+
+Returns the computed digest of the remote system's hostkey. The length of 
+the returned string is hash_type specific (e.g. 16 bytes for MD5, 
+20 bytes for SHA1).
+
+.SH RETURN VALUE
+Computed hostkey hash value. or NULL if the session has not yet been started 
+up. (The hash consists of raw binary bytes, not hex digits, so is not 
+directly printable.)
+
+.SH SEE ALSO
+.BR libssh2_session_init(3)
diff --git a/libssh2/share/man/man3/libssh2_poll.3 b/libssh2/share/man/man3/libssh2_poll.3
new file mode 100644 (file)
index 0000000..eb9ae5a
--- /dev/null
@@ -0,0 +1,19 @@
+.\" $Id: libssh2_poll.3,v 1.3 2007/06/13 12:51:11 jehousley Exp $
+.\"
+.TH libssh2_poll 3 "14 Dec 2006" "libssh2 0.15" "libssh2 manual"
+.SH NAME
+libssh2_poll - poll for activity on a socket, channel or listener
+.SH SYNOPSIS
+#include <libssh2.h>
+
+int libssh2_poll(LIBSSH2_POLLFD *fds, unsigned int nfds, long timeout);
+.SH DESCRIPTION
+Poll for activity on a socket, channel, listener, or any combination of these
+three types. The calling semantics for this function generally match
+\fIpoll(2)\fP however the structure of fds is somewhat more complex in order
+to accommodate the disparate datatypes, POLLFD constants have been namespaced
+to avoid platform discrepancies, and revents has additional values defined.
+.SH "RETURN VALUE"
+Number of fds with interesting events.
+.SH SEE ALSO
+.BR libssh2_poll_channel_read(3)
diff --git a/libssh2/share/man/man3/libssh2_poll_channel_read.3 b/libssh2/share/man/man3/libssh2_poll_channel_read.3
new file mode 100644 (file)
index 0000000..7aa0325
--- /dev/null
@@ -0,0 +1,18 @@
+.\" $Id: libssh2_poll_channel_read.3,v 1.2 2007/06/13 12:51:11 jehousley Exp $
+.\"
+.TH libssh2_poll_channel_read 3 "14 Dec 2006" "libssh2 0.15" "libssh2 manual"
+.SH NAME
+libssh2_poll_channel_read - check if data is available
+.SH SYNOPSIS
+#include <libssh2.h>
+
+int libssh2_poll_channel_read(LIBSSH2_CHANNEL *channel, int extended);
+.SH DESCRIPTION
+\fIlibssh2_poll_channel_read(3)\fP checks to see if data is available in the
+\fIchannel\fP's read buffer. No attempt is made with this method to see if
+packets are available to be processed. For full polling support, use
+\fIlibssh2_poll(3)\fP.
+.SH RETURN VALUE
+Returns 1 when data is available and 0 otherwise.
+.SH SEE ALSO
+.BR libssh2_poll(3)
diff --git a/libssh2/share/man/man3/libssh2_scp_recv.3 b/libssh2/share/man/man3/libssh2_scp_recv.3
new file mode 100644 (file)
index 0000000..99f8cad
--- /dev/null
@@ -0,0 +1,40 @@
+.\" $Id: libssh2_scp_recv.3,v 1.1 2007/06/14 14:56:32 jehousley Exp $
+.\"
+.TH libssh2_scp_recv 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
+.SH NAME
+libssh2_scp_recv - request a remote file via SCP
+.SH SYNOPSIS
+#include <libssh2.h>
+
+LIBSSH2_CHANNEL *
+libssh2_scp_recv(LIBSSH2_SESSION *session, const char *path, struct stat *sb);
+
+.SH DESCRIPTION
+\fIsession\fP - Session instance as returned by 
+.BR libssh2_session_init(3)
+
+\fIpath\fP - Full path and filename of file to transfer
+
+\fIsb\fP - Populated with remote file's size, mode, mtime, and atime
+
+Request a file from the remote host via SCP. This 
+function acts as a wrapper calling 
+.BR libssh2_channel_open_session(3)
+,
+.BR libssh2_channel_exec(3)
+, and negotiating rcp protocol handshakes.
+
+.SH RETURN VALUE
+Pointer to a newly allocated LIBSSH2_CHANNEL instance, or NULL on errors.
+
+.SH ERRORS
+\fILIBSSH2_ERROR_ALLOC\fP -  An internal memory allocation call failed.
+
+\fILIBSSH2_ERROR_SCP_PROTOCOL\fP - 
+
+\fILIBSSH2_ERROR_EAGAIN\fP - Marked for non-blocking I/O but the call would block.
+
+.SH SEE ALSO
+.BR libssh2_session_init(3)
+.BR libssh2_channel_open_session(3)
+.BR libssh2_channel_exec(3)
diff --git a/libssh2/share/man/man3/libssh2_scp_send_ex.3 b/libssh2/share/man/man3/libssh2_scp_send_ex.3
new file mode 100644 (file)
index 0000000..1b12893
--- /dev/null
@@ -0,0 +1,52 @@
+.\" $Id: libssh2_scp_send_ex.3,v 1.1 2007/06/14 14:56:32 jehousley Exp $
+.\"
+.TH libssh2_scp_send_ex 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
+.SH NAME
+libssh2_scp_send_ex - Send a file via SCP
+.SH SYNOPSIS
+#include <libssh2.h>
+
+LIBSSH2_CHANNEL *
+libssh2_scp_send_ex(LIBSSH2_SESSION *session, const char *path, int mode, size_t size, long mtime, long atime);
+
+LIBSSH2_CHANNEL *
+libssh2_scp_send_ex(LIBSSH2_SESSION *session, const char *path, int mode, size_t size);
+
+.SH DESCRIPTION
+\fIsession\fP - Session instance as returned by 
+.BR libssh2_session_init(3)
+
+\fIpath\fP - Full path and filename of file to transfer
+
+\fImode\fP - File access mode to create file with
+
+\fIsize\fP - Size of file being transmitted (Must be known 
+ahead of time precisely)
+
+\fImtime\fP - mtime to assign to file being created
+
+\fIatime\fP - atime to assign to file being created (Set this and 
+mtime to zero to instruct remote host to use current time).
+
+Send a file to the remote host via SCP. This function 
+acts as a wrapper calling 
+.BR libssh2_channel_open_session(3)
+, 
+.BR libssh2_channel_exec(3)
+, and negotiating rcp protocol handshakes.
+
+.SH RETURN VALUE
+Pointer to a newly allocated LIBSSH2_CHANNEL instance, or NULL on errors.
+
+.SH ERRORS
+\fILIBSSH2_ERROR_ALLOC\fP -  An internal memory allocation call failed.
+
+\fILIBSSH2_ERROR_SOCKET_SEND\fP - Unable to send data on socket.
+
+\fILIBSSH2_ERROR_SCP_PROTOCOL\fP - 
+
+\fILIBSSH2_ERROR_EAGAIN\fP - Marked for non-blocking I/O but the call would block.
+
+.SH SEE ALSO
+.BR libssh2_channel_open_session(3)
+.BR libssh2_channel_exec(3)
diff --git a/libssh2/share/man/man3/libssh2_session_abstract.3 b/libssh2/share/man/man3/libssh2_session_abstract.3
new file mode 100644 (file)
index 0000000..b6ac5db
--- /dev/null
@@ -0,0 +1,26 @@
+.\" $Id: libssh2_session_abstract.3,v 1.1 2007/06/14 15:26:58 jehousley Exp $
+.\"
+.TH libssh2_session_abstract 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
+.SH NAME
+libssh2_session_abstract - return a pointer to a session's abstract pointer
+.SH SYNOPSIS
+#include <libssh2.h>
+
+void **
+libssh2_session_abstract(LIBSSH2_SESSION *session);
+
+.SH DESCRIPTION
+\fIsession\fP - Session instance as returned by 
+.BR libssh2_session_init_ex(3)
+
+Return a pointer to where the abstract pointer provided to 
+.BR libssh2_session_init_ex(3)
+ is stored. By providing a doubly de-referenced pointer, the internal 
+ storage of the session instance may be modified in place.
+
+.SH RETURN VALUE
+A pointer to session internal storage whos contents point to previously 
+provided abstract data.
+
+.SH SEE ALSO
+.BR libssh2_session_init_ex(3)
diff --git a/libssh2/share/man/man3/libssh2_session_callback_set.3 b/libssh2/share/man/man3/libssh2_session_callback_set.3
new file mode 100644 (file)
index 0000000..75e73fd
--- /dev/null
@@ -0,0 +1,30 @@
+.\" $Id: libssh2_session_callback_set.3,v 1.1 2007/06/14 15:26:58 jehousley Exp $
+.\"
+.TH libssh2_session_callback_set 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
+.SH NAME
+libssh2_session_callback_set - set a callback function
+.SH SYNOPSIS
+#include <libssh2.h>
+
+void *
+libssh2_session_callback_set(LIBSSH2_SESSION *session, int cbtype, void *callback);
+
+.SH DESCRIPTION
+\fIsession\fP - Session instance as returned by 
+.BR libssh2_session_init(3)
+
+\fIcbtype\fP - Callback type. One of the types listed in Callback Types.
+
+\fIcallback\fP - Pointer to custom callback function. The prototype for 
+this function must match the associated callback declaration macro.
+
+Sets a custom callback handler for a previously initialized session 
+object. Callbacks are triggered by the receipt of special packets at 
+the Transport layer. To disable a callback, set it to NULL.
+
+.SH RETURN VALUE
+Pointer to previous callback handler. Returns NULL if no 
+prior callback handler was set.
+
+.SH SEE ALSO
+.BR libssh2_session_init(3)
diff --git a/libssh2/share/man/man3/libssh2_session_disconnect_ex.3 b/libssh2/share/man/man3/libssh2_session_disconnect_ex.3
new file mode 100644 (file)
index 0000000..7548232
--- /dev/null
@@ -0,0 +1,40 @@
+.\" $Id: libssh2_session_disconnect_ex.3,v 1.4 2007/06/13 16:41:33 jehousley Exp $
+.\"
+.TH libssh2_session_disconnect_ex 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
+.SH NAME
+libssh2_session_disconnect_ex - terminate transport layer
+.SH SYNOPSIS
+#include <libssh2.h>
+
+int 
+libssh2_session_disconnect_ex(LIBSSH2_SESSION *session, int reason, const char *description, const char *lang);
+
+int 
+libssh2_session_disconnect(LIBSSH2_SESSION *session, const char *description);
+
+.SH DESCRIPTION
+\fIsession\fP - Session instance as returned by 
+.BR libssh2_session_init(3)
+
+\fIreason\fP - One of the Disconnect Reason constants.
+
+\fIdescription\fP - Human readable reason for disconnection.
+
+\fIlang\fP - Localization string describing the langauge/encoding of the description provided.
+
+Send a disconnect message to the remote host associated with \fIsession\fP, 
+along with a \fIreason\fP symbol and a verbose \fIdescription\fP.
+
+As a convenience, the macro 
+.BR libssh2_session_disconnect(3)
+is provided. It calls
+.BR libssh2_session_disconnect_ex(3)
+with \fIreason\fP set to SSH_DISCONNECT_BY_APPLICATION 
+and \fIlang\fP set to an empty string.
+
+.SH RETURN VALUE
+Return 0 on success or negative on failure.  It returns
+LIBSSH2_ERROR_EAGAIN when it would otherwise block. While
+LIBSSH2_ERROR_EAGAIN is a negative number, it isn't really a failure per se.
+.SH SEE ALSO
+.BR libssh2_session_init(3)
diff --git a/libssh2/share/man/man3/libssh2_session_free.3 b/libssh2/share/man/man3/libssh2_session_free.3
new file mode 100644 (file)
index 0000000..0ea781d
--- /dev/null
@@ -0,0 +1,21 @@
+.\" $Id: libssh2_session_free.3,v 1.4 2007/06/13 16:41:33 jehousley Exp $
+.\"
+.TH libssh2_session_free 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
+.SH NAME
+libssh2_session_free - frees resources associated with a session instance
+.SH SYNOPSIS
+#include <libssh2.h>
+
+int 
+libssh2_session_free(LIBSSH2_SESSION *session);
+.SH DESCRIPTION
+Frees resources associated with a session instance. Typically called after
+.BR libssh2_session_disconnect(3)
+
+.SH RETURN VALUE
+Return 0 on success or negative on failure.  It returns
+LIBSSH2_ERROR_EAGAIN when it would otherwise block. While
+LIBSSH2_ERROR_EAGAIN is a negative number, it isn't really a failure per se.
+.SH SEE ALSO
+.BR libssh2_session_init(3)
+.BR libssh2_session_disconnect(3)
diff --git a/libssh2/share/man/man3/libssh2_session_init.3 b/libssh2/share/man/man3/libssh2_session_init.3
new file mode 100644 (file)
index 0000000..651841d
--- /dev/null
@@ -0,0 +1,44 @@
+.\" $Id: libssh2_session_init.3,v 1.6 2007/06/13 16:41:33 jehousley Exp $
+.\"
+.TH libssh2_session_init_ex 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
+.SH NAME
+libssh2_session_init_ex - initializes an SSH session object
+.SH SYNOPSIS
+#include <libssh2.h>
+
+LIBSSH2_SESSION * 
+libssh2_session_init_ex(LIBSSH2_ALLOC_FUNC((*myalloc)), LIBSSH2_FREE_FUNC((*myfree)), LIBSSH2_REALLOC_FUNC((*myrealloc)), void *abstract);
+
+LIBSSH2_SESSION *
+libssh2_session_init(void);
+
+.SH DESCRIPTION
+\fImyalloc\fP - Custom allocator function. Refer to the section on Callbacks 
+for implementing an allocator callback. Pass a value of NULL to use the 
+default system allocator.
+
+\fImyfree\fP - Custom de-allocator function. Refer to the section on Callbacks 
+for implementing a deallocator callback. Pass a value of NULL to use the 
+default system deallocator.
+
+\fImyrealloc\fP - Custom re-allocator function. Refer to the section on 
+Callbacks for implementing a reallocator callback. Pass a value of NULL to 
+use the default system reallocator.
+
+\fIabstract\fP - Arbitrary pointer to application specific callback data. 
+This value will be passed to any callback function associated with the named 
+session instance.
+
+Initializes an SSH session object. By default system memory allocators
+(malloc(), free(), realloc()) will be used for any dynamically allocated memory
+blocks. Alternate memory allocation functions may be specified using the
+extended version of this API call, and/or optional application specific data
+may be attached to the session object.
+
+This method must be called first, prior to configuring session options or
+starting up an SSH session with a remote server.
+.SH RETURN VALUE
+Pointer to a newly allocated LIBSSH2_SESSION instance, or NULL on errors.
+.SH SEE ALSO
+.BR libssh2_session_free(3)
+.BR libssh2_session_startup(3)
diff --git a/libssh2/share/man/man3/libssh2_session_last_errno.3 b/libssh2/share/man/man3/libssh2_session_last_errno.3
new file mode 100644 (file)
index 0000000..3efa04b
--- /dev/null
@@ -0,0 +1,22 @@
+.\" $Id: libssh2_session_last_errno.3,v 1.1 2007/06/13 23:02:08 jehousley Exp $
+.\"
+.TH libssh2_session_last_errno 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
+.SH NAME
+libssh2_session_last_errno - get the most recent error number
+.SH SYNOPSIS
+#include <libssh2.h>
+
+int
+libssh2_session_last_errno(LIBSSH2_SESSION *session);
+
+.SH DESCRIPTION
+\fIsession\fP - Session instance as returned by 
+.BR libssh2_session_init(3)
+
+Determine the most recent error condition.
+
+.SH RETURN VALUE
+Numeric error code corresponding to the the Error Code constants.
+
+.SH SEE ALSO
+.BR libssh2_session_last_error(3)
diff --git a/libssh2/share/man/man3/libssh2_session_last_error.3 b/libssh2/share/man/man3/libssh2_session_last_error.3
new file mode 100644 (file)
index 0000000..8636ad2
--- /dev/null
@@ -0,0 +1,33 @@
+.\" $Id: libssh2_session_last_error.3,v 1.1 2007/06/13 23:02:08 jehousley Exp $
+.\"
+.TH libssh2_session_last_error 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
+.SH NAME
+libssh2_session_last_error - get the most recent error
+.SH SYNOPSIS
+#include <libssh2.h>
+
+int
+libssh2_session_last_error(LIBSSH2_SESSION *session, char **errmsg, int *errmsg_len, int want_buf);
+
+.SH DESCRIPTION
+\fIsession\fP - Session instance as returned by 
+.BR libssh2_session_init(3)
+
+\fIerrmsg\fP - If not NULL, is populated by reference with the human 
+readable form of the most recent error message.
+
+\fIerrmsg_len\fP - If not NULL, is populated by reference with the length 
+of errmsg. (The string is NUL-terminated, so the length is only useful as 
+an optimization, to avoid calling strlen.)
+
+\fIwant_buf\fP - If set to a non-zero value, "ownership" of the errmsg 
+buffer will be given to the calling scope. If necessary, the errmsg buffer 
+will be duplicated.
+
+Determine the most recent error condition and its cause.
+
+.SH RETURN VALUE
+Numeric error code corresponding to the the Error Code constants.
+
+.SH SEE ALSO
+.BR libssh2_session_last_errno(3)
diff --git a/libssh2/share/man/man3/libssh2_session_method_pref.3 b/libssh2/share/man/man3/libssh2_session_method_pref.3
new file mode 100644 (file)
index 0000000..17a9d4c
--- /dev/null
@@ -0,0 +1,42 @@
+.\" $Id: libssh2_session_method_pref.3,v 1.1 2007/06/14 15:26:58 jehousley Exp $
+.\"
+.TH libssh2_session_method_pref 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
+.SH NAME
+libssh2_session_method_pref - set preferred key exchange method
+.SH SYNOPSIS
+#include <libssh2.h>
+
+int 
+libssh2_session_method_pref(LIBSSH2_SESSION *session, int method_type, const char *prefs);
+
+.SH DESCRIPTION
+\fIsession\fP - Session instance as returned by 
+.BR libssh2_session_init(3)
+
+\fImethod_type\fP - One of the Method Type constants.
+
+\fIprefs\fP - Coma delimited list of preferred methods to use with 
+the most preferred listed first and the least preferred listed last. 
+If a method is listed which is not supported by libssh2 it will be 
+ignored and not sent to the remote host during protocol negotiation.
+
+Set preferred methods to be negotiated. These 
+preferrences must be set prior to calling 
+.BR libssh2_session_startup(3)
+as they are used during the protocol initiation phase.
+
+.SH RETURN VALUE
+Return 0 on success or negative on failure.  It returns
+LIBSSH2_ERROR_EAGAIN when it would otherwise block. While
+LIBSSH2_ERROR_EAGAIN is a negative number, it isn't really a failure per se.
+
+.SH ERRORS
+\fILIBSSH2_ERROR_INVAL\fP - The requested method type was invalid.
+
+\fILIBSSH2_ERROR_ALLOC\fP -  An internal memory allocation call failed.
+
+\fILIBSSH2_ERROR_METHOD_NOT_SUPPORTED\fP - The requested method is not supported.
+
+.SH SEE ALSO
+.BR libssh2_session_init(3)
+.BR libssh2_session_startup(3)
diff --git a/libssh2/share/man/man3/libssh2_session_methods.3 b/libssh2/share/man/man3/libssh2_session_methods.3
new file mode 100644 (file)
index 0000000..bfc7be5
--- /dev/null
@@ -0,0 +1,29 @@
+.\" $Id: libssh2_session_methods.3,v 1.1 2007/06/14 15:26:58 jehousley Exp $
+.\"
+.TH libssh2_session_methods 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
+.SH NAME
+libssh2_session_methods - return the currently active algorithms
+.SH SYNOPSIS
+#include <libssh2.h>
+
+const char *
+libssh2_session_methods(LIBSSH2_SESSION *session, int method_type);
+
+.SH DESCRIPTION
+\fIsession\fP - Session instance as returned by 
+.BR libssh2_session_init(3)
+
+\fImethod_type\fP - One of the Method Type constants.
+
+Return the actual method negotiated for a particular transport parameter.
+
+.SH RETURN VALUE
+Negotiated method or NULL if the session has not yet been started.
+
+.SH ERRORS
+\fILIBSSH2_ERROR_INVAL\fP - The requested method type was invalid.
+
+\fILIBSSH2_ERROR_METHOD_NONE\fP - 
+
+.SH SEE ALSO
+.BR libssh2_session_init(3)
diff --git a/libssh2/share/man/man3/libssh2_session_set_blocking.3 b/libssh2/share/man/man3/libssh2_session_set_blocking.3
new file mode 100644 (file)
index 0000000..3008be5
--- /dev/null
@@ -0,0 +1,32 @@
+.\" $Id: libssh2_session_set_blocking.3,v 1.1 2007/06/14 17:23:13 jehousley Exp $
+.\"
+.TH libssh2_session_set_blocking 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
+.SH NAME
+libssh2_session_set_blocking - set or clear blocking mode on session
+.SH SYNOPSIS
+#include <libssh2.h>
+
+void 
+libssh2_session_set_blocking(LIBSSH2_SESSION *session, int blocking);
+
+.SH DESCRIPTION
+\fIsession\fP - session instance as returned by 
+.BR libssh2_session_init(3)
+
+\fIblocking\fP - Set to a non-zero value to make the channel block, or zero to
+make it non-blocking.
+
+Set or clear blocking mode on the selected on the sessoin.  This will 
+instantly affect any channels associtated with this session. If a read is 
+performed on a session with no data currently available, a blocking 
+session will wait for data to arrive and return what it receives. 
+A non-blocking session will return immediately with an empty buffer.  
+If a write is performed on a session with
+no room for more data, a blocking session will wait for room.  A non-blocking
+session will return immediately without writing anything.
+
+.SH RETURN VALUE
+None
+
+.SH SEE ALSO
+.BR libssh2_session_init(3)
diff --git a/libssh2/share/man/man3/libssh2_session_startup.3 b/libssh2/share/man/man3/libssh2_session_startup.3
new file mode 100644 (file)
index 0000000..42c3bbe
--- /dev/null
@@ -0,0 +1,42 @@
+.\" $Id: libssh2_session_startup.3,v 1.6 2007/06/13 16:41:33 jehousley Exp $
+.\"
+.TH libssh2_session_startup 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
+.SH NAME
+libssh2_session_startup - begin transport layer
+.SH SYNOPSIS
+#include <libssh2.h>
+
+int 
+libssh2_session_startup(LIBSSH2_SESSION *session, int socket);
+
+.SH DESCRIPTION
+\fIsession\fP - Session instance as returned by 
+.BR libssh2_session_init(3)
+
+\fIsocket\fP - Connected socket descriptor. Typically a TCP connection 
+though the protocol allows for any reliable transport and the library will 
+attempt to use any berkeley socket.
+
+Begin transport layer protocol negotiation with the connected host.
+.SH RETURN VALUE
+Returns 0 on success, negative on failure.
+.SH ERRORS
+\fILIBSSH2_ERROR_SOCKET_NONE\fP - The socket is invalid.
+
+\fILIBSSH2_ERROR_BANNER_SEND\fP - Unable to send banner to remote host.
+
+\fILIBSSH2_ERROR_KEX_FAILURE\fP - >Encryption key exchange with the remote 
+host failed.
+
+\fILIBSSH2_ERROR_SOCKET_SEND\fP - Unable to send data on socket.
+
+\fILIBSSH2_ERROR_SOCKET_DISCONNECT\fP - The socket was disconnected.
+
+\fILIBSSH2_ERROR_PROTO\fP - An invalid SSH protocol response was received on 
+the socket.
+
+\fILIBSSH2_ERROR_EAGAIN\fP - Marked for non-blocking I/O but the call would block.
+
+.SH SEE ALSO
+.BR libssh2_session_free(3)
+.BR libssh2_session_init(3)
diff --git a/libssh2/share/man/man3/libssh2_sftp_close_handle.3 b/libssh2/share/man/man3/libssh2_sftp_close_handle.3
new file mode 100644 (file)
index 0000000..37c87e2
--- /dev/null
@@ -0,0 +1,52 @@
+.\" $Id: libssh2_sftp_close_handle.3,v 1.1 2007/06/14 15:45:03 jehousley Exp $
+.\"
+.TH libssh2_sftp_close_handle 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
+.SH NAME
+libssh2_sftp_close_handle - close filehandle
+.SH SYNOPSIS
+#include <libssh2.h>
+#include <libssh2_sftp.h>
+
+int 
+libssh2_sftp_close_handle(LIBSSH2_SFTP_HANDLE *handle);
+
+int 
+libssh2_sftp_close(LIBSSH2_SFTP_HANDLE *handle);
+
+int 
+libssh2_sftp_closedir(LIBSSH2_SFTP_HANDLE *handle);
+
+.SH DESCRIPTION
+\fIhandle\fP - SFTP File Handle as returned by 
+.BR libssh2_sftp_open(3)
+or
+.BR libssh2_sftp_opendir(3)
+
+Close an active LIBSSH2_SFTP_HANDLE. Because files and directories 
+share the same underlying storage mechanism these methods may be used 
+interchangably. It is recommended that 
+.BR libssh2_sftp_close()
+be used for files and that 
+.BR libssh2_sftp_closedir()
+be used for directories so that future changes in the library 
+may cause minimal disruption.
+
+.SH RETURN VALUE
+Return 0 on success or negative on failure.  It returns
+LIBSSH2_ERROR_EAGAIN when it would otherwise block. While
+LIBSSH2_ERROR_EAGAIN is a negative number, it isn't really a failure per se.
+
+.SH ERRORS
+\fILIBSSH2_ERROR_ALLOC\fP -  An internal memory allocation call failed.
+
+\fILIBSSH2_ERROR_SOCKET_SEND\fP - Unable to send data on socket.
+
+\fILIBSSH2_ERROR_SOCKET_TIMEOUT\fP - 
+
+\fILIBSSH2_ERROR_SFTP_PROTOCOL\fP - An invalid SFTP protocol response was 
+received on the socket, or an SFTP operation caused an errorcode to 
+be returned by the server.
+
+.SH SEE ALSO
+.BR libssh2_sftp_open(3)
+.BR libssh2_sftp_opendir(3)
diff --git a/libssh2/share/man/man3/libssh2_sftp_fstat_ex.3 b/libssh2/share/man/man3/libssh2_sftp_fstat_ex.3
new file mode 100644 (file)
index 0000000..45e4f4f
--- /dev/null
@@ -0,0 +1,49 @@
+.\" $Id: libssh2_sftp_fstat_ex.3,v 1.1 2007/06/14 15:45:03 jehousley Exp $
+.\"
+.TH libssh2_sftp_fstat_ex 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
+.SH NAME
+libssh2_sftp_fstat_ex - get or set attributes on a file handle
+.SH SYNOPSIS
+#include <libssh2.h>
+#include <libssh2_sftp.h>
+
+int 
+libssh2_sftp_fstat_ex(LIBSSH2_SFTP_HANDLE *handle, LIBSSH2_SFTP_ATTRIBUTES *attrs, int setstat)
+
+int 
+libssh2_sftp_fstat(LIBSSH2_SFTP_HANDLE *handle, LIBSSH2_SFTP_ATTRIBUTES *attrs)
+
+int 
+libssh2_sftp_fsetstat(LIBSSH2_SFTP_HANDLE *handle, LIBSSH2_SFTP_ATTRIBUTES *attrs)
+
+.SH DESCRIPTION
+\fIhandle\fP - SFTP File Handle as returned by 
+.BR libssh2_sftp_open(3)
+
+\fIattrs\fP - Pointer to attribute structure to set file metadata 
+from or into depending on the value of setstat.
+
+\fIsetstat\fP - When non-zero, the file's metadata will be updated 
+with the data found in attrs according to the values of attrs->flags 
+and other relevant member attributes.
+
+Get or Set statbuf type data for a given LIBSSH2_SFTP_HANDLE instance.
+
+.SH RETURN VALUE
+Return 0 on success or negative on failure.  It returns
+LIBSSH2_ERROR_EAGAIN when it would otherwise block. While
+LIBSSH2_ERROR_EAGAIN is a negative number, it isn't really a failure per se.
+
+.SH ERRORS
+\fILIBSSH2_ERROR_ALLOC\fP -  An internal memory allocation call failed.
+
+\fILIBSSH2_ERROR_SOCKET_SEND\fP - Unable to send data on socket.
+
+\fILIBSSH2_ERROR_SOCKET_TIMEOUT\fP - 
+
+\fILIBSSH2_ERROR_SFTP_PROTOCOL\fP - An invalid SFTP protocol response was 
+received on the socket, or an SFTP operation caused an errorcode to 
+be returned by the server.
+
+.SH SEE ALSO
+.BR libssh2_sftp_open(3)
diff --git a/libssh2/share/man/man3/libssh2_sftp_init.3 b/libssh2/share/man/man3/libssh2_sftp_init.3
new file mode 100644 (file)
index 0000000..c66a6d4
--- /dev/null
@@ -0,0 +1,41 @@
+.\" $Id: libssh2_sftp_init.3,v 1.6 2007/06/13 16:41:33 jehousley Exp $
+.\"
+.TH libssh2_sftp_init 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
+.SH NAME
+libssh2_sftp_init - 
+.SH SYNOPSIS
+#include <libssh2.h>
+#include <libssh2_sftp.h>
+
+LIBSSH2_SFTP *
+libssh2_sftp_init(LIBSSH2_SESSION *session);
+
+.SH DESCRIPTION
+\fIsession\fP - Session instance as returned by 
+.BR libssh2_session_init(3)
+
+Open a channel and initialize the SFTP subsystem. Although the SFTP subsystem
+operates over the same type of channel as those exported by the Channel API,
+the protocol itself implements its own unique binary packet protocol which
+must be managed with the libssh2_sftp_*() family of functions. When an SFTP
+session is complete, it must be destroyed using the
+.BR libssh2_sftp_shutdown(3)
+function.
+.SH RETURN VALUE
+A pointer to the newly allocated SFTP instance or NULL on failure.
+.SH ERRORS
+\fILIBSSH2_ERROR_ALLOC\fP -  An internal memory allocation call failed.
+
+\fILIBSSH2_ERROR_SOCKET_SEND\fP - Unable to send data on socket.
+
+\fILIBSSH2_ERROR_SOCKET_TIMEOUT\fP - 
+
+\fILIBSSH2_ERROR_SFTP_PROTOCOL\fP - An invalid SFTP protocol response was 
+received on the socket, or an SFTP operation caused an errorcode to be 
+returned by the server.
+
+\fILIBSSH2_ERROR_EAGAIN\fP - Marked for non-blocking I/O but the call would block.
+
+.SH SEE ALSO
+.BR libssh2_sftp_shutdown(3)
+.BR libssh2_sftp_open_ex(3)
diff --git a/libssh2/share/man/man3/libssh2_sftp_last_error.3 b/libssh2/share/man/man3/libssh2_sftp_last_error.3
new file mode 100644 (file)
index 0000000..725262a
--- /dev/null
@@ -0,0 +1,23 @@
+.\" $Id: libssh2_sftp_last_error.3,v 1.1 2007/06/14 16:08:43 jehousley Exp $
+.\"
+.TH libssh2_sftp_last_error 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
+.SH NAME
+libssh2_sftp_last_error - return the last SFTP-specific error code
+.SH SYNOPSIS
+#include <libssh2.h>
+#include <libssh2_sftp.h>
+
+unsigned long 
+libssh2_sftp_last_error(LIBSSH2_SFTP *sftp);
+
+.SH DESCRIPTION
+\fIsftp\fP - SFTP instance as returned by 
+.BR libssh2_sftp_init(3)
+
+Determines the last error code produced by the SFTP layer.
+
+.SH RETURN VALUE
+Current error code state of the SFTP instance.
+
+.SH SEE ALSO
+.BR libssh2_sftp_init(3)
diff --git a/libssh2/share/man/man3/libssh2_sftp_mkdir_ex.3 b/libssh2/share/man/man3/libssh2_sftp_mkdir_ex.3
new file mode 100644 (file)
index 0000000..b0936f0
--- /dev/null
@@ -0,0 +1,46 @@
+.\" $Id: libssh2_sftp_mkdir_ex.3,v 1.6 2007/06/13 16:41:33 jehousley Exp $
+.\"
+.TH libssh2_sftp_mkdir_ex 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
+.SH NAME
+libssh2_sftp_mkdir_ex - create a directory on the remote file system
+.SH SYNOPSIS
+#include <libssh2.h>
+#include <libssh2_sftp.h>
+
+int 
+libssh2_sftp_mkdir_ex(LIBSSH2_SFTP *sftp, const char *path, unsigned int path_len, long mode);
+
+int 
+libssh2_sftp_mkdir(LIBSSH2_SFTP *sftp, const char *path, long mode);
+
+.SH DESCRIPTION
+\fIsftp\fP - SFTP instance as returned by 
+.BR libssh2_sftp_init(3)
+
+\fIpath\fP - full path of the new directory to create. Note that the new 
+directory's parents must all exist priot to making this call.
+
+\fIpath_len\fP - length of the full path of the new directory to create.
+
+\fImode\fP - directory creation mode (e.g. 0755).
+
+Create a directory on the remote file system.
+
+.SH RETURN VALUE
+Return 0 on success or negative on failure.
+LIBSSH2_ERROR_EAGAIN when it would otherwise block. While
+LIBSSH2_ERROR_EAGAIN is a negative number, it isn't really a failure per se.
+
+.SH ERRORS
+\fILIBSSH2_ERROR_ALLOC\fP -  An internal memory allocation call failed.
+
+\fILIBSSH2_ERROR_SOCKET_SEND\fP - Unable to send data on socket.
+
+\fILIBSSH2_ERROR_SOCKET_TIMEOUT\fP - 
+
+\fILIBSSH2_ERROR_SFTP_PROTOCOL\fP - An invalid SFTP protocol response was 
+received on the socket, or an SFTP operation caused an errorcode to be 
+returned by the server.
+
+.SH SEE ALSO
+.BR libssh2_sftp_opendir(3)
diff --git a/libssh2/share/man/man3/libssh2_sftp_open_ex.3 b/libssh2/share/man/man3/libssh2_sftp_open_ex.3
new file mode 100644 (file)
index 0000000..e70c275
--- /dev/null
@@ -0,0 +1,53 @@
+.\" $Id: libssh2_sftp_open_ex.3,v 1.8 2007/06/13 16:41:33 jehousley Exp $
+.\"
+.TH libssh2_sftp_open_ex 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
+.SH NAME
+libssh2_sftp_open - 
+.SH SYNOPSIS
+#include <libssh2.h>
+#include <libssh2_sftp.h>
+
+LIBSSH2_SFTP_HANDLE *
+libssh2_sftp_open_ex(LIBSSH2_SFTP *sftp, const char *filename, unsigned int filename_len, unsigned long flags, long mode, int open_type);
+
+LIBSSH2_SFTP_HANDLE *
+libssh2_sftp_open(LIBSSH2_SFTP *sftp, const char *filename, unsigned long flags, long mode);
+
+LIBSSH2_SFTP_HANDLE *
+libssh2_sftp_opendir(LIBSSH2_SFTP *sftp, const char *path);
+
+.SH DESCRIPTION
+\fIsftp\fP - SFTP instance as returned by 
+.BR libssh2_sftp_init(3)
+
+\fIfilename\fP - Remote file/directory resource to open 
+
+\fIfilename_len\fP - Length of filename 
+
+\fIflags\fP - Any (reasonable) combination of the LIBSSH2_FXF_* constants
+corresponding fopen modes.
+
+\fImode\fP - POSIX file permissions to assign if the file is being newly
+created.
+
+\fIopen_type\fP - Either of LIBSSH2_SFTP_OPENFILE (to open a file) or
+LIBSSH2_SFTP_OPENDIR (to open a directory).
+.SH RETURN VALUE
+A pointer to the newly created LIBSSH2_SFTP_HANDLE instance or NULL on
+failure.
+.SH ERRORS
+\fILIBSSH2_ERROR_ALLOC\fP -  An internal memory allocation call failed.
+
+\fILIBSSH2_ERROR_SOCKET_SEND\fP - Unable to send data on socket.
+
+\fILIBSSH2_ERROR_SOCKET_TIMEOUT\fP - 
+
+\fILIBSSH2_ERROR_SFTP_PROTOCOL\fP - An invalid SFTP protocol response was 
+received on the socket, or an SFTP operation caused an errorcode to be 
+returned by the server.
+
+\fILIBSSH2_ERROR_EAGAIN\fP - Marked for non-blocking I/O but the call would block.
+
+.SH SEE ALSO
+.BR libssh_sftp_close(3)
+
diff --git a/libssh2/share/man/man3/libssh2_sftp_read.3 b/libssh2/share/man/man3/libssh2_sftp_read.3
new file mode 100644 (file)
index 0000000..15d7473
--- /dev/null
@@ -0,0 +1,47 @@
+.\" $Id: libssh2_sftp_read.3,v 1.8 2007/06/13 16:41:33 jehousley Exp $
+.\"
+.TH libssh2_sftp_read 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
+.SH NAME
+libssh2_sftp_read - read data from an SFTP handle
+.SH SYNOPSIS
+#include <libssh2.h>
+#include <libssh2_sftp.h>
+
+ssize_t 
+libssh2_sftp_read(LIBSSH2_SFTP_HANDLE *handle, char *buffer, size_t buffer_maxlen);
+
+.SH DESCRIPTION
+\fIhandle\fP is the SFTP File Handle as returned by 
+.BR libssh2_sftp_open(3)
+
+\fIbuffer\fP is a pointer to a pre-allocated buffer of at least
+
+\fIbuffer_maxlen\fP bytes to read data into.
+
+Reads a block of data from an LIBSSH2_SFTP_HANDLE. This method is modelled
+after the POSIX 
+.BR read(2)
+function and uses the same calling semantics. 
+.BR libssh2_sftp_read(3)
+will attempt to read as much as possible however it may not fill all of 
+buffer if the file pointer reaches the end or
+if further reads would cause the socket to block.
+
+.SH RETURN VALUE
+Number of bytes actually populated into buffer, or negative on failure.  
+It returns LIBSSH2_ERROR_EAGAIN when it would otherwise block. While
+LIBSSH2_ERROR_EAGAIN is a negative number, it isn't really a failure per se.
+.SH ERRORS
+\fILIBSSH2_ERROR_ALLOC\fP -  An internal memory allocation call failed.
+
+\fILIBSSH2_ERROR_SOCKET_SEND\fP - Unable to send data on socket.
+
+\fILIBSSH2_ERROR_SOCKET_TIMEOUT\fP - 
+
+\fILIBSSH2_ERROR_SFTP_PROTOCOL\fP - An invalid SFTP protocol response was 
+received on the socket, or an SFTP operation caused an errorcode to be 
+returned by the server.
+
+.SH SEE ALSO
+.BR libssh2_sftp_open(3)
+.BR libssh2_sftp_readnb(3)
diff --git a/libssh2/share/man/man3/libssh2_sftp_readdir.3 b/libssh2/share/man/man3/libssh2_sftp_readdir.3
new file mode 100644 (file)
index 0000000..b85c4cb
--- /dev/null
@@ -0,0 +1,60 @@
+.\" $Id: libssh2_sftp_readdir.3,v 1.11 2007/07/04 10:44:40 jehousley Exp $
+.\"
+.TH libssh2_sftp_readdir_ex 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
+.SH NAME
+libssh2_sftp_readdir_ex - read directory data from an SFTP handle
+.SH SYNOPSIS
+#include <libssh2.h>
+#include <libssh2_sftp.h>
+
+int 
+libssh2_sftp_readdir_ex(LIBSSH2_SFTP_HANDLE *handle, char *buffer, size_t buffer_maxlen, char *longentry, size_t longentry_maxlen, LIBSSH2_SFTP_ATTRIBUTES *attrs);
+
+int 
+libssh2_sftp_readdir(LIBSSH2_SFTP_HANDLE *handle, char *buffer, size_t buffer_maxlen, LIBSSH2_SFTP_ATTRIBUTES *attrs);
+
+.SH DESCRIPTION
+\fIhandle\fP - is the SFTP File Handle as returned by 
+.BR libssh2_sftp_diropen(3)
+
+\fIbuffer\fP - is a pointer to a pre-allocated buffer of at least
+\fIbuffer_maxlen\fP bytes to read data into.
+
+\fIbuffer_maxlen\fP - is the length of buffer in bytes. If the length of the 
+filename is longer than the space provided by buffer_maxlen it will be 
+truncated to fit.
+
+\fIlongentry\fP - is a pointer to a pre-allocated buffer of at least
+\fIlongentry_maxlen\fP bytes to read data into.
+
+\fIlongentry_maxlen\fP - is the length of longentry in bytes. If the length 
+of the full directory entry is longer than the space provided by 
+longentry_maxlen it will be truncated to fit.
+
+\fIattrs\fP - is a pointer to LIBSSH2_SFTP_ATTRIBUTES storage to populate 
+statbuf style data into.
+
+Read a block of data from a LIBSSH2_SFTP_HANDLE. This method is modeled 
+after the POSIX 
+.BR readdir(2)
+however, it uses a variable sized directory entry (filename) buffer and 
+returns statbuf type data in the same call.
+
+.SH RETURN VALUE
+Number of bytes actually populated into buffer, or negative on failure.  It returns
+LIBSSH2_ERROR_EAGAIN when it would otherwise block. While
+LIBSSH2_ERROR_EAGAIN is a negative number, it isn't really a failure per se.
+.SH ERRORS
+\fILIBSSH2_ERROR_ALLOC\fP -  An internal memory allocation call failed.
+
+\fILIBSSH2_ERROR_SOCKET_SEND\fP - Unable to send data on socket.
+
+\fILIBSSH2_ERROR_SOCKET_TIMEOUT\fP - 
+
+\fILIBSSH2_ERROR_SFTP_PROTOCOL\fP - An invalid SFTP protocol response was 
+received on the socket, or an SFTP operation caused an errorcode to be 
+returned by the server.
+
+.SH SEE ALSO
+.BR libssh2_sftp_opendir(3)
+.BR libssh2_sftp_closedir(3)
diff --git a/libssh2/share/man/man3/libssh2_sftp_rename_ex.3 b/libssh2/share/man/man3/libssh2_sftp_rename_ex.3
new file mode 100644 (file)
index 0000000..4277e48
--- /dev/null
@@ -0,0 +1,58 @@
+.\" $Id: libssh2_sftp_rename_ex.3,v 1.1 2007/06/14 16:08:43 jehousley Exp $
+.\"
+.TH libssh2_sftp_rename_ex 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
+.SH NAME
+libssh2_sftp_rename_ex - rename a file
+.SH SYNOPSIS
+#include <libssh2.h>
+#include <libssh2_sftp.h>
+
+int 
+libssh2_sftp_rename_ex(LIBSSH2_SFTP *sftp, const char *source_filename, unsigned int source_filename_len, const char *dest_filename, unsigned int dest_filename_len, long flags);
+
+int 
+libssh2_sftp_rename_ex(LIBSSH2_SFTP *sftp, const char *source_filename, const char *dest_filename);
+
+.SH DESCRIPTION
+\fIsftp\fP - SFTP instance as returned by 
+.BR libssh2_sftp_init(3)
+
+\fIsourcefile\fP - Path and name of the existing filesystem entry
+
+\fIsourcefile_len\fP - Length of the path and name of the existing 
+filesystem entry
+
+\fIdestfile\fP - Path and name of the target filesystem entry
+
+\fIdestfile_len\fP - Length of the path and name of the target 
+filesystem entry
+
+\fIflags\fP - 
+Bitmask flags made up of LIBSSH2_SFTP_RENAME_* constants.
+
+Rename a filesystem object on the remote filesystem. The semantics of 
+this command typically include the ability to move a filsystem object 
+between folders and/or filesystem mounts. If the LIBSSH2_SFTP_RENAME_OVERWRITE 
+flag is not set and the destfile entry already exists, the operation 
+will fail. Use of the other two flags indicate a preference (but not a 
+requirement) for the remote end to perform an atomic rename operation 
+and/or using native system calls when possible.
+
+.SH RETURN VALUE
+Return 0 on success or negative on failure.  It returns
+LIBSSH2_ERROR_EAGAIN when it would otherwise block. While
+LIBSSH2_ERROR_EAGAIN is a negative number, it isn't really a failure per se.
+
+.SH ERRORS
+\fILIBSSH2_ERROR_ALLOC\fP -  An internal memory allocation call failed.
+
+\fILIBSSH2_ERROR_SOCKET_SEND\fP - Unable to send data on socket.
+
+\fILIBSSH2_ERROR_SOCKET_TIMEOUT\fP - 
+
+\fILIBSSH2_ERROR_SFTP_PROTOCOL\fP - An invalid SFTP protocol response was 
+received on the socket, or an SFTP operation caused an errorcode to 
+be returned by the server.
+
+.SH SEE ALSO
+.BR libssh2_sftp_init(3)
diff --git a/libssh2/share/man/man3/libssh2_sftp_rmdir_ex.3 b/libssh2/share/man/man3/libssh2_sftp_rmdir_ex.3
new file mode 100644 (file)
index 0000000..5e5bf21
--- /dev/null
@@ -0,0 +1,43 @@
+.\" $Id: libssh2_sftp_rmdir_ex.3,v 1.1 2007/06/14 16:08:43 jehousley Exp $
+.\"
+.TH libssh2_sftp_rmdir_ex 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
+.SH NAME
+libssh2_sftp_rmdir_ex - rename a file
+.SH SYNOPSIS
+#include <libssh2.h>
+#include <libssh2_sftp.h>
+
+int 
+libssh2_sftp_rmdir_ex(LIBSSH2_SFTP *sftp, const char *path, unsigned int path_len);
+
+int 
+libssh2_sftp_rmdir_ex(LIBSSH2_SFTP *sftp, const char *path);
+
+.SH DESCRIPTION
+\fIsftp\fP - SFTP instance as returned by 
+.BR libssh2_sftp_init(3)
+
+\fIsourcefile\fP - Full path of the existing directory to remove.
+
+\fIsourcefile_len\fP - Length of the full path of the existing directory to remove. 
+
+Remove a directory from the remote file system.
+
+.SH RETURN VALUE
+Return 0 on success or negative on failure.  It returns
+LIBSSH2_ERROR_EAGAIN when it would otherwise block. While
+LIBSSH2_ERROR_EAGAIN is a negative number, it isn't really a failure per se.
+
+.SH ERRORS
+\fILIBSSH2_ERROR_ALLOC\fP -  An internal memory allocation call failed.
+
+\fILIBSSH2_ERROR_SOCKET_SEND\fP - Unable to send data on socket.
+
+\fILIBSSH2_ERROR_SOCKET_TIMEOUT\fP - 
+
+\fILIBSSH2_ERROR_SFTP_PROTOCOL\fP - An invalid SFTP protocol response was 
+received on the socket, or an SFTP operation caused an errorcode to 
+be returned by the server.
+
+.SH SEE ALSO
+.BR libssh2_sftp_init(3)
diff --git a/libssh2/share/man/man3/libssh2_sftp_seek.3 b/libssh2/share/man/man3/libssh2_sftp_seek.3
new file mode 100644 (file)
index 0000000..62eaeb9
--- /dev/null
@@ -0,0 +1,26 @@
+.\" $Id: libssh2_sftp_seek.3,v 1.1 2007/06/14 16:08:43 jehousley Exp $
+.\"
+.TH libssh2_sftp_seek 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
+.SH NAME
+libssh2_sftp_seek - set the read/write position indicator within a file
+.SH SYNOPSIS
+#include <libssh2.h>
+#include <libssh2_sftp.h>
+
+void 
+libssh2_sftp_seek(LIBSSH2_SFTP_HANDLE *handle, size_t offset);
+
+.SH DESCRIPTION
+\fIhandle\fP - SFTP File Handle as returned by 
+.BR libssh2_sftp_open(3)
+
+\fIoffset\fP - Number of bytes from the beginning of file to seek to.
+
+Move the file handle's internal pointer to an arbitrary location. 
+Note that libssh2 implements file pointers as a localized concept to make 
+file access appear more POSIX like. No packets are exchanged with the server 
+during a seek operation. The localized file pointer is simply used as a 
+convenience offset during read/write operations.
+
+.SH SEE ALSO
+.BR libssh2_sftp_open(3)
diff --git a/libssh2/share/man/man3/libssh2_sftp_shutdown.3 b/libssh2/share/man/man3/libssh2_sftp_shutdown.3
new file mode 100644 (file)
index 0000000..1a1defd
--- /dev/null
@@ -0,0 +1,26 @@
+.\" $Id: libssh2_sftp_shutdown.3,v 1.1 2007/06/14 16:33:38 jehousley Exp $
+.\"
+.TH libssh2_sftp_shutdown 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
+.SH NAME
+libssh2_sftp_shutdown - shut down an SFTP session
+.SH SYNOPSIS
+#include <libssh2.h>
+#include <libssh2_sftp.h>
+
+int 
+libssh2_sftp_shutdown(LIBSSH2_SFTP *sftp);
+
+.SH DESCRIPTION
+\fIsftp\fP - SFTP instance as returned by 
+.BR libssh2_sftp_init(3)
+
+Destroys a previously initialized SFTP session and frees all resources 
+associated with it.
+
+.SH RETURN VALUE
+Return 0 on success or negative on failure.  It returns
+LIBSSH2_ERROR_EAGAIN when it would otherwise block. While
+LIBSSH2_ERROR_EAGAIN is a negative number, it isn't really a failure per se.
+
+.SH SEE ALSO
+.BR libssh2_sftp_init(3)
diff --git a/libssh2/share/man/man3/libssh2_sftp_stat_ex.3 b/libssh2/share/man/man3/libssh2_sftp_stat_ex.3
new file mode 100644 (file)
index 0000000..cd96491
--- /dev/null
@@ -0,0 +1,62 @@
+.\" $Id: libssh2_sftp_stat_ex.3,v 1.1 2007/06/14 16:33:38 jehousley Exp $
+.\"
+.TH libssh2_sftp_stat_ex 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
+.SH NAME
+libssh2_sftp_stat_ex - rename a file
+.SH SYNOPSIS
+#include <libssh2.h>
+#include <libssh2_sftp.h>
+
+int 
+libssh2_sftp_stat_ex(LIBSSH2_SFTP *sftp, const char *path, unsigned int path_len, int stat_type, LIBSSH2_SFTP_ATTRIBUTES *attrs);
+
+int 
+libssh2_sftp_stat(LIBSSH2_SFTP *sftp, const char *path, LIBSSH2_SFTP_ATTRIBUTES *attrs);
+
+int 
+libssh2_sftp_lstat(LIBSSH2_SFTP *sftp, const char *path, LIBSSH2_SFTP_ATTRIBUTES *attrs);
+
+int 
+libssh2_sftp_setstat(LIBSSH2_SFTP *sftp, const char *path, LIBSSH2_SFTP_ATTRIBUTES *attrs);
+
+.SH DESCRIPTION
+\fIsftp\fP - SFTP instance as returned by 
+.BR libssh2_sftp_init(3)
+
+\fIpath\fP - Remote filesystem object to stat/lstat/setstat.
+
+\fIpath_len\fP - Lenght of the name of the remote filesystem object 
+to stat/lstat/setstat.
+
+\fIstat_type\fP - One of the three constants specifying the type of 
+stat operation to perform.
+
+\fIattrs\fP - Pointer to attribute structure to set file metadata 
+from or into depending on the value of stat_type.
+
+Get or Set statbuf type data on a remote filesystem object. When 
+getting statbuf data, 
+.BR libssh2_sftp_stat(3)
+will follow all symlinks, while 
+.BR libssh2_sftp_lstat(3)
+will return data about the object encountered, even if that object 
+happens to be a symlink.
+
+.SH RETURN VALUE
+Return 0 on success or negative on failure.  It returns
+LIBSSH2_ERROR_EAGAIN when it would otherwise block. While
+LIBSSH2_ERROR_EAGAIN is a negative number, it isn't really a failure per se.
+
+.SH ERRORS
+\fILIBSSH2_ERROR_ALLOC\fP -  An internal memory allocation call failed.
+
+\fILIBSSH2_ERROR_SOCKET_SEND\fP - Unable to send data on socket.
+
+\fILIBSSH2_ERROR_SOCKET_TIMEOUT\fP - 
+
+\fILIBSSH2_ERROR_SFTP_PROTOCOL\fP - An invalid SFTP protocol response was 
+received on the socket, or an SFTP operation caused an errorcode to 
+be returned by the server.
+
+.SH SEE ALSO
+.BR libssh2_sftp_init(3)
diff --git a/libssh2/share/man/man3/libssh2_sftp_symlink_ex.3 b/libssh2/share/man/man3/libssh2_sftp_symlink_ex.3
new file mode 100644 (file)
index 0000000..d5f5161
--- /dev/null
@@ -0,0 +1,70 @@
+.\" $Id: libssh2_sftp_symlink_ex.3,v 1.1 2007/06/14 16:33:38 jehousley Exp $
+.\"
+.TH libssh2_sftp_symlink_ex 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
+.SH NAME
+libssh2_sftp_symlink_ex - read or set a symbolic link
+.SH SYNOPSIS
+#include <libssh2.h>
+#include <libssh2_sftp.h>
+
+int 
+libssh2_sftp_symlink_ex(LIBSSH2_SFTP *sftp, const char *path, unsigned int path_len, char *target, unsigned int target_len, int link_type);
+
+int 
+libssh2_sftp_symlink(LIBSSH2_SFTP *sftp, const char *path, char *target);
+
+int 
+libssh2_sftp_readlink(LIBSSH2_SFTP *sftp, const char *path, char *target, unsigned int target_len);
+
+int 
+libssh2_sftp_realpath(LIBSSH2_SFTP *sftp, const char *path, char *target, unsigned int target_len);
+
+.SH DESCRIPTION
+\fIsftp\fP - SFTP instance as returned by 
+.BR libssh2_sftp_init(3)
+
+\fIpath\fP - Remote filesystem object to create a symlink from or resolve.
+
+\fIpath_len\fP - Length of the name of the remote filesystem object to 
+create a symlink from or resolve.
+
+\fItarget\fP - 
+.br
+\fBLIBSSH2_SFTP_SYMLINK\fP: Remote filesystem object to link to.
+.br
+\fBLIBSSH2_SFTP_READLINK\fP: Pre-allocated buffer to resolve symlink target into.
+.br
+\fBLIBSSH2_SFTP_REALPATH\fP: Pre-allocated buffer to resolve realpath target into.
+
+\fItarget_len\fP - Length of the name of the remote filesystem target object.
+
+\fIlink_type\fP - One of the three previously mentioned constants which 
+determines the resulting behavior of this function.
+
+.BR libssh2_sftp_symlink(3)
+: Create a symbolic link between two filesystem objects.
+.br
+.BR libssh2_sftp_readlink(3)
+: Resolve a symbolic link filesystem object to its next target.
+.br
+.BR libssh2_sftp_realpath(3)
+: Resolve a complex, relative, or symlinked filepath to its effective target.
+
+.SH RETURN VALUE
+Return 0 on success or negative on failure.  It returns
+LIBSSH2_ERROR_EAGAIN when it would otherwise block. While
+LIBSSH2_ERROR_EAGAIN is a negative number, it isn't really a failure per se.
+
+.SH ERRORS
+\fILIBSSH2_ERROR_ALLOC\fP -  An internal memory allocation call failed.
+
+\fILIBSSH2_ERROR_SOCKET_SEND\fP - Unable to send data on socket.
+
+\fILIBSSH2_ERROR_SOCKET_TIMEOUT\fP - 
+
+\fILIBSSH2_ERROR_SFTP_PROTOCOL\fP - An invalid SFTP protocol response was 
+received on the socket, or an SFTP operation caused an errorcode to 
+be returned by the server.
+
+.SH SEE ALSO
+.BR libssh2_sftp_init(3)
diff --git a/libssh2/share/man/man3/libssh2_sftp_tell.3 b/libssh2/share/man/man3/libssh2_sftp_tell.3
new file mode 100644 (file)
index 0000000..f21cba7
--- /dev/null
@@ -0,0 +1,26 @@
+.\" $Id: libssh2_sftp_tell.3,v 1.1 2007/06/14 16:33:38 jehousley Exp $
+.\"
+.TH libssh2_sftp_tell 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
+.SH NAME
+libssh2_sftp_tell - get the current read/write position indicator for a file
+.SH SYNOPSIS
+#include <libssh2.h>
+#include <libssh2_sftp.h>
+
+size_t 
+libssh2_sftp_tell(LIBSSH2_SFTP_HANDLE *handle);
+
+.SH DESCRIPTION
+\fIhandle\fP - SFTP File Handle as returned by 
+.BR libssh2_sftp_open(3)
+
+Identify the current offset of the file handle's internal pointer. Note 
+that the SSH2 protocol does not have a notion of file pointers and that 
+libssh2 implements this using a localized file pointer which is updated 
+with each read/write call.
+
+.SH RETURN VALUE
+Current offset from beginning of file in bytes.
+
+.SH SEE ALSO
+.BR libssh2_sftp_open(3)
diff --git a/libssh2/share/man/man3/libssh2_sftp_unlink_ex.3 b/libssh2/share/man/man3/libssh2_sftp_unlink_ex.3
new file mode 100644 (file)
index 0000000..3f111c7
--- /dev/null
@@ -0,0 +1,44 @@
+.\" $Id: libssh2_sftp_unlink_ex.3,v 1.1 2007/06/14 16:46:14 jehousley Exp $
+.\"
+.TH libssh2_sftp_unlink_ex 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
+.SH NAME
+libssh2_sftp_unlink_ex - rename a file
+.SH SYNOPSIS
+#include <libssh2.h>
+#include <libssh2_sftp.h>
+
+int 
+libssh2_sftp_unlink_ex(LIBSSH2_SFTP *sftp, const char *filename, unsigned int filename_len);
+
+int 
+libssh2_sftp_unlink(LIBSSH2_SFTP *sftp, const char *filename);
+
+.SH DESCRIPTION
+\fIsftp\fP - SFTP instance as returned by 
+.BR libssh2_sftp_init(3)
+
+\fIfilename\fP - Path and name of the existing filesystem entry
+
+\fIfilename_len\fP - Length of the path and name of the existing 
+filesystem entry
+
+Unlink (delete) a file from the remote filesystem.
+
+.SH RETURN VALUE
+Return 0 on success or negative on failure.  It returns
+LIBSSH2_ERROR_EAGAIN when it would otherwise block. While
+LIBSSH2_ERROR_EAGAIN is a negative number, it isn't really a failure per se.
+
+.SH ERRORS
+\fILIBSSH2_ERROR_ALLOC\fP -  An internal memory allocation call failed.
+
+\fILIBSSH2_ERROR_SOCKET_SEND\fP - Unable to send data on socket.
+
+\fILIBSSH2_ERROR_SOCKET_TIMEOUT\fP - 
+
+\fILIBSSH2_ERROR_SFTP_PROTOCOL\fP - An invalid SFTP protocol response was 
+received on the socket, or an SFTP operation caused an errorcode to 
+be returned by the server.
+
+.SH SEE ALSO
+.BR libssh2_sftp_init(3)
diff --git a/libssh2/share/man/man3/libssh2_sftp_write.3 b/libssh2/share/man/man3/libssh2_sftp_write.3
new file mode 100644 (file)
index 0000000..575a5e9
--- /dev/null
@@ -0,0 +1,41 @@
+.\" $Id: libssh2_sftp_write.3,v 1.1 2007/06/14 16:46:14 jehousley Exp $
+.\"
+.TH libssh2_sftp_rename_ex 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
+.SH NAME
+libssh2_sftp_rename_ex - rename a file
+.SH SYNOPSIS
+#include <libssh2.h>
+#include <libssh2_sftp.h>
+
+ssize_t 
+libssh2_sftp_write(LIBSSH2_SFTP_HANDLE *handle, const char *buffer, size_t count);
+
+.SH DESCRIPTION
+\fIhandle\fP - SFTP File Handle as returned by 
+.BR libssh2_sftp_open(3)
+
+\fIbuffer\fP - Pre-initialized data buffer to write to the LIBSSH2_SFTP_HANDLE.
+
+\fIcount\fP - Number of bytes from buffer to write. Note that it may not 
+be possible to write all bytes as requested.
+
+Write a block of data to a LIBSSH2_SFTP_HANDLE. This method is modeled after the POSIX write() function and uses the same calling semantics.
+
+.SH RETURN VALUE
+Actual number of bytes written or negative on failure.  It returns
+LIBSSH2_ERROR_EAGAIN when it would otherwise block. While
+LIBSSH2_ERROR_EAGAIN is a negative number, it isn't really a failure per se.
+
+.SH ERRORS
+\fILIBSSH2_ERROR_ALLOC\fP -  An internal memory allocation call failed.
+
+\fILIBSSH2_ERROR_SOCKET_SEND\fP - Unable to send data on socket.
+
+\fILIBSSH2_ERROR_SOCKET_TIMEOUT\fP - 
+
+\fILIBSSH2_ERROR_SFTP_PROTOCOL\fP - An invalid SFTP protocol response was 
+received on the socket, or an SFTP operation caused an errorcode to 
+be returned by the server.
+
+.SH SEE ALSO
+.BR libssh2_sftp_open(3)
diff --git a/libssh2/share/man/man3/libssh2_userauth_authenticated.3 b/libssh2/share/man/man3/libssh2_userauth_authenticated.3
new file mode 100644 (file)
index 0000000..4a9a10b
--- /dev/null
@@ -0,0 +1,22 @@
+.\" $Id: libssh2_userauth_authenticated.3,v 1.1 2007/06/14 17:15:32 jehousley Exp $
+.\"
+.TH libssh2_userauth_authenticated 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
+.SH NAME
+libssh2_userauth_authenticated - return authentication status
+.SH SYNOPSIS
+#include <libssh2.h>
+
+int 
+libssh2_userauth_authenticated(LIBSSH2_SESSION *session);
+
+.SH DESCRIPTION
+\fIsession\fP - Session instance as returned by 
+.BR libssh2_session_init(3)
+
+Indicates whether or not the named session has been successfully authenticated.
+
+.SH RETURN VALUE
+Returns 1 if authenticated and 0 if not.
+
+.SH SEE ALSO
+.BR libssh2_session_init(3)
diff --git a/libssh2/share/man/man3/libssh2_userauth_list.3 b/libssh2/share/man/man3/libssh2_userauth_list.3
new file mode 100644 (file)
index 0000000..3ea3436
--- /dev/null
@@ -0,0 +1,43 @@
+.\" $Id: libssh2_userauth_list.3,v 1.1 2007/06/14 17:15:32 jehousley Exp $
+.\"
+.TH libssh2_userauth_list 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
+.SH NAME
+libssh2_userauth_list - list the authentication methods supported by a server
+.SH SYNOPSIS
+#include <libssh2.h>
+
+char *
+libssh2_userauth_list(LIBSSH2_SESSION *session, const char *username, unsigned int username_len);
+
+.SH DESCRIPTION
+\fIsession\fP - Session instance as returned by 
+.BR libssh2_session_init(3)
+
+\fIusername\fP - Username which will be used while authenticating. Note 
+that most server implementations do not permit attempting authentication 
+with different usernames between requests. Therefore this must be the 
+same username you will use on later userauth calls.
+
+\fIusername_len\fP - Length of username parameter.
+
+Send a \fBSSH_USERAUTH_NONE\fP request to the remote host. Unless the 
+remote host is configured to accept none as a viable authentication 
+scheme (unlikely), it will return \fBSSH_USERAUTH_FAILURE\fB along with a 
+listing of what authentication schemes it does support. In the unlikely 
+event that none authentication succeeds, this method with return NULL. This 
+case may be distinguished from faily by examining 
+.BR libssh2_userauth_authenticated(3)
+
+.SH RETURN VALUE
+On success a comma delimited list of supported authentication schemes.  This list is 
+internally managed by libssh2.  On failure ruturns NULL.
+
+.SH ERRORS
+\fILIBSSH2_ERROR_ALLOC\fP -  An internal memory allocation call failed.
+
+\fILIBSSH2_ERROR_SOCKET_SEND\fP - Unable to send data on socket.
+
+\fILIBSSH2_ERROR_EAGAIN\fP - Marked for non-blocking I/O but the call
+
+.SH SEE ALSO
+.BR libssh2_session_init(3)
diff --git a/libssh2/share/man/man3/libssh2_userauth_password_ex.3 b/libssh2/share/man/man3/libssh2_userauth_password_ex.3
new file mode 100644 (file)
index 0000000..5b047e0
--- /dev/null
@@ -0,0 +1,50 @@
+.\" $Id: libssh2_userauth_password_ex.3,v 1.1 2007/06/14 17:15:32 jehousley Exp $
+.\"
+.TH libssh2_userauth_password_ex 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
+.SH NAME
+libssh2_userauth_password_ex - authenticate a session with username and password
+.SH SYNOPSIS
+#include <libssh2.h>
+
+int
+libssh2_userauth_password_ex(LIBSSH2_SESSION *session, const char *username, unsigned int username_len, const char *password, unsigned int password_len, LIBSSH2_PASSWD_CHANGEREQ_FUNC((*passwd_change_cb)));
+
+int
+libssh2_userauth_password(LIBSSH2_SESSION *session, const char *username, const char *password);
+
+.SH DESCRIPTION
+\fIsession\fP - Session instance as returned by 
+.BR libssh2_session_init(3)
+
+\fIusername\fP - Name of user to attempt plain password authentication for.
+
+\fIusername_len\fP - Length of username parameter.
+
+\fIpassword\fP - Password to use for authenticating username.
+
+\fIpassword_len\fP - Length of password parameter.
+
+\fIpasswd_change_cb\fP - If the host accepts authentication but 
+requests that the password be changed, this callback will be issued. 
+If no callback is defined, but server required password change, 
+authentication will fail.
+
+Attempt basic password authentication. Note that many SSH servers 
+which appear to support ordinary password authentication actually have 
+it disabled and use Keyboard Interactive authentication (routed via 
+PAM or another authentication backed) instead.
+
+.SH RETURN VALUE
+Return 0 on success or negative on failure.  It returns
+LIBSSH2_ERROR_EAGAIN when it would otherwise block. While
+LIBSSH2_ERROR_EAGAIN is a negative number, it isn't really a failure per se.
+
+.SH ERRORS
+\fILIBSSH2_ERROR_ALLOC\fP -  An internal memory allocation call failed.
+
+\fILIBSSH2_ERROR_SOCKET_SEND\fP - Unable to send data on socket.
+
+\fILIBSSH2_ERROR_PASSWORD_EXPIRED\fP - 
+
+.SH SEE ALSO
+.BR libssh2_session_init(3)
diff --git a/libssh2/share/man/man3/libssh2_userauth_publickey_fromfile.3 b/libssh2/share/man/man3/libssh2_userauth_publickey_fromfile.3
new file mode 100644 (file)
index 0000000..041aada
--- /dev/null
@@ -0,0 +1,51 @@
+.\" $Id: libssh2_userauth_publickey_fromfile.3,v 1.1 2007/06/14 17:15:32 jehousley Exp $
+.\"
+.TH libssh2_userauth_publickey_fromfile 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
+.SH NAME
+libssh2_userauth_publickey_fromfile - authenticate a session with a public key, read from a file
+.SH SYNOPSIS
+#include <libssh2.h>
+
+int
+libssh2_userauth_publickey_fromfile_ex(LIBSSH2_SESSION *session, const char *username, unsigned int username_len, const char *publickey, const char *privatekey, const char *passphrase);
+
+int
+libssh2_userauth_publickey_fromfile_ex(LIBSSH2_SESSION *session, const char *username, const char *publickey, const char *privatekey, const char *passphrase);
+
+.SH DESCRIPTION
+\fIsession\fP - Session instance as returned by 
+.BR libssh2_session_init(3)
+
+\fIusername\fP - Remote user name to authenticate as.
+
+\fIusername_len\fP - Length of username.
+
+\fIpublickey\fP - Path and name of public key file. (e.g. /etc/ssh/hostkey.pub)
+
+\fIprivatekey\fP - Path and name of private key file. (e.g. /etc/ssh/hostkey)
+
+\fIpassphrase\fP - Passphrase to use when decoding private key file.
+
+Attempt public key authentication using a PEM encoded private key file stored on disk
+
+.SH RETURN VALUE
+Return 0 on success or negative on failure.  It returns
+LIBSSH2_ERROR_EAGAIN when it would otherwise block. While
+LIBSSH2_ERROR_EAGAIN is a negative number, it isn't really a failure per se.
+
+.SH ERRORS
+\fILIBSSH2_ERROR_ALLOC\fP -  An internal memory allocation call failed.
+
+\fILIBSSH2_ERROR_SOCKET_SEND\fP - Unable to send data on socket.
+
+\fILIBSSH2_ERROR_SOCKET_TIMEOUT\fP - 
+
+\fILIBSSH2_ERROR_PUBLICKEY_UNRECOGNIZED\fP - >The username/public key 
+combination was invalid.
+
+\fILIBSSH2_ERROR_PUBLICKEY_UNVERIFIED\fP - The username/public key 
+combination was invalid, or the signature for the supplied public 
+key was invalid.
+
+.SH SEE ALSO
+.BR libssh2_session_init(3)