## NMSettingSriov

NMSettingSriov — Describes SR-IOV connection properties

## Functions

NMSetting * | nm_setting_sriov_new ()
guint | nm_setting_sriov_get_total_vfs ()
guint | nm_setting_sriov_get_num_vfs ()
NMSriovVF * | nm_setting_sriov_get_vf ()
void | nm_setting_sriov_add_vf ()
void | nm_setting_sriov_remove_vf ()
gboolean | nm_setting_sriov_remove_vf_by_index ()
void | nm_setting_sriov_clear_vfs ()
NMTernary | nm_setting_sriov_get_autoprobe_drivers ()
NMSriovEswitchMode | nm_setting_sriov_get_eswitch_mode ()
NMSriovEswitchInlineMode | nm_setting_sriov_get_eswitch_inline_mode ()
NMSriovEswitchEncapMode | nm_setting_sriov_get_eswitch_encap_mode ()
gboolean | nm_sriov_vf_add_vlan ()
gboolean | nm_sriov_vf_remove_vlan ()
const guint * | nm_sriov_vf_get_vlan_ids ()
void | nm_sriov_vf_set_vlan_qos ()
void | nm_sriov_vf_set_vlan_protocol ()
guint32 | nm_sriov_vf_get_vlan_qos ()
NMSriovVFVlanProtocol | nm_sriov_vf_get_vlan_protocol ()
NMSriovVF * | nm_sriov_vf_new ()
void | nm_sriov_vf_ref ()
void | nm_sriov_vf_unref ()
gboolean | nm_sriov_vf_equal ()
NMSriovVF * | nm_sriov_vf_dup ()
guint | nm_sriov_vf_get_index ()
void | nm_sriov_vf_set_attribute ()
const char ** | nm_sriov_vf_get_attribute_names ()
GVariant * | nm_sriov_vf_get_attribute ()
gboolean | nm_sriov_vf_attribute_validate ()

## Types and Values

#define | NM_SETTING_SRIOV_SETTING_NAME
#define | NM_SETTING_SRIOV_TOTAL_VFS
#define | NM_SETTING_SRIOV_VFS
#define | NM_SETTING_SRIOV_AUTOPROBE_DRIVERS
#define | NM_SETTING_SRIOV_ESWITCH_MODE
#define | NM_SETTING_SRIOV_ESWITCH_INLINE_MODE
#define | NM_SETTING_SRIOV_ESWITCH_ENCAP_MODE
#define | NM_SRIOV_VF_ATTRIBUTE_MAC
#define | NM_SRIOV_VF_ATTRIBUTE_SPOOF_CHECK
#define | NM_SRIOV_VF_ATTRIBUTE_TRUST
#define | NM_SRIOV_VF_ATTRIBUTE_MIN_TX_RATE
#define | NM_SRIOV_VF_ATTRIBUTE_MAX_TX_RATE
enum | NMSriovVFVlanProtocol
enum | NMSriovEswitchMode
enum | NMSriovEswitchInlineMode
enum | NMSriovEswitchEncapMode

## Object Hierarchy

        GBoxed
        ╰── NMSriovVF
        GEnum
        ├── NMSriovEswitchEncapMode
        ├── NMSriovEswitchInlineMode
        ├── NMSriovEswitchMode
        ╰── NMSriovVFVlanProtocol

## Includes

    #include <nm-setting-sriov.h>

## Description

## Functions

### nm_setting_sriov_new ()

    NMSetting *
    nm_setting_sriov_new (void);

Creates a new NMSettingSriov object with default values.

#### Returns

the new empty NMSettingSriov object.

[transfer full]

Since: 1.14

### nm_setting_sriov_get_total_vfs ()

    guint
    nm_setting_sriov_get_total_vfs (NMSettingSriov *setting);

Returns the value contained in the “total-vfs” property.

#### Parameters

setting | the NMSettingSriov |

#### Returns

the total number of SR-IOV virtual functions to create

Since: 1.14

### nm_setting_sriov_get_num_vfs ()

    guint
    nm_setting_sriov_get_num_vfs (NMSettingSriov *setting);

#### Parameters

setting | the NMSettingSriov |

#### Returns

the number of configured VFs

Since: 1.14

### nm_setting_sriov_get_vf ()

    NMSriovVF *
    nm_setting_sriov_get_vf (NMSettingSriov *setting,
                             guint idx);

#### Parameters

