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

124 lines
3.2 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>freeaddrinfo--Free Address Information API</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. -->
<!-- Created for V5R2 by Chris Gloe -->
<!-- Edited by Kersten Feb 02 -->
<link rel="stylesheet" type="text/css" href="../rzahg/ic.css">
</head>
<body>
<!-- End Header Records -->
<!-- Java sync-link -->
<script type="text/javascript" language="Javascript" src="../rzahg/synch.js">
</script>
<a name="Top_Of_Page"></a>
<h2>freeaddrinfo()--Free Address
Information</h2>
<div class="box" style="width: 60%;">
<br>
&nbsp;&nbsp;Syntax
<pre>
#include &lt;sys/socket.h&gt;
#include &lt;netdb.h&gt;
void freeaddrinfo(struct addrinfo *ai);
</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 <strong>freeaddrinfo()</strong> function frees one or more addrinfo
structures returned by <a href="getaddrinfo.htm">getaddrinfo()</a>, along with
any additional storage associated with those structures. If the
<em>ai_next</em> field of the structure is not null, the entire list of
structures is freed.</p>
<br>
<h3>Parameters</h3>
<dl>
<dt><strong>ai</strong></dt>
<dd>(Input) The pointer to a <strong>struct addrinfo</strong> that was returned
by <a href="getaddrinfo.htm">getaddrinfo()</a>.
<p>The structure <strong>struct addrinfo</strong> is defined in
<strong>&lt;netdb.h&gt;</strong>.</p>
<pre>
struct addrinfo {
int ai_flags; /* AI_PASSIVE, AI_CANONNAME, AI_NUMERICHOST, .. */
int ai_family; /* PF_xxx */
int ai_socktype; /* SOCK_xxx */
int ai_protocol; /* 0 or IPPROTO_xxx for IPv4 and IPv6 */
socklen_t ai_addrlen; /* length of ai_addr */
char *ai_canonname; /* canonical name for nodename */
struct sockaddr *ai_addr; /* binary address */
struct addrinfo *ai_next; /* next structure in linked list */
};
</pre>
</dd>
</dl>
<br>
<h3>Authorities</h3>
<p>No authorization is required.</p>
<br>
<h3>Usage Notes</h3>
<ol>
<li>The <strong>freeaddrinfo()</strong> API supports the freeing of arbitrary
sublists of an <em>addrinfo</em> list originally returned by <a href=
"getaddrinfo.htm">getaddrinfo()</a>.</li>
</ol>
<br>
<h3>Related Information</h3>
<ul>
<li><a href="getaddrinfo.htm">getaddrinfo()</a>--Get Address Information<br>
<br>
</li>
</ul>
<br>
<br>
<hr>
API introduced: V5R2
<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>