我正在为我正在处理的需要 libssh 的 linux 程序编写一些代码。我正在查看他们的教程页面,我看到它通过ssh_options_set()
引用传递了所有参数。这是为什么?
#include <libssh/libssh.h>
#include <stdlib.h>
int main()
{
ssh_session my_ssh_session;
int verbosity = SSH_LOG_PROTOCOL;
int port = 22;
my_ssh_session = ssh_new();
if (my_ssh_session == NULL)
exit(-1);
ssh_options_set(my_ssh_session, SSH_OPTIONS_HOST, "localhost");
ssh_options_set(my_ssh_session, SSH_OPTIONS_LOG_VERBOSITY, &verbosity); //here
ssh_options_set(my_ssh_session, SSH_OPTIONS_PORT, &port); //here
...
ssh_free(my_ssh_session);
}