ibm-information-center/dist/eclipse/plugins/i5OS.ic.apis_5.4.0.1/dnexp.htm

186 lines
4.8 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Copyright" content="Copyright (c) 2006 by IBM Corporation">
<title>dn_expand()--Expand Domain Name</title>
<!-- Begin Header Records ========================================== -->
<!-- All rights reserved. Licensed Materials Property of IBM -->
<!-- US Government Users Restricted Rights -->
<!-- Use, duplication or disclosure restricted by -->
<!-- GSA ADP Schedule Contract with IBM Corp. -->
<!-- Change History: -->
<!-- YYMMDD USERID Change description -->
<!-- Unix8 SCRIPT J converted by B2H R4.1 (346) (CMS) by V2KEA304 -->
<!-- at RCHVMW2 on 17 Feb 1999 at 11:05:09 -->
<!-- Edited by Kersten Feb 02 -->
<!-- End Header Records -->
<link rel="stylesheet" type="text/css" href="../rzahg/ic.css">
</head>
<body>
<!-- Java sync-link -->
<script type="text/javascript" language="Javascript" src="../rzahg/synch.js">
</script>
<a name="Top_Of_Page"></a>
<h2>dn_expand()--Expand Domain Name</h2>
<div class="box" style="width: 70%;">
<br>
&nbsp;&nbsp;Syntax<br>
<pre>
#include &lt;sys/types.h&gt;
#include &lt;netinet/in.h&gt;
#include &lt;arpa/nameser.h&gt;
#include &lt;resolv.h&gt;
int dn_expand(unsigned char *<em>message_pointer</em>,
unsigned char *<em>end_of_message</em>,
unsigned char *<em>compressed_domain_name</em>,
unsigned char *<em>expanded_domain_name</em>,
int <em>answer_buffer_length</em>)
</pre>
<br>
&nbsp;&nbsp;Service Program Name: QSOSRV2<br>
<!-- iddvc RMBR -->
<br>
&nbsp;&nbsp;Default Public Authority: *USE<br>
<!-- iddvc RMBR -->
<br>
&nbsp;&nbsp;Threadsafe: Yes<br>
<!-- iddvc RMBR -->
<br>
</div>
<p>The <em>dn_expand()</em> function is used to expand a compressed domain
name.</p>
<br>
<!-- Please NOTE: DO NOT DELETE THIS SECTION if this API has no authorities and locks. -->
<!-- Instead, use the commented out coding below to indicate NONE. -->
<h3>Authorities and Locks</h3>
<!-- Use this if there are no authorities and locks. -->
<p>None.</p>
<br>
<h3>Parameters</h3>
<dl>
<dt><strong>message_pointer</strong></dt>
<dd>(Input) The pointer to the beginning of a DNS packet.<br>
<br>
</dd>
<dt><strong>end_of_message</strong></dt>
<dd>(Input) The pointer to the end of the DNS packet.<br>
<br>
</dd>
<dt><strong>compressed_domain_name</strong></dt>
<dd>(Input) The pointer to the compressed domain name within the DNS
packet.<br>
<br>
</dd>
<dt><strong>expanded_domain_name</strong></dt>
<dd>(Output) The pointer to the expanded domain name.<br>
<br>
</dd>
<dt><strong>answer_buffer_length</strong></dt>
<dd>(Input) The size of the <em>expanded_domain_name</em> buffer.</dd>
</dl>
<br>
<h3>Return Value</h3>
<p><em>dn_expand()</em> returns an integer. Possible values are:</p>
<ul>
<li>-1 (unsuccessful)<br>
<br>
</li>
<li>n (successful), where n is the size of the compressed domain name.
<p>The <em>dn_expand()</em> routine expands the domain name pointed to by
<em>compressed_domain_name</em>. The result is placed in
<em>expanded_domain_name</em>.</p>
</li>
</ul>
<br>
<h3>Error Conditions</h3>
<p>When the <em>dn_expand()</em> function fails, it does not set specific
<em>errno</em> or <em>h_errno</em> values. An error occurs under the following
conditions:</p>
<ul>
<li>NULL pointer(s) passed to the function.<br><br></li>
<li>Invalid pointer(s) passed to the function.<br><br></li>
<li><em>expanded_domain_name</em> too small for the expanded domain name.<br><br></li>
<li><em>end_of_message</em> reached before the domain name could be
expanded.</li>
</ul>
<br>
<h3>Usage Notes</h3>
<ol>
<li>The compressed domain name size is returned rather than the expanded domain
name size because it is used to parse through the DNS packet.<br>
<br>
</li>
<li><em>dn_expand()</em> uses <em>end_of_message</em> to insure that it doesn't
run past the end of the DNS packet.<br>
<br>
</li>
<li><em>dn_expand()</em> expects EBCDIC data as input. The output from
<em>dn_expand()</em> is also EBCDIC.</li>
</ol>
<br>
<h3>Related Information</h3>
<ul>
<li><a href="dncomp.htm">dn_comp()</a>--Compress Domain Name<br>
<br>
</li>
<li><a href="dnfind.htm">dn_find()</a>--Search for Compressed Domain Name<br>
<br>
</li>
<li><a href="dnsknm.htm">dn_skipname()</a>--Skip over Compressed Domain
Name</li>
</ul>
<br>
<hr>
API introduced: V3R1
<hr>
<table cellpadding="2" cellspacing="2" align="center">
<tr align="center">
<td valign="middle" align="center"><a href="#Top_Of_Page">Top</a> | <a href=
"unix.htm">UNIX-Type APIs</a> | <a href="aplist.htm">APIs by category</a> </td>
</tr>
</table>
</body>
</html>