Class: Libvirt::NWFilter

Inherits:
Object
  • Object
show all
Defined in:
ext/libvirt/nwfilter.c

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#connection ⇒ Object (readonly)

Class Method Details

.new(*args) ⇒ Object

For classes where Ruby objects are just wrappers around C pointers, the only acceptable way to create new instances is to use Connect.create_domain_xml and similar. The use of Domain.new and friends is explicitly disallowed by providing this functions as implementation when defining the class



501
502
503
504
# File 'ext/libvirt/common.c', line 501

VALUE ruby_libvirt_new_not_allowed(int argc, VALUE *argv, VALUE obj)
{
    rb_raise(rb_eTypeError, "Not allowed for this class");
}

Instance Method Details

#free ⇒ nil

Call virNWFilterFree to free this network filter. After this call the network filter object is no longer valid.

Returns:

  • (nil)


114
115
116
117
# File 'ext/libvirt/nwfilter.c', line 114

static VALUE libvirt_nwfilter_free(VALUE n)
{
    ruby_libvirt_generate_call_free(NWFilter, n);
}

#name ⇒ String

Call virNWFilterGetName to retrieve the network filter name.

Returns:

  • (String)


67
68
69
70
71
72
# File 'ext/libvirt/nwfilter.c', line 67

static VALUE libvirt_nwfilter_name(VALUE n)
{
    ruby_libvirt_generate_call_string(virNWFilterGetName,
                                      ruby_libvirt_connect_get(n), 0,
                                      nwfilter_get(n));
}

#undefine ⇒ nil

Call virNWFilterUndefine to undefine the network filter.

Returns:

  • (nil)


53
54
55
56
57
58
# File 'ext/libvirt/nwfilter.c', line 53

static VALUE libvirt_nwfilter_undefine(VALUE n)
{
    ruby_libvirt_generate_call_nil(virNWFilterUndefine,
                                   ruby_libvirt_connect_get(n),
                                   nwfilter_get(n));
}

#uuid ⇒ String

Call virNWFilterGetUUIDString to retrieve the network filter UUID.

Returns:

  • (String)


81
82
83
84
85
# File 'ext/libvirt/nwfilter.c', line 81

static VALUE libvirt_nwfilter_uuid(VALUE n)
{
    ruby_libvirt_generate_uuid(virNWFilterGetUUIDString,
                               ruby_libvirt_connect_get(n), nwfilter_get(n));
}

#xml_desc(flags = 0) ⇒ String

Call virNWFilterGetXMLDesc to retrieve the XML for this network filter.

Returns:

  • (String)


94
95
96
97
98
99
100
101
102
103
104
# File 'ext/libvirt/nwfilter.c', line 94

static VALUE libvirt_nwfilter_xml_desc(int argc, VALUE *argv, VALUE n)
{
    VALUE flags = RUBY_Qnil;

    rb_scan_args(argc, argv, "01", &flags);

    ruby_libvirt_generate_call_string(virNWFilterGetXMLDesc,
                                      ruby_libvirt_connect_get(n), 1,
                                      nwfilter_get(n),
                                      ruby_libvirt_value_to_uint(flags));
}