NM.SettingVlan

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

Subclasses:

None

Methods

Inherited:

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

Structs:

GObject.ObjectClass (5)

class

new ()

add_priority (map, from_, to)

add_priority_str (map, str)

clear_priorities (map)

get_flags ()

get_id ()

get_num_priorities (map)

get_parent ()

get_priority (map, idx)

get_protocol ()

remove_priority (map, idx)

remove_priority_by_value (map, from_, to)

remove_priority_str_by_value (map, str)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Inherited:

NM.Setting (1)

Name

Type

Flags

Short Description

egress-priority-map

[str]

r/w

flags

NM.VlanFlags

r/w

id

int

r/w/en

ingress-priority-map

[str]

r/w

parent

str

r/w/en

protocol

str

r/w/en

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Class Details

class NM.SettingVlan(**kwargs)
Bases:

NM.Setting

Abstract:

No

Structure:

NM.SettingVlanClass

VLAN Settings

classmethod new()
Returns:

the new empty NM.SettingVlan object

Return type:

NM.Setting

Creates a new NM.SettingVlan object with default values.

add_priority(map, from_, to)
Parameters:
  • map (NM.VlanPriorityMap) – the type of priority map

  • from (int) – the priority to map to to

  • to (int) – the priority to map from to

Returns:

True.

Return type:

bool

Adds a priority mapping to the #NMSettingVlan:ingress_priority_map or #NMSettingVlan:egress_priority_map properties of the setting. If from is already in the given priority map, this function will overwrite the existing entry with the new to.

If map is NM.VlanPriorityMap.INGRESS_MAP then from is the incoming 802.1q VLAN Priority Code Point (PCP) value, and to is the Linux SKB priority value.

If map is NM.VlanPriorityMap.EGRESS_MAP then from is the Linux SKB priority value and to is the outgoing 802.1q VLAN Priority Code Point (PCP) value.

add_priority_str(map, str)
Parameters:
  • map (NM.VlanPriorityMap) – the type of priority map

  • str (str) – the string which contains a priority map, like “3:7”

Returns:

True if the entry was successfully added to the list, or it overwrote the old value, False if str is not a valid mapping.

Return type:

bool

Adds a priority map entry into either the #NMSettingVlan:ingress_priority_map or the #NMSettingVlan:egress_priority_map properties. The priority map maps the Linux SKB priorities to 802.1p priorities.

clear_priorities(map)
Parameters:

map (NM.VlanPriorityMap) – the type of priority map

Clear all the entries from #NMSettingVlan:ingress_priority_map or #NMSettingVlan:egress_priority_map properties.

get_flags()
Returns:

the NM.SettingVlan :flags property of the setting

Return type:

int

get_id()
Returns:

the NM.SettingVlan :id property of the setting

Return type:

int

get_num_priorities(map)
Parameters:

map (NM.VlanPriorityMap) – the type of priority map

Returns:

return the number of ingress/egress priority entries.

Return type:

int

Returns the number of entries in the #NMSettingVlan:ingress_priority_map or #NMSettingVlan:egress_priority_map properties of this setting.

get_parent()
Returns:

the NM.SettingVlan :parent property of the setting

Return type:

str

get_priority(map, idx)
Parameters:
  • map (NM.VlanPriorityMap) – the type of priority map

  • idx (int) – the zero-based index of the ingress/egress priority map entry

Returns:

returns True if idx is in range. Otherwise, False.

out_from:

on return the value of the priority map’s ‘from’ item

out_to:

on return the value of priority map’s ‘to’ item

Return type:

(bool, out_from: int, out_to: int)

Retrieve one of the entries of the #NMSettingVlan:ingress_priority_map or #NMSettingVlan:egress_priority_map properties of this setting.

get_protocol()
Returns:

the NM.SettingVlan :protocol property of the setting

Return type:

str

New in version 1.42.

remove_priority(map, idx)
Parameters:
  • map (NM.VlanPriorityMap) – the type of priority map

  • idx (int) – the zero-based index of the priority map to remove

Removes the priority map at index idx from the #NMSettingVlan:ingress_priority_map or #NMSettingVlan:egress_priority_map properties.

remove_priority_by_value(map, from_, to)
Parameters:
  • map (NM.VlanPriorityMap) – the type of priority map

  • from (int) – the priority to map to to

  • to (int) – the priority to map from to

Returns:

True if the priority mapping was found and removed; False if it was not.

Return type:

bool

Removes the priority map form:to from the #NMSettingVlan:ingress_priority_map or #NMSettingVlan:egress_priority_map (according to map argument) properties.

remove_priority_str_by_value(map, str)
Parameters:
  • map (NM.VlanPriorityMap) – the type of priority map

  • str (str) – the string which contains a priority map, like “3:7”

Returns:

True if the priority mapping was found and removed; False if it was not.

Return type:

bool

Removes the priority map str from the #NMSettingVlan:ingress_priority_map or #NMSettingVlan:egress_priority_map (according to map argument) properties.

Property Details

NM.SettingVlan.props.egress_priority_map
Name:

egress-priority-map

Type:

[str]

Default Value:

[]

Flags:

READABLE, WRITABLE

For outgoing packets, a list of mappings from Linux SKB priorities to 802.1p priorities. The mapping is given in the format “from:to” where both “from” and “to” are unsigned integers, ie “7:3”.

NM.SettingVlan.props.flags
Name:

flags

Type:

NM.VlanFlags

Default Value:

NM.VlanFlags.REORDER_HEADERS

Flags:

READABLE, WRITABLE

One or more flags which control the behavior and features of the VLAN interface. Flags include NM.VlanFlags.REORDER_HEADERS (reordering of output packet headers), NM.VlanFlags.GVRP (use of the GVRP protocol), and NM.VlanFlags.LOOSE_BINDING (loose binding of the interface to its master device’s operating state). NM.VlanFlags.MVRP (use of the MVRP protocol).

The default value of this property is NM.VlanFlags.REORDER_HEADERS, but it used to be 0. To preserve backward compatibility, the default-value in the D-Bus API continues to be 0 and a missing property on D-Bus is still considered as 0.

NM.SettingVlan.props.id
Name:

id

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The VLAN identifier that the interface created by this connection should be assigned. The valid range is from 0 to 4094, without the reserved id 4095.

NM.SettingVlan.props.ingress_priority_map
Name:

ingress-priority-map

Type:

[str]

Default Value:

[]

Flags:

READABLE, WRITABLE

For incoming packets, a list of mappings from 802.1p priorities to Linux SKB priorities. The mapping is given in the format “from:to” where both “from” and “to” are unsigned integers, ie “7:3”.

NM.SettingVlan.props.parent
Name:

parent

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

If given, specifies the parent interface name or parent connection UUID from which this VLAN interface should be created. If this property is not specified, the connection must contain an NM.SettingWired setting with a NM.SettingWired :mac-address property.

NM.SettingVlan.props.protocol
Name:

protocol

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Specifies the VLAN protocol to use for encapsulation.

Supported values are: ‘802.1Q’, ‘802.1ad’. If not specified the default value is ‘802.1Q’.

New in version 1.42.