1
1
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@352 7dcaeef0-15fb-0310-b436-a5af3365683c
Этот коммит содержится в:
Andreas Schneider 2009-04-02 11:53:24 +00:00
родитель d86ac9e04b
Коммит b6fbe97f24
2 изменённых файлов: 20 добавлений и 10 удалений

Просмотреть файл

@ -312,7 +312,7 @@ int ssh_options_set_username(SSH_OPTIONS *opt, const char *username);
int ssh_options_set_port(SSH_OPTIONS *opt, unsigned int port); int ssh_options_set_port(SSH_OPTIONS *opt, unsigned int port);
int ssh_options_getopt(SSH_OPTIONS *options, int *argcptr, char **argv); int ssh_options_getopt(SSH_OPTIONS *options, int *argcptr, char **argv);
int ssh_options_set_host(SSH_OPTIONS *opt, const char *host); int ssh_options_set_host(SSH_OPTIONS *opt, const char *host);
void ssh_options_set_fd(SSH_OPTIONS *opt, socket_t fd); int ssh_options_set_fd(SSH_OPTIONS *opt, socket_t fd);
void ssh_options_set_bind(SSH_OPTIONS *opt, const char *bindaddr, int port); void ssh_options_set_bind(SSH_OPTIONS *opt, const char *bindaddr, int port);
void ssh_options_set_identity(SSH_OPTIONS *opt, const char *identity); void ssh_options_set_identity(SSH_OPTIONS *opt, const char *identity);
void ssh_options_set_status_callback(SSH_OPTIONS *opt, void (*callback) void ssh_options_set_status_callback(SSH_OPTIONS *opt, void (*callback)

Просмотреть файл

@ -304,16 +304,26 @@ int ssh_options_set_username(SSH_OPTIONS *opt, const char *username) {
return 0; return 0;
} }
/** If you wish to open the socket yourself for a reason /**
* or another, set the file descriptor.\n * @brief Set a file descriptor for connection.
* don't forget to use ssh_option_set_hostname() as the hostname *
* is used as a key in the known_host mechanism * If you wish to open the socket yourself for a reason or another, set the
* \brief set a file descriptor for connection * file descriptor. Don't forget to use ssh_option_set_hostname() as the
* \param opt options structure * hostname is used as a key in the known_host mechanism.
* \param fd an opened file descriptor to use *
* @param opt The options structure to use.
*
* @param fd An opened file descriptor to use.
*
* @return 0 on success, < 0 on error.
*/ */
void ssh_options_set_fd(SSH_OPTIONS *opt, socket_t fd){ int ssh_options_set_fd(SSH_OPTIONS *opt, socket_t fd) {
opt->fd=fd; if (opt == NULL) {
return -1;
}
opt->fd = fd;
return 0;
} }
/** In case your client has multiple IP adresses, select the local address /** In case your client has multiple IP adresses, select the local address