NM.SettingBridgePort

g GObject.Object GObject.Object NM.Setting NM.Setting GObject.Object->NM.Setting NM.SettingBridgePort NM.SettingBridgePort NM.Setting->NM.SettingBridgePort

Subclasses:

None

Methods

Inherited:

NM.Setting (21), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new ()

add_vlan (vlan)

clear_vlans ()

get_hairpin_mode ()

get_num_vlans ()

get_path_cost ()

get_priority ()

get_vlan (idx)

remove_vlan (idx)

remove_vlan_by_vid (vid_start, vid_end)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Inherited:

NM.Setting (1)

Name

Type

Flags

Short Description

hairpin-mode

bool

r/w/en

path-cost

int

r/w/en

priority

int

r/w/en

vlans

GLib.PtrArray

r/w

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Class Details

class NM.SettingBridgePort(**kwargs)
Bases:

NM.Setting

Abstract:

No

Structure:

NM.SettingBridgePortClass

Bridge Port Settings

classmethod new()
Returns:

the new empty NM.SettingBridgePort object

Return type:

NM.Setting

Creates a new NM.SettingBridgePort object with default values.

add_vlan(vlan)
Parameters:

vlan (NM.BridgeVlan) – the vlan to add

Appends a new vlan and associated information to the setting. The given vlan gets sealed and a reference to it is added.

New in version 1.18.

clear_vlans()

Removes all configured VLANs.

New in version 1.18.

get_hairpin_mode()
Returns:

the NM.SettingBridgePort :hairpin-mode property of the setting

Return type:

bool

get_num_vlans()
Returns:

the number of VLANs

Return type:

int

New in version 1.18.

get_path_cost()
Returns:

the NM.SettingBridgePort :path-cost property of the setting

Return type:

int

get_priority()
Returns:

the NM.SettingBridgePort :priority property of the setting

Return type:

int

get_vlan(idx)
Parameters:

idx (int) – index number of the VLAN to return

Returns:

the VLAN at index idx

Return type:

NM.BridgeVlan

New in version 1.18.

remove_vlan(idx)
Parameters:

idx (int) – index number of the VLAN.

Removes the vlan at index idx.

New in version 1.18.

remove_vlan_by_vid(vid_start, vid_end)
Parameters:
  • vid_start (int) – the vlan start index

  • vid_end (int) – the vlan end index

Returns:

True if the vlan was found and removed; False otherwise

Return type:

bool

Remove the VLAN with range vid_start to vid_end. If vid_end is zero, it is assumed to be equal to vid_start and so the single-id VLAN with id vid_start is removed.

New in version 1.18.

Property Details

NM.SettingBridgePort.props.hairpin_mode
Name:

hairpin-mode

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Enables or disables “hairpin mode” for the port, which allows frames to be sent back out through the port the frame was received on.

NM.SettingBridgePort.props.path_cost
Name:

path-cost

Type:

int

Default Value:

100

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The Spanning Tree Protocol (STP) port cost for destinations via this port.

NM.SettingBridgePort.props.priority
Name:

priority

Type:

int

Default Value:

32

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The Spanning Tree Protocol (STP) priority of this bridge port.

NM.SettingBridgePort.props.vlans
Name:

vlans

Type:

GLib.PtrArray

Default Value:

None

Flags:

READABLE, WRITABLE

Array of bridge VLAN objects. In addition to the VLANs specified here, the port will also have the default-pvid VLAN configured on the bridge by the bridge.vlan-default-pvid property.

In nmcli the VLAN list can be specified with the following syntax:

$vid ‘pvid [untagged]’ [, $vid ‘pvid [untagged]’]…

where $vid is either a single id between 1 and 4094 or a range, represented as a couple of ids separated by a dash.

New in version 1.18.