summaryrefslogtreecommitdiff
path: root/src/ssh.h
blob: f7a3380086bd8c302cfff85ba3987e6059aff6aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#ifndef _SSH_H_
#define _SSH_H_

#include <libssh/libssh.h>
#include <libssh/sftp.h>


struct ssh_opts {
        char    *login_name;    /* -l */
        char    *port;          /* -p */
        char    *identity;      /* -i */
        char    *cipher;        /* -c */
        int     compress;       /* -C */
        int     debuglevel;     /* -v */

        char    *password;      /* filled at the first connecting phase */
};

/* ssh_make_sftp_session() creates sftp_session. sshdst accpets
 * user@hostname and hostname notations (by libssh).
 */
sftp_session ssh_make_sftp_session(char *sshdst, struct ssh_opts *opts);
void ssh_sftp_close(sftp_session sftp);

#define sftp_ssh(sftp) (sftp)->session

#endif /* _SSH_H_ */