init_ipcx - inititalize interface to ipcexecd server
startserver - start a server on a remote machine

#include <mach.h>
#include <servers/ipcx.h>

void init_ipcx(reply_port);
port_t reply_port;

kern_return_t startserver(
port_t ServPort;
a_string userid;
a_string password;
a_string commandline;
port_t *server_k_port;
port_t *server_n_port;

reply_port port that startserver will reply on. If set to
PORT_NULL a new port will be allocated.

ServPort port to the ipcexecd server on the remote machine.

userid the userid under which the started server will run.

password the (encrypted) password of the user specified by

commandline the command line used to startup the requested
server. The first item should be the name of the
program to run, and the rest of the line is any
arguments to that program.

server_k_port The task_self port of the started program

server_n_port The task_notify port of the started program.

startserver will start a task on a remote host. The first word of
the commandline must be the name of the program that the remote
task is to execute. Any other words on that line are passed to the
task in the argv vector. Words are separated by one or more spaces.
The remote task will be run under the userid that is provided. The
passwd is checked for validity by su. The two ports that are
returned allow the caller to control the remote task.
server_k_port is the remote task’s port to the kernel, e.g. its
task_self() port. Using this port, the client can make kernel
calls on behalf of the remote task. server_n_port is the
notification port of the remote task, e.g. its task_notify() port.

For this call to work an ipcexecd server must be running on the
target host. The port to this server can be found by a call to
net_name_lookup for the name <prefix><host_name>. <prefix> is
either DEFAULT_PREFIX defined in the file <servers/ipcx_types.h> or
the prefix argument that the ipcexecd server was started with.
<host_name> is the name of the target machine. There is also a
program start_rem_server(1) that will prompt for the remote machine
name and the command line, do the appropriate net_name_lookups and
call startserver.

KERN_SUCCESS the requested program was successfully started.

the program to run was not found.

IPCX_WRONGUSER either the userid was not found or the password was

KERN_FAILURE the ipcexecd server was unable to fork a task for
the requested program.

net_name_lookup(3), ipcexecd(8)