setting | the NMSettingSriov |
idx | index number of the VF to return |

#### Returns

the VF at index `idx` .

[transfer none]

Since: 1.14

### nm_setting_sriov_add_vf ()

    void
    nm_setting_sriov_add_vf (NMSettingSriov *setting,
                             NMSriovVF *vf);

Appends a new VF and associated information to the setting. The given VF is duplicated internally and is not changed by this function.

#### Parameters

setting | the NMSettingSriov |
vf | the VF to add |

Since: 1.14

### nm_setting_sriov_remove_vf ()

    void
    nm_setting_sriov_remove_vf (NMSettingSriov *setting,
                                guint idx);

Removes the VF at index `idx` .

#### Parameters

setting | the NMSettingSriov |
idx | index number of the VF |

Since: 1.14

### nm_setting_sriov_remove_vf_by_index ()

    gboolean
    nm_setting_sriov_remove_vf_by_index (NMSettingSriov *setting,
                                         guint index);

Removes the VF with VF index `index` .

#### Parameters

setting | the NMSettingSriov |
index | the VF index of the VF to remove |

#### Returns

`TRUE` if the VF was found and removed; `FALSE` if it was not

Since: 1.14

### nm_setting_sriov_clear_vfs ()

    void
    nm_setting_sriov_clear_vfs (NMSettingSriov *setting);

Removes all configured VFs.

#### Parameters

setting | the NMSettingSriov |

Since: 1.14

### nm_setting_sriov_get_autoprobe_drivers ()

    NMTernary
    nm_setting_sriov_get_autoprobe_drivers
                                   (NMSettingSriov *setting);

Returns the value contained in the “autoprobe-drivers” property.

#### Parameters

setting | the NMSettingSriov |

#### Returns

the autoprobe-drivers property value

Since: 1.14

### nm_setting_sriov_get_eswitch_mode ()

    NMSriovEswitchMode
    nm_setting_sriov_get_eswitch_mode (NMSettingSriov *setting);

#### Parameters

setting | the NMSettingSriov |

#### Returns

the value contained in the “eswitch-mode” property.

Since: 1.46

### nm_setting_sriov_get_eswitch_inline_mode ()

    NMSriovEswitchInlineMode
    nm_setting_sriov_get_eswitch_inline_mode
                                   (NMSettingSriov *setting);

#### Parameters

setting | the NMSettingSriov |

#### Returns

the value contained in the “eswitch-inline-mode” property.

Since: 1.46

### nm_setting_sriov_get_eswitch_encap_mode ()

    NMSriovEswitchEncapMode
    nm_setting_sriov_get_eswitch_encap_mode
                                   (NMSettingSriov *setting);

#### Parameters

setting | the NMSettingSriov |

#### Returns

the value contained in the “eswitch-encap-mode” property.

Since: 1.46

### nm_sriov_vf_add_vlan ()

    gboolean
    nm_sriov_vf_add_vlan (NMSriovVF *vf,
                          guint vlan_id);

Adds a VLAN to the VF. Currently kernel only supports one VLAN per VF.

#### Parameters

vf | the NMSriovVF |
vlan_id | the VLAN id |

#### Returns

`TRUE` if the VLAN was added; `FALSE` if it already existed

Since: 1.14

### nm_sriov_vf_remove_vlan ()

    gboolean
    nm_sriov_vf_remove_vlan (NMSriovVF *vf,
                             guint vlan_id);

Removes a VLAN from a VF.

#### Parameters

vf | the NMSriovVF |
vlan_id | the VLAN id |

#### Returns

`TRUE` if the VLAN was removed, `FALSE` if the VLAN `vlan_id` did not belong to the VF.

Since: 1.14

### nm_sriov_vf_get_vlan_ids ()

    const guint *
    nm_sriov_vf_get_vlan_ids (const NMSriovVF *vf,
                              guint *length);

Returns the VLANs currently configured on the VF. Currently kernel only supports one VLAN per VF.

#### Parameters

vf | the NMSriovVF |
length | on return, the number of VLANs configured. | [out][optional]

#### Returns

a list of VLAN ids configured on the VF.

[transfer none][array length=length]

Since: 1.14

### nm_sriov_vf_set_vlan_qos ()

    void
    nm_sriov_vf_set_vlan_qos (NMSriovVF *vf,
                              guint vlan_id,
                              guint32 qos);

Sets a QoS value for the given VLAN.

