Tryag File Manager
Home
-
Turbo Force
Current Path :
/
usr
/
share
/
doc
/
iscsi-initiator-utils-6.2.0.872
/
html
/
Upload File :
New :
File
Dir
//usr/share/doc/iscsi-initiator-utils-6.2.0.872/html/libiscsi_8h.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> <title>libiscsi: libiscsi.h File Reference</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> <link href="tabs.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.4.7 --> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="annotated.html"><span>Data Structures</span></a></li> <li id="current"><a href="files.html"><span>Files</span></a></li> </ul></div> <div class="tabs"> <ul> <li><a href="files.html"><span>File List</span></a></li> <li><a href="globals.html"><span>Globals</span></a></li> </ul></div> <h1>libiscsi.h File Reference</h1><code>#include <netdb.h></code><br> <p> <a href="libiscsi_8h-source.html">Go to the source code of this file.</a><table border="0" cellpadding="0" cellspacing="0"> <tr><td></td></tr> <tr><td colspan="2"><br><h2>Data Structures</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">struct </td><td class="memItemRight" valign="bottom"><a class="el" href="structlibiscsi__node.html">libiscsi_node</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">iSCSI node record <a href="structlibiscsi__node.html#_details">More...</a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">struct </td><td class="memItemRight" valign="bottom"><a class="el" href="structlibiscsi__chap__auth__info.html">libiscsi_chap_auth_info</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">libiscsi CHAP authentication information struct <a href="structlibiscsi__chap__auth__info.html#_details">More...</a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">struct </td><td class="memItemRight" valign="bottom"><a class="el" href="structlibiscsi__auth__info.html">libiscsi_auth_info</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">generic libiscsi authentication information struct <a href="structlibiscsi__auth__info.html#_details">More...</a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">struct </td><td class="memItemRight" valign="bottom"><a class="el" href="structlibiscsi__network__config.html">libiscsi_network_config</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">libiscsi network config struct <a href="structlibiscsi__network__config.html#_details">More...</a><br></td></tr> <tr><td colspan="2"><br><h2>Defines</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="libiscsi_8h.html#d17d551e31d1828c68acf40684849b7e">PUBLIC</a></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="libiscsi_8h.html#bef8f771556cb4f978f67730f951f391">LIBISCSI_VALUE_MAXLEN</a> 256</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Maximum length for iSCSI values. <a href="#bef8f771556cb4f978f67730f951f391"></a><br></td></tr> <tr><td colspan="2"><br><h2>Enumerations</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><a class="el" href="libiscsi_8h.html#4ace9c6f75284acfc90d72c130c6be70">libiscsi_auth_t</a> { <a class="el" href="libiscsi_8h.html#4ace9c6f75284acfc90d72c130c6be708d50f6026de3850e38aad596eb28298e">libiscsi_auth_none</a>, <a class="el" href="libiscsi_8h.html#4ace9c6f75284acfc90d72c130c6be703fbb0924ae0ca776d1d01acc0953bb58">libiscsi_auth_chap</a> }</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">supported authentication methods <a href="libiscsi_8h.html#4ace9c6f75284acfc90d72c130c6be70">More...</a><br></td></tr> <tr><td colspan="2"><br><h2>Functions</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">PUBLIC struct <a class="el" href="structlibiscsi__context.html">libiscsi_context</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="libiscsi_8h.html#ba87226c3b5bccbfb5c99eb912ff0687">libiscsi_init</a> (void)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Initalize libiscsi. <a href="#ba87226c3b5bccbfb5c99eb912ff0687"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">PUBLIC void </td><td class="memItemRight" valign="bottom"><a class="el" href="libiscsi_8h.html#18e293dacff9b92a0cd4b1364742e5c3">libiscsi_cleanup</a> (struct <a class="el" href="structlibiscsi__context.html">libiscsi_context</a> *context)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Cleanup libiscsi used resource. <a href="#18e293dacff9b92a0cd4b1364742e5c3"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">PUBLIC int </td><td class="memItemRight" valign="bottom"><a class="el" href="libiscsi_8h.html#fd63bd5bf05f96a98ebb0b3e40b64c9f">libiscsi_discover_sendtargets</a> (struct <a class="el" href="structlibiscsi__context.html">libiscsi_context</a> *context, const char *address, int port, const struct <a class="el" href="structlibiscsi__auth__info.html">libiscsi_auth_info</a> *auth_info, int *nr_found, struct <a class="el" href="structlibiscsi__node.html">libiscsi_node</a> **found_nodes)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Discover iSCSI nodes using sendtargets and add them to the node db. <a href="#fd63bd5bf05f96a98ebb0b3e40b64c9f"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">PUBLIC int </td><td class="memItemRight" valign="bottom"><a class="el" href="libiscsi_8h.html#b30d9e8ce2617b2dac1523a1a95670c0">libiscsi_discover_firmware</a> (struct <a class="el" href="structlibiscsi__context.html">libiscsi_context</a> *context, int *nr_found, struct <a class="el" href="structlibiscsi__node.html">libiscsi_node</a> **found_nodes)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Read iSCSI node info from firmware and add them to the node db. <a href="#b30d9e8ce2617b2dac1523a1a95670c0"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">PUBLIC int </td><td class="memItemRight" valign="bottom"><a class="el" href="libiscsi_8h.html#8c6ce5940d21c48547d6b846ee885a5f">libiscsi_verify_auth_info</a> (struct <a class="el" href="structlibiscsi__context.html">libiscsi_context</a> *context, const struct <a class="el" href="structlibiscsi__auth__info.html">libiscsi_auth_info</a> *auth_info)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Check validity of the given authentication info. <a href="#8c6ce5940d21c48547d6b846ee885a5f"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">PUBLIC int </td><td class="memItemRight" valign="bottom"><a class="el" href="libiscsi_8h.html#37cd1f9c72833b04566225ac798069d8">libiscsi_node_set_auth</a> (struct <a class="el" href="structlibiscsi__context.html">libiscsi_context</a> *context, const struct <a class="el" href="structlibiscsi__node.html">libiscsi_node</a> *node, const struct <a class="el" href="structlibiscsi__auth__info.html">libiscsi_auth_info</a> *auth_info)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Set the authentication info for the given node. <a href="#37cd1f9c72833b04566225ac798069d8"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">PUBLIC int </td><td class="memItemRight" valign="bottom"><a class="el" href="libiscsi_8h.html#86a805d8625dea5e8c27722678a92a7c">libiscsi_node_get_auth</a> (struct <a class="el" href="structlibiscsi__context.html">libiscsi_context</a> *context, const struct <a class="el" href="structlibiscsi__node.html">libiscsi_node</a> *node, struct <a class="el" href="structlibiscsi__auth__info.html">libiscsi_auth_info</a> *auth_info)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Get the authentication info for the given node. <a href="#86a805d8625dea5e8c27722678a92a7c"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">PUBLIC int </td><td class="memItemRight" valign="bottom"><a class="el" href="libiscsi_8h.html#fa9bb3f886e4d10f5d293b3520f8c6ef">libiscsi_node_login</a> (struct <a class="el" href="structlibiscsi__context.html">libiscsi_context</a> *context, const struct <a class="el" href="structlibiscsi__node.html">libiscsi_node</a> *node)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Login to an iSCSI node. <a href="#fa9bb3f886e4d10f5d293b3520f8c6ef"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">PUBLIC int </td><td class="memItemRight" valign="bottom"><a class="el" href="libiscsi_8h.html#240f603fa8fc2325ebc88436dc2dacb5">libiscsi_node_logout</a> (struct <a class="el" href="structlibiscsi__context.html">libiscsi_context</a> *context, const struct <a class="el" href="structlibiscsi__node.html">libiscsi_node</a> *node)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Logout of an iSCSI node. <a href="#240f603fa8fc2325ebc88436dc2dacb5"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">PUBLIC int </td><td class="memItemRight" valign="bottom"><a class="el" href="libiscsi_8h.html#2b33cea406584ae5a3fb29b72e6f2fbb">libiscsi_node_set_parameter</a> (struct <a class="el" href="structlibiscsi__context.html">libiscsi_context</a> *context, const struct <a class="el" href="structlibiscsi__node.html">libiscsi_node</a> *node, const char *parameter, const char *value)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Set an iSCSI parameter for the given node. <a href="#2b33cea406584ae5a3fb29b72e6f2fbb"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">PUBLIC int </td><td class="memItemRight" valign="bottom"><a class="el" href="libiscsi_8h.html#1ff670014db080800da2e045248d0495">libiscsi_node_get_parameter</a> (struct <a class="el" href="structlibiscsi__context.html">libiscsi_context</a> *context, const struct <a class="el" href="structlibiscsi__node.html">libiscsi_node</a> *node, const char *parameter, char *value)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Get the value of an iSCSI parameter for the given node. <a href="#1ff670014db080800da2e045248d0495"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">PUBLIC const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="libiscsi_8h.html#5b6757f22f44c55aaaaa321da5d906e5">libiscsi_get_error_string</a> (struct <a class="el" href="structlibiscsi__context.html">libiscsi_context</a> *context)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Get human readable string describing the last libiscsi error. <a href="#5b6757f22f44c55aaaaa321da5d906e5"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">PUBLIC int </td><td class="memItemRight" valign="bottom"><a class="el" href="libiscsi_8h.html#d0998828aefef518dfc4b626322723da">libiscsi_get_firmware_network_config</a> (struct <a class="el" href="structlibiscsi__network__config.html">libiscsi_network_config</a> *config)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Get network configuration information from iscsi firmware. <a href="#d0998828aefef518dfc4b626322723da"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">PUBLIC int </td><td class="memItemRight" valign="bottom"><a class="el" href="libiscsi_8h.html#1ce5c7829bd0609267ab0d398ae2a853">libiscsi_get_firmware_initiator_name</a> (char *initiatorname)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Get the initiator name (iqn) from the iscsi firmware. <a href="#1ce5c7829bd0609267ab0d398ae2a853"></a><br></td></tr> </table> <hr><h2>Define Documentation</h2> <a class="anchor" name="bef8f771556cb4f978f67730f951f391"></a><!-- doxytag: member="libiscsi.h::LIBISCSI_VALUE_MAXLEN" ref="bef8f771556cb4f978f67730f951f391" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define LIBISCSI_VALUE_MAXLEN 256 </td> </tr> </table> </div> <div class="memdoc"> <p> Maximum length for iSCSI values such as hostnames and parameter values. </div> </div><p> <a class="anchor" name="d17d551e31d1828c68acf40684849b7e"></a><!-- doxytag: member="libiscsi.h::PUBLIC" ref="d17d551e31d1828c68acf40684849b7e" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define PUBLIC </td> </tr> </table> </div> <div class="memdoc"> <p> </div> </div><p> <hr><h2>Enumeration Type Documentation</h2> <a class="anchor" name="4ace9c6f75284acfc90d72c130c6be70"></a><!-- doxytag: member="libiscsi.h::libiscsi_auth_t" ref="4ace9c6f75284acfc90d72c130c6be70" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">enum <a class="el" href="libiscsi_8h.html#4ace9c6f75284acfc90d72c130c6be70">libiscsi_auth_t</a> </td> </tr> </table> </div> <div class="memdoc"> <p> This enum lists all supported authentication methods. <dl compact><dt><b>Enumerator: </b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"><em><a class="anchor" name="4ace9c6f75284acfc90d72c130c6be708d50f6026de3850e38aad596eb28298e"></a><!-- doxytag: member="libiscsi_auth_none" ref="4ace9c6f75284acfc90d72c130c6be708d50f6026de3850e38aad596eb28298e" args="" -->libiscsi_auth_none</em> </td><td> No authentication </td></tr> <tr><td valign="top"><em><a class="anchor" name="4ace9c6f75284acfc90d72c130c6be703fbb0924ae0ca776d1d01acc0953bb58"></a><!-- doxytag: member="libiscsi_auth_chap" ref="4ace9c6f75284acfc90d72c130c6be703fbb0924ae0ca776d1d01acc0953bb58" args="" -->libiscsi_auth_chap</em> </td><td> CHAP authentication </td></tr> </table> </dl> </div> </div><p> <hr><h2>Function Documentation</h2> <a class="anchor" name="18e293dacff9b92a0cd4b1364742e5c3"></a><!-- doxytag: member="libiscsi.h::libiscsi_cleanup" ref="18e293dacff9b92a0cd4b1364742e5c3" args="(struct libiscsi_context *context)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">PUBLIC void libiscsi_cleanup </td> <td>(</td> <td class="paramtype">struct <a class="el" href="structlibiscsi__context.html">libiscsi_context</a> * </td> <td class="paramname"> <em>context</em> </td> <td> ) </td> <td width="100%"></td> </tr> </table> </div> <div class="memdoc"> <p> This function cleanups any used resources and then destroys the passed context. After this the passed in context may no longer be used!<p> <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>context</em> </td><td>libiscsi context to operate on. </td></tr> </table> </dl> </div> </div><p> <a class="anchor" name="b30d9e8ce2617b2dac1523a1a95670c0"></a><!-- doxytag: member="libiscsi.h::libiscsi_discover_firmware" ref="b30d9e8ce2617b2dac1523a1a95670c0" args="(struct libiscsi_context *context, int *nr_found, struct libiscsi_node **found_nodes)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">PUBLIC int libiscsi_discover_firmware </td> <td>(</td> <td class="paramtype">struct <a class="el" href="structlibiscsi__context.html">libiscsi_context</a> * </td> <td class="paramname"> <em>context</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int * </td> <td class="paramname"> <em>nr_found</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">struct <a class="el" href="structlibiscsi__node.html">libiscsi_node</a> ** </td> <td class="paramname"> <em>found_nodes</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td width="100%"></td> </tr> </table> </div> <div class="memdoc"> <p> This function discovers iSCSI nodes using firmware (ppc or ibft). Any found nodes are added to the local iSCSI node database and are returned in a dynamically allocated array.<p> Note that unlike sendtargets discovery, this function will also read authentication info and store that in the database too.<p> Note this function currently is a stub which will always return -EINVAL (IOW it is not yet implemented)<p> <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>context</em> </td><td>libiscsi context to operate on. </td></tr> <tr><td valign="top"></td><td valign="top"><em>nr_found</em> </td><td>The number of found nodes will be returned through this pointer if not NULL. </td></tr> <tr><td valign="top"></td><td valign="top"><em>found_nodes</em> </td><td>The address of the dynamically allocated array of found nodes will be returned through this pointer if not NULL. The caller must free this array using free(). </td></tr> </table> </dl> <dl compact><dt><b>Returns:</b></dt><dd>0 on success, otherwise a standard error code (from errno.h). </dd></dl> </div> </div><p> <a class="anchor" name="fd63bd5bf05f96a98ebb0b3e40b64c9f"></a><!-- doxytag: member="libiscsi.h::libiscsi_discover_sendtargets" ref="fd63bd5bf05f96a98ebb0b3e40b64c9f" args="(struct libiscsi_context *context, const char *address, int port, const struct libiscsi_auth_info *auth_info, int *nr_found, struct libiscsi_node **found_nodes)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">PUBLIC int libiscsi_discover_sendtargets </td> <td>(</td> <td class="paramtype">struct <a class="el" href="structlibiscsi__context.html">libiscsi_context</a> * </td> <td class="paramname"> <em>context</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const char * </td> <td class="paramname"> <em>address</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int </td> <td class="paramname"> <em>port</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const struct <a class="el" href="structlibiscsi__auth__info.html">libiscsi_auth_info</a> * </td> <td class="paramname"> <em>auth_info</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int * </td> <td class="paramname"> <em>nr_found</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">struct <a class="el" href="structlibiscsi__node.html">libiscsi_node</a> ** </td> <td class="paramname"> <em>found_nodes</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td width="100%"></td> </tr> </table> </div> <div class="memdoc"> <p> This function connects to the given address and port and then tries to discover iSCSI nodes using the sendtargets protocol. Any found nodes are added to the local iSCSI node database and are returned in a dynamically allocated array.<p> Note that the (optional) authentication info is for authenticating the discovery, and is not for the found nodes! If the connection(s) to the node(s) need authentication too, you can set the username / password for those (which can be different!) using the <a class="el" href="libiscsi_8c.html#60df6a0acfab13c794acdbe9268d07cf">libiscsi_node_set_auth()</a> function.<p> <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>context</em> </td><td>libiscsi context to operate on. </td></tr> <tr><td valign="top"></td><td valign="top"><em>address</em> </td><td>Hostname or IP-address to connect to. </td></tr> <tr><td valign="top"></td><td valign="top"><em>port</em> </td><td>Port to connect to, or 0 for the default port. </td></tr> <tr><td valign="top"></td><td valign="top"><em>auth_info</em> </td><td>Authentication information, or NULL. </td></tr> <tr><td valign="top"></td><td valign="top"><em>nr_found</em> </td><td>The number of found nodes will be returned through this pointer if not NULL. </td></tr> <tr><td valign="top"></td><td valign="top"><em>found_nodes</em> </td><td>The address of the dynamically allocated array of found nodes will be returned through this pointer if not NULL. The caller must free this array using free(). </td></tr> </table> </dl> <dl compact><dt><b>Returns:</b></dt><dd>0 on success, otherwise a standard error code (from errno.h). </dd></dl> </div> </div><p> <a class="anchor" name="5b6757f22f44c55aaaaa321da5d906e5"></a><!-- doxytag: member="libiscsi.h::libiscsi_get_error_string" ref="5b6757f22f44c55aaaaa321da5d906e5" args="(struct libiscsi_context *context)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">PUBLIC const char* libiscsi_get_error_string </td> <td>(</td> <td class="paramtype">struct <a class="el" href="structlibiscsi__context.html">libiscsi_context</a> * </td> <td class="paramname"> <em>context</em> </td> <td> ) </td> <td width="100%"></td> </tr> </table> </div> <div class="memdoc"> <p> This function can be called to get a human readable error string when a libiscsi function has returned an error. This function uses a single buffer per context, thus the result is only valid as long as no other libiscsi calls are made on the same context after the failing function call.<p> <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>context</em> </td><td>libiscsi context to operate on.</td></tr> </table> </dl> <dl compact><dt><b>Returns:</b></dt><dd>human readable string describing the last libiscsi error. </dd></dl> </div> </div><p> <a class="anchor" name="1ce5c7829bd0609267ab0d398ae2a853"></a><!-- doxytag: member="libiscsi.h::libiscsi_get_firmware_initiator_name" ref="1ce5c7829bd0609267ab0d398ae2a853" args="(char *initiatorname)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">PUBLIC int libiscsi_get_firmware_initiator_name </td> <td>(</td> <td class="paramtype">char * </td> <td class="paramname"> <em>initiatorname</em> </td> <td> ) </td> <td width="100%"></td> </tr> </table> </div> <div class="memdoc"> <p> Get the initiator name (iqn) from the iscsi firmware.<p> <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>initiatorname</em> </td><td>The initiator name is stored here, this buffer must be atleast LIBISCSI_VALUE_MAXLEN bytes large. </td></tr> </table> </dl> <dl compact><dt><b>Returns:</b></dt><dd>0 on success, ENODEV when no iscsi firmware was found. </dd></dl> </div> </div><p> <a class="anchor" name="d0998828aefef518dfc4b626322723da"></a><!-- doxytag: member="libiscsi.h::libiscsi_get_firmware_network_config" ref="d0998828aefef518dfc4b626322723da" args="(struct libiscsi_network_config *config)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">PUBLIC int libiscsi_get_firmware_network_config </td> <td>(</td> <td class="paramtype">struct <a class="el" href="structlibiscsi__network__config.html">libiscsi_network_config</a> * </td> <td class="paramname"> <em>config</em> </td> <td> ) </td> <td width="100%"></td> </tr> </table> </div> <div class="memdoc"> <p> Function can be called to get the network configuration information (like dhcp, ip, netmask, default gateway, etc.) from the firmware of a network adapter with iscsi boot firmware.<p> Note that not all fields of the returned struct are necessarilly filled, unset fields contain a 0 length string.<p> <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>config</em> </td><td>pointer to a <a class="el" href="structlibiscsi__network__config.html">libiscsi_network_config</a> struct to fill.</td></tr> </table> </dl> <dl compact><dt><b>Returns:</b></dt><dd>0 on success, ENODEV when no iscsi firmware was found. </dd></dl> </div> </div><p> <a class="anchor" name="ba87226c3b5bccbfb5c99eb912ff0687"></a><!-- doxytag: member="libiscsi.h::libiscsi_init" ref="ba87226c3b5bccbfb5c99eb912ff0687" args="(void)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">PUBLIC struct <a class="el" href="structlibiscsi__context.html">libiscsi_context</a>* libiscsi_init </td> <td>(</td> <td class="paramtype">void </td> <td class="paramname"> </td> <td> ) </td> <td width="100%"></td> </tr> </table> </div> <div class="memdoc"> <p> This function creates a libiscsi context and initalizes it. This context is need to use other libiscsi funtions.<p> <dl compact><dt><b>Returns:</b></dt><dd>A pointer to the created context, or NULL in case of an error. </dd></dl> </div> </div><p> <a class="anchor" name="86a805d8625dea5e8c27722678a92a7c"></a><!-- doxytag: member="libiscsi.h::libiscsi_node_get_auth" ref="86a805d8625dea5e8c27722678a92a7c" args="(struct libiscsi_context *context, const struct libiscsi_node *node, struct libiscsi_auth_info *auth_info)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">PUBLIC int libiscsi_node_get_auth </td> <td>(</td> <td class="paramtype">struct <a class="el" href="structlibiscsi__context.html">libiscsi_context</a> * </td> <td class="paramname"> <em>context</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const struct <a class="el" href="structlibiscsi__node.html">libiscsi_node</a> * </td> <td class="paramname"> <em>node</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">struct <a class="el" href="structlibiscsi__auth__info.html">libiscsi_auth_info</a> * </td> <td class="paramname"> <em>auth_info</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td width="100%"></td> </tr> </table> </div> <div class="memdoc"> <p> This function gets the authentication information for the node described by the given node record.<p> <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>context</em> </td><td>libiscsi context to operate on. </td></tr> <tr><td valign="top"></td><td valign="top"><em>node</em> </td><td>iSCSI node to set auth information of </td></tr> <tr><td valign="top"></td><td valign="top"><em>auth_info</em> </td><td>Pointer to a <a class="el" href="structlibiscsi__auth__info.html">libiscsi_auth_info</a> struct where the retreived information will be stored. </td></tr> </table> </dl> <dl compact><dt><b>Returns:</b></dt><dd>0 on success, otherwise a standard error code (from errno.h). </dd></dl> </div> </div><p> <a class="anchor" name="1ff670014db080800da2e045248d0495"></a><!-- doxytag: member="libiscsi.h::libiscsi_node_get_parameter" ref="1ff670014db080800da2e045248d0495" args="(struct libiscsi_context *context, const struct libiscsi_node *node, const char *parameter, char *value)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">PUBLIC int libiscsi_node_get_parameter </td> <td>(</td> <td class="paramtype">struct <a class="el" href="structlibiscsi__context.html">libiscsi_context</a> * </td> <td class="paramname"> <em>context</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const struct <a class="el" href="structlibiscsi__node.html">libiscsi_node</a> * </td> <td class="paramname"> <em>node</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const char * </td> <td class="paramname"> <em>parameter</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">char * </td> <td class="paramname"> <em>value</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td width="100%"></td> </tr> </table> </div> <div class="memdoc"> <p> Get the value of the given nodes iSCSI parameter named by <em>parameter</em>.<p> <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>context</em> </td><td>libiscsi context to operate on. </td></tr> <tr><td valign="top"></td><td valign="top"><em>node</em> </td><td>iSCSI node to change a parameter from. </td></tr> <tr><td valign="top"></td><td valign="top"><em>parameter</em> </td><td>Name of the parameter to get. </td></tr> <tr><td valign="top"></td><td valign="top"><em>value</em> </td><td>The retreived value is stored here, this buffer must be atleast LIBISCSI_VALUE_MAXLEN bytes large. </td></tr> </table> </dl> <dl compact><dt><b>Returns:</b></dt><dd>0 on success, otherwise a standard error code (from errno.h). </dd></dl> </div> </div><p> <a class="anchor" name="fa9bb3f886e4d10f5d293b3520f8c6ef"></a><!-- doxytag: member="libiscsi.h::libiscsi_node_login" ref="fa9bb3f886e4d10f5d293b3520f8c6ef" args="(struct libiscsi_context *context, const struct libiscsi_node *node)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">PUBLIC int libiscsi_node_login </td> <td>(</td> <td class="paramtype">struct <a class="el" href="structlibiscsi__context.html">libiscsi_context</a> * </td> <td class="paramname"> <em>context</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const struct <a class="el" href="structlibiscsi__node.html">libiscsi_node</a> * </td> <td class="paramname"> <em>node</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td width="100%"></td> </tr> </table> </div> <div class="memdoc"> <p> Login to the iSCSI node described by the given node record.<p> <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>context</em> </td><td>libiscsi context to operate on. </td></tr> <tr><td valign="top"></td><td valign="top"><em>node</em> </td><td>iSCSI node to login to. </td></tr> </table> </dl> <dl compact><dt><b>Returns:</b></dt><dd>0 on success, otherwise a standard error code (from errno.h). </dd></dl> </div> </div><p> <a class="anchor" name="240f603fa8fc2325ebc88436dc2dacb5"></a><!-- doxytag: member="libiscsi.h::libiscsi_node_logout" ref="240f603fa8fc2325ebc88436dc2dacb5" args="(struct libiscsi_context *context, const struct libiscsi_node *node)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">PUBLIC int libiscsi_node_logout </td> <td>(</td> <td class="paramtype">struct <a class="el" href="structlibiscsi__context.html">libiscsi_context</a> * </td> <td class="paramname"> <em>context</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const struct <a class="el" href="structlibiscsi__node.html">libiscsi_node</a> * </td> <td class="paramname"> <em>node</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td width="100%"></td> </tr> </table> </div> <div class="memdoc"> <p> Logout of the iSCSI node described by the given node record.<p> <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>context</em> </td><td>libiscsi context to operate on. </td></tr> <tr><td valign="top"></td><td valign="top"><em>node</em> </td><td>iSCSI node to logout from. </td></tr> </table> </dl> <dl compact><dt><b>Returns:</b></dt><dd>0 on success, otherwise a standard error code (from errno.h). </dd></dl> </div> </div><p> <a class="anchor" name="37cd1f9c72833b04566225ac798069d8"></a><!-- doxytag: member="libiscsi.h::libiscsi_node_set_auth" ref="37cd1f9c72833b04566225ac798069d8" args="(struct libiscsi_context *context, const struct libiscsi_node *node, const struct libiscsi_auth_info *auth_info)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">PUBLIC int libiscsi_node_set_auth </td> <td>(</td> <td class="paramtype">struct <a class="el" href="structlibiscsi__context.html">libiscsi_context</a> * </td> <td class="paramname"> <em>context</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const struct <a class="el" href="structlibiscsi__node.html">libiscsi_node</a> * </td> <td class="paramname"> <em>node</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const struct <a class="el" href="structlibiscsi__auth__info.html">libiscsi_auth_info</a> * </td> <td class="paramname"> <em>auth_info</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td width="100%"></td> </tr> </table> </div> <div class="memdoc"> <p> This function sets the authentication information for the node described by the given node record. This will overwrite any existing authentication information.<p> This is the way to specify authentication information for nodes found through sendtargets discovery.<p> Note: 1) This is a convience wrapper around <a class="el" href="libiscsi_8c.html#e46d1a8a76d320b8f5257db30fe8bd21">libiscsi_node_set_parameter()</a>, setting the node.session.auth.* parameters. 2) For nodes found through firmware discovery the authentication information has already been set from the firmware. 3) <em>auth_info</em> may be NULL in which case any existing authinfo will be cleared.<p> <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>context</em> </td><td>libiscsi context to operate on. </td></tr> <tr><td valign="top"></td><td valign="top"><em>node</em> </td><td>iSCSI node to set auth information of </td></tr> <tr><td valign="top"></td><td valign="top"><em>auth_info</em> </td><td>Authentication information, or NULL. </td></tr> </table> </dl> <dl compact><dt><b>Returns:</b></dt><dd>0 on success, otherwise a standard error code (from errno.h). </dd></dl> </div> </div><p> <a class="anchor" name="2b33cea406584ae5a3fb29b72e6f2fbb"></a><!-- doxytag: member="libiscsi.h::libiscsi_node_set_parameter" ref="2b33cea406584ae5a3fb29b72e6f2fbb" args="(struct libiscsi_context *context, const struct libiscsi_node *node, const char *parameter, const char *value)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">PUBLIC int libiscsi_node_set_parameter </td> <td>(</td> <td class="paramtype">struct <a class="el" href="structlibiscsi__context.html">libiscsi_context</a> * </td> <td class="paramname"> <em>context</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const struct <a class="el" href="structlibiscsi__node.html">libiscsi_node</a> * </td> <td class="paramname"> <em>node</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const char * </td> <td class="paramname"> <em>parameter</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const char * </td> <td class="paramname"> <em>value</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td width="100%"></td> </tr> </table> </div> <div class="memdoc"> <p> Set the given nodes iSCSI parameter named by <em>parameter</em> to value <em>value</em>.<p> <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>context</em> </td><td>libiscsi context to operate on. </td></tr> <tr><td valign="top"></td><td valign="top"><em>node</em> </td><td>iSCSI node to change a parameter from. </td></tr> <tr><td valign="top"></td><td valign="top"><em>parameter</em> </td><td>Name of the parameter to set. </td></tr> <tr><td valign="top"></td><td valign="top"><em>value</em> </td><td>Value to set the parameter too. </td></tr> </table> </dl> <dl compact><dt><b>Returns:</b></dt><dd>0 on success, otherwise a standard error code (from errno.h). </dd></dl> </div> </div><p> <a class="anchor" name="8c6ce5940d21c48547d6b846ee885a5f"></a><!-- doxytag: member="libiscsi.h::libiscsi_verify_auth_info" ref="8c6ce5940d21c48547d6b846ee885a5f" args="(struct libiscsi_context *context, const struct libiscsi_auth_info *auth_info)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">PUBLIC int libiscsi_verify_auth_info </td> <td>(</td> <td class="paramtype">struct <a class="el" href="structlibiscsi__context.html">libiscsi_context</a> * </td> <td class="paramname"> <em>context</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const struct <a class="el" href="structlibiscsi__auth__info.html">libiscsi_auth_info</a> * </td> <td class="paramname"> <em>auth_info</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td width="100%"></td> </tr> </table> </div> <div class="memdoc"> <p> This function checks the validity of the given authentication info. For example in case of CHAP, if the username and password are not empty.<p> This function is mainly intended for use by language bindings.<p> <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>context</em> </td><td>libiscsi context to operate on. </td></tr> <tr><td valign="top"></td><td valign="top"><em>auth_info</em> </td><td>Authentication information to check. </td></tr> </table> </dl> <dl compact><dt><b>Returns:</b></dt><dd>0 on success, otherwise EINVAL. </dd></dl> </div> </div><p> <hr size="1"><address style="align: right;"><small>Generated on 18 Oct 2012 for libiscsi by <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address> </body> </html>