1REMCTL_COMMAND(3) remctl Library Reference REMCTL_COMMAND(3)
2
3
4
6 remctl_command, remctl_commandv - Send a command to a remctl server
7
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
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
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
46 These interfaces have been provided by the remctl client library since
47 its initial release in version 2.0.
48
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
61 SPDX-License-Identifier: FSFAP
62
64 remctl_new(3), remctl_open(3), remctl_output(3), remctl_error(3)
65
66 The current version of the remctl library and complete details of the
67 remctl protocol are available from its web page at
68 <https://www.eyrie.org/~eagle/software/remctl/>.
69
70
71
723.18 2022-05-09 REMCTL_COMMAND(3)