diff options
author | Tobias Brunner <tobias@strongswan.org> | 2008-07-30 12:58:45 +0000 |
---|---|---|
committer | Tobias Brunner <tobias@strongswan.org> | 2008-07-30 12:58:45 +0000 |
commit | 2e73cd6e87bced8ac145f86ef6c854f35b234f37 (patch) | |
tree | 0cecf680e986b4fb3f13bdfe79d664751297a8a8 /src/dumm/guest.h | |
parent | 38a8e397396985480d8e6a1e55e16902ad961bfa (diff) | |
download | strongswan-2e73cd6e87bced8ac145f86ef6c854f35b234f37.tar.bz2 strongswan-2e73cd6e87bced8ac145f86ef6c854f35b234f37.tar.xz |
added an extended exec function to guests that allows to get the output of the command as string or by line.
Diffstat (limited to 'src/dumm/guest.h')
-rw-r--r-- | src/dumm/guest.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/dumm/guest.h b/src/dumm/guest.h index 98e5ebb44..3b1b06435 100644 --- a/src/dumm/guest.h +++ b/src/dumm/guest.h @@ -153,6 +153,22 @@ struct guest_t { char *cmd, ...); /** + * Execute a command in the guest and return the output by lines or as combined + * string. + * + * @note This function does not work with binary output (i.e. containing 0 bytes). + * + * @param cb callback to call for each line or for the complete output + * @param lines TRUE if the callback should be called for each line (instead of for the combined output) + * @param data data to pass to callback + * @param cmd command to execute + * @param ... printf style argument list for cmd + * @return return value + */ + int (*exec_str)(guest_t *this, void(*cb)(void*,char*), bool lines, + void *data, char *cmd, ...); + + /** * @brief Called whenever a SIGCHILD for the guests PID is received. */ void (*sigchild)(guest_t *this); |