247 lines
6.1 KiB
HTML
247 lines
6.1 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>res_nmkupdate()--Construct an Update Packet</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. -->
|
|
<!-- 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>
|
|
<a name="Top_Of_Page"></a>
|
|
<!-- Java sync-link -->
|
|
<script type="text/javascript" language="Javascript" src="../rzahg/synch.js">
|
|
</script>
|
|
|
|
<h2>res_nmkupdate()--Construct an Update Packet</h2>
|
|
|
|
<div class="box" style="width: 60%;">
|
|
<br>
|
|
Syntax<br>
|
|
<pre>
|
|
#include <sys/types.h>
|
|
#include <netinet/in.h>
|
|
#include <arpa/nameser.h>
|
|
#include <resolv.h>
|
|
|
|
int res_nmkupdate(state* <em>res</em>,
|
|
ns_updrec *<em>update_record</em>,
|
|
unsigned char *<em>buffer</em>,
|
|
int <em>buffer_length</em>)
|
|
|
|
</pre>
|
|
|
|
<br>
|
|
Service Program Name: QSOSRV2<br>
|
|
<!-- iddvc RMBR -->
|
|
<br>
|
|
Default Public Authority: *USE<br>
|
|
<!-- iddvc RMBR -->
|
|
<br>
|
|
Threadsafe: Yes<br>
|
|
<!-- iddvc RMBR -->
|
|
<br>
|
|
</div>
|
|
|
|
<p>The <em>res_nmkupdate()</em> function builds a dynamic update packet from
|
|
the linked list of update records.</p>
|
|
|
|
<br>
|
|
<h3>Parameters</h3>
|
|
|
|
<dl>
|
|
<dt><strong>res</strong></dt>
|
|
|
|
<dd>(Input) The pointer to the <strong>state</strong> structure.<br>
|
|
<br>
|
|
</dd>
|
|
|
|
<dt><strong>update_record</strong></dt>
|
|
|
|
<dd>(Input) The pointer to the linked list of update records. See <a href=
|
|
"resnupdate.htm">res_nupdate()</a> for more information.<br>
|
|
<br>
|
|
</dd>
|
|
|
|
<dt><strong>buffer</strong></dt>
|
|
|
|
<dd>(Input) The pointer to the buffer to be filled in with the update
|
|
packet.<br>
|
|
<br>
|
|
</dd>
|
|
|
|
<dt><strong>buffer_length</strong></dt>
|
|
|
|
<dd>(Input) The length of the <strong><em>buffer</em></strong>.</dd>
|
|
</dl>
|
|
|
|
<br>
|
|
<h3>Authorities</h3>
|
|
|
|
<p>No authorization is required.</p>
|
|
|
|
<br>
|
|
<h3>Return Value</h3>
|
|
|
|
<p><em>res_nmkupdate()</em> returns an integer. Possible values are:</p>
|
|
|
|
<ul>
|
|
<li>n (successful), where n is the actual size of the resulting update
|
|
packet.<br>
|
|
<br>
|
|
</li>
|
|
|
|
<li>-1 (unsuccessful) An error occurred parsing a word or number in the rdata
|
|
portion of the update records.<br>
|
|
<br>
|
|
</li>
|
|
|
|
<li>-2 (unsuccessful) The buffer was too small<br>
|
|
<br>
|
|
</li>
|
|
|
|
<li>-3 (unsuccessful) The zone section is not the first section in the linked
|
|
list, or the section order has a problem. The section order is
|
|
<em>ns_s_zn</em>, <em>ns_s_pr</em> and <em>ns_s_ud</em>.<br>
|
|
<br>
|
|
</li>
|
|
|
|
<li>-4 (unsuccessful) A number overflow occurred.<br>
|
|
<br>
|
|
</li>
|
|
|
|
<li>-5 (unsuccessful) Unknown operation or no records found.</li>
|
|
</ul>
|
|
|
|
<br>
|
|
<h3>Error Conditions</h3>
|
|
<p>When the <em>res_nmkupdate()</em> function fails, <em>res_nmkupdate()</em>
|
|
can set <em>errno</em> to one of the following:</p>
|
|
<dl>
|
|
|
|
<dt><em>[ECONVERT]</em></dt>
|
|
<dd><p>Either the input packet could not be translated
|
|
to ASCII or the answer received could not be translated to the coded character
|
|
set identifier (CCSID) currently in effect for the job.</p></dd>
|
|
|
|
|
|
<dt><em>[EFAULT]</em></dt>
|
|
<dd><p>The system detected a pointer that was invalid
|
|
while attempting to access an input pointer.</p></dd>
|
|
|
|
|
|
<dt><em>[EINVAL]</em></dt>
|
|
<dd><p>One of the following reasons:</p>
|
|
<ul>
|
|
<li>An invalid length or NULL pointer was passed to <em>res_nmkupdate()</em><br><br></li>
|
|
<li>The <strong>res</strong> appears to be initialized but the reserved field
|
|
is not set to zeros.</li>
|
|
</ul>
|
|
<p><strong>Note:</strong> No attempt is made to initialize the
|
|
<strong>res</strong> structure if it was initialized previous to the
|
|
<em>res_nmkupdate()</em> being issued.</p></dd>
|
|
|
|
|
|
<dt><em>[EMSGSIZE]</em></dt>
|
|
<dd><p>The message buffer was too small. The return
|
|
value was -2.</p></dd>
|
|
|
|
</dl>
|
|
|
|
|
|
<br>
|
|
<h3>Usage Notes</h3>
|
|
|
|
<ol>
|
|
<li><em>res_nmkupdate()</em> calls <em>res_ninit()</em> if the
|
|
<strong>res</strong> structure has not been initialized.<br>
|
|
<br>
|
|
</li>
|
|
|
|
<li><em>res_nmkupdate()</em> assumes that the data passed to it is EBCDIC and
|
|
is in the default coded character set identifier (CCSID) currently in effect
|
|
for the job. It translates the data from the default CCSID currently in effect
|
|
for the job to ASCII (CCSID 819) before the data is sent out to a name server.
|
|
The response that it receives from the name server is returned in the default
|
|
CCSID currently in effect for the job.</li>
|
|
</ol>
|
|
|
|
<br>
|
|
<h3>Related Information</h3>
|
|
|
|
<ul>
|
|
<li><a href="resnclose.htm">res_nclose()</a>--Close Socket and Reset res
|
|
Structure<br>
|
|
<br>
|
|
</li>
|
|
|
|
<li><a href="resfindzonecut.htm">res_findzonecut()</a>--Find the Enclosing Zone and
|
|
Servers<br>
|
|
<br>
|
|
</li>
|
|
|
|
<li><a href="reshostalias.htm">res_hostalias()</a>--Retrieve the host alias<br>
|
|
<br>
|
|
</li>
|
|
|
|
<li><a href="resninit.htm">res_ninit()</a>--Initialize res Structure<br>
|
|
<br>
|
|
</li>
|
|
|
|
<li><a href="resnmkquery.htm">res_nmkquery()</a>--Place Domain Query in
|
|
Buffer<br>
|
|
<br>
|
|
</li>
|
|
|
|
<li><a href="resnquery.htm">res_nquery()</a>--Send Domain Query<br>
|
|
<br>
|
|
</li>
|
|
|
|
<li><a href="resnsearch.htm">res_nsearch()</a>--Search for Domain Name<br>
|
|
<br>
|
|
</li>
|
|
|
|
<li><a href="resnsend.htm">res_nsend()</a>--Send Buffered Domain Query<br>
|
|
<br>
|
|
</li>
|
|
|
|
<li><a href="resnsendsigned.htm">res_nsendsigned()</a>--Send Authenticated Domain
|
|
Query<br>
|
|
<br>
|
|
</li>
|
|
|
|
<li><a href="resnupdate.htm">res_nupdate()</a>--Build and Send Dynamic
|
|
Updates<br>
|
|
<br>
|
|
</li>
|
|
|
|
<li><a href="resxlt.htm">res_xlate()</a>--Translate DNS Packets</li>
|
|
</ul>
|
|
|
|
<br>
|
|
|
|
|
|
<hr>
|
|
API introduced: V5R1
|
|
|
|
<hr>
|
|
<center>
|
|
<table cellpadding="2" cellspacing="2">
|
|
<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>
|
|
</center>
|
|
</body>
|
|
</html>
|
|
|