NMSettingBridgePort: libnm Reference Manual

## NMSettingBridgePort NMSettingBridgePort — Describes connection properties for bridge ports |

## Functions

NMSetting * | nm_setting_bridge_port_new ()
guint16 | nm_setting_bridge_port_get_priority ()
guint16 | nm_setting_bridge_port_get_path_cost ()
gboolean | nm_setting_bridge_port_get_hairpin_mode ()
void | nm_setting_bridge_port_add_vlan ()
guint | nm_setting_bridge_port_get_num_vlans ()
NMBridgeVlan * | nm_setting_bridge_port_get_vlan ()
void | nm_setting_bridge_port_remove_vlan ()
gboolean | nm_setting_bridge_port_remove_vlan_by_vid ()
void | nm_setting_bridge_port_clear_vlans ()

## Properties

gboolean | hairpin-mode | Read / Write
guint | path-cost | Read / Write
guint | priority | Read / Write
GPtrArray * | vlans | Read / Write

## Types and Values

#define | NM_SETTING_BRIDGE_PORT_SETTING_NAME
#define | NM_SETTING_BRIDGE_PORT_PRIORITY
#define | NM_SETTING_BRIDGE_PORT_PATH_COST
#define | NM_SETTING_BRIDGE_PORT_HAIRPIN_MODE
#define | NM_SETTING_BRIDGE_PORT_VLANS
| NMSettingBridgePort

## Object Hierarchy

        GObject
        ╰── NMSetting
            ╰── NMSettingBridgePort

## Description

The NMSettingBridgePort object is a NMSetting subclass that describes optional properties that apply to bridge ports.

## Functions

### nm_setting_bridge_port_new ()

    NMSetting *
    nm_setting_bridge_port_new (void);

Creates a new NMSettingBridgePort object with default values.

#### Returns

the new empty NMSettingBridgePort object.

[transfer full]

### nm_setting_bridge_port_get_priority ()

    guint16
    nm_setting_bridge_port_get_priority (NMSettingBridgePort *setting);

#### Parameters

setting | the NMSettingBridgePort |

#### Returns

the “priority” property of the setting

### nm_setting_bridge_port_get_path_cost ()

    guint16
    nm_setting_bridge_port_get_path_cost (NMSettingBridgePort *setting);

#### Parameters

setting | the NMSettingBridgePort |

#### Returns

the “path-cost” property of the setting

### nm_setting_bridge_port_get_hairpin_mode ()

    gboolean
    nm_setting_bridge_port_get_hairpin_mode
                                   (NMSettingBridgePort *setting);

#### Parameters

setting | the NMSettingBridgePort |

#### Returns

the “hairpin-mode” property of the setting

### nm_setting_bridge_port_add_vlan ()

    void
    nm_setting_bridge_port_add_vlan (NMSettingBridgePort *setting,
                                     NMBridgeVlan *vlan);

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

#### Parameters

setting | the NMSettingBridgePort |
vlan | the vlan to add |

Since: 1.18

### nm_setting_bridge_port_get_num_vlans ()

    guint
    nm_setting_bridge_port_get_num_vlans (NMSettingBridgePort *setting);

#### Parameters

setting | the NMSettingBridgePort |

#### Returns

the number of VLANs

Since: 1.18

### nm_setting_bridge_port_get_vlan ()

    NMBridgeVlan *
    nm_setting_bridge_port_get_vlan (NMSettingBridgePort *setting,
                                     guint idx);

#### Parameters

setting | the NMSettingBridgePort |
idx | index number of the VLAN to return |

#### Returns

the VLAN at index `idx` .

[transfer none]

Since: 1.18

### nm_setting_bridge_port_remove_vlan ()

    void
    nm_setting_bridge_port_remove_vlan (NMSettingBridgePort *setting,
                                        guint idx);

Removes the vlan at index `idx` .

#### Parameters

setting | the NMSettingBridgePort |
idx | index number of the VLAN. |

Since: 1.18

### nm_setting_bridge_port_remove_vlan_by_vid ()

    gboolean
    nm_setting_bridge_port_remove_vlan_by_vid
                                   (NMSettingBridgePort *setting,
                                    guint16 vid_start,
                                    guint16 vid_end);

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.

#### Parameters

setting | the NMSettingBridgePort |
vid_start | the vlan start index |
vid_end | the vlan end index |

#### Returns

`TRUE` if the vlan was found and removed; `FALSE` otherwise

Since: 1.18

### nm_setting_bridge_port_clear_vlans ()

    void
    nm_setting_bridge_port_clear_vlans (NMSettingBridgePort *setting);

Removes all configured VLANs.

#### Parameters

setting | the NMSettingBridgePort |

Since: 1.18

## Types and Values

### NM_SETTING_BRIDGE_PORT_SETTING_NAME

    #define NM_SETTING_BRIDGE_PORT_SETTING_NAME "bridge-port"

### NM_SETTING_BRIDGE_PORT_PRIORITY

    #define NM_SETTING_BRIDGE_PORT_PRIORITY     "priority"

### NM_SETTING_BRIDGE_PORT_PATH_COST

    #define NM_SETTING_BRIDGE_PORT_PATH_COST    "path-cost"

### NM_SETTING_BRIDGE_PORT_HAIRPIN_MODE

    #define NM_SETTING_BRIDGE_PORT_HAIRPIN_MODE "hairpin-mode"

### NM_SETTING_BRIDGE_PORT_VLANS

    #define NM_SETTING_BRIDGE_PORT_VLANS        "vlans"

### NMSettingBridgePort

    typedef struct _NMSettingBridgePort NMSettingBridgePort;

Bridge Port Settings

## Property Details

### The `“hairpin-mode”` property

      “hairpin-mode”             gboolean

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

Owner: NMSettingBridgePort

Flags: Read / Write

Default value: FALSE

### The `“path-cost”` property

      “path-cost”                guint

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

Owner: NMSettingBridgePort

Flags: Read / Write

Allowed values: <= 65535

Default value: 100

### The `“priority”` property

      “priority”                 guint

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

Owner: NMSettingBridgePort

Flags: Read / Write

Allowed values: <= 63

Default value: 32

### The `“vlans”` property

      “vlans”                    GPtrArray *

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 [, $vid pvid]...

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

[type GPtrArray(NMBridgeVlan)]

Owner: NMSettingBridgePort

Flags: Read / Write

Since: 1.18