| 1 | =for stopwords |
|---|
| 2 | remctl const iovec NUL-terminated argv Allbery |
|---|
| 3 | |
|---|
| 4 | =head1 NAME |
|---|
| 5 | |
|---|
| 6 | remctl_command, remctl_commandv - Send a command to a remctl server |
|---|
| 7 | |
|---|
| 8 | =head1 SYNOPSIS |
|---|
| 9 | |
|---|
| 10 | #include <remctl.h> |
|---|
| 11 | |
|---|
| 12 | int B<remctl_command>(struct remctl *I<r>, const char **I<command>); |
|---|
| 13 | |
|---|
| 14 | #include <sys/uio.h> |
|---|
| 15 | |
|---|
| 16 | int B<remctl_commandv>(struct remctl *I<r>, const struct iovec *I<iov>, |
|---|
| 17 | size_t I<count>); |
|---|
| 18 | |
|---|
| 19 | =head1 DESCRIPTION |
|---|
| 20 | |
|---|
| 21 | remctl_command() and remctl_commandv() send a command to a remote remctl |
|---|
| 22 | server. The remctl client object I<r>, created with remctl_new(), should |
|---|
| 23 | have previously been passed to remctl_open() to open a connection to the |
|---|
| 24 | server. |
|---|
| 25 | |
|---|
| 26 | remctl_command() takes the command as a NULL-terminated array of |
|---|
| 27 | NUL-terminated strings (the same layout as an argv array). This function |
|---|
| 28 | is most convenient when passing simple text commands. |
|---|
| 29 | |
|---|
| 30 | remctl_commandv() takes the command as an array of iovec structs of length |
|---|
| 31 | I<count>. This function is most convenient when passing arbitrary data to |
|---|
| 32 | the command, since the iovec struct takes a pointer and a length for each |
|---|
| 33 | chunk of data. See writev(2) for the layout of the iovec struct. |
|---|
| 34 | |
|---|
| 35 | After calling one of these functions, call remctl_output() to get the |
|---|
| 36 | results of the command. |
|---|
| 37 | |
|---|
| 38 | =head1 RETURN VALUE |
|---|
| 39 | |
|---|
| 40 | remctl_command() and remctl_commandv() return true on success and false on |
|---|
| 41 | failure. On failure, the caller should call remctl_error() to retrieve |
|---|
| 42 | the error message. |
|---|
| 43 | |
|---|
| 44 | =head1 SEE ALSO |
|---|
| 45 | |
|---|
| 46 | remctl_new(3), remctl_open(3), remctl_output(3), remctl_error(3) |
|---|
| 47 | |
|---|
| 48 | The current version of the remctl library and complete details of the |
|---|
| 49 | remctl protocol are available from its web page at |
|---|
| 50 | L<http://www.eyrie.org/~eagle/software/remctl/>. |
|---|
| 51 | |
|---|
| 52 | =head1 AUTHOR |
|---|
| 53 | |
|---|
| 54 | Russ Allbery <rra@stanford.edu> |
|---|
| 55 | |
|---|
| 56 | =cut |
|---|