added booted?/boot methods
[strongswan.git] / src / dumm / ext / lib / dumm.rb
1 =begin
2 Copyright (C) 2008 Tobias Brunner
3 Hochschule fuer Technik Rapperswil
4
5 This program is free software; you can redistribute it and/or modify it
6 under the terms of the GNU General Public License as published by the
7 Free Software Foundation; either version 2 of the License, or (at your
8 option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
9
10 This program is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 for more details.
14
15 $Id$
16 =end
17
18 require 'dumm.so'
19 require 'dumm/guest'
20
21 module Dumm
22 # unload templates, reset all guests and delete bridges
23 def reset
24 Template.unload
25 Guest.each { |guest|
26 guest.reset if guest.running?
27 }
28 Bridge.each { |bridge|
29 bridge.delete
30 }
31 return Dumm
32 end
33
34 # wait until all running guests have booted up
35 def boot
36 Guest.each {|g|
37 g.boot if g.running?
38 }
39 return Dumm
40 end
41 end
42
43 # vim:sw=2 ts=2 et