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

154 lines
4.3 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>ns_ntoa_r() -- Translate Network Services</title>
<!-- 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. -->
<!-- Begin Header Records ========================================== -->
<!-- Unix8 SCRIPT J converted by B2H R4.1 (346) (CMS) by V2KEA304 -->
<!-- at RCHVMW2 on 17 Feb 1999 at 11:05:09 -->
<!--End Header Records -->
<!-- Edited by Kersten Feb 02 -->
<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>ns_ntoa_r() -- Translate Network Services Address from 12-byte Address</h2>
<div class="box" style="width: 60%;">
<br>
&nbsp;&nbsp;Syntax<br>
<pre>
#include &lt;sys/types.h&gt;
#include &lt;netns/ns.h&gt;
int ns_ntoa_r(struct ns_addr
<em>network_services_address</em>,
char *<em>output_buffer</em>,
int <em>output_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>ns_ntoa_r()</em> function is used to translate a network services
address from a 12-byte address to a human readable format.</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>struct ns_addr <strong>network_services_address</strong>
&nbsp;(input)&nbsp;</dt>
<dd>Specifies the 12-byte network services address that is to be converted to
human readable format.<br>
<br>
</dd>
<dt>char * <strong>output_buffer</strong> &nbsp;(input/output)&nbsp;</dt>
<dd>Specifies the pointer to the converted string.<br>
<br>
</dd>
<dt>int <strong>output_buffer_length</strong> &nbsp;(input)&nbsp;</dt>
<dd>Specifies the length of the output buffer (length should at least 35).</dd>
</dl>
<br>
<h3>Return Value</h3>
<p>The <em>ns_ntoa_r()</em> function returns:</p>
<ul>
<li>-1 (unsuccessful call)</li>
<li>0 (successful call)</li>
</ul>
<h3>Error Conditions</h3>
<p>When the <em>ns_ntoa_r()</em> function fails, <em>errno</em> can be set
to:</p>
<dl>
<dt><em>[EINVAL]</em></dt>
<dd><p>Parameter is not valid.</p>
<p>This error code indicates one of the following:</p>
<ul>
<li>The <em>output_buffer_length</em> length is less than 35.</li>
</ul>
</dd>
</dl>
<br>
<br>
<h3>Usage Notes</h3>
<ol>
<li>The network services address consists of three fields, the network field,
the host field, and the port number field. <em>ns_ntoa_r()</em> will return
these fields as a single character string with the fields separated by the
period (.) character. The character string is always terminated with a NULL
character.<br>
<br>
</li>
<li>The fields are always returned in hexadecimal notation.
<em>ns_ntoa_r()</em> will insert an 'H' character at the end of each field that
does not contain an a,b,c,d,e,f,A,B,C,D,E or F character, in order to make it
obvious that the notation is in hexadecimal.<br>
<br>
</li>
<li>Not all fields need be returned. For example, if the host field and the
port number field of the network services address both contain hexadecimal
zeros, the <em>ns_ntoa_r()</em> routine will return a character string that
only contains the network field.</li>
</ol>
<br>
<hr>
API introduced: V4R2
<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>