From b4111c5c187cf9212eba0ae459edb630dbddb656 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Tue, 28 Jul 2009 14:13:22 +0200 Subject: Add functions to get the extension count, name and data. --- sample.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'sample.c') diff --git a/sample.c b/sample.c index 3a7acfa0..1a8b0580 100644 --- a/sample.c +++ b/sample.c @@ -283,10 +283,12 @@ void do_sftp(SSH_SESSION *session){ SFTP_FILE *fichier; SFTP_FILE *to; int len=1; - int i; + unsigned int i; char data[8000]={0}; char *link; + unsigned int count; + if(!sftp_session){ fprintf(stderr, "sftp error initialising channel: %s\n", ssh_get_error(session)); @@ -298,6 +300,14 @@ void do_sftp(SSH_SESSION *session){ return; } + printf("Additional SFTP extensions provided by the server:\n"); + count = sftp_extensions_get_count(sftp_session); + for (i = 0; i < count; i++) { + printf("\t%s, version: %s\n", + sftp_extensions_get_name(sftp_session, i), + sftp_extensions_get_data(sftp_session, i)); + } + /* test symlink and readlink */ if (sftp_symlink(sftp_session, "/tmp/this_is_the_link", "/tmp/sftp_symlink_test") < 0) { -- cgit