Compare commits
207 Commits
libssh2-1.
...
libssh2-1.
Author | SHA1 | Date | |
---|---|---|---|
![]() |
507d5f96cf | ||
![]() |
84d8728835 | ||
![]() |
296d57bb2c | ||
![]() |
9e79031ad7 | ||
![]() |
689fc5c596 | ||
![]() |
31a9e8860d | ||
![]() |
b26c3e7cce | ||
![]() |
e4eeb85f01 | ||
![]() |
7de77e94bf | ||
![]() |
8c0294db66 | ||
![]() |
900c90ccbe | ||
![]() |
d5eec4aad9 | ||
![]() |
19864f0f64 | ||
![]() |
420f0b7793 | ||
![]() |
7aa4bfc671 | ||
![]() |
462996b064 | ||
![]() |
07d7a85bdb | ||
![]() |
95d69d3a81 | ||
![]() |
2fe1770d9f | ||
![]() |
3c71ad4fce | ||
![]() |
79f48e4881 | ||
![]() |
49453c9ae2 | ||
![]() |
b232eeb598 | ||
![]() |
f922df9e1b | ||
![]() |
7e47bd6640 | ||
![]() |
4ae907cdef | ||
![]() |
01d199180a | ||
![]() |
7e18862eae | ||
![]() |
45ffdcfe3c | ||
![]() |
dadc05fdfd | ||
![]() |
733bf877f8 | ||
![]() |
2db7d9c655 | ||
![]() |
9a24b03402 | ||
![]() |
81d53de4dc | ||
![]() |
5b004a4b67 | ||
![]() |
da64618c9a | ||
![]() |
566894494b | ||
![]() |
0723dab4d7 | ||
![]() |
67ba8713a6 | ||
![]() |
dade304c47 | ||
![]() |
6e8229a221 | ||
![]() |
821fb6ca71 | ||
![]() |
59673a111e | ||
![]() |
5b66a5f38d | ||
![]() |
ce8f0b29a4 | ||
![]() |
26dad4590b | ||
![]() |
4ed1e9d96b | ||
![]() |
c5ec167881 | ||
![]() |
e652b4c7b8 | ||
![]() |
cc84d875eb | ||
![]() |
c01737e679 | ||
![]() |
4825171919 | ||
![]() |
d881e7e8ef | ||
![]() |
5dc5c80a39 | ||
![]() |
9f477073bc | ||
![]() |
78498e0588 | ||
![]() |
0b0aa209f6 | ||
![]() |
aa07cdee9a | ||
![]() |
274fb2169c | ||
![]() |
f0a37bdadc | ||
![]() |
1249dd2272 | ||
![]() |
5633bb4a3b | ||
![]() |
fabf1a45ee | ||
![]() |
2e352d3085 | ||
![]() |
8c9571b7ba | ||
![]() |
527c1b2def | ||
![]() |
ec934f6dab | ||
![]() |
516fa7fdd9 | ||
![]() |
3ce2628140 | ||
![]() |
ad88325b3f | ||
![]() |
2db4863e6e | ||
![]() |
691cabc048 | ||
![]() |
90b4b4073f | ||
![]() |
8ce9a66ccf | ||
![]() |
7015488150 | ||
![]() |
164838c7dd | ||
![]() |
f9b1b95059 | ||
![]() |
59207291fc | ||
![]() |
0da37e0924 | ||
![]() |
4552c73cd5 | ||
![]() |
306929ee80 | ||
![]() |
326f741a52 | ||
![]() |
aa4f861643 | ||
![]() |
fd691deb17 | ||
![]() |
20da09932e | ||
![]() |
3ab7af095a | ||
![]() |
5b1a7ec2f1 | ||
![]() |
5ee38702a0 | ||
![]() |
2165ceacd3 | ||
![]() |
121237ce2f | ||
![]() |
b3e832172b | ||
![]() |
3faa8bc940 | ||
![]() |
2f0c0cef76 | ||
![]() |
75909e05a9 | ||
![]() |
47b4e62780 | ||
![]() |
1b1ff333e4 | ||
![]() |
c1683ae92c | ||
![]() |
1b65c6ae26 | ||
![]() |
92ea3bda60 | ||
![]() |
811cce09b5 | ||
![]() |
6875285b71 | ||
![]() |
0cc14be09d | ||
![]() |
499b989d46 | ||
![]() |
fa07d9fefc | ||
![]() |
b0c32a85fc | ||
![]() |
7ed7dad3b4 | ||
![]() |
b215ec0af5 | ||
![]() |
ac6d0fb706 | ||
![]() |
e87293d480 | ||
![]() |
a3ce1073c4 | ||
![]() |
97a1881749 | ||
![]() |
80f7508d55 | ||
![]() |
e8c44e789f | ||
![]() |
ca2e81eb1f | ||
![]() |
aff9c825c8 | ||
![]() |
7899d28ecb | ||
![]() |
2f5a2ff8e6 | ||
![]() |
160453cee4 | ||
![]() |
82fa5d2167 | ||
![]() |
1c3e1c4d25 | ||
![]() |
1d2a5b8456 | ||
![]() |
1d11d02aa9 | ||
![]() |
f4ad3e0120 | ||
![]() |
772564650d | ||
![]() |
05ba8db8aa | ||
![]() |
1964ccb557 | ||
![]() |
bef0ce5392 | ||
![]() |
fb6afd01a1 | ||
![]() |
a302428335 | ||
![]() |
7ad152a6b2 | ||
![]() |
075ff19574 | ||
![]() |
16f46c1cfc | ||
![]() |
aa2fdb3e7e | ||
![]() |
8f10da89c5 | ||
![]() |
2dfa5d38cb | ||
![]() |
095e9e7b3e | ||
![]() |
588c8946fc | ||
![]() |
a6fc9aeec9 | ||
![]() |
7603c0f854 | ||
![]() |
8974dc05ae | ||
![]() |
6395a738fd | ||
![]() |
73be9fab04 | ||
![]() |
753e55ef23 | ||
![]() |
4760e4d051 | ||
![]() |
57af0da9f7 | ||
![]() |
024b5d29f5 | ||
![]() |
a0dd0c5992 | ||
![]() |
92d308c157 | ||
![]() |
4ae71b4838 | ||
![]() |
ba190d34c6 | ||
![]() |
b84f69c960 | ||
![]() |
a7aee34522 | ||
![]() |
1dc366109d | ||
![]() |
e1ea2eb7c2 | ||
![]() |
610a8ab919 | ||
![]() |
8ec21e0afe | ||
![]() |
8e0983347b | ||
![]() |
95db6cc62c | ||
![]() |
727043074a | ||
![]() |
5b4ed2717b | ||
![]() |
59f74de157 | ||
![]() |
d87562976a | ||
![]() |
a94886f157 | ||
![]() |
dec0ea9e70 | ||
![]() |
030b2d9b60 | ||
![]() |
c48840ba88 | ||
![]() |
d9cdd8c0a7 | ||
![]() |
c49061e708 | ||
![]() |
d674b1a09a | ||
![]() |
5ede32a826 | ||
![]() |
3a391f6cf2 | ||
![]() |
64063d5f0b | ||
![]() |
784db8e987 | ||
![]() |
84efbf788f | ||
![]() |
f805c2db2a | ||
![]() |
08ce6425f6 | ||
![]() |
fac9412a74 | ||
![]() |
4d15e0c9d1 | ||
![]() |
6140ec2de3 | ||
![]() |
70d6bd6c6f | ||
![]() |
98e38c4f3a | ||
![]() |
cd6d41b806 | ||
![]() |
c36f379b88 | ||
![]() |
77a9335515 | ||
![]() |
59636cc11e | ||
![]() |
0d58af6aec | ||
![]() |
c34e1d8735 | ||
![]() |
861fc75fa3 | ||
![]() |
f4d302fdfe | ||
![]() |
4faf67d3e9 | ||
![]() |
76a30f2c6f | ||
![]() |
bcd7eee1d2 | ||
![]() |
046ad88d88 | ||
![]() |
9887c01103 | ||
![]() |
822f9e8689 | ||
![]() |
3ee2aabd7a | ||
![]() |
7c49c8be58 | ||
![]() |
665d9ee885 | ||
![]() |
b3d6c6567d | ||
![]() |
7dd574c353 | ||
![]() |
018602cb34 | ||
![]() |
eec7f2fb63 | ||
![]() |
c32b0d164e | ||
![]() |
835c03e076 | ||
![]() |
6c6c43f92c | ||
![]() |
5af87e8c80 | ||
![]() |
10a65fda01 |
@@ -26,10 +26,10 @@ vms/libssh2_make_kit.dcl vms/libssh2_make_lib.dcl vms/man2help.c \
|
||||
vms/readme.vms vms/libssh2_config.h
|
||||
|
||||
|
||||
WIN32FILES = win32/Makefile.win32 win32/libssh2.dsw \
|
||||
win32/config.mk win32/Makefile win32/test/Makefile.win32 \
|
||||
win32/libssh2_config.h win32/tests.dsp win32/rules.mk $(DSP) \
|
||||
win32/msvcproj.head win32/msvcproj.foot
|
||||
WIN32FILES = win32/libssh2.dsw win32/config.mk win32/Makefile \
|
||||
win32/libssh2_config.h win32/tests.dsp win32/rules.mk $(DSP) \
|
||||
win32/msvcproj.head win32/msvcproj.foot win32/libssh2.rc \
|
||||
win32/Makefile.Watcom
|
||||
|
||||
EXTRA_DIST = $(WIN32FILES) buildconf $(NETWAREFILES) get_ver.awk HACKING \
|
||||
maketgz NMakefile TODO RELEASE-NOTES libssh2.pc.in $(VMSFILES)
|
||||
|
@@ -4,4 +4,4 @@ CSOURCES = channel.c comp.c crypt.c hostkey.c kex.c mac.c misc.c \
|
||||
global.c
|
||||
|
||||
HHEADERS = libssh2_priv.h openssl.h libgcrypt.h transport.h channel.h \
|
||||
comp.h mac.h misc.h packet.h userauth.h session.h
|
||||
comp.h mac.h misc.h packet.h userauth.h session.h sftp.h crypto.h
|
||||
|
787
NEWS
787
NEWS
@@ -1,786 +1,3 @@
|
||||
libssh2 1.2.7 (August 17, 2010)
|
||||
The old NEWS file.
|
||||
|
||||
This release includes the following changes:
|
||||
|
||||
o Added Watcom makefile
|
||||
|
||||
This release includes the following bugfixes:
|
||||
|
||||
o Better handling of invalid key files
|
||||
o inputchecks: make lots of API functions check for NULL pointers
|
||||
o libssh2_session_callback_set: extended the man page
|
||||
o SFTP: limit write() to not produce overly large packets
|
||||
o agent: make libssh2_agent_userauth() work blocking properly
|
||||
o _libssh2_userauth_publickey: reject method names longer than the data
|
||||
o channel_free: ignore problems with channel_close()
|
||||
o typedef: make ssize_t get typedef without LIBSSH2_WIN32
|
||||
o _libssh2_wait_socket: poll needs milliseconds
|
||||
o libssh2_wait_socket: reset error code to "leak" EAGAIN less
|
||||
o Added include for sys/select.h to get fd.set on some platforms
|
||||
o session_free: free more data to avoid memory leaks
|
||||
o openssl: make use of the EVP interface
|
||||
o Fix underscore typo for 64-bit printf format specifiers on Windows
|
||||
o Make libssh2_debug() create a correctly terminated string
|
||||
o userauth_hostbased_fromfile: packet length too short
|
||||
o handshake: Compression enabled at the wrong time
|
||||
o Don't overflow MD5 server hostkey
|
||||
|
||||
libssh2 1.2.6 (June 10, 2010)
|
||||
|
||||
This release includes the following changes:
|
||||
|
||||
o Added libssh2_sftp_statvfs() and libssh2_sftp_fstatvfs()
|
||||
o Added libssh2_knownhost_checkp()
|
||||
o Added libssh2_scp_send64()
|
||||
|
||||
This release includes the following bugfixes:
|
||||
|
||||
o wait_socket: make c89 compliant and use two fd_sets for select()
|
||||
o OpenSSL AES-128-CTR detection
|
||||
o proper keyboard-interactive user dialog in the sftp.c example
|
||||
o build procedure for VMS
|
||||
o fixed libssh2.dsw to use the generated libssh2.dsp
|
||||
o several Windows-related build fixes
|
||||
o fail to init SFTP if session isn't already authenticated
|
||||
o many tiny fixes that address clang-analyzer warnings
|
||||
o sftp_open: deal with short channel_write calls
|
||||
o libssh2_publickey_init: fixed to work better non-blocking
|
||||
o sftp_close_handle: add precation to not access NULL pointer
|
||||
o sftp_readdir: simplified and bugfixed
|
||||
o channel_write: if data has been sent, don't return EAGAIN
|
||||
|
||||
Version 1.2.5 (April 13, 2010)
|
||||
|
||||
This release includes the following changes:
|
||||
|
||||
o Added Add keep-alive support: libssh2_keepalive_config() and
|
||||
libssh2_keepalive_send()
|
||||
o Added libssh2_knownhost_addc(), libssh2_init() and libssh2_exit()
|
||||
o Added LIBSSH2_SFTP_S_IS***() macros
|
||||
|
||||
This release includes the following bugfixes:
|
||||
|
||||
o fix memory leak in libssh2_session_startup()
|
||||
o added missing error codes - shown as hangs in blocking mode
|
||||
o fix memory leak in userauth_keyboard_interactive()
|
||||
o libssh2_knownhost_del: fix write to freed memory
|
||||
o Send and receive channel EOF before sending SSH_MSG_CHANNEL_CLOSE
|
||||
o Use AES-CTR from OpenSSL when available
|
||||
o Fixed gettimeofday to compile with Visual C++ 6
|
||||
o NULL dereference when window adjusting a non-existing channel
|
||||
o avoid using poll on interix and mac os x systems
|
||||
o fix scp memory leak
|
||||
o Correctly clear blocking flag after sending multipart packet
|
||||
o Reduce used window sizes by factor 10
|
||||
o libssh2_userauth_publickey_fromfile_ex() handles a NULL password
|
||||
o sftp_init() deal with _libssh2_channel_write() short returns
|
||||
|
||||
o Use poll instead of select when available. By Paul Querna.
|
||||
|
||||
o Add APIs to have libssh2 automatically send keep-alive requests.
|
||||
The APIs are libssh2_keepalive_config, and libssh2_keepalive_send.
|
||||
By Simon Josefsson.
|
||||
|
||||
o Add global init/exit points, to do crypto initialization in one place.
|
||||
The APIs are libssh2_init and libssh2_exit. By Lars Nordin.
|
||||
|
||||
* (February 15 2010) Daniel Stenberg:
|
||||
- Added 46 new man pages for public convenience macros. The man pages are
|
||||
just short redirects to the actual underlying function. The were all
|
||||
initially created by a script.
|
||||
|
||||
- Committed the patch by Yoichi Iwaki in bug #2929647, which fixed a memory
|
||||
leak when an 'outbuf' was still allocated when a session was freed.
|
||||
|
||||
Version 1.2.4 (February 13, 2010)
|
||||
|
||||
o Resolve compile issues on Solaris x64 and UltraSPARC
|
||||
o Allow compiling with OpenSSL when AES isn't available
|
||||
o Fix Tru64 socklen_t compile issue with example/direct_tcpip.c
|
||||
|
||||
Version 1.2.3 (February 3, 2010)
|
||||
|
||||
o Added libssh2_trace_sethandler()
|
||||
o Added the direct_tcpip.c example
|
||||
o Fixed memory leak in userauth_publickey
|
||||
o Added support for authentication via SSH-Agent. By Daiki Ueno.
|
||||
|
||||
o Respond to unknown SSH_MSG_GLOBAL_REQUEST/SSH_MSG_CHANNEL_REQUEST
|
||||
with SSH_MSG_REQUEST_FAILURE/SSH_MSG_CHANNEL_FAILURE in order to
|
||||
make (at least) OpenSSH server keepalive work. Before OpenSSH
|
||||
servers (configured with a positive ClientAliveInterval) would
|
||||
terminate connections against libssh2 clients because libssh2 did
|
||||
not respond properly to the request. By Simon Josefsson.
|
||||
|
||||
Version 1.2.2 (November 16, 2009)
|
||||
|
||||
* This release includes the following changes:
|
||||
|
||||
o Fix crash when server sends an invalid SSH_MSG_IGNORE message.
|
||||
Reported by Bob Alexander <balexander@expressor-software.com> in
|
||||
<http://thread.gmane.org/gmane.network.ssh.libssh2.devel/2530>.
|
||||
By Simon Josefsson.
|
||||
|
||||
o Support for the "aes128-ctr", "aes192-ctr", "aes256-ctr" ciphers
|
||||
as per RFC 4344 for libgcrypt and OpenSSL. They are now the
|
||||
preferred ciphers. By Simon Josefsson.
|
||||
|
||||
o Support for the "arcfour128" cipher as per RFC 4345 for libgcrypt
|
||||
and OpenSSL. It is preferred over the normal "arcfour" cipher
|
||||
which is somewhat broken. By Simon Josefsson.
|
||||
|
||||
o Add support for GCC visibility features. By Cristian Rodr<64>guez.
|
||||
|
||||
o Fix libssh2_channel_forward_accept. By Juzna.
|
||||
|
||||
o Generate Win32 files correctly. By Peter Stuge.
|
||||
|
||||
o Fix permission issue in ssh2 self test. By Dan Fandrich.
|
||||
|
||||
o Use memmove instead of memcpy in one place which copies
|
||||
overlapping memory areas.
|
||||
|
||||
o Cleanup hard coding of cipher modes in libgcrypt backend. By Simon.
|
||||
|
||||
o Added man page for libssh2_knownhost_free. By Daniel.
|
||||
|
||||
Version 1.2.1 (September 28, 2009)
|
||||
|
||||
* This release includes the following changes:
|
||||
|
||||
o generate and install libssh2.pc
|
||||
|
||||
... and the following bugfixes:
|
||||
|
||||
o proper return codes returned from several functions
|
||||
o return EAGAIN internal cleanup
|
||||
o added knownhost.c to windows makefiles
|
||||
o pass private-key to OpenSSL as a filename with BIO_new_file().
|
||||
o make libssh2_scp_send/recv do blocking mode correctly
|
||||
o libssh2_channel_wait_closed() could hang
|
||||
o libssh2_channel_read_ex() must return 0 when closed
|
||||
o added gettimeofday() function for win32 for the debug trace outputs
|
||||
o transport layer bug causing invalid -39 (LIBSSH2_ERROR_BAD_USE) errors
|
||||
o scp examples now loop correctly over libssh2_channel_write()
|
||||
|
||||
* (August 29 2009) Daniel Stenberg:
|
||||
|
||||
- I fixed all code to use the recently added dedicated linked list functions
|
||||
instead of doing the same stuff spread out all over.
|
||||
|
||||
- I also fixed a few cases where local variables where used to keep memory
|
||||
but was used to keep state for re-invokes due to non-blocking situations
|
||||
which would lead to segfaults.
|
||||
|
||||
Version 1.2 (August 10, 2009)
|
||||
-----------------------------
|
||||
|
||||
* (August 02 2009) Alexander Lamaison:
|
||||
|
||||
- changed _libssh2_rsa_new_private and _libssh2_rsa_new_private so that they
|
||||
no longer use the OpenSSL functions that take a FILE* argument. Passing
|
||||
CRT-created objects across a DLL boundary causes crashes on Windows of the
|
||||
DLL and the client aren't linked to the exact same verison of the CRT. Now
|
||||
we pass the keys as strings to avoid this issue.
|
||||
|
||||
* (May 29 2009) Daniel Stenberg:
|
||||
|
||||
- Updated the knownhost API and there are now 9 functions, and all of them
|
||||
have man pages. The libssh2.h now defines HAVE_LIBSSH2_KNOWNHOST_API to
|
||||
ease things for applications to check for the correct release before trying
|
||||
to use it.
|
||||
|
||||
* (May 23 2009) Daniel Stenberg:
|
||||
|
||||
- Anonymous bug report #2795816 revealed that doing subsequent
|
||||
libssh2_sftp_init() calls on the same session failed.
|
||||
|
||||
* (May 20 2009) Daniel Stenberg:
|
||||
|
||||
- made libssh2_sftp_write() properly deal with huge/any sized input buffers.
|
||||
|
||||
- fixed libssh2_channel_write_ex() to return the correct return code, and
|
||||
deal with sending off huge buffers better
|
||||
|
||||
* (May 7 2009) Daniel Stenberg:
|
||||
|
||||
- linked list code. I got a bit tired of the fact that we don't have any
|
||||
generic linked-list functions within libssh2 so I wrote up the first embryo
|
||||
for one that I use for this new functionality. The plan would then be to
|
||||
move all existing code that uses linked lists to use this new set.
|
||||
|
||||
- base64 encode. I had to add a base64 encoding function which was missing
|
||||
in the code base so it helps to "bloat" my patch.
|
||||
|
||||
- The knownhost API is currently:
|
||||
|
||||
_init() - init a bundle of known hosts
|
||||
_add() - add a known host
|
||||
_del() - delete a known host
|
||||
_free() - free an entire bundle of known hosts
|
||||
_check() - check if a host+key is present in the bundle
|
||||
|
||||
The convenience function:
|
||||
|
||||
_parsefile() - reads a ~/.ssh/known_hosts file and add all entries to the
|
||||
given bundle
|
||||
|
||||
- there's no docs other than some comments in the code/headers yet
|
||||
|
||||
- the patch includes changes to example/simple/ssh2_exec.c that makes use of
|
||||
a few of these functions. Using that I've verified that the functions in
|
||||
fact can verify my localhost's key agains my ~/.ssh/known_hosts file
|
||||
|
||||
* (Apr 30 2009) Daniel Stenberg:
|
||||
|
||||
Markus posted a bug report about a bad 0-return from libssh2_channel_read:
|
||||
http://libssh2.haxx.se/mail/libssh2-devel-archive-2009-04/0076.shtml
|
||||
|
||||
And it was indeed a bad loop that terminated too early due to a receveived
|
||||
close packet.
|
||||
|
||||
* (Apr 14 2009) Daniel Stenberg:
|
||||
|
||||
libssh2_poll() and libssh2_poll_channel_read() are now considered and
|
||||
documented deprecated and they will be removed at next soname bump. It also
|
||||
saves us from fixing some rather quirky bugs in libssh2_poll()...
|
||||
|
||||
|
||||
Version 1.1 (April 2, 2009)
|
||||
---------------------------
|
||||
|
||||
- (Mar 28 2009) Daniel Stenberg:
|
||||
|
||||
Jean-Louis Charton found a memory leak in
|
||||
libssh2_userauth_hostbased_fromfile_ex()
|
||||
|
||||
- (Mar 25 2009) Daniel Stenberg:
|
||||
|
||||
* Renamed the functions in src/transport.c to be _libssh2_transport_ prefixed
|
||||
and introduced a transport.h header.
|
||||
|
||||
* Fixed the blocking mode to only change behavior not the actual underlying
|
||||
socket mode so we now always work with non-blocking sockets. This also
|
||||
introduces a new rule of thumb in libssh2 code: we don't call the
|
||||
external function calls internally. We use the internal (non-blocking)
|
||||
ones!
|
||||
|
||||
* libssh2_channel_receive_window_adjust2 was added and
|
||||
libssh2_channel_receive_window_adjust is now deprecated
|
||||
|
||||
* Introduced "local" header files with prototypes etc for different parts
|
||||
instead of cramming everything into libssh2_priv.h. channel.h is the
|
||||
first.
|
||||
|
||||
- (Mar 19 2009) Daniel Stenberg: based on a patch by "E L" we now use errno
|
||||
properly after recv() and send() calls (that internally are now known as
|
||||
_libssh2_recv() and _libssh2_send()) so that the API and more works fine on
|
||||
windows too!
|
||||
|
||||
- (Mar 17 2009) Simon Josefsson:
|
||||
|
||||
Added a Libtool -export-symbols-regex flag to reduce the number of
|
||||
exported symbols in shared libraries. Reported by Mikhail Gusarov.
|
||||
|
||||
- (Mar 16 2009) Daniel Stenberg:
|
||||
|
||||
I renamed a few man pages to match the exact name of the functions they
|
||||
describe. I also added template versions for the 13 functions that
|
||||
previously lacked man pages. While these don't contain any docs just yet, it
|
||||
will now be easier to add the info as the foundation is there!
|
||||
|
||||
- (Mar 15 2009) Daniel Stenberg:
|
||||
|
||||
* libssh2_channel_read_ex() was simplified and enhanced. It now adjusts the
|
||||
window less frequent and uses much larger window that now allows MUCH
|
||||
faster transfers.
|
||||
|
||||
* SCP send/recv now allow file names with whitespaces etc, thanks to a patch
|
||||
by Heiner Steven
|
||||
|
||||
- (Mar 13 2009) Daniel Stenberg: Cleanups, that do seem to have boosted SFTP
|
||||
download performance up to 300% in some tests:
|
||||
|
||||
* cut off "_ex" from several internal function names
|
||||
|
||||
* corrected some log outputs
|
||||
|
||||
* simplified libssh2_channel_read_ex() and made it much faster in the process
|
||||
|
||||
* cut out {{{ and }}} comments that were incorrect anyway
|
||||
|
||||
* fixed sftp_packet_ask() to return the correct packet by using memcmp() and
|
||||
not strncmp()
|
||||
|
||||
* fixed mkdir()'s wait for packet to use the correct request_id - it
|
||||
semi-worked previously because strncmp() in sftp_packet_ask() made it
|
||||
match far too easily.
|
||||
|
||||
* took away the polling functionality from sftp_packet_ask() since it wasn't
|
||||
used
|
||||
|
||||
- (Mar 7 2009) Olivier Hervieu pointed out a flaw in the
|
||||
libssh2_channel_x11_req_ex() function that made it produce a crappy random
|
||||
chunk of data. Peter Stuge improved the fix to not do out-of-boundary
|
||||
writes. I (Daniel Stenberg) replaced the snprintf() with a plain sprintf()
|
||||
since the size argument wasn't adding anything anyway.
|
||||
|
||||
- (Feb 23 2009) Added libssh2_version()
|
||||
|
||||
- (Feb 20 2009) libssh2_channel_direct_tcpip_ex() bug #1902169 fixed, which
|
||||
caused it to fail when called a second time.
|
||||
|
||||
- (Feb 12 2009) Romain Bondue extended Markus Moeller fix from Feb 8, based on
|
||||
a previous (uncommitted) patch by Erik Brossler. It improves
|
||||
libssh2_channel_write_ex in blocking situations when the socket is set non-
|
||||
blocking.
|
||||
|
||||
- (Feb 8 2009) Markus Moeller fixed a flaw in libssh2_channel_write_ex() that
|
||||
would occur on EAGAIN situations.
|
||||
|
||||
Version 1.0 (December 26 2008)
|
||||
------------------------------
|
||||
|
||||
- (Dec 20 2008) Based on Alexander Lamaison's patch, there's now a new
|
||||
function called libssh2_sftp_tell64() that returns the 64 bit file offset,
|
||||
as the existing libssh2_sftp_tell() only returns a size_t.
|
||||
|
||||
- (Dec 18 2008) Markus Moeller fixed the issue also reported by Alexander
|
||||
Lamaison which caused SFTP reads with large buffers to fail.
|
||||
|
||||
- Several flaws were fixed that prevented at least SFTP to work reliably
|
||||
|
||||
- Vlad Grachov brought the new function called
|
||||
libssh2_session_block_directions() which returns a bitmask for what
|
||||
directions the connection blocks. It is to be used applications that use
|
||||
non-blocking sockets and when a libssh2 function returns
|
||||
LIBSSH2_ERROR_EAGAIN this function can be used to figure out in which
|
||||
direction the socket would block and thus it can wait for the socket to
|
||||
again be ready for communication in that direction before it calls libssh2
|
||||
again.
|
||||
|
||||
- Vincent Jaulin brought the new libssh2_channel_request_pty_size_ex()
|
||||
function.
|
||||
|
||||
- Carlo Bramini fixed the build for msys+mingw. Bug #1943976.
|
||||
|
||||
- Neil Gierman provided improved Visual Studio 2008 code in bug #1946268
|
||||
|
||||
- Bug #1862727 fixed libssh2_poll() to work on windows (by defining
|
||||
HAVE_SELECT).
|
||||
|
||||
- Based on bug #1815692, we introduce libssh2_sftp_seek64() that allows
|
||||
seeking beyond the 2GB margin even on 32bit machines.
|
||||
|
||||
- Based on a patch in bug #1878059 by Steven Ayre libssh2 now parses >2GB file
|
||||
sizes when downloading SCP files.
|
||||
|
||||
- Bug #2064371 pointed out that the SSH2 banner may not use dash
|
||||
('-'). Reported by Bjorn Stenborg.
|
||||
|
||||
- Sean Peterson fixed a key re-exchange bug:
|
||||
http://daniel.haxx.se/projects/libssh2/mail/libssh2-devel-archive-2008-06/0002.shtml
|
||||
|
||||
- Mike Protts filed the bug report #1908724 that identified and fixed a problem
|
||||
with SFTP stat on files >4GB in size. Previously it used 32bit math only.
|
||||
|
||||
- Removed a stderr debug message that was accidentally left in (bug #1863153)
|
||||
|
||||
- OpenSSL and libz detection changed to make cross-compiling to Mingw
|
||||
work. See README for parameters to use if the auto-detection does
|
||||
not work for you. From Simon Josefsson.
|
||||
|
||||
- Simon Josefsson added a self-test that uses libssh2 to connect to a
|
||||
local sshd (only enabled if if OpenSSH is installed).
|
||||
|
||||
Version 0.18 (November 11 2007)
|
||||
-------------------------------
|
||||
|
||||
- Various changes that improve non-blocking operations and prevent stalls.
|
||||
Especially noticable on Windows since libssh2 just didn't work properly
|
||||
non-blocking on Windows before.
|
||||
|
||||
- Peter O'Gorman reported how a SCP transfer would hang for him, and it was
|
||||
fairly easy reproducable. One bug was in the transport layer, ignoring to
|
||||
read more data while there was data left even though it couldn't decrypt the
|
||||
data that was left due to it being too little... The other bug was in the
|
||||
channel layer, where the libssh2_channel_receive_window_adjust() function
|
||||
missed to set the state variables at times and thus this function would
|
||||
misbehave on repeated invokes.
|
||||
|
||||
- Changed the signature of libssh2_channel_setenv_ex to add const to the
|
||||
"varname" parameter (Dan Fandrich)
|
||||
|
||||
- Satish Mittal and David J Sullivan fixed an infinit recv() loop in
|
||||
libssh2_banner_receive()
|
||||
|
||||
Version 0.17 (August 6 2007)
|
||||
----------------------------
|
||||
Changes since previous version include:
|
||||
|
||||
o Re-indented the source code with this GNU indent setup:
|
||||
|
||||
--braces-on-if-line
|
||||
--braces-after-struct-decl-line
|
||||
--space-after-cast
|
||||
--line-length 79
|
||||
--comment-line-length 79
|
||||
--cuddle-else
|
||||
--no-tabs
|
||||
--tab-size 8
|
||||
--indent-level 4
|
||||
--no-space-after-for
|
||||
--space-after-if
|
||||
--space-after-while
|
||||
--no-space-after-function-call-names
|
||||
|
||||
Version 0.16 (August 6 2007)
|
||||
----------------------------
|
||||
Changes since previous version include:
|
||||
|
||||
o CRLF stripping fix for PEM reading
|
||||
o libssh2_scp_recv() error message fix
|
||||
o added HACKING as an initial attempt to describe our source code format
|
||||
o new public defines in include/libssh2.h to allow applictions to figure out
|
||||
version number etc
|
||||
o new script (maketgz) to build releases with
|
||||
o updated files for building with MSVC and mingw
|
||||
o keyboard-interactive would always fail due to claimed memory problem
|
||||
o a few minor memory leaks fixed
|
||||
o libssh2_poll() no longer relies on C99 features
|
||||
o AIX 4 and 5 now supports non-blocking sockets
|
||||
o large file magic checks in configure
|
||||
o LIBSSH2_APINO was removed from the public header file
|
||||
|
||||
This release would not have been possible without these friendly contributors:
|
||||
|
||||
James Housley, Simon Josefsson, Dan Fandrich, Guenter Knauf and I too did
|
||||
some poking. (Sorry if I forgot anyone I should've mentioned here.)
|
||||
|
||||
Of course we would have nothing without the great work by Sara Golemon that
|
||||
we're extending and building upon.
|
||||
|
||||
Version 0.15 (June 15 2007)
|
||||
---------------------------
|
||||
Added libssh2_sftp_readdir_ex() and updated LIBSSH2_APINO to
|
||||
200706151200 (James Housley)
|
||||
|
||||
Converted all of the libssh2 code to be able to work in non-blocking
|
||||
mode. This included some public API changes, listed below (James Housley)
|
||||
Changed function return values:
|
||||
int libssh2_session_free()
|
||||
int libssh2_publickey_shutdown()
|
||||
ssize_t libssh2_channel_read_ex()
|
||||
ssize_t libssh2_channel_write_ex()
|
||||
|
||||
Added functions:
|
||||
libssh2_session_last_errno(), libssh2_channel_handle_extended_data2(),
|
||||
libssh2_channel_wait_closed(), libssh2_channel_wait_eof(),
|
||||
libssh2_session_set_blocking()
|
||||
|
||||
Removed functions:
|
||||
libssh2_channel_readnb_ex(), libssh2_channel_writenb_ex(),
|
||||
libssh2_sftp_readnb(), libssh2_sftp_writenb(),
|
||||
libssh2_sftp_mkdirnb_ex()
|
||||
|
||||
Added the following functions for non-blocking operations: (Daniel Stenberg)
|
||||
libssh2_channel_readnb_ex()
|
||||
libssh2_channel_writenb_ex()
|
||||
libssh2_sftp_readnb()
|
||||
libssh2_sftp_writenb()
|
||||
|
||||
Size parameter changed from 'int' to 'unsigned int' in several
|
||||
public APIs.
|
||||
|
||||
Added (a few) man pages in docs/. (Daniel Stenberg)
|
||||
|
||||
Maximum SSH packet size is now some 35000 bytes.
|
||||
|
||||
Private include files are now in src/ and only public headers are in
|
||||
include/. (Daniel Stenberg)
|
||||
|
||||
Automake and libtool are being used (increased portability). (Daniel
|
||||
Stenberg)
|
||||
|
||||
Fixed OpenSSL detection using pkg-config. (Daniel Stenberg)
|
||||
|
||||
Simple self test added to tests/. (Simon Josefsson)
|
||||
|
||||
Libgcrypt can now be used instead of OpenSSL if you specify
|
||||
--with-libgcrypt. (Simon Josefsson)
|
||||
|
||||
Fixed a memory leak in the packet handling, and better handle out of
|
||||
memory situations. (Dan Fandrich)
|
||||
|
||||
Made libssh2 build with OpenSSL 0.9.6. (Dan Fandrich)
|
||||
|
||||
Improved portability to Solaris related to -lsocket and
|
||||
-lnsl. (Simon Josefsson)
|
||||
|
||||
Clean up of README, INSTALL, NEWS, added ChangeLog. (Simon
|
||||
Josefsson)
|
||||
|
||||
Improve debugging code. Avoids many #ifdef's.
|
||||
|
||||
Improved session closing to avoid potentially truncated files on
|
||||
OpenSSH servers (Dan Fandrich)
|
||||
|
||||
Made some function parameters in the API const (Dan Fandrich)
|
||||
|
||||
Version 0.14
|
||||
------------
|
||||
|
||||
Plug leaks in EVP cipher init/shutdown. (Selcuk Gueney)
|
||||
|
||||
Allow socket_fd == 0 in libssh2_session_startup(). (puudeli)
|
||||
|
||||
Swap ordering of packet_add/packet-inspection to avoid inspect after
|
||||
free. (Selcuk)
|
||||
|
||||
Swap KEX_INIT ordering, send our KEX_INIT first.
|
||||
|
||||
Add check for oportunistic KEX_INIT packets. Burn bad guess if necessary.
|
||||
|
||||
Fix OpenSSL detection using pkg-config. (Dan Casey)
|
||||
|
||||
Version 0.13
|
||||
------------
|
||||
|
||||
Fixed channel not being marked closed when CHANNEL_CLOSE package cannot be
|
||||
sent. (David Robins)
|
||||
|
||||
Fixed payload packet allocation bug when invalid packet length
|
||||
received. (David Robins)
|
||||
|
||||
Fixed `make install' target for MacOSX.
|
||||
|
||||
Add terminating NULL character to readlink()/realpath() results.
|
||||
|
||||
BugFix#1436593: Apply build options for HPUX targets.
|
||||
|
||||
Version 0.12
|
||||
------------
|
||||
|
||||
Added support for publickey subsytem (not the same as publickey auth).
|
||||
|
||||
Fix x11_req. Multiple packet_len issues and error handling logic.
|
||||
(Thanks Simon Hart)
|
||||
|
||||
Fix generation of 'e' portion of Diffie-Hellman keyset.
|
||||
|
||||
Use appropriate order for BN_rand() rather than fixed group1-specific value.
|
||||
|
||||
Re-fixed libssh2_sftp_rename_ex()
|
||||
|
||||
Transport had right packet_len, but sftp layer still had extra 4 bytes.
|
||||
|
||||
Fixed build with newer OpenSSL headers.
|
||||
|
||||
Added extern "C" declarations to libssh2_sftp.h for C++ compatability.
|
||||
|
||||
Version 0.11
|
||||
------------
|
||||
|
||||
Added libssh2_chnnale_get_exit_status() -- Mikhail
|
||||
|
||||
Added libssh2_channel_wait_closed() -- Mikhail
|
||||
|
||||
Added libssh2_userauth_keyboard_interactive_ex() -- Mikhail
|
||||
|
||||
Added libssh2_channel_receive_window_adjust() to be able to increase the
|
||||
size of the receive window.
|
||||
|
||||
Added queueing for small window_adjust packets to avoid unnecessary packet
|
||||
conversation.
|
||||
|
||||
Fixed libssh2_sftp_rename_ex() to only send flags parameter if version >= 5
|
||||
negotiated (not currently possible, but will be and might as well keep the
|
||||
API consistent).
|
||||
|
||||
Version 0.10
|
||||
------------
|
||||
|
||||
Added developer debugging hooks. See --enable-debug-* options to ./configure
|
||||
|
||||
Ignore extended data in the SFTP layer. With no other mechanism to deal
|
||||
with that data it'd just fill up and get stuck.
|
||||
|
||||
(Re)Fixed channel_write() to provide an opportunity for window space to
|
||||
become available again.
|
||||
|
||||
(Re)Fixed SFTP INIT to send the correct SFTP packet length.
|
||||
|
||||
Fixed segfault when client and host can't agree on a hostkey/crypt/mac/comp
|
||||
method. (Thanks puudeli)
|
||||
|
||||
Fixed major issue with sftp packet buffering mechanism. Using wrong
|
||||
blocking semantics. (No puudeli, YOU the man)
|
||||
|
||||
Reduced busy-looping of libssh2_sftp_packet_requirev.
|
||||
|
||||
Version 0.9
|
||||
-----------
|
||||
|
||||
Changed blocking_read to only block as much as necessary and not an
|
||||
arbitrary length of time. (Thanks Felix)
|
||||
|
||||
Fixed SFTP INIT/VERSION to exclude request_id and send correct maximum
|
||||
version number.
|
||||
|
||||
Fixed SFTP to be properly BC with version 1 and 2 servers.
|
||||
|
||||
Fixed libssh2_poll() to recognized closed sessions/channels.
|
||||
|
||||
Fixed libssh2_channel_write_ex() to fully block when set to blocking mode.
|
||||
Return actual bytes written as well. (Thanks deadem)
|
||||
|
||||
Added tests for -lm and -lsocket and add them when necessary.
|
||||
|
||||
Added libssh2_channel_window_read_ex() and libssh2_channel_window_write_ex()
|
||||
for examining the ssh transport windowing states.
|
||||
|
||||
Version 0.8
|
||||
-----------
|
||||
|
||||
Fix potential segfault in compression/decompression.
|
||||
|
||||
Fix compatability with older versions of OpenSSL
|
||||
|
||||
Swapped order of none,zlib compression modes to prefer no compression by
|
||||
default.
|
||||
|
||||
Added sys/uio.h for platforms (FBSD) which need it in order to define struct
|
||||
iovec.
|
||||
|
||||
Added libssh2_poll() to check status of sockets/channels/listeners.
|
||||
|
||||
Removed unnecessary inclusion of stdio.h (holdover from debugging)
|
||||
|
||||
Version 0.7
|
||||
-----------
|
||||
|
||||
Added libssh2_userauth_hostbased_fromfile_ex() for authenticating from hostkey.
|
||||
|
||||
Added configure recognition for MacOSX (Darwin) (Thanks Gabe)
|
||||
|
||||
Fixed extended data identification in libssh2_channel_read().
|
||||
|
||||
Fixed window adjust code. Hadn't acknowledged adjustments correctly.
|
||||
|
||||
Removed initial_window_size requirement for sending window adjust packet.
|
||||
|
||||
|
||||
Version 0.6
|
||||
-----------
|
||||
|
||||
Added LIBSSH2_FLAG_SIGPIPE to enable/disable SIGPIPE generated by
|
||||
send()/recv() calls. Default off.
|
||||
|
||||
Added libssh2_session_flag() to set optional session flags.
|
||||
|
||||
Collapsed exchanging_keys/newkeys/authenticated flags into single state
|
||||
attribute.
|
||||
|
||||
Fix zlib compression issue when internal buffer state misses partial sync.
|
||||
|
||||
Fix segfault when libssh2_session_methods() is called prior to
|
||||
session_startup().
|
||||
|
||||
Fixed client to server channel windowing. Pervent send queue overruns.
|
||||
|
||||
Swapped banner send/receive order (send first, then wait for response).
|
||||
|
||||
Version 0.5
|
||||
-----------
|
||||
|
||||
*** BC Break ***
|
||||
Reimplemented libssh2_session_methods() to match
|
||||
libssh2_session_method_pref() style
|
||||
|
||||
Fixed libssh2_attr2bin() (effects any setstat style call).
|
||||
|
||||
Fixed authenticating with encrypted private key.
|
||||
|
||||
Fixed authenticating via ssh-dss public key.
|
||||
|
||||
Fixed KEX_INIT cookie and packet padding to use actual random data
|
||||
|
||||
Added DESTDIR support to makefiles (Adam Go<47><6F>biowski -- I hope that
|
||||
character set translates right)
|
||||
|
||||
Added libssh2_channel_forward_listen_ex(), libssh2_channel_forward_cancel(),
|
||||
and libssh2_channel_forward_accept().
|
||||
|
||||
Added ./configure option '--disable-gex-new' to allow using the older
|
||||
group-exchange format
|
||||
|
||||
Added MAC methods hmac-md5 and hmac-md5-96.
|
||||
|
||||
Version 0.4
|
||||
-----------
|
||||
|
||||
Fixed crash when trying to free sftp_dirhandle data from a filehandle struct.
|
||||
|
||||
Fixed leak in sftp_open_ex(), handle->handle not freed in handle_close().
|
||||
|
||||
Fixed leak in sftp_symlink_ex(), result for READLINK and REALPATH not freed unless there was an error.
|
||||
|
||||
Added libssh2_banner_set(), specify an arbitrary banner to send on introduction.
|
||||
|
||||
Version 0.3
|
||||
-----------
|
||||
|
||||
Fixed libssh2_channel_read_ex(). Packet loop initialized BEFORE transport polled for new packets (should have been after).
|
||||
|
||||
Fixed blocking issues in scp_send()/scp_recv().
|
||||
|
||||
Fixed degree of indirection in macerror callback.
|
||||
|
||||
Changed packet read mechanism to use a fixed buffer and avoid unnecessary alloc/free calls. (especially while non-block looping)
|
||||
|
||||
Added channel close callback.
|
||||
|
||||
Added SFTP support (Using its own header file: libssh2_sftp.h)
|
||||
|
||||
Version 0.2
|
||||
-----------
|
||||
|
||||
Changed extended data ignorance mechanism:
|
||||
libssh2_channel_ignore_extended_data() changed to libssh2_channel_handle_extended_data()
|
||||
Macro introduced for backward compatability during beta phase.
|
||||
*** THE LIBSSH2_CHANNEL_IGNORE_EXTENDED_DATA() MACRO WILL BE REMOVED PRIOR TO 1.0 RELEASE ***
|
||||
libssh2_channel_handle_extended_data() may be passed one of three "ignore_mode" constants
|
||||
LIBSSH2_CHANNEL_EXTENDED_DATA_NONE Default behavior, queue ED packets and return them with read_ex
|
||||
LIBSSH2_CHANNEL_EXTENDED_DATA_IGNORE Equivalent to libssh2_channel_ignore_extended_data()
|
||||
IGNORE will implicitly flush the extended data stream(s)
|
||||
LIBSSH2_CHANNEL_EXTENDED_DATA_MERGE Calls to channel_read() will check both the standard data stream
|
||||
and the extended data stream(s) for the first available packet
|
||||
|
||||
Changed libssh2_session_disconnect_ex() to return an error code when alloc fails
|
||||
|
||||
Added libssh2_channel_flush_ex() and basic macros: ..._flush() ..._flush_stderr()
|
||||
flush_ex accepts either the streamid (0 for standard data, 1 for stderr) or one of the two following constants:
|
||||
LIBSSH2_CHANNEL_FLUSH_ALL Flush all streams
|
||||
LIBSSH2_CHANNEL_FLUSH_EXTENDED_DATA Flush all streams EXCEPT the standard data stream
|
||||
|
||||
Added libssh2_session_callback_set() for setting ignore/debug/disconnect/macerror callbacks
|
||||
|
||||
Added libssh2_session_method_pref() to selectively set methods and method preferences.
|
||||
|
||||
Added libssh2_session_methods() to determine what methods were negotiated.
|
||||
|
||||
Added libssh2_session_abstract() for retreiving &session->abstract
|
||||
|
||||
Added libssh2_session_last_error() for retreiving error codes/messages
|
||||
|
||||
Version 0.1
|
||||
-----------
|
||||
|
||||
Initial Release:
|
||||
KEX methods: diffie-hellman-group14-sha1, diffie-hellman-group-exchange-sha1, diffie-hellman-group1-sha1
|
||||
Hostkey methods: ssh-rsa, ssh-dss
|
||||
Cipher methods: aes256-cbc, rijndael-cbc@lysator.liu.se, aes192-cbc, aes128-cbc, blowfish-cbc, arcfour, cast128-cbc, 3des-cbc, none*
|
||||
Compression methods: zlib, none
|
||||
MAC methods: hmac-sha1, hmac-sha1-96, hmac-ripemd160, hmac-ripemd160@openssh.com none*
|
||||
*Cipher/MAC "none" is disabled by default for security purposes,
|
||||
Use --enable-crypt-none and/or --enable-mac-none with ./configure to enable
|
||||
NEWS is now generated from git and put into the release tarballs.
|
||||
|
@@ -1,34 +1,19 @@
|
||||
libssh2 1.2.7
|
||||
libssh2 1.3.0
|
||||
|
||||
This release includes the following changes:
|
||||
|
||||
o Added Watcom makefile
|
||||
o Added custom callbacks for performing low level socket I/O
|
||||
|
||||
This release includes the following bugfixes:
|
||||
|
||||
o Better handling of invalid key files
|
||||
o inputchecks: make lots of API functions check for NULL pointers
|
||||
o libssh2_session_callback_set: extended the man page
|
||||
o SFTP: limit write() to not produce overly large packets
|
||||
o agent: make libssh2_agent_userauth() work blocking properly
|
||||
o _libssh2_userauth_publickey: reject method names longer than the data
|
||||
o channel_free: ignore problems with channel_close()
|
||||
o typedef: make ssize_t get typedef without LIBSSH2_WIN32
|
||||
o _libssh2_wait_socket: poll needs milliseconds
|
||||
o libssh2_wait_socket: reset error code to "leak" EAGAIN less
|
||||
o Added include for sys/select.h to get fd.set on some platforms
|
||||
o session_free: free more data to avoid memory leaks
|
||||
o openssl: make use of the EVP interface
|
||||
o Fix underscore typo for 64-bit printf format specifiers on Windows
|
||||
o Make libssh2_debug() create a correctly terminated string
|
||||
o userauth_hostbased_fromfile: packet length too short
|
||||
o handshake: Compression enabled at the wrong time
|
||||
o Don't overflow MD5 server hostkey
|
||||
o sftp_read: advance offset correctly for buffered copies
|
||||
o libssh2_sftp_seek64: flush packetlist and buffered data
|
||||
o _libssh2_packet_add: adjust window size when truncating
|
||||
o sftp_read: a short read is not end of file
|
||||
|
||||
This release would not have looked like this without help, code, reports and
|
||||
advice from friends like these:
|
||||
|
||||
Alexander Lamaison, Guenter Knauf, Peter Stuge, Simon Josefsson, Lars Nordin,
|
||||
John Little, Daniel Stenberg, TJ Saunders, Tor Arntsen
|
||||
Henrik Nordstrom, liuzl, Guenter Knauf
|
||||
|
||||
Thanks! (and sorry if I forgot to mention someone)
|
||||
|
127
TODO
127
TODO
@@ -1,6 +1,9 @@
|
||||
Things TODO
|
||||
===========
|
||||
|
||||
* Fix the numerous malloc+copy operations for sending data, see "Buffering
|
||||
Improvements" below for details
|
||||
|
||||
* make sure the windowing code adapts better to slow situations so that it
|
||||
doesn't then use as much memory as today. Possibly by an app-controllable
|
||||
"Window mode"?
|
||||
@@ -11,9 +14,11 @@ Things TODO
|
||||
|
||||
* Add more info to the man pages.
|
||||
|
||||
* Decrease the number of mallocs. Everywhere.
|
||||
* Decrease the number of mallocs. Everywhere. Will get easier once the
|
||||
buffering improvements have been done.
|
||||
|
||||
* Use SO_NOSIGPIPE for Mac OS/BSD systems where MSG_NOSIGNAL doesn't exist/work
|
||||
* Use SO_NOSIGPIPE for Mac OS/BSD systems where MSG_NOSIGNAL doesn't
|
||||
exist/work
|
||||
|
||||
* Extend the test suite to actually test lots of aspects of libssh2
|
||||
|
||||
@@ -21,6 +26,13 @@ Things TODO
|
||||
|
||||
* Expose error messages sent by the server
|
||||
|
||||
* Make SFTP transfers ask for and send several packages at once so that it
|
||||
doesn't have to send-waitforack-send-waitforack as much. This will be
|
||||
easier/smoother if we implement the "New SFTP API" described below.
|
||||
|
||||
* select() is troublesome with libssh2 when using multiple channels over
|
||||
the same session. See "New Transport API" below for more details.
|
||||
|
||||
At next SONAME bump
|
||||
===================
|
||||
|
||||
@@ -38,6 +50,7 @@ At next SONAME bump
|
||||
libssh2_channel_receive_window_adjust()
|
||||
libssh2_poll()
|
||||
libssh2_poll_channel_read()
|
||||
libssh2_session_startup() (libssh2_session_handshake() is the replacement)
|
||||
|
||||
* Rename a few function:
|
||||
|
||||
@@ -58,3 +71,113 @@ At next SONAME bump
|
||||
|
||||
* remove the existing libssh2_knownhost_check() functin and rename
|
||||
libssh2_knownhost_checkp() to become the new libssh2_knownhost_check instead
|
||||
|
||||
Buffering Improvements
|
||||
======================
|
||||
|
||||
transport_write
|
||||
|
||||
- If this function gets called with a total packet size that is larger than
|
||||
32K, it should create more than one SSH packet so that it keeps the largest
|
||||
one below 32K
|
||||
|
||||
sftp_write
|
||||
|
||||
- should not copy/allocate anything for the data, only create a header chunk
|
||||
and pass on the payload data to channel_write "pointed to"
|
||||
|
||||
New Transport API
|
||||
=================
|
||||
|
||||
THE PROBLEM
|
||||
|
||||
The problem in a nutshell is that when an application opens up multiple
|
||||
channels over a single session, those are all using the same socket. If the
|
||||
application is then using select() to wait for traffic (like any sensible app
|
||||
does) and wants to act on the data when select() tells there is something to
|
||||
for example read, what does an application do?
|
||||
|
||||
With our current API, you have to loop over all the channels and read from
|
||||
them to see if they have data. This effectively makes blocking reads
|
||||
impossible. If the app has many channels in a setup like this, it even becomes
|
||||
slow. (The original API had the libssh2_poll_channel_read() and libssh2_poll()
|
||||
to somewhat overcome this hurdle, but they too have pretty much the same
|
||||
problems plus a few others.)
|
||||
|
||||
Traffic in the other direction is similarly limited: the app has to try
|
||||
sending to all channels, even though some of them may very well not accept any
|
||||
data at that point.
|
||||
|
||||
A SOLUTION
|
||||
|
||||
I suggest we introduce two new helper functions:
|
||||
|
||||
libssh2_transport_read()
|
||||
|
||||
- Read "a bunch" of data from the given socket and returns information to the
|
||||
app about what channels that are now readable (ie they will not block when
|
||||
read from). The function can be called over and over and it will repeatedly
|
||||
return info about what channels that are readable at that moment.
|
||||
|
||||
libssh2_transport_write()
|
||||
|
||||
- Returns information about what channels that are writable, in the sense
|
||||
that they have windows set from the remote side that allows data to get
|
||||
sent. Writing to one of those channels will not block. Of course, the
|
||||
underlying socket may only accept a certain amount of data, so at the first
|
||||
short return, nothing more should be attempted to get sent until select()
|
||||
(or equivalent) has been used on the master socket again.
|
||||
|
||||
I haven't yet figured out a sensible API for how these functions should return
|
||||
that info, but if we agree on the general principles I guess we can work that
|
||||
out.
|
||||
|
||||
VOLUNTARY
|
||||
|
||||
I wanted to mention that these two helper functions would not be mandatory
|
||||
in any way. They would just be there for those who want them, and existing
|
||||
programs can remain using the old functions only if they prefer to.
|
||||
|
||||
New SFTP API
|
||||
============
|
||||
|
||||
PURPOSE
|
||||
|
||||
Provide API functions that explicitly tells at once that a (full) SFTP file
|
||||
transfer is wanted, to allow libssh2 to leverage on that knowledge to speed
|
||||
up things internally. It can for example do read ahead, buffer writes (merge
|
||||
small writes into larger chunks), better tune the SSH window and more. This
|
||||
sort of API is already provided for SCP transfers.
|
||||
|
||||
API
|
||||
|
||||
New functions:
|
||||
|
||||
LIBSSH2_SFTP_HANDLE *libssh2_sftp_send(SFTP_SESSION *sftp,
|
||||
uint64_t filesize,
|
||||
char *remote_path,
|
||||
size_t remote_path_len,
|
||||
long mode);
|
||||
|
||||
Tell libssh2 that a local file with a given size is about to get sent to
|
||||
the SFTP server.
|
||||
|
||||
LIBSSH2_SFTP_HANDLE *libssh2_sftp_recv();
|
||||
|
||||
Tell libssh2 that a remote file is requested to get downloaded from the SFTP
|
||||
server.
|
||||
|
||||
Only the setup of the file transfer is different from an application's point
|
||||
of view. Depending on direction of the transfer(s), the following already
|
||||
existing functions should then be used until the transfer is complete:
|
||||
|
||||
libssh2_sftp_read()
|
||||
libssh2_sftp_write()
|
||||
|
||||
HOW TO USE
|
||||
|
||||
1. Setup the transfer using one of the two new functions.
|
||||
|
||||
2. Loop through the reading or writing of data.
|
||||
|
||||
3. Cleanup the transfer
|
||||
|
12
configure.ac
12
configure.ac
@@ -15,12 +15,14 @@ if test "x$SED" = "xsed-was-not-found-by-configure"; then
|
||||
fi
|
||||
|
||||
dnl figure out the libssh2 version
|
||||
VERSION=`$SED -ne 's/^#define LIBSSH2_VERSION *"\(.*\)"/\1/p' ${srcdir}/include/libssh2.h`
|
||||
AM_INIT_AUTOMAKE(libssh2,$VERSION)
|
||||
LIBSSH2VER=`$SED -ne 's/^#define LIBSSH2_VERSION *"\(.*\)"/\1/p' ${srcdir}/include/libssh2.h`
|
||||
AM_INIT_AUTOMAKE
|
||||
AC_MSG_CHECKING([libssh2 version])
|
||||
AC_MSG_RESULT($VERSION)
|
||||
AC_MSG_RESULT($LIBSSH2VER)
|
||||
|
||||
AB_VERSION=$VERSION
|
||||
AC_SUBST(LIBSSH2VER)
|
||||
|
||||
AB_VERSION=$LIBSSH2VER
|
||||
|
||||
AB_INIT
|
||||
|
||||
@@ -289,7 +291,7 @@ AC_OUTPUT
|
||||
|
||||
AC_MSG_NOTICE([summary of build options:
|
||||
|
||||
version: ${VERSION}
|
||||
version: ${LIBSSH2VER}
|
||||
Host type: ${host}
|
||||
Install prefix: ${prefix}
|
||||
Compiler: ${CC}
|
||||
|
@@ -25,6 +25,7 @@ dist_man_MANS = \
|
||||
libssh2_channel_forward_listen.3 \
|
||||
libssh2_channel_forward_listen_ex.3 \
|
||||
libssh2_channel_free.3 \
|
||||
libssh2_channel_get_exit_signal.3 \
|
||||
libssh2_channel_get_exit_status.3 \
|
||||
libssh2_channel_handle_extended_data.3 \
|
||||
libssh2_channel_handle_extended_data2.3 \
|
||||
@@ -59,10 +60,11 @@ dist_man_MANS = \
|
||||
libssh2_channel_x11_req.3 \
|
||||
libssh2_channel_x11_req_ex.3 \
|
||||
libssh2_exit.3 \
|
||||
libssh2_free_host_entry.3 \
|
||||
libssh2_host_entry_match.3 \
|
||||
libssh2_free.3 \
|
||||
libssh2_hostkey_hash.3 \
|
||||
libssh2_init.3 \
|
||||
libssh2_keepalive_config.3 \
|
||||
libssh2_keepalive_send.3 \
|
||||
libssh2_knownhost_add.3 \
|
||||
libssh2_knownhost_addc.3 \
|
||||
libssh2_knownhost_check.3 \
|
||||
@@ -75,7 +77,6 @@ dist_man_MANS = \
|
||||
libssh2_knownhost_readline.3 \
|
||||
libssh2_knownhost_writefile.3 \
|
||||
libssh2_knownhost_writeline.3 \
|
||||
libssh2_new_host_entry.3 \
|
||||
libssh2_poll.3 \
|
||||
libssh2_poll_channel_read.3 \
|
||||
libssh2_publickey_add.3 \
|
||||
@@ -88,8 +89,8 @@ dist_man_MANS = \
|
||||
libssh2_publickey_shutdown.3 \
|
||||
libssh2_scp_recv.3 \
|
||||
libssh2_scp_send.3 \
|
||||
libssh2_scp_send_ex.3 \
|
||||
libssh2_scp_send64.3 \
|
||||
libssh2_scp_send_ex.3 \
|
||||
libssh2_session_abstract.3 \
|
||||
libssh2_session_block_directions.3 \
|
||||
libssh2_session_callback_set.3 \
|
||||
@@ -98,6 +99,7 @@ dist_man_MANS = \
|
||||
libssh2_session_flag.3 \
|
||||
libssh2_session_free.3 \
|
||||
libssh2_session_get_blocking.3 \
|
||||
libssh2_session_get_timeout.3 \
|
||||
libssh2_session_hostkey.3 \
|
||||
libssh2_session_init.3 \
|
||||
libssh2_session_init_ex.3 \
|
||||
@@ -106,6 +108,7 @@ dist_man_MANS = \
|
||||
libssh2_session_method_pref.3 \
|
||||
libssh2_session_methods.3 \
|
||||
libssh2_session_set_blocking.3 \
|
||||
libssh2_session_set_timeout.3 \
|
||||
libssh2_session_startup.3 \
|
||||
libssh2_sftp_close.3 \
|
||||
libssh2_sftp_close_handle.3 \
|
||||
@@ -133,6 +136,7 @@ dist_man_MANS = \
|
||||
libssh2_sftp_rmdir.3 \
|
||||
libssh2_sftp_rmdir_ex.3 \
|
||||
libssh2_sftp_seek.3 \
|
||||
libssh2_sftp_seek64.3 \
|
||||
libssh2_sftp_setstat.3 \
|
||||
libssh2_sftp_shutdown.3 \
|
||||
libssh2_sftp_stat.3 \
|
||||
@@ -155,6 +159,7 @@ dist_man_MANS = \
|
||||
libssh2_userauth_list.3 \
|
||||
libssh2_userauth_password.3 \
|
||||
libssh2_userauth_password_ex.3 \
|
||||
libssh2_userauth_publickey.3 \
|
||||
libssh2_userauth_publickey_fromfile.3 \
|
||||
libssh2_userauth_publickey_fromfile_ex.3 \
|
||||
libssh2_version.3
|
||||
|
@@ -6,7 +6,8 @@ libssh2_channel_direct_tcpip - convenience macro for \fIlibssh2_channel_direct_t
|
||||
.SH SYNOPSIS
|
||||
#include <libssh2.h>
|
||||
|
||||
libssh2_channel_direct_tcpip(arguments)
|
||||
LIBSSH2_CHANNEL *
|
||||
libssh2_channel_direct_tcpip(LIBSSH2_SESSION *session, const char *host, int port);
|
||||
|
||||
.SH DESCRIPTION
|
||||
This is a macro defined in a public libssh2 header file that is using the
|
||||
@@ -16,4 +17,4 @@ See \fIlibssh2_channel_direct_tcpip_ex(3)\fP
|
||||
.SH ERRORS
|
||||
See \fIlibssh2_channel_direct_tcpip_ex(3)\fP
|
||||
.SH SEE ALSO
|
||||
.BR \fIlibssh2_channel_direct_tcpip_ex(3)\fP
|
||||
.BR libssh2_channel_direct_tcpip_ex(3)
|
||||
|
@@ -6,7 +6,7 @@ libssh2_channel_exec - convenience macro for \fIlibssh2_channel_process_startup(
|
||||
.SH SYNOPSIS
|
||||
#include <libssh2.h>
|
||||
|
||||
libssh2_channel_exec(arguments)
|
||||
int libssh2_channel_exec(LIBSSH2_CHANNEL *channel, const char *command);
|
||||
|
||||
.SH DESCRIPTION
|
||||
This is a macro defined in a public libssh2 header file that is using the
|
||||
@@ -16,4 +16,4 @@ See \fIlibssh2_channel_process_startup(3)\fP
|
||||
.SH ERRORS
|
||||
See \fIlibssh2_channel_process_startup(3)\fP
|
||||
.SH SEE ALSO
|
||||
.BR \fIlibssh2_channel_process_startup(3)\fP
|
||||
.BR libssh2_channel_process_startup(3)
|
||||
|
@@ -6,7 +6,7 @@ libssh2_channel_flush - convenience macro for \fIlibssh2_channel_flush_ex(3)\fP
|
||||
.SH SYNOPSIS
|
||||
#include <libssh2.h>
|
||||
|
||||
libssh2_channel_flush(arguments)
|
||||
int libssh2_channel_flush(LIBSSH2_CHANNEL *channel);
|
||||
|
||||
.SH DESCRIPTION
|
||||
This is a macro defined in a public libssh2 header file that is using the
|
||||
@@ -16,4 +16,4 @@ See \fIlibssh2_channel_flush_ex(3)\fP
|
||||
.SH ERRORS
|
||||
See \fIlibssh2_channel_flush_ex(3)\fP
|
||||
.SH SEE ALSO
|
||||
.BR \fIlibssh2_channel_flush_ex(3)\fP
|
||||
.BR libssh2_channel_flush_ex(3)
|
||||
|
@@ -6,7 +6,7 @@ libssh2_channel_flush_stderr - convenience macro for \fIlibssh2_channel_flush_ex
|
||||
.SH SYNOPSIS
|
||||
#include <libssh2.h>
|
||||
|
||||
libssh2_channel_flush_stderr(arguments)
|
||||
int libssh2_channel_flush_stderr(LIBSSH2_CHANNEL *channel);
|
||||
|
||||
.SH DESCRIPTION
|
||||
This is a macro defined in a public libssh2 header file that is using the
|
||||
@@ -16,4 +16,4 @@ See \fIlibssh2_channel_flush_ex(3)\fP
|
||||
.SH ERRORS
|
||||
See \fIlibssh2_channel_flush_ex(3)\fP
|
||||
.SH SEE ALSO
|
||||
.BR \fIlibssh2_channel_flush_ex(3)\fP
|
||||
.BR libssh2_channel_flush_ex(3)
|
||||
|
@@ -15,7 +15,8 @@ libssh2_channel_forward_accept(LIBSSH2_LISTENER *listener);
|
||||
.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.
|
||||
When this function returns NULL use \fIlibssh2_session_last_errno(3)\fP to
|
||||
extract the error code. If that code is \fILIBSSH2_ERROR_EAGAIN\fP, the
|
||||
session is set to do non-blocking I/O but the call would block.
|
||||
.SH SEE ALSO
|
||||
.BR libssh2_channel_forward_listen_ex(3)
|
||||
|
@@ -6,7 +6,7 @@ libssh2_channel_forward_listen - convenience macro for \fIlibssh2_channel_forwar
|
||||
.SH SYNOPSIS
|
||||
#include <libssh2.h>
|
||||
|
||||
libssh2_channel_forward_listen(arguments)
|
||||
int libssh2_channel_forward_listen(LIBSSH2_SESSION *session, int port);
|
||||
|
||||
.SH DESCRIPTION
|
||||
This is a macro defined in a public libssh2 header file that is using the
|
||||
@@ -16,4 +16,4 @@ See \fIlibssh2_channel_forward_listen_ex(3)\fP
|
||||
.SH ERRORS
|
||||
See \fIlibssh2_channel_forward_listen_ex(3)\fP
|
||||
.SH SEE ALSO
|
||||
.BR \fIlibssh2_channel_forward_listen_ex(3)\fP
|
||||
.BR libssh2_channel_forward_listen_ex(3)
|
||||
|
36
docs/libssh2_channel_get_exit_signal.3
Normal file
36
docs/libssh2_channel_get_exit_signal.3
Normal file
@@ -0,0 +1,36 @@
|
||||
.\" $Id$
|
||||
.\"
|
||||
.TH libssh2_channel_get_exit_signal 3 "4 Oct 2010" "libssh2 1.2.8" "libssh2 manual"
|
||||
.SH NAME
|
||||
libssh2_channel_get_exit_signal - get the remote exit signal
|
||||
.SH SYNOPSIS
|
||||
#include <libssh2.h>
|
||||
|
||||
int
|
||||
libssh2_channel_get_exit_signal(LIBSSH2_CHANNEL *channel, char **exitsignal, size_t *exitsignal_len, char **errmsg, size_t *errmsg_len, char **langtag, size_t *langtag_len);
|
||||
|
||||
.SH DESCRIPTION
|
||||
\fIchannel\fP - Closed channel stream to retrieve exit signal from.
|
||||
|
||||
\fIexitsignal\fP - If not NULL, is populated by reference with the exit signal
|
||||
(without leading "SIG"). Note that the string is stored in a newly allocated
|
||||
buffer. If the remote program exited cleanly, the referenced string pointer
|
||||
will be set to NULL.
|
||||
|
||||
\fIexitsignal_len\fP - If not NULL, is populated by reference with the length
|
||||
of exitsignal.
|
||||
|
||||
\fIerrmsg\fP - If not NULL, is populated by reference with the error message
|
||||
(if provided by remote server, if not it will be set to NULL). Note that the
|
||||
string is stored in a newly allocated buffer.
|
||||
|
||||
\fIerrmsg_len\fP - If not NULL, is populated by reference with the length of errmsg.
|
||||
|
||||
\fIlangtag\fP - If not NULL, is populated by reference with the language tag
|
||||
(if provided by remote server, if not it will be set to NULL). Note that the
|
||||
string is stored in a newly allocated buffer.
|
||||
|
||||
\fIlangtag_len\fP - If not NULL, is populated by reference with the length of langtag.
|
||||
|
||||
.SH RETURN VALUE
|
||||
Numeric error code corresponding to the the Error Code constants.
|
@@ -9,6 +9,9 @@ libssh2_channel_ignore_extended_data - convenience macro for \fIlibssh2_channel_
|
||||
libssh2_channel_ignore_extended_data(arguments)
|
||||
|
||||
.SH DESCRIPTION
|
||||
This function is deprecated. Use the
|
||||
\fIlibssh2_channel_handle_extended_data2(3)\fP function instead!
|
||||
|
||||
This is a macro defined in a public libssh2 header file that is using the
|
||||
underlying function \fIlibssh2_channel_handle_extended_data(3)\fP.
|
||||
.SH RETURN VALUE
|
||||
@@ -16,4 +19,4 @@ See \fIlibssh2_channel_handle_extended_data(3)\fP
|
||||
.SH ERRORS
|
||||
See \fIlibssh2_channel_handle_extended_data(3)\fP
|
||||
.SH SEE ALSO
|
||||
.BR \fIlibssh2_channel_handle_extended_data(3)\fP
|
||||
.BR libssh2_channel_handle_extended_data(3)
|
||||
|
@@ -6,7 +6,8 @@ libssh2_channel_open_session - convenience macro for \fIlibssh2_channel_open_ex(
|
||||
.SH SYNOPSIS
|
||||
#include <libssh2.h>
|
||||
|
||||
libssh2_channel_open_session(arguments)
|
||||
LIBSSH2_CHANNEL *
|
||||
libssh2_channel_open_session(LIBSSH2_SESSION *session);
|
||||
|
||||
.SH DESCRIPTION
|
||||
This is a macro defined in a public libssh2 header file that is using the
|
||||
@@ -16,4 +17,4 @@ See \fIlibssh2_channel_open_ex(3)\fP
|
||||
.SH ERRORS
|
||||
See \fIlibssh2_channel_open_ex(3)\fP
|
||||
.SH SEE ALSO
|
||||
.BR \fIlibssh2_channel_open_ex(3)\fP
|
||||
.BR libssh2_channel_open_ex(3)
|
||||
|
@@ -4,20 +4,14 @@
|
||||
.SH NAME
|
||||
libssh2_channel_process_startup - request a shell on a channel
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#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);
|
||||
|
||||
int libssh2_channel_process_startup(LIBSSH2_CHANNEL *channel,
|
||||
const char *request,
|
||||
unsigned int request_len,
|
||||
const char *message,
|
||||
unsigned int message_len);
|
||||
.SH DESCRIPTION
|
||||
\fIchannel\fP - Active session channel instance.
|
||||
|
||||
|
@@ -6,7 +6,7 @@ libssh2_channel_read - convenience macro for \fIlibssh2_channel_read_ex(3)\fP ca
|
||||
.SH SYNOPSIS
|
||||
#include <libssh2.h>
|
||||
|
||||
libssh2_channel_read(arguments)
|
||||
ssize_t libssh2_channel_read(LIBSSH2_CHANNEL *channel, char *buf, size_t buflen);
|
||||
|
||||
.SH DESCRIPTION
|
||||
This is a macro defined in a public libssh2 header file that is using the
|
||||
@@ -16,4 +16,4 @@ See \fIlibssh2_channel_read_ex(3)\fP
|
||||
.SH ERRORS
|
||||
See \fIlibssh2_channel_read_ex(3)\fP
|
||||
.SH SEE ALSO
|
||||
.BR \fIlibssh2_channel_read_ex(3)\fP
|
||||
.BR libssh2_channel_read_ex(3)
|
||||
|
@@ -6,7 +6,7 @@ libssh2_channel_read_stderr - convenience macro for \fIlibssh2_channel_read_ex(3
|
||||
.SH SYNOPSIS
|
||||
#include <libssh2.h>
|
||||
|
||||
libssh2_channel_read_stderr(arguments)
|
||||
ssize_t libssh2_channel_read_stderr(LIBSSH2_CHANNEL *channel, char *buf, size_t buflen);
|
||||
|
||||
.SH DESCRIPTION
|
||||
This is a macro defined in a public libssh2 header file that is using the
|
||||
@@ -16,4 +16,4 @@ See \fIlibssh2_channel_read_ex(3)\fP
|
||||
.SH ERRORS
|
||||
See \fIlibssh2_channel_read_ex(3)\fP
|
||||
.SH SEE ALSO
|
||||
.BR \fIlibssh2_channel_read_ex(3)\fP
|
||||
.BR libssh2_channel_read_ex(3)
|
||||
|
@@ -6,7 +6,7 @@ libssh2_channel_request_pty - convenience macro for \fIlibssh2_channel_request_p
|
||||
.SH SYNOPSIS
|
||||
#include <libssh2.h>
|
||||
|
||||
libssh2_channel_request_pty(arguments)
|
||||
int libssh2_channel_request_pty(LIBSSH2_SESSION *session, const char *term);
|
||||
|
||||
.SH DESCRIPTION
|
||||
This is a macro defined in a public libssh2 header file that is using the
|
||||
@@ -16,4 +16,4 @@ See \fIlibssh2_channel_request_pty_ex(3)\fP
|
||||
.SH ERRORS
|
||||
See \fIlibssh2_channel_request_pty_ex(3)\fP
|
||||
.SH SEE ALSO
|
||||
.BR \fIlibssh2_channel_request_pty_ex(3)\fP
|
||||
.BR libssh2_channel_request_pty_ex(3)
|
||||
|
@@ -6,7 +6,7 @@ libssh2_channel_request_pty_size - convenience macro for \fIlibssh2_channel_requ
|
||||
.SH SYNOPSIS
|
||||
#include <libssh2.h>
|
||||
|
||||
libssh2_channel_request_pty_size(arguments)
|
||||
int libssh2_channel_request_pty_size(LIBSSH2_CHANNEL *channel, int width, int height);
|
||||
|
||||
.SH DESCRIPTION
|
||||
This is a macro defined in a public libssh2 header file that is using the
|
||||
@@ -16,4 +16,4 @@ See \fIlibssh2_channel_request_pty_size_ex(3)\fP
|
||||
.SH ERRORS
|
||||
See \fIlibssh2_channel_request_pty_size_ex(3)\fP
|
||||
.SH SEE ALSO
|
||||
.BR \fIlibssh2_channel_request_pty_size_ex(3)\fP
|
||||
.BR libssh2_channel_request_pty_size_ex(3)
|
||||
|
@@ -6,7 +6,7 @@ libssh2_channel_setenv - convenience macro for \fIlibssh2_channel_setenv_ex(3)\f
|
||||
.SH SYNOPSIS
|
||||
#include <libssh2.h>
|
||||
|
||||
libssh2_channel_setenv(arguments)
|
||||
int libssh2_channel_setenv(LIBSSH2_CHANNEL *channel, const char *varname, const char *value);
|
||||
|
||||
.SH DESCRIPTION
|
||||
This is a macro defined in a public libssh2 header file that is using the
|
||||
@@ -16,4 +16,4 @@ See \fIlibssh2_channel_setenv_ex(3)\fP
|
||||
.SH ERRORS
|
||||
See \fIlibssh2_channel_setenv_ex(3)\fP
|
||||
.SH SEE ALSO
|
||||
.BR \fIlibssh2_channel_setenv_ex(3)\fP
|
||||
.BR libssh2_channel_setenv_ex(3)
|
||||
|
@@ -6,7 +6,7 @@ libssh2_channel_shell - convenience macro for \fIlibssh2_channel_process_startup
|
||||
.SH SYNOPSIS
|
||||
#include <libssh2.h>
|
||||
|
||||
libssh2_channel_shell(arguments)
|
||||
int libssh2_channel_shell(LIBSSH2_CHANNEL *channel);
|
||||
|
||||
.SH DESCRIPTION
|
||||
This is a macro defined in a public libssh2 header file that is using the
|
||||
@@ -16,4 +16,4 @@ See \fIlibssh2_channel_process_startup(3)\fP
|
||||
.SH ERRORS
|
||||
See \fIlibssh2_channel_process_startup(3)\fP
|
||||
.SH SEE ALSO
|
||||
.BR \fIlibssh2_channel_process_startup(3)\fP
|
||||
.BR libssh2_channel_process_startup(3)
|
||||
|
@@ -6,7 +6,7 @@ libssh2_channel_subsystem - convenience macro for \fIlibssh2_channel_process_sta
|
||||
.SH SYNOPSIS
|
||||
#include <libssh2.h>
|
||||
|
||||
libssh2_channel_subsystem(arguments)
|
||||
int libssh2_channel_subsystem(LIBSSH2_CHANNEL *channel, const char *subsystem);
|
||||
|
||||
.SH DESCRIPTION
|
||||
This is a macro defined in a public libssh2 header file that is using the
|
||||
@@ -16,4 +16,4 @@ See \fIlibssh2_channel_process_startup(3)\fP
|
||||
.SH ERRORS
|
||||
See \fIlibssh2_channel_process_startup(3)\fP
|
||||
.SH SEE ALSO
|
||||
.BR \fIlibssh2_channel_process_startup(3)\fP
|
||||
.BR libssh2_channel_process_startup(3)
|
||||
|
@@ -6,7 +6,7 @@ libssh2_channel_window_read - convenience macro for \fIlibssh2_channel_window_re
|
||||
.SH SYNOPSIS
|
||||
#include <libssh2.h>
|
||||
|
||||
libssh2_channel_window_read(arguments)
|
||||
unsigned long libssh2_channel_window_read(LIBSSH2_CHANNEL *channel);
|
||||
|
||||
.SH DESCRIPTION
|
||||
This is a macro defined in a public libssh2 header file that is using the
|
||||
@@ -16,4 +16,4 @@ See \fIlibssh2_channel_window_read_ex(3)\fP
|
||||
.SH ERRORS
|
||||
See \fIlibssh2_channel_window_read_ex(3)\fP
|
||||
.SH SEE ALSO
|
||||
.BR \fIlibssh2_channel_window_read_ex(3)\fP
|
||||
.BR libssh2_channel_window_read_ex(3)
|
||||
|
@@ -6,7 +6,7 @@ libssh2_channel_window_write - convenience macro for \fIlibssh2_channel_window_w
|
||||
.SH SYNOPSIS
|
||||
#include <libssh2.h>
|
||||
|
||||
libssh2_channel_window_write(arguments)
|
||||
unsigend long libssh2_channel_window_write(LIBSSH2_CHANNEL *channel);
|
||||
|
||||
.SH DESCRIPTION
|
||||
This is a macro defined in a public libssh2 header file that is using the
|
||||
@@ -16,4 +16,4 @@ See \fIlibssh2_channel_window_write_ex(3)\fP
|
||||
.SH ERRORS
|
||||
See \fIlibssh2_channel_window_write_ex(3)\fP
|
||||
.SH SEE ALSO
|
||||
.BR \fIlibssh2_channel_window_write_ex(3)\fP
|
||||
.BR libssh2_channel_window_write_ex(3)
|
||||
|
@@ -7,8 +7,8 @@ libssh2_channel_write - convenience macro for \fIlibssh2_channel_write_ex(3)\fP
|
||||
.nf
|
||||
#include <libssh2.h>
|
||||
|
||||
#define libssh2_channel_write(channel, buf, buflen) \\
|
||||
libssh2_channel_write_ex((channel), 0, (buf), (buflen))
|
||||
ssize_t libssh2_channel_write(LIBSSH2_CHANNEL *channel, const char *buf, size_t buflen);
|
||||
|
||||
.SH DESCRIPTION
|
||||
This is a macro defined in a public libssh2 header file that is using the
|
||||
underlying function \fIlibssh2_channel_write_ex(3)\fP.
|
||||
@@ -17,4 +17,4 @@ See \fIlibssh2_channel_write_ex(3)\fP
|
||||
.SH ERRORS
|
||||
See \fIlibssh2_channel_write_ex(3)\fP
|
||||
.SH SEE ALSO
|
||||
.BR \fIlibssh2_channel_write_ex(3)\fP
|
||||
.BR libssh2_channel_write_ex(3)
|
||||
|
@@ -7,8 +7,8 @@ libssh2_channel_write_stderr - convenience macro for \fIlibssh2_channel_write_ex
|
||||
.nf
|
||||
#include <libssh2.h>
|
||||
|
||||
#define libssh2_channel_write_stderr(channel, buf, buflen) \\
|
||||
libssh2_channel_write_ex((channel), SSH_EXTENDED_DATA_STDERR, (buf), (buflen))
|
||||
ssize_t libssh2_channel_write_stderr(LIBSSH2_CHANNEL *channel, const char *buf, size_t buflen);
|
||||
|
||||
.SH DESCRIPTION
|
||||
This is a macro defined in a public libssh2 header file that is using the
|
||||
underlying function \fIlibssh2_channel_write_ex(3)\fP.
|
||||
@@ -17,4 +17,4 @@ See \fIlibssh2_channel_write_ex(3)\fP
|
||||
.SH ERRORS
|
||||
See \fIlibssh2_channel_write_ex(3)\fP
|
||||
.SH SEE ALSO
|
||||
.BR \fIlibssh2_channel_write_ex(3)\fP
|
||||
.BR libssh2_channel_write_ex(3)
|
||||
|
@@ -6,7 +6,7 @@ libssh2_channel_x11_req - convenience macro for \fIlibssh2_channel_x11_req_ex(3)
|
||||
.SH SYNOPSIS
|
||||
#include <libssh2.h>
|
||||
|
||||
libssh2_channel_x11_req(arguments)
|
||||
int libssh2_channel_x11_req(LIBSSH2_CHANNEL *channel, int screen_number);
|
||||
|
||||
.SH DESCRIPTION
|
||||
This is a macro defined in a public libssh2 header file that is using the
|
||||
@@ -16,4 +16,4 @@ See \fIlibssh2_channel_x11_req_ex(3)\fP
|
||||
.SH ERRORS
|
||||
See \fIlibssh2_channel_x11_req_ex(3)\fP
|
||||
.SH SEE ALSO
|
||||
.BR \fIlibssh2_channel_x11_req_ex(3)\fP
|
||||
.BR libssh2_channel_x11_req_ex(3)
|
||||
|
19
docs/libssh2_free.3
Normal file
19
docs/libssh2_free.3
Normal file
@@ -0,0 +1,19 @@
|
||||
.TH libssh2_exit 3 "13 Oct 2010" "libssh2 1.2.8" "libssh2 manual"
|
||||
.SH NAME
|
||||
libssh2_free - deallocate libssh2 memory
|
||||
.SH SYNOPSIS
|
||||
#include <libssh2.h>
|
||||
|
||||
void
|
||||
libssh2_free(LIBSSH2_SESSION *session, void *ptr);
|
||||
.SH DESCRIPTION
|
||||
Deallocate memory allocated by earlier call to libssh2 functions. It
|
||||
uses the memory allocation callbacks provided by the application, if
|
||||
any. Otherwise, this will just call free().
|
||||
|
||||
This function is mostly useful under Windows when libssh2 is linked to
|
||||
one run-time library and the application to another.
|
||||
.SH AVAILABILITY
|
||||
Added in libssh2 1.2.8
|
||||
.SH SEE ALSO
|
||||
.BR libssh2_session_init_ex(3)
|
@@ -1,14 +0,0 @@
|
||||
.\" $Id: libssh2_free_host_entry.3,v 1.1 2009/03/16 15:00:45 bagder Exp $
|
||||
.\"
|
||||
.TH libssh2_free_host_entry 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
|
||||
.SH NAME
|
||||
libssh2_free_host_entry - TODO
|
||||
.SH SYNOPSIS
|
||||
|
||||
.SH DESCRIPTION
|
||||
|
||||
.SH RETURN VALUE
|
||||
|
||||
.SH ERRORS
|
||||
|
||||
.SH SEE ALSO
|
@@ -1,14 +0,0 @@
|
||||
.\" $Id: libssh2_host_entry_match.3,v 1.1 2009/03/16 15:00:45 bagder Exp $
|
||||
.\"
|
||||
.TH libssh2_host_entry_match 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
|
||||
.SH NAME
|
||||
libssh2_host_entry_match - TODO
|
||||
.SH SYNOPSIS
|
||||
|
||||
.SH DESCRIPTION
|
||||
|
||||
.SH RETURN VALUE
|
||||
|
||||
.SH ERRORS
|
||||
|
||||
.SH SEE ALSO
|
27
docs/libssh2_keepalive_config.3
Normal file
27
docs/libssh2_keepalive_config.3
Normal file
@@ -0,0 +1,27 @@
|
||||
.TH libssh2_keepalive_config 3 "12 Apr 2011" "libssh2 1.2.5" "libssh2 manual"
|
||||
.SH NAME
|
||||
libssh2_keepalive_config - short function description
|
||||
.SH SYNOPSIS
|
||||
#include <libssh2.h>
|
||||
.nf
|
||||
|
||||
void libssh2_keepalive_config(LIBSSH2_SESSION *session,
|
||||
int want_reply,
|
||||
unsigned interval);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Set how often keepalive messages should be sent. \fBwant_reply\fP indicates
|
||||
whether the keepalive messages should request a response from the server.
|
||||
\fBinterval\fP is number of seconds that can pass without any I/O, use 0 (the
|
||||
default) to disable keepalives. To avoid some busy-loop corner-cases, if you
|
||||
specify an interval of 1 it will be treated as 2.
|
||||
|
||||
Note that non-blocking applications are responsible for sending the keepalive
|
||||
messages using \fBlibssh2_keepalive_send(3)\fP.
|
||||
.SH RETURN VALUE
|
||||
Nothing
|
||||
.SH AVAILABILITY
|
||||
Added in libssh2 1.2.5
|
||||
.SH SEE ALSO
|
||||
.BR libssh2_keepalive_send(3)
|
||||
|
20
docs/libssh2_keepalive_send.3
Normal file
20
docs/libssh2_keepalive_send.3
Normal file
@@ -0,0 +1,20 @@
|
||||
.\" $Id: keepalive_send.3,v 1.4 2007/06/13 16:41:33 jehousley Exp $
|
||||
.\"
|
||||
.TH libssh2_keepalive_send 3 "13 Apr 2011" "libssh2 1.2.5" "libssh2 manual"
|
||||
.SH NAME
|
||||
libssh2_keepalive_send - short function description
|
||||
.SH SYNOPSIS
|
||||
#include <libssh2.h>
|
||||
.nf
|
||||
|
||||
int libssh2_keepalive_send(LIBSSH2_SESSION *session,
|
||||
int *seconds_to_next);
|
||||
.SH DESCRIPTION
|
||||
Send a keepalive message if needed. \fBseconds_to_next\fP indicates how many
|
||||
seconds you can sleep after this call before you need to call it again.
|
||||
.SH RETURN VALUE
|
||||
Returns 0 on success, or LIBSSH2_ERROR_SOCKET_SEND on I/O errors.
|
||||
.SH AVAILABILITY
|
||||
Added in libssh2 1.2.5
|
||||
.SH SEE ALSO
|
||||
.BR libssh2_keepalive_config(3)
|
@@ -1,5 +1,5 @@
|
||||
.\"
|
||||
.\" Copyright (c) 2009 by Daniel Stenberg
|
||||
.\" Copyright (c) 2009-2011 by Daniel Stenberg
|
||||
.\"
|
||||
.TH libssh2_knownhost_readfile 3 "28 May 2009" "libssh2 1.2" "libssh2 manual"
|
||||
.SH NAME
|
||||
@@ -19,8 +19,8 @@ collection of known hosts.
|
||||
\fILIBSSH2_KNOWNHOST_FILE_OPENSSH\fP is the only currently supported
|
||||
format. This file is normally found named ~/.ssh/known_hosts
|
||||
.SH RETURN VALUE
|
||||
Returns a regular libssh2 error code, where negative values are error codes
|
||||
and 0 indicates success.
|
||||
Returns a negative value, a regular libssh2 error code for errors, or a
|
||||
positive number as number of parsed known hosts in the file.
|
||||
.SH AVAILABILITY
|
||||
Added in libssh2 1.2
|
||||
.SH SEE ALSO
|
||||
|
@@ -1,14 +0,0 @@
|
||||
.\" $Id: libssh2_new_host_entry.3,v 1.1 2009/03/16 15:00:45 bagder Exp $
|
||||
.\"
|
||||
.TH libssh2_new_host_entry 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
|
||||
.SH NAME
|
||||
libssh2_new_host_entry - TODO
|
||||
.SH SYNOPSIS
|
||||
|
||||
.SH DESCRIPTION
|
||||
|
||||
.SH RETURN VALUE
|
||||
|
||||
.SH ERRORS
|
||||
|
||||
.SH SEE ALSO
|
@@ -6,7 +6,10 @@ libssh2_publickey_add - convenience macro for \fIlibssh2_publickey_add_ex(3)\fP
|
||||
.SH SYNOPSIS
|
||||
#include <libssh2.h>
|
||||
|
||||
libssh2_publickey_add(arguments)
|
||||
int libssh2_publickey_add(LIBSSH2_PUBLICKEY *pkey,
|
||||
const unsigned char *name,
|
||||
const unsigned char *blob, unsigned long blob_len, char overwrite,
|
||||
unsigned long num_attrs, const libssh2_publickey_attribute attrs[]);
|
||||
|
||||
.SH DESCRIPTION
|
||||
This is a macro defined in a public libssh2 header file that is using the
|
||||
@@ -16,4 +19,4 @@ See \fIlibssh2_publickey_add_ex(3)\fP
|
||||
.SH ERRORS
|
||||
See \fIlibssh2_publickey_add_ex(3)\fP
|
||||
.SH SEE ALSO
|
||||
.BR \fIlibssh2_publickey_add_ex(3)\fP
|
||||
.BR libssh2_publickey_add_ex(3)
|
||||
|
@@ -2,13 +2,26 @@
|
||||
.\"
|
||||
.TH libssh2_publickey_add_ex 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
|
||||
.SH NAME
|
||||
libssh2_publickey_add_ex - TODO
|
||||
libssh2_publickey_add_ex - Add a public key entry
|
||||
.SH SYNOPSIS
|
||||
#include <libssh2.h>
|
||||
|
||||
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[])
|
||||
|
||||
.SH DESCRIPTION
|
||||
|
||||
TBD
|
||||
.SH RETURN VALUE
|
||||
|
||||
Returns 0 on success, negative on failure.
|
||||
.SH ERRORS
|
||||
|
||||
LIBSSH2_ERROR_BAD_USE
|
||||
LIBSSH2_ERROR_ALLOC,
|
||||
LIBSSH2_ERROR_EAGAIN
|
||||
LIBSSH2_ERROR_SOCKET_SEND,
|
||||
LIBSSH2_ERROR_SOCKET_TIMEOUT,
|
||||
LIBSSH2_ERROR_PUBLICKEY_PROTOCOL,
|
||||
.SH SEE ALSO
|
||||
|
@@ -6,7 +6,9 @@ libssh2_publickey_remove - convenience macro for \fIlibssh2_publickey_remove_ex(
|
||||
.SH SYNOPSIS
|
||||
#include <libssh2.h>
|
||||
|
||||
libssh2_publickey_remove(arguments)
|
||||
int libssh2_publickey_remove(LIBSSH2_PUBLICKEY *pkey,
|
||||
const unsigned char *name, unsigned long name_len,
|
||||
const unsigned char *blob, unsigned long blob_len);
|
||||
|
||||
.SH DESCRIPTION
|
||||
This is a macro defined in a public libssh2 header file that is using the
|
||||
@@ -16,4 +18,4 @@ See \fIlibssh2_publickey_remove_ex(3)\fP
|
||||
.SH ERRORS
|
||||
See \fIlibssh2_publickey_remove_ex(3)\fP
|
||||
.SH SEE ALSO
|
||||
.BR \fIlibssh2_publickey_remove_ex(3)\fP
|
||||
.BR libssh2_publickey_remove_ex(3)
|
||||
|
@@ -6,7 +6,8 @@ libssh2_scp_send - convenience macro for \fIlibssh2_scp_send_ex(3)\fP calls
|
||||
.SH SYNOPSIS
|
||||
#include <libssh2.h>
|
||||
|
||||
libssh2_scp_send(arguments)
|
||||
LIBSSH2_CHANNEL *
|
||||
libssh2_scp_send(LIBSSH2_SESSION *session, const char *path, int mode, size_t size);
|
||||
|
||||
.SH DESCRIPTION
|
||||
This is a macro defined in a public libssh2 header file that is using the
|
||||
@@ -16,4 +17,4 @@ See \fIlibssh2_scp_send_ex(3)\fP
|
||||
.SH ERRORS
|
||||
See \fIlibssh2_scp_send_ex(3)\fP
|
||||
.SH SEE ALSO
|
||||
.BR \fIlibssh2_scp_send_ex(3)\fP
|
||||
.BR libssh2_scp_send_ex(3)
|
||||
|
@@ -2,7 +2,7 @@
|
||||
.\"
|
||||
.TH libssh2_session_block_directions 3 "1 Oct 2008" "libssh2 1.0" "libssh2 manual"
|
||||
.SH NAME
|
||||
libssh2_session_block_directions - get directions that socket should wait for before calling libssh2 function again
|
||||
libssh2_session_block_directions - get directions to wait for
|
||||
.SH SYNOPSIS
|
||||
#include <libssh2.h>
|
||||
|
||||
@@ -26,6 +26,6 @@ LIBSSH2_SESSION_BLOCK_OUTBOUND: Outbound direction blocked.
|
||||
Application should wait for data to be available for socket prior to calling a
|
||||
libssh2 function again. If \fBLIBSSH2_SESSION_BLOCK_INBOUND\fP is set select
|
||||
should contain the session socket in readfds set. Correspondingly in case of
|
||||
\fBLIBSSH2_SESSION_BLOCK_INBOUND\fP writefds set should contain the socket.
|
||||
\fBLIBSSH2_SESSION_BLOCK_OUTBOUND\fP writefds set should contain the socket.
|
||||
.SH AVAILABILITY
|
||||
Added in 1.0
|
||||
|
@@ -29,9 +29,16 @@ Called when a SSH_MSG_DEBUG message is received
|
||||
.IP LIBSSH2_CALLBACK_DISCONNECT
|
||||
Called when a SSH_MSG_DISCONNECT message is received
|
||||
.IP LIBSSH2_CALLBACK_MACERROR
|
||||
Called when a mismatched MAC has been detected in the transport layer
|
||||
Called when a mismatched MAC has been detected in the transport layer. If the
|
||||
function returns 0, the packet will be accepted nonetheless.
|
||||
.IP LIBSSH2_CALLBACK_X11
|
||||
Called when an X11 connection has been accepted
|
||||
.IP LIBSSH2_CALLBACK_SEND
|
||||
Called when libssh2 wants to send some data on the connection.
|
||||
Can be set to a custom function to handle I/O your own way.
|
||||
.IP LIBSSH2_CALLBACK_RECV
|
||||
Called when libssh2 wants to receive some data from the connection.
|
||||
Can be set to a custom function to handle I/O your own way.
|
||||
.SH RETURN VALUE
|
||||
Pointer to previous callback handler. Returns NULL if no prior callback
|
||||
handler was set or the callback type was unknown.
|
||||
|
@@ -6,7 +6,7 @@ libssh2_session_disconnect - convenience macro for \fIlibssh2_session_disconnect
|
||||
.SH SYNOPSIS
|
||||
#include <libssh2.h>
|
||||
|
||||
libssh2_session_disconnect(arguments)
|
||||
int libssh2_session_disconnect(LIBSSH2_SESSION *session, const char *description);
|
||||
|
||||
.SH DESCRIPTION
|
||||
This is a macro defined in a public libssh2 header file that is using the
|
||||
@@ -16,4 +16,4 @@ See \fIlibssh2_session_disconnect_ex(3)\fP
|
||||
.SH ERRORS
|
||||
See \fIlibssh2_session_disconnect_ex(3)\fP
|
||||
.SH SEE ALSO
|
||||
.BR \fIlibssh2_session_disconnect_ex(3)\fP
|
||||
.BR libssh2_session_disconnect_ex(3)
|
||||
|
@@ -5,11 +5,21 @@
|
||||
libssh2_session_flag - TODO
|
||||
.SH SYNOPSIS
|
||||
int
|
||||
libssh2_session_flag(LIBSSH2_SESSION * session, int flag, int value);
|
||||
libssh2_session_flag(LIBSSH2_SESSION *session, int flag, int value);
|
||||
.SH DESCRIPTION
|
||||
This function has no purpose and no documented flags can be set nor read.
|
||||
Set options for the created session. \fIflag\fP is the option to set, while
|
||||
\fIvalue\fP is typically set to 1 or 0 to enable or disable the option.
|
||||
.SH FLAGS
|
||||
.IP LIBSSH2_FLAG_SIGPIPE
|
||||
If set, libssh2 will not attempt to block SIGPIPEs but will let them trigger
|
||||
from the underlying socket layer.
|
||||
.IP LIBSSH2_FLAG_COMPRESS
|
||||
If set - before the connection negotiation is performed - libssh2 will try to
|
||||
negotiate compression enabling for this connection. By default libssh2 will
|
||||
not attempt to use compression.
|
||||
.SH RETURN VALUE
|
||||
0
|
||||
.SH ERRORS
|
||||
Its mere existence is an error
|
||||
Returns regular libssh2 error code.
|
||||
.SH AVAILABILITY
|
||||
This function has existed since the age of dawn. LIBSSH2_FLAG_COMPRESS was
|
||||
added in version 1.2.8.
|
||||
.SH SEE ALSO
|
||||
|
19
docs/libssh2_session_get_timeout.3
Normal file
19
docs/libssh2_session_get_timeout.3
Normal file
@@ -0,0 +1,19 @@
|
||||
.TH libssh2_session_get_timeout 3 "4 May 2011" "libssh2 1.2.9" "libssh2 manual"
|
||||
.SH NAME
|
||||
libssh2_session_get_timeout - get the timeout for blocking functions
|
||||
.SH SYNOPSIS
|
||||
#include <libssh2.h>
|
||||
.nf
|
||||
long libssh2_session_get_timeout(LIBSSH2_SESSION *session);
|
||||
.SH DESCRIPTION
|
||||
Returns the \fBtimeout\fP (in milliseconds) for how long a blocking the
|
||||
libssh2 function calls may wait until they consider the situation an error and
|
||||
return LIBSSH2_ERROR_TIMEOUT.
|
||||
|
||||
By default libssh2 has no timeout (zero) for blocking functions.
|
||||
.SH RETURN VALUE
|
||||
The value of the timeout setting.
|
||||
.SH AVAILABILITY
|
||||
Added in 1.2.9
|
||||
.SH SEE ALSO
|
||||
.BR libssh2_session_set_timeout(3)
|
42
docs/libssh2_session_handshake.3
Normal file
42
docs/libssh2_session_handshake.3
Normal file
@@ -0,0 +1,42 @@
|
||||
.\" $Id: libssh2_session_handshake.3,v 1.7 2009/03/16 23:25:14 bagder Exp $
|
||||
.\"
|
||||
.TH libssh2_session_handshake 3 "7 Oct 2010" "libssh2 1.2.8" "libssh2 manual"
|
||||
.SH NAME
|
||||
libssh2_session_handshake - perform the SSH handshake
|
||||
.SH SYNOPSIS
|
||||
#include <libssh2.h>
|
||||
|
||||
int
|
||||
libssh2_session_handshake(LIBSSH2_SESSION *session, libssh2_socket_t socket);
|
||||
.SH DESCRIPTION
|
||||
\fIsession\fP - Session instance as returned by
|
||||
.BR libssh2_session_init_ex(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 AVAILABILITY
|
||||
Added in 1.2.8
|
||||
.SH SEE ALSO
|
||||
.BR libssh2_session_free(3)
|
||||
.BR libssh2_session_init_ex(3)
|
@@ -6,7 +6,8 @@ libssh2_session_init - convenience macro for \fIlibssh2_session_init_ex(3)\fP ca
|
||||
.SH SYNOPSIS
|
||||
#include <libssh2.h>
|
||||
|
||||
libssh2_session_init(arguments)
|
||||
LIBSSH2_SESSION *
|
||||
libssh2_session_init(void);
|
||||
|
||||
.SH DESCRIPTION
|
||||
This is a macro defined in a public libssh2 header file that is using the
|
||||
@@ -16,4 +17,4 @@ See \fIlibssh2_session_init_ex(3)\fP
|
||||
.SH ERRORS
|
||||
See \fIlibssh2_session_init_ex(3)\fP
|
||||
.SH SEE ALSO
|
||||
.BR \fIlibssh2_session_init_ex(3)\fP
|
||||
.BR libssh2_session_init_ex(3)
|
||||
|
@@ -13,17 +13,17 @@ libssh2_session_methods(LIBSSH2_SESSION *session, int method_type);
|
||||
\fIsession\fP - Session instance as returned by
|
||||
.BR libssh2_session_init_ex(3)
|
||||
|
||||
\fImethod_type\fP - One of the Method Type constants.
|
||||
|
||||
Return the actual method negotiated for a particular transport parameter.
|
||||
\fImethod_type\fP - one of the method type constants: LIBSSH2_METHOD_KEX,
|
||||
LIBSSH2_METHOD_HOSTKEY, LIBSSH2_METHOD_CRYPT_CS, LIBSSH2_METHOD_CRYPT_SC,
|
||||
LIBSSH2_METHOD_MAC_CS, LIBSSH2_METHOD_MAC_SC, LIBSSH2_METHOD_COMP_CS,
|
||||
LIBSSH2_METHOD_COMP_SC, LIBSSH2_METHOD_LANG_CS, LIBSSH2_METHOD_LANG_SC.
|
||||
|
||||
Returns 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 -
|
||||
|
||||
\fILIBSSH2_ERROR_METHOD_NONE\fP - no method has been set
|
||||
.SH SEE ALSO
|
||||
.BR libssh2_session_init_ex(3)
|
||||
|
20
docs/libssh2_session_set_timeout.3
Normal file
20
docs/libssh2_session_set_timeout.3
Normal file
@@ -0,0 +1,20 @@
|
||||
.TH libssh2_session_set_timeout 3 "4 May 2011" "libssh2 1.2.9" "libssh2 manual"
|
||||
.SH NAME
|
||||
libssh2_session_set_timeout - set timeout for blocking functions
|
||||
.SH SYNOPSIS
|
||||
#include <libssh2.h>
|
||||
.nf
|
||||
void libssh2_session_set_timeout(LIBSSH2_SESSION *session, long timeout);
|
||||
.SH DESCRIPTION
|
||||
Set the \fBtimeout\fP in milliseconds for how long a blocking the libssh2
|
||||
function calls may wait until they consider the situation an error and return
|
||||
LIBSSH2_ERROR_TIMEOUT.
|
||||
|
||||
By default or if you set the timeout to zero, libssh2 has no timeout for
|
||||
blocking functions.
|
||||
.SH RETURN VALUE
|
||||
Nothing
|
||||
.SH AVAILABILITY
|
||||
Added in 1.2.9
|
||||
.SH SEE ALSO
|
||||
.BR libssh2_session_get_timeout(3)
|
@@ -8,8 +8,10 @@ libssh2_session_startup - begin transport layer
|
||||
|
||||
int
|
||||
libssh2_session_startup(LIBSSH2_SESSION *session, int socket);
|
||||
|
||||
.SH DESCRIPTION
|
||||
Starting in libssh2 version 1.2.8 this function is considered deprecated. Use
|
||||
\fIlibssh2_session_handshake(3)\fP instead.
|
||||
|
||||
\fIsession\fP - Session instance as returned by
|
||||
.BR libssh2_session_init_ex(3)
|
||||
|
||||
|
@@ -6,7 +6,7 @@ libssh2_sftp_close - convenience macro for \fIlibssh2_sftp_close_handle(3)\fP ca
|
||||
.SH SYNOPSIS
|
||||
#include <libssh2.h>
|
||||
|
||||
libssh2_sftp_close(arguments)
|
||||
int libssh2_sftp_close(LIBSSH2_SFTP_HANDLE *handle);
|
||||
|
||||
.SH DESCRIPTION
|
||||
This is a macro defined in a public libssh2 header file that is using the
|
||||
@@ -16,4 +16,4 @@ See \fIlibssh2_sftp_close_handle(3)\fP
|
||||
.SH ERRORS
|
||||
See \fIlibssh2_sftp_close_handle(3)\fP
|
||||
.SH SEE ALSO
|
||||
.BR \fIlibssh2_sftp_close_handle(3)\fP
|
||||
.BR libssh2_sftp_close_handle(3)
|
||||
|
@@ -6,7 +6,7 @@ libssh2_sftp_closedir - convenience macro for \fIlibssh2_sftp_close_handle(3)\fP
|
||||
.SH SYNOPSIS
|
||||
#include <libssh2.h>
|
||||
|
||||
libssh2_sftp_closedir(arguments)
|
||||
int libssh2_sftp_closedir(LIBSSH2_SFTP_HANDLE *handle)
|
||||
|
||||
.SH DESCRIPTION
|
||||
This is a macro defined in a public libssh2 header file that is using the
|
||||
@@ -16,4 +16,4 @@ See \fIlibssh2_sftp_close_handle(3)\fP
|
||||
.SH ERRORS
|
||||
See \fIlibssh2_sftp_close_handle(3)\fP
|
||||
.SH SEE ALSO
|
||||
.BR \fIlibssh2_sftp_close_handle(3)\fP
|
||||
.BR libssh2_sftp_close_handle(3)
|
||||
|
@@ -6,7 +6,7 @@ libssh2_sftp_fsetstat - convenience macro for \fIlibssh2_sftp_fstat_ex(3)\fP cal
|
||||
.SH SYNOPSIS
|
||||
#include <libssh2.h>
|
||||
|
||||
libssh2_sftp_fsetstat(arguments)
|
||||
int libssh2_sftp_fsetstat(LIBSSH2_SFTP_HANDLE *handle, LIBSSH2_SFTP_ATTRIBUTES *attrs);
|
||||
|
||||
.SH DESCRIPTION
|
||||
This is a macro defined in a public libssh2 header file that is using the
|
||||
@@ -16,4 +16,4 @@ See \fIlibssh2_sftp_fstat_ex(3)\fP
|
||||
.SH ERRORS
|
||||
See \fIlibssh2_sftp_fstat_ex(3)\fP
|
||||
.SH SEE ALSO
|
||||
.BR \fIlibssh2_sftp_fstat_ex(3)\fP
|
||||
.BR libssh2_sftp_fstat_ex(3)
|
||||
|
@@ -6,7 +6,7 @@ libssh2_sftp_fstat - convenience macro for \fIlibssh2_sftp_fstat_ex(3)\fP calls
|
||||
.SH SYNOPSIS
|
||||
#include <libssh2.h>
|
||||
|
||||
libssh2_sftp_fstat(arguments)
|
||||
int libssh2_sftp_fstat(LIBSSH2_SFTP_HANDLE *handle, LIBSSH2_SFTP_ATTRIBUTES *attrs);
|
||||
|
||||
.SH DESCRIPTION
|
||||
This is a macro defined in a public libssh2 header file that is using the
|
||||
@@ -16,4 +16,4 @@ See \fIlibssh2_sftp_fstat_ex(3)\fP
|
||||
.SH ERRORS
|
||||
See \fIlibssh2_sftp_fstat_ex(3)\fP
|
||||
.SH SEE ALSO
|
||||
.BR \fIlibssh2_sftp_fstat_ex(3)\fP
|
||||
.BR libssh2_sftp_fstat_ex(3)
|
||||
|
@@ -6,7 +6,7 @@ libssh2_sftp_lstat - convenience macro for \fIlibssh2_sftp_stat_ex(3)\fP calls
|
||||
.SH SYNOPSIS
|
||||
#include <libssh2.h>
|
||||
|
||||
libssh2_sftp_lstat(arguments)
|
||||
int libssh2_sftp_lstat(LIBSSH2_SFTP *sftp, const char *path, LIBSSH2_SFTP_ATTRIBUTES *attrs);
|
||||
|
||||
.SH DESCRIPTION
|
||||
This is a macro defined in a public libssh2 header file that is using the
|
||||
@@ -16,4 +16,4 @@ See \fIlibssh2_sftp_stat_ex(3)\fP
|
||||
.SH ERRORS
|
||||
See \fIlibssh2_sftp_stat_ex(3)\fP
|
||||
.SH SEE ALSO
|
||||
.BR \fIlibssh2_sftp_stat_ex(3)\fP
|
||||
.BR libssh2_sftp_stat_ex(3)
|
||||
|
@@ -6,7 +6,7 @@ libssh2_sftp_mkdir - convenience macro for \fIlibssh2_sftp_mkdir_ex(3)\fP calls
|
||||
.SH SYNOPSIS
|
||||
#include <libssh2.h>
|
||||
|
||||
libssh2_sftp_mkdir(arguments)
|
||||
int libssh2_sftp_mkdir(LIBSSH2_SFTP *sftp, const char *path, long mode);
|
||||
|
||||
.SH DESCRIPTION
|
||||
This is a macro defined in a public libssh2 header file that is using the
|
||||
@@ -16,4 +16,4 @@ See \fIlibssh2_sftp_mkdir_ex(3)\fP
|
||||
.SH ERRORS
|
||||
See \fIlibssh2_sftp_mkdir_ex(3)\fP
|
||||
.SH SEE ALSO
|
||||
.BR \fIlibssh2_sftp_mkdir_ex(3)\fP
|
||||
.BR libssh2_sftp_mkdir_ex(3)
|
||||
|
@@ -6,7 +6,8 @@ libssh2_sftp_open - convenience macro for \fIlibssh2_sftp_open_ex(3)\fP calls
|
||||
.SH SYNOPSIS
|
||||
#include <libssh2.h>
|
||||
|
||||
libssh2_sftp_open(arguments)
|
||||
LIBSSH2_SFTP_HANDLE *
|
||||
libssh2_sftp_open(LIBSSH2_SFTP *sftp, const char *path, unsigned long flags, long mode);
|
||||
|
||||
.SH DESCRIPTION
|
||||
This is a macro defined in a public libssh2 header file that is using the
|
||||
@@ -16,4 +17,4 @@ See \fIlibssh2_sftp_open_ex(3)\fP
|
||||
.SH ERRORS
|
||||
See \fIlibssh2_sftp_open_ex(3)\fP
|
||||
.SH SEE ALSO
|
||||
.BR \fIlibssh2_sftp_open_ex(3)\fP
|
||||
.BR libssh2_sftp_open_ex(3)
|
||||
|
@@ -4,31 +4,45 @@
|
||||
.SH NAME
|
||||
libssh2_sftp_open - open filehandle for file on SFTP.
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#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);
|
||||
|
||||
libssh2_sftp_open_ex(LIBSSH2_SFTP *sftp, const char *filename,
|
||||
unsigned int filename_len, unsigned long flags,
|
||||
long mode, int open_type);
|
||||
.SH DESCRIPTION
|
||||
\fIsftp\fP - SFTP instance as returned by
|
||||
.BR libssh2_sftp_init(3)
|
||||
\fIsftp\fP - SFTP instance as returned by \fIlibssh2_sftp_init(3)\fP
|
||||
|
||||
\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.
|
||||
\fIflags\fP - Any reasonable combination of the LIBSSH2_FXF_* constants:
|
||||
.RS
|
||||
.IP LIBSSH2_FXF_READ
|
||||
Open the file for reading.
|
||||
.IP LIBSSH2_FXF_WRITE
|
||||
Open the file for writing. If both this and LIBSSH2_FXF_READ are specified,
|
||||
the file is opened for both reading and writing.
|
||||
.IP LIBSSH2_FXF_APPEND
|
||||
Force all writes to append data at the end of the file.
|
||||
.IP LIBSSH2_FXF_CREAT,
|
||||
If this flag is specified, then a new file will be created if one does not
|
||||
already exist (if LIBSSH2_FXF_TRUNC is specified, the new file will be
|
||||
truncated to zero length if it previously exists)
|
||||
.IP LIBSSH2_FXF_TRUNC
|
||||
Forces an existing file with the same name to be truncated to zero length when
|
||||
creating a file by specifying LIBSSH2_FXF_CREAT. LIBSSH2_FXF_CREAT MUST also
|
||||
be specified if this flag is used.
|
||||
.IP LIBSSH2_FXF_EXCL
|
||||
Causes the request to fail if the named file already exists.
|
||||
LIBSSH2_FXF_CREAT MUST also be specified if this flag is used.
|
||||
|
||||
.RE
|
||||
\fImode\fP - POSIX file permissions to assign if the file is being newly
|
||||
created.
|
||||
created. See the LIBSSH2_SFTP_S_* convenience defines in <libssh2_sftp.h>
|
||||
|
||||
\fIopen_type\fP - Either of LIBSSH2_SFTP_OPENFILE (to open a file) or
|
||||
LIBSSH2_SFTP_OPENDIR (to open a directory).
|
||||
|
@@ -6,7 +6,8 @@ libssh2_sftp_opendir - convenience macro for \fIlibssh2_sftp_open_ex(3)\fP calls
|
||||
.SH SYNOPSIS
|
||||
#include <libssh2.h>
|
||||
|
||||
libssh2_sftp_opendir(arguments)
|
||||
LIBSSH2_SFTP_HANDLE *
|
||||
libssh2_sftp_opendir(LIBSSH2_SFTP *sftp, const char *path);
|
||||
|
||||
.SH DESCRIPTION
|
||||
This is a macro defined in a public libssh2 header file that is using the
|
||||
@@ -16,4 +17,4 @@ See \fIlibssh2_sftp_open_ex(3)\fP
|
||||
.SH ERRORS
|
||||
See \fIlibssh2_sftp_open_ex(3)\fP
|
||||
.SH SEE ALSO
|
||||
.BR \fIlibssh2_sftp_open_ex(3)\fP
|
||||
.BR libssh2_sftp_open_ex(3)
|
||||
|
@@ -6,7 +6,7 @@ libssh2_sftp_readdir - convenience macro for \fIlibssh2_sftp_readdir_ex(3)\fP ca
|
||||
.SH SYNOPSIS
|
||||
#include <libssh2.h>
|
||||
|
||||
libssh2_sftp_readdir(arguments)
|
||||
int libssh2_sftp_readdir(LIBSSH2_SFTP_HANDLE *handle, char *buffer, size_t buffer_maxlen, LIBSSH2_SFTP_ATTRIBUTES *attrs);
|
||||
|
||||
.SH DESCRIPTION
|
||||
This is a macro defined in a public libssh2 header file that is using the
|
||||
@@ -16,4 +16,4 @@ See \fIlibssh2_sftp_readdir_ex(3)\fP
|
||||
.SH ERRORS
|
||||
See \fIlibssh2_sftp_readdir_ex(3)\fP
|
||||
.SH SEE ALSO
|
||||
.BR \fIlibssh2_sftp_readdir_ex(3)\fP
|
||||
.BR libssh2_sftp_readdir_ex(3)
|
||||
|
@@ -13,9 +13,6 @@ 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(h, b, bl, a) \\
|
||||
libssh2_sftp_readdir_ex((h), (b), (bl), NULL, 0, (a))
|
||||
.SH DESCRIPTION
|
||||
Reads a block of data from a LIBSSH2_SFTP_HANDLE and returns file entry
|
||||
information for the next entry, if any.
|
||||
@@ -47,6 +44,10 @@ Number of bytes actually populated into buffer (not counting the terminating
|
||||
zero), 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 BUG
|
||||
Passing in a too small buffer for 'buffer' or 'longentry' when receiving data
|
||||
only results in libssh2 1.2.7 or earlier to not copy the entire data amount,
|
||||
and it is not possible for the application to tell when it happens!
|
||||
.SH ERRORS
|
||||
\fILIBSSH2_ERROR_ALLOC\fP - An internal memory allocation call failed.
|
||||
|
||||
@@ -57,6 +58,10 @@ really a failure per se.
|
||||
\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.
|
||||
|
||||
From 1.2.8, LIBSSH2_ERROR_BUFFER_TOO_SMALL is returned if any of the
|
||||
given 'buffer' or 'longentry' buffers are too small to fit the requested
|
||||
object name.
|
||||
.SH SEE ALSO
|
||||
.BR libssh2_sftp_open_ex(3),
|
||||
.BR libssh2_sftp_close_handle(3)
|
||||
|
@@ -18,4 +18,4 @@ See \fIlibssh2_sftp_symlink_ex(3)\fP
|
||||
.SH ERRORS
|
||||
See \fIlibssh2_sftp_symlink_ex(3)\fP
|
||||
.SH SEE ALSO
|
||||
.BR \fIlibssh2_sftp_symlink_ex(3)\fP
|
||||
.BR libssh2_sftp_symlink_ex(3)
|
||||
|
@@ -18,4 +18,4 @@ See \fIlibssh2_sftp_symlink_ex(3)\fP
|
||||
.SH ERRORS
|
||||
See \fIlibssh2_sftp_symlink_ex(3)\fP
|
||||
.SH SEE ALSO
|
||||
.BR \fIlibssh2_sftp_symlink_ex(3)\fP
|
||||
.BR libssh2_sftp_symlink_ex(3)
|
||||
|
@@ -6,7 +6,7 @@ libssh2_sftp_rename - convenience macro for \fIlibssh2_sftp_rename_ex(3)\fP call
|
||||
.SH SYNOPSIS
|
||||
#include <libssh2.h>
|
||||
|
||||
libssh2_sftp_rename(arguments)
|
||||
int libssh2_sftp_rename(LIBSSH2_SFTP *sftp, const char *source_filename, const char *destination_filename);
|
||||
|
||||
.SH DESCRIPTION
|
||||
This is a macro defined in a public libssh2 header file that is using the
|
||||
@@ -16,4 +16,4 @@ See \fIlibssh2_sftp_rename_ex(3)\fP
|
||||
.SH ERRORS
|
||||
See \fIlibssh2_sftp_rename_ex(3)\fP
|
||||
.SH SEE ALSO
|
||||
.BR \fIlibssh2_sftp_rename_ex(3)\fP
|
||||
.BR libssh2_sftp_rename_ex(3)
|
||||
|
@@ -6,7 +6,7 @@ libssh2_sftp_rewind - convenience macro for \fIlibssh2_sftp_seek64(3)\fP calls
|
||||
.SH SYNOPSIS
|
||||
#include <libssh2.h>
|
||||
|
||||
libssh2_sftp_rewind(arguments)
|
||||
int libssh2_sftp_rewind(LINBSSH2_SFTP_HANDLE *handle);
|
||||
|
||||
.SH DESCRIPTION
|
||||
This is a macro defined in a public libssh2 header file that is using the
|
||||
@@ -16,4 +16,4 @@ See \fIlibssh2_sftp_seek64(3)\fP
|
||||
.SH ERRORS
|
||||
See \fIlibssh2_sftp_seek64(3)\fP
|
||||
.SH SEE ALSO
|
||||
.BR \fIlibssh2_sftp_seek64(3)\fP
|
||||
.BR libssh2_sftp_seek64(3)
|
||||
|
@@ -17,4 +17,4 @@ See \fIlibssh2_sftp_rmdir_ex(3)\fP
|
||||
.SH ERRORS
|
||||
See \fIlibssh2_sftp_rmdir_ex(3)\fP
|
||||
.SH SEE ALSO
|
||||
.BR \fIlibssh2_sftp_rmdir_ex(3)\fP
|
||||
.BR libssh2_sftp_rmdir_ex(3)
|
||||
|
@@ -4,16 +4,14 @@
|
||||
.SH NAME
|
||||
libssh2_sftp_seek - set the read/write position indicator within a file
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <libssh2.h>
|
||||
#include <libssh2_sftp.h>
|
||||
|
||||
void
|
||||
libssh2_sftp_seek(LIBSSH2_SFTP_HANDLE *handle, size_t offset);
|
||||
|
||||
void
|
||||
libssh2_sftp_seek64(LIBSSH2_SFTP_HANDLE *handle, libssh2_uint64_t offset);
|
||||
|
||||
void libssh2_sftp_seek(LIBSSH2_SFTP_HANDLE *handle, size_t offset);
|
||||
.SH DESCRIPTION
|
||||
Deprecated function. Use \fIlibssh2_sftp_seek64(3)\fP instead!
|
||||
|
||||
\fIhandle\fP - SFTP File Handle as returned by
|
||||
.BR libssh2_sftp_open_ex(3)
|
||||
|
||||
@@ -24,7 +22,6 @@ 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 AVAILABILITY
|
||||
libssh2_sftp_seek64(3) was added in 1.0
|
||||
.SH SEE ALSO
|
||||
.BR libssh2_sftp_open_ex(3)
|
||||
.BR libssh2_sftp_open_ex(3),
|
||||
.BR libssh2_sftp_seek64(3)
|
||||
|
31
docs/libssh2_sftp_seek64.3
Normal file
31
docs/libssh2_sftp_seek64.3
Normal file
@@ -0,0 +1,31 @@
|
||||
.\" $Id: libssh2_sftp_seek.3,v 1.5 2009/03/17 10:34:27 bagder Exp $
|
||||
.\"
|
||||
.TH libssh2_sftp_seek64 3 "22 Dec 2008" "libssh2 1.0" "libssh2 manual"
|
||||
.SH NAME
|
||||
libssh2_sftp_seek64 - set the read/write position within a file
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <libssh2.h>
|
||||
#include <libssh2_sftp.h>
|
||||
|
||||
void libssh2_sftp_seek64(LIBSSH2_SFTP_HANDLE *handle,
|
||||
libssh2_uint64_t offset);
|
||||
.SH DESCRIPTION
|
||||
\fIhandle\fP - SFTP File Handle as returned by
|
||||
.BR libssh2_sftp_open_ex(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. 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.
|
||||
|
||||
You MUST NOT seek during writing or reading a file with SFTP, as the internals
|
||||
use outstanding packets and changing the "file position" during transit will
|
||||
results in badness.
|
||||
.SH AVAILABILITY
|
||||
Added in 1.0
|
||||
.SH SEE ALSO
|
||||
.BR libssh2_sftp_open_ex(3)
|
@@ -6,7 +6,7 @@ libssh2_sftp_setstat - convenience macro for \fIlibssh2_sftp_stat_ex(3)\fP calls
|
||||
.SH SYNOPSIS
|
||||
#include <libssh2.h>
|
||||
|
||||
libssh2_sftp_setstat(arguments)
|
||||
int libssh2_sftp_setstat(LIBSSH2_SFTP *sftp, const char *path, LIBSSH2_SFTP_ATTRIBUTES *attr);
|
||||
|
||||
.SH DESCRIPTION
|
||||
This is a macro defined in a public libssh2 header file that is using the
|
||||
@@ -16,4 +16,4 @@ See \fIlibssh2_sftp_stat_ex(3)\fP
|
||||
.SH ERRORS
|
||||
See \fIlibssh2_sftp_stat_ex(3)\fP
|
||||
.SH SEE ALSO
|
||||
.BR \fIlibssh2_sftp_stat_ex(3)\fP
|
||||
.BR libssh2_sftp_stat_ex(3)
|
||||
|
@@ -6,7 +6,7 @@ libssh2_sftp_stat - convenience macro for \fIlibssh2_sftp_fstat_ex(3)\fP calls
|
||||
.SH SYNOPSIS
|
||||
#include <libssh2.h>
|
||||
|
||||
libssh2_sftp_stat(arguments)
|
||||
int libssh2_sftp_stat(LIBSSH2_SFTP *sftp, const char *path, LIBSSH2_STFP_ATTRIBUTES *attrs);
|
||||
|
||||
.SH DESCRIPTION
|
||||
This is a macro defined in a public libssh2 header file that is using the
|
||||
@@ -16,4 +16,4 @@ See \fIlibssh2_sftp_fstat_ex(3)\fP
|
||||
.SH ERRORS
|
||||
See \fIlibssh2_sftp_fstat_ex(3)\fP
|
||||
.SH SEE ALSO
|
||||
.BR \fIlibssh2_sftp_fstat_ex(3)\fP
|
||||
.BR libssh2_sftp_fstat_ex(3)
|
||||
|
@@ -4,21 +4,13 @@
|
||||
.SH NAME
|
||||
libssh2_sftp_stat_ex - get status about an SFTP file
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#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);
|
||||
|
||||
int libssh2_sftp_stat_ex(LIBSSH2_SFTP *sftp, const char *path,
|
||||
unsigned int path_len, int stat_type,
|
||||
LIBSSH2_SFTP_ATTRIBUTES *attrs);
|
||||
.SH DESCRIPTION
|
||||
\fIsftp\fP - SFTP instance as returned by
|
||||
.BR libssh2_sftp_init(3)
|
||||
@@ -29,24 +21,47 @@ libssh2_sftp_setstat(LIBSSH2_SFTP *sftp, const char *path, LIBSSH2_SFTP_ATTRIBUT
|
||||
to stat/lstat/setstat.
|
||||
|
||||
\fIstat_type\fP - One of the three constants specifying the type of
|
||||
stat operation to perform.
|
||||
stat operation to perform:
|
||||
|
||||
\fIattrs\fP - Pointer to attribute structure to set file metadata
|
||||
from or into depending on the value of stat_type.
|
||||
.br
|
||||
\fBLIBSSH2_SFTP_STAT\fP: performs stat(2) operation
|
||||
.br
|
||||
\fBLIBSSH2_SFTP_LSTAT\fP: performs lstat(2) operation
|
||||
.br
|
||||
\fBLIBSSH2_SFTP_SETSTAT\fP: performs operation to set stat info on file
|
||||
|
||||
Get or Set statbuf type data on a remote filesystem object. When
|
||||
getting statbuf data,
|
||||
\fIattrs\fP - Pointer to a \fBLIBSSH2_SFTP_ATTRIBUTES\fP 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.
|
||||
The LIBSSH2_SFTP_ATTRIBUTES struct looks like this:
|
||||
|
||||
.nf
|
||||
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;
|
||||
unsigned long gid;
|
||||
unsigned long permissions;
|
||||
unsigned long atime;
|
||||
unsigned long mtime;
|
||||
};
|
||||
.fi
|
||||
.SH RETURN VALUE
|
||||
Returns 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.
|
||||
|
||||
@@ -57,6 +72,5 @@ LIBSSH2_ERROR_EAGAIN is a negative number, it isn't really a failure per se.
|
||||
\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)
|
||||
|
@@ -18,4 +18,4 @@ See \fIlibssh2_sftp_symlink_ex(3)\fP
|
||||
.SH ERRORS
|
||||
See \fIlibssh2_sftp_symlink_ex(3)\fP
|
||||
.SH SEE ALSO
|
||||
.BR \fIlibssh2_sftp_symlink_ex(3)\fP
|
||||
.BR libssh2_sftp_symlink_ex(3)
|
||||
|
@@ -12,9 +12,6 @@ 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_realpath(LIBSSH2_SFTP *sftp, const char *path, char *target,
|
||||
unsigned int target_len);
|
||||
.SH DESCRIPTION
|
||||
Create a symlink or read out symlink information from the remote side.
|
||||
|
||||
@@ -62,6 +59,13 @@ zero) 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.
|
||||
|
||||
From 1.2.8, LIBSSH2_ERROR_BUFFER_TOO_SMALL is returned if the given 'target'
|
||||
buffer is too small to fit the requested object name.
|
||||
.SH BUG
|
||||
Passing in a too small buffer when receiving data only results in libssh2
|
||||
1.2.7 or earlier to not copy the entire data amount, and it is not possible
|
||||
for the application to tell when it happens!
|
||||
.SH ERRORS
|
||||
\fILIBSSH2_ERROR_ALLOC\fP - An internal memory allocation call failed.
|
||||
|
||||
|
@@ -6,7 +6,7 @@ libssh2_sftp_unlink - convenience macro for \fIlibssh2_sftp_unlink_ex(3)\fP call
|
||||
.SH SYNOPSIS
|
||||
#include <libssh2.h>
|
||||
|
||||
libssh2_sftp_unlink(arguments)
|
||||
int libssh2_sftp_unlink(LIBSSH2_SFTP *sftp, const char *filename);
|
||||
|
||||
.SH DESCRIPTION
|
||||
This is a macro defined in a public libssh2 header file that is using the
|
||||
@@ -16,4 +16,4 @@ See \fIlibssh2_sftp_unlink_ex(3)\fP
|
||||
.SH ERRORS
|
||||
See \fIlibssh2_sftp_unlink_ex(3)\fP
|
||||
.SH SEE ALSO
|
||||
.BR \fIlibssh2_sftp_unlink_ex(3)\fP
|
||||
.BR libssh2_sftp_unlink_ex(3)
|
||||
|
@@ -27,6 +27,28 @@ possible to write all bytes as requested.
|
||||
put it into a single SFTP protocol packet. This means that to get maximum
|
||||
performance when sending larger files, you should try to always pass in at
|
||||
least 32K of data to this function.
|
||||
|
||||
.SH WRITE AHEAD
|
||||
Starting in libssh2 version 1.2.8, the default behavior of libssh2 is to
|
||||
create several smaller outgoing packets for all data you pass to this function
|
||||
and it will return a positive number as soon as the first packet is
|
||||
acknowledged from the server.
|
||||
|
||||
This has the effect that sometimes more data has been sent off but isn't acked
|
||||
yet when this function returns, and when this function is subsequently called
|
||||
again to write more data, libssh2 will immediately figure out that the data is
|
||||
already received remotely.
|
||||
|
||||
In most normal situation this should not cause any problems, but it should be
|
||||
noted that if you've once called libssh2_sftp_write() with data and it returns
|
||||
short, you MUST still assume that the rest of the data might've been cached so
|
||||
you need to make sure you don't alter that data and think that the version you
|
||||
have in your next function invoke will be detected or used.
|
||||
|
||||
The reason for this funny behavior is that SFTP can only send 32K data in each
|
||||
packet and it gets all packets acked individually. This means we cannot use a
|
||||
simple serial approach if we want to reach high performance even on high
|
||||
latency connections. And we want that.
|
||||
.SH RETURN VALUE
|
||||
Actual number of bytes written or negative on failure.
|
||||
|
||||
|
@@ -6,7 +6,7 @@ libssh2_userauth_hostbased_fromfile - convenience macro for \fIlibssh2_userauth_
|
||||
.SH SYNOPSIS
|
||||
#include <libssh2.h>
|
||||
|
||||
libssh2_userauth_hostbased_fromfile(arguments)
|
||||
int libssh2_userauth_hostbased_fromfile(LIBSSH2_SESSION *session, const char *username, const char *publickey, const char *privatekey, const char *passphrase, const char *hostname);
|
||||
|
||||
.SH DESCRIPTION
|
||||
This is a macro defined in a public libssh2 header file that is using the
|
||||
@@ -16,4 +16,4 @@ See \fIlibssh2_userauth_hostbased_fromfile_ex(3)\fP
|
||||
.SH ERRORS
|
||||
See \fIlibssh2_userauth_hostbased_fromfile_ex(3)\fP
|
||||
.SH SEE ALSO
|
||||
.BR \fIlibssh2_userauth_hostbased_fromfile_ex(3)\fP
|
||||
.BR libssh2_userauth_hostbased_fromfile_ex(3)
|
||||
|
@@ -6,7 +6,11 @@ libssh2_userauth_keyboard_interactive - convenience macro for \fIlibssh2_useraut
|
||||
.SH SYNOPSIS
|
||||
#include <libssh2.h>
|
||||
|
||||
libssh2_userauth_keyboard_interactive(arguments)
|
||||
int
|
||||
libssh2_userauth_keyboard_interactive(LIBSSH2_SESSION* session,
|
||||
const char *username,
|
||||
LIBSSH2_USERAUTH_KBDINT_RESPONSE_FUNC((*response_callback)));
|
||||
|
||||
|
||||
.SH DESCRIPTION
|
||||
This is a macro defined in a public libssh2 header file that is using the
|
||||
@@ -16,4 +20,4 @@ See \fIlibssh2_userauth_keyboard_interactive_ex(3)\fP
|
||||
.SH ERRORS
|
||||
See \fIlibssh2_userauth_keyboard_interactive_ex(3)\fP
|
||||
.SH SEE ALSO
|
||||
.BR \fIlibssh2_userauth_keyboard_interactive_ex(3)\fP
|
||||
.BR libssh2_userauth_keyboard_interactive_ex(3)
|
||||
|
@@ -2,44 +2,59 @@
|
||||
.\"
|
||||
.TH libssh2_userauth_keyboard_interactive_ex 3 "8 Mar 2008" "libssh2 0.19" "libssh2 manual"
|
||||
.SH NAME
|
||||
libssh2_userauth_keyboard_interactive_ex - authenticate a session using a challenge-response authentication
|
||||
libssh2_userauth_keyboard_interactive_ex - authenticate a session using
|
||||
keyboard-interactive authentication
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <libssh2.h>
|
||||
|
||||
int
|
||||
libssh2_userauth_keyboard_interactive_ex(LIBSSH2_SESSION *session, const char *username, unsigned int username_len, LIBSSH2_USERAUTH_KBDINT_RESPONSE_FUNC(*response_callback));
|
||||
|
||||
int
|
||||
libssh2_userauth_keyboard_interactive(LIBSSH2_SESSION *session, const char *username, LIBSSH2_USERAUTH_KBDINT_RESPONSE_FUNC(*response_callback));
|
||||
|
||||
libssh2_userauth_keyboard_interactive_ex(LIBSSH2_SESSION *session,
|
||||
const char *username,
|
||||
unsigned int username_len,
|
||||
LIBSSH2_USERAUTH_KBDINT_RESPONSE_FUNC(*response_callback));
|
||||
.SH DESCRIPTION
|
||||
\fIsession\fP - Session instance as returned by
|
||||
.BR libssh2_session_init_ex(3)
|
||||
\fIsession\fP - Session instance as returned by
|
||||
\fIlibssh2_session_init_ex(3)\fP.
|
||||
|
||||
\fIusername\fP - Name of user to attempt plain password authentication for.
|
||||
\fIusername\fP - Name of user to attempt keyboard-interactive authentication
|
||||
for.
|
||||
|
||||
\fIusername_len\fP - Length of username parameter.
|
||||
|
||||
\fIresponse_callback\fP - As authentication proceeds, host issues several (1 or more) challenges and requires responses. This callback will be called at this moment. Callback is responsible to obtain responses for the challenges, fill the provided data structure and then return control. Responses will be sent to the host. String values will be free(3)ed by the library.
|
||||
\fIresponse_callback\fP - As authentication proceeds, the host issues several
|
||||
(1 or more) challenges and requires responses. This callback will be called at
|
||||
this moment. The callback is responsible to obtain responses for the
|
||||
challenges, fill the provided data structure and then return
|
||||
control. Responses will be sent to the host. String values will be free(3)ed
|
||||
by the library. The callback prototype must match this:
|
||||
|
||||
.nf
|
||||
void response(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);
|
||||
.fi
|
||||
|
||||
Attempts keyboard-interactive (challenge/response) authentication.
|
||||
|
||||
Note that many SSH servers will always issue single "password" challenge,
|
||||
requesting actual password as response, but it is not required by the protocol,
|
||||
and various authentication schemes, such as smartcard authentication may use
|
||||
keyboard-interactive authentication type too.
|
||||
|
||||
Note that many SSH servers will always issue a single "password" challenge,
|
||||
requesting actual password as response, but it is not required by the
|
||||
protocol, and various authentication schemes, such as smartcard authentication
|
||||
may use keyboard-interactive authentication type too.
|
||||
.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.
|
||||
|
||||
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.
|
||||
|
||||
\fLIBSSH2_ERROR_AUTHENTICATION_FAILED\fP - failed, invalid username/password or public/private key.
|
||||
|
||||
\fLIBSSH2_ERROR_AUTHENTICATION_FAILED\fP - failed, invalid username/password
|
||||
or public/private key.
|
||||
.SH SEE ALSO
|
||||
.BR libssh2_session_init_ex(3)
|
||||
|
@@ -2,42 +2,40 @@
|
||||
.\"
|
||||
.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
|
||||
libssh2_userauth_list - list supported authentication methods
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <libssh2.h>
|
||||
|
||||
char *
|
||||
libssh2_userauth_list(LIBSSH2_SESSION *session, const char *username, unsigned int username_len);
|
||||
|
||||
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_ex(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\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)
|
||||
|
||||
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\fP 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 a failing case by examining
|
||||
\fIlibssh2_userauth_authenticated(3)\fP.
|
||||
.SH RETURN VALUE
|
||||
On success a comma delimited list of supported authentication schemes. This list is
|
||||
internally managed by libssh2. On failure ruturns NULL.
|
||||
|
||||
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_ex(3)
|
||||
|
@@ -6,7 +6,9 @@ libssh2_userauth_password - convenience macro for \fIlibssh2_userauth_password_e
|
||||
.SH SYNOPSIS
|
||||
#include <libssh2.h>
|
||||
|
||||
libssh2_userauth_password(arguments)
|
||||
int libssh2_userauth_password(LIBSSH2_SESSION *session,
|
||||
const char *username,
|
||||
const char *password);
|
||||
|
||||
.SH DESCRIPTION
|
||||
This is a macro defined in a public libssh2 header file that is using the
|
||||
@@ -16,4 +18,4 @@ See \fIlibssh2_userauth_password_ex(3)\fP
|
||||
.SH ERRORS
|
||||
See \fIlibssh2_userauth_password_ex(3)\fP
|
||||
.SH SEE ALSO
|
||||
.BR \fIlibssh2_userauth_password_ex(3)\fP
|
||||
.BR libssh2_userauth_password_ex(3)
|
||||
|
29
docs/libssh2_userauth_publickey.3
Normal file
29
docs/libssh2_userauth_publickey.3
Normal file
@@ -0,0 +1,29 @@
|
||||
.\" $Id: template.3,v 1.4 2007/06/13 16:41:33 jehousley Exp $
|
||||
.\"
|
||||
.TH libssh2_userauth_publickey 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
|
||||
.SH NAME
|
||||
libssh2_userauth_publickey - authenticate using a callback function
|
||||
.SH SYNOPSIS
|
||||
#include <libssh2.h>
|
||||
|
||||
.nf
|
||||
int libssh2_userauth_publickey(LIBSSH2_SESSION *session,
|
||||
const char *user,
|
||||
const unsigned char *pubkeydata,
|
||||
size_t pubkeydata_len,
|
||||
sign_callback,
|
||||
void **abstract);
|
||||
.SH DESCRIPTION
|
||||
Authenticate with the \fIsign_callback\fP callback that matches the prototype
|
||||
below
|
||||
.SH CALLBACK
|
||||
.nf
|
||||
int name(LIBSSH2_SESSION *session, unsigned char **sig, size_t *sig_len,
|
||||
const unsigned char *data, size_t data_len, void **abstract);
|
||||
.fi
|
||||
|
||||
This function gets called...
|
||||
.SH RETURN VALUE
|
||||
Return 0 on success or negative on failure.
|
||||
.SH SEE ALSO
|
||||
.BR libssh2_userauth_publickey_fromfile_ex(3)
|
@@ -6,7 +6,12 @@ libssh2_userauth_publickey_fromfile - convenience macro for \fIlibssh2_userauth_
|
||||
.SH SYNOPSIS
|
||||
#include <libssh2.h>
|
||||
|
||||
libssh2_userauth_publickey_fromfile(arguments)
|
||||
int
|
||||
libssh2_userauth_publickey_fromfile(LIBSSH2_SESSION *session,
|
||||
const char *username,
|
||||
const char *publickey,
|
||||
const char *privatekey,
|
||||
const char *passphrase);
|
||||
|
||||
.SH DESCRIPTION
|
||||
This is a macro defined in a public libssh2 header file that is using the
|
||||
@@ -16,4 +21,4 @@ See \fIlibssh2_userauth_publickey_fromfile_ex(3)\fP
|
||||
.SH ERRORS
|
||||
See \fIlibssh2_userauth_publickey_fromfile_ex(3)\fP
|
||||
.SH SEE ALSO
|
||||
.BR \fIlibssh2_userauth_publickey_fromfile_ex(3)\fP
|
||||
.BR libssh2_userauth_publickey_fromfile_ex(3)
|
||||
|
@@ -6,12 +6,12 @@ libssh2_userauth_publickey_fromfile - authenticate a session with a public key,
|
||||
.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);
|
||||
|
||||
.nf
|
||||
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_ex(3)
|
||||
|
9
example/.gitignore
vendored
9
example/.gitignore
vendored
@@ -23,3 +23,12 @@ ssh2_agent
|
||||
libssh2_config.h
|
||||
libssh2_config.h.in
|
||||
stamp-h2
|
||||
sftp_append
|
||||
ssh2_echo
|
||||
subsystem_netconf
|
||||
test-scp
|
||||
test-sftp_append
|
||||
test-sftp_nonblock
|
||||
test-sftp_write
|
||||
test-sftp_write_nonblock
|
||||
test-ssh2_echo
|
||||
|
@@ -3,14 +3,11 @@ AUTOMAKE_OPTIONS = foreign nostdinc
|
||||
EXTRA_DIST = libssh2_config.h.in
|
||||
|
||||
# samples
|
||||
noinst_PROGRAMS = direct_tcpip ssh2 \
|
||||
scp scp_nonblock \
|
||||
scp_write scp_write_nonblock \
|
||||
sftp sftp_nonblock \
|
||||
sftp_write sftp_write_nonblock \
|
||||
sftp_mkdir sftp_mkdir_nonblock \
|
||||
sftp_RW_nonblock \
|
||||
sftpdir sftpdir_nonblock ssh2_exec ssh2_agent
|
||||
noinst_PROGRAMS = direct_tcpip ssh2 scp scp_nonblock scp_write \
|
||||
scp_write_nonblock sftp sftp_nonblock sftp_write sftp_write_nonblock \
|
||||
sftp_mkdir sftp_mkdir_nonblock sftp_RW_nonblock sftpdir \
|
||||
sftpdir_nonblock ssh2_exec ssh2_agent ssh2_echo sftp_append \
|
||||
subsystem_netconf
|
||||
|
||||
AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/example
|
||||
LDADD = $(top_builddir)/src/libssh2.la
|
||||
|
@@ -137,7 +137,8 @@ int main(int argc, char *argv[])
|
||||
channel = libssh2_scp_recv(session, scppath, &fileinfo);
|
||||
|
||||
if (!channel) {
|
||||
fprintf(stderr, "Unable to open a session\n");
|
||||
fprintf(stderr, "Unable to open a session: %d\n",
|
||||
libssh2_session_last_errno(session));
|
||||
goto shutdown;
|
||||
}
|
||||
|
||||
|
@@ -34,6 +34,36 @@
|
||||
#include <ctype.h>
|
||||
#include <time.h>
|
||||
|
||||
static int waitsocket(int socket_fd, LIBSSH2_SESSION *session)
|
||||
{
|
||||
struct timeval timeout;
|
||||
int rc;
|
||||
fd_set fd;
|
||||
fd_set *writefd = NULL;
|
||||
fd_set *readfd = NULL;
|
||||
int dir;
|
||||
|
||||
timeout.tv_sec = 10;
|
||||
timeout.tv_usec = 0;
|
||||
|
||||
FD_ZERO(&fd);
|
||||
|
||||
FD_SET(socket_fd, &fd);
|
||||
|
||||
/* now make sure we wait in the correct direction */
|
||||
dir = libssh2_session_block_directions(session);
|
||||
|
||||
if(dir & LIBSSH2_SESSION_BLOCK_INBOUND)
|
||||
readfd = &fd;
|
||||
|
||||
if(dir & LIBSSH2_SESSION_BLOCK_OUTBOUND)
|
||||
writefd = &fd;
|
||||
|
||||
rc = select(socket_fd + 1, readfd, writefd, NULL, &timeout);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
unsigned long hostaddr;
|
||||
@@ -58,6 +88,7 @@ int main(int argc, char *argv[])
|
||||
time_t start;
|
||||
long total = 0;
|
||||
int duration;
|
||||
size_t prev;
|
||||
|
||||
#ifdef WIN32
|
||||
WSADATA wsadata;
|
||||
@@ -190,15 +221,21 @@ int main(int argc, char *argv[])
|
||||
|
||||
total += nread;
|
||||
|
||||
prev = 0;
|
||||
do {
|
||||
/* write the same data over and over, until error or completion */
|
||||
rc = libssh2_channel_write(channel, ptr, nread);
|
||||
if (LIBSSH2_ERROR_EAGAIN == rc) { /* must loop around */
|
||||
continue;
|
||||
} else if (rc < 0) {
|
||||
fprintf(stderr, "ERROR %d\n", rc);
|
||||
while ((rc = libssh2_channel_write(channel, ptr, nread)) ==
|
||||
LIBSSH2_ERROR_EAGAIN) {
|
||||
waitsocket(sock, session);
|
||||
prev = 0;
|
||||
}
|
||||
if (rc < 0) {
|
||||
fprintf(stderr, "ERROR %d total %ld / %d prev %d\n", rc,
|
||||
total, (int)nread, (int)prev);
|
||||
break;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
prev = nread;
|
||||
|
||||
/* rc indicates how many bytes were written this time */
|
||||
nread -= rc;
|
||||
ptr += rc;
|
||||
|
@@ -245,7 +245,8 @@ int main(int argc, char *argv[])
|
||||
libssh2_sftp_open(sftp_session, sftppath, LIBSSH2_FXF_READ, 0);
|
||||
|
||||
if (!sftp_handle) {
|
||||
fprintf(stderr, "Unable to open file with SFTP\n");
|
||||
fprintf(stderr, "Unable to open file with SFTP: %ld\n",
|
||||
libssh2_sftp_last_error(sftp_session));
|
||||
goto shutdown;
|
||||
}
|
||||
fprintf(stderr, "libssh2_sftp_open() is done, now receive data!\n");
|
||||
|
232
example/sftp_append.c
Normal file
232
example/sftp_append.c
Normal file
@@ -0,0 +1,232 @@
|
||||
/*
|
||||
* $Id: sftp_write.c,v 1.11 2009/04/28 10:35:30 bagder Exp $
|
||||
*
|
||||
* Sample showing how to do SFTP append of a local file onto a remote one.
|
||||
*
|
||||
* The sample code has default values for host name, user name, password
|
||||
* and path to copy, but you can specify them on the command line like:
|
||||
*
|
||||
* sftp_append 192.168.0.1 user password localfile /tmp/remotefile
|
||||
*/
|
||||
|
||||
#include "libssh2_config.h"
|
||||
#include <libssh2.h>
|
||||
#include <libssh2_sftp.h>
|
||||
|
||||
#ifdef HAVE_WINSOCK2_H
|
||||
# include <winsock2.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
# ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_INET_H
|
||||
# include <arpa/inet.h>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
unsigned long hostaddr;
|
||||
int sock, i, auth_pw = 1;
|
||||
struct sockaddr_in sin;
|
||||
const char *fingerprint;
|
||||
LIBSSH2_SESSION *session;
|
||||
const char *username="username";
|
||||
const char *password="password";
|
||||
const char *loclfile="sftp_write.c";
|
||||
const char *sftppath="/tmp/TEST";
|
||||
int rc;
|
||||
FILE *local;
|
||||
LIBSSH2_SFTP *sftp_session;
|
||||
LIBSSH2_SFTP_HANDLE *sftp_handle;
|
||||
LIBSSH2_SFTP_ATTRIBUTES attrs;
|
||||
char mem[1024*100];
|
||||
size_t nread;
|
||||
char *ptr;
|
||||
|
||||
#ifdef WIN32
|
||||
WSADATA wsadata;
|
||||
|
||||
WSAStartup(MAKEWORD(2,0), &wsadata);
|
||||
#endif
|
||||
|
||||
if (argc > 1) {
|
||||
hostaddr = inet_addr(argv[1]);
|
||||
} else {
|
||||
hostaddr = htonl(0x7F000001);
|
||||
}
|
||||
|
||||
if(argc > 2) {
|
||||
username = argv[2];
|
||||
}
|
||||
if(argc > 3) {
|
||||
password = argv[3];
|
||||
}
|
||||
if(argc > 4) {
|
||||
loclfile = argv[4];
|
||||
}
|
||||
if(argc > 5) {
|
||||
sftppath = argv[5];
|
||||
}
|
||||
|
||||
rc = libssh2_init (0);
|
||||
if (rc != 0) {
|
||||
fprintf (stderr, "libssh2 initialization failed (%d)\n", rc);
|
||||
return 1;
|
||||
}
|
||||
|
||||
local = fopen(loclfile, "rb");
|
||||
if (!local) {
|
||||
printf("Can't local file %s\n", loclfile);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*
|
||||
* The application code is responsible for creating the socket
|
||||
* and establishing the connection
|
||||
*/
|
||||
sock = socket(AF_INET, SOCK_STREAM, 0);
|
||||
|
||||
sin.sin_family = AF_INET;
|
||||
sin.sin_port = htons(22);
|
||||
sin.sin_addr.s_addr = hostaddr;
|
||||
if (connect(sock, (struct sockaddr*)(&sin),
|
||||
sizeof(struct sockaddr_in)) != 0) {
|
||||
fprintf(stderr, "failed to connect!\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Create a session instance
|
||||
*/
|
||||
session = libssh2_session_init();
|
||||
if(!session)
|
||||
return -1;
|
||||
|
||||
/* Since we have set non-blocking, tell libssh2 we are blocking */
|
||||
libssh2_session_set_blocking(session, 1);
|
||||
|
||||
/* ... start it up. This will trade welcome banners, exchange keys,
|
||||
* and setup crypto, compression, and MAC layers
|
||||
*/
|
||||
rc = libssh2_session_startup(session, sock);
|
||||
if(rc) {
|
||||
fprintf(stderr, "Failure establishing SSH session: %d\n", rc);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* At this point we havn't yet authenticated. The first thing to do
|
||||
* is check the hostkey's fingerprint against our known hosts Your app
|
||||
* may have it hard coded, may go to a file, may present it to the
|
||||
* user, that's your call
|
||||
*/
|
||||
fingerprint = libssh2_hostkey_hash(session, LIBSSH2_HOSTKEY_HASH_SHA1);
|
||||
printf("Fingerprint: ");
|
||||
for(i = 0; i < 20; i++) {
|
||||
printf("%02X ", (unsigned char)fingerprint[i]);
|
||||
}
|
||||
printf("\n");
|
||||
|
||||
if (auth_pw) {
|
||||
/* We could authenticate via password */
|
||||
if (libssh2_userauth_password(session, username, password)) {
|
||||
printf("Authentication by password failed.\n");
|
||||
goto shutdown;
|
||||
}
|
||||
} else {
|
||||
/* Or by public key */
|
||||
if (libssh2_userauth_publickey_fromfile(session, username,
|
||||
"/home/username/.ssh/id_rsa.pub",
|
||||
"/home/username/.ssh/id_rsa",
|
||||
password)) {
|
||||
printf("\tAuthentication by public key failed\n");
|
||||
goto shutdown;
|
||||
}
|
||||
}
|
||||
|
||||
fprintf(stderr, "libssh2_sftp_init()!\n");
|
||||
sftp_session = libssh2_sftp_init(session);
|
||||
|
||||
if (!sftp_session) {
|
||||
fprintf(stderr, "Unable to init SFTP session\n");
|
||||
goto shutdown;
|
||||
}
|
||||
|
||||
fprintf(stderr, "libssh2_sftp_open() for READ and WRITE!\n");
|
||||
/* Request a file via SFTP */
|
||||
|
||||
sftp_handle =
|
||||
libssh2_sftp_open(sftp_session, sftppath,
|
||||
LIBSSH2_FXF_WRITE|LIBSSH2_FXF_READ,
|
||||
LIBSSH2_SFTP_S_IRUSR|LIBSSH2_SFTP_S_IWUSR|
|
||||
LIBSSH2_SFTP_S_IRGRP|LIBSSH2_SFTP_S_IROTH);
|
||||
if (!sftp_handle) {
|
||||
fprintf(stderr, "Unable to open file with SFTP\n");
|
||||
goto shutdown;
|
||||
}
|
||||
|
||||
if(libssh2_sftp_fstat_ex(sftp_handle, &attrs, 0) < 0) {
|
||||
printf("libssh2_sftp_fstat_ex failed\n");
|
||||
goto shutdown;
|
||||
}
|
||||
else
|
||||
libssh2_sftp_seek64(sftp_handle, attrs.filesize);
|
||||
printf("Did a seek to position %ld\n", (long) attrs.filesize);
|
||||
|
||||
fprintf(stderr, "libssh2_sftp_open() a handle for APPEND\n");
|
||||
|
||||
if (!sftp_handle) {
|
||||
fprintf(stderr, "Unable to open file with SFTP\n");
|
||||
goto shutdown;
|
||||
}
|
||||
fprintf(stderr, "libssh2_sftp_open() is done, now send data!\n");
|
||||
do {
|
||||
nread = fread(mem, 1, sizeof(mem), local);
|
||||
if (nread <= 0) {
|
||||
/* end of file */
|
||||
break;
|
||||
}
|
||||
ptr = mem;
|
||||
|
||||
do {
|
||||
/* write data in a loop until we block */
|
||||
rc = libssh2_sftp_write(sftp_handle, ptr, nread);
|
||||
if(rc < 0)
|
||||
break;
|
||||
ptr += rc;
|
||||
nread -= rc;
|
||||
} while (nread);
|
||||
|
||||
} while (rc > 0);
|
||||
|
||||
libssh2_sftp_close(sftp_handle);
|
||||
libssh2_sftp_shutdown(sftp_session);
|
||||
|
||||
shutdown:
|
||||
libssh2_session_disconnect(session,
|
||||
"Normal Shutdown, Thank you for playing");
|
||||
libssh2_session_free(session);
|
||||
|
||||
#ifdef WIN32
|
||||
closesocket(sock);
|
||||
#else
|
||||
close(sock);
|
||||
#endif
|
||||
if (local)
|
||||
fclose(local);
|
||||
printf("all done\n");
|
||||
|
||||
libssh2_exit();
|
||||
|
||||
return 0;
|
||||
}
|
@@ -50,7 +50,7 @@ int main(int argc, char *argv[])
|
||||
FILE *local;
|
||||
LIBSSH2_SFTP *sftp_session;
|
||||
LIBSSH2_SFTP_HANDLE *sftp_handle;
|
||||
char mem[1024];
|
||||
char mem[1024*100];
|
||||
size_t nread;
|
||||
char *ptr;
|
||||
|
||||
|
@@ -31,6 +31,9 @@
|
||||
#ifdef HAVE_ARPA_INET_H
|
||||
# include <arpa/inet.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_TIME_H
|
||||
# include <sys/time.h>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <fcntl.h>
|
||||
|
292
example/sftp_write_sliding.c
Normal file
292
example/sftp_write_sliding.c
Normal file
@@ -0,0 +1,292 @@
|
||||
/*
|
||||
* Sample showing how to do SFTP non-blocking write transfers.
|
||||
*
|
||||
* The sample code has default values for host name, user name, password
|
||||
* and path to copy, but you can specify them on the command line like:
|
||||
*
|
||||
* "sftp 192.168.0.1 user password sftp_write_nonblock.c /tmp/sftp_write_nonblock.c"
|
||||
*/
|
||||
|
||||
#include "libssh2_config.h"
|
||||
#include <libssh2.h>
|
||||
#include <libssh2_sftp.h>
|
||||
|
||||
#ifdef HAVE_WINSOCK2_H
|
||||
# include <winsock2.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_SELECT_H
|
||||
# include <sys/select.h>
|
||||
#endif
|
||||
# ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_INET_H
|
||||
# include <arpa/inet.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_TIME_H
|
||||
# include <sys/time.h>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <time.h>
|
||||
|
||||
static int waitsocket(int socket_fd, LIBSSH2_SESSION *session)
|
||||
{
|
||||
struct timeval timeout;
|
||||
int rc;
|
||||
fd_set fd;
|
||||
fd_set *writefd = NULL;
|
||||
fd_set *readfd = NULL;
|
||||
int dir;
|
||||
|
||||
timeout.tv_sec = 10;
|
||||
timeout.tv_usec = 0;
|
||||
|
||||
FD_ZERO(&fd);
|
||||
|
||||
FD_SET(socket_fd, &fd);
|
||||
|
||||
/* now make sure we wait in the correct direction */
|
||||
dir = libssh2_session_block_directions(session);
|
||||
|
||||
if(dir & LIBSSH2_SESSION_BLOCK_INBOUND)
|
||||
readfd = &fd;
|
||||
|
||||
if(dir & LIBSSH2_SESSION_BLOCK_OUTBOUND)
|
||||
writefd = &fd;
|
||||
|
||||
rc = select(socket_fd + 1, readfd, writefd, NULL, &timeout);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
unsigned long hostaddr;
|
||||
int sock, i, auth_pw = 1;
|
||||
struct sockaddr_in sin;
|
||||
const char *fingerprint;
|
||||
LIBSSH2_SESSION *session;
|
||||
const char *username="username";
|
||||
const char *password="password";
|
||||
const char *loclfile="sftp_write_nonblock.c";
|
||||
const char *sftppath="/tmp/sftp_write_nonblock.c";
|
||||
int rc;
|
||||
#if defined(HAVE_IOCTLSOCKET)
|
||||
long flag = 1;
|
||||
#endif
|
||||
FILE *local;
|
||||
LIBSSH2_SFTP *sftp_session;
|
||||
LIBSSH2_SFTP_HANDLE *sftp_handle;
|
||||
char mem[1024 * 1000];
|
||||
size_t nread;
|
||||
size_t memuse;
|
||||
time_t start;
|
||||
long total = 0;
|
||||
int duration;
|
||||
|
||||
#ifdef WIN32
|
||||
WSADATA wsadata;
|
||||
|
||||
WSAStartup(MAKEWORD(2,0), &wsadata);
|
||||
#endif
|
||||
|
||||
if (argc > 1) {
|
||||
hostaddr = inet_addr(argv[1]);
|
||||
} else {
|
||||
hostaddr = htonl(0x7F000001);
|
||||
}
|
||||
|
||||
if (argc > 2) {
|
||||
username = argv[2];
|
||||
}
|
||||
if (argc > 3) {
|
||||
password = argv[3];
|
||||
}
|
||||
if (argc > 4) {
|
||||
loclfile = argv[4];
|
||||
}
|
||||
if (argc > 5) {
|
||||
sftppath = argv[5];
|
||||
}
|
||||
|
||||
rc = libssh2_init (0);
|
||||
if (rc != 0) {
|
||||
fprintf (stderr, "libssh2 initialization failed (%d)\n", rc);
|
||||
return 1;
|
||||
}
|
||||
|
||||
local = fopen(loclfile, "rb");
|
||||
if (!local) {
|
||||
printf("Can't local file %s\n", loclfile);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*
|
||||
* The application code is responsible for creating the socket
|
||||
* and establishing the connection
|
||||
*/
|
||||
sock = socket(AF_INET, SOCK_STREAM, 0);
|
||||
|
||||
sin.sin_family = AF_INET;
|
||||
sin.sin_port = htons(22);
|
||||
sin.sin_addr.s_addr = hostaddr;
|
||||
if (connect(sock, (struct sockaddr*)(&sin),
|
||||
sizeof(struct sockaddr_in)) != 0) {
|
||||
fprintf(stderr, "failed to connect!\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Create a session instance
|
||||
*/
|
||||
session = libssh2_session_init();
|
||||
if (!session)
|
||||
return -1;
|
||||
|
||||
/* Since we have set non-blocking, tell libssh2 we are non-blocking */
|
||||
libssh2_session_set_blocking(session, 0);
|
||||
|
||||
/* ... start it up. This will trade welcome banners, exchange keys,
|
||||
* and setup crypto, compression, and MAC layers
|
||||
*/
|
||||
while ((rc = libssh2_session_startup(session, sock))
|
||||
== LIBSSH2_ERROR_EAGAIN);
|
||||
if (rc) {
|
||||
fprintf(stderr, "Failure establishing SSH session: %d\n", rc);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* At this point we havn't yet authenticated. The first thing to do is
|
||||
* check the hostkey's fingerprint against our known hosts Your app may
|
||||
* have it hard coded, may go to a file, may present it to the user,
|
||||
* that's your call
|
||||
*/
|
||||
fingerprint = libssh2_hostkey_hash(session, LIBSSH2_HOSTKEY_HASH_SHA1);
|
||||
printf("Fingerprint: ");
|
||||
for(i = 0; i < 20; i++) {
|
||||
printf("%02X ", (unsigned char)fingerprint[i]);
|
||||
}
|
||||
printf("\n");
|
||||
|
||||
if (auth_pw) {
|
||||
/* We could authenticate via password */
|
||||
while ((rc = libssh2_userauth_password(session, username, password)) ==
|
||||
LIBSSH2_ERROR_EAGAIN);
|
||||
if (rc) {
|
||||
printf("Authentication by password failed.\n");
|
||||
goto shutdown;
|
||||
}
|
||||
} else {
|
||||
/* Or by public key */
|
||||
while ((rc = libssh2_userauth_publickey_fromfile(session, username,
|
||||
"/home/username/.ssh/id_rsa.pub",
|
||||
"/home/username/.ssh/id_rsa",
|
||||
password)) ==
|
||||
LIBSSH2_ERROR_EAGAIN);
|
||||
if (rc) {
|
||||
printf("\tAuthentication by public key failed\n");
|
||||
goto shutdown;
|
||||
}
|
||||
}
|
||||
|
||||
fprintf(stderr, "libssh2_sftp_init()!\n");
|
||||
do {
|
||||
sftp_session = libssh2_sftp_init(session);
|
||||
|
||||
if (!sftp_session &&
|
||||
(libssh2_session_last_errno(session) != LIBSSH2_ERROR_EAGAIN)) {
|
||||
fprintf(stderr, "Unable to init SFTP session\n");
|
||||
goto shutdown;
|
||||
}
|
||||
} while (!sftp_session);
|
||||
|
||||
fprintf(stderr, "libssh2_sftp_open()!\n");
|
||||
/* Request a file via SFTP */
|
||||
do {
|
||||
sftp_handle =
|
||||
libssh2_sftp_open(sftp_session, sftppath,
|
||||
LIBSSH2_FXF_WRITE|LIBSSH2_FXF_CREAT|LIBSSH2_FXF_TRUNC,
|
||||
LIBSSH2_SFTP_S_IRUSR|LIBSSH2_SFTP_S_IWUSR|
|
||||
LIBSSH2_SFTP_S_IRGRP|LIBSSH2_SFTP_S_IROTH);
|
||||
|
||||
if (!sftp_handle &&
|
||||
(libssh2_session_last_errno(session) != LIBSSH2_ERROR_EAGAIN)) {
|
||||
fprintf(stderr, "Unable to open file with SFTP\n");
|
||||
goto shutdown;
|
||||
}
|
||||
} while (!sftp_handle);
|
||||
|
||||
fprintf(stderr, "libssh2_sftp_open() is done, now send data!\n");
|
||||
|
||||
start = time(NULL);
|
||||
|
||||
memuse = 0; /* it starts blank */
|
||||
do {
|
||||
nread = fread(&mem[memuse], 1, sizeof(mem)-memuse, local);
|
||||
if (nread <= 0) {
|
||||
/* end of file */
|
||||
if (memuse > 0)
|
||||
/* the previous sending is not finished */
|
||||
nread = 0;
|
||||
else
|
||||
break;
|
||||
}
|
||||
memuse += nread;
|
||||
total += nread;
|
||||
|
||||
/* write data in a loop until we block */
|
||||
while ((rc = libssh2_sftp_write(sftp_handle, mem, memuse)) ==
|
||||
LIBSSH2_ERROR_EAGAIN) {
|
||||
waitsocket(sock, session);
|
||||
}
|
||||
if(rc < 0)
|
||||
break;
|
||||
|
||||
if(memuse - rc) {
|
||||
/* make room for more data at the end of the buffer */
|
||||
memmove(&mem[0], &mem[rc], memuse - rc);
|
||||
memuse -= rc;
|
||||
}
|
||||
else
|
||||
/* 'mem' was consumed fully */
|
||||
memuse = 0;
|
||||
|
||||
} while (rc > 0);
|
||||
|
||||
duration = (int)(time(NULL)-start);
|
||||
|
||||
printf("%ld bytes in %d seconds makes %.1f bytes/sec\n",
|
||||
total, duration, total/(double)duration);
|
||||
|
||||
|
||||
fclose(local);
|
||||
libssh2_sftp_close(sftp_handle);
|
||||
libssh2_sftp_shutdown(sftp_session);
|
||||
|
||||
shutdown:
|
||||
|
||||
while (libssh2_session_disconnect(session, "Normal Shutdown, Thank you for playing")
|
||||
== LIBSSH2_ERROR_EAGAIN);
|
||||
libssh2_session_free(session);
|
||||
|
||||
#ifdef WIN32
|
||||
closesocket(sock);
|
||||
#else
|
||||
close(sock);
|
||||
#endif
|
||||
printf("all done\n");
|
||||
|
||||
libssh2_exit();
|
||||
|
||||
return 0;
|
||||
}
|
@@ -144,7 +144,7 @@ int main(int argc, char *argv[])
|
||||
username, identity->comment);
|
||||
break;
|
||||
}
|
||||
prev_identity = identity;
|
||||
prev_identity = identity;
|
||||
}
|
||||
if (rc) {
|
||||
fprintf(stderr, "Couldn't continue authentication\n");
|
||||
|
361
example/ssh2_echo.c
Normal file
361
example/ssh2_echo.c
Normal file
@@ -0,0 +1,361 @@
|
||||
/*
|
||||
* $Id: ssh2_exec.c,v 1.4 2009/05/07 20:30:22 bagder Exp $
|
||||
*
|
||||
* Run it like this:
|
||||
*
|
||||
* $ ./ssh2_echo 127.0.0.1 user password
|
||||
*
|
||||
* The code sends a 'cat' command, and then writes a lot of data to it only to
|
||||
* check that reading the returned data sums up to the same amount.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "libssh2_config.h"
|
||||
#include <libssh2.h>
|
||||
|
||||
#ifdef HAVE_WINSOCK2_H
|
||||
# include <winsock2.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_SELECT_H
|
||||
# include <sys/select.h>
|
||||
#endif
|
||||
# ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_INET_H
|
||||
# include <arpa/inet.h>
|
||||
#endif
|
||||
|
||||
#include <sys/time.h>
|
||||
#include <sys/types.h>
|
||||
#include <stdlib.h>
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
|
||||
static int waitsocket(int socket_fd, LIBSSH2_SESSION *session)
|
||||
{
|
||||
struct timeval timeout;
|
||||
int rc;
|
||||
fd_set fd;
|
||||
fd_set *writefd = NULL;
|
||||
fd_set *readfd = NULL;
|
||||
int dir;
|
||||
|
||||
timeout.tv_sec = 10;
|
||||
timeout.tv_usec = 0;
|
||||
|
||||
FD_ZERO(&fd);
|
||||
|
||||
FD_SET(socket_fd, &fd);
|
||||
|
||||
/* now make sure we wait in the correct direction */
|
||||
dir = libssh2_session_block_directions(session);
|
||||
|
||||
if(dir & LIBSSH2_SESSION_BLOCK_INBOUND)
|
||||
readfd = &fd;
|
||||
|
||||
if(dir & LIBSSH2_SESSION_BLOCK_OUTBOUND)
|
||||
writefd = &fd;
|
||||
|
||||
rc = select(socket_fd + 1, readfd, writefd, NULL, &timeout);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
#define BUFSIZE 32000
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
const char *hostname = "127.0.0.1";
|
||||
const char *commandline = "cat";
|
||||
const char *username = "user";
|
||||
const char *password = "password";
|
||||
unsigned long hostaddr;
|
||||
int sock;
|
||||
struct sockaddr_in sin;
|
||||
const char *fingerprint;
|
||||
LIBSSH2_SESSION *session;
|
||||
LIBSSH2_CHANNEL *channel;
|
||||
int rc;
|
||||
int exitcode = 0;
|
||||
char *exitsignal=(char *)"none";
|
||||
size_t len;
|
||||
LIBSSH2_KNOWNHOSTS *nh;
|
||||
int type;
|
||||
|
||||
#ifdef WIN32
|
||||
WSADATA wsadata;
|
||||
WSAStartup(MAKEWORD(2,0), &wsadata);
|
||||
#endif
|
||||
if (argc > 1)
|
||||
/* must be ip address only */
|
||||
hostname = argv[1];
|
||||
|
||||
if (argc > 2) {
|
||||
username = argv[2];
|
||||
}
|
||||
if (argc > 3) {
|
||||
password = argv[3];
|
||||
}
|
||||
|
||||
rc = libssh2_init (0);
|
||||
if (rc != 0) {
|
||||
fprintf (stderr, "libssh2 initialization failed (%d)\n", rc);
|
||||
return 1;
|
||||
}
|
||||
|
||||
hostaddr = inet_addr(hostname);
|
||||
|
||||
/* Ultra basic "connect to port 22 on localhost"
|
||||
* Your code is responsible for creating the socket establishing the
|
||||
* connection
|
||||
*/
|
||||
sock = socket(AF_INET, SOCK_STREAM, 0);
|
||||
|
||||
sin.sin_family = AF_INET;
|
||||
sin.sin_port = htons(22);
|
||||
sin.sin_addr.s_addr = hostaddr;
|
||||
if (connect(sock, (struct sockaddr*)(&sin),
|
||||
sizeof(struct sockaddr_in)) != 0) {
|
||||
fprintf(stderr, "failed to connect!\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Create a session instance */
|
||||
session = libssh2_session_init();
|
||||
if (!session)
|
||||
return -1;
|
||||
|
||||
/* tell libssh2 we want it all done non-blocking */
|
||||
libssh2_session_set_blocking(session, 0);
|
||||
|
||||
/* ... start it up. This will trade welcome banners, exchange keys,
|
||||
* and setup crypto, compression, and MAC layers
|
||||
*/
|
||||
while ((rc = libssh2_session_startup(session, sock)) ==
|
||||
LIBSSH2_ERROR_EAGAIN);
|
||||
if (rc) {
|
||||
fprintf(stderr, "Failure establishing SSH session: %d\n", rc);
|
||||
return -1;
|
||||
}
|
||||
|
||||
nh = libssh2_knownhost_init(session);
|
||||
if(!nh) {
|
||||
/* eeek, do cleanup here */
|
||||
return 2;
|
||||
}
|
||||
|
||||
/* read all hosts from here */
|
||||
libssh2_knownhost_readfile(nh, "known_hosts",
|
||||
LIBSSH2_KNOWNHOST_FILE_OPENSSH);
|
||||
|
||||
/* store all known hosts to here */
|
||||
libssh2_knownhost_writefile(nh, "dumpfile",
|
||||
LIBSSH2_KNOWNHOST_FILE_OPENSSH);
|
||||
|
||||
fingerprint = libssh2_session_hostkey(session, &len, &type);
|
||||
if(fingerprint) {
|
||||
struct libssh2_knownhost *host;
|
||||
int check = libssh2_knownhost_checkp(nh, hostname, 22,
|
||||
fingerprint, len,
|
||||
LIBSSH2_KNOWNHOST_TYPE_PLAIN|
|
||||
LIBSSH2_KNOWNHOST_KEYENC_RAW,
|
||||
&host);
|
||||
|
||||
fprintf(stderr, "Host check: %d, key: %s\n", check,
|
||||
(check <= LIBSSH2_KNOWNHOST_CHECK_MISMATCH)?
|
||||
host->key:"<none>");
|
||||
|
||||
/*****
|
||||
* At this point, we could verify that 'check' tells us the key is
|
||||
* fine or bail out.
|
||||
*****/
|
||||
}
|
||||
else {
|
||||
/* eeek, do cleanup here */
|
||||
return 3;
|
||||
}
|
||||
libssh2_knownhost_free(nh);
|
||||
|
||||
if ( strlen(password) != 0 ) {
|
||||
/* We could authenticate via password */
|
||||
while ((rc = libssh2_userauth_password(session, username, password)) ==
|
||||
LIBSSH2_ERROR_EAGAIN);
|
||||
if (rc) {
|
||||
fprintf(stderr, "Authentication by password failed.\n");
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
libssh2_trace(session, LIBSSH2_TRACE_SOCKET);
|
||||
|
||||
/* Exec non-blocking on the remove host */
|
||||
while( (channel = libssh2_channel_open_session(session)) == NULL &&
|
||||
libssh2_session_last_error(session,NULL,NULL,0) ==
|
||||
LIBSSH2_ERROR_EAGAIN ) {
|
||||
waitsocket(sock, session);
|
||||
}
|
||||
if( channel == NULL ) {
|
||||
fprintf(stderr,"Error\n");
|
||||
exit( 1 );
|
||||
}
|
||||
while( (rc = libssh2_channel_exec(channel, commandline)) ==
|
||||
LIBSSH2_ERROR_EAGAIN )
|
||||
waitsocket(sock, session);
|
||||
|
||||
if( rc != 0 ) {
|
||||
fprintf(stderr, "exec error\n");
|
||||
exit( 1 );
|
||||
}
|
||||
else {
|
||||
LIBSSH2_POLLFD *fds = NULL;
|
||||
int running = 1;
|
||||
int bufsize = BUFSIZE;
|
||||
char buffer[BUFSIZE];
|
||||
int totsize = 1500000;
|
||||
int totwritten = 0;
|
||||
int totread = 0;
|
||||
int partials = 0;
|
||||
int rereads = 0;
|
||||
int rewrites = 0;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < BUFSIZE; i++)
|
||||
buffer[i] = 'A';
|
||||
|
||||
if ((fds = malloc (sizeof (LIBSSH2_POLLFD))) == NULL) {
|
||||
fprintf(stderr, "malloc failed\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
fds[0].type = LIBSSH2_POLLFD_CHANNEL;
|
||||
fds[0].fd.channel = channel;
|
||||
fds[0].events = LIBSSH2_POLLFD_POLLIN | LIBSSH2_POLLFD_POLLOUT;
|
||||
|
||||
do {
|
||||
int rc = (libssh2_poll(fds, 1, 10));
|
||||
int act = 0;
|
||||
|
||||
if (rc < 1)
|
||||
continue;
|
||||
|
||||
if (fds[0].revents & LIBSSH2_POLLFD_POLLIN) {
|
||||
int n = libssh2_channel_read(channel, buffer, sizeof(buffer));
|
||||
act++;
|
||||
|
||||
if (n == LIBSSH2_ERROR_EAGAIN) {
|
||||
rereads++;
|
||||
fprintf(stderr, "will read again\n");
|
||||
}
|
||||
else if (n < 0) {
|
||||
fprintf(stderr, "read failed\n");
|
||||
exit(1);
|
||||
}
|
||||
else {
|
||||
totread += n;
|
||||
fprintf(stderr, "read %d bytes (%d in total)\n",
|
||||
n, totread);
|
||||
}
|
||||
}
|
||||
|
||||
if (fds[0].revents & LIBSSH2_POLLFD_POLLOUT) {
|
||||
act++;
|
||||
|
||||
if (totwritten < totsize) {
|
||||
/* we have not written all data yet */
|
||||
int left = totsize - totwritten;
|
||||
int size = (left < bufsize) ? left : bufsize;
|
||||
int n = libssh2_channel_write_ex(channel, 0, buffer, size);
|
||||
|
||||
if (n == LIBSSH2_ERROR_EAGAIN) {
|
||||
rewrites++;
|
||||
fprintf(stderr, "will write again\n");
|
||||
}
|
||||
else if (n < 0) {
|
||||
fprintf(stderr, "write failed\n");
|
||||
exit(1);
|
||||
}
|
||||
else {
|
||||
totwritten += n;
|
||||
fprintf(stderr, "wrote %d bytes (%d in total)",
|
||||
n, totwritten);
|
||||
if (left >= bufsize && n != bufsize) {
|
||||
partials++;
|
||||
fprintf(stderr, " PARTIAL");
|
||||
}
|
||||
fprintf(stderr, "\n");
|
||||
}
|
||||
} else {
|
||||
/* all data written, send EOF */
|
||||
rc = libssh2_channel_send_eof(channel);
|
||||
|
||||
if (rc == LIBSSH2_ERROR_EAGAIN) {
|
||||
fprintf(stderr, "will send eof again\n");
|
||||
}
|
||||
else if (rc < 0) {
|
||||
fprintf(stderr, "send eof failed\n");
|
||||
exit(1);
|
||||
}
|
||||
else {
|
||||
fprintf(stderr, "sent eof\n");
|
||||
/* we're done writing, stop listening for OUT events */
|
||||
fds[0].events &= ~LIBSSH2_POLLFD_POLLOUT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (fds[0].revents & LIBSSH2_POLLFD_CHANNEL_CLOSED) {
|
||||
if (!act) /* don't leave loop until we have read all data */
|
||||
running = 0;
|
||||
}
|
||||
} while(running);
|
||||
|
||||
exitcode = 127;
|
||||
while( (rc = libssh2_channel_close(channel)) == LIBSSH2_ERROR_EAGAIN )
|
||||
waitsocket(sock, session);
|
||||
|
||||
if( rc == 0 ) {
|
||||
exitcode = libssh2_channel_get_exit_status( channel );
|
||||
libssh2_channel_get_exit_signal(channel, &exitsignal,
|
||||
NULL, NULL, NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
if (exitsignal)
|
||||
printf("\nGot signal: %s\n", exitsignal);
|
||||
|
||||
libssh2_channel_free(channel);
|
||||
channel = NULL;
|
||||
|
||||
fprintf(stderr, "\nrereads: %d rewrites: %d totwritten %d\n",
|
||||
rereads, rewrites, totwritten);
|
||||
|
||||
if (totwritten != totread) {
|
||||
fprintf(stderr, "\n*** FAIL bytes written: %d bytes "
|
||||
"read: %d ***\n", totwritten, totread);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
libssh2_session_disconnect(session,
|
||||
"Normal Shutdown, Thank you for playing");
|
||||
libssh2_session_free(session);
|
||||
|
||||
#ifdef WIN32
|
||||
closesocket(sock);
|
||||
#else
|
||||
close(sock);
|
||||
#endif
|
||||
fprintf(stderr, "all done\n");
|
||||
|
||||
libssh2_exit();
|
||||
|
||||
return exitcode;
|
||||
}
|
@@ -86,6 +86,7 @@ int main(int argc, char *argv[])
|
||||
LIBSSH2_CHANNEL *channel;
|
||||
int rc;
|
||||
int exitcode;
|
||||
char *exitsignal=(char *)"none";
|
||||
int bytecount = 0;
|
||||
size_t len;
|
||||
LIBSSH2_KNOWNHOSTS *nh;
|
||||
@@ -286,8 +287,14 @@ int main(int argc, char *argv[])
|
||||
if( rc == 0 )
|
||||
{
|
||||
exitcode = libssh2_channel_get_exit_status( channel );
|
||||
libssh2_channel_get_exit_signal(channel, &exitsignal,
|
||||
NULL, NULL, NULL, NULL, NULL);
|
||||
}
|
||||
printf("\nEXIT: %d bytecount: %d\n", exitcode, bytecount);
|
||||
|
||||
if (exitsignal)
|
||||
printf("\nGot signal: %s\n", exitsignal);
|
||||
else
|
||||
printf("\nEXIT: %d bytecount: %d\n", exitcode, bytecount);
|
||||
|
||||
libssh2_channel_free(channel);
|
||||
channel = NULL;
|
||||
|
271
example/subsystem_netconf.c
Normal file
271
example/subsystem_netconf.c
Normal file
@@ -0,0 +1,271 @@
|
||||
#include "libssh2_config.h"
|
||||
#include <libssh2.h>
|
||||
|
||||
#ifdef WIN32
|
||||
#include <windows.h>
|
||||
#include <winsock2.h>
|
||||
#include <ws2tcpip.h>
|
||||
#else
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef HAVE_SYS_SELECT_H
|
||||
#include <sys/select.h>
|
||||
#endif
|
||||
|
||||
#ifndef INADDR_NONE
|
||||
#define INADDR_NONE (in_addr_t)~0
|
||||
#endif
|
||||
|
||||
const char *keyfile1 = "/home/username/.ssh/id_rsa.pub";
|
||||
const char *keyfile2 = "/home/username/.ssh/id_rsa";
|
||||
const char *username = "username";
|
||||
const char *password = "";
|
||||
|
||||
const char *server_ip = "127.0.0.1";
|
||||
|
||||
enum {
|
||||
AUTH_NONE = 0,
|
||||
AUTH_PASSWORD,
|
||||
AUTH_PUBLICKEY
|
||||
};
|
||||
|
||||
static int netconf_write(LIBSSH2_CHANNEL *channel, const char *buf, size_t len)
|
||||
{
|
||||
int i;
|
||||
ssize_t wr = 0;
|
||||
|
||||
do {
|
||||
i = libssh2_channel_write(channel, buf, len);
|
||||
if (i < 0) {
|
||||
fprintf(stderr, "libssh2_channel_write: %d\n", i);
|
||||
return -1;
|
||||
}
|
||||
wr += i;
|
||||
} while (i > 0 && wr < (ssize_t)len);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int netconf_read_until(LIBSSH2_CHANNEL *channel, const char *endtag,
|
||||
char *buf, size_t buflen)
|
||||
{
|
||||
ssize_t len, rd = 0;
|
||||
char *endreply, *specialsequence = NULL;
|
||||
|
||||
memset(buf, 0, buflen);
|
||||
|
||||
do {
|
||||
len = libssh2_channel_read(channel, buf + rd, buflen - rd);
|
||||
if (LIBSSH2_ERROR_EAGAIN == len)
|
||||
continue;
|
||||
else if (len < 0) {
|
||||
fprintf(stderr, "libssh2_channel_read: %d", (int)len);
|
||||
return -1;
|
||||
}
|
||||
rd += len;
|
||||
|
||||
/* read more data until we see a rpc-reply closing tag followed by
|
||||
* the special sequence ]]>]]> */
|
||||
|
||||
/* really, this MUST be replaced with proper XML parsing! */
|
||||
|
||||
endreply = strstr(buf, endtag);
|
||||
if (endreply)
|
||||
specialsequence = strstr(endreply, "]]>]]>");
|
||||
|
||||
} while (!endreply || !specialsequence);
|
||||
|
||||
/* discard the special sequence so that only XML is returned */
|
||||
rd = specialsequence - buf;
|
||||
buf[rd] = 0;
|
||||
|
||||
return rd;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int rc, sock = -1, i, auth = AUTH_NONE;
|
||||
struct sockaddr_in sin;
|
||||
const char *fingerprint;
|
||||
char *userauthlist;
|
||||
LIBSSH2_SESSION *session;
|
||||
LIBSSH2_CHANNEL *channel = NULL;
|
||||
char buf[1048576]; /* avoid any buffer reallocation for simplicity */
|
||||
ssize_t len;
|
||||
|
||||
#ifdef WIN32
|
||||
WSADATA wsadata;
|
||||
|
||||
WSAStartup(MAKEWORD(2,0), &wsadata);
|
||||
#endif
|
||||
|
||||
if (argc > 1)
|
||||
server_ip = argv[1];
|
||||
if (argc > 2)
|
||||
username = argv[2];
|
||||
if (argc > 3)
|
||||
password = argv[3];
|
||||
|
||||
rc = libssh2_init (0);
|
||||
if (rc != 0) {
|
||||
fprintf (stderr, "libssh2 initialization failed (%d)\n", rc);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Connect to SSH server */
|
||||
sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
|
||||
sin.sin_family = AF_INET;
|
||||
if (INADDR_NONE == (sin.sin_addr.s_addr = inet_addr(server_ip))) {
|
||||
fprintf(stderr, "inet_addr: Invalid IP address \"%s\"\n", server_ip);
|
||||
return -1;
|
||||
}
|
||||
sin.sin_port = htons(830);
|
||||
if (connect(sock, (struct sockaddr*)(&sin),
|
||||
sizeof(struct sockaddr_in)) != 0) {
|
||||
fprintf(stderr, "Failed to connect to %s!\n", inet_ntoa(sin.sin_addr));
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Create a session instance */
|
||||
session = libssh2_session_init();
|
||||
if(!session) {
|
||||
fprintf(stderr, "Could not initialize SSH session!\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* ... start it up. This will trade welcome banners, exchange keys,
|
||||
* and setup crypto, compression, and MAC layers
|
||||
*/
|
||||
rc = libssh2_session_startup(session, sock);
|
||||
if(rc) {
|
||||
fprintf(stderr, "Error when starting up SSH session: %d\n", rc);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* At this point we havn't yet authenticated. The first thing to do
|
||||
* is check the hostkey's fingerprint against our known hosts Your app
|
||||
* may have it hard coded, may go to a file, may present it to the
|
||||
* user, that's your call
|
||||
*/
|
||||
fingerprint = libssh2_hostkey_hash(session, LIBSSH2_HOSTKEY_HASH_SHA1);
|
||||
fprintf(stderr, "Fingerprint: ");
|
||||
for(i = 0; i < 20; i++)
|
||||
fprintf(stderr, "%02X ", (unsigned char)fingerprint[i]);
|
||||
fprintf(stderr, "\n");
|
||||
|
||||
/* check what authentication methods are available */
|
||||
userauthlist = libssh2_userauth_list(session, username, strlen(username));
|
||||
printf("Authentication methods: %s\n", userauthlist);
|
||||
if (strstr(userauthlist, "password"))
|
||||
auth |= AUTH_PASSWORD;
|
||||
if (strstr(userauthlist, "publickey"))
|
||||
auth |= AUTH_PUBLICKEY;
|
||||
|
||||
/* check for options */
|
||||
if(argc > 4) {
|
||||
if ((auth & AUTH_PASSWORD) && !strcasecmp(argv[4], "-p"))
|
||||
auth = AUTH_PASSWORD;
|
||||
if ((auth & AUTH_PUBLICKEY) && !strcasecmp(argv[4], "-k"))
|
||||
auth = AUTH_PUBLICKEY;
|
||||
}
|
||||
|
||||
if (auth & AUTH_PASSWORD) {
|
||||
if (libssh2_userauth_password(session, username, password)) {
|
||||
fprintf(stderr, "Authentication by password failed.\n");
|
||||
goto shutdown;
|
||||
}
|
||||
} else if (auth & AUTH_PUBLICKEY) {
|
||||
if (libssh2_userauth_publickey_fromfile(session, username, keyfile1,
|
||||
keyfile2, password)) {
|
||||
printf("Authentication by public key failed!\n");
|
||||
goto shutdown;
|
||||
}
|
||||
printf("Authentication by public key succeeded.\n");
|
||||
} else {
|
||||
printf("No supported authentication methods found!\n");
|
||||
goto shutdown;
|
||||
}
|
||||
|
||||
/* open a channel */
|
||||
channel = libssh2_channel_open_session(session);
|
||||
if (!channel) {
|
||||
fprintf(stderr, "Could not open the channel!\n"
|
||||
"(Note that this can be a problem at the server!"
|
||||
" Please review the server logs.)\n");
|
||||
goto shutdown;
|
||||
}
|
||||
|
||||
/* execute the subsystem on our channel */
|
||||
if (libssh2_channel_subsystem(channel, "netconf")) {
|
||||
fprintf(stderr, "Could not execute the \"netconf\" subsystem!\n"
|
||||
"(Note that this can be a problem at the server!"
|
||||
" Please review the server logs.)\n");
|
||||
goto shutdown;
|
||||
}
|
||||
|
||||
/* NETCONF: http://tools.ietf.org/html/draft-ietf-netconf-ssh-06 */
|
||||
|
||||
printf("Sending NETCONF client <hello>\n");
|
||||
snprintf(buf, sizeof(buf),
|
||||
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
|
||||
"<hello>"
|
||||
"<capabilities>"
|
||||
"<capability>urn:ietf:params:xml:ns:netconf:base:1.0</capability>"
|
||||
"</capabilities>"
|
||||
"</hello>\n"
|
||||
"]]>]]>\n%n", &len);
|
||||
if (-1 == netconf_write(channel, buf, len))
|
||||
goto shutdown;
|
||||
|
||||
printf("Reading NETCONF server <hello>\n");
|
||||
len = netconf_read_until(channel, "</hello>", buf, sizeof(buf));
|
||||
if (-1 == len)
|
||||
goto shutdown;
|
||||
|
||||
printf("Got %d bytes:\n----------------------\n%s", len, buf);
|
||||
|
||||
printf("Sending NETCONF <rpc>\n");
|
||||
snprintf(buf, sizeof(buf),
|
||||
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
|
||||
"<rpc xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\">"
|
||||
"<get-interface-information><terse/></get-interface-information>"
|
||||
"</rpc>\n"
|
||||
"]]>]]>\n%n", &len);
|
||||
if (-1 == netconf_write(channel, buf, len))
|
||||
goto shutdown;
|
||||
|
||||
printf("Reading NETCONF <rpc-reply>\n");
|
||||
len = netconf_read_until(channel, "</rpc-reply>", buf, sizeof(buf));
|
||||
if (-1 == len)
|
||||
goto shutdown;
|
||||
|
||||
printf("Got %d bytes:\n----------------------\n%s", len, buf);
|
||||
|
||||
shutdown:
|
||||
if (channel)
|
||||
libssh2_channel_free(channel);
|
||||
libssh2_session_disconnect(session, "Client disconnecting normally");
|
||||
libssh2_session_free(session);
|
||||
|
||||
#ifdef WIN32
|
||||
closesocket(sock);
|
||||
#else
|
||||
close(sock);
|
||||
#endif
|
||||
|
||||
libssh2_exit();
|
||||
|
||||
return 0;
|
||||
}
|
@@ -408,14 +408,16 @@ main (int argc, char *argv[])
|
||||
current_node = NULL;
|
||||
|
||||
while (current_node != NULL) {
|
||||
struct chan_X11_list *next_node;
|
||||
rc = x11_send_receive(current_node->chan, current_node->sock);
|
||||
next_node = current_node->next;
|
||||
if (rc == -1){
|
||||
shutdown(current_node->sock,SHUT_RDWR);
|
||||
close(current_node->sock);
|
||||
remove_node(current_node);
|
||||
|
||||
}
|
||||
current_node = current_node->next;
|
||||
|
||||
current_node = next_node;
|
||||
}
|
||||
|
||||
|
||||
|
76
git2news.pl
Executable file
76
git2news.pl
Executable file
@@ -0,0 +1,76 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
# git log --pretty=fuller --no-color --date=short --decorate=full
|
||||
|
||||
my @mname = ('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
|
||||
'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' );
|
||||
|
||||
sub nicedate {
|
||||
my ($date)=$_;
|
||||
|
||||
if($date =~ /(\d\d\d\d)-(\d\d)-(\d\d)/) {
|
||||
return sprintf("%d %s %4d", $3, $mname[$2-1], $1);
|
||||
}
|
||||
return $date;
|
||||
}
|
||||
|
||||
print
|
||||
' Changelog for the libssh2 project. Generated with git2news.pl
|
||||
';
|
||||
|
||||
my $line;
|
||||
my $tag;
|
||||
while(<STDIN>) {
|
||||
my $l = $_;
|
||||
|
||||
if($l =~/^commit ([[:xdigit:]]*) ?(.*)/) {
|
||||
$co = $1;
|
||||
my $ref = $2;
|
||||
if ($ref =~ /refs\/tags\/(libssh2-|VERSION\.)([0-9._]*)/) {
|
||||
$tag = $2;
|
||||
} else {
|
||||
$tag = '';
|
||||
}
|
||||
}
|
||||
elsif($l =~ /^Author: *(.*) +</) {
|
||||
$a = $1;
|
||||
}
|
||||
elsif($l =~ /^Commit: *(.*) +</) {
|
||||
$c = $1;
|
||||
}
|
||||
elsif($l =~ /^CommitDate: (.*)/) {
|
||||
$date = nicedate($1);
|
||||
}
|
||||
elsif($l =~ /^( )(.*)/) {
|
||||
my $extra;
|
||||
if ($tag) {
|
||||
# Version entries have a special format
|
||||
print "\nVersion " . $tag." ($date)\n";
|
||||
$oldc = "";
|
||||
$tag = "";
|
||||
}
|
||||
if($a ne $c) {
|
||||
$extra=sprintf("\n- [%s brought this change]\n\n ", $a);
|
||||
}
|
||||
else {
|
||||
$extra="\n- ";
|
||||
}
|
||||
if($co ne $oldco) {
|
||||
if($c ne $oldc) {
|
||||
print "\n$c ($date)$extra";
|
||||
}
|
||||
else {
|
||||
print "$extra";
|
||||
}
|
||||
$line =0;
|
||||
}
|
||||
|
||||
$oldco = $co;
|
||||
$oldc = $c;
|
||||
$olddate = $date;
|
||||
if($line++) {
|
||||
print " ";
|
||||
}
|
||||
print $2."\n";
|
||||
}
|
||||
}
|
@@ -1,5 +1,5 @@
|
||||
/* Copyright (c) 2004-2009, Sara Golemon <sarag@libssh2.org>
|
||||
* Copyright (c) 2009 by Daniel Stenberg
|
||||
* Copyright (c) 2009-2010 Daniel Stenberg
|
||||
* Copyright (c) 2010 Simon Josefsson <simon@josefsson.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
@@ -40,19 +40,19 @@
|
||||
#ifndef LIBSSH2_H
|
||||
#define LIBSSH2_H 1
|
||||
|
||||
#define LIBSSH2_COPYRIGHT "2004-2010 The libssh2 project and its contributors."
|
||||
#define LIBSSH2_COPYRIGHT "2004-2011 The libssh2 project and its contributors."
|
||||
|
||||
/* We use underscore instead of dash when appending DEV in dev versions just
|
||||
to make the BANNER define (used by src/session.c) be a valid SSH
|
||||
banner. Release versions have no appended strings and may of course not
|
||||
have dashes either. */
|
||||
#define LIBSSH2_VERSION "1.2.7_DEV"
|
||||
#define LIBSSH2_VERSION "1.3.0_DEV"
|
||||
|
||||
/* The numeric version number is also available "in parts" by using these
|
||||
defines: */
|
||||
#define LIBSSH2_VERSION_MAJOR 1
|
||||
#define LIBSSH2_VERSION_MINOR 2
|
||||
#define LIBSSH2_VERSION_PATCH 7
|
||||
#define LIBSSH2_VERSION_MINOR 3
|
||||
#define LIBSSH2_VERSION_PATCH 0
|
||||
|
||||
/* This is the numeric version of the libssh2 version number, meant for easier
|
||||
parsing and comparions by programs. The LIBSSH2_VERSION_NUM define will
|
||||
@@ -69,7 +69,7 @@
|
||||
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 0x010207
|
||||
#define LIBSSH2_VERSION_NUM 0x010300
|
||||
|
||||
/*
|
||||
* This is the date and time when the full source package was created. The
|
||||
@@ -87,6 +87,10 @@
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#ifdef _WIN32
|
||||
# include <BaseTsd.h>
|
||||
# include <WinSock2.h>
|
||||
#endif
|
||||
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
@@ -106,8 +110,7 @@ extern "C" {
|
||||
# endif /* LIBSSH2_WIN32 */
|
||||
#endif /* LIBSSH2_API */
|
||||
|
||||
#if defined(LIBSSH2_DARWIN) || (defined(LIBSSH2_WIN32) && \
|
||||
!defined(_MSC_VER) && !defined(__MINGW32__))
|
||||
#if defined(LIBSSH2_DARWIN)
|
||||
# include <sys/uio.h>
|
||||
#endif
|
||||
|
||||
@@ -122,15 +125,21 @@ typedef unsigned char uint8_t;
|
||||
typedef unsigned int uint32_t;
|
||||
typedef unsigned __int64 libssh2_uint64_t;
|
||||
typedef __int64 libssh2_int64_t;
|
||||
# ifndef _SSIZE_T_DEFINED
|
||||
typedef int ssize_t;
|
||||
# define _SSIZE_T_DEFINED
|
||||
#ifndef ssize_t
|
||||
typedef SSIZE_T ssize_t;
|
||||
#endif
|
||||
#else
|
||||
typedef unsigned long long libssh2_uint64_t;
|
||||
typedef long long libssh2_int64_t;
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
typedef SOCKET libssh2_socket_t;
|
||||
#else /* !WIN32 */
|
||||
typedef int libssh2_socket_t;
|
||||
#define INVALID_SOCKET -1
|
||||
#endif /* WIN32 */
|
||||
|
||||
/* Part of every banner, user specified or not */
|
||||
#define LIBSSH2_SSH_BANNER "SSH-2.0-libssh2_" LIBSSH2_VERSION
|
||||
|
||||
@@ -228,12 +237,22 @@ typedef struct _LIBSSH2_USERAUTH_KBDINT_RESPONSE
|
||||
void name(LIBSSH2_SESSION *session, void **session_abstract, \
|
||||
LIBSSH2_CHANNEL *channel, void **channel_abstract)
|
||||
|
||||
/* I/O callbacks */
|
||||
#define LIBSSH2_RECV_FUNC(name) ssize_t name(int socket, \
|
||||
void *buffer, size_t length, \
|
||||
int flags, void **abstract)
|
||||
#define LIBSSH2_SEND_FUNC(name) ssize_t name(int socket, \
|
||||
const void *buffer, size_t length,\
|
||||
int flags, void **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
|
||||
#define LIBSSH2_CALLBACK_SEND 5
|
||||
#define LIBSSH2_CALLBACK_RECV 6
|
||||
|
||||
/* libssh2_session_method_pref() constants */
|
||||
#define LIBSSH2_METHOD_KEX 0
|
||||
@@ -247,8 +266,9 @@ typedef struct _LIBSSH2_USERAUTH_KBDINT_RESPONSE
|
||||
#define LIBSSH2_METHOD_LANG_CS 8
|
||||
#define LIBSSH2_METHOD_LANG_SC 9
|
||||
|
||||
/* session.flags bits */
|
||||
#define LIBSSH2_FLAG_SIGPIPE 0x00000001
|
||||
/* flags */
|
||||
#define LIBSSH2_FLAG_SIGPIPE 1
|
||||
#define LIBSSH2_FLAG_COMPRESS 2
|
||||
|
||||
typedef struct _LIBSSH2_SESSION LIBSSH2_SESSION;
|
||||
typedef struct _LIBSSH2_CHANNEL LIBSSH2_CHANNEL;
|
||||
@@ -331,8 +351,15 @@ typedef struct _LIBSSH2_POLLFD {
|
||||
|
||||
/* Error Codes (defined by libssh2) */
|
||||
#define LIBSSH2_ERROR_NONE 0
|
||||
|
||||
/* The library once used -1 as a generic error return value on numerous places
|
||||
through the code, which subsequently was converted to
|
||||
LIBSSH2_ERROR_SOCKET_NONE uses over time. As this is a generic error code,
|
||||
the goal is to never ever return this code but instead make sure that a
|
||||
more accurate and descriptive error code is used. */
|
||||
#define LIBSSH2_ERROR_SOCKET_NONE -1
|
||||
#define LIBSSH2_ERROR_BANNER_NONE -2
|
||||
|
||||
#define LIBSSH2_ERROR_BANNER_RECV -2
|
||||
#define LIBSSH2_ERROR_BANNER_SEND -3
|
||||
#define LIBSSH2_ERROR_INVALID_MAC -4
|
||||
#define LIBSSH2_ERROR_KEX_FAILURE -5
|
||||
@@ -374,6 +401,12 @@ typedef struct _LIBSSH2_POLLFD {
|
||||
#define LIBSSH2_ERROR_COMPRESS -40
|
||||
#define LIBSSH2_ERROR_OUT_OF_BOUNDARY -41
|
||||
#define LIBSSH2_ERROR_AGENT_PROTOCOL -42
|
||||
#define LIBSSH2_ERROR_SOCKET_RECV -43
|
||||
#define LIBSSH2_ERROR_ENCRYPT -44
|
||||
#define LIBSSH2_ERROR_BAD_SOCKET -45
|
||||
|
||||
/* this is a define to provide the old (<= 1.2.7) name */
|
||||
#define LIBSSH2_ERROR_BANNER_NONE LIBSSH2_ERROR_BANNER_RECV
|
||||
|
||||
/* Global API */
|
||||
#define LIBSSH2_INIT_NO_CRYPTO 0x0001
|
||||
@@ -401,6 +434,13 @@ LIBSSH2_API int libssh2_init(int flags);
|
||||
*/
|
||||
LIBSSH2_API void libssh2_exit(void);
|
||||
|
||||
/*
|
||||
* libssh2_free()
|
||||
*
|
||||
* Deallocate memory allocated by earlier call to libssh2 functions.
|
||||
*/
|
||||
LIBSSH2_API void libssh2_free(LIBSSH2_SESSION *session, void *ptr);
|
||||
|
||||
/* Session API */
|
||||
LIBSSH2_API LIBSSH2_SESSION *
|
||||
libssh2_session_init_ex(LIBSSH2_ALLOC_FUNC((*my_alloc)),
|
||||
@@ -416,6 +456,8 @@ 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_handshake(LIBSSH2_SESSION *session,
|
||||
libssh2_socket_t sock);
|
||||
LIBSSH2_API int libssh2_session_disconnect_ex(LIBSSH2_SESSION *session,
|
||||
int reason,
|
||||
const char *description,
|
||||
@@ -673,6 +715,10 @@ 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_session_set_timeout(LIBSSH2_SESSION* session,
|
||||
long timeout);
|
||||
LIBSSH2_API long libssh2_session_get_timeout(LIBSSH2_SESSION* session);
|
||||
|
||||
/* libssh2_channel_handle_extended_data is DEPRECATED, do not use! */
|
||||
LIBSSH2_API void libssh2_channel_handle_extended_data(LIBSSH2_CHANNEL *channel,
|
||||
int ignore_mode);
|
||||
@@ -702,6 +748,13 @@ LIBSSH2_API int libssh2_channel_flush_ex(LIBSSH2_CHANNEL *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_get_exit_signal(LIBSSH2_CHANNEL* channel,
|
||||
char **exitsignal,
|
||||
size_t *exitsignal_len,
|
||||
char **errmsg,
|
||||
size_t *errmsg_len,
|
||||
char **langtag,
|
||||
size_t *langtag_len);
|
||||
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);
|
||||
|
@@ -9,8 +9,8 @@ includedir=@includedir@
|
||||
|
||||
Name: libssh2
|
||||
URL: http://www.libssh2.org/
|
||||
Description: Library for SSH based connunication
|
||||
Version: @VERSION@
|
||||
Description: Library for SSH-based communication
|
||||
Version: @LIBSSH2VER@
|
||||
Libs: -L${libdir} -lssh2 @LDFLAGS@ @LIBS@
|
||||
Libs.private: @LIBS@
|
||||
Cflags: -I${includedir}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user