1REMCTL_COMMAND(3)          remctl Library Reference          REMCTL_COMMAND(3)
2
3
4

NAME

6       remctl_command, remctl_commandv - Send a command to a remctl server
7

SYNOPSIS

9       #include <remctl.h>
10
11       int remctl_command(struct remctl *r, const char **command);
12
13       #include <sys/uio.h>
14
15       int remctl_commandv(struct remctl *r, const struct iovec *iov,
16                           size_t count);
17

DESCRIPTION

19       remctl_command() and remctl_commandv() send a command to a remote
20       remctl server.  The remctl client object r, created with remctl_new(),
21       should have previously been passed to remctl_open() to open a
22       connection to the server.
23
24       remctl_command() takes the command as a NULL-terminated array of NUL-
25       terminated strings (the same layout as an argv array).  This function
26       is most convenient when passing simple text commands.
27
28       remctl_commandv() takes the command as an array of iovec structs of
29       length count.  This function is most convenient when passing arbitrary
30       data to the command, since the iovec struct takes a pointer and a
31       length for each chunk of data.  See writev(2) for the layout of the
32       iovec struct.
33
34       To control the network timeout for sending the command, see the
35       remctl_set_timeout(3) function.
36
37       After calling one of these functions, call remctl_output() to get the
38       results of the command.
39

RETURN VALUE

41       remctl_command() and remctl_commandv() return true on success and false
42       on failure.  On failure, the caller should call remctl_error() to
43       retrieve the error message.
44

COMPATIBILITY

46       These interfaces have been provided by the remctl client library since
47       its initial release in version 2.0.
48

AUTHOR

50       Russ Allbery <eagle@eyrie.org>
51
53       Copyright 2007, 2009, 2014 The Board of Trustees of the Leland Stanford
54       Junior University
55
56       Copying and distribution of this file, with or without modification,
57       are permitted in any medium without royalty provided the copyright
58       notice and this notice are preserved.  This file is offered as-is,
59       without any warranty.
60

SEE ALSO

62       remctl_new(3), remctl_open(3), remctl_output(3), remctl_error(3)
63
64       The current version of the remctl library and complete details of the
65       remctl protocol are available from its web page at
66       <http://www.eyrie.org/~eagle/software/remctl/>.
67
68
69
703.14                              2018-04-01                 REMCTL_COMMAND(3)
Impressum