ruby-libvirt 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/NEWS +10 -0
- data/README +188 -21
- data/Rakefile +11 -7
- data/ext/libvirt/_libvirt.c +252 -234
- data/ext/libvirt/common.c +346 -71
- data/ext/libvirt/common.h +171 -111
- data/ext/libvirt/connect.c +1851 -798
- data/ext/libvirt/connect.h +6 -5
- data/ext/libvirt/domain.c +3903 -1060
- data/ext/libvirt/domain.h +5 -3
- data/ext/libvirt/extconf.rb +275 -41
- data/ext/libvirt/interface.c +60 -41
- data/ext/libvirt/interface.h +3 -1
- data/ext/libvirt/network.c +291 -72
- data/ext/libvirt/network.h +3 -2
- data/ext/libvirt/nodedevice.c +138 -59
- data/ext/libvirt/nodedevice.h +3 -1
- data/ext/libvirt/nwfilter.c +39 -34
- data/ext/libvirt/nwfilter.h +3 -1
- data/ext/libvirt/secret.c +122 -64
- data/ext/libvirt/secret.h +3 -1
- data/ext/libvirt/storage.c +451 -233
- data/ext/libvirt/storage.h +1 -1
- data/ext/libvirt/stream.c +120 -122
- data/ext/libvirt/stream.h +4 -2
- data/tests/test_conn.rb +214 -67
- data/tests/test_domain.rb +553 -209
- data/tests/test_interface.rb +4 -10
- data/tests/test_network.rb +21 -12
- data/tests/test_nodedevice.rb +11 -1
- data/tests/test_nwfilter.rb +4 -0
- data/tests/test_open.rb +59 -6
- data/tests/test_secret.rb +25 -0
- data/tests/test_storage.rb +132 -28
- data/tests/test_stream.rb +171 -0
- data/tests/test_utils.rb +86 -15
- metadata +43 -66
data/ext/libvirt/interface.h
CHANGED
data/ext/libvirt/network.c
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
* network.c: virNetwork methods
|
3
3
|
*
|
4
4
|
* Copyright (C) 2007,2010 Red Hat Inc.
|
5
|
+
* Copyright (C) 2013 Chris Lalancette <clalancette@gmail.com>
|
5
6
|
*
|
6
7
|
* This library is free software; you can redistribute it and/or
|
7
8
|
* modify it under the terms of the GNU Lesser General Public
|
@@ -28,124 +29,156 @@
|
|
28
29
|
#if HAVE_TYPE_VIRNETWORKPTR
|
29
30
|
static VALUE c_network;
|
30
31
|
|
31
|
-
static void network_free(void *d)
|
32
|
-
|
32
|
+
static void network_free(void *d)
|
33
|
+
{
|
34
|
+
ruby_libvirt_free_struct(Network, d);
|
33
35
|
}
|
34
36
|
|
35
|
-
static virNetworkPtr network_get(VALUE
|
36
|
-
|
37
|
+
static virNetworkPtr network_get(VALUE n)
|
38
|
+
{
|
39
|
+
ruby_libvirt_get_struct(Network, n);
|
37
40
|
}
|
38
41
|
|
39
|
-
VALUE
|
40
|
-
|
42
|
+
VALUE ruby_libvirt_network_new(virNetworkPtr n, VALUE conn)
|
43
|
+
{
|
44
|
+
return ruby_libvirt_new_class(c_network, n, conn, network_free);
|
41
45
|
}
|
42
46
|
|
43
47
|
/*
|
44
48
|
* call-seq:
|
45
49
|
* net.undefine -> nil
|
46
50
|
*
|
47
|
-
* Call
|
51
|
+
* Call virNetworkUndefine[http://www.libvirt.org/html/libvirt-libvirt.html#virNetworkUndefine]
|
48
52
|
* to undefine this network.
|
49
53
|
*/
|
50
|
-
static VALUE
|
51
|
-
|
54
|
+
static VALUE libvirt_network_undefine(VALUE n)
|
55
|
+
{
|
56
|
+
ruby_libvirt_generate_call_nil(virNetworkUndefine,
|
57
|
+
ruby_libvirt_connect_get(n),
|
58
|
+
network_get(n));
|
52
59
|
}
|
53
60
|
|
54
61
|
/*
|
55
62
|
* call-seq:
|
56
63
|
* net.create -> nil
|
57
64
|
*
|
58
|
-
* Call
|
65
|
+
* Call virNetworkCreate[http://www.libvirt.org/html/libvirt-libvirt.html#virNetworkCreate]
|
59
66
|
* to start this network.
|
60
67
|
*/
|
61
|
-
static VALUE
|
62
|
-
|
68
|
+
static VALUE libvirt_network_create(VALUE n)
|
69
|
+
{
|
70
|
+
ruby_libvirt_generate_call_nil(virNetworkCreate,
|
71
|
+
ruby_libvirt_connect_get(n),
|
72
|
+
network_get(n));
|
73
|
+
}
|
74
|
+
|
75
|
+
#if HAVE_VIRNETWORKUPDATE
|
76
|
+
/*
|
77
|
+
* call-seq:
|
78
|
+
* net.update -> nil
|
79
|
+
*
|
80
|
+
* Call virNetworkUpdate[http://www.libvirt.org/html/libvirt-libvirt.html#virNetworkUpdate]
|
81
|
+
* to update this network.
|
82
|
+
*/
|
83
|
+
static VALUE libvirt_network_update(VALUE n, VALUE command, VALUE section,
|
84
|
+
VALUE index, VALUE xml, VALUE flags)
|
85
|
+
{
|
86
|
+
ruby_libvirt_generate_call_nil(virNetworkUpdate,
|
87
|
+
ruby_libvirt_connect_get(n),
|
88
|
+
network_get(n), NUM2UINT(command),
|
89
|
+
NUM2UINT(section), NUM2INT(index),
|
90
|
+
StringValuePtr(xml), NUM2UINT(flags));
|
63
91
|
}
|
92
|
+
#endif
|
64
93
|
|
65
94
|
/*
|
66
95
|
* call-seq:
|
67
96
|
* net.destroy -> nil
|
68
97
|
*
|
69
|
-
* Call
|
98
|
+
* Call virNetworkDestroy[http://www.libvirt.org/html/libvirt-libvirt.html#virNetworkDestroy]
|
70
99
|
* to shutdown this network.
|
71
100
|
*/
|
72
|
-
static VALUE
|
73
|
-
|
101
|
+
static VALUE libvirt_network_destroy(VALUE n)
|
102
|
+
{
|
103
|
+
ruby_libvirt_generate_call_nil(virNetworkDestroy,
|
104
|
+
ruby_libvirt_connect_get(n),
|
105
|
+
network_get(n));
|
74
106
|
}
|
75
107
|
|
76
108
|
/*
|
77
109
|
* call-seq:
|
78
110
|
* net.name -> string
|
79
111
|
*
|
80
|
-
* Call
|
112
|
+
* Call virNetworkGetName[http://www.libvirt.org/html/libvirt-libvirt.html#virNetworkGetName]
|
81
113
|
* to retrieve the name of this network.
|
82
114
|
*/
|
83
|
-
static VALUE
|
84
|
-
|
115
|
+
static VALUE libvirt_network_name(VALUE n)
|
116
|
+
{
|
117
|
+
ruby_libvirt_generate_call_string(virNetworkGetName,
|
118
|
+
ruby_libvirt_connect_get(n), 0,
|
119
|
+
network_get(n));
|
85
120
|
}
|
86
121
|
|
87
122
|
/*
|
88
123
|
* call-seq:
|
89
124
|
* net.uuid -> string
|
90
125
|
*
|
91
|
-
* Call
|
126
|
+
* Call virNetworkGetUUIDString[http://www.libvirt.org/html/libvirt-libvirt.html#virNetworkGetUUIDString]
|
92
127
|
* to retrieve the UUID of this network.
|
93
128
|
*/
|
94
|
-
static VALUE
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
r = virNetworkGetUUIDString(netw, uuid);
|
100
|
-
_E(r < 0, create_error(e_RetrieveError, "virNetworkGetUUIDString",
|
101
|
-
conn(s)));
|
102
|
-
|
103
|
-
return rb_str_new2((char *) uuid);
|
129
|
+
static VALUE libvirt_network_uuid(VALUE n)
|
130
|
+
{
|
131
|
+
ruby_libvirt_generate_uuid(virNetworkGetUUIDString,
|
132
|
+
ruby_libvirt_connect_get(n), network_get(n));
|
104
133
|
}
|
105
134
|
|
106
135
|
/*
|
107
136
|
* call-seq:
|
108
137
|
* net.xml_desc(flags=0) -> string
|
109
138
|
*
|
110
|
-
* Call
|
139
|
+
* Call virNetworkGetXMLDesc[http://www.libvirt.org/html/libvirt-libvirt.html#virNetworkGetXMLDesc]
|
111
140
|
* to retrieve the XML for this network.
|
112
141
|
*/
|
113
|
-
static VALUE
|
142
|
+
static VALUE libvirt_network_xml_desc(int argc, VALUE *argv, VALUE n)
|
143
|
+
{
|
114
144
|
VALUE flags;
|
115
145
|
|
116
146
|
rb_scan_args(argc, argv, "01", &flags);
|
117
147
|
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
NUM2UINT(flags));
|
148
|
+
ruby_libvirt_generate_call_string(virNetworkGetXMLDesc,
|
149
|
+
ruby_libvirt_connect_get(n), 1,
|
150
|
+
network_get(n),
|
151
|
+
ruby_libvirt_value_to_uint(flags));
|
123
152
|
}
|
124
153
|
|
125
154
|
/*
|
126
155
|
* call-seq:
|
127
156
|
* net.bridge_name -> string
|
128
157
|
*
|
129
|
-
* Call
|
158
|
+
* Call virNetworkGetBridgeName[http://www.libvirt.org/html/libvirt-libvirt.html#virNetworkGetBridgeName]
|
130
159
|
* to retrieve the bridge name for this network.
|
131
160
|
*/
|
132
|
-
static VALUE
|
133
|
-
|
161
|
+
static VALUE libvirt_network_bridge_name(VALUE n)
|
162
|
+
{
|
163
|
+
ruby_libvirt_generate_call_string(virNetworkGetBridgeName,
|
164
|
+
ruby_libvirt_connect_get(n),
|
165
|
+
1, network_get(n));
|
134
166
|
}
|
135
167
|
|
136
168
|
/*
|
137
169
|
* call-seq:
|
138
170
|
* net.autostart? -> [true|false]
|
139
171
|
*
|
140
|
-
* Call
|
172
|
+
* Call virNetworkGetAutostart[http://www.libvirt.org/html/libvirt-libvirt.html#virNetworkGetAutostart]
|
141
173
|
* to determine if this network will be autostarted when libvirtd starts.
|
142
174
|
*/
|
143
|
-
static VALUE
|
144
|
-
|
175
|
+
static VALUE libvirt_network_autostart(VALUE n)
|
176
|
+
{
|
145
177
|
int r, autostart;
|
146
178
|
|
147
|
-
r = virNetworkGetAutostart(
|
148
|
-
|
179
|
+
r = virNetworkGetAutostart(network_get(n), &autostart);
|
180
|
+
ruby_libvirt_raise_error_if(r < 0, e_RetrieveError, "virNetworkAutostart",
|
181
|
+
ruby_libvirt_connect_get(n));
|
149
182
|
|
150
183
|
return autostart ? Qtrue : Qfalse;
|
151
184
|
}
|
@@ -154,27 +187,31 @@ static VALUE libvirt_netw_autostart(VALUE s){
|
|
154
187
|
* call-seq:
|
155
188
|
* net.autostart = [true|false]
|
156
189
|
*
|
157
|
-
* Call
|
190
|
+
* Call virNetworkSetAutostart[http://www.libvirt.org/html/libvirt-libvirt.html#virNetworkSetAutostart]
|
158
191
|
* to set this network to be autostarted when libvirtd starts.
|
159
192
|
*/
|
160
|
-
static VALUE
|
161
|
-
|
193
|
+
static VALUE libvirt_network_autostart_equal(VALUE n, VALUE autostart)
|
194
|
+
{
|
195
|
+
if (autostart != Qtrue && autostart != Qfalse) {
|
162
196
|
rb_raise(rb_eTypeError,
|
163
197
|
"wrong argument type (expected TrueClass or FalseClass)");
|
198
|
+
}
|
164
199
|
|
165
|
-
|
166
|
-
|
200
|
+
ruby_libvirt_generate_call_nil(virNetworkSetAutostart,
|
201
|
+
ruby_libvirt_connect_get(n),
|
202
|
+
network_get(n), RTEST(autostart) ? 1 : 0);
|
167
203
|
}
|
168
204
|
|
169
205
|
/*
|
170
206
|
* call-seq:
|
171
207
|
* net.free -> nil
|
172
208
|
*
|
173
|
-
* Call
|
209
|
+
* Call virNetworkFree[http://www.libvirt.org/html/libvirt-libvirt.html#virNetworkFree]
|
174
210
|
* to free this network. The object will no longer be valid after this call.
|
175
211
|
*/
|
176
|
-
static VALUE
|
177
|
-
|
212
|
+
static VALUE libvirt_network_free(VALUE n)
|
213
|
+
{
|
214
|
+
ruby_libvirt_generate_call_free(Network, n);
|
178
215
|
}
|
179
216
|
|
180
217
|
#if HAVE_VIRNETWORKISACTIVE
|
@@ -182,11 +219,14 @@ static VALUE libvirt_netw_free(VALUE s) {
|
|
182
219
|
* call-seq:
|
183
220
|
* net.active? -> [true|false]
|
184
221
|
*
|
185
|
-
* Call
|
222
|
+
* Call virNetworkIsActive[http://www.libvirt.org/html/libvirt-libvirt.html#virNetworkIsActive]
|
186
223
|
* to determine if this network is currently active.
|
187
224
|
*/
|
188
|
-
static VALUE
|
189
|
-
|
225
|
+
static VALUE libvirt_network_active_p(VALUE n)
|
226
|
+
{
|
227
|
+
ruby_libvirt_generate_call_truefalse(virNetworkIsActive,
|
228
|
+
ruby_libvirt_connect_get(n),
|
229
|
+
network_get(n));
|
190
230
|
}
|
191
231
|
#endif
|
192
232
|
|
@@ -195,11 +235,14 @@ static VALUE libvirt_netw_active_p(VALUE s) {
|
|
195
235
|
* call-seq:
|
196
236
|
* net.persistent? -> [true|false]
|
197
237
|
*
|
198
|
-
* Call
|
238
|
+
* Call virNetworkIsPersistent[http://www.libvirt.org/html/libvirt-libvirt.html#virNetworkIsPersistent]
|
199
239
|
* to determine if this network is persistent.
|
200
240
|
*/
|
201
|
-
static VALUE
|
202
|
-
|
241
|
+
static VALUE libvirt_network_persistent_p(VALUE n)
|
242
|
+
{
|
243
|
+
ruby_libvirt_generate_call_truefalse(virNetworkIsPersistent,
|
244
|
+
ruby_libvirt_connect_get(n),
|
245
|
+
network_get(n));
|
203
246
|
}
|
204
247
|
#endif
|
205
248
|
|
@@ -208,28 +251,204 @@ static VALUE libvirt_netw_persistent_p(VALUE s) {
|
|
208
251
|
/*
|
209
252
|
* Class Libvirt::Network
|
210
253
|
*/
|
211
|
-
void
|
254
|
+
void ruby_libvirt_network_init(void)
|
212
255
|
{
|
213
256
|
#if HAVE_TYPE_VIRNETWORKPTR
|
214
257
|
c_network = rb_define_class_under(m_libvirt, "Network", rb_cObject);
|
215
258
|
rb_define_attr(c_network, "connection", 1, 0);
|
216
259
|
|
217
|
-
rb_define_method(c_network, "undefine",
|
218
|
-
rb_define_method(c_network, "create",
|
219
|
-
|
220
|
-
rb_define_method(c_network, "
|
221
|
-
|
222
|
-
rb_define_method(c_network, "
|
223
|
-
rb_define_method(c_network, "
|
224
|
-
rb_define_method(c_network, "
|
225
|
-
rb_define_method(c_network, "
|
226
|
-
rb_define_method(c_network, "
|
227
|
-
rb_define_method(c_network, "
|
260
|
+
rb_define_method(c_network, "undefine", libvirt_network_undefine, 0);
|
261
|
+
rb_define_method(c_network, "create", libvirt_network_create, 0);
|
262
|
+
#if HAVE_VIRNETWORKUPDATE
|
263
|
+
rb_define_method(c_network, "update", libvirt_network_update, 5);
|
264
|
+
#endif
|
265
|
+
rb_define_method(c_network, "destroy", libvirt_network_destroy, 0);
|
266
|
+
rb_define_method(c_network, "name", libvirt_network_name, 0);
|
267
|
+
rb_define_method(c_network, "uuid", libvirt_network_uuid, 0);
|
268
|
+
rb_define_method(c_network, "xml_desc", libvirt_network_xml_desc, -1);
|
269
|
+
rb_define_method(c_network, "bridge_name", libvirt_network_bridge_name, 0);
|
270
|
+
rb_define_method(c_network, "autostart", libvirt_network_autostart, 0);
|
271
|
+
rb_define_method(c_network, "autostart?", libvirt_network_autostart, 0);
|
272
|
+
rb_define_method(c_network, "autostart=", libvirt_network_autostart_equal,
|
273
|
+
1);
|
274
|
+
rb_define_method(c_network, "free", libvirt_network_free, 0);
|
228
275
|
#if HAVE_VIRNETWORKISACTIVE
|
229
|
-
rb_define_method(c_network, "active?",
|
276
|
+
rb_define_method(c_network, "active?", libvirt_network_active_p, 0);
|
230
277
|
#endif
|
231
278
|
#if HAVE_VIRNETWORKISPERSISTENT
|
232
|
-
rb_define_method(c_network, "persistent?",
|
279
|
+
rb_define_method(c_network, "persistent?", libvirt_network_persistent_p, 0);
|
280
|
+
#endif
|
281
|
+
#if HAVE_CONST_VIR_NETWORK_UPDATE_COMMAND_NONE
|
282
|
+
/* Ideally we would just have the "UPDATE_COMMAND_NONE" constant.
|
283
|
+
* Unfortunately we screwed up long ago, and we have to
|
284
|
+
* leave "NETWORK_UPDATE_COMMAND_NONE" for backwards compatibility.
|
285
|
+
*/
|
286
|
+
rb_define_const(c_network, "UPDATE_COMMAND_NONE",
|
287
|
+
INT2NUM(VIR_NETWORK_UPDATE_COMMAND_NONE));
|
288
|
+
rb_define_const(c_network, "NETWORK_UPDATE_COMMAND_NONE",
|
289
|
+
INT2NUM(VIR_NETWORK_UPDATE_COMMAND_NONE));
|
290
|
+
/* Ideally we would just have the "UPDATE_COMMAND_MODIFY" constant.
|
291
|
+
* Unfortunately we screwed up long ago, and we have to
|
292
|
+
* leave "NETWORK_UPDATE_COMMAND_MODIFY" for backwards compatibility.
|
293
|
+
*/
|
294
|
+
rb_define_const(c_network, "UPDATE_COMMAND_MODIFY",
|
295
|
+
INT2NUM(VIR_NETWORK_UPDATE_COMMAND_MODIFY));
|
296
|
+
rb_define_const(c_network, "NETWORK_UPDATE_COMMAND_MODIFY",
|
297
|
+
INT2NUM(VIR_NETWORK_UPDATE_COMMAND_MODIFY));
|
298
|
+
/* Ideally we would just have the "UPDATE_COMMAND_ADD_LAST" constant.
|
299
|
+
* Unfortunately we screwed up long ago, and we have to
|
300
|
+
* leave "NETWORK_UPDATE_COMMAND_ADD_LAST" for backwards compatibility.
|
301
|
+
*/
|
302
|
+
rb_define_const(c_network, "UPDATE_COMMAND_ADD_LAST",
|
303
|
+
INT2NUM(VIR_NETWORK_UPDATE_COMMAND_ADD_LAST));
|
304
|
+
rb_define_const(c_network, "NETWORK_UPDATE_COMMAND_ADD_LAST",
|
305
|
+
INT2NUM(VIR_NETWORK_UPDATE_COMMAND_ADD_LAST));
|
306
|
+
/* Ideally we would just have the "UPDATE_COMMAND_ADD_FIRST" constant.
|
307
|
+
* Unfortunately we screwed up long ago, and we have to
|
308
|
+
* leave "NETWORK_UPDATE_COMMAND_ADD_FIRST" for backwards compatibility.
|
309
|
+
*/
|
310
|
+
rb_define_const(c_network, "UPDATE_COMMAND_ADD_FIRST",
|
311
|
+
INT2NUM(VIR_NETWORK_UPDATE_COMMAND_ADD_FIRST));
|
312
|
+
rb_define_const(c_network, "NETWORK_UPDATE_COMMAND_ADD_FIRST",
|
313
|
+
INT2NUM(VIR_NETWORK_UPDATE_COMMAND_ADD_FIRST));
|
314
|
+
/* Ideally we would just have the "SECTION_NONE" constant.
|
315
|
+
* Unfortunately we screwed up long ago, and we have to
|
316
|
+
* leave "NETWORK_SECTION_NONE" for backwards compatibility.
|
317
|
+
*/
|
318
|
+
rb_define_const(c_network, "SECTION_NONE",
|
319
|
+
INT2NUM(VIR_NETWORK_SECTION_NONE));
|
320
|
+
rb_define_const(c_network, "NETWORK_SECTION_NONE",
|
321
|
+
INT2NUM(VIR_NETWORK_SECTION_NONE));
|
322
|
+
/* Ideally we would just have the "SECTION_BRIDGE" constant.
|
323
|
+
* Unfortunately we screwed up long ago, and we have to
|
324
|
+
* leave "NETWORK_SECTION_BRIDGE" for backwards compatibility.
|
325
|
+
*/
|
326
|
+
rb_define_const(c_network, "SECTION_BRIDGE",
|
327
|
+
INT2NUM(VIR_NETWORK_SECTION_BRIDGE));
|
328
|
+
rb_define_const(c_network, "NETWORK_SECTION_BRIDGE",
|
329
|
+
INT2NUM(VIR_NETWORK_SECTION_BRIDGE));
|
330
|
+
/* Ideally we would just have the "SECTION_DOMAIN" constant.
|
331
|
+
* Unfortunately we screwed up long ago, and we have to
|
332
|
+
* leave "NETWORK_SECTION_DOMAIN" for backwards compatibility.
|
333
|
+
*/
|
334
|
+
rb_define_const(c_network, "SECTION_DOMAIN",
|
335
|
+
INT2NUM(VIR_NETWORK_SECTION_DOMAIN));
|
336
|
+
rb_define_const(c_network, "NETWORK_SECTION_DOMAIN",
|
337
|
+
INT2NUM(VIR_NETWORK_SECTION_DOMAIN));
|
338
|
+
/* Ideally we would just have the "SECTION_IP" constant.
|
339
|
+
* Unfortunately we screwed up long ago, and we have to
|
340
|
+
* leave "NETWORK_SECTION_IP" for backwards compatibility.
|
341
|
+
*/
|
342
|
+
rb_define_const(c_network, "SECTION_IP",
|
343
|
+
INT2NUM(VIR_NETWORK_SECTION_IP));
|
344
|
+
rb_define_const(c_network, "NETWORK_SECTION_IP",
|
345
|
+
INT2NUM(VIR_NETWORK_SECTION_IP));
|
346
|
+
/* Ideally we would just have the "SECTION_IP_DHCP_HOST" constant.
|
347
|
+
* Unfortunately we screwed up long ago, and we have to
|
348
|
+
* leave "NETWORK_SECTION_IP_DHCP_HOST" for backwards compatibility.
|
349
|
+
*/
|
350
|
+
rb_define_const(c_network, "SECTION_IP_DHCP_HOST",
|
351
|
+
INT2NUM(VIR_NETWORK_SECTION_IP_DHCP_HOST));
|
352
|
+
rb_define_const(c_network, "NETWORK_SECTION_IP_DHCP_HOST",
|
353
|
+
INT2NUM(VIR_NETWORK_SECTION_IP_DHCP_HOST));
|
354
|
+
/* Ideally we would just have the "SECTION_IP_DHCP_RANGE" constant.
|
355
|
+
* Unfortunately we screwed up long ago, and we have to
|
356
|
+
* leave "NETWORK_SECTION_IP_DHCP_RANGE" for backwards compatibility.
|
357
|
+
*/
|
358
|
+
rb_define_const(c_network, "SECTION_IP_DHCP_RANGE",
|
359
|
+
INT2NUM(VIR_NETWORK_SECTION_IP_DHCP_RANGE));
|
360
|
+
rb_define_const(c_network, "NETWORK_SECTION_IP_DHCP_RANGE",
|
361
|
+
INT2NUM(VIR_NETWORK_SECTION_IP_DHCP_RANGE));
|
362
|
+
/* Ideally we would just have the "SECTION_FORWARD" constant.
|
363
|
+
* Unfortunately we screwed up long ago, and we have to
|
364
|
+
* leave "NETWORK_SECTION_FORWARD" for backwards compatibility.
|
365
|
+
*/
|
366
|
+
rb_define_const(c_network, "SECTION_FORWARD",
|
367
|
+
INT2NUM(VIR_NETWORK_SECTION_FORWARD));
|
368
|
+
rb_define_const(c_network, "NETWORK_SECTION_FORWARD",
|
369
|
+
INT2NUM(VIR_NETWORK_SECTION_FORWARD));
|
370
|
+
/* Ideally we would just have the "SECTION_FORWARD_INTERFACE" constant.
|
371
|
+
* Unfortunately we screwed up long ago, and we have to
|
372
|
+
* leave "NETWORK_SECTION_FORWARD_INTERFACE" for backwards compatibility.
|
373
|
+
*/
|
374
|
+
rb_define_const(c_network, "SECTION_FORWARD_INTERFACE",
|
375
|
+
INT2NUM(VIR_NETWORK_SECTION_FORWARD_INTERFACE));
|
376
|
+
rb_define_const(c_network, "NETWORK_SECTION_FORWARD_INTERFACE",
|
377
|
+
INT2NUM(VIR_NETWORK_SECTION_FORWARD_INTERFACE));
|
378
|
+
/* Ideally we would just have the "SECTION_FORWARD_PF" constant.
|
379
|
+
* Unfortunately we screwed up long ago, and we have to
|
380
|
+
* leave "NETWORK_SECTION_FORWARD_PF" for backwards compatibility.
|
381
|
+
*/
|
382
|
+
rb_define_const(c_network, "SECTION_FORWARD_PF",
|
383
|
+
INT2NUM(VIR_NETWORK_SECTION_FORWARD_PF));
|
384
|
+
rb_define_const(c_network, "NETWORK_SECTION_FORWARD_PF",
|
385
|
+
INT2NUM(VIR_NETWORK_SECTION_FORWARD_PF));
|
386
|
+
/* Ideally we would just have the "SECTION_PORTGROUP" constant.
|
387
|
+
* Unfortunately we screwed up long ago, and we have to
|
388
|
+
* leave "NETWORK_SECTION_PORTGROUP" for backwards compatibility.
|
389
|
+
*/
|
390
|
+
rb_define_const(c_network, "SECTION_PORTGROUP",
|
391
|
+
INT2NUM(VIR_NETWORK_SECTION_PORTGROUP));
|
392
|
+
rb_define_const(c_network, "NETWORK_SECTION_PORTGROUP",
|
393
|
+
INT2NUM(VIR_NETWORK_SECTION_PORTGROUP));
|
394
|
+
/* Ideally we would just have the "SECTION_DNS_HOST" constant.
|
395
|
+
* Unfortunately we screwed up long ago, and we have to
|
396
|
+
* leave "NETWORK_SECTION_DNS_HOST" for backwards compatibility.
|
397
|
+
*/
|
398
|
+
rb_define_const(c_network, "SECTION_DNS_HOST",
|
399
|
+
INT2NUM(VIR_NETWORK_SECTION_DNS_HOST));
|
400
|
+
rb_define_const(c_network, "NETWORK_SECTION_DNS_HOST",
|
401
|
+
INT2NUM(VIR_NETWORK_SECTION_DNS_HOST));
|
402
|
+
/* Ideally we would just have the "SECTION_DNS_TXT" constant.
|
403
|
+
* Unfortunately we screwed up long ago, and we have to
|
404
|
+
* leave "NETWORK_SECTION_DNS_TXT" for backwards compatibility.
|
405
|
+
*/
|
406
|
+
rb_define_const(c_network, "SECTION_DNS_TXT",
|
407
|
+
INT2NUM(VIR_NETWORK_SECTION_DNS_TXT));
|
408
|
+
rb_define_const(c_network, "NETWORK_SECTION_DNS_TXT",
|
409
|
+
INT2NUM(VIR_NETWORK_SECTION_DNS_TXT));
|
410
|
+
/* Ideally we would just have the "SECTION_DNS_SRV" constant.
|
411
|
+
* Unfortunately we screwed up long ago, and we have to
|
412
|
+
* leave "NETWORK_SECTION_DNS_SRV" for backwards compatibility.
|
413
|
+
*/
|
414
|
+
rb_define_const(c_network, "SECTION_DNS_SRV",
|
415
|
+
INT2NUM(VIR_NETWORK_SECTION_DNS_SRV));
|
416
|
+
rb_define_const(c_network, "NETWORK_SECTION_DNS_SRV",
|
417
|
+
INT2NUM(VIR_NETWORK_SECTION_DNS_SRV));
|
418
|
+
/* Ideally we would just have the "UPDATE_AFFECT_CURRENT" constant.
|
419
|
+
* Unfortunately we screwed up long ago, and we have to
|
420
|
+
* leave "NETWORK_UPDATE_AFFECT_CURRENT" for backwards compatibility.
|
421
|
+
*/
|
422
|
+
rb_define_const(c_network, "UPDATE_AFFECT_CURRENT",
|
423
|
+
INT2NUM(VIR_NETWORK_UPDATE_AFFECT_CURRENT));
|
424
|
+
rb_define_const(c_network, "NETWORK_UPDATE_AFFECT_CURRENT",
|
425
|
+
INT2NUM(VIR_NETWORK_UPDATE_AFFECT_CURRENT));
|
426
|
+
/* Ideally we would just have the "UPDATE_AFFECT_LIVE" constant.
|
427
|
+
* Unfortunately we screwed up long ago, and we have to
|
428
|
+
* leave "NETWORK_UPDATE_AFFECT_LIVE" for backwards compatibility.
|
429
|
+
*/
|
430
|
+
rb_define_const(c_network, "UPDATE_AFFECT_LIVE",
|
431
|
+
INT2NUM(VIR_NETWORK_UPDATE_AFFECT_LIVE));
|
432
|
+
rb_define_const(c_network, "NETWORK_UPDATE_AFFECT_LIVE",
|
433
|
+
INT2NUM(VIR_NETWORK_UPDATE_AFFECT_LIVE));
|
434
|
+
/* Ideally we would just have the "UPDATE_AFFECT_CONFIG" constant.
|
435
|
+
* Unfortunately we screwed up long ago, and we have to
|
436
|
+
* leave "NETWORK_UPDATE_AFFECT_CONFIG" for backwards compatibility.
|
437
|
+
*/
|
438
|
+
rb_define_const(c_network, "UPDATE_AFFECT_CONFIG",
|
439
|
+
INT2NUM(VIR_NETWORK_UPDATE_AFFECT_CONFIG));
|
440
|
+
rb_define_const(c_network, "NETWORK_UPDATE_AFFECT_CONFIG",
|
441
|
+
INT2NUM(VIR_NETWORK_UPDATE_AFFECT_CONFIG));
|
233
442
|
#endif
|
443
|
+
|
444
|
+
#if HAVE_CONST_VIR_NETWORK_XML_INACTIVE
|
445
|
+
rb_define_const(c_network, "XML_INACTIVE",
|
446
|
+
INT2NUM(VIR_NETWORK_XML_INACTIVE));
|
447
|
+
#endif
|
448
|
+
#if HAVE_CONST_VIR_NETWORK_UPDATE_COMMAND_DELETE
|
449
|
+
rb_define_const(c_network, "UPDATE_COMMAND_DELETE",
|
450
|
+
INT2NUM(VIR_NETWORK_UPDATE_COMMAND_DELETE));
|
451
|
+
#endif
|
452
|
+
|
234
453
|
#endif
|
235
454
|
}
|