1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>rpc_localaddr</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="Linux Networking and Network Devices APIs"><link rel="up" href="ch01s05.html" title="SUN RPC subsystem"><link rel="prev" href="API-rpc-peeraddr2str.html" title="rpc_peeraddr2str"><link rel="next" href="API-rpc-protocol.html" title="rpc_protocol"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"><span class="phrase">rpc_localaddr</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-rpc-peeraddr2str.html">Prev</a>&#160;</td><th width="60%" align="center">SUN RPC subsystem</th><td width="20%" align="right">&#160;<a accesskey="n" href="API-rpc-protocol.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-rpc-localaddr"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>rpc_localaddr &#8212; 
2     discover local endpoint address for an RPC client
3 </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <b class="fsfunc">rpc_localaddr </b>(</code></td><td>struct rpc_clnt * <var class="pdparam">clnt</var>, </td></tr><tr><td>&#160;</td><td>struct sockaddr * <var class="pdparam">buf</var>, </td></tr><tr><td>&#160;</td><td>size_t <var class="pdparam">buflen</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div></div><div class="refsect1"><a name="idp1097486108"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>clnt</code></em></span></dt><dd><p>
4     RPC client structure
5    </p></dd><dt><span class="term"><em class="parameter"><code>buf</code></em></span></dt><dd><p>
6     target buffer
7    </p></dd><dt><span class="term"><em class="parameter"><code>buflen</code></em></span></dt><dd><p>
8     size of target buffer, in bytes
9    </p></dd></dl></div></div><div class="refsect1"><a name="idp1097489756"></a><h2>Description</h2><p>
10   Returns zero and fills in <span class="quote">&#8220;<span class="quote">buf</span>&#8221;</span> and <span class="quote">&#8220;<span class="quote">buflen</span>&#8221;</span> if successful;
11   otherwise, a negative errno is returned.
12   </p><p>
13
14   This works even if the underlying transport is not currently connected,
15   or if the upper layer never previously provided a source address.
16</p></div><div class="refsect1"><a name="idp1097491156"></a><h2>The result of this function call is transient</h2><p>
17   multiple calls in
18   succession may give different results, depending on how local
19   networking configuration changes over time.
20</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-rpc-peeraddr2str.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="ch01s05.html">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="API-rpc-protocol.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">rpc_peeraddr2str</span>&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;<span class="phrase">rpc_protocol</span></td></tr></table></div></body></html>
21