![]() |
![]() |
![]() |
libnm-util Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties |
#include <nm-setting-vlan.h> #define NM_SETTING_VLAN_SETTING_NAME enum NMSettingVlanError; #define NM_SETTING_VLAN_ERROR GQuark nm_setting_vlan_error_quark (void
); #define NM_SETTING_VLAN_INTERFACE_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 NMSettingVlan; NMSettingVlanClass; enum NMVlanPriorityMap; enum NMVlanFlags; NMSetting * nm_setting_vlan_new (void
); const char * nm_setting_vlan_get_interface_name (NMSettingVlan *setting
); const char * nm_setting_vlan_get_parent (NMSettingVlan *setting
); guint32 nm_setting_vlan_get_id (NMSettingVlan *setting
); guint32 nm_setting_vlan_get_flags (NMSettingVlan *setting
); gint32 nm_setting_vlan_get_num_priorities (NMSettingVlan *setting
,NMVlanPriorityMap map
); gboolean nm_setting_vlan_get_priority (NMSettingVlan *setting
,NMVlanPriorityMap map
,guint32 idx
,guint32 *out_from
,guint32 *out_to
); gboolean nm_setting_vlan_add_priority (NMSettingVlan *setting
,NMVlanPriorityMap map
,guint32 from
,guint32 to
); void nm_setting_vlan_remove_priority (NMSettingVlan *setting
,NMVlanPriorityMap map
,guint32 idx
); void nm_setting_vlan_clear_priorities (NMSettingVlan *setting
,NMVlanPriorityMap map
); gboolean nm_setting_vlan_add_priority_str (NMSettingVlan *setting
,NMVlanPriorityMap map
,const char *str
);
GEnum +----NMSettingVlanError
GObject +----NMSetting +----NMSettingVlan
GEnum +----NMVlanPriorityMap
GEnum +----NMVlanFlags
"egress-priority-map" GSList_gchararray_* : Read / Write "flags" guint : Read / Write / Construct "id" guint : Read / Write / Construct "ingress-priority-map" GSList_gchararray_* : Read / Write "interface-name" gchar* : Read / Write / Construct "parent" gchar* : Read / Write / Construct
The NMSettingVlan object is a NMSetting subclass that describes properties necessary for connection to VLAN interfaces.
typedef enum { NM_SETTING_VLAN_ERROR_UNKNOWN = 0, /*< nick=Unknown >*/ NM_SETTING_VLAN_ERROR_INVALID_PROPERTY, /*< nick=InvalidProperty >*/ NM_SETTING_VLAN_ERROR_MISSING_PROPERTY, /*< nick=MissingProperty >*/ NM_SETTING_VLAN_ERROR_INVALID_PARENT /*< nick=InvalidParent >*/ } NMSettingVlanError;
GQuark nm_setting_vlan_error_quark (void
);
Registers an error quark for NMSettingVlan if necessary.
Returns : |
the error quark used for NMSettingVlan errors. |
#define NM_SETTING_VLAN_INGRESS_PRIORITY_MAP "ingress-priority-map"
#define NM_SETTING_VLAN_EGRESS_PRIORITY_MAP "egress-priority-map"
typedef struct { NMSettingClass parent; /* Padding for future expansion */ void (*_reserved1) (void); void (*_reserved2) (void); void (*_reserved3) (void); void (*_reserved4) (void); } NMSettingVlanClass;
typedef enum { NM_VLAN_INGRESS_MAP, NM_VLAN_EGRESS_MAP } NMVlanPriorityMap;
A selector for traffic priority maps; these map Linux SKB priorities to 802.1p priorities used in VLANs.
typedef enum { NM_VLAN_FLAG_REORDER_HEADERS = 0x1, NM_VLAN_FLAG_GVRP = 0x2, NM_VLAN_FLAG_LOOSE_BINDING = 0x4, /* NOTE: if adding flags update nm-setting-vlan.c::verify() */ } NMVlanFlags;
NMVlanFlags values control the behavior of the VLAN interface.
indicates that this interface should reorder outgoing packet headers to look more like a non-VLAN ethernet interface | |
indicates that this interface should use GVRP to register itself with it's switch | |
indicates that this interface's operating state is tied to the underlying network interface but other details (like routing) are not. |
NMSetting * nm_setting_vlan_new (void
);
Creates a new NMSettingVlan object with default values.
Returns : |
the new empty NMSettingVlan object. [transfer full] |
const char * nm_setting_vlan_get_interface_name (NMSettingVlan *setting
);
|
the NMSettingVlan |
Returns : |
the "interface_name" property of the setting |
const char * nm_setting_vlan_get_parent (NMSettingVlan *setting
);
|
the NMSettingVlan |
Returns : |
the "parent" property of the setting |
guint32 nm_setting_vlan_get_id (NMSettingVlan *setting
);
|
the NMSettingVlan |
Returns : |
the "id" property of the setting |
guint32 nm_setting_vlan_get_flags (NMSettingVlan *setting
);
|
the NMSettingVlan |
Returns : |
the "flags" property of the setting |
gint32 nm_setting_vlan_get_num_priorities (NMSettingVlan *setting
,NMVlanPriorityMap map
);
Returns the number of entires in the "ingress_priority_map" or "egress_priority_map" properties of this setting.
|
the NMSettingVlan |
|
the type of priority map |
Returns : |
return the number of ingress/egress priority entries, -1 if error |
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.
|
the NMSettingVlan |
|
the type of priority map |
|
the zero-based index of the ingress/egress priority map entry |
|
on return the value of the priority map's 'from' item. [out] |
|
on return the value of priority map's 'to' item. [out] |
Returns : |
TRUE if a priority map was returned, FALSE if error |
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.
|
the NMSettingVlan |
|
the type of priority map |
|
the priority to map to to
|
|
the priority to map from to |
Returns : |
TRUE if the new priority mapping was successfully added to the list, FALSE if error |
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.
|
the NMSettingVlan |
|
the type of priority map |
|
the zero-based index of the priority map to remove |
void nm_setting_vlan_clear_priorities (NMSettingVlan *setting
,NMVlanPriorityMap map
);
Clear all the entires from "ingress_priority_map" or "egress_priority_map" properties.
|
the NMSettingVlan |
|
the type of priority map |
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.
|
the NMSettingVlan |
|
the type of priority map |
|
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 error |
"egress-priority-map"
property "egress-priority-map" GSList_gchararray_* : Read / Write
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'.
"flags"
property"flags" guint : Read / Write / Construct
One or more of NMVlanFlags
which control the behavior and features of
the VLAN interface.
Default value: 0
"id"
property"id" guint : Read / Write / Construct
The VLAN identifier the interface created by this connection should be assigned.
Allowed values: <= 4095
Default value: 0
"ingress-priority-map"
property "ingress-priority-map" GSList_gchararray_* : Read / Write
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'.
"interface-name"
property"interface-name" gchar* : Read / Write / Construct
If given, specifies the kernel name of the VLAN interface. If not given, a default name will be constructed from the interface described by the parent interface and the "id" , ex 'eth2.1'. The parent interface may be given by the "parent" property or by a hardware address property, eg "mac-address".
Default value: NULL
"parent"
property"parent" gchar* : Read / Write / Construct
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 a hardware address in a hardware-specific setting, like "mac-address".
Default value: NULL