Top | ![]() |
![]() |
![]() |
![]() |
guint | ageing-time | Read / Write / Construct |
guint | forward-delay | Read / Write / Construct |
guint | group-forward-mask | Read / Write / Construct |
guint | hello-time | Read / Write / Construct |
gchar * | mac-address | Read / Write |
guint | max-age | Read / Write / Construct |
gboolean | multicast-snooping | Read / Write / Construct |
guint | priority | Read / Write / Construct |
gboolean | stp | Read / Write / Construct |
guint | vlan-default-pvid | Read / Write / Construct |
gboolean | vlan-filtering | Read / Write / Construct |
GPtrArray * | vlans | Read / Write |
#define | NM_SETTING_BRIDGE_SETTING_NAME |
#define | NM_SETTING_BRIDGE_MAC_ADDRESS |
#define | NM_SETTING_BRIDGE_STP |
#define | NM_SETTING_BRIDGE_PRIORITY |
#define | NM_SETTING_BRIDGE_FORWARD_DELAY |
#define | NM_SETTING_BRIDGE_HELLO_TIME |
#define | NM_SETTING_BRIDGE_MAX_AGE |
#define | NM_SETTING_BRIDGE_AGEING_TIME |
#define | NM_SETTING_BRIDGE_GROUP_FORWARD_MASK |
#define | NM_SETTING_BRIDGE_MULTICAST_SNOOPING |
#define | NM_SETTING_BRIDGE_VLAN_FILTERING |
#define | NM_SETTING_BRIDGE_VLAN_DEFAULT_PVID |
#define | NM_SETTING_BRIDGE_VLANS |
#define | NM_BRIDGE_VLAN_VID_MIN |
#define | NM_BRIDGE_VLAN_VID_MAX |
NMSettingBridge |
The NMSettingBridge object is a NMSetting subclass that describes properties necessary for bridging connections.
NMSetting *
nm_setting_bridge_new (void
);
Creates a new NMSettingBridge object with default values.
const char *
nm_setting_bridge_get_mac_address (NMSettingBridge *setting
);
guint16
nm_setting_bridge_get_priority (NMSettingBridge *setting
);
guint16
nm_setting_bridge_get_forward_delay (NMSettingBridge *setting
);
guint16
nm_setting_bridge_get_hello_time (NMSettingBridge *setting
);
guint32
nm_setting_bridge_get_ageing_time (NMSettingBridge *setting
);
guint16
nm_setting_bridge_get_group_forward_mask
(NMSettingBridge *setting
);
Since: 1.10
gboolean
nm_setting_bridge_get_multicast_snooping
(NMSettingBridge *setting
);
Since: 1.2
gboolean
nm_setting_bridge_get_vlan_filtering (NMSettingBridge *setting
);
Since: 1.18
guint16
nm_setting_bridge_get_vlan_default_pvid
(NMSettingBridge *setting
);
Since: 1.18
void nm_setting_bridge_add_vlan (NMSettingBridge *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.
Since: 1.18
guint
nm_setting_bridge_get_num_vlans (NMSettingBridge *setting
);
Since: 1.18
NMBridgeVlan * nm_setting_bridge_get_vlan (NMSettingBridge *setting
,guint idx
);
Since: 1.18
void nm_setting_bridge_remove_vlan (NMSettingBridge *setting
,guint idx
);
Removes the vlan at index idx
.
Since: 1.18
gboolean nm_setting_bridge_remove_vlan_by_vid (NMSettingBridge *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.
Since: 1.18
void
nm_setting_bridge_clear_vlans (NMSettingBridge *setting
);
Removes all configured VLANs.
Since: 1.18
NMBridgeVlan * nm_bridge_vlan_new (guint16 vid_start
,guint16 vid_end
);
Creates a new NMBridgeVlan object for the given VLAN id range.
Setting vid_end
to 0 is equivalent to setting it to vid_start
and creates a single-id VLAN.
vid_start |
the start VLAN id, must be between 1 and 4094. |
|
vid_end |
the end VLAN id, must be 0 or between |
Since: 1.18
NMBridgeVlan *
nm_bridge_vlan_ref (NMBridgeVlan *vlan
);
Increases the reference count of the object.
Since: 1.18
void
nm_bridge_vlan_unref (NMBridgeVlan *vlan
);
Decreases the reference count of the object. If the reference count reaches zero the object will be destroyed.
Since: 1.18
NMBridgeVlan *
nm_bridge_vlan_new_clone (const NMBridgeVlan *vlan
);
Since: 1.18
int nm_bridge_vlan_cmp (const NMBridgeVlan *a
,const NMBridgeVlan *b
);
Compare two bridge VLAN objects.
zero of the two instances are equivalent or a non-zero integer otherwise. This defines a total ordering over the VLANs. Whether a VLAN is sealed or not does not affect the comparison.
Since: 1.18
void
nm_bridge_vlan_seal (NMBridgeVlan *vlan
);
Seal the NMBridgeVlan instance. Afterwards, it is a bug
to call all functions that modify the instance (except ref/unref).
A sealed instance cannot be unsealed again, but you can create
an unsealed copy with nm_bridge_vlan_new_clone()
.
Since: 1.18
gboolean
nm_bridge_vlan_is_sealed (const NMBridgeVlan *vlan
);
Since: 1.18
void nm_bridge_vlan_set_untagged (NMBridgeVlan *vlan
,gboolean value
);
Change the value of the untagged property of the VLAN.
Since: 1.18
void nm_bridge_vlan_set_pvid (NMBridgeVlan *vlan
,gboolean value
);
Change the value of the PVID property of the VLAN. It
is invalid to set the value to TRUE
for non-single-id
VLANs.
Since: 1.18
gboolean nm_bridge_vlan_get_vid_range (const NMBridgeVlan *vlan
,guint16 *vid_start
,guint16 *vid_end
);
Gets the VLAN id range.
vlan |
the NMBridgeVlan |
|
vid_start |
location to store the VLAN id range start. |
[out] |
vid_end |
location to store the VLAN id range end. |
[out] |
Since: 1.18
gboolean
nm_bridge_vlan_is_untagged (const NMBridgeVlan *vlan
);
Returns whether the VLAN is untagged.
Since: 1.18
gboolean
nm_bridge_vlan_is_pvid (const NMBridgeVlan *vlan
);
Returns whether the VLAN is the PVID for the port.
Since: 1.18
char * nm_bridge_vlan_to_str (const NMBridgeVlan *vlan
,GError **error
);
Convert a NMBridgeVlan
to a string.
Since: 1.18
NMBridgeVlan * nm_bridge_vlan_from_str (const char *str
,GError **error
);
Parses the string representation of the queueing
discipline to a NMBridgeVlan
instance.
Since: 1.18
#define NM_SETTING_BRIDGE_GROUP_FORWARD_MASK "group-forward-mask"
#define NM_SETTING_BRIDGE_MULTICAST_SNOOPING "multicast-snooping"
“ageing-time”
property “ageing-time” guint
The Ethernet MAC address aging time, in seconds.
Flags: Read / Write / Construct
Allowed values: <= 1000000
Default value: 300
“forward-delay”
property “forward-delay” guint
The Spanning Tree Protocol (STP) forwarding delay, in seconds.
Flags: Read / Write / Construct
Allowed values: <= 30
Default value: 15
“group-forward-mask”
property “group-forward-mask” guint
A mask of group addresses to forward. Usually, group addresses in the range from 01:80:C2:00:00:00 to 01:80:C2:00:00:0F are not forwarded according to standards. This property is a mask of 16 bits, each corresponding to a group address in that range that must be forwarded. The mask can't have bits 0, 1 or 2 set because they are used for STP, MAC pause frames and LACP.
Flags: Read / Write / Construct
Allowed values: <= 65535
Default value: 0
Since: 1.10
“hello-time”
property “hello-time” guint
The Spanning Tree Protocol (STP) hello time, in seconds.
Flags: Read / Write / Construct
Allowed values: <= 10
Default value: 2
“mac-address”
property “mac-address” gchar *
If specified, the MAC address of bridge. When creating a new bridge, this MAC address will be set.
If this field is left unspecified, the "ethernet.cloned-mac-address" is referred instead to generate the initial MAC address. Note that setting "ethernet.cloned-mac-address" anyway overwrites the MAC address of the bridge later while activating the bridge. Hence, this property is deprecated.
NMSettingBridge:mac-address
has been deprecated since version 1.12 and should not be used in newly-written code.
Use the ethernet.cloned-mac-address property instead.
Flags: Read / Write
Default value: NULL
“max-age”
property “max-age” guint
The Spanning Tree Protocol (STP) maximum message age, in seconds.
Flags: Read / Write / Construct
Allowed values: <= 40
Default value: 20
“multicast-snooping”
property “multicast-snooping” gboolean
Controls whether IGMP snooping is enabled for this bridge. Note that if snooping was automatically disabled due to hash collisions, the system may refuse to enable the feature until the collisions are resolved.
Flags: Read / Write / Construct
Default value: TRUE
Since: 1.2
“priority”
property “priority” guint
Sets the Spanning Tree Protocol (STP) priority for this bridge. Lower values are "better"; the lowest priority bridge will be elected the root bridge.
Flags: Read / Write / Construct
Allowed values: <= 65535
Default value: 32768
“stp”
property “stp” gboolean
Controls whether Spanning Tree Protocol (STP) is enabled for this bridge.
Flags: Read / Write / Construct
Default value: TRUE
“vlan-default-pvid”
property “vlan-default-pvid” guint
The default PVID for the ports of the bridge, that is the VLAN id assigned to incoming untagged frames.
Flags: Read / Write / Construct
Allowed values: <= 4094
Default value: 1
Since: 1.18
“vlan-filtering”
property “vlan-filtering” gboolean
Control whether VLAN filtering is enabled on the bridge.
Flags: Read / Write / Construct
Default value: FALSE
Since: 1.18
“vlans”
property “vlans” GPtrArray *
Array of bridge VLAN objects. In addition to the VLANs specified here, the bridge will also have the default-pvid VLAN configured 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)]
Flags: Read / Write
Since: 1.18