]> git.proxmox.com Git - systemd.git/blob - man/sd_machine_get_ifindices.html
Imported Upstream version 218
[systemd.git] / man / sd_machine_get_ifindices.html
1 <html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>sd_machine_get_class</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><style>
2 a.headerlink {
3 color: #c60f0f;
4 font-size: 0.8em;
5 padding: 0 4px 0 4px;
6 text-decoration: none;
7 visibility: hidden;
8 }
9
10 a.headerlink:hover {
11 background-color: #c60f0f;
12 color: white;
13 }
14
15 h1:hover > a.headerlink, h2:hover > a.headerlink, h3:hover > a.headerlink, dt:hover > a.headerlink {
16 visibility: visible;
17 }
18 </style><a href="index.html">Index </a>·
19 <a href="systemd.directives.html">Directives </a>·
20 <a href="../python-systemd/index.html">Python </a>·
21 <a href="../libudev/index.html">libudev </a>·
22 <a href="../libudev/index.html">gudev </a><span style="float:right">systemd 218</span><hr><div class="refentry"><a name="sd_machine_get_class"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>sd_machine_get_class, sd_machine_get_ifindices — Determine the class and network interface
23 indices of a locally running virtual machine or
24 container.</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;systemd/sd-login.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <b class="fsfunc">sd_machine_get_class</b>(</code></td><td>const char* <var class="pdparam">machine</var>, </td></tr><tr><td> </td><td>char *<var class="pdparam">class</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <b class="fsfunc">sd_machine_get_ifindices</b>(</code></td><td>const char* <var class="pdparam">machine</var>, </td></tr><tr><td> </td><td>int **<var class="pdparam">ifindices</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a name="idm140258410831376"></a><h2 id="Description">Description<a class="headerlink" title="Permalink to this headline" href="#Description"></a></h2><p><code class="function">sd_machine_get_class()</code> may
25 be used to determine the class of a locally running
26 virtual machine or container that is registered with
27 <a href="systemd-machined.service.html"><span class="citerefentry"><span class="refentrytitle">systemd-machined.service</span>(8)</span></a>. The
28 string returned is either "<code class="literal">vm</code>" or
29 "<code class="literal">container</code>". The returned string
30 needs to be freed with the libc <a href="http://man7.org/linux/man-pages/man3/free.3.html"><span class="citerefentry"><span class="refentrytitle">free</span>(3)</span></a>
31 call after use.</p><p><code class="function">sd_machine_get_ifindices()</code>
32 may be used to determine the numeric indices of the
33 network interfaces on the host that are pointing
34 towards the specified locally running virtual machine
35 or container that is registered with
36 <a href="systemd-machined.service.html"><span class="citerefentry"><span class="refentrytitle">systemd-machined.service</span>(8)</span></a>. The
37 returned array needs to be freed with the libc
38 <a href="http://man7.org/linux/man-pages/man3/free.3.html"><span class="citerefentry"><span class="refentrytitle">free</span>(3)</span></a>
39 call after use.</p></div><div class="refsect1"><a name="idm140258414727104"></a><h2 id="Return Value">Return Value<a class="headerlink" title="Permalink to this headline" href="#Return%20Value"></a></h2><p>On success, these calls return 0 or a positive
40 integer. On failure, these calls return a negative
41 errno-style error code.</p></div><div class="refsect1"><a name="idm140258414725744"></a><h2 id="Notes">Notes<a class="headerlink" title="Permalink to this headline" href="#Notes"></a></h2><p>The <code class="function">sd_machine_get_class()</code> and
42 <code class="function">sd_machine_get_ifindices()</code> interfaces are
43 available as a shared library, which can be compiled
44 and linked to with the
45 <code class="constant">libsystemd</code> <a href="http://linux.die.net/man/1/pkg-config"><span class="citerefentry"><span class="refentrytitle">pkg-config</span>(1)</span></a>
46 file.</p></div><div class="refsect1"><a name="idm140258414721456"></a><h2 id="See Also">See Also<a class="headerlink" title="Permalink to this headline" href="#See%20Also"></a></h2><p>
47 <a href="systemd.html"><span class="citerefentry"><span class="refentrytitle">systemd</span>(1)</span></a>,
48 <a href="sd-login.html"><span class="citerefentry"><span class="refentrytitle">sd-login</span>(3)</span></a>,
49 <a href="systemd-machined.service.html"><span class="citerefentry"><span class="refentrytitle">systemd-machined.service</span>(8)</span></a>,
50 <a href="sd_pid_get_machine_name.html"><span class="citerefentry"><span class="refentrytitle">sd_pid_get_machine_name</span>(3)</span></a>
51 </p></div></div></body></html>