<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
                   "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
<!-- lifted from troff+man by doclifter -->
<refentry id='xaddhostman'>
<!--  Copyright \(co 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1994, 1996 X Consortium -->

<!--  Permission is hereby granted, free of charge, to any person obtaining -->
<!--  a copy of this software and associated documentation files (the -->
<!--  "Software"), to deal in the Software without restriction, including -->
<!--  without limitation the rights to use, copy, modify, merge, publish, -->
<!--  distribute, sublicense, and/or sell copies of the Software, and to -->
<!--  permit persons to whom the Software is furnished to do so, subject to -->
<!--  the following conditions: -->

<!--  The above copyright notice and this permission notice shall be included -->
<!--  in all copies or substantial portions of the Software. -->

<!--  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -->
<!--  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -->
<!--  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -->
<!--  IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR -->
<!--  OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -->
<!--  ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -->
<!--  OTHER DEALINGS IN THE SOFTWARE. -->

<!--  Except as contained in this notice, the name of the X Consortium shall -->
<!--  not be used in advertising or otherwise to promote the sale, use or -->
<!--  other dealings in this Software without prior written authorization -->
<!--  from the X Consortium. -->

<!--  Copyright \(co 1985, 1986, 1987, 1988, 1989, 1990, 1991 by -->
<!--  Digital Equipment Corporation -->

<!--  Portions Copyright \(co 1990, 1991 by -->
<!--  Tektronix, Inc. -->

<!--  Permission to use, copy, modify and distribute this documentation for -->
<!--  any purpose and without fee is hereby granted, provided that the above -->
<!--  copyright notice appears in all copies and that both that copyright notice -->
<!--  and this permission notice appear in all copies, and that the names of -->
<!--  Digital and Tektronix not be used in in advertising or publicity pertaining -->
<!--  to this documentation without specific, written prior permission. -->
<!--  Digital and Tektronix makes no representations about the suitability -->
<!--  of this documentation for any purpose. -->
<!--  It is provided ``as is'' without express or implied warranty. -->
<!--   -->
<!--  $XFree86: xc/doc/man/X11/XAddHost.man,v 1.4 2003/11/23 05:40:33 dawes Exp $ -->

<!-- .na -->
<!-- FD listing suppressed (not used) -->
<!-- FN listing suppressed (not used) -->
<!-- IN listing suppressed (not used) -->
<!-- C{ listing suppressed (not used) -->
<!-- C} listing suppressed (not used) -->
<!-- Pn listing suppressed (not used) -->
<!-- hN listing suppressed (not used) -->
<!-- NT listing suppressed (not used) -->
<!-- .		\" Note End \-\- doug kraft 3/85 -->
<!-- NE listing suppressed (not used) -->
<!-- .ny0 -->
<refmeta>
<refentrytitle>XAddHost</refentrytitle>
<manvolnum>3X11</manvolnum>
<refmiscinfo class='date'>__xorgversion__</refmiscinfo>
<refmiscinfo class='source'>XLIB FUNCTIONS</refmiscinfo>
</refmeta>
<refnamediv id='name'>
<refname>XAddHost</refname>
<refname>XAddHosts</refname>
<refname>XListHosts</refname>
<refname>XRemoveHost</refname>
<refname>XRemoveHosts</refname>
<refname>XSetAccessControl</refname>
<refname>XEnableAccessControl</refname>
<refname>XDisableAccessControl</refname>
<refname>XHostAddress</refname>
<refpurpose>control host access and host control structure</refpurpose>
</refnamediv>
<!-- body begins here -->

<refsect1 id='syntax'><title>SYNTAX</title>

<para>int XAddHost&hairsp;(&hairsp;Display *<emphasis remap='I'>display</emphasis>, XHostAddress *<emphasis remap='I'>host</emphasis>&hairsp;);</para> 

<para>int XAddHosts&hairsp;(&hairsp;Display *<emphasis remap='I'>display</emphasis>, XHostAddress *<emphasis remap='I'>hosts</emphasis>, 
int <emphasis remap='I'>num_hosts</emphasis>&hairsp;);</para>

<para>XHostAddress *XListHosts&hairsp;(&hairsp;Display *<emphasis remap='I'>display</emphasis>, int *<emphasis remap='I'>nhosts_return</emphasis>,
Bool <emphasis remap='I'>state_return</emphasis>&hairsp;);</para>

<para>int XRemoveHost&hairsp;(&hairsp;Display *<emphasis remap='I'>display</emphasis>, XHostAddress *<emphasis remap='I'>host</emphasis>&hairsp;);</para>

<para>int XRemoveHosts&hairsp;(&hairsp;Display *<emphasis remap='I'>display</emphasis>, XHostAddress *<emphasis remap='I'>hosts</emphasis>, int <emphasis remap='I'>num_hosts</emphasis>&hairsp;);</para>

<para>int XSetAccessControl&hairsp;(&hairsp;Display *<emphasis remap='I'>display</emphasis>, int <emphasis remap='I'>mode</emphasis>&hairsp;);</para>

<para>int XEnableAccessControl&hairsp;(&hairsp;Display *<emphasis remap='I'>display</emphasis>&hairsp;);</para>

<para>int XDisableAccessControl&hairsp;(&hairsp;Display *<emphasis remap='I'>display</emphasis>&hairsp;);</para>
</refsect1>

<refsect1 id='arguments'><title>ARGUMENTS</title>
<variablelist remap='IP'>
  <varlistentry>
  <term><emphasis remap='I'>display</emphasis></term>
  <listitem>
<para>Specifies the connection to the X server.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>host</emphasis></term>
  <listitem>
<para>Specifies the host that is to be added or removed.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>hosts</emphasis></term>
  <listitem>
<para>Specifies each host that is to be added or removed.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>mode</emphasis></term>
  <listitem>
<para>Specifies the mode.
You can pass
<emphasis remap='I'>&hairsp;EnableAccess&hairsp;</emphasis>
or
<emphasis remap='I'>&hairsp;DisableAccess&hairsp;</emphasis>.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>nhosts_return</emphasis></term>
  <listitem>
<para>Returns the number of hosts currently in the access control list.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>num_hosts</emphasis></term>
  <listitem>
<para>Specifies the number of hosts.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>state_return</emphasis></term>
  <listitem>
<para>Returns the state of the access control.</para>
  </listitem>
  </varlistentry>
</variablelist>
</refsect1>

<refsect1 id='description'><title>DESCRIPTION</title>
<para>The
<emphasis remap='I'>&hairsp;XAddHost&hairsp;</emphasis>
function adds the specified host to the access control list for that display.
The server must be on the same host as the client issuing the command, or a
<emphasis remap='I'>&hairsp;BadAccess&hairsp;</emphasis>
error results.</para>

<para><emphasis remap='I'>&hairsp;XAddHost&hairsp;</emphasis>
can generate
<emphasis remap='I'>&hairsp;BadAccess&hairsp;</emphasis>
and
<emphasis remap='I'>&hairsp;BadValue&hairsp;</emphasis>
errors.</para>

<para>The
<emphasis remap='I'>&hairsp;XAddHosts&hairsp;</emphasis>
function adds each specified host to the access control list for that display.
The server must be on the same host as the client issuing the command, or a
<emphasis remap='I'>&hairsp;BadAccess&hairsp;</emphasis>
error results.</para>

<para><emphasis remap='I'>&hairsp;XAddHosts&hairsp;</emphasis>
can generate
<emphasis remap='I'>&hairsp;BadAccess&hairsp;</emphasis>
and
<emphasis remap='I'>&hairsp;BadValue&hairsp;</emphasis>
errors.</para>

<para>The
<emphasis remap='I'>&hairsp;XListHosts&hairsp;</emphasis>
function returns the current access control list as well as whether the use 
of the list at connection setup was enabled or disabled.
<emphasis remap='I'>&hairsp;XListHosts&hairsp;</emphasis>
allows a program to find out what machines can make connections.
It also returns a pointer to a list of host structures that
were allocated by the function. 
When no longer needed,
this memory should be freed by calling
<emphasis remap='I'>&hairsp;XFree&hairsp;</emphasis>.</para>

<para>The
<emphasis remap='I'>&hairsp;XRemoveHost&hairsp;</emphasis>
function removes the specified host from the access control list 
for that display.
The server must be on the same host as the client process, or a
<emphasis remap='I'>&hairsp;BadAccess&hairsp;</emphasis>
error results.
If you remove your machine from the access list,
you can no longer connect to that server,
and this operation cannot be reversed unless you reset the server.</para>

<para><emphasis remap='I'>&hairsp;XRemoveHost&hairsp;</emphasis>
can generate
<emphasis remap='I'>&hairsp;BadAccess&hairsp;</emphasis>
and
<emphasis remap='I'>&hairsp;BadValue&hairsp;</emphasis>
errors.</para>

<para>The
<emphasis remap='I'>&hairsp;XRemoveHosts&hairsp;</emphasis>
function removes each specified host from the access control list for that 
display.  
The X server must be on the same host as the client process, or a
<emphasis remap='I'>&hairsp;BadAccess&hairsp;</emphasis>
error results.
If you remove your machine from the access list, 
you can no longer connect to that server,
and this operation cannot be reversed unless you reset the server.</para>

<para><emphasis remap='I'>&hairsp;XRemoveHosts&hairsp;</emphasis>
can generate
<emphasis remap='I'>&hairsp;BadAccess&hairsp;</emphasis>
and
<emphasis remap='I'>&hairsp;BadValue&hairsp;</emphasis>
errors.</para>

<para>The
<emphasis remap='I'>&hairsp;XSetAccessControl&hairsp;</emphasis>
function either enables or disables the use of the access control list 
at each connection setup.</para>

<para><emphasis remap='I'>&hairsp;XSetAccessControl&hairsp;</emphasis>
can generate
<emphasis remap='I'>&hairsp;BadAccess&hairsp;</emphasis>
and
<emphasis remap='I'>&hairsp;BadValue&hairsp;</emphasis>
errors.</para>

<para>The
<emphasis remap='I'>&hairsp;XEnableAccessControl&hairsp;</emphasis>
function enables the use of the access control list at each connection setup.</para>

<para><emphasis remap='I'>&hairsp;XEnableAccessControl&hairsp;</emphasis>
can generate a
<emphasis remap='I'>&hairsp;BadAccess&hairsp;</emphasis>
error.</para>

<para>The
<emphasis remap='I'>&hairsp;XDisableAccessControl&hairsp;</emphasis>
function disables the use of the access control list at each connection setup.</para>

<para><emphasis remap='I'>&hairsp;XDisableAccessControl&hairsp;</emphasis>
can generate a
<emphasis remap='I'>&hairsp;BadAccess&hairsp;</emphasis>
error.</para>
</refsect1>

<refsect1 id='structures'><title>STRUCTURES</title>
<para>The
<emphasis remap='I'>&hairsp;XHostAddress&hairsp;</emphasis>
structure contains:</para>

<literallayout remap='.nf'>
<!-- .0D  0 -->

<!-- .ps \n(PS -->
<!-- .if \n(VS&gt;=40 .vs \n(VSu -->
<!-- .if \n(VS&lt;=39 .vs \n(VSp -->
<!-- .TA .5i 3i -->
<!-- .ta .5i 3i -->
typedef struct {
	int family;	/&lowast; for example FamilyInternet */
	int length;	/&lowast; length of address, in bytes */
	char *address;	/&lowast; pointer to where to find the address */
} XHostAddress;
<!-- .ce 0  IGNORED -->
<!-- .in \n(OIu  IGNORED -->

</literallayout> <!-- .fi -->

<para>The family member specifies which protocol address family to use 
(for example, TCP/IP or DECnet) and can be
<emphasis remap='I'>&hairsp;FamilyInternet&hairsp;</emphasis>,
<emphasis remap='I'>&hairsp;FamilyDECnet&hairsp;</emphasis>,
or
<emphasis remap='I'>&hairsp;FamilyChaos&hairsp;</emphasis>.
The length member specifies the length of the address in bytes.
The address member specifies a pointer to the address.</para>
</refsect1>

<refsect1 id='diagnostics'><title>DIAGNOSTICS</title>
<variablelist remap='TP'>
  <varlistentry>
  <term><emphasis remap='I'>&hairsp;BadAccess&hairsp;</emphasis></term>
  <listitem>
<para>A client attempted
to modify the access control list from other than the local
(or otherwise authorized) host.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>&hairsp;BadValue&hairsp;</emphasis></term>
  <listitem>
<para>Some numeric value falls outside the range of values accepted by the request.
Unless a specific range is specified for an argument, the full range defined
by the argument's type is accepted.  Any argument defined as a set of
alternatives can generate this error.</para>
  </listitem>
  </varlistentry>
</variablelist>
</refsect1>

<refsect1 id='see_also'><title>SEE ALSO</title>
<para>XFree(3X11)
<!-- .br -->
<userinput>Xlib - C Language X Interface</userinput></para>
</refsect1>
</refentry>

