X is not particularly sophisticated about its access control. Each server program looks in /etc/X?.hosts when it starts up to find a list of machines which it will accept connections from. (? is the display number) The following calls permit the user to modify the situation. From the terminal it is also possible to add and remove hosts using xhost(1).
All the functions use the XHostAddress structure. DECnet nodes must terminate in '::' to distinguish them from internet nodes.
#include <sys/socket.h> XAddHost (display,host) /* add a host */ XHostAddress *host; /* network address */ XAddHosts (display,hosts,num_hosts) /* add hosts */ XHostAddress *hosts; /* network address */ int num_hosts; #include <sys/socket.h> XRemoveHost (display,host) /* remove a host */ XHostAddress *host; /* network address */ XRemoveHosts (display,hosts,num_hosts) /* remove a hosts */ XHostAddress *host; /* network address */ int num_hosts; #include <sys/socket.h> struct in_addr *XListHosts (display,nhosts,state)/* RETURN list of hosts */ int *nhosts; /* RETURN number of hosts on list */ Bool *state; /* RETURN state of connection set up*/ XSetAccessControl(display,mode) int mode; XEnableAccessControl(display) XDisableAccessControl(display)