summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2017-07-22 09:39:42 +0200
committerBeniamino Galvani <bgalvani@redhat.com>2017-07-22 09:39:44 +0200
commit4e6041355bf67ad896059081288e34f6892ae098 (patch)
tree413baaea2591ce7301c94b00a3e746645a9283bd
parent07eb49869661db02ed134d8668fb142cc16f6fb2 (diff)
downloadnetwork-manager-applet-bg/bridge-fwd-mask-rh1358615.tar.gz
bridge: add support for group-forward-mask propertybg/bridge-fwd-mask-rh1358615
https://bugzilla.redhat.com/show_bug.cgi?id=1358615
-rw-r--r--src/connection-editor/ce-page-bridge.ui35
-rw-r--r--src/connection-editor/page-bridge.c15
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 @@
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
+ <object class="GtkAdjustment" id="bridge_group_fwd_mask_adjustment">
+ <property name="upper">65535</property>
+ <property name="step_increment">1</property>
+ <property name="page_increment">10</property>
+ </object>
<object class="GtkListStore" id="master_connections_model">
<columns>
<!-- column-name connection -->
@@ -463,5 +468,35 @@
<property name="top_attach">3</property>
</packing>
</child>
+ <child>
+ <object class="GtkLabel" id="bridge_group_fwd_mask_label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Group _forward mask:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">bridge_group_fwd_mask</property>
+ <property name="xalign">0</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">10</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSpinButton" id="bridge_group_fwd_mask">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="invisible_char">●</property>
+ <property name="text" translatable="yes">0</property>
+ <property name="adjustment">bridge_group_fwd_mask_adjustment</property>
+ <property name="climb_rate">1</property>
+ <property name="numeric">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">10</property>
+ </packing>
+ </child>
</object>
</interface>
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);