Add functions to get the extension count, name and data.

This commit is contained in:
Andreas Schneider
2009-07-28 14:13:22 +02:00
parent b9b7174d85
commit b4111c5c18
3 changed files with 77 additions and 1 deletions

View File

@@ -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) {