24 #include "libssh/callbacks.h"
25 struct ssh_poll_handle_struct;
28 struct ssh_socket_struct;
29 typedef struct ssh_socket_struct* ssh_socket;
31 int ssh_socket_init(
void);
32 void ssh_socket_cleanup(
void);
33 ssh_socket ssh_socket_new(ssh_session session);
34 void ssh_socket_reset(ssh_socket s);
35 void ssh_socket_free(ssh_socket s);
36 void ssh_socket_set_fd(ssh_socket s, socket_t fd);
37 socket_t ssh_socket_get_fd_in(ssh_socket s);
39 int ssh_socket_unix(ssh_socket s,
const char *path);
40 void ssh_execute_command(
const char *command, socket_t in, socket_t out);
41 int ssh_socket_connect_proxycommand(ssh_socket s,
const char *command);
43 void ssh_socket_close(ssh_socket s);
44 int ssh_socket_write(ssh_socket s,
const void *buffer,
int len);
45 int ssh_socket_is_open(ssh_socket s);
46 int ssh_socket_fd_isset(ssh_socket s, fd_set *set);
47 void ssh_socket_fd_set(ssh_socket s, fd_set *set, socket_t *max_fd);
48 void ssh_socket_set_fd_in(ssh_socket s, socket_t fd);
49 void ssh_socket_set_fd_out(ssh_socket s, socket_t fd);
50 int ssh_socket_nonblocking_flush(ssh_socket s);
51 void ssh_socket_set_write_wontblock(ssh_socket s);
52 void ssh_socket_set_read_wontblock(ssh_socket s);
53 void ssh_socket_set_except(ssh_socket s);
54 int ssh_socket_get_status(ssh_socket s);
55 int ssh_socket_get_poll_flags(ssh_socket s);
56 int ssh_socket_buffered_write_bytes(ssh_socket s);
57 int ssh_socket_data_available(ssh_socket s);
58 int ssh_socket_data_writable(ssh_socket s);
59 int ssh_socket_set_nonblocking(socket_t fd);
60 int ssh_socket_set_blocking(socket_t fd);
62 void ssh_socket_set_callbacks(ssh_socket s, ssh_socket_callbacks callbacks);
63 int ssh_socket_pollcallback(
struct ssh_poll_handle_struct *p, socket_t fd,
int revents,
void *v_s);
64 struct ssh_poll_handle_struct * ssh_socket_get_poll_handle_in(ssh_socket s);
65 struct ssh_poll_handle_struct * ssh_socket_get_poll_handle_out(ssh_socket s);
67 int ssh_socket_connect(ssh_socket s,
const char *host,
int port,
const char *bind_addr);