00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef SOCKET_H_
00023 #define SOCKET_H_
00024
00025
00026
00027 struct socket;
00028 int ssh_socket_init(void);
00029 struct socket *ssh_socket_new(ssh_session session);
00030 void ssh_socket_free(struct socket *s);
00031 void ssh_socket_set_fd(struct socket *s, socket_t fd);
00032 socket_t ssh_socket_get_fd(struct socket *s);
00033 #ifndef _WIN32
00034 int ssh_socket_unix(struct socket *s, const char *path);
00035 #endif
00036 void ssh_socket_close(struct socket *s);
00037 int ssh_socket_read(struct socket *s, void *buffer, int len);
00038 int ssh_socket_write(struct socket *s,const void *buffer, int len);
00039 int ssh_socket_is_open(struct socket *s);
00040 int ssh_socket_fd_isset(struct socket *s, fd_set *set);
00041 void ssh_socket_fd_set(struct socket *s, fd_set *set, int *fd_max);
00042 int ssh_socket_completeread(struct socket *s, void *buffer, uint32_t len);
00043 int ssh_socket_completewrite(struct socket *s, const void *buffer, uint32_t len);
00044 int ssh_socket_wait_for_data(struct socket *s, ssh_session session, uint32_t len);
00045 int ssh_socket_nonblocking_flush(struct socket *s);
00046 int ssh_socket_blocking_flush(struct socket *s);
00047 int ssh_socket_poll(struct socket *s, int *writeable, int *except);
00048 void ssh_socket_set_towrite(struct socket *s);
00049 void ssh_socket_set_toread(struct socket *s);
00050 void ssh_socket_set_except(struct socket *s);
00051 int ssh_socket_get_status(struct socket *s);
00052 int ssh_socket_data_available(struct socket *s);
00053 int ssh_socket_data_writable(struct socket *s);
00054
00055 #endif