NM.BridgeVlan¶
Fields¶
None
Methods¶
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- class NM.BridgeVlan¶
- classmethod from_str(str)¶
- Parameters:
str (
str
) – the string representation of a bridge VLAN- Raises:
- Returns:
the
NM.BridgeVlan
orNone
- Return type:
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:
- Returns:
the new
NM.BridgeVlan
object.- Return type:
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
) – anotherNM.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:
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:
Gets the VLAN id range.
New in version 1.18.
- is_pvid()¶
-
Returns whether the VLAN is the PVID for the port.
New in version 1.18.
- is_untagged()¶
-
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:
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:
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 withNM.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:
- Returns:
formatted string or
None
- Return type:
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.