134 lines
3.4 KiB
HTML
134 lines
3.4 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>inet_ntoa_r()--Translate IP Address to Dotted Decimal Format</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 language="Javascript" src="../rzahg/synch.js" type="text/javascript">
|
||
|
</script>
|
||
|
|
||
|
<h2>inet_ntoa_r()--Translate IP Address to Dotted Decimal Format</h2>
|
||
|
|
||
|
<div class="box" style="width: 60%;">
|
||
|
<br>
|
||
|
Syntax<br>
|
||
|
<pre>
|
||
|
#include <sys/types.h>
|
||
|
#include <sys/socket.h>
|
||
|
#include <netinet/in.h>
|
||
|
#include <arpa/inet.h>
|
||
|
|
||
|
int inet_ntoa_r(struct in_addr <em>internet_address</em>,
|
||
|
char *<em>output_buffer</em>,
|
||
|
int <em>output_buffer_length</em>)
|
||
|
|
||
|
</pre>
|
||
|
|
||
|
Service Program Name: Name QSOSRV2<br>
|
||
|
<!-- iddvc RMBR -->
|
||
|
<br>
|
||
|
Default Public Authority: *USE<br>
|
||
|
<!-- iddvc RMBR -->
|
||
|
<br>
|
||
|
Threadsafe: Yes<br>
|
||
|
<!-- iddvc RMBR -->
|
||
|
<br>
|
||
|
</div>
|
||
|
|
||
|
<p>The <em>inet_ntoa_r()</em> function is used to translate an Internet address
|
||
|
from a 32-bit IP address to dotted decimal 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><strong>struct in_addr <em>internet_address</em></strong>
|
||
|
(input) </dt>
|
||
|
|
||
|
<dd>The 32-bit IP address that is to be converted to dotted decimal format.<br>
|
||
|
<br>
|
||
|
</dd>
|
||
|
|
||
|
<dt><strong>char * <em>output_buffer</em></strong>
|
||
|
(input/output) </dt>
|
||
|
|
||
|
<dd>The pointer to the buffer that contains the dotted decimal format.<br>
|
||
|
<br>
|
||
|
</dd>
|
||
|
|
||
|
<dt><strong>int <em>output_buffer_length</em></strong> (input) </dt>
|
||
|
|
||
|
<dd>The length of the output buffer (length should be at least 16).</dd>
|
||
|
</dl>
|
||
|
|
||
|
<br>
|
||
|
|
||
|
|
||
|
<h3>Return Value</h3>
|
||
|
|
||
|
<p>The <em>inet_ntoa_r()</em> function returns:</p>
|
||
|
|
||
|
<ul>
|
||
|
<li>-1 (unsuccessful call)</li>
|
||
|
|
||
|
<li>0 (successful call)</li>
|
||
|
</ul>
|
||
|
|
||
|
<br>
|
||
|
|
||
|
|
||
|
<h3>Error Conditions</h3>
|
||
|
|
||
|
<p>When the <em>inet_ntoa_r()</em> function fails, <em>errno</em> can be set
|
||
|
to:</p>
|
||
|
|
||
|
<dl>
|
||
|
<dt><em>[EINVAL]</em></dt>
|
||
|
<dd>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 16.</li>
|
||
|
</ul></dd>
|
||
|
</dl>
|
||
|
<br>
|
||
|
<hr>
|
||
|
API introduced: V4R2
|
||
|
|
||
|
<hr>
|
||
|
<center>
|
||
|
<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></center>
|
||
|
</body>
|
||
|
</html>
|
||
|
|