summaryrefslogtreecommitdiff
path: root/src/dumm/ext/dumm.c
diff options
context:
space:
mode:
authorRene Mayrhofer <rene@mayrhofer.eu.org>2008-12-05 16:44:41 +0000
committerRene Mayrhofer <rene@mayrhofer.eu.org>2008-12-05 16:44:41 +0000
commit2db1ef4ac8928944958712923b9c89c263a337d2 (patch)
tree700043d9d97b7e7ba344b448918728af0a8be8d1 /src/dumm/ext/dumm.c
parent5dc75410286b0e3a16845b44dd696ba0f40df573 (diff)
downloadvyos-strongswan-2db1ef4ac8928944958712923b9c89c263a337d2.tar.gz
vyos-strongswan-2db1ef4ac8928944958712923b9c89c263a337d2.zip
- Updated to new upstream.
Diffstat (limited to 'src/dumm/ext/dumm.c')
-rw-r--r--src/dumm/ext/dumm.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/dumm/ext/dumm.c b/src/dumm/ext/dumm.c
index 97f14ef85..2610affc3 100644
--- a/src/dumm/ext/dumm.c
+++ b/src/dumm/ext/dumm.c
@@ -13,7 +13,7 @@
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
- * $Id: dumm.c 4410 2008-10-10 11:20:04Z martin $
+ * $Id: dumm.c 4447 2008-10-15 14:47:52Z martin $
*/
#include <stdio.h>
@@ -207,6 +207,22 @@ static VALUE guest_exec(VALUE self, VALUE cmd)
block = rb_block_given_p();
Data_Get_Struct(self, guest_t, guest);
if ((ret = guest->exec_str(guest, block ? (void*)exec_cb : NULL, TRUE, NULL,
+ "exec %s", StringValuePtr(cmd))) != 0)
+ {
+ rb_raise(rb_eRuntimeError, "executing command failed (%d)", ret);
+ }
+ return self;
+}
+
+static VALUE guest_mconsole(VALUE self, VALUE cmd)
+{
+ guest_t *guest;
+ bool block;
+ int ret;
+
+ block = rb_block_given_p();
+ Data_Get_Struct(self, guest_t, guest);
+ if ((ret = guest->exec_str(guest, block ? (void*)exec_cb : NULL, TRUE, NULL,
"%s", StringValuePtr(cmd))) != 0)
{
rb_raise(rb_eRuntimeError, "executing command failed (%d)", ret);
@@ -310,6 +326,7 @@ static void guest_init()
rb_define_method(rbc_guest, "stop", guest_stop, 0);
rb_define_method(rbc_guest, "running?", guest_running, 0);
rb_define_method(rbc_guest, "exec", guest_exec, 1);
+ rb_define_method(rbc_guest, "mconsole", guest_mconsole, 1);
rb_define_method(rbc_guest, "add", guest_add_iface, 1);
rb_define_method(rbc_guest, "[]", guest_get_iface, 1);
rb_define_method(rbc_guest, "each", guest_each_iface, -1);