NMSettingBridge
3
LIBNM-UTIL Library

# NMSettingBridge

Describes bridging-related properties

## Synopsis

    #include <nm-setting-bridge.h>

    #define             NM_SETTING_BRIDGE_SETTING_NAME
    enum                NMSettingBridgeError;
    #define             NM_TYPE_SETTING_BRIDGE_ERROR
    #define             NM_SETTING_BRIDGE_ERROR
    GQuark              nm_setting_bridge_error_quark       (void);
    #define             NM_SETTING_BRIDGE_IFNAME
    #define             NM_SETTING_BRIDGE_MEMBERS
                        NMSettingBridge;
    GType               nm_setting_bridge_get_type          (void);
    NMSetting *         nm_setting_bridge_new               (void);
    const char *        nm_setting_bridge_get_ifname        (NMSettingBridge *setting);
    guint32             nm_setting_bridge_get_num_members   (NMSettingBridge *setting);
    const char *        nm_setting_bridge_get_member        (NMSettingBridge *setting,
                                                             guint32 i);
    gboolean            nm_setting_bridge_add_member        (NMSettingBridge *setting,
                                                             const char *uuid);
    void                nm_setting_bridge_remove_member     (NMSettingBridge *setting,
                                                             guint32 i);
    void                nm_setting_bridge_clear_members     (NMSettingBridge *setting);

## Object Hierarchy

      GObject
       +----NMSetting
             +----NMSettingBridge

## Properties

      "ifname"                   gchar*                : Read / Write / Construct
      "members"                  GSList_gchararray_*   : Read / Write

## Description

The NMSettingBridge object is a NMSetting subclass that describes properties that apply to bridged network configurations. Most importantly, it contains a list of UUIDs of other NMConnection objects that are members of the bridge.

## Details

### NM_SETTING_BRIDGE_SETTING_NAME

    #define NM_SETTING_BRIDGE_SETTING_NAME "bridge"

### enum NMSettingBridgeError

    typedef enum
    {
    	NM_SETTING_BRIDGE_ERROR_UNKNOWN = 0,
    	NM_SETTING_BRIDGE_ERROR_INVALID_PROPERTY,
    	NM_SETTING_BRIDGE_ERROR_MISSING_PROPERTY,
    } NMSettingBridgeError;

### NM_TYPE_SETTING_BRIDGE_ERROR

    #define NM_TYPE_SETTING_BRIDGE_ERROR (nm_setting_bridge_error_get_type ())

### NM_SETTING_BRIDGE_ERROR

    #define NM_SETTING_BRIDGE_ERROR nm_setting_bridge_error_quark ()

### nm_setting_bridge_error_quark ()

    GQuark              nm_setting_bridge_error_quark       (void);

Registers an error quark for NMSettingBridge if necessary.

Returns :

  the error quark used for NMSettingBridge errors.

### NM_SETTING_BRIDGE_IFNAME

    #define NM_SETTING_BRIDGE_IFNAME   "ifname"

### NM_SETTING_BRIDGE_MEMBERS

    #define NM_SETTING_BRIDGE_MEMBERS  "members"

### NMSettingBridge

    typedef struct _NMSettingBridge NMSettingBridge;

### nm_setting_bridge_get_type ()

    GType               nm_setting_bridge_get_type          (void);

Returns :

### nm_setting_bridge_new ()

    NMSetting *         nm_setting_bridge_new               (void);

Creates a new NMSettingBridge object with default values.

Returns :

  the new empty NMSettingBridge object

### nm_setting_bridge_get_ifname ()

    const char *        nm_setting_bridge_get_ifname        (NMSettingBridge *setting);

Returns the "ifname" property of the bridge.

`setting` :

  the NMSettingBridge

Returns :

  the bridge interface name

### nm_setting_bridge_get_num_members ()

    guint32             nm_setting_bridge_get_num_members   (NMSettingBridge *setting);

A bridge may have zero or more members, which are other NMConnection objects that provide configuration of interfaces that will be added to this bridge when the connection containing this NMSettingBridge is activated.

`setting` :

  the NMSettingBridge

Returns :

  the number of members of the bridge

### nm_setting_bridge_get_member ()

    const char *        nm_setting_bridge_get_member        (NMSettingBridge *setting,
                                                             guint32 i);

Returns the UUID of the member NMConnection referenced by `i`. Members are not stored in any particular order (nor is any ordering implied), and thus the index should be viewed as an opaque pointer. Members may be reordered internally at any time.

`setting` :

  the NMSettingBridge

`i` :

  the index of the bridge member to return

Returns :

  the UUID of a NMConnection that is a member of this bridge

### nm_setting_bridge_add_member ()

    gboolean            nm_setting_bridge_add_member        (NMSettingBridge *setting,
                                                             const char *uuid);

Note that members are not stored in any particular order (nor is any ordering implied). Members may be reordered internally at any time.

`setting` :

  the NMSettingBridge

`uuid` :

  the UUID if an NMConnection to be added as a member of this bridge

Returns :

  TRUE if the member was added, FALSE if the uuid was invalid or previously added.

### nm_setting_bridge_remove_member ()

    void                nm_setting_bridge_remove_member     (NMSettingBridge *setting,
                                                             guint32 i);

Removes the bridge member UUID specified at index `i`.

`setting` :

  the NMSettingBridge

`i` :

  the index of the bridge member to remove

### nm_setting_bridge_clear_members ()

    void                nm_setting_bridge_clear_members     (NMSettingBridge *setting);

Removes all members of the bridge.

`setting` :

  the NMSettingBridge

## Property Details

### The `"ifname"` property

      "ifname"                   gchar*                : Read / Write / Construct

Bridges can (optionally) be assigned a specific name, such as br0. Be aware that assigning a name may cause the connection to fail if there is already an existing bridge with the same name (for example, created outside of NetworkManager). Leaving the "ifname" allows an unused interface name to be used instead.

Default value: NULL

### The `"members"` property

      "members"                  GSList_gchararray_*   : Read / Write

A bridge may have 0 or more members, that is interfaces to be added to the bridge when it is activated. Each 'member' is the ("uuid") of an NMConnection object. To be successfully activated, each of the members NMConnections must be valid available to NetworkManager. All members must be successfully added to the bridge or the activation will fail. A member NMConnection must refer to a bridgable device such as an ethernet or wifi device.