-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathssh_methods.h
More file actions
57 lines (45 loc) · 1.02 KB
/
Copy pathssh_methods.h
File metadata and controls
57 lines (45 loc) · 1.02 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/**
* SSH Methods for SSH server and client
*
* Methods are implemented in ssh_methods.c
**/
#ifndef SSH_RUN
#define SSH_RUN
#define LIBSSH_STATIC 1
#include<libssh/libssh.h>
#include<libssh/server.h>
/**
* Max size of result output
* Makes sure we don't run commands forever
**/
#define BUFFER_SIZE 2048
// Client only methods
/**
* Check if session is valid.
* Set HOST, LOG_VERBOSITY, and PORT
* Exit on fail
**/
void session_init(ssh_session session, char* host, int port, int verbosity, long timeout);
/**
* Setup channel
**/
int connect_session_client(ssh_session session, char* host);
/**
* Create channel
**/
void create_channel_client(ssh_session session, ssh_channel* channel);
// Server only methods
/**
* Handle authentication from server standpoint
**/
int handle_auth_server(ssh_session session);
/**
* Handle creating channel from server standpoint
**/
ssh_channel create_channel_server(ssh_session session);
// Both server and client
/**
* Cleanup ssh_session
**/
void cleanup(ssh_session session);
#endif