Compare commits
243 Commits
libssh2-1.
...
libssh2-1.
Author | SHA1 | Date | |
---|---|---|---|
![]() |
0ecd0eb37c | ||
![]() |
f514bcac53 | ||
![]() |
79ee2f339e | ||
![]() |
12fd204ae4 | ||
![]() |
2386a5a21c | ||
![]() |
8b7e22cb33 | ||
![]() |
1d49f1bc21 | ||
![]() |
1711917c2c | ||
![]() |
b6ed60d2cc | ||
![]() |
79acf60ae6 | ||
![]() |
7810656564 | ||
![]() |
4bc10aa728 | ||
![]() |
5512d0d593 | ||
![]() |
05f9fb878e | ||
![]() |
f314f3b5fd | ||
![]() |
eb4407975c | ||
![]() |
6d253324be | ||
![]() |
aebcc45a37 | ||
![]() |
1decccbb52 | ||
![]() |
4c09324b02 | ||
![]() |
6d4b1bbb45 | ||
![]() |
5456163507 | ||
![]() |
7301036421 | ||
![]() |
fa4017c613 | ||
![]() |
2e3f380ff2 | ||
![]() |
6c3c3e1b49 | ||
![]() |
55ede3b41b | ||
![]() |
d00283927f | ||
![]() |
9ea5b0625e | ||
![]() |
1b1b4ac387 | ||
![]() |
9abf81de97 | ||
![]() |
c585828d2b | ||
![]() |
e54786cf2e | ||
![]() |
4cfeade243 | ||
![]() |
60ff0a2ade | ||
![]() |
64c97765a5 | ||
![]() |
ab66ff488b | ||
![]() |
0d331aade1 | ||
![]() |
69520e1564 | ||
![]() |
f87f4ab836 | ||
![]() |
b3556c2e0c | ||
![]() |
1f406feaa4 | ||
![]() |
c0436fc602 | ||
![]() |
0034a83e4c | ||
![]() |
f0f4ba92f0 | ||
![]() |
c29ba827e4 | ||
![]() |
a03e1b0457 | ||
![]() |
d4a768af4e | ||
![]() |
d377c3065a | ||
![]() |
51fcb11d60 | ||
![]() |
8bbc109e52 | ||
![]() |
0ef84144ac | ||
![]() |
ef27023eb9 | ||
![]() |
a9621548f8 | ||
![]() |
a925bdd5bb | ||
![]() |
3420e9858c | ||
![]() |
2de339b2f7 | ||
![]() |
c46cbd46e2 | ||
![]() |
16af813b81 | ||
![]() |
a2157c8391 | ||
![]() |
942a40b482 | ||
![]() |
ef096220ce | ||
![]() |
e4232e531b | ||
![]() |
cdc1366b2c | ||
![]() |
3e1a95392e | ||
![]() |
b4f12e153a | ||
![]() |
bd5519c7a2 | ||
![]() |
05b1bb3cd3 | ||
![]() |
dea503df73 | ||
![]() |
c5609acb17 | ||
![]() |
37c08983a3 | ||
![]() |
72ae0866cb | ||
![]() |
2149244cfe | ||
![]() |
a491017f5a | ||
![]() |
ec699ef684 | ||
![]() |
514104b37d | ||
![]() |
4d13c6e59b | ||
![]() |
72a28f6b16 | ||
![]() |
c889058cb3 | ||
![]() |
69c876e210 | ||
![]() |
10f5c70ac0 | ||
![]() |
ea914c8b72 | ||
![]() |
64a6c255ec | ||
![]() |
e09d6ac653 | ||
![]() |
91841731af | ||
![]() |
a190437c4a | ||
![]() |
68a900d27a | ||
![]() |
e4b7baa885 | ||
![]() |
2622bbaf33 | ||
![]() |
d3dbe4c81e | ||
![]() |
095ccbf825 | ||
![]() |
8eafded280 | ||
![]() |
6df87e64b7 | ||
![]() |
3ddac8ac66 | ||
![]() |
6c543545fe | ||
![]() |
abd9bd0bbe | ||
![]() |
5dd4005ace | ||
![]() |
8f102b8f56 | ||
![]() |
7d71f92a9c | ||
![]() |
f6fab0d9ea | ||
![]() |
cc7f90f1d4 | ||
![]() |
6d55714ab5 | ||
![]() |
6b23f640f8 | ||
![]() |
2cb8866f0a | ||
![]() |
3b3e13366e | ||
![]() |
9f4292433a | ||
![]() |
f077984394 | ||
![]() |
44eba0c993 | ||
![]() |
474e38119b | ||
![]() |
7f27b0822d | ||
![]() |
e3d8c1cfed | ||
![]() |
11a114ee7c | ||
![]() |
e48907ee05 | ||
![]() |
3f6bc287f9 | ||
![]() |
e84fe88526 | ||
![]() |
73e37b3b49 | ||
![]() |
7926c9cfaa | ||
![]() |
63457dfa6c | ||
![]() |
d00e97a7f1 | ||
![]() |
8436e45ea6 | ||
![]() |
0b6e37872d | ||
![]() |
1b3b7b2214 | ||
![]() |
6a249d7b6c | ||
![]() |
87e32272f9 | ||
![]() |
bd0505d6b9 | ||
![]() |
f70dbfa3e6 | ||
![]() |
a2452d7eee | ||
![]() |
bbb2f29037 | ||
![]() |
3138b5891f | ||
![]() |
c573af83de | ||
![]() |
ea8babf6d1 | ||
![]() |
db26c4eace | ||
![]() |
7b351eed36 | ||
![]() |
58abc7e30b | ||
![]() |
0a3b350012 | ||
![]() |
b5e358618b | ||
![]() |
dd81bda112 | ||
![]() |
12433b4511 | ||
![]() |
39cbd17e19 | ||
![]() |
1f91ab049f | ||
![]() |
f2e5b49904 | ||
![]() |
b4c0821332 | ||
![]() |
70b199f476 | ||
![]() |
d142f385da | ||
![]() |
1a491c6f00 | ||
![]() |
1256c61815 | ||
![]() |
95f559a926 | ||
![]() |
052a68db30 | ||
![]() |
1aba38cd7d | ||
![]() |
7317edab61 | ||
![]() |
e642e2c202 | ||
![]() |
f07cf3afd3 | ||
![]() |
1e350754f6 | ||
![]() |
55031fa320 | ||
![]() |
355fbf4d5b | ||
![]() |
74c63852d7 | ||
![]() |
ebbd7c879b | ||
![]() |
b78f854d8b | ||
![]() |
1f0d47fa92 | ||
![]() |
463e09e55f | ||
![]() |
82bf39dbfa | ||
![]() |
e5f170bae2 | ||
![]() |
fc60563840 | ||
![]() |
b38b4fb859 | ||
![]() |
3182045c2d | ||
![]() |
60d73d5663 | ||
![]() |
1e80194b97 | ||
![]() |
0c13f7beda | ||
![]() |
b859f4d9d2 | ||
![]() |
13092c5a5e | ||
![]() |
22b73235d3 | ||
![]() |
55034294e8 | ||
![]() |
5e80055d22 | ||
![]() |
11ca8d5583 | ||
![]() |
9162fd7e61 | ||
![]() |
7208e8d0d9 | ||
![]() |
e1bb074287 | ||
![]() |
e887ffca4c | ||
![]() |
65d1cb8107 | ||
![]() |
4ed82f0e78 | ||
![]() |
3cc2f143c1 | ||
![]() |
683aa0f6b5 | ||
![]() |
7a9d36903a | ||
![]() |
c2375dbfa4 | ||
![]() |
906a7d8866 | ||
![]() |
1418993a0f | ||
![]() |
c4b7f0394b | ||
![]() |
9e84b999a5 | ||
![]() |
3fda91d725 | ||
![]() |
7c32c84d0e | ||
![]() |
766127ad57 | ||
![]() |
a9e7f87e31 | ||
![]() |
a04a0b6c69 | ||
![]() |
1f8d58a4ce | ||
![]() |
4b482eddbe | ||
![]() |
05eb612f8e | ||
![]() |
d48ee98ecf | ||
![]() |
536443246e | ||
![]() |
b728b1018f | ||
![]() |
3f5a6662d0 | ||
![]() |
33f4e0f250 | ||
![]() |
8dabb1c5eb | ||
![]() |
0d6aaa1f56 | ||
![]() |
00fac145ba | ||
![]() |
f65f71a156 | ||
![]() |
3142e8df7e | ||
![]() |
bffefb12ea | ||
![]() |
feadd5f321 | ||
![]() |
7c139633a1 | ||
![]() |
692401633a | ||
![]() |
5bb1fb5cbc | ||
![]() |
5e5ead00b4 | ||
![]() |
06278728e2 | ||
![]() |
0357befa42 | ||
![]() |
85198c1cdb | ||
![]() |
face4750ca | ||
![]() |
a1365916c7 | ||
![]() |
f64a84a909 | ||
![]() |
fba3877ed8 | ||
![]() |
f1e010f5d4 | ||
![]() |
9e96acf86e | ||
![]() |
1a157d27cc | ||
![]() |
b3418bb1eb | ||
![]() |
08be841b4d | ||
![]() |
e39128df52 | ||
![]() |
5c6b8166c7 | ||
![]() |
dcb9625473 | ||
![]() |
c1b687c9e4 | ||
![]() |
13e920d4ef | ||
![]() |
314e61e545 | ||
![]() |
13c16db3bc | ||
![]() |
82c3f0ba72 | ||
![]() |
9e099fb88a | ||
![]() |
415efe10ac | ||
![]() |
4b1cb4e95e | ||
![]() |
d8b6f3c7b8 | ||
![]() |
a871f0b214 | ||
![]() |
08cad8e14c | ||
![]() |
46178378f2 | ||
![]() |
28b179ecf2 | ||
![]() |
7b4d6b2868 | ||
![]() |
fbe4737719 | ||
![]() |
ce4ad0d086 |
28
.cvsignore
28
.cvsignore
@@ -1,28 +0,0 @@
|
|||||||
.deps
|
|
||||||
.libs
|
|
||||||
*.lib
|
|
||||||
*.pdb
|
|
||||||
*.dll
|
|
||||||
*.exe
|
|
||||||
*.obj
|
|
||||||
.*.swp
|
|
||||||
Debug
|
|
||||||
Release
|
|
||||||
*.exp
|
|
||||||
Makefile
|
|
||||||
Makefile.in
|
|
||||||
aclocal.m4
|
|
||||||
autom4te.cache
|
|
||||||
config.guess
|
|
||||||
config.log
|
|
||||||
config.status
|
|
||||||
config.sub
|
|
||||||
configure
|
|
||||||
depcomp
|
|
||||||
libtool
|
|
||||||
ltmain.sh
|
|
||||||
missing
|
|
||||||
ssh2_sample
|
|
||||||
libssh2-*.tar.gz
|
|
||||||
INSTALL
|
|
||||||
install-sh
|
|
11
.cvsusers
11
.cvsusers
@@ -1,11 +0,0 @@
|
|||||||
jas4711:Simon Josefsson <simon@josefsson.org>
|
|
||||||
bagder:Daniel Stenberg
|
|
||||||
sarag:Sara Golemon <pollita@libssh2.org>
|
|
||||||
gusarov:Mikhail Gusarov <dottedmag@dottedmag.net>
|
|
||||||
wez:Wez Furlong
|
|
||||||
edink:Edink Kadribasic
|
|
||||||
jehousley: James Housley
|
|
||||||
gknauf: Guenter Knauf
|
|
||||||
dfandrich: Dan Fandrich
|
|
||||||
yangtse: Yang Tse
|
|
||||||
thomaspu: Paul Thomas
|
|
2
.gitattribute
Normal file
2
.gitattribute
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
win32/msvcproj.head -crlf
|
||||||
|
win32/msvcproj.foot -crlf
|
3
.gitignore
vendored
3
.gitignore
vendored
@@ -30,3 +30,6 @@ install-sh
|
|||||||
*.lo
|
*.lo
|
||||||
*.la
|
*.la
|
||||||
mkinstalldirs
|
mkinstalldirs
|
||||||
|
tags
|
||||||
|
libssh2.pc
|
||||||
|
TAGS
|
||||||
|
7
AUTHORS
7
AUTHORS
@@ -6,6 +6,7 @@
|
|||||||
Adam Gobiowski
|
Adam Gobiowski
|
||||||
Alexander Holyapin
|
Alexander Holyapin
|
||||||
Alexander Lamaison
|
Alexander Lamaison
|
||||||
|
Ben Kibbey
|
||||||
Bjorn Stenborg
|
Bjorn Stenborg
|
||||||
Carlo Bramini
|
Carlo Bramini
|
||||||
Dan Casey
|
Dan Casey
|
||||||
@@ -15,15 +16,19 @@ David J Sullivan
|
|||||||
David Robins
|
David Robins
|
||||||
Edink Kadribasic
|
Edink Kadribasic
|
||||||
Erik Brossler
|
Erik Brossler
|
||||||
|
Francois Dupoux
|
||||||
Guenter Knauf
|
Guenter Knauf
|
||||||
Heiner Steven
|
Heiner Steven
|
||||||
James Housleys
|
James Housleys
|
||||||
Jean-Louis Charton
|
Jean-Louis Charton
|
||||||
|
Jussi Mononen
|
||||||
|
Mark McPherson
|
||||||
Markus Moeller
|
Markus Moeller
|
||||||
Mike Protts
|
Mike Protts
|
||||||
Mikhail Gusarov
|
Mikhail Gusarov
|
||||||
Neil Gierman
|
Neil Gierman
|
||||||
Olivier Hervieu
|
Olivier Hervieu
|
||||||
|
Paul Veldkamp
|
||||||
Peter O'Gorman
|
Peter O'Gorman
|
||||||
Peter Stuge
|
Peter Stuge
|
||||||
Romain Bondue
|
Romain Bondue
|
||||||
@@ -34,6 +39,8 @@ Selcuk Gueney
|
|||||||
Simon Hart
|
Simon Hart
|
||||||
Simon Josefsson
|
Simon Josefsson
|
||||||
Steven Ayre
|
Steven Ayre
|
||||||
|
Steven Van Ingelgem
|
||||||
|
Tor Arntsen
|
||||||
Vincent Jaulin
|
Vincent Jaulin
|
||||||
Vlad Grachov
|
Vlad Grachov
|
||||||
Wez Furlong
|
Wez Furlong
|
||||||
|
1
COPYING
1
COPYING
@@ -1,6 +1,7 @@
|
|||||||
/* Copyright (c) 2004-2007 Sara Golemon <sarag@libssh2.org>
|
/* Copyright (c) 2004-2007 Sara Golemon <sarag@libssh2.org>
|
||||||
* Copyright (c) 2006-2007 The Written Word, Inc.
|
* Copyright (c) 2006-2007 The Written Word, Inc.
|
||||||
* Copyright (c) 2009 Daniel Stenberg
|
* Copyright (c) 2009 Daniel Stenberg
|
||||||
|
* Copyright (C) 2008, 2009 Simon Josefsson
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms,
|
* Redistribution and use in source and binary forms,
|
||||||
|
11
HACKING
11
HACKING
@@ -9,14 +9,5 @@ libssh2 source code style guide:
|
|||||||
go_nuts();
|
go_nuts();
|
||||||
}
|
}
|
||||||
|
|
||||||
- write both braces on the else line:
|
|
||||||
|
|
||||||
if (banana) {
|
|
||||||
go_nuts();
|
|
||||||
} else {
|
|
||||||
stay_calm();
|
|
||||||
}
|
|
||||||
|
|
||||||
- use braces even for single-statement blocks
|
|
||||||
|
|
||||||
- keep source lines shorter than 80 columns
|
- keep source lines shorter than 80 columns
|
||||||
|
- See libssh2-style.el for how to achieve this within Emacs
|
||||||
|
63
Makefile.am
63
Makefile.am
@@ -2,6 +2,9 @@ AUTOMAKE_OPTIONS = foreign nostdinc
|
|||||||
|
|
||||||
SUBDIRS = src example tests docs
|
SUBDIRS = src example tests docs
|
||||||
|
|
||||||
|
pkgconfigdir = $(libdir)/pkgconfig
|
||||||
|
pkgconfig_DATA = libssh2.pc
|
||||||
|
|
||||||
include_HEADERS = \
|
include_HEADERS = \
|
||||||
include/libssh2.h \
|
include/libssh2.h \
|
||||||
include/libssh2_publickey.h \
|
include/libssh2_publickey.h \
|
||||||
@@ -16,8 +19,7 @@ NETWAREFILES = nw/keepscreen.c \
|
|||||||
DSP = win32/libssh2.dsp
|
DSP = win32/libssh2.dsp
|
||||||
VCPROJ = win32/libssh2.vcproj
|
VCPROJ = win32/libssh2.vcproj
|
||||||
|
|
||||||
#Need to include $(VCPROJ) to CLEANFILES and WIN32FILES when I get a proper vc8proj.head|foot
|
DISTCLEANFILES = $(DSP)
|
||||||
CLEANFILES = $(DSP)
|
|
||||||
|
|
||||||
WIN32FILES = win32/Makefile.win32 win32/libssh2.dsw \
|
WIN32FILES = win32/Makefile.win32 win32/libssh2.dsw \
|
||||||
win32/config.mk win32/Makefile win32/test/Makefile.win32 \
|
win32/config.mk win32/Makefile win32/test/Makefile.win32 \
|
||||||
@@ -25,14 +27,14 @@ win32/libssh2_config.h win32/tests.dsp win32/rules.mk $(DSP) \
|
|||||||
win32/msvcproj.head win32/msvcproj.foot
|
win32/msvcproj.head win32/msvcproj.foot
|
||||||
|
|
||||||
EXTRA_DIST = $(WIN32FILES) buildconf $(NETWAREFILES) get_ver.awk HACKING \
|
EXTRA_DIST = $(WIN32FILES) buildconf $(NETWAREFILES) get_ver.awk HACKING \
|
||||||
maketgz NMakefile TODO RELEASE-NOTES
|
maketgz NMakefile TODO RELEASE-NOTES libssh2.pc.in
|
||||||
|
|
||||||
ACLOCAL_AMFLAGS = -I m4
|
ACLOCAL_AMFLAGS = -I m4
|
||||||
|
|
||||||
.PHONY: ChangeLog
|
.PHONY: ChangeLog
|
||||||
ChangeLog:
|
ChangeLog:
|
||||||
echo "see NEWS" > ./ChangeLog
|
echo "see NEWS" > ./ChangeLog
|
||||||
CLEANFILES += ChangeLog
|
DISTCLEANFILES += ChangeLog
|
||||||
|
|
||||||
dist-hook:
|
dist-hook:
|
||||||
rm -rf $(top_builddir)/tests/log
|
rm -rf $(top_builddir)/tests/log
|
||||||
@@ -73,55 +75,54 @@ include Makefile.inc
|
|||||||
WIN32SOURCES = $(CSOURCES)
|
WIN32SOURCES = $(CSOURCES)
|
||||||
WIN32HEADERS = $(HHEADERS) libssh2_config.h
|
WIN32HEADERS = $(HHEADERS) libssh2_config.h
|
||||||
|
|
||||||
DSPOUT = | awk '{printf("%s\r\n", $$0)}' >> $(DSP)
|
|
||||||
VCPROJOUT = | awk '{printf("%s\r\n", $$0)}' >> $(VCPROJ)
|
|
||||||
|
|
||||||
$(DSP): win32/msvcproj.head win32/msvcproj.foot Makefile.am
|
$(DSP): win32/msvcproj.head win32/msvcproj.foot Makefile.am
|
||||||
echo "creating $(DSP)"
|
echo "creating $(DSP)"
|
||||||
@(cp $(srcdir)/win32/msvcproj.head $(DSP); \
|
@( (cat $(srcdir)/win32/msvcproj.head; \
|
||||||
echo "# Begin Group \"Source Files\"" $(DSPOUT); \
|
echo "# Begin Group \"Source Files\""; \
|
||||||
echo "" $(DSPOUT); \
|
echo ""; \
|
||||||
echo "# PROP Default_Filter \"cpp;c;cxx\"" $(DSPOUT); \
|
echo "# PROP Default_Filter \"cpp;c;cxx\""; \
|
||||||
win32_srcs='$(WIN32SOURCES)'; \
|
win32_srcs='$(WIN32SOURCES)'; \
|
||||||
sorted_srcs=`for file in $$win32_srcs; do echo $$file; done | sort`; \
|
sorted_srcs=`for file in $$win32_srcs; do echo $$file; done | sort`; \
|
||||||
for file in $$sorted_srcs; do \
|
for file in $$sorted_srcs; do \
|
||||||
echo "# Begin Source File" $(DSPOUT); \
|
echo "# Begin Source File"; \
|
||||||
echo "" $(DSPOUT); \
|
echo ""; \
|
||||||
echo "SOURCE=..\\src\\"$$file $(DSPOUT); \
|
echo "SOURCE=..\\src\\"$$file; \
|
||||||
echo "# End Source File" $(DSPOUT); \
|
echo "# End Source File"; \
|
||||||
done; \
|
done; \
|
||||||
echo "# End Group" $(DSPOUT); \
|
echo "# End Group"; \
|
||||||
echo "# Begin Group \"Header Files\"" $(DSPOUT); \
|
echo "# Begin Group \"Header Files\""; \
|
||||||
echo "" $(DSPOUT); \
|
echo ""; \
|
||||||
echo "# PROP Default_Filter \"h;hpp;hxx\"" $(DSPOUT); \
|
echo "# PROP Default_Filter \"h;hpp;hxx\""; \
|
||||||
win32_hdrs='$(WIN32HEADERS)'; \
|
win32_hdrs='$(WIN32HEADERS)'; \
|
||||||
sorted_hdrs=`for file in $$win32_hdrs; do echo $$file; done | sort`; \
|
sorted_hdrs=`for file in $$win32_hdrs; do echo $$file; done | sort`; \
|
||||||
for file in $$sorted_hdrs; do \
|
for file in $$sorted_hdrs; do \
|
||||||
echo "# Begin Source File" $(DSPOUT); \
|
echo "# Begin Source File"; \
|
||||||
echo "" $(DSPOUT); \
|
echo ""; \
|
||||||
if [ "$$file" == "libssh2_config.h" ]; \
|
if [ "$$file" == "libssh2_config.h" ]; \
|
||||||
then \
|
then \
|
||||||
echo "SOURCE=.\\"$$file $(DSPOUT); \
|
echo "SOURCE=.\\"$$file; \
|
||||||
else \
|
else \
|
||||||
echo "SOURCE=..\\src\\"$$file $(DSPOUT); \
|
echo "SOURCE=..\\src\\"$$file; \
|
||||||
fi; \
|
fi; \
|
||||||
echo "# End Source File" $(DSPOUT); \
|
echo "# End Source File"; \
|
||||||
done; \
|
done; \
|
||||||
echo "# End Group" $(DSPOUT); \
|
echo "# End Group"; \
|
||||||
cat $(srcdir)/win32/msvcproj.foot $(DSPOUT) )
|
cat $(srcdir)/win32/msvcproj.foot) | \
|
||||||
|
awk '{printf("%s\r\n", gensub("\r", "", "g"))}' > $@ )
|
||||||
|
|
||||||
$(VCPROJ): win32/vc8proj.head win32/vc8proj.foot Makefile.am
|
$(VCPROJ): win32/vc8proj.head win32/vc8proj.foot Makefile.am
|
||||||
echo "creating $(VCPROJ)"
|
echo "creating $(VCPROJ)"
|
||||||
@(cp $(srcdir)/vc8proj.head $(VCPROJ); \
|
@( (cat $(srcdir)/vc8proj.head; \
|
||||||
win32_srcs='$(WIN32SOURCES)'; \
|
win32_srcs='$(WIN32SOURCES)'; \
|
||||||
sorted_srcs=`for file in $$win32_srcs; do echo $$file; done | sort`; \
|
sorted_srcs=`for file in $$win32_srcs; do echo $$file; done | sort`; \
|
||||||
for file in $$sorted_srcs; do \
|
for file in $$sorted_srcs; do \
|
||||||
echo "<File RelativePath=\""..\src\$$file"\"></File>" $(VCPROJOUT); \
|
echo "<File RelativePath=\""..\src\$$file"\"></File>"; \
|
||||||
done; \
|
done; \
|
||||||
echo "</Filter><Filter Name=\"Header Files\">" $(VCPROJOUT); \
|
echo "</Filter><Filter Name=\"Header Files\">"; \
|
||||||
win32_hdrs='$(WIN32HEADERS)'; \
|
win32_hdrs='$(WIN32HEADERS)'; \
|
||||||
sorted_hdrs=`for file in $$win32_hdrs; do echo $$file; done | sort`; \
|
sorted_hdrs=`for file in $$win32_hdrs; do echo $$file; done | sort`; \
|
||||||
for file in $$sorted_hdrs; do \
|
for file in $$sorted_hdrs; do \
|
||||||
echo "<File RelativePath=\""..\src\$$file"\"></File>" $(VCPROJOUT); \
|
echo "<File RelativePath=\""..\src\$$file"\"></File>"; \
|
||||||
done; \
|
done; \
|
||||||
cat $(srcdir)/vc8proj.foot $(VCPROJOUT) )
|
cat $(srcdir)/vc8proj.foot) | \
|
||||||
|
awk '{printf("%s\r\n", gensub("\r", "", "g"))}' > $@ )
|
||||||
|
12
Makefile.inc
12
Makefile.inc
@@ -1,11 +1,7 @@
|
|||||||
CSOURCES = channel.c comp.c crypt.c hostkey.c kex.c mac.c misc.c \
|
CSOURCES = channel.c comp.c crypt.c hostkey.c kex.c mac.c misc.c \
|
||||||
packet.c publickey.c scp.c session.c sftp.c userauth.c transport.c \
|
packet.c publickey.c scp.c session.c sftp.c userauth.c transport.c \
|
||||||
version.c knownhost.c
|
version.c knownhost.c agent.c openssl.c libgcrypt.c pem.c keepalive.c \
|
||||||
|
global.c
|
||||||
|
|
||||||
if LIBGCRYPT
|
HHEADERS = libssh2_priv.h openssl.h libgcrypt.h transport.h channel.h \
|
||||||
CSOURCES += libgcrypt.c pem.c
|
comp.h mac.h misc.h
|
||||||
else
|
|
||||||
CSOURCES += openssl.c
|
|
||||||
endif
|
|
||||||
|
|
||||||
HHEADERS = libssh2_priv.h openssl.h libgcrypt.h transport.h channel.h comp.h mac.h misc.h
|
|
||||||
|
97
NEWS
97
NEWS
@@ -1,3 +1,100 @@
|
|||||||
|
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)
|
Version 1.2 (August 10, 2009)
|
||||||
-----------------------------
|
-----------------------------
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
!include "win32/config.mk"
|
!include "win32/config.mk"
|
||||||
|
|
||||||
# SUBDIRS=src example\simple
|
# SUBDIRS=src example
|
||||||
SUBDIRS=src
|
SUBDIRS=src
|
||||||
|
|
||||||
all-sub:
|
all-sub:
|
||||||
|
@@ -1,40 +1,33 @@
|
|||||||
libssh2 1.2
|
libssh2 1.2.5
|
||||||
|
|
||||||
This release includes the following changes:
|
This release includes the following changes:
|
||||||
|
|
||||||
o we've switched to using git for source code control
|
o Added Add keep-alive support: libssh2_keepalive_config() and
|
||||||
o we're offering an alternative web site at http://libssh2.haxx.se/
|
libssh2_keepalive_send()
|
||||||
o the libssh2-devel mailing list moved to http://cool.haxx.se/
|
o Added libssh2_knownhost_addc(), libssh2_init() and libssh2_exit()
|
||||||
o libssh2_poll() and libssh2_poll_channel_read() are now deprecated
|
o Added LIBSSH2_SFTP_S_IS***() macros
|
||||||
o a range of libssh2_knownhost_*() functions were added to the API to work
|
|
||||||
with OpenSSH style known_hosts files etc
|
|
||||||
o added libssh2_session_hostkey()
|
|
||||||
o added an X11 forwarding example
|
|
||||||
o the makefile now generate MSVS project files
|
|
||||||
|
|
||||||
This release includes the following bugfixes:
|
This release includes the following bugfixes:
|
||||||
|
|
||||||
o bad 0-return from libssh2_channel_read
|
o fix memory leak in libssh2_session_startup()
|
||||||
o failure to "drain" the transport data caused badness
|
o added missing error codes - shown as hangs in blocking mode
|
||||||
o memory leak in libssh2_sftp_shutdown()
|
o fix memory leak in userauth_keyboard_interactive()
|
||||||
o fixed stroll() #if condition
|
o libssh2_knownhost_del: fix write to freed memory
|
||||||
o build thread-safe on Solaris
|
o Send and receive channel EOF before sending SSH_MSG_CHANNEL_CLOSE
|
||||||
o error when including libssh2.h in two files on Windows fixed
|
o Use AES-CTR from OpenSSL when available
|
||||||
o custom memory function extra argument was wrong
|
o Fixed gettimeofday to compile with Visual C++ 6
|
||||||
o transport now checks for and bail out on packets claing to be zero sized
|
o NULL dereference when window adjusting a non-existing channel
|
||||||
o fixed a number of compiler warnings
|
o avoid using poll on interix and mac os x systems
|
||||||
o buildconf runs on Mac OS X
|
o fix scp memory leak
|
||||||
o public headers includable on their own
|
o Correctly clear blocking flag after sending multipart packet
|
||||||
o bad debugdump() caused SIGSEGV at times (when libssh2_trace() was used)
|
o Reduce used window sizes by factor 10
|
||||||
o possible data loss when send_existing() failed to send its buffer
|
o libssh2_userauth_publickey_fromfile_ex() handles a NULL password
|
||||||
o passing FILE*s across DLL boundaries (OpenSSL) caused crashes on Windows
|
o sftp_init() deal with _libssh2_channel_write() short returns
|
||||||
|
|
||||||
This release would not have looked like this without help, code, reports and
|
This release would not have looked like this without help, code, reports and
|
||||||
advice from friends like these:
|
advice from friends like these:
|
||||||
|
|
||||||
Simon Josefsson, Neil Gierman, Alexander Lamaison, Peter Stuge,
|
Peter Stuge, Simon Josefsson, Alexander Lamaison, Paul Querna, Suyog Jadhav,
|
||||||
Steven Van Ingelgem, Ben Kibbey, Francois Dupoux, Mark McPherson,
|
Lars Nordin
|
||||||
Guenter Knauf, Yang Tse, Tor Arntsen, Jussi Mononen, Olivier Hervieu,
|
|
||||||
Paul Veldkamp
|
|
||||||
|
|
||||||
Thanks! (and sorry if I forgot to mention someone)
|
Thanks! (and sorry if I forgot to mention someone)
|
||||||
|
21
TODO
21
TODO
@@ -2,15 +2,15 @@ Things TODO
|
|||||||
===========
|
===========
|
||||||
|
|
||||||
* make sure the windowing code adapts better to slow situations so that it
|
* make sure the windowing code adapts better to slow situations so that it
|
||||||
doesn't then use as much memory as today
|
doesn't then use as much memory as today. Possibly by an app-controllable
|
||||||
|
"Window mode"?
|
||||||
|
|
||||||
* Introduce a 'libssh2_socket_t' type for sockets in internal code
|
* Introduce a function that can free data that is returned allocated from the
|
||||||
|
lib, like when libssh2_session_last_error() is asked to return the string
|
||||||
|
with 'want_buf' set to non-zero.
|
||||||
|
|
||||||
* Provide a libssh2_scp_send() API for files larger than 4GB (32bit size)
|
* Provide a libssh2_scp_send() API for files larger than 4GB (32bit size)
|
||||||
|
|
||||||
* Convert the linked list code used all over to use the (new) generic linked
|
|
||||||
list code. See the _libssh2_list_*() functions in src/misc.c
|
|
||||||
|
|
||||||
* Add more info to the man pages.
|
* Add more info to the man pages.
|
||||||
|
|
||||||
* Decrease the number of mallocs. Everywhere.
|
* Decrease the number of mallocs. Everywhere.
|
||||||
@@ -21,6 +21,8 @@ Things TODO
|
|||||||
|
|
||||||
* Fix all compiler warnings (some can't be done without API changes)
|
* Fix all compiler warnings (some can't be done without API changes)
|
||||||
|
|
||||||
|
* Expose error messages sent by the server
|
||||||
|
|
||||||
At next SONAME bump
|
At next SONAME bump
|
||||||
===================
|
===================
|
||||||
|
|
||||||
@@ -43,3 +45,12 @@ At next SONAME bump
|
|||||||
|
|
||||||
libssh2_hostkey_hash => libssh2_session_hostkey_hash
|
libssh2_hostkey_hash => libssh2_session_hostkey_hash
|
||||||
libssh2_banner_set => libssh2_session_banner_set
|
libssh2_banner_set => libssh2_session_banner_set
|
||||||
|
|
||||||
|
* change 'int' to 'libssh2_socket_t' in the public API for sockets.
|
||||||
|
|
||||||
|
* Use 'size_t' for string lengths in all functions.
|
||||||
|
|
||||||
|
* Add a comment field to struct libssh2_knownhost.
|
||||||
|
|
||||||
|
* remove the existing libssh2_knownhost_add() function and rename
|
||||||
|
libssh2_knownhost_addc to become the new libssh2_knownhost_add instead
|
||||||
|
@@ -297,7 +297,7 @@ dnl Internal macro for CURL_CONFIGURE_REENTRANT.
|
|||||||
|
|
||||||
AC_DEFUN([CURL_CHECK_NEED_REENTRANT_SYSTEM], [
|
AC_DEFUN([CURL_CHECK_NEED_REENTRANT_SYSTEM], [
|
||||||
case $host in
|
case $host in
|
||||||
*-*-solaris*)
|
*-*-solaris* | *-*-hpux*)
|
||||||
tmp_need_reentrant="yes"
|
tmp_need_reentrant="yes"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
15
buildconf
15
buildconf
@@ -2,26 +2,21 @@
|
|||||||
|
|
||||||
LIBTOOLIZE="libtoolize"
|
LIBTOOLIZE="libtoolize"
|
||||||
|
|
||||||
if [ "x`which $LIBTOOLIZE`" == "x" ];
|
if [ "x`which $LIBTOOLIZE`" = "x" ]; then
|
||||||
then
|
LIBTOOLIZE="glibtoolize"
|
||||||
LIBTOOLIZE="glibtoolize";
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "x`which $LIBTOOLIZE`" == "x" ];
|
if [ "x`which $LIBTOOLIZE`" = "x" ]; then
|
||||||
then
|
echo "Neither libtoolize nor glibtoolize could be found!"
|
||||||
echo "Neither libtoolize nor glibtoolize could be found!";
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
${LIBTOOLIZE} --copy --automake --force
|
${LIBTOOLIZE} --copy --automake --force
|
||||||
${ACLOCAL:-aclocal} -I m4 $ACLOCAL_FLAGS
|
${ACLOCAL:-aclocal} -I m4 $ACLOCAL_FLAGS
|
||||||
${AUTOHEADER:-autoheader}
|
${AUTOHEADER:-autoheader}
|
||||||
# copy the private libssh2_config.h.in to the examples dir so that
|
# copy the private libssh2_config.h.in to the examples dir so that
|
||||||
# it can be included without pointing the include path to the private
|
# it can be included without pointing the include path to the private
|
||||||
# source dir
|
# source dir
|
||||||
cp src/libssh2_config.h.in example/simple/config.h.in
|
cp src/libssh2_config.h.in example/libssh2_config.h.in
|
||||||
${AUTOCONF:-autoconf}
|
${AUTOCONF:-autoconf}
|
||||||
${AUTOMAKE:-automake} --add-missing --copy
|
${AUTOMAKE:-automake} --add-missing --copy
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
# AC_PREREQ(2.57)
|
# AC_PREREQ(2.57)
|
||||||
AC_INIT(libssh2, [-], libssh2-devel@lists.sourceforge.net)
|
AC_INIT(libssh2, [-], libssh2-devel@cool.haxx.se)
|
||||||
AC_CONFIG_MACRO_DIR([m4])
|
AC_CONFIG_MACRO_DIR([m4])
|
||||||
AC_CONFIG_SRCDIR([src])
|
AC_CONFIG_SRCDIR([src])
|
||||||
AC_CONFIG_HEADER([src/libssh2_config.h])
|
AM_CONFIG_HEADER([src/libssh2_config.h example/libssh2_config.h])
|
||||||
AM_MAINTAINER_MODE
|
AM_MAINTAINER_MODE
|
||||||
|
|
||||||
dnl SED is needed by some of the tools
|
dnl SED is needed by some of the tools
|
||||||
@@ -41,6 +41,9 @@ case "$host" in
|
|||||||
;;
|
;;
|
||||||
*hpux*)
|
*hpux*)
|
||||||
;;
|
;;
|
||||||
|
*osf*)
|
||||||
|
CFLAGS="$CFLAGS -D_POSIX_PII_SOCKET"
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@@ -108,6 +111,14 @@ if test "$ac_cv_libgcrypt" = "yes"; then
|
|||||||
fi
|
fi
|
||||||
AM_CONDITIONAL(LIBGCRYPT, test "$ac_cv_libgcrypt" = "yes")
|
AM_CONDITIONAL(LIBGCRYPT, test "$ac_cv_libgcrypt" = "yes")
|
||||||
|
|
||||||
|
# Not all OpenSSL have AES-CTR functions.
|
||||||
|
if test "$ac_cv_libssl" = "yes"; then
|
||||||
|
save_LDFLAGS="$LDFLAGS"
|
||||||
|
LDFLAGS="$LDFLAGS $LIBSSL"
|
||||||
|
AC_CHECK_FUNCS(EVP_aes128_ctr)
|
||||||
|
LDFLAGS="$save_LDFLAGS"
|
||||||
|
fi
|
||||||
|
|
||||||
# Look for Libz
|
# Look for Libz
|
||||||
if test "$use_libz" != "no"; then
|
if test "$use_libz" != "no"; then
|
||||||
AC_LIB_HAVE_LINKFLAGS([z], [], [#include <zlib.h>])
|
AC_LIB_HAVE_LINKFLAGS([z], [], [#include <zlib.h>])
|
||||||
@@ -144,12 +155,12 @@ AC_MSG_CHECKING([whether to enable pedantic and debug compiler options])
|
|||||||
AC_ARG_ENABLE(debug,
|
AC_ARG_ENABLE(debug,
|
||||||
AC_HELP_STRING([--enable-debug],[Enable pedantic and debug options])
|
AC_HELP_STRING([--enable-debug],[Enable pedantic and debug options])
|
||||||
AC_HELP_STRING([--disable-debug],[Disable debug options]),
|
AC_HELP_STRING([--disable-debug],[Disable debug options]),
|
||||||
[ case "$enableval" in
|
[ case "$enable_debug" in
|
||||||
no)
|
no)
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
;;
|
;;
|
||||||
*) AC_MSG_RESULT(yes)
|
*) AC_MSG_RESULT(yes)
|
||||||
|
enable_debug=yes
|
||||||
CPPFLAGS="$CPPFLAGS -DLIBSSH2DEBUG"
|
CPPFLAGS="$CPPFLAGS -DLIBSSH2DEBUG"
|
||||||
CFLAGS="$CFLAGS -g"
|
CFLAGS="$CFLAGS -g"
|
||||||
|
|
||||||
@@ -159,6 +170,46 @@ AC_HELP_STRING([--disable-debug],[Disable debug options]),
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
],
|
],
|
||||||
|
enable_debug=no
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
)
|
||||||
|
|
||||||
|
dnl ************************************************************
|
||||||
|
dnl Enable hiding of internal symbols in library to reduce its size and
|
||||||
|
dnl speed dynamic linking of applications. This currently is only supported
|
||||||
|
dnl on gcc >= 4.0 and SunPro C.
|
||||||
|
dnl
|
||||||
|
AC_MSG_CHECKING([whether to enable hidden symbols in the library])
|
||||||
|
AC_ARG_ENABLE(hidden-symbols,
|
||||||
|
AC_HELP_STRING([--enable-hidden-symbols],[Hide internal symbols in library])
|
||||||
|
AC_HELP_STRING([--disable-hidden-symbols],[Leave all symbols with default visibility in library]),
|
||||||
|
[ case "$enableval" in
|
||||||
|
no)
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
AC_MSG_CHECKING([whether $CC supports it])
|
||||||
|
if test "$GCC" = yes ; then
|
||||||
|
if $CC --help --verbose 2>&1 | grep fvisibility= > /dev/null ; then
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(LIBSSH2_API, [__attribute__ ((visibility ("default")))], [to make a symbol visible])
|
||||||
|
CFLAGS="$CFLAGS -fvisibility=hidden"
|
||||||
|
else
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
fi
|
||||||
|
|
||||||
|
else
|
||||||
|
dnl Test for SunPro cc
|
||||||
|
if $CC 2>&1 | grep flags >/dev/null && $CC -flags | grep xldscope= >/dev/null ; then
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(LIBSSH2_API, [__global], [to make a symbol visible])
|
||||||
|
CFLAGS="$CFLAGS -xldscope=hidden"
|
||||||
|
else
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac ],
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -167,6 +218,7 @@ AC_HELP_STRING([--disable-debug],[Disable debug options]),
|
|||||||
AC_CHECK_HEADERS([errno.h fcntl.h stdio.h stdlib.h unistd.h sys/uio.h])
|
AC_CHECK_HEADERS([errno.h fcntl.h stdio.h stdlib.h unistd.h sys/uio.h])
|
||||||
AC_CHECK_HEADERS([sys/select.h sys/socket.h sys/ioctl.h sys/time.h])
|
AC_CHECK_HEADERS([sys/select.h sys/socket.h sys/ioctl.h sys/time.h])
|
||||||
AC_CHECK_HEADERS([arpa/inet.h netinet/in.h])
|
AC_CHECK_HEADERS([arpa/inet.h netinet/in.h])
|
||||||
|
AC_CHECK_HEADERS([sys/un.h])
|
||||||
|
|
||||||
case $host in
|
case $host in
|
||||||
*-*-cygwin* | *-*-cegcc*)
|
*-*-cygwin* | *-*-cegcc*)
|
||||||
@@ -177,7 +229,25 @@ case $host in
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
AC_CHECK_FUNCS(poll gettimeofday select strtoll)
|
case $host in
|
||||||
|
*darwin*|*interix*)
|
||||||
|
dnl poll() does not work on these platforms
|
||||||
|
dnl Interix: "does provide poll(), but the implementing developer must
|
||||||
|
dnl have been in a bad mood, because poll() only works on the /proc
|
||||||
|
dnl filesystem here"
|
||||||
|
dnl Mac OS X's poll has funny behaviors, like:
|
||||||
|
dnl not being able to do poll on no fildescriptors (10.3?)
|
||||||
|
dnl not being able to poll on some files (like anything in /dev)
|
||||||
|
dnl not having reliable timeout support
|
||||||
|
dnl inconsistent return of POLLHUP where other implementations give POLLIN
|
||||||
|
AC_MSG_NOTICE([poll use is disabled on this platform])
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
AC_CHECK_FUNCS(poll)
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
AC_CHECK_FUNCS(gettimeofday select strtoll)
|
||||||
|
|
||||||
dnl Check for select() into ws2_32 for Msys/Mingw
|
dnl Check for select() into ws2_32 for Msys/Mingw
|
||||||
if test "$ac_cv_func_select" != "yes"; then
|
if test "$ac_cv_func_select" != "yes"; then
|
||||||
@@ -213,6 +283,20 @@ AC_CONFIG_FILES([Makefile
|
|||||||
src/Makefile
|
src/Makefile
|
||||||
tests/Makefile
|
tests/Makefile
|
||||||
example/Makefile
|
example/Makefile
|
||||||
example/simple/Makefile
|
docs/Makefile
|
||||||
docs/Makefile])
|
libssh2.pc])
|
||||||
AC_OUTPUT
|
AC_OUTPUT
|
||||||
|
|
||||||
|
AC_MSG_NOTICE([summary of build options:
|
||||||
|
|
||||||
|
version: ${VERSION}
|
||||||
|
Host type: ${host}
|
||||||
|
Install prefix: ${prefix}
|
||||||
|
Compiler: ${CC}
|
||||||
|
Compiler flags: ${CFLAGS}
|
||||||
|
Library types: Shared=${enable_shared}, Static=${enable_static}
|
||||||
|
Crypto library: openssl: ${ac_cv_libssl:-no} (AES-CTR: ${ac_cv_func_EVP_aes128_ctr:-N/A}) libgcrypt: ${ac_cv_libgcrypt:-no}
|
||||||
|
Debug build: $enable_debug
|
||||||
|
Path to sshd: $ac_cv_path_SSHD (only for self-tests)
|
||||||
|
libz compression: $ac_cv_libz
|
||||||
|
])
|
0
docs/.cvsignore → docs/.gitignore
vendored
0
docs/.cvsignore → docs/.gitignore
vendored
@@ -3,41 +3,71 @@
|
|||||||
EXTRA_DIST = template.3
|
EXTRA_DIST = template.3
|
||||||
|
|
||||||
dist_man_MANS = \
|
dist_man_MANS = \
|
||||||
|
libssh2_agent_connect.3 \
|
||||||
|
libssh2_agent_disconnect.3 \
|
||||||
|
libssh2_agent_free.3 \
|
||||||
|
libssh2_agent_get_identity.3 \
|
||||||
|
libssh2_agent_init.3 \
|
||||||
|
libssh2_agent_list_identities.3 \
|
||||||
|
libssh2_agent_userauth.3 \
|
||||||
libssh2_banner_set.3 \
|
libssh2_banner_set.3 \
|
||||||
libssh2_base64_decode.3 \
|
libssh2_base64_decode.3 \
|
||||||
libssh2_channel_close.3 \
|
libssh2_channel_close.3 \
|
||||||
|
libssh2_channel_direct_tcpip.3 \
|
||||||
libssh2_channel_direct_tcpip_ex.3 \
|
libssh2_channel_direct_tcpip_ex.3 \
|
||||||
libssh2_channel_eof.3 \
|
libssh2_channel_eof.3 \
|
||||||
|
libssh2_channel_exec.3 \
|
||||||
|
libssh2_channel_flush.3 \
|
||||||
libssh2_channel_flush_ex.3 \
|
libssh2_channel_flush_ex.3 \
|
||||||
|
libssh2_channel_flush_stderr.3 \
|
||||||
libssh2_channel_forward_accept.3 \
|
libssh2_channel_forward_accept.3 \
|
||||||
libssh2_channel_forward_cancel.3 \
|
libssh2_channel_forward_cancel.3 \
|
||||||
|
libssh2_channel_forward_listen.3 \
|
||||||
libssh2_channel_forward_listen_ex.3 \
|
libssh2_channel_forward_listen_ex.3 \
|
||||||
libssh2_channel_free.3 \
|
libssh2_channel_free.3 \
|
||||||
libssh2_channel_get_exit_status.3 \
|
libssh2_channel_get_exit_status.3 \
|
||||||
libssh2_channel_handle_extended_data.3 \
|
libssh2_channel_handle_extended_data.3 \
|
||||||
libssh2_channel_handle_extended_data2.3 \
|
libssh2_channel_handle_extended_data2.3 \
|
||||||
|
libssh2_channel_ignore_extended_data.3 \
|
||||||
libssh2_channel_open_ex.3 \
|
libssh2_channel_open_ex.3 \
|
||||||
|
libssh2_channel_open_session.3 \
|
||||||
libssh2_channel_process_startup.3 \
|
libssh2_channel_process_startup.3 \
|
||||||
|
libssh2_channel_read.3 \
|
||||||
libssh2_channel_read_ex.3 \
|
libssh2_channel_read_ex.3 \
|
||||||
|
libssh2_channel_read_stderr.3 \
|
||||||
libssh2_channel_receive_window_adjust.3 \
|
libssh2_channel_receive_window_adjust.3 \
|
||||||
libssh2_channel_receive_window_adjust2.3 \
|
libssh2_channel_receive_window_adjust2.3 \
|
||||||
|
libssh2_channel_request_pty.3 \
|
||||||
libssh2_channel_request_pty_ex.3 \
|
libssh2_channel_request_pty_ex.3 \
|
||||||
|
libssh2_channel_request_pty_size.3 \
|
||||||
libssh2_channel_request_pty_size_ex.3 \
|
libssh2_channel_request_pty_size_ex.3 \
|
||||||
libssh2_channel_send_eof.3 \
|
libssh2_channel_send_eof.3 \
|
||||||
libssh2_channel_set_blocking.3 \
|
libssh2_channel_set_blocking.3 \
|
||||||
|
libssh2_channel_setenv.3 \
|
||||||
libssh2_channel_setenv_ex.3 \
|
libssh2_channel_setenv_ex.3 \
|
||||||
|
libssh2_channel_shell.3 \
|
||||||
|
libssh2_channel_subsystem.3 \
|
||||||
libssh2_channel_wait_closed.3 \
|
libssh2_channel_wait_closed.3 \
|
||||||
libssh2_channel_wait_eof.3 \
|
libssh2_channel_wait_eof.3 \
|
||||||
|
libssh2_channel_window_read.3 \
|
||||||
libssh2_channel_window_read_ex.3 \
|
libssh2_channel_window_read_ex.3 \
|
||||||
|
libssh2_channel_window_write.3 \
|
||||||
libssh2_channel_window_write_ex.3 \
|
libssh2_channel_window_write_ex.3 \
|
||||||
|
libssh2_channel_write.3 \
|
||||||
libssh2_channel_write_ex.3 \
|
libssh2_channel_write_ex.3 \
|
||||||
|
libssh2_channel_write_stderr.3 \
|
||||||
|
libssh2_channel_x11_req.3 \
|
||||||
libssh2_channel_x11_req_ex.3 \
|
libssh2_channel_x11_req_ex.3 \
|
||||||
|
libssh2_exit.3 \
|
||||||
libssh2_free_host_entry.3 \
|
libssh2_free_host_entry.3 \
|
||||||
libssh2_host_entry_match.3 \
|
libssh2_host_entry_match.3 \
|
||||||
libssh2_hostkey_hash.3 \
|
libssh2_hostkey_hash.3 \
|
||||||
|
libssh2_init.3 \
|
||||||
libssh2_knownhost_add.3 \
|
libssh2_knownhost_add.3 \
|
||||||
|
libssh2_knownhost_addc.3 \
|
||||||
libssh2_knownhost_check.3 \
|
libssh2_knownhost_check.3 \
|
||||||
libssh2_knownhost_del.3 \
|
libssh2_knownhost_del.3 \
|
||||||
|
libssh2_knownhost_free.3 \
|
||||||
libssh2_knownhost_get.3 \
|
libssh2_knownhost_get.3 \
|
||||||
libssh2_knownhost_init.3 \
|
libssh2_knownhost_init.3 \
|
||||||
libssh2_knownhost_readfile.3 \
|
libssh2_knownhost_readfile.3 \
|
||||||
@@ -47,22 +77,27 @@ dist_man_MANS = \
|
|||||||
libssh2_new_host_entry.3 \
|
libssh2_new_host_entry.3 \
|
||||||
libssh2_poll.3 \
|
libssh2_poll.3 \
|
||||||
libssh2_poll_channel_read.3 \
|
libssh2_poll_channel_read.3 \
|
||||||
|
libssh2_publickey_add.3 \
|
||||||
libssh2_publickey_add_ex.3 \
|
libssh2_publickey_add_ex.3 \
|
||||||
libssh2_publickey_init.3 \
|
libssh2_publickey_init.3 \
|
||||||
libssh2_publickey_list_fetch.3 \
|
libssh2_publickey_list_fetch.3 \
|
||||||
libssh2_publickey_list_free.3 \
|
libssh2_publickey_list_free.3 \
|
||||||
|
libssh2_publickey_remove.3 \
|
||||||
libssh2_publickey_remove_ex.3 \
|
libssh2_publickey_remove_ex.3 \
|
||||||
libssh2_publickey_shutdown.3 \
|
libssh2_publickey_shutdown.3 \
|
||||||
libssh2_scp_recv.3 \
|
libssh2_scp_recv.3 \
|
||||||
|
libssh2_scp_send.3 \
|
||||||
libssh2_scp_send_ex.3 \
|
libssh2_scp_send_ex.3 \
|
||||||
libssh2_session_abstract.3 \
|
libssh2_session_abstract.3 \
|
||||||
libssh2_session_block_directions.3 \
|
libssh2_session_block_directions.3 \
|
||||||
libssh2_session_callback_set.3 \
|
libssh2_session_callback_set.3 \
|
||||||
|
libssh2_session_disconnect.3 \
|
||||||
libssh2_session_disconnect_ex.3 \
|
libssh2_session_disconnect_ex.3 \
|
||||||
libssh2_session_flag.3 \
|
libssh2_session_flag.3 \
|
||||||
libssh2_session_free.3 \
|
libssh2_session_free.3 \
|
||||||
libssh2_session_get_blocking.3 \
|
libssh2_session_get_blocking.3 \
|
||||||
libssh2_session_hostkey.3 \
|
libssh2_session_hostkey.3 \
|
||||||
|
libssh2_session_init.3 \
|
||||||
libssh2_session_init_ex.3 \
|
libssh2_session_init_ex.3 \
|
||||||
libssh2_session_last_errno.3 \
|
libssh2_session_last_errno.3 \
|
||||||
libssh2_session_last_error.3 \
|
libssh2_session_last_error.3 \
|
||||||
@@ -70,29 +105,52 @@ dist_man_MANS = \
|
|||||||
libssh2_session_methods.3 \
|
libssh2_session_methods.3 \
|
||||||
libssh2_session_set_blocking.3 \
|
libssh2_session_set_blocking.3 \
|
||||||
libssh2_session_startup.3 \
|
libssh2_session_startup.3 \
|
||||||
|
libssh2_sftp_close.3 \
|
||||||
libssh2_sftp_close_handle.3 \
|
libssh2_sftp_close_handle.3 \
|
||||||
|
libssh2_sftp_closedir.3 \
|
||||||
|
libssh2_sftp_fsetstat.3 \
|
||||||
|
libssh2_sftp_fstat.3 \
|
||||||
libssh2_sftp_fstat_ex.3 \
|
libssh2_sftp_fstat_ex.3 \
|
||||||
libssh2_sftp_init.3 \
|
libssh2_sftp_init.3 \
|
||||||
libssh2_sftp_last_error.3 \
|
libssh2_sftp_last_error.3 \
|
||||||
|
libssh2_sftp_lstat.3 \
|
||||||
|
libssh2_sftp_mkdir.3 \
|
||||||
libssh2_sftp_mkdir_ex.3 \
|
libssh2_sftp_mkdir_ex.3 \
|
||||||
|
libssh2_sftp_open.3 \
|
||||||
libssh2_sftp_open_ex.3 \
|
libssh2_sftp_open_ex.3 \
|
||||||
|
libssh2_sftp_opendir.3 \
|
||||||
libssh2_sftp_read.3 \
|
libssh2_sftp_read.3 \
|
||||||
|
libssh2_sftp_readdir.3 \
|
||||||
libssh2_sftp_readdir_ex.3 \
|
libssh2_sftp_readdir_ex.3 \
|
||||||
|
libssh2_sftp_readlink.3 \
|
||||||
|
libssh2_sftp_realpath.3 \
|
||||||
|
libssh2_sftp_rename.3 \
|
||||||
libssh2_sftp_rename_ex.3 \
|
libssh2_sftp_rename_ex.3 \
|
||||||
|
libssh2_sftp_rewind.3 \
|
||||||
|
libssh2_sftp_rmdir.3 \
|
||||||
libssh2_sftp_rmdir_ex.3 \
|
libssh2_sftp_rmdir_ex.3 \
|
||||||
libssh2_sftp_seek.3 \
|
libssh2_sftp_seek.3 \
|
||||||
|
libssh2_sftp_setstat.3 \
|
||||||
libssh2_sftp_shutdown.3 \
|
libssh2_sftp_shutdown.3 \
|
||||||
|
libssh2_sftp_stat.3 \
|
||||||
libssh2_sftp_stat_ex.3 \
|
libssh2_sftp_stat_ex.3 \
|
||||||
|
libssh2_sftp_symlink.3 \
|
||||||
libssh2_sftp_symlink_ex.3 \
|
libssh2_sftp_symlink_ex.3 \
|
||||||
libssh2_sftp_tell.3 \
|
libssh2_sftp_tell.3 \
|
||||||
libssh2_sftp_tell64.3 \
|
libssh2_sftp_tell64.3 \
|
||||||
|
libssh2_sftp_unlink.3 \
|
||||||
libssh2_sftp_unlink_ex.3 \
|
libssh2_sftp_unlink_ex.3 \
|
||||||
libssh2_sftp_write.3 \
|
libssh2_sftp_write.3 \
|
||||||
libssh2_trace.3 \
|
libssh2_trace.3 \
|
||||||
|
libssh2_trace_sethandler.3 \
|
||||||
libssh2_userauth_authenticated.3 \
|
libssh2_userauth_authenticated.3 \
|
||||||
|
libssh2_userauth_hostbased_fromfile.3 \
|
||||||
libssh2_userauth_hostbased_fromfile_ex.3 \
|
libssh2_userauth_hostbased_fromfile_ex.3 \
|
||||||
|
libssh2_userauth_keyboard_interactive.3 \
|
||||||
libssh2_userauth_keyboard_interactive_ex.3 \
|
libssh2_userauth_keyboard_interactive_ex.3 \
|
||||||
libssh2_userauth_list.3 \
|
libssh2_userauth_list.3 \
|
||||||
|
libssh2_userauth_password.3 \
|
||||||
libssh2_userauth_password_ex.3 \
|
libssh2_userauth_password_ex.3 \
|
||||||
|
libssh2_userauth_publickey_fromfile.3 \
|
||||||
libssh2_userauth_publickey_fromfile_ex.3 \
|
libssh2_userauth_publickey_fromfile_ex.3 \
|
||||||
libssh2_version.3
|
libssh2_version.3
|
||||||
|
23
docs/libssh2_agent_connect.3
Normal file
23
docs/libssh2_agent_connect.3
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
.\"
|
||||||
|
.\" Copyright (c) 2009 by Daiki Ueno
|
||||||
|
.\"
|
||||||
|
.TH libssh2_agent_connect 3 "23 Dec 2009" "libssh2 1.2" "libssh2 manual"
|
||||||
|
.SH NAME
|
||||||
|
libssh2_agent_connect - connect to an ssh-agent
|
||||||
|
.SH SYNOPSIS
|
||||||
|
#include <libssh2.h>
|
||||||
|
|
||||||
|
int libssh2_agent_connect(LIBSSH2_AGENT *agent);
|
||||||
|
.SH DESCRIPTION
|
||||||
|
Connect to an ssh-agent running on the system.
|
||||||
|
|
||||||
|
Call \fBlibssh2_agent_disconnect(3)\fP to close the connection after
|
||||||
|
you're doing using it.
|
||||||
|
.SH RETURN VALUE
|
||||||
|
Returns 0 if succeeded, or a negative value for error.
|
||||||
|
.SH AVAILABILITY
|
||||||
|
Added in libssh2 1.2
|
||||||
|
.SH SEE ALSO
|
||||||
|
.BR libssh2_agent_init(3)
|
||||||
|
.BR libssh2_agent_disconnect(3)
|
||||||
|
|
20
docs/libssh2_agent_disconnect.3
Normal file
20
docs/libssh2_agent_disconnect.3
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
.\"
|
||||||
|
.\" Copyright (c) 2009 by Daiki Ueno
|
||||||
|
.\"
|
||||||
|
.TH libssh2_agent_disconnect 3 "23 Dec 2009" "libssh2 1.2" "libssh2 manual"
|
||||||
|
.SH NAME
|
||||||
|
libssh2_agent_disconnect - close a connection to an ssh-agent
|
||||||
|
.SH SYNOPSIS
|
||||||
|
#include <libssh2.h>
|
||||||
|
|
||||||
|
int libssh2_agent_disconnect(LIBSSH2_AGENT *agent);
|
||||||
|
.SH DESCRIPTION
|
||||||
|
Close a connection to an ssh-agent.
|
||||||
|
|
||||||
|
.SH RETURN VALUE
|
||||||
|
Returns 0 if succeeded, or a negative value for error.
|
||||||
|
.SH AVAILABILITY
|
||||||
|
Added in libssh2 1.2
|
||||||
|
.SH SEE ALSO
|
||||||
|
.BR libssh2_agent_connect(3)
|
||||||
|
.BR libssh2_agent_free(3)
|
20
docs/libssh2_agent_free.3
Normal file
20
docs/libssh2_agent_free.3
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
.\"
|
||||||
|
.\" Copyright (c) 2009 by Daiki Ueno
|
||||||
|
.\"
|
||||||
|
.TH libssh2_agent_free 3 "28 May 2009" "libssh2 1.2" "libssh2 manual"
|
||||||
|
.SH NAME
|
||||||
|
libssh2_agent_free - free an ssh-agent handle
|
||||||
|
.SH SYNOPSIS
|
||||||
|
#include <libssh2.h>
|
||||||
|
|
||||||
|
void libssh2_agent_free(LIBSSH2_AGENT *agent);
|
||||||
|
.SH DESCRIPTION
|
||||||
|
Free an ssh-agent handle. This function also frees the internal
|
||||||
|
collection of public keys.
|
||||||
|
.SH RETURN VALUE
|
||||||
|
None.
|
||||||
|
.SH AVAILABILITY
|
||||||
|
Added in libssh2 1.2
|
||||||
|
.SH SEE ALSO
|
||||||
|
.BR libssh2_agent_init(3)
|
||||||
|
.BR libssh2_agent_disconnect(3)
|
34
docs/libssh2_agent_get_identity.3
Normal file
34
docs/libssh2_agent_get_identity.3
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
.\"
|
||||||
|
.\" Copyright (c) 2009 by Daiki Ueno
|
||||||
|
.\"
|
||||||
|
.TH libssh2_agent_get_identity 3 "23 Dec 2009" "libssh2 1.2" "libssh2 manual"
|
||||||
|
.SH NAME
|
||||||
|
libssh2_agent_get_identity - get a public key off the collection of public keys managed by ssh-agent
|
||||||
|
.SH SYNOPSIS
|
||||||
|
#include <libssh2.h>
|
||||||
|
|
||||||
|
int libssh2_agent_get_identity(LIBSSH2_AGENT *agent,
|
||||||
|
struct libssh2_agent_publickey **store,
|
||||||
|
struct libssh2_agent_publickey *prev);
|
||||||
|
.SH DESCRIPTION
|
||||||
|
\fIlibssh2_agent_get_identity(3)\fP allows an application to iterate
|
||||||
|
over all public keys in the collection managed by ssh-agent.
|
||||||
|
|
||||||
|
\fIstore\fP should point to a pointer that gets filled in to point to the
|
||||||
|
public key data.
|
||||||
|
|
||||||
|
\fIprev\fP is a pointer to a previous 'struct libssh2_agent_publickey'
|
||||||
|
as returned by a previous invoke of this function, or NULL to get the
|
||||||
|
first entry in the internal collection.
|
||||||
|
.SH RETURN VALUE
|
||||||
|
Returns 0 if everything is fine and information about a host was stored in
|
||||||
|
the \fIstore\fP struct.
|
||||||
|
|
||||||
|
Returns 1 if it reached the end of public keys.
|
||||||
|
|
||||||
|
Returns negative values for error
|
||||||
|
.SH AVAILABILITY
|
||||||
|
Added in libssh2 1.2
|
||||||
|
.SH SEE ALSO
|
||||||
|
.BR libssh2_agent_list_identities(3)
|
||||||
|
.BR libssh2_agent_userauth(3)
|
26
docs/libssh2_agent_init.3
Normal file
26
docs/libssh2_agent_init.3
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
.\"
|
||||||
|
.\" Copyright (c) 2009 by Daiki Ueno
|
||||||
|
.\"
|
||||||
|
.TH libssh2_agent_init 3 "23 Dec 2009" "libssh2 1.2" "libssh2 manual"
|
||||||
|
.SH NAME
|
||||||
|
libssh2_agent_init - init an ssh-agent handle
|
||||||
|
.SH SYNOPSIS
|
||||||
|
#include <libssh2.h>
|
||||||
|
|
||||||
|
LIBSSH2_AGENT *libssh2_agent_init(LIBSSH2_SESSION *session);
|
||||||
|
.SH DESCRIPTION
|
||||||
|
Init an ssh-agent handle. Returns the handle to an internal
|
||||||
|
representation of an ssh-agent connection. After the successful
|
||||||
|
initialization, an application can call \fBlibssh2_agent_connect(3)\fP
|
||||||
|
to connect to a running ssh-agent.
|
||||||
|
|
||||||
|
Call \fBlibssh2_agent_free(3)\fP to free the handle again after you're
|
||||||
|
doing using it.
|
||||||
|
.SH RETURN VALUE
|
||||||
|
Returns a handle pointer or NULL if something went wrong. The returned handle
|
||||||
|
is used as input to all other ssh-agent related functions libssh2 provides.
|
||||||
|
.SH AVAILABILITY
|
||||||
|
Added in libssh2 1.2
|
||||||
|
.SH SEE ALSO
|
||||||
|
.BR libssh2_agent_connect(3)
|
||||||
|
.BR libssh2_agent_free(3)
|
24
docs/libssh2_agent_list_identities.3
Normal file
24
docs/libssh2_agent_list_identities.3
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
.\"
|
||||||
|
.\" Copyright (c) 2009 by Daiki Ueno
|
||||||
|
.\"
|
||||||
|
.TH libssh2_agent_list_identities 3 "23 Dec 2009" "libssh2 1.2" "libssh2 manual"
|
||||||
|
.SH NAME
|
||||||
|
libssh2_agent_list_identities - request an ssh-agent to list of public keys.
|
||||||
|
.SH SYNOPSIS
|
||||||
|
#include <libssh2.h>
|
||||||
|
|
||||||
|
int libssh2_agent_list_identities(LIBSSH2_AGENT *agent);
|
||||||
|
.SH DESCRIPTION
|
||||||
|
Request an ssh-agent to list of public keys, and stores them in the
|
||||||
|
internal collection of the handle. Call
|
||||||
|
\fIlibssh2_agent_get_identity(3)\fP to get a public key off the
|
||||||
|
collection.
|
||||||
|
|
||||||
|
.SH RETURN VALUE
|
||||||
|
Returns 0 if succeeded, or a negative value for error.
|
||||||
|
.SH AVAILABILITY
|
||||||
|
Added in libssh2 1.2
|
||||||
|
.SH SEE ALSO
|
||||||
|
.BR libssh2_agent_connect(3)
|
||||||
|
.BR libssh2_agent_get_identity(3)
|
||||||
|
|
29
docs/libssh2_agent_userauth.3
Normal file
29
docs/libssh2_agent_userauth.3
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
.\"
|
||||||
|
.\" Copyright (c) 2009 by Daiki Ueno
|
||||||
|
.\"
|
||||||
|
.TH libssh2_agent_userauth 3 "23 Dec 2009" "libssh2 1.2" "libssh2 manual"
|
||||||
|
.SH NAME
|
||||||
|
libssh2_agent_userauth - authenticate a session with a public key, with the help of ssh-agent
|
||||||
|
.SH SYNOPSIS
|
||||||
|
#include <libssh2.h>
|
||||||
|
|
||||||
|
int libssh2_agent_userauth(LIBSSH2_AGENT *agent,
|
||||||
|
const char *username,
|
||||||
|
struct libssh2_agent_publickey *identity);
|
||||||
|
.SH DESCRIPTION
|
||||||
|
\fIagent\fP - ssh-agent handle as returned by
|
||||||
|
.BR libssh2_agent_init(3)
|
||||||
|
|
||||||
|
\fIusername\fP - Remote user name to authenticate as.
|
||||||
|
|
||||||
|
\fIidentity\fP - Public key to authenticate with, as returned by
|
||||||
|
.BR libssh2_agent_get_identity(3)
|
||||||
|
|
||||||
|
Attempt public key authentication with the help of ssh-agent.
|
||||||
|
.SH RETURN VALUE
|
||||||
|
Returns 0 if succeeded, or a negative value for error.
|
||||||
|
.SH AVAILABILITY
|
||||||
|
Added in libssh2 1.2
|
||||||
|
.SH SEE ALSO
|
||||||
|
.BR libssh2_agent_init(3)
|
||||||
|
.BR libssh2_agent_get_identity(3)
|
19
docs/libssh2_channel_direct_tcpip.3
Normal file
19
docs/libssh2_channel_direct_tcpip.3
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
.\" $Id: template.3,v 1.4 2007/06/13 16:41:33 jehousley Exp $
|
||||||
|
.\"
|
||||||
|
.TH libssh2_channel_direct_tcpip 3 "20 Feb 2010" "libssh2 1.2.4" "libssh2 manual"
|
||||||
|
.SH NAME
|
||||||
|
libssh2_channel_direct_tcpip - convenience macro for \fIlibssh2_channel_direct_tcpip_ex(3)\fP calls
|
||||||
|
.SH SYNOPSIS
|
||||||
|
#include <libssh2.h>
|
||||||
|
|
||||||
|
libssh2_channel_direct_tcpip(arguments)
|
||||||
|
|
||||||
|
.SH DESCRIPTION
|
||||||
|
This is a macro defined in a public libssh2 header file that is using the
|
||||||
|
underlying function \fIlibssh2_channel_direct_tcpip_ex(3)\fP.
|
||||||
|
.SH RETURN VALUE
|
||||||
|
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
|
19
docs/libssh2_channel_exec.3
Normal file
19
docs/libssh2_channel_exec.3
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
.\" $Id: template.3,v 1.4 2007/06/13 16:41:33 jehousley Exp $
|
||||||
|
.\"
|
||||||
|
.TH libssh2_channel_exec 3 "20 Feb 2010" "libssh2 1.2.4" "libssh2 manual"
|
||||||
|
.SH NAME
|
||||||
|
libssh2_channel_exec - convenience macro for \fIlibssh2_channel_process_startup(3)\fP calls
|
||||||
|
.SH SYNOPSIS
|
||||||
|
#include <libssh2.h>
|
||||||
|
|
||||||
|
libssh2_channel_exec(arguments)
|
||||||
|
|
||||||
|
.SH DESCRIPTION
|
||||||
|
This is a macro defined in a public libssh2 header file that is using the
|
||||||
|
underlying function \fIlibssh2_channel_process_startup(3)\fP.
|
||||||
|
.SH RETURN VALUE
|
||||||
|
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
|
19
docs/libssh2_channel_flush.3
Normal file
19
docs/libssh2_channel_flush.3
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
.\" $Id: template.3,v 1.4 2007/06/13 16:41:33 jehousley Exp $
|
||||||
|
.\"
|
||||||
|
.TH libssh2_channel_flush 3 "20 Feb 2010" "libssh2 1.2.4" "libssh2 manual"
|
||||||
|
.SH NAME
|
||||||
|
libssh2_channel_flush - convenience macro for \fIlibssh2_channel_flush_ex(3)\fP calls
|
||||||
|
.SH SYNOPSIS
|
||||||
|
#include <libssh2.h>
|
||||||
|
|
||||||
|
libssh2_channel_flush(arguments)
|
||||||
|
|
||||||
|
.SH DESCRIPTION
|
||||||
|
This is a macro defined in a public libssh2 header file that is using the
|
||||||
|
underlying function \fIlibssh2_channel_flush_ex(3)\fP.
|
||||||
|
.SH RETURN VALUE
|
||||||
|
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
|
19
docs/libssh2_channel_flush_stderr.3
Normal file
19
docs/libssh2_channel_flush_stderr.3
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
.\" $Id: template.3,v 1.4 2007/06/13 16:41:33 jehousley Exp $
|
||||||
|
.\"
|
||||||
|
.TH libssh2_channel_flush_stderr 3 "20 Feb 2010" "libssh2 1.2.4" "libssh2 manual"
|
||||||
|
.SH NAME
|
||||||
|
libssh2_channel_flush_stderr - convenience macro for \fIlibssh2_channel_flush_ex(3)\fP calls
|
||||||
|
.SH SYNOPSIS
|
||||||
|
#include <libssh2.h>
|
||||||
|
|
||||||
|
libssh2_channel_flush_stderr(arguments)
|
||||||
|
|
||||||
|
.SH DESCRIPTION
|
||||||
|
This is a macro defined in a public libssh2 header file that is using the
|
||||||
|
underlying function \fIlibssh2_channel_flush_ex(3)\fP.
|
||||||
|
.SH RETURN VALUE
|
||||||
|
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
|
19
docs/libssh2_channel_forward_listen.3
Normal file
19
docs/libssh2_channel_forward_listen.3
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
.\" $Id: template.3,v 1.4 2007/06/13 16:41:33 jehousley Exp $
|
||||||
|
.\"
|
||||||
|
.TH libssh2_channel_forward_listen 3 "20 Feb 2010" "libssh2 1.2.4" "libssh2 manual"
|
||||||
|
.SH NAME
|
||||||
|
libssh2_channel_forward_listen - convenience macro for \fIlibssh2_channel_forward_listen_ex(3)\fP calls
|
||||||
|
.SH SYNOPSIS
|
||||||
|
#include <libssh2.h>
|
||||||
|
|
||||||
|
libssh2_channel_forward_listen(arguments)
|
||||||
|
|
||||||
|
.SH DESCRIPTION
|
||||||
|
This is a macro defined in a public libssh2 header file that is using the
|
||||||
|
underlying function \fIlibssh2_channel_forward_listen_ex(3)\fP.
|
||||||
|
.SH RETURN VALUE
|
||||||
|
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
|
19
docs/libssh2_channel_ignore_extended_data.3
Normal file
19
docs/libssh2_channel_ignore_extended_data.3
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
.\" $Id: template.3,v 1.4 2007/06/13 16:41:33 jehousley Exp $
|
||||||
|
.\"
|
||||||
|
.TH libssh2_channel_ignore_extended_data 3 "20 Feb 2010" "libssh2 1.2.4" "libssh2 manual"
|
||||||
|
.SH NAME
|
||||||
|
libssh2_channel_ignore_extended_data - convenience macro for \fIlibssh2_channel_handle_extended_data(3)\fP calls
|
||||||
|
.SH SYNOPSIS
|
||||||
|
#include <libssh2.h>
|
||||||
|
|
||||||
|
libssh2_channel_ignore_extended_data(arguments)
|
||||||
|
|
||||||
|
.SH DESCRIPTION
|
||||||
|
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
|
||||||
|
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
|
19
docs/libssh2_channel_open_session.3
Normal file
19
docs/libssh2_channel_open_session.3
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
.\" $Id: template.3,v 1.4 2007/06/13 16:41:33 jehousley Exp $
|
||||||
|
.\"
|
||||||
|
.TH libssh2_channel_open_session 3 "20 Feb 2010" "libssh2 1.2.4" "libssh2 manual"
|
||||||
|
.SH NAME
|
||||||
|
libssh2_channel_open_session - convenience macro for \fIlibssh2_channel_open_ex(3)\fP calls
|
||||||
|
.SH SYNOPSIS
|
||||||
|
#include <libssh2.h>
|
||||||
|
|
||||||
|
libssh2_channel_open_session(arguments)
|
||||||
|
|
||||||
|
.SH DESCRIPTION
|
||||||
|
This is a macro defined in a public libssh2 header file that is using the
|
||||||
|
underlying function \fIlibssh2_channel_open_ex(3)\fP.
|
||||||
|
.SH RETURN VALUE
|
||||||
|
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
|
19
docs/libssh2_channel_read.3
Normal file
19
docs/libssh2_channel_read.3
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
.\" $Id: template.3,v 1.4 2007/06/13 16:41:33 jehousley Exp $
|
||||||
|
.\"
|
||||||
|
.TH libssh2_channel_read 3 "20 Feb 2010" "libssh2 1.2.4" "libssh2 manual"
|
||||||
|
.SH NAME
|
||||||
|
libssh2_channel_read - convenience macro for \fIlibssh2_channel_read_ex(3)\fP calls
|
||||||
|
.SH SYNOPSIS
|
||||||
|
#include <libssh2.h>
|
||||||
|
|
||||||
|
libssh2_channel_read(arguments)
|
||||||
|
|
||||||
|
.SH DESCRIPTION
|
||||||
|
This is a macro defined in a public libssh2 header file that is using the
|
||||||
|
underlying function \fIlibssh2_channel_read_ex(3)\fP.
|
||||||
|
.SH RETURN VALUE
|
||||||
|
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
|
@@ -35,6 +35,9 @@ macros.
|
|||||||
Actual number of bytes read or negative on failure. It returns
|
Actual number of bytes read or negative on failure. It returns
|
||||||
LIBSSH2_ERROR_EAGAIN when it would otherwise block. While
|
LIBSSH2_ERROR_EAGAIN when it would otherwise block. While
|
||||||
LIBSSH2_ERROR_EAGAIN is a negative number, it isn't really a failure per se.
|
LIBSSH2_ERROR_EAGAIN is a negative number, it isn't really a failure per se.
|
||||||
|
|
||||||
|
Note that a return value of zero (0) can in fact be a legitimate value and
|
||||||
|
only signals that no payload data was read. It is not an error.
|
||||||
.SH ERRORS
|
.SH ERRORS
|
||||||
\fILIBSSH2_ERROR_SOCKET_SEND\fP - Unable to send data on socket.
|
\fILIBSSH2_ERROR_SOCKET_SEND\fP - Unable to send data on socket.
|
||||||
|
|
||||||
|
19
docs/libssh2_channel_read_stderr.3
Normal file
19
docs/libssh2_channel_read_stderr.3
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
.\" $Id: template.3,v 1.4 2007/06/13 16:41:33 jehousley Exp $
|
||||||
|
.\"
|
||||||
|
.TH libssh2_channel_read_stderr 3 "20 Feb 2010" "libssh2 1.2.4" "libssh2 manual"
|
||||||
|
.SH NAME
|
||||||
|
libssh2_channel_read_stderr - convenience macro for \fIlibssh2_channel_read_ex(3)\fP calls
|
||||||
|
.SH SYNOPSIS
|
||||||
|
#include <libssh2.h>
|
||||||
|
|
||||||
|
libssh2_channel_read_stderr(arguments)
|
||||||
|
|
||||||
|
.SH DESCRIPTION
|
||||||
|
This is a macro defined in a public libssh2 header file that is using the
|
||||||
|
underlying function \fIlibssh2_channel_read_ex(3)\fP.
|
||||||
|
.SH RETURN VALUE
|
||||||
|
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
|
19
docs/libssh2_channel_request_pty.3
Normal file
19
docs/libssh2_channel_request_pty.3
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
.\" $Id: template.3,v 1.4 2007/06/13 16:41:33 jehousley Exp $
|
||||||
|
.\"
|
||||||
|
.TH libssh2_channel_request_pty 3 "20 Feb 2010" "libssh2 1.2.4" "libssh2 manual"
|
||||||
|
.SH NAME
|
||||||
|
libssh2_channel_request_pty - convenience macro for \fIlibssh2_channel_request_pty_ex(3)\fP calls
|
||||||
|
.SH SYNOPSIS
|
||||||
|
#include <libssh2.h>
|
||||||
|
|
||||||
|
libssh2_channel_request_pty(arguments)
|
||||||
|
|
||||||
|
.SH DESCRIPTION
|
||||||
|
This is a macro defined in a public libssh2 header file that is using the
|
||||||
|
underlying function \fIlibssh2_channel_request_pty_ex(3)\fP.
|
||||||
|
.SH RETURN VALUE
|
||||||
|
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
|
19
docs/libssh2_channel_request_pty_size.3
Normal file
19
docs/libssh2_channel_request_pty_size.3
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
.\" $Id: template.3,v 1.4 2007/06/13 16:41:33 jehousley Exp $
|
||||||
|
.\"
|
||||||
|
.TH libssh2_channel_request_pty_size 3 "20 Feb 2010" "libssh2 1.2.4" "libssh2 manual"
|
||||||
|
.SH NAME
|
||||||
|
libssh2_channel_request_pty_size - convenience macro for \fIlibssh2_channel_request_pty_size_ex(3)\fP calls
|
||||||
|
.SH SYNOPSIS
|
||||||
|
#include <libssh2.h>
|
||||||
|
|
||||||
|
libssh2_channel_request_pty_size(arguments)
|
||||||
|
|
||||||
|
.SH DESCRIPTION
|
||||||
|
This is a macro defined in a public libssh2 header file that is using the
|
||||||
|
underlying function \fIlibssh2_channel_request_pty_size_ex(3)\fP.
|
||||||
|
.SH RETURN VALUE
|
||||||
|
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
|
19
docs/libssh2_channel_setenv.3
Normal file
19
docs/libssh2_channel_setenv.3
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
.\" $Id: template.3,v 1.4 2007/06/13 16:41:33 jehousley Exp $
|
||||||
|
.\"
|
||||||
|
.TH libssh2_channel_setenv 3 "20 Feb 2010" "libssh2 1.2.4" "libssh2 manual"
|
||||||
|
.SH NAME
|
||||||
|
libssh2_channel_setenv - convenience macro for \fIlibssh2_channel_setenv_ex(3)\fP calls
|
||||||
|
.SH SYNOPSIS
|
||||||
|
#include <libssh2.h>
|
||||||
|
|
||||||
|
libssh2_channel_setenv(arguments)
|
||||||
|
|
||||||
|
.SH DESCRIPTION
|
||||||
|
This is a macro defined in a public libssh2 header file that is using the
|
||||||
|
underlying function \fIlibssh2_channel_setenv_ex(3)\fP.
|
||||||
|
.SH RETURN VALUE
|
||||||
|
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
|
19
docs/libssh2_channel_shell.3
Normal file
19
docs/libssh2_channel_shell.3
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
.\" $Id: template.3,v 1.4 2007/06/13 16:41:33 jehousley Exp $
|
||||||
|
.\"
|
||||||
|
.TH libssh2_channel_shell 3 "20 Feb 2010" "libssh2 1.2.4" "libssh2 manual"
|
||||||
|
.SH NAME
|
||||||
|
libssh2_channel_shell - convenience macro for \fIlibssh2_channel_process_startup(3)\fP calls
|
||||||
|
.SH SYNOPSIS
|
||||||
|
#include <libssh2.h>
|
||||||
|
|
||||||
|
libssh2_channel_shell(arguments)
|
||||||
|
|
||||||
|
.SH DESCRIPTION
|
||||||
|
This is a macro defined in a public libssh2 header file that is using the
|
||||||
|
underlying function \fIlibssh2_channel_process_startup(3)\fP.
|
||||||
|
.SH RETURN VALUE
|
||||||
|
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
|
19
docs/libssh2_channel_subsystem.3
Normal file
19
docs/libssh2_channel_subsystem.3
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
.\" $Id: template.3,v 1.4 2007/06/13 16:41:33 jehousley Exp $
|
||||||
|
.\"
|
||||||
|
.TH libssh2_channel_subsystem 3 "20 Feb 2010" "libssh2 1.2.4" "libssh2 manual"
|
||||||
|
.SH NAME
|
||||||
|
libssh2_channel_subsystem - convenience macro for \fIlibssh2_channel_process_startup(3)\fP calls
|
||||||
|
.SH SYNOPSIS
|
||||||
|
#include <libssh2.h>
|
||||||
|
|
||||||
|
libssh2_channel_subsystem(arguments)
|
||||||
|
|
||||||
|
.SH DESCRIPTION
|
||||||
|
This is a macro defined in a public libssh2 header file that is using the
|
||||||
|
underlying function \fIlibssh2_channel_process_startup(3)\fP.
|
||||||
|
.SH RETURN VALUE
|
||||||
|
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
|
19
docs/libssh2_channel_window_read.3
Normal file
19
docs/libssh2_channel_window_read.3
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
.\" $Id: template.3,v 1.4 2007/06/13 16:41:33 jehousley Exp $
|
||||||
|
.\"
|
||||||
|
.TH libssh2_channel_window_read 3 "20 Feb 2010" "libssh2 1.2.4" "libssh2 manual"
|
||||||
|
.SH NAME
|
||||||
|
libssh2_channel_window_read - convenience macro for \fIlibssh2_channel_window_read_ex(3)\fP calls
|
||||||
|
.SH SYNOPSIS
|
||||||
|
#include <libssh2.h>
|
||||||
|
|
||||||
|
libssh2_channel_window_read(arguments)
|
||||||
|
|
||||||
|
.SH DESCRIPTION
|
||||||
|
This is a macro defined in a public libssh2 header file that is using the
|
||||||
|
underlying function \fIlibssh2_channel_window_read_ex(3)\fP.
|
||||||
|
.SH RETURN VALUE
|
||||||
|
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
|
19
docs/libssh2_channel_window_write.3
Normal file
19
docs/libssh2_channel_window_write.3
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
.\" $Id: template.3,v 1.4 2007/06/13 16:41:33 jehousley Exp $
|
||||||
|
.\"
|
||||||
|
.TH libssh2_channel_window_write 3 "20 Feb 2010" "libssh2 1.2.4" "libssh2 manual"
|
||||||
|
.SH NAME
|
||||||
|
libssh2_channel_window_write - convenience macro for \fIlibssh2_channel_window_write_ex(3)\fP calls
|
||||||
|
.SH SYNOPSIS
|
||||||
|
#include <libssh2.h>
|
||||||
|
|
||||||
|
libssh2_channel_window_write(arguments)
|
||||||
|
|
||||||
|
.SH DESCRIPTION
|
||||||
|
This is a macro defined in a public libssh2 header file that is using the
|
||||||
|
underlying function \fIlibssh2_channel_window_write_ex(3)\fP.
|
||||||
|
.SH RETURN VALUE
|
||||||
|
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
|
19
docs/libssh2_channel_write.3
Normal file
19
docs/libssh2_channel_write.3
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
.\" $Id: template.3,v 1.4 2007/06/13 16:41:33 jehousley Exp $
|
||||||
|
.\"
|
||||||
|
.TH libssh2_channel_write 3 "20 Feb 2010" "libssh2 1.2.4" "libssh2 manual"
|
||||||
|
.SH NAME
|
||||||
|
libssh2_channel_write - convenience macro for \fIlibssh2_channel_write_ex(3)\fP calls
|
||||||
|
.SH SYNOPSIS
|
||||||
|
#include <libssh2.h>
|
||||||
|
|
||||||
|
libssh2_channel_write(arguments)
|
||||||
|
|
||||||
|
.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.
|
||||||
|
.SH RETURN VALUE
|
||||||
|
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
|
19
docs/libssh2_channel_write_stderr.3
Normal file
19
docs/libssh2_channel_write_stderr.3
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
.\" $Id: template.3,v 1.4 2007/06/13 16:41:33 jehousley Exp $
|
||||||
|
.\"
|
||||||
|
.TH libssh2_channel_write_stderr 3 "20 Feb 2010" "libssh2 1.2.4" "libssh2 manual"
|
||||||
|
.SH NAME
|
||||||
|
libssh2_channel_write_stderr - convenience macro for \fIlibssh2_channel_write_ex(3)\fP calls
|
||||||
|
.SH SYNOPSIS
|
||||||
|
#include <libssh2.h>
|
||||||
|
|
||||||
|
libssh2_channel_write_stderr(arguments)
|
||||||
|
|
||||||
|
.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.
|
||||||
|
.SH RETURN VALUE
|
||||||
|
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
|
19
docs/libssh2_channel_x11_req.3
Normal file
19
docs/libssh2_channel_x11_req.3
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
.\" $Id: template.3,v 1.4 2007/06/13 16:41:33 jehousley Exp $
|
||||||
|
.\"
|
||||||
|
.TH libssh2_channel_x11_req 3 "20 Feb 2010" "libssh2 1.2.4" "libssh2 manual"
|
||||||
|
.SH NAME
|
||||||
|
libssh2_channel_x11_req - convenience macro for \fIlibssh2_channel_x11_req_ex(3)\fP calls
|
||||||
|
.SH SYNOPSIS
|
||||||
|
#include <libssh2.h>
|
||||||
|
|
||||||
|
libssh2_channel_x11_req(arguments)
|
||||||
|
|
||||||
|
.SH DESCRIPTION
|
||||||
|
This is a macro defined in a public libssh2 header file that is using the
|
||||||
|
underlying function \fIlibssh2_channel_x11_req_ex(3)\fP.
|
||||||
|
.SH RETURN VALUE
|
||||||
|
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
|
14
docs/libssh2_exit.3
Normal file
14
docs/libssh2_exit.3
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
.TH libssh2_exit 3 "19 Mar 2010" "libssh2 1.2.5" "libssh2 manual"
|
||||||
|
.SH NAME
|
||||||
|
libssh2_exit - global library deinitialization
|
||||||
|
.SH SYNOPSIS
|
||||||
|
#include <libssh2.h>
|
||||||
|
|
||||||
|
int
|
||||||
|
libssh2_exit(void);
|
||||||
|
|
||||||
|
.SH DESCRIPTION
|
||||||
|
Exit the libssh2 functions and free's all memory used internal.
|
||||||
|
|
||||||
|
.SH SEE ALSO
|
||||||
|
.BR libssh2_init(3)
|
21
docs/libssh2_init.3
Normal file
21
docs/libssh2_init.3
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
.TH libssh2_init 3 "19 Mar 2010" "libssh2 1.2.5" "libssh2 manual"
|
||||||
|
.SH NAME
|
||||||
|
libssh2_init - global library initialization
|
||||||
|
.SH SYNOPSIS
|
||||||
|
#include <libssh2.h>
|
||||||
|
|
||||||
|
#define LIBSSH2_INIT_NO_CRYPTO 0x0001
|
||||||
|
|
||||||
|
int
|
||||||
|
libssh2_init(int flags);
|
||||||
|
|
||||||
|
.SH DESCRIPTION
|
||||||
|
Initialize the libssh2 functions. This typically initialize the
|
||||||
|
crypto library. It uses a global state, and is not thread safe -- you
|
||||||
|
must make sure this function is not called concurrently.
|
||||||
|
|
||||||
|
.SH RETURN VALUE
|
||||||
|
Returns 0 if succeeded, or a negative value for error.
|
||||||
|
|
||||||
|
.SH SEE ALSO
|
||||||
|
.BR libssh2_exit(3)
|
@@ -13,6 +13,11 @@ int libssh2_knownhost_add(LIBSSH2_KNOWNHOSTS *hosts,
|
|||||||
int typemask,
|
int typemask,
|
||||||
struct libssh2_knownhost **store);
|
struct libssh2_knownhost **store);
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
|
We discourage use of this function as of libssh2 1.2.5. Instead we strongly
|
||||||
|
urge users to sue \fIlibssh2_knownhost_addc(3)\fP instead, which as a more
|
||||||
|
complete API. \fIlibssh2_knownhost_add(3)\fP is subject for removal in a
|
||||||
|
future release.
|
||||||
|
|
||||||
Adds a known host to the collection of known hosts identified by the 'hosts'
|
Adds a known host to the collection of known hosts identified by the 'hosts'
|
||||||
handle.
|
handle.
|
||||||
|
|
||||||
@@ -51,8 +56,10 @@ this pointer.
|
|||||||
Returns a regular libssh2 error code, where negative values are error codes
|
Returns a regular libssh2 error code, where negative values are error codes
|
||||||
and 0 indicates success.
|
and 0 indicates success.
|
||||||
.SH AVAILABILITY
|
.SH AVAILABILITY
|
||||||
Added in libssh2 1.2
|
Added in libssh2 1.2, deprecated since libssh2 1.2.5. Use
|
||||||
|
\fIlibssh2_knownhost_addc(3)\fP instead!
|
||||||
.SH SEE ALSO
|
.SH SEE ALSO
|
||||||
.BR libssh2_knownhost_init(3)
|
.BR libssh2_knownhost_init(3)
|
||||||
.BR libssh2_knownhost_free(3)
|
.BR libssh2_knownhost_free(3)
|
||||||
.BR libssh2_knownhost_check(3)
|
.BR libssh2_knownhost_check(3)
|
||||||
|
.BR libssh2_knownhost_addc(3)
|
||||||
|
63
docs/libssh2_knownhost_addc.3
Normal file
63
docs/libssh2_knownhost_addc.3
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
|
||||||
|
.\" Copyright (c) 2009, 2010 by Daniel Stenberg
|
||||||
|
.\"
|
||||||
|
.TH libssh2_knownhost_add 3 "28 May 2009" "libssh2 1.2" "libssh2 manual"
|
||||||
|
.SH NAME
|
||||||
|
libssh2_knownhost_add - add a known host
|
||||||
|
.SH SYNOPSIS
|
||||||
|
#include <libssh2.h>
|
||||||
|
|
||||||
|
int libssh2_knownhost_add(LIBSSH2_KNOWNHOSTS *hosts,
|
||||||
|
char *host, char *salt,
|
||||||
|
char *key, size_t keylen,
|
||||||
|
const char *comment, size_t commentlen,
|
||||||
|
int typemask,
|
||||||
|
struct libssh2_knownhost **store);
|
||||||
|
.SH DESCRIPTION
|
||||||
|
Adds a known host to the collection of known hosts identified by the 'hosts'
|
||||||
|
handle.
|
||||||
|
|
||||||
|
\fIhost\fP is a pointer the host name in plain text or hashed. If hashed, it
|
||||||
|
must be provided base64 encoded. The host name can be the IP numerical address
|
||||||
|
of the host or the full name.
|
||||||
|
|
||||||
|
\fIsalt\P is a pointer to the salt used for the host hashing, if the host is
|
||||||
|
provided hashed. If the host is provided in plain text, salt has no meaning.
|
||||||
|
The salt has to be provided base64 encoded with a trailing zero byte.
|
||||||
|
|
||||||
|
\fIkey\fP is a pointer to the key for the given host.
|
||||||
|
|
||||||
|
\fIkeylen\fP is the total size in bytes of the key pointed to by the \fIkey\fP
|
||||||
|
argument
|
||||||
|
|
||||||
|
\fIcomment\fP is a pointer to a comment for the key.
|
||||||
|
|
||||||
|
\fIcommentlen\fP is the total size in bytes of the comment pointed to by the \fIcomment\fP argument
|
||||||
|
|
||||||
|
\fItypemask\fP is a bitmask that specifies format and info about the data
|
||||||
|
passed to this function. Specificly, it details what format the host name is,
|
||||||
|
what format the key is and what key type it is.
|
||||||
|
|
||||||
|
The host name is given as one of the following types:
|
||||||
|
LIBSSH2_KNOWNHOST_TYPE_PLAIN, LIBSSH2_KNOWNHOST_TYPE_SHA1 or
|
||||||
|
LIBSSH2_KNOWNHOST_TYPE_CUSTOM.
|
||||||
|
|
||||||
|
The key is encoded using one of the following encodings:
|
||||||
|
LIBSSH2_KNOWNHOST_KEYENC_RAW or LIBSSH2_KNOWNHOST_KEYENC_BASE64.
|
||||||
|
|
||||||
|
The key is using one of these algorithms:
|
||||||
|
LIBSSH2_KNOWNHOST_KEY_RSA1, LIBSSH2_KNOWNHOST_KEY_SSHRSA or
|
||||||
|
LIBSSH2_KNOWNHOST_KEY_SSHDSS.
|
||||||
|
|
||||||
|
\fIstore\fP should point to a pointer that gets filled in to point to the
|
||||||
|
known host data after the addition. NULL can be passed if you don't care about
|
||||||
|
this pointer.
|
||||||
|
.SH RETURN VALUE
|
||||||
|
Returns a regular libssh2 error code, where negative values are error codes
|
||||||
|
and 0 indicates success.
|
||||||
|
.SH AVAILABILITY
|
||||||
|
Added in libssh2 1.2.5
|
||||||
|
.SH SEE ALSO
|
||||||
|
.BR libssh2_knownhost_init(3)
|
||||||
|
.BR libssh2_knownhost_free(3)
|
||||||
|
.BR libssh2_knownhost_check(3)
|
20
docs/libssh2_knownhost_free.3
Normal file
20
docs/libssh2_knownhost_free.3
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
.\"
|
||||||
|
.\" Copyright (c) 2009 by Daniel Stenberg
|
||||||
|
.\"
|
||||||
|
.TH libssh2_knownhost_free 3 "28 May 2009" "libssh2 1.2" "libssh2 manual"
|
||||||
|
.SH NAME
|
||||||
|
libssh2_knownhost_free - free a collection of known hosts
|
||||||
|
.SH SYNOPSIS
|
||||||
|
#include <libssh2.h>
|
||||||
|
|
||||||
|
void libssh2_knownhost_free(LIBSSH2_KNOWNHOSTS *hosts);
|
||||||
|
.SH DESCRIPTION
|
||||||
|
Free a collection of known hosts.
|
||||||
|
.SH RETURN VALUE
|
||||||
|
None.
|
||||||
|
.SH AVAILABILITY
|
||||||
|
Added in libssh2 1.2
|
||||||
|
.SH SEE ALSO
|
||||||
|
.BR libssh2_knownhost_init(3)
|
||||||
|
.BR libssh2_knownhost_add(3)
|
||||||
|
.BR libssh2_knownhost_check(3)
|
@@ -11,6 +11,9 @@ LIBSSH2_KNOWNHOSTS *libssh2_knownhost_init(LIBSSH2_SESSION *session);
|
|||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
Init a collection of known hosts for this session. Returns the handle to an
|
Init a collection of known hosts for this session. Returns the handle to an
|
||||||
internal representation of a known host collection.
|
internal representation of a known host collection.
|
||||||
|
|
||||||
|
Call \fBlibssh2_knownhost_free(3)\fP to free the collection again after you're
|
||||||
|
doing using it.
|
||||||
.SH RETURN VALUE
|
.SH RETURN VALUE
|
||||||
Returns a handle pointer or NULL if something went wrong. The returned handle
|
Returns a handle pointer or NULL if something went wrong. The returned handle
|
||||||
is used as input to all other known host related functions libssh2 provides.
|
is used as input to all other known host related functions libssh2 provides.
|
||||||
|
19
docs/libssh2_publickey_add.3
Normal file
19
docs/libssh2_publickey_add.3
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
.\" $Id: template.3,v 1.4 2007/06/13 16:41:33 jehousley Exp $
|
||||||
|
.\"
|
||||||
|
.TH libssh2_publickey_add 3 "20 Feb 2010" "libssh2 1.2.4" "libssh2 manual"
|
||||||
|
.SH NAME
|
||||||
|
libssh2_publickey_add - convenience macro for \fIlibssh2_publickey_add_ex(3)\fP calls
|
||||||
|
.SH SYNOPSIS
|
||||||
|
#include <libssh2.h>
|
||||||
|
|
||||||
|
libssh2_publickey_add(arguments)
|
||||||
|
|
||||||
|
.SH DESCRIPTION
|
||||||
|
This is a macro defined in a public libssh2 header file that is using the
|
||||||
|
underlying function \fIlibssh2_publickey_add_ex(3)\fP.
|
||||||
|
.SH RETURN VALUE
|
||||||
|
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
|
19
docs/libssh2_publickey_remove.3
Normal file
19
docs/libssh2_publickey_remove.3
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
.\" $Id: template.3,v 1.4 2007/06/13 16:41:33 jehousley Exp $
|
||||||
|
.\"
|
||||||
|
.TH libssh2_publickey_remove 3 "20 Feb 2010" "libssh2 1.2.4" "libssh2 manual"
|
||||||
|
.SH NAME
|
||||||
|
libssh2_publickey_remove - convenience macro for \fIlibssh2_publickey_remove_ex(3)\fP calls
|
||||||
|
.SH SYNOPSIS
|
||||||
|
#include <libssh2.h>
|
||||||
|
|
||||||
|
libssh2_publickey_remove(arguments)
|
||||||
|
|
||||||
|
.SH DESCRIPTION
|
||||||
|
This is a macro defined in a public libssh2 header file that is using the
|
||||||
|
underlying function \fIlibssh2_publickey_remove_ex(3)\fP.
|
||||||
|
.SH RETURN VALUE
|
||||||
|
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
|
@@ -13,7 +13,8 @@ libssh2_scp_recv(LIBSSH2_SESSION *session, const char *path, struct stat *sb);
|
|||||||
\fIsession\fP - Session instance as returned by
|
\fIsession\fP - Session instance as returned by
|
||||||
.BR libssh2_session_init_ex(3)
|
.BR libssh2_session_init_ex(3)
|
||||||
|
|
||||||
\fIpath\fP - Full path and filename of file to transfer
|
\fIpath\fP - Full path and filename of file to transfer. That is the remote
|
||||||
|
file name.
|
||||||
|
|
||||||
\fIsb\fP - Populated with remote file's size, mode, mtime, and atime
|
\fIsb\fP - Populated with remote file's size, mode, mtime, and atime
|
||||||
|
|
||||||
|
19
docs/libssh2_scp_send.3
Normal file
19
docs/libssh2_scp_send.3
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
.\" $Id: template.3,v 1.4 2007/06/13 16:41:33 jehousley Exp $
|
||||||
|
.\"
|
||||||
|
.TH libssh2_scp_send 3 "20 Feb 2010" "libssh2 1.2.4" "libssh2 manual"
|
||||||
|
.SH NAME
|
||||||
|
libssh2_scp_send - convenience macro for \fIlibssh2_scp_send_ex(3)\fP calls
|
||||||
|
.SH SYNOPSIS
|
||||||
|
#include <libssh2.h>
|
||||||
|
|
||||||
|
libssh2_scp_send(arguments)
|
||||||
|
|
||||||
|
.SH DESCRIPTION
|
||||||
|
This is a macro defined in a public libssh2 header file that is using the
|
||||||
|
underlying function \fIlibssh2_scp_send_ex(3)\fP.
|
||||||
|
.SH RETURN VALUE
|
||||||
|
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
|
@@ -12,7 +12,8 @@ libssh2_scp_send_ex(LIBSSH2_SESSION *session, const char *path, int mode, size_t
|
|||||||
\fIsession\fP - Session instance as returned by
|
\fIsession\fP - Session instance as returned by
|
||||||
.BR libssh2_session_init_ex(3)
|
.BR libssh2_session_init_ex(3)
|
||||||
|
|
||||||
\fIpath\fP - Full path and filename of file to transfer
|
\fIpath\fP - Full path and filename of file to transfer to. That is the remote
|
||||||
|
file name.
|
||||||
|
|
||||||
\fImode\fP - File access mode to create file with
|
\fImode\fP - File access mode to create file with
|
||||||
|
|
||||||
|
19
docs/libssh2_session_disconnect.3
Normal file
19
docs/libssh2_session_disconnect.3
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
.\" $Id: template.3,v 1.4 2007/06/13 16:41:33 jehousley Exp $
|
||||||
|
.\"
|
||||||
|
.TH libssh2_session_disconnect 3 "20 Feb 2010" "libssh2 1.2.4" "libssh2 manual"
|
||||||
|
.SH NAME
|
||||||
|
libssh2_session_disconnect - convenience macro for \fIlibssh2_session_disconnect_ex(3)\fP calls
|
||||||
|
.SH SYNOPSIS
|
||||||
|
#include <libssh2.h>
|
||||||
|
|
||||||
|
libssh2_session_disconnect(arguments)
|
||||||
|
|
||||||
|
.SH DESCRIPTION
|
||||||
|
This is a macro defined in a public libssh2 header file that is using the
|
||||||
|
underlying function \fIlibssh2_session_disconnect_ex(3)\fP.
|
||||||
|
.SH RETURN VALUE
|
||||||
|
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
|
@@ -9,7 +9,7 @@ libssh2_session_free - frees resources associated with a session instance
|
|||||||
int
|
int
|
||||||
libssh2_session_free(LIBSSH2_SESSION *session);
|
libssh2_session_free(LIBSSH2_SESSION *session);
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
Frees resources associated with a session instance. Typically called after
|
Frees all resources associated with a session instance. Typically called after
|
||||||
.BR libssh2_session_disconnect_ex(3)
|
.BR libssh2_session_disconnect_ex(3)
|
||||||
.SH RETURN VALUE
|
.SH RETURN VALUE
|
||||||
Return 0 on success or negative on failure. It returns
|
Return 0 on success or negative on failure. It returns
|
||||||
|
19
docs/libssh2_session_init.3
Normal file
19
docs/libssh2_session_init.3
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
.\" $Id: template.3,v 1.4 2007/06/13 16:41:33 jehousley Exp $
|
||||||
|
.\"
|
||||||
|
.TH libssh2_session_init 3 "20 Feb 2010" "libssh2 1.2.4" "libssh2 manual"
|
||||||
|
.SH NAME
|
||||||
|
libssh2_session_init - convenience macro for \fIlibssh2_session_init_ex(3)\fP calls
|
||||||
|
.SH SYNOPSIS
|
||||||
|
#include <libssh2.h>
|
||||||
|
|
||||||
|
libssh2_session_init(arguments)
|
||||||
|
|
||||||
|
.SH DESCRIPTION
|
||||||
|
This is a macro defined in a public libssh2 header file that is using the
|
||||||
|
underlying function \fIlibssh2_session_init_ex(3)\fP.
|
||||||
|
.SH RETURN VALUE
|
||||||
|
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
|
19
docs/libssh2_sftp_close.3
Normal file
19
docs/libssh2_sftp_close.3
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
.\" $Id: template.3,v 1.4 2007/06/13 16:41:33 jehousley Exp $
|
||||||
|
.\"
|
||||||
|
.TH libssh2_sftp_close 3 "20 Feb 2010" "libssh2 1.2.4" "libssh2 manual"
|
||||||
|
.SH NAME
|
||||||
|
libssh2_sftp_close - convenience macro for \fIlibssh2_sftp_close_handle(3)\fP calls
|
||||||
|
.SH SYNOPSIS
|
||||||
|
#include <libssh2.h>
|
||||||
|
|
||||||
|
libssh2_sftp_close(arguments)
|
||||||
|
|
||||||
|
.SH DESCRIPTION
|
||||||
|
This is a macro defined in a public libssh2 header file that is using the
|
||||||
|
underlying function \fIlibssh2_sftp_close_handle(3)\fP.
|
||||||
|
.SH RETURN VALUE
|
||||||
|
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
|
19
docs/libssh2_sftp_closedir.3
Normal file
19
docs/libssh2_sftp_closedir.3
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
.\" $Id: template.3,v 1.4 2007/06/13 16:41:33 jehousley Exp $
|
||||||
|
.\"
|
||||||
|
.TH libssh2_sftp_closedir 3 "20 Feb 2010" "libssh2 1.2.4" "libssh2 manual"
|
||||||
|
.SH NAME
|
||||||
|
libssh2_sftp_closedir - convenience macro for \fIlibssh2_sftp_close_handle(3)\fP calls
|
||||||
|
.SH SYNOPSIS
|
||||||
|
#include <libssh2.h>
|
||||||
|
|
||||||
|
libssh2_sftp_closedir(arguments)
|
||||||
|
|
||||||
|
.SH DESCRIPTION
|
||||||
|
This is a macro defined in a public libssh2 header file that is using the
|
||||||
|
underlying function \fIlibssh2_sftp_close_handle(3)\fP.
|
||||||
|
.SH RETURN VALUE
|
||||||
|
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
|
19
docs/libssh2_sftp_fsetstat.3
Normal file
19
docs/libssh2_sftp_fsetstat.3
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
.\" $Id: template.3,v 1.4 2007/06/13 16:41:33 jehousley Exp $
|
||||||
|
.\"
|
||||||
|
.TH libssh2_sftp_fsetstat 3 "20 Feb 2010" "libssh2 1.2.4" "libssh2 manual"
|
||||||
|
.SH NAME
|
||||||
|
libssh2_sftp_fsetstat - convenience macro for \fIlibssh2_sftp_fstat_ex(3)\fP calls
|
||||||
|
.SH SYNOPSIS
|
||||||
|
#include <libssh2.h>
|
||||||
|
|
||||||
|
libssh2_sftp_fsetstat(arguments)
|
||||||
|
|
||||||
|
.SH DESCRIPTION
|
||||||
|
This is a macro defined in a public libssh2 header file that is using the
|
||||||
|
underlying function \fIlibssh2_sftp_fstat_ex(3)\fP.
|
||||||
|
.SH RETURN VALUE
|
||||||
|
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
|
19
docs/libssh2_sftp_fstat.3
Normal file
19
docs/libssh2_sftp_fstat.3
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
.\" $Id: template.3,v 1.4 2007/06/13 16:41:33 jehousley Exp $
|
||||||
|
.\"
|
||||||
|
.TH libssh2_sftp_fstat 3 "20 Feb 2010" "libssh2 1.2.4" "libssh2 manual"
|
||||||
|
.SH NAME
|
||||||
|
libssh2_sftp_fstat - convenience macro for \fIlibssh2_sftp_fstat_ex(3)\fP calls
|
||||||
|
.SH SYNOPSIS
|
||||||
|
#include <libssh2.h>
|
||||||
|
|
||||||
|
libssh2_sftp_fstat(arguments)
|
||||||
|
|
||||||
|
.SH DESCRIPTION
|
||||||
|
This is a macro defined in a public libssh2 header file that is using the
|
||||||
|
underlying function \fIlibssh2_sftp_fstat_ex(3)\fP.
|
||||||
|
.SH RETURN VALUE
|
||||||
|
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
|
@@ -2,32 +2,88 @@
|
|||||||
.\"
|
.\"
|
||||||
.TH libssh2_sftp_fstat_ex 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
|
.TH libssh2_sftp_fstat_ex 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
libssh2_sftp_fstat_ex - get or set attributes on a file handle
|
libssh2_sftp_fstat_ex - get or set attributes on an SFTP file handle
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
|
.nf
|
||||||
#include <libssh2.h>
|
#include <libssh2.h>
|
||||||
#include <libssh2_sftp.h>
|
#include <libssh2_sftp.h>
|
||||||
|
|
||||||
int
|
int
|
||||||
libssh2_sftp_fstat_ex(LIBSSH2_SFTP_HANDLE *handle, LIBSSH2_SFTP_ATTRIBUTES *attrs, int setstat)
|
libssh2_sftp_fstat_ex(LIBSSH2_SFTP_HANDLE *handle,
|
||||||
|
LIBSSH2_SFTP_ATTRIBUTES *attrs, int setstat)
|
||||||
int
|
|
||||||
libssh2_sftp_fstat(LIBSSH2_SFTP_HANDLE *handle, LIBSSH2_SFTP_ATTRIBUTES *attrs)
|
|
||||||
|
|
||||||
int
|
|
||||||
libssh2_sftp_fsetstat(LIBSSH2_SFTP_HANDLE *handle, LIBSSH2_SFTP_ATTRIBUTES *attrs)
|
|
||||||
|
|
||||||
|
#define libbssh2_sftp_fstat(handle, attrs) \\
|
||||||
|
libssh2_sftp_fstat_ex((handle), (attrs), 0)
|
||||||
|
#define libssh2_sftp_fsetstat(handle, attrs) \\
|
||||||
|
libssh2_sftp_fstat_ex((handle), (attrs), 1)
|
||||||
|
.fi
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
\fIhandle\fP - SFTP File Handle as returned by
|
\fIhandle\fP - SFTP File Handle as returned by
|
||||||
.BR libssh2_sftp_open_ex(3)
|
.BR libssh2_sftp_open_ex(3)
|
||||||
|
|
||||||
\fIattrs\fP - Pointer to attribute structure to set file metadata
|
\fIattrs\fP - Pointer to an LIBSSH2_SFTP_ATTRIBUTES structure to set file
|
||||||
from or into depending on the value of setstat.
|
metadata from or into depending on the value of setstat.
|
||||||
|
|
||||||
\fIsetstat\fP - When non-zero, the file's metadata will be updated
|
\fIsetstat\fP - When non-zero, the file's metadata will be updated
|
||||||
with the data found in attrs according to the values of attrs->flags
|
with the data found in attrs according to the values of attrs->flags
|
||||||
and other relevant member attributes.
|
and other relevant member attributes.
|
||||||
|
|
||||||
Get or Set statbuf type data for a given LIBSSH2_SFTP_HANDLE instance.
|
Get or Set statbuf type data for a given LIBSSH2_SFTP_HANDLE instance.
|
||||||
|
.SH DATA TYPES
|
||||||
|
LIBSSH2_SFTP_ATTRIBUTES is a typedefed struct that is defined as below
|
||||||
|
|
||||||
|
.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;
|
||||||
|
|
||||||
|
/* size of file, in bytes */
|
||||||
|
libssh2_uint64_t filesize;
|
||||||
|
|
||||||
|
/* numerical representation of the user and group owner of
|
||||||
|
* the file
|
||||||
|
*/
|
||||||
|
unsigned long uid, gid;
|
||||||
|
|
||||||
|
/* bitmask of permissions */
|
||||||
|
unsigned long permissions;
|
||||||
|
|
||||||
|
/* access time and modified time of file */
|
||||||
|
unsigned long atime, mtime;
|
||||||
|
};
|
||||||
|
.fi
|
||||||
|
|
||||||
|
You will find a full set of defines and macros to identify flags and
|
||||||
|
permissions on the \fBlibssh2_sftp.h\fP header file, but some of the
|
||||||
|
most common ones are:
|
||||||
|
|
||||||
|
To check for specific user permissons, the set of defines are in the
|
||||||
|
pattern LIBSSH2_SFTP_S_I<action><who> where <action> is R, W or X for
|
||||||
|
read, write and excutable and <who> is USR, GRP and OTH for user,
|
||||||
|
group and other. So, you check for a user readable file, use the bit
|
||||||
|
\fILIBSSH2_SFTP_S_IRUSR\fP while you want to see if it is executable
|
||||||
|
for other, you use \fILIBSSH2_SFTP_S_IXOTH\fP and so on.
|
||||||
|
|
||||||
|
To check for specific file types, you would previously (before libssh2
|
||||||
|
1.2.5) use the standard posix S_IS***() macros, but since 1.2.5
|
||||||
|
libssh2 offers its own set of macros for this functionality:
|
||||||
|
.IP LIBSSH2_SFTP_S_ISLNK
|
||||||
|
Test for a symbolic link
|
||||||
|
.IP LIBSSH2_SFTP_S_ISREG
|
||||||
|
Test for a regular file
|
||||||
|
.IP LIBSSH2_SFTP_S_ISDIR
|
||||||
|
Test for a directory
|
||||||
|
.IP LIBSSH2_SFTP_S_ISCHR
|
||||||
|
Test for a character special file
|
||||||
|
.IP LIBSSH2_SFTP_S_ISBLK
|
||||||
|
Test for a block special file
|
||||||
|
.IP LIBSSH2_SFTP_S_ISFIFO
|
||||||
|
Test for a pipe or FIFO special file
|
||||||
|
.IP LIBSSH2_SFTP_S_ISSOCK
|
||||||
|
Test for a socket
|
||||||
.SH RETURN VALUE
|
.SH RETURN VALUE
|
||||||
Return 0 on success or negative on failure. It returns
|
Return 0 on success or negative on failure. It returns
|
||||||
LIBSSH2_ERROR_EAGAIN when it would otherwise block. While
|
LIBSSH2_ERROR_EAGAIN when it would otherwise block. While
|
||||||
@@ -42,5 +98,9 @@ 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
|
\fILIBSSH2_ERROR_SFTP_PROTOCOL\fP - An invalid SFTP protocol response was
|
||||||
received on the socket, or an SFTP operation caused an errorcode to
|
received on the socket, or an SFTP operation caused an errorcode to
|
||||||
be returned by the server.
|
be returned by the server.
|
||||||
|
.SH AVAILABILITY
|
||||||
|
This function has been around since forever, but most of the
|
||||||
|
LIBSSH2_SFTP_S_* defines were introduced in libssh2 0.14 and the
|
||||||
|
LIBSSH2_SFTP_S_IS***() macros were introduced in libssh2 1.2.5.
|
||||||
.SH SEE ALSO
|
.SH SEE ALSO
|
||||||
.BR libssh2_sftp_open_ex(3)
|
.BR libssh2_sftp_open_ex(3)
|
||||||
|
19
docs/libssh2_sftp_lstat.3
Normal file
19
docs/libssh2_sftp_lstat.3
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
.\" $Id: template.3,v 1.4 2007/06/13 16:41:33 jehousley Exp $
|
||||||
|
.\"
|
||||||
|
.TH libssh2_sftp_lstat 3 "20 Feb 2010" "libssh2 1.2.4" "libssh2 manual"
|
||||||
|
.SH NAME
|
||||||
|
libssh2_sftp_lstat - convenience macro for \fIlibssh2_sftp_stat_ex(3)\fP calls
|
||||||
|
.SH SYNOPSIS
|
||||||
|
#include <libssh2.h>
|
||||||
|
|
||||||
|
libssh2_sftp_lstat(arguments)
|
||||||
|
|
||||||
|
.SH DESCRIPTION
|
||||||
|
This is a macro defined in a public libssh2 header file that is using the
|
||||||
|
underlying function \fIlibssh2_sftp_stat_ex(3)\fP.
|
||||||
|
.SH RETURN VALUE
|
||||||
|
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
|
19
docs/libssh2_sftp_mkdir.3
Normal file
19
docs/libssh2_sftp_mkdir.3
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
.\" $Id: template.3,v 1.4 2007/06/13 16:41:33 jehousley Exp $
|
||||||
|
.\"
|
||||||
|
.TH libssh2_sftp_mkdir 3 "20 Feb 2010" "libssh2 1.2.4" "libssh2 manual"
|
||||||
|
.SH NAME
|
||||||
|
libssh2_sftp_mkdir - convenience macro for \fIlibssh2_sftp_mkdir_ex(3)\fP calls
|
||||||
|
.SH SYNOPSIS
|
||||||
|
#include <libssh2.h>
|
||||||
|
|
||||||
|
libssh2_sftp_mkdir(arguments)
|
||||||
|
|
||||||
|
.SH DESCRIPTION
|
||||||
|
This is a macro defined in a public libssh2 header file that is using the
|
||||||
|
underlying function \fIlibssh2_sftp_mkdir_ex(3)\fP.
|
||||||
|
.SH RETURN VALUE
|
||||||
|
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
|
19
docs/libssh2_sftp_open.3
Normal file
19
docs/libssh2_sftp_open.3
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
.\" $Id: template.3,v 1.4 2007/06/13 16:41:33 jehousley Exp $
|
||||||
|
.\"
|
||||||
|
.TH libssh2_sftp_open 3 "20 Feb 2010" "libssh2 1.2.4" "libssh2 manual"
|
||||||
|
.SH NAME
|
||||||
|
libssh2_sftp_open - convenience macro for \fIlibssh2_sftp_open_ex(3)\fP calls
|
||||||
|
.SH SYNOPSIS
|
||||||
|
#include <libssh2.h>
|
||||||
|
|
||||||
|
libssh2_sftp_open(arguments)
|
||||||
|
|
||||||
|
.SH DESCRIPTION
|
||||||
|
This is a macro defined in a public libssh2 header file that is using the
|
||||||
|
underlying function \fIlibssh2_sftp_open_ex(3)\fP.
|
||||||
|
.SH RETURN VALUE
|
||||||
|
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
|
19
docs/libssh2_sftp_opendir.3
Normal file
19
docs/libssh2_sftp_opendir.3
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
.\" $Id: template.3,v 1.4 2007/06/13 16:41:33 jehousley Exp $
|
||||||
|
.\"
|
||||||
|
.TH libssh2_sftp_opendir 3 "20 Feb 2010" "libssh2 1.2.4" "libssh2 manual"
|
||||||
|
.SH NAME
|
||||||
|
libssh2_sftp_opendir - convenience macro for \fIlibssh2_sftp_open_ex(3)\fP calls
|
||||||
|
.SH SYNOPSIS
|
||||||
|
#include <libssh2.h>
|
||||||
|
|
||||||
|
libssh2_sftp_opendir(arguments)
|
||||||
|
|
||||||
|
.SH DESCRIPTION
|
||||||
|
This is a macro defined in a public libssh2 header file that is using the
|
||||||
|
underlying function \fIlibssh2_sftp_open_ex(3)\fP.
|
||||||
|
.SH RETURN VALUE
|
||||||
|
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
|
19
docs/libssh2_sftp_readdir.3
Normal file
19
docs/libssh2_sftp_readdir.3
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
.\" $Id: template.3,v 1.4 2007/06/13 16:41:33 jehousley Exp $
|
||||||
|
.\"
|
||||||
|
.TH libssh2_sftp_readdir 3 "20 Feb 2010" "libssh2 1.2.4" "libssh2 manual"
|
||||||
|
.SH NAME
|
||||||
|
libssh2_sftp_readdir - convenience macro for \fIlibssh2_sftp_readdir_exa(3)\fP calls
|
||||||
|
.SH SYNOPSIS
|
||||||
|
#include <libssh2.h>
|
||||||
|
|
||||||
|
libssh2_sftp_readdir(arguments)
|
||||||
|
|
||||||
|
.SH DESCRIPTION
|
||||||
|
This is a macro defined in a public libssh2 header file that is using the
|
||||||
|
underlying function \fIlibssh2_sftp_readdir_exa(3)\fP.
|
||||||
|
.SH RETURN VALUE
|
||||||
|
See \fIlibssh2_sftp_readdir_exa(3)\fP
|
||||||
|
.SH ERRORS
|
||||||
|
See \fIlibssh2_sftp_readdir_exa(3)\fP
|
||||||
|
.SH SEE ALSO
|
||||||
|
.BR \fIlibssh2_sftp_readdir_exa(3)\fP
|
19
docs/libssh2_sftp_readlink.3
Normal file
19
docs/libssh2_sftp_readlink.3
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
.\" $Id: template.3,v 1.4 2007/06/13 16:41:33 jehousley Exp $
|
||||||
|
.\"
|
||||||
|
.TH libssh2_sftp_readlink 3 "20 Feb 2010" "libssh2 1.2.4" "libssh2 manual"
|
||||||
|
.SH NAME
|
||||||
|
libssh2_sftp_readlink - convenience macro for \fIlibssh2_sftp_symlink_ex(3)\fP calls
|
||||||
|
.SH SYNOPSIS
|
||||||
|
#include <libssh2.h>
|
||||||
|
|
||||||
|
libssh2_sftp_readlink(arguments)
|
||||||
|
|
||||||
|
.SH DESCRIPTION
|
||||||
|
This is a macro defined in a public libssh2 header file that is using the
|
||||||
|
underlying function \fIlibssh2_sftp_symlink_ex(3)\fP.
|
||||||
|
.SH RETURN VALUE
|
||||||
|
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
|
19
docs/libssh2_sftp_realpath.3
Normal file
19
docs/libssh2_sftp_realpath.3
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
.\" $Id: template.3,v 1.4 2007/06/13 16:41:33 jehousley Exp $
|
||||||
|
.\"
|
||||||
|
.TH libssh2_sftp_realpath 3 "20 Feb 2010" "libssh2 1.2.4" "libssh2 manual"
|
||||||
|
.SH NAME
|
||||||
|
libssh2_sftp_realpath - convenience macro for \fIlibssh2_sftp_symlink_ex(3)\fP calls
|
||||||
|
.SH SYNOPSIS
|
||||||
|
#include <libssh2.h>
|
||||||
|
|
||||||
|
libssh2_sftp_realpath(arguments)
|
||||||
|
|
||||||
|
.SH DESCRIPTION
|
||||||
|
This is a macro defined in a public libssh2 header file that is using the
|
||||||
|
underlying function \fIlibssh2_sftp_symlink_ex(3)\fP.
|
||||||
|
.SH RETURN VALUE
|
||||||
|
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
|
19
docs/libssh2_sftp_rename.3
Normal file
19
docs/libssh2_sftp_rename.3
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
.\" $Id: template.3,v 1.4 2007/06/13 16:41:33 jehousley Exp $
|
||||||
|
.\"
|
||||||
|
.TH libssh2_sftp_rename 3 "20 Feb 2010" "libssh2 1.2.4" "libssh2 manual"
|
||||||
|
.SH NAME
|
||||||
|
libssh2_sftp_rename - convenience macro for \fIlibssh2_sftp_rename_ex(3)\fP calls
|
||||||
|
.SH SYNOPSIS
|
||||||
|
#include <libssh2.h>
|
||||||
|
|
||||||
|
libssh2_sftp_rename(arguments)
|
||||||
|
|
||||||
|
.SH DESCRIPTION
|
||||||
|
This is a macro defined in a public libssh2 header file that is using the
|
||||||
|
underlying function \fIlibssh2_sftp_rename_ex(3)\fP.
|
||||||
|
.SH RETURN VALUE
|
||||||
|
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
|
19
docs/libssh2_sftp_rewind.3
Normal file
19
docs/libssh2_sftp_rewind.3
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
.\" $Id: template.3,v 1.4 2007/06/13 16:41:33 jehousley Exp $
|
||||||
|
.\"
|
||||||
|
.TH libssh2_sftp_rewind 3 "20 Feb 2010" "libssh2 1.2.4" "libssh2 manual"
|
||||||
|
.SH NAME
|
||||||
|
libssh2_sftp_rewind - convenience macro for \fIlibssh2_sftp_seek64(3)\fP calls
|
||||||
|
.SH SYNOPSIS
|
||||||
|
#include <libssh2.h>
|
||||||
|
|
||||||
|
libssh2_sftp_rewind(arguments)
|
||||||
|
|
||||||
|
.SH DESCRIPTION
|
||||||
|
This is a macro defined in a public libssh2 header file that is using the
|
||||||
|
underlying function \fIlibssh2_sftp_seek64(3)\fP.
|
||||||
|
.SH RETURN VALUE
|
||||||
|
See \fIlibssh2_sftp_seek64(3)\fP
|
||||||
|
.SH ERRORS
|
||||||
|
See \fIlibssh2_sftp_seek64(3)\fP
|
||||||
|
.SH SEE ALSO
|
||||||
|
.BR \fIlibssh2_sftp_seek64(3)\fP
|
19
docs/libssh2_sftp_rmdir.3
Normal file
19
docs/libssh2_sftp_rmdir.3
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
.\" $Id: template.3,v 1.4 2007/06/13 16:41:33 jehousley Exp $
|
||||||
|
.\"
|
||||||
|
.TH libssh2_sftp_rmdir 3 "20 Feb 2010" "libssh2 1.2.4" "libssh2 manual"
|
||||||
|
.SH NAME
|
||||||
|
libssh2_sftp_rmdir - convenience macro for \fIlibssh2_sftp_rmdir_ex(3)\fP calls
|
||||||
|
.SH SYNOPSIS
|
||||||
|
#include <libssh2.h>
|
||||||
|
|
||||||
|
libssh2_sftp_rmdir(arguments)
|
||||||
|
|
||||||
|
.SH DESCRIPTION
|
||||||
|
This is a macro defined in a public libssh2 header file that is using the
|
||||||
|
underlying function \fIlibssh2_sftp_rmdir_ex(3)\fP.
|
||||||
|
.SH RETURN VALUE
|
||||||
|
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
|
19
docs/libssh2_sftp_setstat.3
Normal file
19
docs/libssh2_sftp_setstat.3
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
.\" $Id: template.3,v 1.4 2007/06/13 16:41:33 jehousley Exp $
|
||||||
|
.\"
|
||||||
|
.TH libssh2_sftp_setstat 3 "20 Feb 2010" "libssh2 1.2.4" "libssh2 manual"
|
||||||
|
.SH NAME
|
||||||
|
libssh2_sftp_setstat - convenience macro for \fIlibssh2_sftp_stat_ex(3)\fP calls
|
||||||
|
.SH SYNOPSIS
|
||||||
|
#include <libssh2.h>
|
||||||
|
|
||||||
|
libssh2_sftp_setstat(arguments)
|
||||||
|
|
||||||
|
.SH DESCRIPTION
|
||||||
|
This is a macro defined in a public libssh2 header file that is using the
|
||||||
|
underlying function \fIlibssh2_sftp_stat_ex(3)\fP.
|
||||||
|
.SH RETURN VALUE
|
||||||
|
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
|
19
docs/libssh2_sftp_stat.3
Normal file
19
docs/libssh2_sftp_stat.3
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
.\" $Id: template.3,v 1.4 2007/06/13 16:41:33 jehousley Exp $
|
||||||
|
.\"
|
||||||
|
.TH libssh2_sftp_stat 3 "20 Feb 2010" "libssh2 1.2.4" "libssh2 manual"
|
||||||
|
.SH NAME
|
||||||
|
libssh2_sftp_stat - convenience macro for \fIlibssh2_sftp_fstat_ex(3)\fP calls
|
||||||
|
.SH SYNOPSIS
|
||||||
|
#include <libssh2.h>
|
||||||
|
|
||||||
|
libssh2_sftp_stat(arguments)
|
||||||
|
|
||||||
|
.SH DESCRIPTION
|
||||||
|
This is a macro defined in a public libssh2 header file that is using the
|
||||||
|
underlying function \fIlibssh2_sftp_fstat_ex(3)\fP.
|
||||||
|
.SH RETURN VALUE
|
||||||
|
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
|
19
docs/libssh2_sftp_symlink.3
Normal file
19
docs/libssh2_sftp_symlink.3
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
.\" $Id: template.3,v 1.4 2007/06/13 16:41:33 jehousley Exp $
|
||||||
|
.\"
|
||||||
|
.TH libssh2_sftp_symlink 3 "20 Feb 2010" "libssh2 1.2.4" "libssh2 manual"
|
||||||
|
.SH NAME
|
||||||
|
libssh2_sftp_symlink - convenience macro for \fIlibssh2_sftp_symlink_ex(3)\fP calls
|
||||||
|
.SH SYNOPSIS
|
||||||
|
#include <libssh2.h>
|
||||||
|
|
||||||
|
libssh2_sftp_symlink(arguments)
|
||||||
|
|
||||||
|
.SH DESCRIPTION
|
||||||
|
This is a macro defined in a public libssh2 header file that is using the
|
||||||
|
underlying function \fIlibssh2_sftp_symlink_ex(3)\fP.
|
||||||
|
.SH RETURN VALUE
|
||||||
|
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
|
19
docs/libssh2_sftp_unlink.3
Normal file
19
docs/libssh2_sftp_unlink.3
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
.\" $Id: template.3,v 1.4 2007/06/13 16:41:33 jehousley Exp $
|
||||||
|
.\"
|
||||||
|
.TH libssh2_sftp_unlink 3 "20 Feb 2010" "libssh2 1.2.4" "libssh2 manual"
|
||||||
|
.SH NAME
|
||||||
|
libssh2_sftp_unlink - convenience macro for \fIlibssh2_sftp_unlink_ex(3)\fP calls
|
||||||
|
.SH SYNOPSIS
|
||||||
|
#include <libssh2.h>
|
||||||
|
|
||||||
|
libssh2_sftp_unlink(arguments)
|
||||||
|
|
||||||
|
.SH DESCRIPTION
|
||||||
|
This is a macro defined in a public libssh2 header file that is using the
|
||||||
|
underlying function \fIlibssh2_sftp_unlink_ex(3)\fP.
|
||||||
|
.SH RETURN VALUE
|
||||||
|
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
|
@@ -11,21 +11,26 @@ ssize_t
|
|||||||
libssh2_sftp_write(LIBSSH2_SFTP_HANDLE *handle, const char *buffer, size_t count);
|
libssh2_sftp_write(LIBSSH2_SFTP_HANDLE *handle, const char *buffer, size_t count);
|
||||||
|
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
\fIhandle\fP - SFTP File Handle as returned by
|
\fIhandle\fP - SFTP file handle as returned by \fIlibssh2_sftp_open_ex(3)\fP.
|
||||||
.BR libssh2_sftp_open_ex(3)
|
|
||||||
|
|
||||||
\fIbuffer\fP - Pre-initialized data buffer to write to the LIBSSH2_SFTP_HANDLE.
|
\fIbuffer\fP - points to the data to send off
|
||||||
|
|
||||||
\fIcount\fP - Number of bytes from buffer to write. Note that it may not
|
\fIcount\fP - Number of bytes from 'buffer' to write. Note that it may not be
|
||||||
be possible to write all bytes as requested.
|
possible to write all bytes as requested.
|
||||||
|
|
||||||
Write a block of data to a LIBSSH2_SFTP_HANDLE. This method is modeled after the POSIX write() function and uses the same calling semantics.
|
|
||||||
|
|
||||||
|
\fBlibssh2_sftp_write(3)\fP writes a block of data to the SFTP server. This
|
||||||
|
method is modeled after the POSIX write() function and uses the same calling
|
||||||
|
semantics.
|
||||||
.SH RETURN VALUE
|
.SH RETURN VALUE
|
||||||
Actual number of bytes written or negative on failure. It returns
|
Actual number of bytes written or negative on failure.
|
||||||
LIBSSH2_ERROR_EAGAIN when it would otherwise block. While
|
|
||||||
LIBSSH2_ERROR_EAGAIN is a negative number, it isn't really a failure per se.
|
|
||||||
|
|
||||||
|
If used in non-blocking mode, 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.
|
||||||
|
|
||||||
|
If this function returns 0 (zero) it should not be considered an error, but
|
||||||
|
simply that there was no error but yet no payload data got sent to the other
|
||||||
|
end.
|
||||||
.SH ERRORS
|
.SH ERRORS
|
||||||
\fILIBSSH2_ERROR_ALLOC\fP - An internal memory allocation call failed.
|
\fILIBSSH2_ERROR_ALLOC\fP - An internal memory allocation call failed.
|
||||||
|
|
||||||
@@ -36,6 +41,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
|
\fILIBSSH2_ERROR_SFTP_PROTOCOL\fP - An invalid SFTP protocol response was
|
||||||
received on the socket, or an SFTP operation caused an errorcode to
|
received on the socket, or an SFTP operation caused an errorcode to
|
||||||
be returned by the server.
|
be returned by the server.
|
||||||
|
|
||||||
.SH SEE ALSO
|
.SH SEE ALSO
|
||||||
.BR libssh2_sftp_open_ex(3)
|
.BR libssh2_sftp_open_ex(3)
|
||||||
|
@@ -6,16 +6,18 @@ libssh2_trace - enable debug info from inside libssh2
|
|||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
#include <libssh2.h>
|
#include <libssh2.h>
|
||||||
|
|
||||||
void libssh2_trace(int bitmask);
|
void libssh2_trace(LIBSSH2_SESSION *session, int bitmask);
|
||||||
|
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
This is a function present in the library that can be used to get debug info
|
This is a function present in the library that can be used to get debug info
|
||||||
from within libssh2 when it is running. Helpful when trying to trace or debug
|
from within libssh2 when it is running. Helpful when trying to trace or debug
|
||||||
behaviors. This function has no effect unless libssh2 was built to support
|
behaviors. Note that this function has no effect unless libssh2 was built to
|
||||||
this option, and a typical "release build" might not.
|
support tracing! It is usually disabled in release builds.
|
||||||
|
|
||||||
\fBbitmask\fP can be set to none, one or more of these bits:
|
\fBbitmask\fP can be set to the logical OR of none, one or more of these:
|
||||||
.RS
|
.RS
|
||||||
|
.IP LIBSSH2_TRACE_SOCKET
|
||||||
|
Socket low-level debugging
|
||||||
.IP LIBSSH2_TRACE_TRANS
|
.IP LIBSSH2_TRACE_TRANS
|
||||||
Transport layer debugging
|
Transport layer debugging
|
||||||
.IP LIBSSH2_TRACE_KEX
|
.IP LIBSSH2_TRACE_KEX
|
||||||
|
30
docs/libssh2_trace_sethandler.3
Normal file
30
docs/libssh2_trace_sethandler.3
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
.\" $Id: libssh2_trace_sethandler.3,v 1.1 2008/12/26 07:46:45 bagder Exp $
|
||||||
|
.\"
|
||||||
|
.TH libssh2_trace_sethandler 3 "15 Jan 2010" "libssh2 1.2.3" "libssh2 manual"
|
||||||
|
.SH NAME
|
||||||
|
libssh2_trace_sethandler - set a trace output handler
|
||||||
|
.SH SYNOPSIS
|
||||||
|
.nf
|
||||||
|
#include <libssh2.h>
|
||||||
|
|
||||||
|
typedef void (*libssh2_trace_handler_func)(LIBSSH2_SESSION *session,
|
||||||
|
void* context,
|
||||||
|
const char *data,
|
||||||
|
size_t length);
|
||||||
|
|
||||||
|
int libssh2_trace_sethandler(LIBSSH2_SESSION *session,
|
||||||
|
void* context,
|
||||||
|
libssh2_trace_handler_func callback);
|
||||||
|
.SH DESCRIPTION
|
||||||
|
libssh2_trace_sethandler installs a trace output handler for your application.
|
||||||
|
By default, when tracing has been switched on via a call to libssh2_trace(),
|
||||||
|
all output is written to stderr. By calling this method and passing a
|
||||||
|
function pointer that matches the libssh2_trace_handler_func prototype,
|
||||||
|
libssh2 will call back as it generates trace output. This can be used to
|
||||||
|
capture the trace output and put it into a log file or diagnostic window.
|
||||||
|
This function has no effect unless libssh2 was built to support this option,
|
||||||
|
and a typical "release build" might not.
|
||||||
|
|
||||||
|
\fBcontext\fP can be used to pass arbitrary user defined data back into the callback when invoked.
|
||||||
|
.SH AVAILABILITY
|
||||||
|
Added in libssh2 version 1.2.3
|
19
docs/libssh2_userauth_hostbased_fromfile.3
Normal file
19
docs/libssh2_userauth_hostbased_fromfile.3
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
.\" $Id: template.3,v 1.4 2007/06/13 16:41:33 jehousley Exp $
|
||||||
|
.\"
|
||||||
|
.TH libssh2_userauth_hostbased_fromfile 3 "20 Feb 2010" "libssh2 1.2.4" "libssh2 manual"
|
||||||
|
.SH NAME
|
||||||
|
libssh2_userauth_hostbased_fromfile - convenience macro for \fIlibssh2_userauth_hostbased_fromfile_ex(3)\fP calls
|
||||||
|
.SH SYNOPSIS
|
||||||
|
#include <libssh2.h>
|
||||||
|
|
||||||
|
libssh2_userauth_hostbased_fromfile(arguments)
|
||||||
|
|
||||||
|
.SH DESCRIPTION
|
||||||
|
This is a macro defined in a public libssh2 header file that is using the
|
||||||
|
underlying function \fIlibssh2_userauth_hostbased_fromfile_ex(3)\fP.
|
||||||
|
.SH RETURN VALUE
|
||||||
|
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
|
19
docs/libssh2_userauth_keyboard_interactive.3
Normal file
19
docs/libssh2_userauth_keyboard_interactive.3
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
.\" $Id: template.3,v 1.4 2007/06/13 16:41:33 jehousley Exp $
|
||||||
|
.\"
|
||||||
|
.TH libssh2_userauth_keyboard_interactive 3 "20 Feb 2010" "libssh2 1.2.4" "libssh2 manual"
|
||||||
|
.SH NAME
|
||||||
|
libssh2_userauth_keyboard_interactive - convenience macro for \fIlibssh2_userauth_keyboard_interactive_ex(3)\fP calls
|
||||||
|
.SH SYNOPSIS
|
||||||
|
#include <libssh2.h>
|
||||||
|
|
||||||
|
libssh2_userauth_keyboard_interactive(arguments)
|
||||||
|
|
||||||
|
.SH DESCRIPTION
|
||||||
|
This is a macro defined in a public libssh2 header file that is using the
|
||||||
|
underlying function \fIlibssh2_userauth_keyboard_interactive_ex(3)\fP.
|
||||||
|
.SH RETURN VALUE
|
||||||
|
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
|
@@ -39,5 +39,7 @@ LIBSSH2_ERROR_EAGAIN is a negative number, it isn't really a failure per se.
|
|||||||
|
|
||||||
\fILIBSSH2_ERROR_SOCKET_SEND\fP - Unable to send data on socket.
|
\fILIBSSH2_ERROR_SOCKET_SEND\fP - Unable to send data on socket.
|
||||||
|
|
||||||
|
\fLIBSSH2_ERROR_AUTHENTICATION_FAILED\fP - failed, invalid username/password or public/private key.
|
||||||
|
|
||||||
.SH SEE ALSO
|
.SH SEE ALSO
|
||||||
.BR libssh2_session_init_ex(3)
|
.BR libssh2_session_init_ex(3)
|
||||||
|
19
docs/libssh2_userauth_password.3
Normal file
19
docs/libssh2_userauth_password.3
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
.\" $Id: template.3,v 1.4 2007/06/13 16:41:33 jehousley Exp $
|
||||||
|
.\"
|
||||||
|
.TH libssh2_userauth_password 3 "20 Feb 2010" "libssh2 1.2.4" "libssh2 manual"
|
||||||
|
.SH NAME
|
||||||
|
libssh2_userauth_password - convenience macro for \fIlibssh2_userauth_password_ex(3)\fP calls
|
||||||
|
.SH SYNOPSIS
|
||||||
|
#include <libssh2.h>
|
||||||
|
|
||||||
|
libssh2_userauth_password(arguments)
|
||||||
|
|
||||||
|
.SH DESCRIPTION
|
||||||
|
This is a macro defined in a public libssh2 header file that is using the
|
||||||
|
underlying function \fIlibssh2_userauth_password_ex(3)\fP.
|
||||||
|
.SH RETURN VALUE
|
||||||
|
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
|
@@ -46,5 +46,7 @@ LIBSSH2_ERROR_EAGAIN is a negative number, it isn't really a failure per se.
|
|||||||
|
|
||||||
\fILIBSSH2_ERROR_PASSWORD_EXPIRED\fP -
|
\fILIBSSH2_ERROR_PASSWORD_EXPIRED\fP -
|
||||||
|
|
||||||
|
\fLIBSSH2_ERROR_AUTHENTICATION_FAILED\fP - failed, invalid username/password or public/private key.
|
||||||
|
|
||||||
.SH SEE ALSO
|
.SH SEE ALSO
|
||||||
.BR libssh2_session_init_ex(3)
|
.BR libssh2_session_init_ex(3)
|
||||||
|
19
docs/libssh2_userauth_publickey_fromfile.3
Normal file
19
docs/libssh2_userauth_publickey_fromfile.3
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
.\" $Id: template.3,v 1.4 2007/06/13 16:41:33 jehousley Exp $
|
||||||
|
.\"
|
||||||
|
.TH libssh2_userauth_publickey_fromfile 3 "20 Feb 2010" "libssh2 1.2.4" "libssh2 manual"
|
||||||
|
.SH NAME
|
||||||
|
libssh2_userauth_publickey_fromfile - convenience macro for \fIlibssh2_userauth_publickey_fromfile_ex(3)\fP calls
|
||||||
|
.SH SYNOPSIS
|
||||||
|
#include <libssh2.h>
|
||||||
|
|
||||||
|
libssh2_userauth_publickey_fromfile(arguments)
|
||||||
|
|
||||||
|
.SH DESCRIPTION
|
||||||
|
This is a macro defined in a public libssh2 header file that is using the
|
||||||
|
underlying function \fIlibssh2_userauth_publickey_fromfile_ex(3)\fP.
|
||||||
|
.SH RETURN VALUE
|
||||||
|
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
|
@@ -40,12 +40,11 @@ LIBSSH2_ERROR_EAGAIN is a negative number, it isn't really a failure per se.
|
|||||||
|
|
||||||
\fILIBSSH2_ERROR_SOCKET_TIMEOUT\fP -
|
\fILIBSSH2_ERROR_SOCKET_TIMEOUT\fP -
|
||||||
|
|
||||||
\fILIBSSH2_ERROR_PUBLICKEY_UNRECOGNIZED\fP - >The username/public key
|
\fILIBSSH2_ERROR_PUBLICKEY_UNVERIFIED\fP - The username/public key
|
||||||
combination was invalid.
|
combination was invalid.
|
||||||
|
|
||||||
\fILIBSSH2_ERROR_PUBLICKEY_UNVERIFIED\fP - The username/public key
|
\fILIBSSH2_ERROR_AUTHENTICATION_FAILED\fP - Authentication using the supplied
|
||||||
combination was invalid, or the signature for the supplied public
|
public key was not accepted.
|
||||||
key was invalid.
|
|
||||||
|
|
||||||
.SH SEE ALSO
|
.SH SEE ALSO
|
||||||
.BR libssh2_session_init_ex(3)
|
.BR libssh2_session_init_ex(3)
|
||||||
|
@@ -1,2 +0,0 @@
|
|||||||
Makefile
|
|
||||||
Makefile.in
|
|
@@ -1,5 +1,8 @@
|
|||||||
|
Makefile
|
||||||
|
Makefile.in
|
||||||
*.gcno
|
*.gcno
|
||||||
*.gcda
|
*.gcda
|
||||||
|
direct_tcpip
|
||||||
scp
|
scp
|
||||||
scp_nonblock
|
scp_nonblock
|
||||||
scp_write
|
scp_write
|
||||||
@@ -16,3 +19,7 @@ sftp_write
|
|||||||
sftp_write_nonblock
|
sftp_write_nonblock
|
||||||
config.h.in
|
config.h.in
|
||||||
ssh2_exec
|
ssh2_exec
|
||||||
|
ssh2_agent
|
||||||
|
libssh2_config.h
|
||||||
|
libssh2_config.h.in
|
||||||
|
stamp-h2
|
@@ -1,2 +1,16 @@
|
|||||||
AUTOMAKE_OPTIONS = foreign nostdinc
|
AUTOMAKE_OPTIONS = foreign nostdinc
|
||||||
SUBDIRS = simple
|
|
||||||
|
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
|
||||||
|
|
||||||
|
AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/example
|
||||||
|
LDADD = $(top_builddir)/src/libssh2.la
|
||||||
|
284
example/direct_tcpip.c
Normal file
284
example/direct_tcpip.c
Normal file
@@ -0,0 +1,284 @@
|
|||||||
|
#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 <stdlib.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
#ifndef INADDR_NONE
|
||||||
|
#define INADDR_NONE (in_addr_t)-1
|
||||||
|
#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";
|
||||||
|
|
||||||
|
const char *local_listenip = "127.0.0.1";
|
||||||
|
unsigned int local_listenport = 2222;
|
||||||
|
|
||||||
|
const char *remote_desthost = "localhost"; /* resolved by the server */
|
||||||
|
unsigned int remote_destport = 22;
|
||||||
|
|
||||||
|
enum {
|
||||||
|
AUTH_NONE = 0,
|
||||||
|
AUTH_PASSWORD,
|
||||||
|
AUTH_PUBLICKEY
|
||||||
|
};
|
||||||
|
|
||||||
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
int rc, sock = -1, listensock = -1, forwardsock = -1, i, auth = AUTH_NONE;
|
||||||
|
struct sockaddr_in sin;
|
||||||
|
socklen_t sinlen;
|
||||||
|
const char *fingerprint;
|
||||||
|
char *userauthlist;
|
||||||
|
LIBSSH2_SESSION *session;
|
||||||
|
LIBSSH2_CHANNEL *channel = NULL;
|
||||||
|
const char *shost;
|
||||||
|
unsigned int sport;
|
||||||
|
fd_set fds;
|
||||||
|
struct timeval tv;
|
||||||
|
ssize_t len, wr;
|
||||||
|
char buf[16384];
|
||||||
|
|
||||||
|
#ifdef WIN32
|
||||||
|
char sockopt;
|
||||||
|
WSADATA wsadata;
|
||||||
|
|
||||||
|
WSAStartup(MAKEWORD(2,0), &wsadata);
|
||||||
|
#else
|
||||||
|
int sockopt;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (argc > 1)
|
||||||
|
server_ip = argv[1];
|
||||||
|
if (argc > 2)
|
||||||
|
username = argv[2];
|
||||||
|
if (argc > 3)
|
||||||
|
password = argv[3];
|
||||||
|
if (argc > 4)
|
||||||
|
local_listenip = argv[4];
|
||||||
|
if (argc > 5)
|
||||||
|
local_listenport = atoi(argv[5]);
|
||||||
|
if (argc > 6)
|
||||||
|
remote_desthost = argv[6];
|
||||||
|
if (argc > 7)
|
||||||
|
remote_destport = atoi(argv[7]);
|
||||||
|
|
||||||
|
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))) {
|
||||||
|
perror("inet_addr");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
sin.sin_port = htons(22);
|
||||||
|
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) {
|
||||||
|
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 > 8) {
|
||||||
|
if ((auth & AUTH_PASSWORD) && !strcasecmp(argv[8], "-p"))
|
||||||
|
auth = AUTH_PASSWORD;
|
||||||
|
if ((auth & AUTH_PUBLICKEY) && !strcasecmp(argv[8], "-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("\tAuthentication by public key failed!\n");
|
||||||
|
goto shutdown;
|
||||||
|
}
|
||||||
|
printf("\tAuthentication by public key succeeded.\n");
|
||||||
|
} else {
|
||||||
|
printf("No supported authentication methods found!\n");
|
||||||
|
goto shutdown;
|
||||||
|
}
|
||||||
|
|
||||||
|
listensock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
|
||||||
|
sin.sin_family = AF_INET;
|
||||||
|
sin.sin_port = htons(local_listenport);
|
||||||
|
if (INADDR_NONE == (sin.sin_addr.s_addr = inet_addr(local_listenip))) {
|
||||||
|
perror("inet_addr");
|
||||||
|
goto shutdown;
|
||||||
|
}
|
||||||
|
sockopt = 1;
|
||||||
|
setsockopt(listensock, SOL_SOCKET, SO_REUSEADDR, &sockopt, sizeof(sockopt));
|
||||||
|
sinlen=sizeof(sin);
|
||||||
|
if (-1 == bind(listensock, (struct sockaddr *)&sin, sinlen)) {
|
||||||
|
perror("bind");
|
||||||
|
goto shutdown;
|
||||||
|
}
|
||||||
|
if (-1 == listen(listensock, 2)) {
|
||||||
|
perror("listen");
|
||||||
|
goto shutdown;
|
||||||
|
}
|
||||||
|
|
||||||
|
printf("Waiting for TCP connection on %s:%d...\n",
|
||||||
|
inet_ntoa(sin.sin_addr), ntohs(sin.sin_port));
|
||||||
|
|
||||||
|
forwardsock = accept(listensock, (struct sockaddr *)&sin, &sinlen);
|
||||||
|
if (-1 == forwardsock) {
|
||||||
|
perror("accept");
|
||||||
|
goto shutdown;
|
||||||
|
}
|
||||||
|
|
||||||
|
shost = inet_ntoa(sin.sin_addr);
|
||||||
|
sport = ntohs(sin.sin_port);
|
||||||
|
|
||||||
|
printf("Forwarding connection from %s:%d here to remote %s:%d\n", shost,
|
||||||
|
sport, remote_desthost, remote_destport);
|
||||||
|
|
||||||
|
channel = libssh2_channel_direct_tcpip_ex(session, remote_desthost,
|
||||||
|
remote_destport, shost, sport);
|
||||||
|
if (!channel) {
|
||||||
|
fprintf(stderr, "Could not open the direct-tcpip channel!\n");
|
||||||
|
fprintf(stderr, "(Note that this can be a problem at the server! Please review the server logs.)\n");
|
||||||
|
goto shutdown;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Must use non-blocking IO hereafter due to the current libssh2 API */
|
||||||
|
libssh2_session_set_blocking(session, 0);
|
||||||
|
|
||||||
|
while (1) {
|
||||||
|
FD_ZERO(&fds);
|
||||||
|
FD_SET(forwardsock, &fds);
|
||||||
|
tv.tv_sec = 0;
|
||||||
|
tv.tv_usec = 100000;
|
||||||
|
rc = select(forwardsock + 1, &fds, NULL, NULL, &tv);
|
||||||
|
if (-1 == rc) {
|
||||||
|
perror("select");
|
||||||
|
goto shutdown;
|
||||||
|
}
|
||||||
|
if (rc && FD_ISSET(forwardsock, &fds)) {
|
||||||
|
len = recv(forwardsock, buf, sizeof(buf), 0);
|
||||||
|
if (len < 0) {
|
||||||
|
perror("read");
|
||||||
|
goto shutdown;
|
||||||
|
} else if (0 == len) {
|
||||||
|
printf("The client at %s:%d disconnected!\n", shost, sport);
|
||||||
|
goto shutdown;
|
||||||
|
}
|
||||||
|
wr = 0;
|
||||||
|
do {
|
||||||
|
i = libssh2_channel_write(channel, buf, len);
|
||||||
|
if (i < 0) {
|
||||||
|
fprintf(stderr, "libssh2_channel_write: %d\n", i);
|
||||||
|
goto shutdown;
|
||||||
|
}
|
||||||
|
wr += i;
|
||||||
|
} while(i > 0 && wr < len);
|
||||||
|
}
|
||||||
|
while (1) {
|
||||||
|
len = libssh2_channel_read(channel, buf, sizeof(buf));
|
||||||
|
if (LIBSSH2_ERROR_EAGAIN == len)
|
||||||
|
break;
|
||||||
|
else if (len < 0) {
|
||||||
|
fprintf(stderr, "libssh2_channel_read: %d", (int)len);
|
||||||
|
goto shutdown;
|
||||||
|
}
|
||||||
|
wr = 0;
|
||||||
|
while (wr < len) {
|
||||||
|
i = send(forwardsock, buf + wr, len - wr, 0);
|
||||||
|
if (i <= 0) {
|
||||||
|
perror("write");
|
||||||
|
goto shutdown;
|
||||||
|
}
|
||||||
|
wr += i;
|
||||||
|
}
|
||||||
|
if (libssh2_channel_eof(channel)) {
|
||||||
|
printf("The server at %s:%d disconnected!\n",
|
||||||
|
remote_desthost, remote_destport);
|
||||||
|
goto shutdown;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
shutdown:
|
||||||
|
#ifdef WIN32
|
||||||
|
closesocket(forwardsock);
|
||||||
|
closesocket(listensock);
|
||||||
|
#else
|
||||||
|
close(forwardsock);
|
||||||
|
close(listensock);
|
||||||
|
#endif
|
||||||
|
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;
|
||||||
|
}
|
@@ -10,12 +10,12 @@
|
|||||||
#ifdef HAVE_WINSOCK2_H
|
#ifdef HAVE_WINSOCK2_H
|
||||||
# include <winsock2.h>
|
# include <winsock2.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_NETINET_IN_H
|
|
||||||
# include <netinet/in.h>
|
|
||||||
#endif
|
|
||||||
#ifdef HAVE_SYS_SOCKET_H
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
# include <sys/socket.h>
|
# include <sys/socket.h>
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_NETINET_IN_H
|
||||||
|
# include <netinet/in.h>
|
||||||
|
#endif
|
||||||
# ifdef HAVE_UNISTD_H
|
# ifdef HAVE_UNISTD_H
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
@@ -68,6 +68,12 @@ int main(int argc, char *argv[])
|
|||||||
scppath = argv[4];
|
scppath = argv[4];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rc = libssh2_init (0);
|
||||||
|
if (rc != 0) {
|
||||||
|
fprintf (stderr, "libssh2 initialization failed (%d)\n", rc);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
/* Ultra basic "connect to port 22 on localhost"
|
/* Ultra basic "connect to port 22 on localhost"
|
||||||
* Your code is responsible for creating the socket establishing the
|
* Your code is responsible for creating the socket establishing the
|
||||||
* connection
|
* connection
|
||||||
@@ -103,9 +109,9 @@ int main(int argc, char *argv[])
|
|||||||
* may have it hard coded, may go to a file, may present it to the
|
* may have it hard coded, may go to a file, may present it to the
|
||||||
* user, that's your call
|
* user, that's your call
|
||||||
*/
|
*/
|
||||||
fingerprint = libssh2_hostkey_hash(session, LIBSSH2_HOSTKEY_HASH_MD5);
|
fingerprint = libssh2_hostkey_hash(session, LIBSSH2_HOSTKEY_HASH_SHA1);
|
||||||
fprintf(stderr, "Fingerprint: ");
|
fprintf(stderr, "Fingerprint: ");
|
||||||
for(i = 0; i < 16; i++) {
|
for(i = 0; i < 20; i++) {
|
||||||
fprintf(stderr, "%02X ", (unsigned char)fingerprint[i]);
|
fprintf(stderr, "%02X ", (unsigned char)fingerprint[i]);
|
||||||
}
|
}
|
||||||
fprintf(stderr, "\n");
|
fprintf(stderr, "\n");
|
||||||
@@ -169,5 +175,8 @@ int main(int argc, char *argv[])
|
|||||||
close(sock);
|
close(sock);
|
||||||
#endif
|
#endif
|
||||||
fprintf(stderr, "all done\n");
|
fprintf(stderr, "all done\n");
|
||||||
|
|
||||||
|
libssh2_exit();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
@@ -15,11 +15,14 @@
|
|||||||
#ifdef HAVE_WINSOCK2_H
|
#ifdef HAVE_WINSOCK2_H
|
||||||
# include <winsock2.h>
|
# include <winsock2.h>
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
|
# include <sys/socket.h>
|
||||||
|
#endif
|
||||||
#ifdef HAVE_NETINET_IN_H
|
#ifdef HAVE_NETINET_IN_H
|
||||||
# include <netinet/in.h>
|
# include <netinet/in.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_SYS_SOCKET_H
|
#ifdef HAVE_SYS_SELECT_H
|
||||||
# include <sys/socket.h>
|
# include <sys/select.h>
|
||||||
#endif
|
#endif
|
||||||
# ifdef HAVE_UNISTD_H
|
# ifdef HAVE_UNISTD_H
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
@@ -118,6 +121,12 @@ int main(int argc, char *argv[])
|
|||||||
scppath = argv[4];
|
scppath = argv[4];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rc = libssh2_init (0);
|
||||||
|
if (rc != 0) {
|
||||||
|
fprintf (stderr, "libssh2 initialization failed (%d)\n", rc);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
/* Ultra basic "connect to port 22 on localhost"
|
/* Ultra basic "connect to port 22 on localhost"
|
||||||
* Your code is responsible for creating the socket establishing the
|
* Your code is responsible for creating the socket establishing the
|
||||||
* connection
|
* connection
|
||||||
@@ -157,9 +166,9 @@ int main(int argc, char *argv[])
|
|||||||
* may have it hard coded, may go to a file, may present it to the
|
* may have it hard coded, may go to a file, may present it to the
|
||||||
* user, that's your call
|
* user, that's your call
|
||||||
*/
|
*/
|
||||||
fingerprint = libssh2_hostkey_hash(session, LIBSSH2_HOSTKEY_HASH_MD5);
|
fingerprint = libssh2_hostkey_hash(session, LIBSSH2_HOSTKEY_HASH_SHA1);
|
||||||
fprintf(stderr, "Fingerprint: ");
|
fprintf(stderr, "Fingerprint: ");
|
||||||
for(i = 0; i < 16; i++) {
|
for(i = 0; i < 20; i++) {
|
||||||
fprintf(stderr, "%02X ", (unsigned char)fingerprint[i]);
|
fprintf(stderr, "%02X ", (unsigned char)fingerprint[i]);
|
||||||
}
|
}
|
||||||
fprintf(stderr, "\n");
|
fprintf(stderr, "\n");
|
||||||
@@ -264,5 +273,8 @@ shutdown:
|
|||||||
close(sock);
|
close(sock);
|
||||||
#endif
|
#endif
|
||||||
fprintf(stderr, "all done\n");
|
fprintf(stderr, "all done\n");
|
||||||
|
|
||||||
|
libssh2_exit();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
@@ -10,12 +10,12 @@
|
|||||||
#ifdef HAVE_WINSOCK2_H
|
#ifdef HAVE_WINSOCK2_H
|
||||||
# include <winsock2.h>
|
# include <winsock2.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_NETINET_IN_H
|
|
||||||
# include <netinet/in.h>
|
|
||||||
#endif
|
|
||||||
#ifdef HAVE_SYS_SOCKET_H
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
# include <sys/socket.h>
|
# include <sys/socket.h>
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_NETINET_IN_H
|
||||||
|
# include <netinet/in.h>
|
||||||
|
#endif
|
||||||
# ifdef HAVE_UNISTD_H
|
# ifdef HAVE_UNISTD_H
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
@@ -38,7 +38,7 @@ int main(int argc, char *argv[])
|
|||||||
int sock, i, auth_pw = 1;
|
int sock, i, auth_pw = 1;
|
||||||
struct sockaddr_in sin;
|
struct sockaddr_in sin;
|
||||||
const char *fingerprint;
|
const char *fingerprint;
|
||||||
LIBSSH2_SESSION *session;
|
LIBSSH2_SESSION *session = NULL;
|
||||||
LIBSSH2_CHANNEL *channel;
|
LIBSSH2_CHANNEL *channel;
|
||||||
const char *username="username";
|
const char *username="username";
|
||||||
const char *password="password";
|
const char *password="password";
|
||||||
@@ -47,7 +47,7 @@ int main(int argc, char *argv[])
|
|||||||
FILE *local;
|
FILE *local;
|
||||||
int rc;
|
int rc;
|
||||||
char mem[1024];
|
char mem[1024];
|
||||||
size_t nread;
|
size_t nread, sent;
|
||||||
char *ptr;
|
char *ptr;
|
||||||
struct stat fileinfo;
|
struct stat fileinfo;
|
||||||
|
|
||||||
@@ -75,9 +75,15 @@ int main(int argc, char *argv[])
|
|||||||
scppath = argv[5];
|
scppath = argv[5];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rc = libssh2_init (0);
|
||||||
|
if (rc != 0) {
|
||||||
|
fprintf (stderr, "libssh2 initialization failed (%d)\n", rc);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
local = fopen(loclfile, "rb");
|
local = fopen(loclfile, "rb");
|
||||||
if (!local) {
|
if (!local) {
|
||||||
fprintf(stderr, "Can't local file %s\n", loclfile);
|
fprintf(stderr, "Can't open local file %s\n", loclfile);
|
||||||
goto shutdown;
|
goto shutdown;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -118,9 +124,9 @@ int main(int argc, char *argv[])
|
|||||||
* may have it hard coded, may go to a file, may present it to the
|
* may have it hard coded, may go to a file, may present it to the
|
||||||
* user, that's your call
|
* user, that's your call
|
||||||
*/
|
*/
|
||||||
fingerprint = libssh2_hostkey_hash(session, LIBSSH2_HOSTKEY_HASH_MD5);
|
fingerprint = libssh2_hostkey_hash(session, LIBSSH2_HOSTKEY_HASH_SHA1);
|
||||||
fprintf(stderr, "Fingerprint: ");
|
fprintf(stderr, "Fingerprint: ");
|
||||||
for(i = 0; i < 16; i++) {
|
for(i = 0; i < 20; i++) {
|
||||||
fprintf(stderr, "%02X ", (unsigned char)fingerprint[i]);
|
fprintf(stderr, "%02X ", (unsigned char)fingerprint[i]);
|
||||||
}
|
}
|
||||||
fprintf(stderr, "\n");
|
fprintf(stderr, "\n");
|
||||||
@@ -142,12 +148,15 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Request a file via SCP */
|
/* Send a file via scp. The mode parameter must only have permissions! */
|
||||||
channel = libssh2_scp_send(session, scppath, 0x1FF & fileinfo.st_mode,
|
channel = libssh2_scp_send(session, scppath, fileinfo.st_mode & 0777,
|
||||||
(unsigned long)fileinfo.st_size);
|
(unsigned long)fileinfo.st_size);
|
||||||
|
|
||||||
if (!channel) {
|
if (!channel) {
|
||||||
fprintf(stderr, "Unable to open a session\n");
|
char *errmsg;
|
||||||
|
int errlen;
|
||||||
|
int err = libssh2_session_last_error(session, &errmsg, &errlen, 0);
|
||||||
|
fprintf(stderr, "Unable to open a session: (%d) %s\n", err, errmsg);
|
||||||
goto shutdown;
|
goto shutdown;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -159,13 +168,20 @@ int main(int argc, char *argv[])
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
ptr = mem;
|
ptr = mem;
|
||||||
|
sent = 0;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
/* write data in a loop until we block */
|
/* write the same data over and over, until error or completion */
|
||||||
rc = libssh2_channel_write(channel, ptr, nread);
|
rc = libssh2_channel_write(channel, ptr, nread);
|
||||||
ptr += rc;
|
if (rc < 0) {
|
||||||
nread -= nread;
|
fprintf(stderr, "ERROR %d\n", rc);
|
||||||
} while (rc > 0);
|
} else {
|
||||||
|
/* rc indicates how many bytes were written this time */
|
||||||
|
sent += rc;
|
||||||
|
}
|
||||||
|
} while (rc > 0 && sent < nread);
|
||||||
|
ptr += sent;
|
||||||
|
nread -= sent;
|
||||||
} while (1);
|
} while (1);
|
||||||
|
|
||||||
fprintf(stderr, "Sending EOF\n");
|
fprintf(stderr, "Sending EOF\n");
|
||||||
@@ -182,14 +198,20 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
shutdown:
|
shutdown:
|
||||||
|
|
||||||
|
if(session) {
|
||||||
libssh2_session_disconnect(session, "Normal Shutdown, Thank you for playing");
|
libssh2_session_disconnect(session, "Normal Shutdown, Thank you for playing");
|
||||||
libssh2_session_free(session);
|
libssh2_session_free(session);
|
||||||
|
}
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
closesocket(sock);
|
closesocket(sock);
|
||||||
#else
|
#else
|
||||||
close(sock);
|
close(sock);
|
||||||
#endif
|
#endif
|
||||||
|
if (local)
|
||||||
|
fclose(local);
|
||||||
fprintf(stderr, "all done\n");
|
fprintf(stderr, "all done\n");
|
||||||
|
|
||||||
|
libssh2_exit();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
@@ -11,12 +11,12 @@
|
|||||||
#ifdef HAVE_WINSOCK2_H
|
#ifdef HAVE_WINSOCK2_H
|
||||||
# include <winsock2.h>
|
# include <winsock2.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_NETINET_IN_H
|
|
||||||
# include <netinet/in.h>
|
|
||||||
#endif
|
|
||||||
#ifdef HAVE_SYS_SOCKET_H
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
# include <sys/socket.h>
|
# include <sys/socket.h>
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_NETINET_IN_H
|
||||||
|
# include <netinet/in.h>
|
||||||
|
#endif
|
||||||
# ifdef HAVE_UNISTD_H
|
# ifdef HAVE_UNISTD_H
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
@@ -51,7 +51,7 @@ int main(int argc, char *argv[])
|
|||||||
long flag = 1;
|
long flag = 1;
|
||||||
#endif
|
#endif
|
||||||
char mem[1024];
|
char mem[1024];
|
||||||
size_t nread;
|
size_t nread, sent;
|
||||||
char *ptr;
|
char *ptr;
|
||||||
struct stat fileinfo;
|
struct stat fileinfo;
|
||||||
|
|
||||||
@@ -79,6 +79,12 @@ int main(int argc, char *argv[])
|
|||||||
scppath = argv[5];
|
scppath = argv[5];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rc = libssh2_init (0);
|
||||||
|
if (rc != 0) {
|
||||||
|
fprintf (stderr, "libssh2 initialization failed (%d)\n", rc);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
local = fopen(loclfile, "rb");
|
local = fopen(loclfile, "rb");
|
||||||
if (!local) {
|
if (!local) {
|
||||||
fprintf(stderr, "Can't local file %s\n", loclfile);
|
fprintf(stderr, "Can't local file %s\n", loclfile);
|
||||||
@@ -126,9 +132,9 @@ int main(int argc, char *argv[])
|
|||||||
* may have it hard coded, may go to a file, may present it to the
|
* may have it hard coded, may go to a file, may present it to the
|
||||||
* user, that's your call
|
* user, that's your call
|
||||||
*/
|
*/
|
||||||
fingerprint = libssh2_hostkey_hash(session, LIBSSH2_HOSTKEY_HASH_MD5);
|
fingerprint = libssh2_hostkey_hash(session, LIBSSH2_HOSTKEY_HASH_SHA1);
|
||||||
fprintf(stderr, "Fingerprint: ");
|
fprintf(stderr, "Fingerprint: ");
|
||||||
for(i = 0; i < 16; i++) {
|
for(i = 0; i < 20; i++) {
|
||||||
fprintf(stderr, "%02X ", (unsigned char)fingerprint[i]);
|
fprintf(stderr, "%02X ", (unsigned char)fingerprint[i]);
|
||||||
}
|
}
|
||||||
fprintf(stderr, "\n");
|
fprintf(stderr, "\n");
|
||||||
@@ -153,9 +159,9 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Request a file via SCP */
|
/* Send a file via scp. The mode parameter must only have permissions! */
|
||||||
do {
|
do {
|
||||||
channel = libssh2_scp_send(session, scppath, 0x1FF & fileinfo.st_mode,
|
channel = libssh2_scp_send(session, scppath, fileinfo.st_mode & 0777,
|
||||||
(unsigned long)fileinfo.st_size);
|
(unsigned long)fileinfo.st_size);
|
||||||
|
|
||||||
if ((!channel) && (libssh2_session_last_errno(session) !=
|
if ((!channel) && (libssh2_session_last_errno(session) !=
|
||||||
@@ -176,17 +182,22 @@ int main(int argc, char *argv[])
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
ptr = mem;
|
ptr = mem;
|
||||||
|
sent = 0;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
/* write data in a loop until we block */
|
/* write the same data over and over, until error or completion */
|
||||||
while ((rc = libssh2_channel_write(channel, ptr, nread)) ==
|
rc = libssh2_channel_write(channel, ptr, nread);
|
||||||
LIBSSH2_ERROR_EAGAIN);
|
if (LIBSSH2_ERROR_EAGAIN == rc) { /* must loop around */
|
||||||
if (rc < 0) {
|
continue;
|
||||||
|
} else if (rc < 0) {
|
||||||
fprintf(stderr, "ERROR %d\n", rc);
|
fprintf(stderr, "ERROR %d\n", rc);
|
||||||
|
} else {
|
||||||
|
/* rc indicates how many bytes were written this time */
|
||||||
|
sent += rc;
|
||||||
}
|
}
|
||||||
ptr += rc;
|
} while (rc > 0 && sent < nread);
|
||||||
nread -= rc;
|
ptr += sent;
|
||||||
} while (nread > 0);
|
nread -= sent;
|
||||||
} while (1);
|
} while (1);
|
||||||
|
|
||||||
fprintf(stderr, "Sending EOF\n");
|
fprintf(stderr, "Sending EOF\n");
|
||||||
@@ -213,5 +224,8 @@ int main(int argc, char *argv[])
|
|||||||
close(sock);
|
close(sock);
|
||||||
#endif
|
#endif
|
||||||
fprintf(stderr, "all done\n");
|
fprintf(stderr, "all done\n");
|
||||||
|
|
||||||
|
libssh2_exit();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
@@ -16,12 +16,12 @@
|
|||||||
#ifdef HAVE_WINSOCK2_H
|
#ifdef HAVE_WINSOCK2_H
|
||||||
# include <winsock2.h>
|
# include <winsock2.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_NETINET_IN_H
|
|
||||||
# include <netinet/in.h>
|
|
||||||
#endif
|
|
||||||
#ifdef HAVE_SYS_SOCKET_H
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
# include <sys/socket.h>
|
# include <sys/socket.h>
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_NETINET_IN_H
|
||||||
|
# include <netinet/in.h>
|
||||||
|
#endif
|
||||||
# ifdef HAVE_UNISTD_H
|
# ifdef HAVE_UNISTD_H
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
@@ -98,6 +98,13 @@ int main(int argc, char *argv[])
|
|||||||
if(argc > 4) {
|
if(argc > 4) {
|
||||||
sftppath = argv[4];
|
sftppath = argv[4];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rc = libssh2_init (0);
|
||||||
|
if (rc != 0) {
|
||||||
|
fprintf (stderr, "libssh2 initialization failed (%d)\n", rc);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The application code is responsible for creating the socket
|
* The application code is responsible for creating the socket
|
||||||
* and establishing the connection
|
* and establishing the connection
|
||||||
@@ -136,9 +143,9 @@ int main(int argc, char *argv[])
|
|||||||
* may have it hard coded, may go to a file, may present it to the
|
* may have it hard coded, may go to a file, may present it to the
|
||||||
* user, that's your call
|
* user, that's your call
|
||||||
*/
|
*/
|
||||||
fingerprint = libssh2_hostkey_hash(session, LIBSSH2_HOSTKEY_HASH_MD5);
|
fingerprint = libssh2_hostkey_hash(session, LIBSSH2_HOSTKEY_HASH_SHA1);
|
||||||
fprintf(stderr, "Fingerprint: ");
|
fprintf(stderr, "Fingerprint: ");
|
||||||
for(i = 0; i < 16; i++) {
|
for(i = 0; i < 20; i++) {
|
||||||
fprintf(stderr, "%02X ", (unsigned char)fingerprint[i]);
|
fprintf(stderr, "%02X ", (unsigned char)fingerprint[i]);
|
||||||
}
|
}
|
||||||
fprintf(stderr, "\n");
|
fprintf(stderr, "\n");
|
||||||
@@ -241,5 +248,8 @@ int main(int argc, char *argv[])
|
|||||||
close(sock);
|
close(sock);
|
||||||
#endif
|
#endif
|
||||||
fprintf(stderr, "all done\n");
|
fprintf(stderr, "all done\n");
|
||||||
|
|
||||||
|
libssh2_exit();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
@@ -16,11 +16,14 @@
|
|||||||
#ifdef HAVE_WINSOCK2_H
|
#ifdef HAVE_WINSOCK2_H
|
||||||
# include <winsock2.h>
|
# include <winsock2.h>
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
|
# include <sys/socket.h>
|
||||||
|
#endif
|
||||||
#ifdef HAVE_NETINET_IN_H
|
#ifdef HAVE_NETINET_IN_H
|
||||||
# include <netinet/in.h>
|
# include <netinet/in.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_SYS_SOCKET_H
|
#ifdef HAVE_SYS_SELECT_H
|
||||||
# include <sys/socket.h>
|
# include <sys/select.h>
|
||||||
#endif
|
#endif
|
||||||
# ifdef HAVE_UNISTD_H
|
# ifdef HAVE_UNISTD_H
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
@@ -69,6 +72,12 @@ int main(int argc, char *argv[])
|
|||||||
WSAStartup(MAKEWORD(2,0), &wsadata);
|
WSAStartup(MAKEWORD(2,0), &wsadata);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
rc = libssh2_init (0);
|
||||||
|
if (rc != 0) {
|
||||||
|
fprintf (stderr, "libssh2 initialization failed (%d)\n", rc);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
/* Ultra basic "connect to port 22 on localhost"
|
/* Ultra basic "connect to port 22 on localhost"
|
||||||
* The application is responsible for creating the socket establishing
|
* The application is responsible for creating the socket establishing
|
||||||
* the connection
|
* the connection
|
||||||
@@ -106,9 +115,9 @@ int main(int argc, char *argv[])
|
|||||||
* may have it hard coded, may go to a file, may present it to the
|
* may have it hard coded, may go to a file, may present it to the
|
||||||
* user, that's your call
|
* user, that's your call
|
||||||
*/
|
*/
|
||||||
fingerprint = libssh2_hostkey_hash(session, LIBSSH2_HOSTKEY_HASH_MD5);
|
fingerprint = libssh2_hostkey_hash(session, LIBSSH2_HOSTKEY_HASH_SHA1);
|
||||||
printf("Fingerprint: ");
|
printf("Fingerprint: ");
|
||||||
for(i = 0; i < 16; i++) {
|
for(i = 0; i < 20; i++) {
|
||||||
printf("%02X ", (unsigned char)fingerprint[i]);
|
printf("%02X ", (unsigned char)fingerprint[i]);
|
||||||
}
|
}
|
||||||
printf("\n");
|
printf("\n");
|
||||||
@@ -280,6 +289,11 @@ int main(int argc, char *argv[])
|
|||||||
#else
|
#else
|
||||||
close(sock);
|
close(sock);
|
||||||
#endif
|
#endif
|
||||||
|
if (tempstorage)
|
||||||
|
fclose(tempstorage);
|
||||||
printf("all done\n");
|
printf("all done\n");
|
||||||
|
|
||||||
|
libssh2_exit();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
@@ -16,12 +16,12 @@
|
|||||||
#ifdef HAVE_WINSOCK2_H
|
#ifdef HAVE_WINSOCK2_H
|
||||||
# include <winsock2.h>
|
# include <winsock2.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_NETINET_IN_H
|
|
||||||
# include <netinet/in.h>
|
|
||||||
#endif
|
|
||||||
#ifdef HAVE_SYS_SOCKET_H
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
# include <sys/socket.h>
|
# include <sys/socket.h>
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_NETINET_IN_H
|
||||||
|
# include <netinet/in.h>
|
||||||
|
#endif
|
||||||
# ifdef HAVE_UNISTD_H
|
# ifdef HAVE_UNISTD_H
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
@@ -70,6 +70,12 @@ int main(int argc, char *argv[])
|
|||||||
sftppath = argv[4];
|
sftppath = argv[4];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rc = libssh2_init (0);
|
||||||
|
if (rc != 0) {
|
||||||
|
fprintf (stderr, "libssh2 initialization failed (%d)\n", rc);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The application code is responsible for creating the socket
|
* The application code is responsible for creating the socket
|
||||||
* and establishing the connection
|
* and establishing the connection
|
||||||
@@ -105,9 +111,9 @@ int main(int argc, char *argv[])
|
|||||||
* may have it hard coded, may go to a file, may present it to the
|
* may have it hard coded, may go to a file, may present it to the
|
||||||
* user, that's your call
|
* user, that's your call
|
||||||
*/
|
*/
|
||||||
fingerprint = libssh2_hostkey_hash(session, LIBSSH2_HOSTKEY_HASH_MD5);
|
fingerprint = libssh2_hostkey_hash(session, LIBSSH2_HOSTKEY_HASH_SHA1);
|
||||||
printf("Fingerprint: ");
|
printf("Fingerprint: ");
|
||||||
for(i = 0; i < 16; i++) {
|
for(i = 0; i < 20; i++) {
|
||||||
printf("%02X ", (unsigned char)fingerprint[i]);
|
printf("%02X ", (unsigned char)fingerprint[i]);
|
||||||
}
|
}
|
||||||
printf("\n");
|
printf("\n");
|
||||||
@@ -159,6 +165,9 @@ int main(int argc, char *argv[])
|
|||||||
#else
|
#else
|
||||||
close(sock);
|
close(sock);
|
||||||
#endif
|
#endif
|
||||||
printf("all done\n");
|
printf("all done\n");
|
||||||
|
|
||||||
|
libssh2_exit();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
@@ -16,12 +16,12 @@
|
|||||||
#ifdef HAVE_WINSOCK2_H
|
#ifdef HAVE_WINSOCK2_H
|
||||||
# include <winsock2.h>
|
# include <winsock2.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_NETINET_IN_H
|
|
||||||
# include <netinet/in.h>
|
|
||||||
#endif
|
|
||||||
#ifdef HAVE_SYS_SOCKET_H
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
# include <sys/socket.h>
|
# include <sys/socket.h>
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_NETINET_IN_H
|
||||||
|
# include <netinet/in.h>
|
||||||
|
#endif
|
||||||
# ifdef HAVE_UNISTD_H
|
# ifdef HAVE_UNISTD_H
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
@@ -73,6 +73,12 @@ int main(int argc, char *argv[])
|
|||||||
sftppath = argv[4];
|
sftppath = argv[4];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rc = libssh2_init (0);
|
||||||
|
if (rc != 0) {
|
||||||
|
fprintf (stderr, "libssh2 initialization failed (%d)\n", rc);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The application code is responsible for creating the socket
|
* The application code is responsible for creating the socket
|
||||||
* and establishing the connection
|
* and establishing the connection
|
||||||
@@ -108,9 +114,9 @@ int main(int argc, char *argv[])
|
|||||||
* may have it hard coded, may go to a file, may present it to the
|
* may have it hard coded, may go to a file, may present it to the
|
||||||
* user, that's your call
|
* user, that's your call
|
||||||
*/
|
*/
|
||||||
fingerprint = libssh2_hostkey_hash(session, LIBSSH2_HOSTKEY_HASH_MD5);
|
fingerprint = libssh2_hostkey_hash(session, LIBSSH2_HOSTKEY_HASH_SHA1);
|
||||||
printf("Fingerprint: ");
|
printf("Fingerprint: ");
|
||||||
for(i = 0; i < 16; i++) {
|
for(i = 0; i < 20; i++) {
|
||||||
printf("%02X ", (unsigned char)fingerprint[i]);
|
printf("%02X ", (unsigned char)fingerprint[i]);
|
||||||
}
|
}
|
||||||
printf("\n");
|
printf("\n");
|
||||||
@@ -165,6 +171,9 @@ int main(int argc, char *argv[])
|
|||||||
#else
|
#else
|
||||||
close(sock);
|
close(sock);
|
||||||
#endif
|
#endif
|
||||||
printf("all done\n");
|
printf("all done\n");
|
||||||
|
|
||||||
|
libssh2_exit();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user