#include <libssh2.h>
#include <libssh2_sftp.h>
#include <netdb.h>
#include <arpa/inet.h>
#include <sys/types.h>
#include <fcntl.h>
#include <errno.h>
#include <stdio.h>
#include <ctype.h>
#include <time.h>
#include "service.h"
Go to the source code of this file.
|
ZOO_DLL_EXPORT SSHCON * | ssh_connect (maps *) |
| Connect to a remote host using SSH protocol. More...
|
|
ZOO_DLL_EXPORT bool | ssh_copy (maps *, const char *, const char *, int) |
| Upload a file over an opened SSH connection. More...
|
|
ZOO_DLL_EXPORT int | ssh_get_cnt (maps *) |
| Get the number of opened SSH connections. More...
|
|
ZOO_DLL_EXPORT int | ssh_fetch (maps *, const char *, const char *, int) |
| Download a file over an opened SSH connection. More...
|
|
ZOO_DLL_EXPORT int | ssh_exec (maps *, const char *, int) |
| Execute a command over an opened SSH connection. More...
|
|
ZOO_DLL_EXPORT bool | ssh_close_session (maps *, SSHCON *) |
| Close an opened SSH connection. More...
|
|
ZOO_DLL_EXPORT bool | ssh_close (maps *) |
| Close all the opened SSH connections. More...
|
|
ZOO_DLL_EXPORT bool | addToUploadQueue (maps **, maps *) |
|
ZOO_DLL_EXPORT bool | runUpload (maps **) |
|
Data Fields |
int |
index |
|
LIBSSH2_SESSION * |
session |
|
LIBSSH2_SFTP * |
sftp_session |
|
int |
sock_id |
|
#define MAX_PARALLEL_SSH_CON 128 |
Close all the opened SSH connections.
- Parameters
-
conf | maps pointer to the main configuration maps |
- Returns
- true in case of success, false if failure occured
Close an opened SSH connection.
- Parameters
-
conf | maps pointer to the main configuration maps |
con | SSHCON pointer to the SSH connection |
- Returns
- true in case of success, false if failure occured
Connect to a remote host using SSH protocol.
- Parameters
-
conf | maps The main configuration maps |
- Returns
- the libssh2 sessions pointer or NULL in case any failure occured.
ZOO_DLL_EXPORT bool ssh_copy |
( |
maps * |
conf, |
|
|
const char * |
localPath, |
|
|
const char * |
targetPath, |
|
|
int |
cnt |
|
) |
| |
Upload a file over an opened SSH connection.
- Parameters
-
conf | maps pointer to the main configuration maps |
localPath | const char* defining the local path for accessing the file |
targetPath | const char* defining the path for storing the file on the remote host |
- Returns
- true in case of success, false if failure occured
Execute a command over an opened SSH connection.
- Parameters
-
conf | maps pointer to the main configuration maps |
command | const char pointer to the command to be executed |
- Returns
- bytecount resulting from the execution of the command
ZOO_DLL_EXPORT int ssh_fetch |
( |
maps * |
conf, |
|
|
const char * |
localPath, |
|
|
const char * |
targetPath, |
|
|
int |
cnt |
|
) |
| |
Download a file over an opened SSH connection.
- Parameters
-
conf | maps pointer to the main configuration maps |
localPath | const char* defining the local path for storing the file |
targetPath | const char* defining the path for accessing the file on the remote host |
- Returns
- 0 in case of success, -1 if failure occured
Get the number of opened SSH connections.
- Parameters
-
conf | maps pointer to the main configuration maps |
- Returns
- the number of opened SSH connections