⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 resolvlib.html

📁 Vxworks API操作系统和驱动程序设计API。压缩的HTML文件
💻 HTML
📖 第 1 页 / 共 2 页
字号:
Use the members of this structure to specify the settings you want to apply to the resolver.  It is important to remember that multiple tasks can use the resolver library and that the settings specified in this <b>RESOLV_PARAMS_S</b> structure affect all queries from all tasks.  In addition, you should set resolver parameters at initialization and not while queries could be in progress. Otherwise, the results of the query are unpredictable.  <p>Before calling <b><a href="./resolvLib.html#resolvParamsSet">resolvParamsSet</a>(&nbsp;)</b>, you should first call <b><a href="./resolvLib.html#resolvParamsGet">resolvParamsGet</a>(&nbsp;)</b> to populate a <b>RESOLV_PARAMS_S</b> structure with the current settings.  Thenyou change the values of the members that interest you.    <p>Valid values for the <b>queryOrder</b> member of <b>RESOLV_PARAMS_S</b> structure are defined in <b>resolvLib.h</b>.  Set the <b>domainName</b> member to the domain to which this resolver belongs.  Set the <b>nameServersAddr</b> member to the IP addresses of the DNS server that the resolver can query.  You must specify the IP addresses in standard dotted decimal notation.  This function tries to validate the values in the <b>queryOrder</b> and <b>nameServerAddr</b> members.  This function does not try to validate the domain name.  <p></blockquote><h4>RETURNS</h4><blockquote><p>OK if the parameters are valid, ERROR otherwise.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./resolvLib.html#top">resolvLib</a></b>, <b><a href="./resolvLib.html#resolvGetHostByName">resolvGetHostByName</a>(&nbsp;)</b>, <b><a href="./resolvLib.html#resolvGetHostByAddr">resolvGetHostByAddr</a>(&nbsp;)</b>, <b><a href="./resolvLib.html#resolvDNExpand">resolvDNExpand</a>(&nbsp;)</b>,  <b><a href="./resolvLib.html#resolvDNComp">resolvDNComp</a>(&nbsp;)</b>, <b><a href="./resolvLib.html#resolvSend">resolvSend</a>(&nbsp;)</b>, <b><a href="./resolvLib.html#resolvInit">resolvInit</a>(&nbsp;)</b>, <b><a href="./resolvLib.html#resolvParamsGet">resolvParamsGet</a>(&nbsp;)</b>,  <b><a href="./resolvLib.html#resolvMkQuery">resolvMkQuery</a>(&nbsp;)</b>, <b><a href="./resolvLib.html#resolvQuery">resolvQuery</a>(&nbsp;)</b><hr><a name="resolvParamsGet"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>resolvParamsGet(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>resolvParamsGet(&nbsp;)</strong> - get the parameters which control the resolver library</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void resolvParamsGet    (    RESOLV_PARAMS_S * pResolvParams /* ptr to resolver parameter struct */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine copies the resolver parameters to the <b>RESOLV_PARAMS_S</b>structure referenced in the <i>pResolvParms</i> parameter.  The <b>RESOLV_PARAMS_S</b>structure is defined in <b>resolvLib.h</b> as follows: <pre>    typedef struct       {       char   queryOrder;       char   domainName [MAXDNAME];       char   nameServersAddr [MAXNS][MAXIPADDRLEN];       } RESOLV_PARAMS_S;</pre>Typically, you call this function just before calling <b><a href="./resolvLib.html#resolvParamsSet">resolvParamsSet</a>(&nbsp;)</b>.The <b><a href="./resolvLib.html#resolvParamsGet">resolvParamsGet</a>(&nbsp;)</b> call populates the <b>RESOLV_PARAMS_S</b> structure. You can then modify the default values just before calling <b><a href="./resolvLib.html#resolvParamsSet">resolvParamsSet</a>(&nbsp;)</b>.  <p></blockquote><h4>RETURNS</h4><blockquote><p>N/A<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./resolvLib.html#top">resolvLib</a></b>, <b><a href="./resolvLib.html#resolvGetHostByName">resolvGetHostByName</a>(&nbsp;)</b>, <b><a href="./resolvLib.html#resolvGetHostByAddr">resolvGetHostByAddr</a>(&nbsp;)</b>, <b><a href="./resolvLib.html#resolvDNExpand">resolvDNExpand</a>(&nbsp;)</b>,  <b><a href="./resolvLib.html#resolvDNComp">resolvDNComp</a>(&nbsp;)</b>, <b><a href="./resolvLib.html#resolvSend">resolvSend</a>(&nbsp;)</b>, <b><a href="./resolvLib.html#resolvParamsSet">resolvParamsSet</a>(&nbsp;)</b>, <b><a href="./resolvLib.html#resolvInit">resolvInit</a>(&nbsp;)</b>,  <b><a href="./resolvLib.html#resolvMkQuery">resolvMkQuery</a>(&nbsp;)</b>, <b><a href="./resolvLib.html#resolvQuery">resolvQuery</a>(&nbsp;)</b><hr><a name="resolvDNExpand"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>resolvDNExpand(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>resolvDNExpand(&nbsp;)</strong> - expand a DNS compressed name from a DNS packet</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int resolvDNExpand    (    const u_char * msg,       /* ptr to the start of the DNS packet */    const u_char * eomorig,   /* ptr to the last location +1 of the DNS */                              /* packet */     const u_char * comp_dn,   /* ptr to the compressed domain name */    u_char *       exp_dn,    /* ptr to where the expanded DN is output */    int            length     /* length of the buffer pointed by <i>expd_dn</i> */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This functions expands a compressed DNS name from a DNS packet.  The <i>msg</i>parameter points to that start of the DNS packet.  The <i>eomorig</i> parameterpoints to the last location of the DNS packet plus 1.  The <i>comp_dn</i> parameter points to the compress domain name, and <i>exp_dn</i> parameter expects a pointer to a buffer.  Upon function completion, this buffer contains the expanded domain name.  Use the <i>length</i> parameter to pass inthe size of the buffer referenced by the <i>exp_dn</i> parameter.  <p></blockquote><h4>RETURNS</h4><blockquote><p>The length of the expanded domain name, or ERROR on failure.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./resolvLib.html#top">resolvLib</a></b>, <b><a href="./resolvLib.html#resolvGetHostByName">resolvGetHostByName</a>(&nbsp;)</b>, <b><a href="./resolvLib.html#resolvGetHostByAddr">resolvGetHostByAddr</a>(&nbsp;)</b>, <b><a href="./resolvLib.html#resolvInit">resolvInit</a>(&nbsp;)</b>,  <b><a href="./resolvLib.html#resolvDNComp">resolvDNComp</a>(&nbsp;)</b>, <b><a href="./resolvLib.html#resolvSend">resolvSend</a>(&nbsp;)</b>, <b><a href="./resolvLib.html#resolvParamsSet">resolvParamsSet</a>(&nbsp;)</b>, <b><a href="./resolvLib.html#resolvParamsGet">resolvParamsGet</a>(&nbsp;)</b>,  <b><a href="./resolvLib.html#resolvMkQuery">resolvMkQuery</a>(&nbsp;)</b>, <b><a href="./resolvLib.html#resolvQuery">resolvQuery</a>(&nbsp;)</b><hr><a name="resolvDNComp"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>resolvDNComp(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>resolvDNComp(&nbsp;)</strong> - compress a DNS name in a DNS packet</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int resolvDNComp    (    const u_char * exp_dn,    /* ptr to the expanded domain name */    u_char *       comp_dn,   /* ptr to where to output the compressed name */    int            length,    /* length of the buffer pointed by <i>comp_dn</i> */    u_char * *     dnptrs,    /* ptr to a ptr list of compressed names */    u_char * *     lastdnptr  /* ptr to the last entry pointed by <i>dnptrs</i> */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine takes the expanded domain name referenced in the <i>exp_dn</i> parameter, compresses it, and stores the compressed name in the locationpointed to by the <i>comp_dn</i> parameter.  The <i>length</i> parameter passes in the length of the buffer starting at <i>comp_dn</i>.  The <i>dnptrs</i> parameter is a pointer to a list of pointers to previously compressed names.  The <i>lastdnptr</i> parameter points to the last entry in the <i>dnptrs</i> array.<p></blockquote><h4>RETURNS</h4><blockquote><p>The size of the compressed name, or ERROR.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./resolvLib.html#top">resolvLib</a></b>, <b><a href="./resolvLib.html#resolvGetHostByName">resolvGetHostByName</a>(&nbsp;)</b>, <b><a href="./resolvLib.html#resolvGetHostByAddr">resolvGetHostByAddr</a>(&nbsp;)</b>, <b><a href="./resolvLib.html#resolvDNExpand">resolvDNExpand</a>(&nbsp;)</b>,  <b><a href="./resolvLib.html#resolvInit">resolvInit</a>(&nbsp;)</b>, <b><a href="./resolvLib.html#resolvSend">resolvSend</a>(&nbsp;)</b>, <b><a href="./resolvLib.html#resolvParamsSet">resolvParamsSet</a>(&nbsp;)</b>, <b><a href="./resolvLib.html#resolvParamsGet">resolvParamsGet</a>(&nbsp;)</b>,  <b><a href="./resolvLib.html#resolvMkQuery">resolvMkQuery</a>(&nbsp;)</b>, <b><a href="./resolvLib.html#resolvQuery">resolvQuery</a>(&nbsp;)</b><hr><a name="resolvQuery"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>resolvQuery(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>resolvQuery(&nbsp;)</strong> - construct a query, send it, wait for a response</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int resolvQuery    (    char *   name,            /* domain name */    int      class,           /* query class for IP is C_IN */    int      type,            /* type is T_A, T_PTR, ... */    u_char * answer,          /* buffer to put answer */    int      anslen           /* length of answer buffer */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine constructs a query for the domain specified in the <i>name</i> parameter.  The <i>class</i> parameter specifies the class of the query. The <i>type</i> parameter specifies the type of query. The routine then sendsthe query to the DNS server.  When the server responds, the response is validated and copied to the buffer you supplied in the <i>answer</i> parameter.Use the <i>anslen</i> parameter to pass in the size of the buffer referencedin <i>answer</i>.<p></blockquote><h4>RETURNS</h4><blockquote><p>The length of the response or ERROR.<p></blockquote><h4>ERRNO</h4><blockquote><p><p>&nbsp;<b>S_resolvLib_TRY_AGAIN</b><br>&nbsp;<b>S_resolvLib_HOST_NOT_FOUND</b><br>&nbsp;<b>S_resolvLib_NO_DATA</b><br>&nbsp;<b>S_resolvLib_NO_RECOVERY</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./resolvLib.html#top">resolvLib</a></b>, <b><a href="./resolvLib.html#resolvGetHostByName">resolvGetHostByName</a>(&nbsp;)</b>, <b><a href="./resolvLib.html#resolvGetHostByAddr">resolvGetHostByAddr</a>(&nbsp;)</b>, <b><a href="./resolvLib.html#resolvDNExpand">resolvDNExpand</a>(&nbsp;)</b>,  <b><a href="./resolvLib.html#resolvDNComp">resolvDNComp</a>(&nbsp;)</b>, <b><a href="./resolvLib.html#resolvInit">resolvInit</a>(&nbsp;)</b>, <b><a href="./resolvLib.html#resolvParamsSet">resolvParamsSet</a>(&nbsp;)</b>, <b><a href="./resolvLib.html#resolvParamsGet">resolvParamsGet</a>(&nbsp;)</b>,  <b><a href="./resolvLib.html#resolvMkQuery">resolvMkQuery</a>(&nbsp;)</b><hr><a name="resolvMkQuery"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>resolvMkQuery(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>resolvMkQuery(&nbsp;)</strong> - create all types of DNS queries</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int resolvMkQuery    (    int          op,          /* set to desire query QUERY or IQUERY */    const char * dname,       /* domain name to be use in the query */    int          class,       /* query class for IP is C_IN */    int          type,        /* type is T_A, T_PTR, ... */    const char * data,        /* resource Record (RR) data */    int          datalen,     /* length of the RR */    const char * newrr_in,    /* not used always set to NULL */    char *       buf,         /* out of the constructed query */    int          buflen       /* length of the buffer for the query */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine uses the input parameters to create a domain name query.You can set the <i>op</i> parameter to QUERY or IQUERY.  Specify the domain name in <i>dname</i>, the class in <i>class</i>, the query type in <i>type</i>.  Validvalues for type include <b>T_A</b>, <b>T_PTR</b>, and so on.  Use <i>data</i> to add Resource Record data to the query.  Use <i>datalen</i> to pass in the length of the data buffer.  Set <i>newrr_in</i> to NULL.  This parameter is reserved for future use.  The <i>buf</i> parameter expects a pointer to the output buffer for the constructed query.  Use <i>buflen</i> to pass in the length of the buffer referenced in <i>buf</i>.<p></blockquote><h4>RETURNS</h4><blockquote><p>The length of the constructed query or ERROR.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./resolvLib.html#top">resolvLib</a></b>, <b><a href="./resolvLib.html#resolvGetHostByName">resolvGetHostByName</a>(&nbsp;)</b>, <b><a href="./resolvLib.html#resolvGetHostByAddr">resolvGetHostByAddr</a>(&nbsp;)</b>, <b><a href="./resolvLib.html#resolvDNExpand">resolvDNExpand</a>(&nbsp;)</b>,  <b><a href="./resolvLib.html#resolvDNComp">resolvDNComp</a>(&nbsp;)</b>, <b><a href="./resolvLib.html#resolvSend">resolvSend</a>(&nbsp;)</b>, <b><a href="./resolvLib.html#resolvParamsSet">resolvParamsSet</a>(&nbsp;)</b>, <b><a href="./resolvLib.html#resolvParamsGet">resolvParamsGet</a>(&nbsp;)</b>,  <b><a href="./resolvLib.html#resolvInit">resolvInit</a>(&nbsp;)</b>, <b><a href="./resolvLib.html#resolvQuery">resolvQuery</a>(&nbsp;)</b><hr><a name="resolvSend"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>resolvSend(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>resolvSend(&nbsp;)</strong> - send a pre-formatted query and return the answer</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int resolvSend    (    const char * buf,         /* pre-formatted query */    int          buflen,      /* length of query */    char *       answer,      /* buffer for answer */    int          anslen       /* length of answer */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine takes a pre-formatted DNS query and sends it to the domainserver.  Use <i>buf</i> to pass in a pointer to the query.  Use <i>buflen</i> to pass in the size of the buffer referenced in <i>buf</i>.  The <i>answer</i> parameterexpects a pointer to a buffer into which this routine can write the answer retrieved from the server.  Use <i>anslen</i> to pass in the size ofthe buffer you have provided in <i>anslen</i>.<p></blockquote><h4>RETURNS</h4><blockquote><p>The length of the response or ERROR.<p></blockquote><h4>ERRNO</h4><blockquote><p><p>&nbsp;<b>S_resolvLib_TRY_AGAIN</b><br>&nbsp;ECONNREFUSE<br>&nbsp;ETIMEDOU<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./resolvLib.html#top">resolvLib</a></b>, <b><a href="./resolvLib.html#resolvGetHostByName">resolvGetHostByName</a>(&nbsp;)</b>, <b><a href="./resolvLib.html#resolvGetHostByAddr">resolvGetHostByAddr</a>(&nbsp;)</b>, <b><a href="./resolvLib.html#resolvDNExpand">resolvDNExpand</a>(&nbsp;)</b>,  <b><a href="./resolvLib.html#resolvDNComp">resolvDNComp</a>(&nbsp;)</b>, <b><a href="./resolvLib.html#resolvInit">resolvInit</a>(&nbsp;)</b>, <b><a href="./resolvLib.html#resolvParamsSet">resolvParamsSet</a>(&nbsp;)</b>, <b><a href="./resolvLib.html#resolvParamsGet">resolvParamsGet</a>(&nbsp;)</b>,  <b><a href="./resolvLib.html#resolvMkQuery">resolvMkQuery</a>(&nbsp;)</b>, <b><a href="./resolvLib.html#resolvQuery">resolvQuery</a>(&nbsp;)</b></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -