## NMSettingVlan NMSettingVlan — Describes connection properties for VLAN interfaces |

## Functions

NMSetting * | nm_setting_vlan_new ()
const char * | nm_setting_vlan_get_parent ()
guint32 | nm_setting_vlan_get_id ()
guint32 | nm_setting_vlan_get_flags ()
gint32 | nm_setting_vlan_get_num_priorities ()
gboolean | nm_setting_vlan_get_priority ()
gboolean | nm_setting_vlan_add_priority ()
void | nm_setting_vlan_remove_priority ()
gboolean | nm_setting_vlan_remove_priority_by_value ()
gboolean | nm_setting_vlan_remove_priority_str_by_value ()
void | nm_setting_vlan_clear_priorities ()
gboolean | nm_setting_vlan_add_priority_str ()

## Types and Values

#define | NM_SETTING_VLAN_SETTING_NAME
#define | NM_SETTING_VLAN_PARENT
#define | NM_SETTING_VLAN_ID
#define | NM_SETTING_VLAN_FLAGS
#define | NM_SETTING_VLAN_INGRESS_PRIORITY_MAP
#define | NM_SETTING_VLAN_EGRESS_PRIORITY_MAP
enum | NMVlanPriorityMap
enum | NMVlanFlags
#define | NM_VLAN_FLAGS_ALL

## Object Hierarchy

        GEnum
        ╰── NMVlanPriorityMap
        GFlags
        ╰── NMVlanFlags

## Description

The NMSettingVlan object is a NMSetting subclass that describes properties necessary for connection to VLAN interfaces.

## Functions

### nm_setting_vlan_new ()

    NMSetting *
    nm_setting_vlan_new (void);

Creates a new NMSettingVlan object with default values.

#### Returns

the new empty NMSettingVlan object.

[transfer full]

### nm_setting_vlan_get_parent ()

    const char *
    nm_setting_vlan_get_parent (NMSettingVlan *setting);

#### Parameters

setting | the NMSettingVlan |

#### Returns

the “parent” property of the setting

### nm_setting_vlan_get_id ()

    guint32
    nm_setting_vlan_get_id (NMSettingVlan *setting);

#### Parameters

setting | the NMSettingVlan |

#### Returns

the “id” property of the setting

### nm_setting_vlan_get_flags ()

    guint32
    nm_setting_vlan_get_flags (NMSettingVlan *setting);

#### Parameters

setting | the NMSettingVlan |

#### Returns

the “flags” property of the setting

### nm_setting_vlan_get_num_priorities ()

    gint32
    nm_setting_vlan_get_num_priorities (NMSettingVlan *setting,
                                        NMVlanPriorityMap map);

Returns the number of entries in the “ingress_priority_map” or “egress_priority_map” properties of this setting.

#### Parameters

setting | the NMSettingVlan |
map | the type of priority map |

#### Returns

return the number of ingress/egress priority entries.

### nm_setting_vlan_get_priority ()

    gboolean
    nm_setting_vlan_get_priority (NMSettingVlan *setting,
                                  NMVlanPriorityMap map,
                                  guint32 idx,
                                  guint32 *out_from,
                                  guint32 *out_to);

Retrieve one of the entries of the “ingress_priority_map” or “egress_priority_map” properties of this setting.

#### Parameters

setting | the NMSettingVlan |
map | the type of priority map |
idx | the zero-based index of the ingress/egress priority map entry |
out_from | on return the value of the priority map's 'from' item. | [out][allow-none]
out_to | on return the value of priority map's 'to' item. | [out][allow-none]

#### Returns

returns `TRUE` if `idx` is in range. Otherwise, `FALSE`.

### nm_setting_vlan_add_priority ()

    gboolean
    nm_setting_vlan_add_priority (NMSettingVlan *setting,
                                  NMVlanPriorityMap map,
                                  guint32 from,
                                  guint32 to);

Adds a priority mapping to the “ingress_priority_map” or “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_VLAN_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_VLAN_EGRESS_MAP then `from` is the Linux SKB priority value and `to` is the outgoing 802.1q VLAN Priority Code Point (PCP) value.

#### Parameters

setting | the NMSettingVlan |
map | the type of priority map |
from | the priority to map to `to` |
to | the priority to map `from` to |

#### Returns

`TRUE`.

### nm_setting_vlan_remove_priority ()

    void
    nm_setting_vlan_remove_priority (NMSettingVlan *setting,
                                     NMVlanPriorityMap map,
                                     guint32 idx);

Removes the priority map at index `idx` from the “ingress_priority_map” or “egress_priority_map” properties.

#### Parameters

setting | the NMSettingVlan |
map | the type of priority map |
idx | the zero-based index of the priority map to remove |

### nm_setting_vlan_remove_priority_by_value ()

    gboolean
    nm_setting_vlan_remove_priority_by_value
                                   (NMSettingVlan *setting,
                                    NMVlanPriorityMap map,
                                    guint32 from,
                                    guint32 to);

Removes the priority map `form` :`to` from the “ingress_priority_map” or “egress_priority_map” (according to `map` argument) properties.

#### Parameters

setting | the NMSettingVlan |
map | the type of priority map |
from | the priority to map to `to` |
to | the priority to map `from` to |

#### Returns

`TRUE` if the priority mapping was found and removed; `FALSE` if it was not.

### nm_setting_vlan_remove_priority_str_by_value ()

    gboolean
    nm_setting_vlan_remove_priority_str_by_value
                                   (NMSettingVlan *setting,
                                    NMVlanPriorityMap map,
                                    const char *str);

Removes the priority map `str` from the “ingress_priority_map” or “egress_priority_map” (according to `map` argument) properties.

#### Parameters

setting | the NMSettingVlan |
map | the type of priority map |
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.

### nm_setting_vlan_clear_priorities ()

    void
    nm_setting_vlan_clear_priorities (NMSettingVlan *setting,
                                      NMVlanPriorityMap map);

Clear all the entries from “ingress_priority_map” or “egress_priority_map” properties.

#### Parameters

setting | the NMSettingVlan |
map | the type of priority map |

### nm_setting_vlan_add_priority_str ()

    gboolean
    nm_setting_vlan_add_priority_str (NMSettingVlan *setting,
                                      NMVlanPriorityMap map,
                                      const char *str);

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

#### Parameters

setting | the NMSettingVlan |
map | the type of priority map |
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.

## Types and Values

### NM_SETTING_VLAN_SETTING_NAME

    #define NM_SETTING_VLAN_SETTING_NAME "vlan"

### NM_SETTING_VLAN_PARENT

    #define NM_SETTING_VLAN_PARENT               "parent"

### NM_SETTING_VLAN_ID

    #define NM_SETTING_VLAN_ID                   "id"

### NM_SETTING_VLAN_FLAGS

    #define NM_SETTING_VLAN_FLAGS                "flags"

### NM_SETTING_VLAN_INGRESS_PRIORITY_MAP

    #define NM_SETTING_VLAN_INGRESS_PRIORITY_MAP "ingress-priority-map"

### NM_SETTING_VLAN_EGRESS_PRIORITY_MAP

    #define NM_SETTING_VLAN_EGRESS_PRIORITY_MAP  "egress-priority-map"

### enum NMVlanPriorityMap

A selector for traffic priority maps; these map Linux SKB priorities to 802.1p priorities used in VLANs.

#### Members

NM_VLAN_INGRESS_MAP | map for incoming data |
NM_VLAN_EGRESS_MAP | map for outgoing data |

### enum NMVlanFlags

NMVlanFlags values control the behavior of the VLAN interface.

#### Members

NM_VLAN_FLAG_REORDER_HEADERS | indicates that this interface should reorder outgoing packet headers to look more like a non-VLAN Ethernet interface |
NM_VLAN_FLAG_GVRP | indicates that this interface should use GVRP to register itself with its switch |
NM_VLAN_FLAG_LOOSE_BINDING | indicates that this interface's operating state is tied to the underlying network interface but other details (like routing) are not. |
NM_VLAN_FLAG_MVRP | indicates that this interface should use MVRP to register itself with its switch |

### NM_VLAN_FLAGS_ALL

    #define             NM_VLAN_FLAGS_ALL