#### Parameters

vf | the NMSriovVF |
vlan_id | the VLAN id |
qos | a QoS (priority) value |

Since: 1.14

### nm_sriov_vf_set_vlan_protocol ()

    void
    nm_sriov_vf_set_vlan_protocol (NMSriovVF *vf,
                                   guint vlan_id,
                                   NMSriovVFVlanProtocol protocol);

Sets the protocol for the given VLAN.

#### Parameters

vf | the NMSriovVF |
vlan_id | the VLAN id |
protocol | the VLAN protocol |

Since: 1.14

### nm_sriov_vf_get_vlan_qos ()

    guint32
    nm_sriov_vf_get_vlan_qos (const NMSriovVF *vf,
                              guint vlan_id);

Returns the QoS value for the given VLAN.

#### Parameters

vf | the NMSriovVF |
vlan_id | the VLAN id |

#### Returns

the QoS value

Since: 1.14

### nm_sriov_vf_get_vlan_protocol ()

    NMSriovVFVlanProtocol
    nm_sriov_vf_get_vlan_protocol (const NMSriovVF *vf,
                                   guint vlan_id);

Returns the configured protocol for the given VLAN.

#### Parameters

vf | the NMSriovVF |
vlan_id | the VLAN id |

#### Returns

the configured protocol

Since: 1.14

### nm_sriov_vf_new ()

    NMSriovVF *
    nm_sriov_vf_new (guint index);

Creates a new NMSriovVF object.

#### Parameters

index | the VF index |

#### Returns

the new NMSriovVF object.

[transfer full]

Since: 1.14

### nm_sriov_vf_ref ()

    void
    nm_sriov_vf_ref (NMSriovVF *vf);

Increases the reference count of the object.

#### Parameters

vf | the NMSriovVF |

Since: 1.14

### nm_sriov_vf_unref ()

    void
    nm_sriov_vf_unref (NMSriovVF *vf);

Decreases the reference count of the object. If the reference count reaches zero, the object will be destroyed.

#### Parameters

vf | the NMSriovVF |

Since: 1.14

### nm_sriov_vf_equal ()

    gboolean
    nm_sriov_vf_equal (const NMSriovVF *vf,
                       const NMSriovVF *other);

Determines if two NMSriovVF objects have the same index, attributes and VLANs.

#### Parameters

vf | the NMSriovVF |
other | the NMSriovVF to compare `vf` to. |

#### Returns

`TRUE` if the objects contain the same values, `FALSE` if they do not.

Since: 1.14

### nm_sriov_vf_dup ()

    NMSriovVF *
    nm_sriov_vf_dup (const NMSriovVF *vf);

Creates a copy of `vf` .

#### Parameters

vf | the NMSriovVF |

#### Returns

a copy of `vf` .

[transfer full]

Since: 1.14

### nm_sriov_vf_get_index ()

    guint
    nm_sriov_vf_get_index (const NMSriovVF *vf);

Gets the index property of this VF object.

#### Parameters

vf | the NMSriovVF |

#### Returns

the VF index

Since: 1.14

### nm_sriov_vf_set_attribute ()

    void
    nm_sriov_vf_set_attribute (NMSriovVF *vf,
                               const char *name,
                               GVariant *value);

Sets the named attribute on `vf` to the given value.

#### Parameters

vf | the NMSriovVF |
name | the name of a route attribute |
value | the value. | [transfer none][nullable]

Since: 1.14

### nm_sriov_vf_get_attribute_names ()

    const char **
    nm_sriov_vf_get_attribute_names (const NMSriovVF *vf);

Gets an array of attribute names defined on `vf` .

#### Parameters

vf | the NMSriovVF |

#### Returns

a `NULL`-terminated array of attribute names.

[transfer container]

Since: 1.14

### nm_sriov_vf_get_attribute ()

    GVariant *
    nm_sriov_vf_get_attribute (const NMSriovVF *vf,
                               const char *name);

Gets the value of the attribute with name `name` on `vf`

#### Parameters

vf | the NMSriovVF |
name | the name of a VF attribute |

#### Returns

the value of the attribute with name `name` on `vf` , or `NULL` if `vf` has no such attribute.

[transfer none]

Since: 1.14

### nm_sriov_vf_attribute_validate ()

    gboolean
    nm_sriov_vf_attribute_validate (const char *name,
                                    GVariant *value,
                                    gboolean *known,
                                    GError **error);

