From 4e6041355bf67ad896059081288e34f6892ae098 Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Sat, 22 Jul 2017 09:39:42 +0200 Subject: bridge: add support for group-forward-mask property https://bugzilla.redhat.com/show_bug.cgi?id=1358615 --- src/connection-editor/ce-page-bridge.ui | 35 +++++++++++++++++++++++++++++++++ src/connection-editor/page-bridge.c | 15 ++++++++++++-- 2 files changed, 48 insertions(+), 2 deletions(-) diff --git a/src/connection-editor/ce-page-bridge.ui b/src/connection-editor/ce-page-bridge.ui index 639b133b..f0d7ee44 100644 --- a/src/connection-editor/ce-page-bridge.ui +++ b/src/connection-editor/ce-page-bridge.ui @@ -32,6 +32,11 @@ 1 10 + + 65535 + 1 + 10 + @@ -463,5 +468,35 @@ 3 + + + True + False + Group _forward mask: + True + bridge_group_fwd_mask + 0 + + + 0 + 10 + + + + + True + True + True + + 0 + bridge_group_fwd_mask_adjustment + 1 + True + + + 1 + 10 + + diff --git a/src/connection-editor/page-bridge.c b/src/connection-editor/page-bridge.c index 62881bfa..0a8870a1 100644 --- a/src/connection-editor/page-bridge.c +++ b/src/connection-editor/page-bridge.c @@ -42,6 +42,7 @@ typedef struct { GtkSpinButton *forward_delay; GtkSpinButton *hello_time; GtkSpinButton *max_age; + GtkSpinButton *group_fwd_mask; } CEPageBridgePrivate; @@ -60,6 +61,7 @@ bridge_private_init (CEPageBridge *self) priv->forward_delay = GTK_SPIN_BUTTON (gtk_builder_get_object (builder, "bridge_forward_delay")); priv->hello_time = GTK_SPIN_BUTTON (gtk_builder_get_object (builder, "bridge_hello_time")); priv->max_age = GTK_SPIN_BUTTON (gtk_builder_get_object (builder, "bridge_max_age")); + priv->group_fwd_mask = GTK_SPIN_BUTTON (gtk_builder_get_object (builder, "bridge_group_fwd_mask")); priv->toplevel = GTK_WINDOW (gtk_widget_get_ancestor (GTK_WIDGET (priv->stp), GTK_TYPE_WINDOW)); @@ -98,7 +100,7 @@ populate_ui (CEPageBridge *self) NMSettingBridge *s_bridge = priv->setting; gboolean stp, mcast_snoop; int priority, forward_delay, hello_time, max_age; - int ageing_time; + int ageing_time, group_fwd_mask; /* Ageing time */ ageing_time = nm_setting_bridge_get_ageing_time (s_bridge); @@ -147,6 +149,13 @@ populate_ui (CEPageBridge *self) g_signal_connect (priv->max_age, "value-changed", G_CALLBACK (stuff_changed), self); + + /* Group forward mask */ + group_fwd_mask = nm_setting_bridge_get_group_forward_mask (s_bridge); + gtk_spin_button_set_value (priv->group_fwd_mask, (gdouble) group_fwd_mask); + g_signal_connect (priv->group_fwd_mask, "value-changed", + G_CALLBACK (stuff_changed), + self); } static void @@ -235,14 +244,16 @@ ui_to_setting (CEPageBridge *self) { CEPageBridgePrivate *priv = CE_PAGE_BRIDGE_GET_PRIVATE (self); int ageing_time, priority, forward_delay, hello_time, max_age; - gboolean stp, mcast_snoop; + gboolean stp, mcast_snoop, group_fwd_mask; ageing_time = gtk_spin_button_get_value_as_int (priv->ageing_time); + group_fwd_mask = gtk_spin_button_get_value_as_int (priv->group_fwd_mask); mcast_snoop = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->mcast_snoop)); stp = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->stp)); g_object_set (G_OBJECT (priv->setting), NM_SETTING_BRIDGE_AGEING_TIME, ageing_time, NM_SETTING_BRIDGE_MULTICAST_SNOOPING, mcast_snoop, + NM_SETTING_BRIDGE_GROUP_FORWARD_MASK, group_fwd_mask, NM_SETTING_BRIDGE_STP, stp, NULL); -- cgit v1.2.1