NM.BridgeVlan

Fields

None

Methods

class

from_str (str)

class

new (vid_start, vid_end)

cmp (b)

get_vid_range ()

is_pvid ()

is_sealed ()

is_untagged ()

new_clone ()

ref ()

seal ()

set_pvid (value)

set_untagged (value)

to_str ()

unref ()

Details

class NM.BridgeVlan
classmethod from_str(str)
Parameters:

str (str) – the string representation of a bridge VLAN

Raises:

GLib.Error

Returns:

the NM.BridgeVlan or None

Return type:

NM.BridgeVlan

Parses the string representation of the queueing discipline to a NM.BridgeVlan instance.

New in version 1.18.

classmethod new(vid_start, vid_end)
Parameters:
  • vid_start (int) – the start VLAN id, must be between 1 and 4094.

  • vid_end (int) – the end VLAN id, must be 0 or between vid_start and 4094.

Returns:

the new NM.BridgeVlan object.

Return type:

NM.BridgeVlan

Creates a new NM.BridgeVlan object for the given VLAN id range. Setting vid_end to 0 is equivalent to setting it to vid_start and creates a single-id VLAN.

Since 1.42, ref-counting of NM.BridgeVlan is thread-safe.

New in version 1.18.

cmp(b)
Parameters:

b (NM.BridgeVlan) – another NM.BridgeVlan

Returns:

zero of the two instances are equivalent or a non-zero integer otherwise. This defines a total ordering over the VLANs. Whether a VLAN is sealed or not does not affect the comparison.

Return type:

int

Compare two bridge VLAN objects.

New in version 1.18.

get_vid_range()
Returns:

True is the VLAN specifies a range, False if it is a single-id VLAN.

vid_start:

location to store the VLAN id range start.

vid_end:

location to store the VLAN id range end

Return type:

(bool, vid_start: int, vid_end: int)

Gets the VLAN id range.

New in version 1.18.

is_pvid()
Returns:

True if the VLAN is the PVID

Return type:

bool

Returns whether the VLAN is the PVID for the port.

New in version 1.18.

is_sealed()
Returns:

whether self is sealed or not.

Return type:

bool

New in version 1.18.

is_untagged()
Returns:

True if the VLAN is untagged, False otherwise

Return type:

bool

Returns whether the VLAN is untagged.

New in version 1.18.

new_clone()
Returns:

a clone of self. This instance is always unsealed.

Return type:

NM.BridgeVlan

New in version 1.18.

ref()
Returns:

the input argument self object.

Since 1.42, ref-counting of NM.BridgeVlan is thread-safe.

Return type:

NM.BridgeVlan

Increases the reference count of the object.

New in version 1.18.

seal()

Seal the NM.BridgeVlan instance. Afterwards, it is a bug to call all functions that modify the instance (except ref/unref). A sealed instance cannot be unsealed again, but you can create an unsealed copy with NM.BridgeVlan.new_clone().

New in version 1.18.

set_pvid(value)
Parameters:

value (bool) – the new value

Change the value of the PVID property of the VLAN. It is invalid to set the value to True for non-single-id VLANs.

New in version 1.18.

set_untagged(value)
Parameters:

value (bool) – the new value

Change the value of the untagged property of the VLAN.

New in version 1.18.

to_str()
Raises:

GLib.Error

Returns:

formatted string or None

Return type:

str

Convert a NM.BridgeVlan to a string.

New in version 1.18.

unref()

Decreases the reference count of the object. If the reference count reaches zero the object will be destroyed.

Since 1.42, ref-counting of NM.BridgeVlan is thread-safe.

New in version 1.18.