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

193 lines
5.0 KiB
HTML
Raw Normal View History

2024-04-02 14:02:31 +00:00
<!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_comp()--Compress 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_comp()--Compress Domain Name</h2>
<div class="box" style="width: 80%;">
<br>
&nbsp;&nbsp;Syntax
<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_comp(unsigned char *<em>expanded_domain_name</em>,
unsigned char *<em>compressed_domain_name</em>,
int <em>answer_buffer_length</em>,
unsigned char **<em>domain_name_pointers</em>,
unsigned char **<em>last_domain_name</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_comp()</em> function is used to compress an expanded 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>expanded_domain_name</strong></dt>
<dd>(Input) The pointer to the expanded domain name.<br>
<br>
</dd>
<dt><strong>compressed_domain_name</strong></dt>
<dd>(Output) The pointer to where the compressed domain name will be
stored.<br>
<br>
</dd>
<dt><strong>answer_buffer_length</strong></dt>
<dd>(Input) The size of the <em>compressed_domain_name</em> buffer.<br>
<br>
</dd>
<dt><strong>domain_name_pointers</strong></dt>
<dd>(Input) The pointer to an array of pointers to previously compressed domain
names in the current message.<br>
<br>
</dd>
<dt><strong>last_domain_name</strong></dt>
<dd>(Input) The pointer to the end of the array specified by
<em>domain_name_pointers</em>.</dd>
</dl>
<br>
<h3>Return Value</h3>
<p><em>dn_comp()</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><em>dn_comp()</em> compresses the domain name pointed to by
<em>expanded_domain_name</em>. The result is placed in
<em>compressed_domain_name</em>.</p>
</li>
</ul>
<br>
<h3>Error Conditions</h3>
<p>When the <em>dn_comp()</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>Compressed_domain_name</em> too small for the compressed domain
name.</li>
</ul>
<br>
<h3>Usage Notes</h3>
<ol>
<li><em>domain_name_pointers</em>[0] points to the beginning of the DNS packet.
The list of pointers ends with a NULL pointer. After
<em>domain_name_pointers</em>[0] is initialized to the beginning of the packet
and <em>domain_name_pointers</em>[1] is initialized to NULL, <em>dn_comp()</em>
updates the list each time it is called.<br>
<br>
</li>
<li><em>dn_comp()</em> calls <em>dn_find()</em> to attempt to locate the
different parts of the domain name being compressed.<br>
<br>
</li>
<li><em>dn_comp()</em> expects EBCDIC data as input. The output from
<em>dn_comp()</em> is also EBCDIC.</li>
</ol>
<br>
<h3>Related Information</h3>
<ul>
<li><a href="dnexp.htm">dn_expand()</a>--Expand 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>