Validates a VF attribute, i.e. checks that the attribute is a known one, the value is of the correct type and well-formed.

#### Parameters

name | the attribute name |
value | the attribute value |
known | on return, whether the attribute name is a known one. | [out][optional]
error | return location for a GError, or `NULL` |

#### Returns

`TRUE` if the attribute is valid, `FALSE` otherwise

Since: 1.42

## Types and Values

### NM_SETTING_SRIOV_SETTING_NAME

    #define NM_SETTING_SRIOV_SETTING_NAME "sriov"

### NM_SETTING_SRIOV_TOTAL_VFS

    #define NM_SETTING_SRIOV_TOTAL_VFS           "total-vfs"

### NM_SETTING_SRIOV_VFS

    #define NM_SETTING_SRIOV_VFS                 "vfs"

### NM_SETTING_SRIOV_AUTOPROBE_DRIVERS

    #define NM_SETTING_SRIOV_AUTOPROBE_DRIVERS   "autoprobe-drivers"

### NM_SETTING_SRIOV_ESWITCH_MODE

    #define NM_SETTING_SRIOV_ESWITCH_MODE        "eswitch-mode"

### NM_SETTING_SRIOV_ESWITCH_INLINE_MODE

    #define NM_SETTING_SRIOV_ESWITCH_INLINE_MODE "eswitch-inline-mode"

### NM_SETTING_SRIOV_ESWITCH_ENCAP_MODE

    #define NM_SETTING_SRIOV_ESWITCH_ENCAP_MODE  "eswitch-encap-mode"

### NM_SRIOV_VF_ATTRIBUTE_MAC

    #define NM_SRIOV_VF_ATTRIBUTE_MAC         "mac"

### NM_SRIOV_VF_ATTRIBUTE_SPOOF_CHECK

    #define NM_SRIOV_VF_ATTRIBUTE_SPOOF_CHECK "spoof-check"

### NM_SRIOV_VF_ATTRIBUTE_TRUST

    #define NM_SRIOV_VF_ATTRIBUTE_TRUST       "trust"

### NM_SRIOV_VF_ATTRIBUTE_MIN_TX_RATE

    #define NM_SRIOV_VF_ATTRIBUTE_MIN_TX_RATE "min-tx-rate"

### NM_SRIOV_VF_ATTRIBUTE_MAX_TX_RATE

    #define NM_SRIOV_VF_ATTRIBUTE_MAX_TX_RATE "max-tx-rate"

### enum NMSriovVFVlanProtocol

NMSriovVFVlanProtocol indicates the VLAN protocol to use.

#### Members

NM_SRIOV_VF_VLAN_PROTOCOL_802_1Q | use 802.1Q |
NM_SRIOV_VF_VLAN_PROTOCOL_802_1AD | use 802.1ad |

Since: 1.14

### enum NMSriovEswitchMode

#### Members

NM_SRIOV_ESWITCH_MODE_PRESERVE | don't modify current eswitch mode |
NM_SRIOV_ESWITCH_MODE_UNKNOWN |  |
NM_SRIOV_ESWITCH_MODE_LEGACY | use legacy SRIOV |
NM_SRIOV_ESWITCH_MODE_SWITCHDEV | use switchdev mode |

Since: 1.46

### enum NMSriovEswitchInlineMode

#### Members

NM_SRIOV_ESWITCH_INLINE_MODE_PRESERVE | don't modify current inline-mode |
NM_SRIOV_ESWITCH_INLINE_MODE_UNKNOWN |  |
NM_SRIOV_ESWITCH_INLINE_MODE_NONE | don't use inline mode |
NM_SRIOV_ESWITCH_INLINE_MODE_LINK | L2 mode |
NM_SRIOV_ESWITCH_INLINE_MODE_NETWORK | L3 mode |
NM_SRIOV_ESWITCH_INLINE_MODE_TRANSPORT | L4 mode |

Since: 1.46

### enum NMSriovEswitchEncapMode

#### Members

NM_SRIOV_ESWITCH_ENCAP_MODE_PRESERVE | don't modify current encap-mode |
NM_SRIOV_ESWITCH_ENCAP_MODE_UNKNOWN |  |
NM_SRIOV_ESWITCH_ENCAP_MODE_NONE | disable encapsulation mode |
NM_SRIOV_ESWITCH_ENCAP_MODE_BASIC | enable encapsulation mode |

Since: 1.46