Sophie

Sophie

distrib > Fedora > 18 > i386 > by-pkgid > ee8fafc31a7ba3ce3ae4499cedf4e1bc > files > 74

libssh-devel-0.5.5-1.fc18.i686.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.3.1"/>
<title>libssh: The SSH session functions.</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">libssh
   &#160;<span id="projectnumber">0.5.5</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.3.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">The SSH session functions.<div class="ingroups"><a class="el" href="group__libssh.html">The libssh API</a></div></div>  </div>
</div><!--header-->
<div class="contents">

<p>Functions that manage a session.  
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga60da8e2c47897a209a455923c35d52d8"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__libssh__session.html#ga60da8e2c47897a209a455923c35d52d8">ssh_blocking_flush</a> (ssh_session session, int timeout)</td></tr>
<tr class="memdesc:ga60da8e2c47897a209a455923c35d52d8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Blocking flush of the outgoing buffer.  <a href="#ga60da8e2c47897a209a455923c35d52d8">More...</a><br/></td></tr>
<tr class="separator:ga60da8e2c47897a209a455923c35d52d8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga07827fd70a51ddc4030364f220eb4c9c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__libssh__session.html#ga07827fd70a51ddc4030364f220eb4c9c">ssh_clean_pubkey_hash</a> (unsigned char **hash)</td></tr>
<tr class="memdesc:ga07827fd70a51ddc4030364f220eb4c9c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Deallocate the hash obtained by ssh_get_pubkey_hash.  <a href="#ga07827fd70a51ddc4030364f220eb4c9c">More...</a><br/></td></tr>
<tr class="separator:ga07827fd70a51ddc4030364f220eb4c9c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga032e07cbd8bc3f14cb2dd375db0b03d7"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__libssh__session.html#ga032e07cbd8bc3f14cb2dd375db0b03d7">ssh_connect</a> (ssh_session session)</td></tr>
<tr class="memdesc:ga032e07cbd8bc3f14cb2dd375db0b03d7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Connect to the ssh server.  <a href="#ga032e07cbd8bc3f14cb2dd375db0b03d7">More...</a><br/></td></tr>
<tr class="separator:ga032e07cbd8bc3f14cb2dd375db0b03d7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0f048a4c0dbe02cfb7e9c5b6d0db0f27"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__libssh__session.html#ga0f048a4c0dbe02cfb7e9c5b6d0db0f27">ssh_disconnect</a> (ssh_session session)</td></tr>
<tr class="memdesc:ga0f048a4c0dbe02cfb7e9c5b6d0db0f27"><td class="mdescLeft">&#160;</td><td class="mdescRight">Disconnect from a session (client or server).  <a href="#ga0f048a4c0dbe02cfb7e9c5b6d0db0f27">More...</a><br/></td></tr>
<tr class="separator:ga0f048a4c0dbe02cfb7e9c5b6d0db0f27"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae5af27a98a7488e9f5ded6b37c274156"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__libssh__session.html#gae5af27a98a7488e9f5ded6b37c274156">ssh_free</a> (ssh_session session)</td></tr>
<tr class="memdesc:gae5af27a98a7488e9f5ded6b37c274156"><td class="mdescLeft">&#160;</td><td class="mdescRight">Deallocate a SSH session handle.  <a href="#gae5af27a98a7488e9f5ded6b37c274156">More...</a><br/></td></tr>
<tr class="separator:gae5af27a98a7488e9f5ded6b37c274156"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad19e368e35d48e02ba95970a7d1e87f5"><td class="memItemLeft" align="right" valign="top">const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__libssh__session.html#gad19e368e35d48e02ba95970a7d1e87f5">ssh_get_disconnect_message</a> (ssh_session session)</td></tr>
<tr class="memdesc:gad19e368e35d48e02ba95970a7d1e87f5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the disconnect message from the server.  <a href="#gad19e368e35d48e02ba95970a7d1e87f5">More...</a><br/></td></tr>
<tr class="separator:gad19e368e35d48e02ba95970a7d1e87f5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gafe509fcea47714b5cd277d1e35e83276"><td class="memItemLeft" align="right" valign="top">socket_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__libssh__session.html#gafe509fcea47714b5cd277d1e35e83276">ssh_get_fd</a> (ssh_session session)</td></tr>
<tr class="memdesc:gafe509fcea47714b5cd277d1e35e83276"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the fd of a connection.  <a href="#gafe509fcea47714b5cd277d1e35e83276">More...</a><br/></td></tr>
<tr class="separator:gafe509fcea47714b5cd277d1e35e83276"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga89864d4d5cc6d3d6ef1c39652f2a688f"><td class="memItemLeft" align="right" valign="top">char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__libssh__session.html#ga89864d4d5cc6d3d6ef1c39652f2a688f">ssh_get_issue_banner</a> (ssh_session session)</td></tr>
<tr class="memdesc:ga89864d4d5cc6d3d6ef1c39652f2a688f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the issue banner from the server.  <a href="#ga89864d4d5cc6d3d6ef1c39652f2a688f">More...</a><br/></td></tr>
<tr class="separator:ga89864d4d5cc6d3d6ef1c39652f2a688f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac55d2895467a1e898ee75b4710d836a5"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__libssh__session.html#gac55d2895467a1e898ee75b4710d836a5">ssh_get_openssh_version</a> (ssh_session session)</td></tr>
<tr class="memdesc:gac55d2895467a1e898ee75b4710d836a5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the version of the OpenSSH server, if it is not an OpenSSH server then 0 will be returned.  <a href="#gac55d2895467a1e898ee75b4710d836a5">More...</a><br/></td></tr>
<tr class="separator:gac55d2895467a1e898ee75b4710d836a5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf8ff0e2236d54d964a82f68d7323a741"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__libssh__session.html#gaf8ff0e2236d54d964a82f68d7323a741">ssh_get_pubkey_hash</a> (ssh_session session, unsigned char **hash)</td></tr>
<tr class="memdesc:gaf8ff0e2236d54d964a82f68d7323a741"><td class="mdescLeft">&#160;</td><td class="mdescRight">Allocates a buffer with the MD5 hash of the server public key.  <a href="#gaf8ff0e2236d54d964a82f68d7323a741">More...</a><br/></td></tr>
<tr class="separator:gaf8ff0e2236d54d964a82f68d7323a741"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac199314d1646372c566ef14b9b6dca53"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__libssh__session.html#gac199314d1646372c566ef14b9b6dca53">ssh_get_status</a> (ssh_session session)</td></tr>
<tr class="memdesc:gac199314d1646372c566ef14b9b6dca53"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get session status.  <a href="#gac199314d1646372c566ef14b9b6dca53">More...</a><br/></td></tr>
<tr class="separator:gac199314d1646372c566ef14b9b6dca53"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8467735e4735165336f68ee82e24de0e"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__libssh__session.html#ga8467735e4735165336f68ee82e24de0e">ssh_get_version</a> (ssh_session session)</td></tr>
<tr class="memdesc:ga8467735e4735165336f68ee82e24de0e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the protocol version of the session.  <a href="#ga8467735e4735165336f68ee82e24de0e">More...</a><br/></td></tr>
<tr class="separator:ga8467735e4735165336f68ee82e24de0e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0c959bde817801ac5de2db1e64b52f26"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__libssh__session.html#ga0c959bde817801ac5de2db1e64b52f26">ssh_is_blocking</a> (ssh_session session)</td></tr>
<tr class="memdesc:ga0c959bde817801ac5de2db1e64b52f26"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the blocking mode of libssh.  <a href="#ga0c959bde817801ac5de2db1e64b52f26">More...</a><br/></td></tr>
<tr class="separator:ga0c959bde817801ac5de2db1e64b52f26"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga49d8f413a3c7879070a112703de1d6e2"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__libssh__session.html#ga49d8f413a3c7879070a112703de1d6e2">ssh_is_connected</a> (ssh_session session)</td></tr>
<tr class="memdesc:ga49d8f413a3c7879070a112703de1d6e2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Check if we are connected.  <a href="#ga49d8f413a3c7879070a112703de1d6e2">More...</a><br/></td></tr>
<tr class="separator:ga49d8f413a3c7879070a112703de1d6e2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6f37e3d7bb6b938b44d6a34a76fdfa0b"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__libssh__session.html#ga6f37e3d7bb6b938b44d6a34a76fdfa0b">ssh_is_server_known</a> (ssh_session session)</td></tr>
<tr class="memdesc:ga6f37e3d7bb6b938b44d6a34a76fdfa0b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Check if the server is known.  <a href="#ga6f37e3d7bb6b938b44d6a34a76fdfa0b">More...</a><br/></td></tr>
<tr class="separator:ga6f37e3d7bb6b938b44d6a34a76fdfa0b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaadadc0f9601547c30db7c4d62017d32c"><td class="memItemLeft" align="right" valign="top">ssh_session&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__libssh__session.html#gaadadc0f9601547c30db7c4d62017d32c">ssh_new</a> (void)</td></tr>
<tr class="memdesc:gaadadc0f9601547c30db7c4d62017d32c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a new ssh session.  <a href="#gaadadc0f9601547c30db7c4d62017d32c">More...</a><br/></td></tr>
<tr class="separator:gaadadc0f9601547c30db7c4d62017d32c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaead8cef1f39e785139bc510852ce1dff"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__libssh__session.html#gaead8cef1f39e785139bc510852ce1dff">ssh_options_copy</a> (ssh_session src, ssh_session *dest)</td></tr>
<tr class="memdesc:gaead8cef1f39e785139bc510852ce1dff"><td class="mdescLeft">&#160;</td><td class="mdescRight">Duplicate the options of a session structure.  <a href="#gaead8cef1f39e785139bc510852ce1dff">More...</a><br/></td></tr>
<tr class="separator:gaead8cef1f39e785139bc510852ce1dff"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga93f7f7159893f3ce62c9b178724eff75"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__libssh__session.html#ga93f7f7159893f3ce62c9b178724eff75">ssh_options_getopt</a> (ssh_session session, int *argcptr, char **argv)</td></tr>
<tr class="memdesc:ga93f7f7159893f3ce62c9b178724eff75"><td class="mdescLeft">&#160;</td><td class="mdescRight">Parse command line arguments.  <a href="#ga93f7f7159893f3ce62c9b178724eff75">More...</a><br/></td></tr>
<tr class="separator:ga93f7f7159893f3ce62c9b178724eff75"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga82371e723260c7572ea061edecc2e9f1"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__libssh__session.html#ga82371e723260c7572ea061edecc2e9f1">ssh_options_parse_config</a> (ssh_session session, const char *filename)</td></tr>
<tr class="memdesc:ga82371e723260c7572ea061edecc2e9f1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Parse the ssh config file.  <a href="#ga82371e723260c7572ea061edecc2e9f1">More...</a><br/></td></tr>
<tr class="separator:ga82371e723260c7572ea061edecc2e9f1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7a801b85800baa3f4e16f5b47db0a73d"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__libssh__session.html#ga7a801b85800baa3f4e16f5b47db0a73d">ssh_options_set</a> (ssh_session session, enum ssh_options_e type, const void *value)</td></tr>
<tr class="memdesc:ga7a801b85800baa3f4e16f5b47db0a73d"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function can set all possible ssh options.  <a href="#ga7a801b85800baa3f4e16f5b47db0a73d">More...</a><br/></td></tr>
<tr class="separator:ga7a801b85800baa3f4e16f5b47db0a73d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga86cbf041bced56d18a2a5248c46cecb4"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__libssh__session.html#ga86cbf041bced56d18a2a5248c46cecb4">ssh_select</a> (ssh_channel *channels, ssh_channel *outchannels, socket_t maxfd, fd_set *readfds, struct timeval *timeout)</td></tr>
<tr class="memdesc:ga86cbf041bced56d18a2a5248c46cecb4"><td class="mdescLeft">&#160;</td><td class="mdescRight">A wrapper for the select syscall.  <a href="#ga86cbf041bced56d18a2a5248c46cecb4">More...</a><br/></td></tr>
<tr class="separator:ga86cbf041bced56d18a2a5248c46cecb4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga2a29cff08855611be84d050e5bec73bc"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__libssh__session.html#ga2a29cff08855611be84d050e5bec73bc">ssh_set_blocking</a> (ssh_session session, int blocking)</td></tr>
<tr class="memdesc:ga2a29cff08855611be84d050e5bec73bc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the session in blocking/nonblocking mode.  <a href="#ga2a29cff08855611be84d050e5bec73bc">More...</a><br/></td></tr>
<tr class="separator:ga2a29cff08855611be84d050e5bec73bc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga06453278350fd9e940c5c1b0d5225f19"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__libssh__session.html#ga06453278350fd9e940c5c1b0d5225f19">ssh_set_fd_except</a> (ssh_session session)</td></tr>
<tr class="memdesc:ga06453278350fd9e940c5c1b0d5225f19"><td class="mdescLeft">&#160;</td><td class="mdescRight">Tell the session it has an exception to catch on the file descriptor.  <a href="#ga06453278350fd9e940c5c1b0d5225f19">More...</a><br/></td></tr>
<tr class="separator:ga06453278350fd9e940c5c1b0d5225f19"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0e05c91c6f475eabc8d221914d25a425"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__libssh__session.html#ga0e05c91c6f475eabc8d221914d25a425">ssh_set_fd_toread</a> (ssh_session session)</td></tr>
<tr class="memdesc:ga0e05c91c6f475eabc8d221914d25a425"><td class="mdescLeft">&#160;</td><td class="mdescRight">Tell the session it has data to read on the file descriptor without blocking.  <a href="#ga0e05c91c6f475eabc8d221914d25a425">More...</a><br/></td></tr>
<tr class="separator:ga0e05c91c6f475eabc8d221914d25a425"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3f1b3c59662464eec3649d3d72a40543"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__libssh__session.html#ga3f1b3c59662464eec3649d3d72a40543">ssh_set_fd_towrite</a> (ssh_session session)</td></tr>
<tr class="memdesc:ga3f1b3c59662464eec3649d3d72a40543"><td class="mdescLeft">&#160;</td><td class="mdescRight">Tell the session it may write to the file descriptor without blocking.  <a href="#ga3f1b3c59662464eec3649d3d72a40543">More...</a><br/></td></tr>
<tr class="separator:ga3f1b3c59662464eec3649d3d72a40543"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae1bd16255ba373325adf76307d0c8c42"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__libssh__session.html#gae1bd16255ba373325adf76307d0c8c42">ssh_silent_disconnect</a> (ssh_session session)</td></tr>
<tr class="memdesc:gae1bd16255ba373325adf76307d0c8c42"><td class="mdescLeft">&#160;</td><td class="mdescRight">Disconnect impolitely from a remote host by closing the socket.  <a href="#gae1bd16255ba373325adf76307d0c8c42">More...</a><br/></td></tr>
<tr class="separator:gae1bd16255ba373325adf76307d0c8c42"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf61a9cfdc40c76ffce9f9a8543755d36"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__libssh__session.html#gaf61a9cfdc40c76ffce9f9a8543755d36">ssh_write_knownhost</a> (ssh_session session)</td></tr>
<tr class="memdesc:gaf61a9cfdc40c76ffce9f9a8543755d36"><td class="mdescLeft">&#160;</td><td class="mdescRight">Write the current server as known in the known hosts file.  <a href="#gaf61a9cfdc40c76ffce9f9a8543755d36">More...</a><br/></td></tr>
<tr class="separator:gaf61a9cfdc40c76ffce9f9a8543755d36"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>Functions that manage a session. </p>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="ga60da8e2c47897a209a455923c35d52d8"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int ssh_blocking_flush </td>
          <td>(</td>
          <td class="paramtype">ssh_session&#160;</td>
          <td class="paramname"><em>session</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>timeout</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Blocking flush of the outgoing buffer. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">session</td><td>The SSH session </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">timeout</td><td>Set an upper limit on the time for which this function will block, in milliseconds. Specifying -1 means an infinite timeout. This parameter is passed to the poll() function. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>SSH_OK on success, SSH_AGAIN if timeout occurred, SSH_ERROR otherwise. </dd></dl>

</div>
</div>
<a class="anchor" id="ga07827fd70a51ddc4030364f220eb4c9c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ssh_clean_pubkey_hash </td>
          <td>(</td>
          <td class="paramtype">unsigned char **&#160;</td>
          <td class="paramname"><em>hash</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Deallocate the hash obtained by ssh_get_pubkey_hash. </p>
<p>This is required under Microsoft platform as this library might use a different C library than your software, hence a different heap.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">hash</td><td>The buffer to deallocate.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="group__libssh__session.html#gaf8ff0e2236d54d964a82f68d7323a741" title="Allocates a buffer with the MD5 hash of the server public key.">ssh_get_pubkey_hash()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="ga032e07cbd8bc3f14cb2dd375db0b03d7"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int ssh_connect </td>
          <td>(</td>
          <td class="paramtype">ssh_session&#160;</td>
          <td class="paramname"><em>session</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Connect to the ssh server. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">session</td><td>The ssh session to connect.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>SSH_OK on success, SSH_ERROR on error. </dd>
<dd>
SSH_AGAIN, if the session is in nonblocking mode, and call must be done again.</dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="group__libssh__session.html#gaadadc0f9601547c30db7c4d62017d32c" title="Create a new ssh session.">ssh_new()</a> </dd>
<dd>
<a class="el" href="group__libssh__session.html#ga0f048a4c0dbe02cfb7e9c5b6d0db0f27" title="Disconnect from a session (client or server).">ssh_disconnect()</a> </dd></dl>

<p>References <a class="el" href="group__libssh.html#ga3ebf8d6920e563f3b032e3cd5277598e">ssh_init()</a>, <a class="el" href="group__libssh__session.html#ga0c959bde817801ac5de2db1e64b52f26">ssh_is_blocking()</a>, <a class="el" href="group__libssh__log.html#ga0bb252b81e0c497fc559c9e4007cf6c5">ssh_log()</a>, <a class="el" href="group__libssh__log.html#gga06fc87d81c62e9abb8790b6e5713c55ba6445dfe21592d69d9741d319538b6673">SSH_LOG_PACKET</a>, <a class="el" href="group__libssh__log.html#gga06fc87d81c62e9abb8790b6e5713c55ba75fa79e63947b66462db977d9b5ae27c">SSH_LOG_PROTOCOL</a>, and <a class="el" href="group__libssh__log.html#gga06fc87d81c62e9abb8790b6e5713c55ba1d3fcdd7b5218f2dcc6471c436792075">SSH_LOG_RARE</a>.</p>

<p>Referenced by <a class="el" href="classssh_1_1Session.html#a2a88d7dd524e81cb9152a87cb6fefc40">ssh::Session::connect()</a>.</p>

</div>
</div>
<a class="anchor" id="ga0f048a4c0dbe02cfb7e9c5b6d0db0f27"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ssh_disconnect </td>
          <td>(</td>
          <td class="paramtype">ssh_session&#160;</td>
          <td class="paramname"><em>session</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Disconnect from a session (client or server). </p>
<p>The session can then be reused to open a new session.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">session</td><td>The SSH session to use. </td></tr>
  </table>
  </dd>
</dl>

<p>References <a class="el" href="group__libssh__channel.html#gad1417f9eae8928fed20faafe2d9dbfff">ssh_channel_free()</a>, <a class="el" href="group__libssh__string.html#gacd9c4eb69f7ecfdcf709deb8dde6a5a8">ssh_string_free()</a>, and <a class="el" href="group__libssh__string.html#ga4154ea16ba2dc5bd5dcb2579686aaac2">ssh_string_from_char()</a>.</p>

<p>Referenced by <a class="el" href="classssh_1_1Session.html#aaa6972fe2757370a0cf2b90576eb6edc">ssh::Session::disconnect()</a>, and <a class="el" href="group__libssh__session.html#gae1bd16255ba373325adf76307d0c8c42">ssh_silent_disconnect()</a>.</p>

</div>
</div>
<a class="anchor" id="gae5af27a98a7488e9f5ded6b37c274156"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ssh_free </td>
          <td>(</td>
          <td class="paramtype">ssh_session&#160;</td>
          <td class="paramname"><em>session</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Deallocate a SSH session handle. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">session</td><td>The SSH session to free.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="group__libssh__session.html#ga0f048a4c0dbe02cfb7e9c5b6d0db0f27" title="Disconnect from a session (client or server).">ssh_disconnect()</a> </dd>
<dd>
<a class="el" href="group__libssh__session.html#gaadadc0f9601547c30db7c4d62017d32c" title="Create a new ssh session.">ssh_new()</a> </dd></dl>

<p>References <a class="el" href="group__libssh__auth.html#ga083af6f8d42a71fab6185137bf155de2">privatekey_free()</a>, <a class="el" href="group__libssh__buffer.html#ga608cf73226454f21e8b2f9f1d838c5fc">ssh_buffer_free()</a>, <a class="el" href="group__libssh__channel.html#gad1417f9eae8928fed20faafe2d9dbfff">ssh_channel_free()</a>, and <a class="el" href="group__libssh__poll.html#ga86bd0c5c2fa5614acef127e6689282ae">ssh_poll_ctx_free()</a>.</p>

<p>Referenced by <a class="el" href="group__libssh__session.html#gaadadc0f9601547c30db7c4d62017d32c">ssh_new()</a>.</p>

</div>
</div>
<a class="anchor" id="gad19e368e35d48e02ba95970a7d1e87f5"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const char* ssh_get_disconnect_message </td>
          <td>(</td>
          <td class="paramtype">ssh_session&#160;</td>
          <td class="paramname"><em>session</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the disconnect message from the server. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">session</td><td>The ssh session to use.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The message sent by the server along with the disconnect, or NULL in which case the reason of the disconnect may be found with ssh_get_error.</dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="group__libssh__error.html#ga9241586665bf21f823806473fc386258" title="Retrieve the error text message from the last error.">ssh_get_error()</a> </dd></dl>

<p>Referenced by <a class="el" href="classssh_1_1Session.html#a4e0c0bcc2cc0d129e049b5b51bf1cbe8">ssh::Session::getDisconnectMessage()</a>.</p>

</div>
</div>
<a class="anchor" id="gafe509fcea47714b5cd277d1e35e83276"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">socket_t ssh_get_fd </td>
          <td>(</td>
          <td class="paramtype">ssh_session&#160;</td>
          <td class="paramname"><em>session</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the fd of a connection. </p>
<p>In case you'd need the file descriptor of the connection to the server/client.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">session</td><td>The ssh session to use.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The file descriptor of the connection, or -1 if it is not connected </dd></dl>

<p>Referenced by <a class="el" href="classssh_1_1Session.html#a30c021f6138124d785f151583e5656bd">ssh::Session::getSocket()</a>.</p>

</div>
</div>
<a class="anchor" id="ga89864d4d5cc6d3d6ef1c39652f2a688f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">char* ssh_get_issue_banner </td>
          <td>(</td>
          <td class="paramtype">ssh_session&#160;</td>
          <td class="paramname"><em>session</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the issue banner from the server. </p>
<p>This is the banner showing a disclaimer to users who log in, typically their right or the fact that they will be monitored.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">session</td><td>The SSH session to use.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A newly allocated string with the banner, NULL on error. </dd></dl>

<p>References <a class="el" href="group__libssh__string.html#ga65cbd5f2c5f02599c1c285efd1f06351">ssh_string_to_char()</a>.</p>

<p>Referenced by <a class="el" href="classssh_1_1Session.html#a9969ed8dcaccef321ac519271758b406">ssh::Session::getIssueBanner()</a>.</p>

</div>
</div>
<a class="anchor" id="gac55d2895467a1e898ee75b4710d836a5"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int ssh_get_openssh_version </td>
          <td>(</td>
          <td class="paramtype">ssh_session&#160;</td>
          <td class="paramname"><em>session</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the version of the OpenSSH server, if it is not an OpenSSH server then 0 will be returned. </p>
<p>You can use the SSH_VERSION_INT macro to compare version numbers.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">session</td><td>The SSH session to use.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The version number if available, 0 otherwise. </dd></dl>

<p>Referenced by <a class="el" href="classssh_1_1Session.html#a9e0af590062a73a0927bb513bc19dd8e">ssh::Session::getOpensshVersion()</a>.</p>

</div>
</div>
<a class="anchor" id="gaf8ff0e2236d54d964a82f68d7323a741"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int ssh_get_pubkey_hash </td>
          <td>(</td>
          <td class="paramtype">ssh_session&#160;</td>
          <td class="paramname"><em>session</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char **&#160;</td>
          <td class="paramname"><em>hash</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Allocates a buffer with the MD5 hash of the server public key. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">session</td><td>The SSH session to use.</td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">hash</td><td>The buffer to allocate.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The bytes allocated or &lt; 0 on error.</dd></dl>
<dl class="section warning"><dt>Warning</dt><dd>It is very important that you verify at some moment that the hash matches a known server. If you don't do it, cryptography wont help you at making things secure</dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="group__libssh__session.html#ga6f37e3d7bb6b938b44d6a34a76fdfa0b" title="Check if the server is known.">ssh_is_server_known()</a> </dd>
<dd>
ssh_get_hexa() </dd>
<dd>
ssh_print_hexa() </dd></dl>

<p>References <a class="el" href="group__libssh__string.html#ga331553369afbfcb4f5300729ed65d0fe">ssh_string_len()</a>.</p>

</div>
</div>
<a class="anchor" id="gac199314d1646372c566ef14b9b6dca53"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int ssh_get_status </td>
          <td>(</td>
          <td class="paramtype">ssh_session&#160;</td>
          <td class="paramname"><em>session</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get session status. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">session</td><td>The ssh session to use.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A bitmask including SSH_CLOSED, SSH_READ_PENDING or SSH_CLOSED_ERROR which respectively means the session is closed, has data to read on the connection socket and session was closed due to an error. </dd></dl>

</div>
</div>
<a class="anchor" id="ga8467735e4735165336f68ee82e24de0e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int ssh_get_version </td>
          <td>(</td>
          <td class="paramtype">ssh_session&#160;</td>
          <td class="paramname"><em>session</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the protocol version of the session. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">session</td><td>The ssh session to use.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>1 or 2, for ssh1 or ssh2, &lt; 0 on error. </dd></dl>

<p>Referenced by <a class="el" href="classssh_1_1Session.html#a5d7b4df57ed97f2592893b0493336b88">ssh::Session::getVersion()</a>.</p>

</div>
</div>
<a class="anchor" id="ga0c959bde817801ac5de2db1e64b52f26"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int ssh_is_blocking </td>
          <td>(</td>
          <td class="paramtype">ssh_session&#160;</td>
          <td class="paramname"><em>session</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Return the blocking mode of libssh. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">session</td><td>The SSH session </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 if the session is nonblocking, </dd>
<dd>
1 if the functions may block. </dd></dl>

<p>Referenced by <a class="el" href="group__libssh__session.html#ga032e07cbd8bc3f14cb2dd375db0b03d7">ssh_connect()</a>.</p>

</div>
</div>
<a class="anchor" id="ga49d8f413a3c7879070a112703de1d6e2"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int ssh_is_connected </td>
          <td>(</td>
          <td class="paramtype">ssh_session&#160;</td>
          <td class="paramname"><em>session</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Check if we are connected. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">session</td><td>The session to check if it is connected.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>1 if we are connected, 0 if not. </dd></dl>

</div>
</div>
<a class="anchor" id="ga6f37e3d7bb6b938b44d6a34a76fdfa0b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int ssh_is_server_known </td>
          <td>(</td>
          <td class="paramtype">ssh_session&#160;</td>
          <td class="paramname"><em>session</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Check if the server is known. </p>
<p>Checks the user's known host file for a previous connection to the current server.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">session</td><td>The SSH session to use.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>SSH_SERVER_KNOWN_OK: The server is known and has not changed.<br/>
 SSH_SERVER_KNOWN_CHANGED: The server key has changed. Either you are under attack or the administrator changed the key. You HAVE to warn the user about a possible attack.<br/>
 SSH_SERVER_FOUND_OTHER: The server gave use a key of a type while we had an other type recorded. It is a possible attack.<br/>
 SSH_SERVER_NOT_KNOWN: The server is unknown. User should confirm the MD5 is correct.<br/>
 SSH_SERVER_FILE_NOT_FOUND: The known host file does not exist. The host is thus unknown. File will be created if host key is accepted.<br/>
 SSH_SERVER_ERROR: Some error happened.</dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="group__libssh__session.html#gaf8ff0e2236d54d964a82f68d7323a741" title="Allocates a buffer with the MD5 hash of the server public key.">ssh_get_pubkey_hash()</a></dd></dl>
<dl class="bug"><dt><b><a class="el" href="bug.html#_bug000002">Bug:</a></b></dt><dd>There is no current way to remove or modify an entry into the known host table. </dd></dl>

<p>References <a class="el" href="group__libssh__session.html#gaf61a9cfdc40c76ffce9f9a8543755d36">ssh_write_knownhost()</a>.</p>

<p>Referenced by <a class="el" href="classssh_1_1Session.html#a0b7055cb236685a9c18cb79c5492b40f">ssh::Session::isServerKnown()</a>.</p>

</div>
</div>
<a class="anchor" id="gaadadc0f9601547c30db7c4d62017d32c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">ssh_session ssh_new </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Create a new ssh session. </p>
<dl class="section return"><dt>Returns</dt><dd>A new ssh_session pointer, NULL on error. </dd></dl>

<p>References <a class="el" href="group__libssh__buffer.html#ga7ecc914104a5bf0da485d3e42f6a7d3b">ssh_buffer_new()</a>, <a class="el" href="group__libssh__session.html#gae5af27a98a7488e9f5ded6b37c274156">ssh_free()</a>, and <a class="el" href="group__libssh__session.html#ga2a29cff08855611be84d050e5bec73bc">ssh_set_blocking()</a>.</p>

</div>
</div>
<a class="anchor" id="gaead8cef1f39e785139bc510852ce1dff"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int ssh_options_copy </td>
          <td>(</td>
          <td class="paramtype">ssh_session&#160;</td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">ssh_session *&#160;</td>
          <td class="paramname"><em>dest</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Duplicate the options of a session structure. </p>
<p>If you make several sessions with the same options this is useful. You cannot use twice the same option structure in ssh_session_connect.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">src</td><td>The session to use to copy the options.</td></tr>
    <tr><td class="paramname">dest</td><td>The session to copy the options to.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 on sucess, -1 on error with errno set.</dd></dl>
<dl class="section see"><dt>See Also</dt><dd>ssh_session_connect() </dd></dl>

<p>Referenced by <a class="el" href="classssh_1_1Session.html#a05cbc79d7b3ef14499fe258f56031957">ssh::Session::optionsCopy()</a>.</p>

</div>
</div>
<a class="anchor" id="ga93f7f7159893f3ce62c9b178724eff75"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int ssh_options_getopt </td>
          <td>(</td>
          <td class="paramtype">ssh_session&#160;</td>
          <td class="paramname"><em>session</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>argcptr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char **&#160;</td>
          <td class="paramname"><em>argv</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Parse command line arguments. </p>
<p>This is a helper for your application to generate the appropriate options from the command line arguments.<br/>
 The argv array and argc value are changed so that the parsed arguments wont appear anymore in them.<br/>
 The single arguments (without switches) are not parsed. thus, myssh -l user localhost<br/>
 The command wont set the hostname value of options to localhost.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">session</td><td>The session to configure.</td></tr>
    <tr><td class="paramname">argcptr</td><td>The pointer to the argument count.</td></tr>
    <tr><td class="paramname">argv</td><td>The arguments list pointer.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 on success, &lt; 0 on error.</dd></dl>
<dl class="section see"><dt>See Also</dt><dd>ssh_session_new() </dd></dl>

<p>References <a class="el" href="group__libssh__session.html#ga7a801b85800baa3f4e16f5b47db0a73d">ssh_options_set()</a>.</p>

</div>
</div>
<a class="anchor" id="ga82371e723260c7572ea061edecc2e9f1"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int ssh_options_parse_config </td>
          <td>(</td>
          <td class="paramtype">ssh_session&#160;</td>
          <td class="paramname"><em>session</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>filename</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Parse the ssh config file. </p>
<p>This should be the last call of all options, it may overwrite options which are already set. It requires that the host name is already set with ssh_options_set_host().</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">session</td><td>SSH session handle</td></tr>
    <tr><td class="paramname">filename</td><td>The options file to use, if NULL the default ~/.ssh/config will be used.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 on success, &lt; 0 on error.</dd></dl>
<dl class="section see"><dt>See Also</dt><dd>ssh_options_set_host() </dd></dl>

<p>References <a class="el" href="group__libssh__session.html#ga7a801b85800baa3f4e16f5b47db0a73d">ssh_options_set()</a>.</p>

<p>Referenced by <a class="el" href="classssh_1_1Session.html#a0fe8a68c45f9f150bb306ae840f68f0f">ssh::Session::optionsParseConfig()</a>.</p>

</div>
</div>
<a class="anchor" id="ga7a801b85800baa3f4e16f5b47db0a73d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int ssh_options_set </td>
          <td>(</td>
          <td class="paramtype">ssh_session&#160;</td>
          <td class="paramname"><em>session</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">enum ssh_options_e&#160;</td>
          <td class="paramname"><em>type</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const void *&#160;</td>
          <td class="paramname"><em>value</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function can set all possible ssh options. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">session</td><td>An allocated SSH session structure.</td></tr>
    <tr><td class="paramname">type</td><td>The option type to set. This could be one of the following:</td></tr>
  </table>
  </dd>
</dl>
<ul>
<li>SSH_OPTIONS_HOST: The hostname or ip address to connect to (const char *).</li>
</ul>
<ul>
<li>SSH_OPTIONS_PORT: The port to connect to (unsigned int).</li>
</ul>
<ul>
<li>SSH_OPTIONS_PORT_STR: The port to connect to (const char *).</li>
</ul>
<ul>
<li>SSH_OPTIONS_FD: The file descriptor to use (socket_t).<br/>
 <br/>
 If you wish to open the socket yourself for a reason or another, set the file descriptor. Don't forget to set the hostname as the hostname is used as a key in the known_host mechanism.</li>
</ul>
<ul>
<li>SSH_OPTIONS_BINDADDR: The address to bind the client to (const char *).</li>
</ul>
<ul>
<li>SSH_OPTIONS_USER: The username for authentication (const char *).<br/>
 <br/>
 If the value is NULL, the username is set to the default username.</li>
</ul>
<ul>
<li>SSH_OPTIONS_SSH_DIR: Set the ssh directory (const char *,format string).<br/>
 <br/>
 If the value is NULL, the directory is set to the default ssh directory.<br/>
 <br/>
 The ssh directory is used for files like known_hosts and identity (private and public key). It may include "%s" which will be replaced by the user home directory.</li>
</ul>
<ul>
<li>SSH_OPTIONS_KNOWNHOSTS: Set the known hosts file name (const char *,format string).<br/>
 <br/>
 If the value is NULL, the directory is set to the default known hosts file, normally ~/.ssh/known_hosts.<br/>
 <br/>
 The known hosts file is used to certify remote hosts are genuine. It may include "%s" which will be replaced by the user home directory.</li>
</ul>
<ul>
<li>SSH_OPTIONS_IDENTITY: Set the identity file name (const char *,format string).<br/>
 <br/>
 By default identity, id_dsa and id_rsa are checked.<br/>
 <br/>
 The identity file used authenticate with public key. It may include "%s" which will be replaced by the user home directory.</li>
</ul>
<ul>
<li>SSH_OPTIONS_TIMEOUT: Set a timeout for the connection in seconds (long).</li>
</ul>
<ul>
<li>SSH_OPTIONS_TIMEOUT_USEC: Set a timeout for the connection in micro seconds (long).</li>
</ul>
<ul>
<li>SSH_OPTIONS_SSH1: Allow or deny the connection to SSH1 servers (int, 0 is false).</li>
</ul>
<ul>
<li>SSH_OPTIONS_SSH2: Allow or deny the connection to SSH2 servers (int, 0 is false).</li>
</ul>
<ul>
<li>SSH_OPTIONS_LOG_VERBOSITY: Set the session logging verbosity (int).<br/>
 <br/>
 The verbosity of the messages. Every log smaller or equal to verbosity will be shown.<ul>
<li>SSH_LOG_NOLOG: No logging</li>
<li>SSH_LOG_RARE: Rare conditions or warnings</li>
<li>SSH_LOG_ENTRY: API-accessible entrypoints</li>
<li>SSH_LOG_PACKET: Packet id and size</li>
<li>SSH_LOG_FUNCTIONS: Function entering and leaving</li>
</ul>
</li>
</ul>
<ul>
<li>SSH_OPTIONS_LOG_VERBOSITY_STR: Set the session logging verbosity (const char *).<br/>
 <br/>
 The verbosity of the messages. Every log smaller or equal to verbosity will be shown.<ul>
<li>SSH_LOG_NOLOG: No logging</li>
<li>SSH_LOG_RARE: Rare conditions or warnings</li>
<li>SSH_LOG_ENTRY: API-accessible entrypoints</li>
<li>SSH_LOG_PACKET: Packet id and size</li>
<li>SSH_LOG_FUNCTIONS: Function entering and leaving <br/>
 See the corresponding numbers in <a class="el" href="libssh_8h_source.html">libssh.h</a>.</li>
</ul>
</li>
</ul>
<ul>
<li>SSH_OPTIONS_AUTH_CALLBACK: Set a callback to use your own authentication function (function pointer).</li>
</ul>
<ul>
<li>SSH_OPTIONS_AUTH_USERDATA: Set the user data passed to the authentication function (generic pointer).</li>
</ul>
<ul>
<li>SSH_OPTIONS_LOG_CALLBACK: Set a callback to use your own logging function (function pointer).</li>
</ul>
<ul>
<li>SSH_OPTIONS_LOG_USERDATA: Set the user data passed to the logging function (generic pointer).</li>
</ul>
<ul>
<li>SSH_OPTIONS_STATUS_CALLBACK: Set a callback to show connection status in realtime (function pointer).<br/>
 <br/>
 <div class="fragment"><div class="line">fn(<span class="keywordtype">void</span> *arg, <span class="keywordtype">float</span> status)</div>
</div><!-- fragment --> <br/>
 During <a class="el" href="group__libssh__session.html#ga032e07cbd8bc3f14cb2dd375db0b03d7" title="Connect to the ssh server.">ssh_connect()</a>, libssh will call the callback with status from 0.0 to 1.0.</li>
</ul>
<ul>
<li>SSH_OPTIONS_STATUS_ARG: Set the status argument which should be passed to the status callback (generic pointer).</li>
</ul>
<ul>
<li>SSH_OPTIONS_CIPHERS_C_S: Set the symmetric cipher client to server (const char *, comma-separated list).</li>
</ul>
<ul>
<li>SSH_OPTIONS_CIPHERS_S_C: Set the symmetric cipher server to client (const char *, comma-separated list).</li>
</ul>
<ul>
<li>SSH_OPTIONS_COMPRESSION_C_S: Set the compression to use for client to server communication (const char *, "yes", "no" or a specific algorithm name if needed ("zlib","zlib@openssh.com","none").</li>
</ul>
<ul>
<li>SSH_OPTIONS_COMPRESSION_S_C: Set the compression to use for server to client communication (const char *, "yes", "no" or a specific algorithm name if needed ("zlib","zlib@openssh.com","none").</li>
</ul>
<ul>
<li>SSH_OPTIONS_COMPRESSION: Set the compression to use for both directions communication (const char *, "yes", "no" or a specific algorithm name if needed ("zlib","zlib@openssh.com","none").</li>
</ul>
<ul>
<li>SSH_OPTIONS_COMPRESSION_LEVEL: Set the compression level to use for zlib functions. (int, value from 1 to 9, 9 being the most efficient but slower).</li>
</ul>
<ul>
<li>SSH_OPTIONS_STRICTHOSTKEYCHECK: Set the parameter StrictHostKeyChecking to avoid asking about a fingerprint (int, 0 = false).</li>
</ul>
<ul>
<li>SSH_OPTIONS_PROXYCOMMAND: Set the command to be executed in order to connect to server (const char *).</li>
</ul>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">value</td><td>The value to set. This is a generic pointer and the datatype which is used should be set according to the type set.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 on success, &lt; 0 on error. </dd></dl>

<p>References <a class="el" href="group__libssh__session.html#ga7a801b85800baa3f4e16f5b47db0a73d">ssh_options_set()</a>, and <a class="el" href="group__libssh__misc.html#ga85622306848fd7e735d5843747f6eb28">ssh_path_expand_tilde()</a>.</p>

<p>Referenced by <a class="el" href="classssh_1_1Session.html#ad19ae4a0927094c12f383907cbf40ccc">ssh::Session::setOption()</a>, <a class="el" href="group__libssh__session.html#ga93f7f7159893f3ce62c9b178724eff75">ssh_options_getopt()</a>, <a class="el" href="group__libssh__session.html#ga82371e723260c7572ea061edecc2e9f1">ssh_options_parse_config()</a>, and <a class="el" href="group__libssh__session.html#ga7a801b85800baa3f4e16f5b47db0a73d">ssh_options_set()</a>.</p>

</div>
</div>
<a class="anchor" id="ga86cbf041bced56d18a2a5248c46cecb4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int ssh_select </td>
          <td>(</td>
          <td class="paramtype">ssh_channel *&#160;</td>
          <td class="paramname"><em>channels</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">ssh_channel *&#160;</td>
          <td class="paramname"><em>outchannels</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">socket_t&#160;</td>
          <td class="paramname"><em>maxfd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">fd_set *&#160;</td>
          <td class="paramname"><em>readfds</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct timeval *&#160;</td>
          <td class="paramname"><em>timeout</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>A wrapper for the select syscall. </p>
<p>This functions acts more or less like the select(2) syscall.<br/>
 There is no support for writing or exceptions.<br/>
</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">channels</td><td>Arrays of channels pointers terminated by a NULL. It is never rewritten.</td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">outchannels</td><td>Arrays of same size that "channels", there is no need to initialize it.</td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">maxfd</td><td>Maximum +1 file descriptor from readfds.</td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">readfds</td><td>A fd_set of file descriptors to be select'ed for reading.</td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">timeout</td><td>A timeout for the select.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>-1 if an error occured. SSH_EINTR if it was interrupted, in that case, just restart it.</dd></dl>
<dl class="section warning"><dt>Warning</dt><dd>libssh is not threadsafe here. That means that if a signal is caught during the processing of this function, you cannot call ssh functions on sessions that are busy with <a class="el" href="group__libssh__session.html#ga86cbf041bced56d18a2a5248c46cecb4" title="A wrapper for the select syscall.">ssh_select()</a>.</dd></dl>
<dl class="section see"><dt>See Also</dt><dd>select(2) </dd></dl>

<p>References <a class="el" href="group__libssh__channel.html#ga157f7d1df5de07ec6c6976e2034ba6e2">ssh_channel_poll()</a>.</p>

</div>
</div>
<a class="anchor" id="ga2a29cff08855611be84d050e5bec73bc"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ssh_set_blocking </td>
          <td>(</td>
          <td class="paramtype">ssh_session&#160;</td>
          <td class="paramname"><em>session</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>blocking</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set the session in blocking/nonblocking mode. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">session</td><td>The ssh session to change.</td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">blocking</td><td>Zero for nonblocking mode.</td></tr>
  </table>
  </dd>
</dl>
<dl class="bug"><dt><b><a class="el" href="bug.html#_bug000003">Bug:</a></b></dt><dd>nonblocking code is in development and won't work as expected </dd></dl>

<p>Referenced by <a class="el" href="group__libssh__session.html#gaadadc0f9601547c30db7c4d62017d32c">ssh_new()</a>.</p>

</div>
</div>
<a class="anchor" id="ga06453278350fd9e940c5c1b0d5225f19"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ssh_set_fd_except </td>
          <td>(</td>
          <td class="paramtype">ssh_session&#160;</td>
          <td class="paramname"><em>session</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Tell the session it has an exception to catch on the file descriptor. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">session</td><td>The ssh session to use. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga0e05c91c6f475eabc8d221914d25a425"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ssh_set_fd_toread </td>
          <td>(</td>
          <td class="paramtype">ssh_session&#160;</td>
          <td class="paramname"><em>session</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Tell the session it has data to read on the file descriptor without blocking. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">session</td><td>The ssh session to use. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga3f1b3c59662464eec3649d3d72a40543"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ssh_set_fd_towrite </td>
          <td>(</td>
          <td class="paramtype">ssh_session&#160;</td>
          <td class="paramname"><em>session</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Tell the session it may write to the file descriptor without blocking. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">session</td><td>The ssh session to use. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gae1bd16255ba373325adf76307d0c8c42"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ssh_silent_disconnect </td>
          <td>(</td>
          <td class="paramtype">ssh_session&#160;</td>
          <td class="paramname"><em>session</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Disconnect impolitely from a remote host by closing the socket. </p>
<p>Suitable if you forked and want to destroy this session.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">session</td><td>The SSH session to disconnect. </td></tr>
  </table>
  </dd>
</dl>

<p>References <a class="el" href="group__libssh__session.html#ga0f048a4c0dbe02cfb7e9c5b6d0db0f27">ssh_disconnect()</a>.</p>

<p>Referenced by <a class="el" href="classssh_1_1Session.html#a15b2a58607cc42628e17c94c8f7eb793">ssh::Session::silentDisconnect()</a>.</p>

</div>
</div>
<a class="anchor" id="gaf61a9cfdc40c76ffce9f9a8543755d36"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int ssh_write_knownhost </td>
          <td>(</td>
          <td class="paramtype">ssh_session&#160;</td>
          <td class="paramname"><em>session</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Write the current server as known in the known hosts file. </p>
<p>This will create the known hosts file if it does not exist. You generaly use it when <a class="el" href="group__libssh__session.html#ga6f37e3d7bb6b938b44d6a34a76fdfa0b" title="Check if the server is known.">ssh_is_server_known()</a> answered SSH_SERVER_NOT_KNOWN.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">session</td><td>The ssh session to use.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>SSH_OK on success, SSH_ERROR on error. </dd></dl>

<p>References <a class="el" href="group__libssh__misc.html#gad36f0f8dbde59aefedd385dff76384fa">ssh_dirname()</a>, <a class="el" href="group__libssh__misc.html#ga5e15e93beecaef3af67d02b7ba55309f">ssh_mkdir()</a>, and <a class="el" href="group__libssh__string.html#ga331553369afbfcb4f5300729ed65d0fe">ssh_string_len()</a>.</p>

<p>Referenced by <a class="el" href="group__libssh__session.html#ga6f37e3d7bb6b938b44d6a34a76fdfa0b">ssh_is_server_known()</a>, and <a class="el" href="classssh_1_1Session.html#ae55f054025dcbe4ceeaec87c9ca064c7">ssh::Session::writeKnownhost()</a>.</p>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.3.1
</small></address>
</body>
</html>