Commit c2c8bfd0 authored by Alexey Torkhov's avatar Alexey Torkhov

Adding options to toggle nopcomp and noaccomp.

parent ef63ca58
...@@ -66,6 +66,8 @@ static const char *advanced_keys[] = { ...@@ -66,6 +66,8 @@ static const char *advanced_keys[] = {
NM_L2TP_KEY_NOBSDCOMP, NM_L2TP_KEY_NOBSDCOMP,
NM_L2TP_KEY_NODEFLATE, NM_L2TP_KEY_NODEFLATE,
NM_L2TP_KEY_NO_VJ_COMP, NM_L2TP_KEY_NO_VJ_COMP,
NM_L2TP_KEY_NO_PCOMP,
NM_L2TP_KEY_USE_ACCOMP,
NM_L2TP_KEY_LCP_ECHO_FAILURE, NM_L2TP_KEY_LCP_ECHO_FAILURE,
NM_L2TP_KEY_LCP_ECHO_INTERVAL, NM_L2TP_KEY_LCP_ECHO_INTERVAL,
NULL NULL
...@@ -462,6 +464,17 @@ advanced_dialog_new (GHashTable *hash) ...@@ -462,6 +464,17 @@ advanced_dialog_new (GHashTable *hash)
if (value && !strcmp (value, "yes")) if (value && !strcmp (value, "yes"))
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), FALSE); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), FALSE);
widget = glade_xml_get_widget (xml, "ppp_usepcomp");
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), TRUE);
value = g_hash_table_lookup (hash, NM_L2TP_KEY_NO_PCOMP);
if (value && !strcmp (value, "yes"))
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), FALSE);
widget = glade_xml_get_widget (xml, "ppp_useaccomp");
value = g_hash_table_lookup (hash, NM_L2TP_KEY_USE_ACCOMP);
if (value && !strcmp (value, "yes"))
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), TRUE);
widget = glade_xml_get_widget (xml, "ppp_send_echo_packets"); widget = glade_xml_get_widget (xml, "ppp_send_echo_packets");
value = g_hash_table_lookup (hash, NM_L2TP_KEY_LCP_ECHO_INTERVAL); value = g_hash_table_lookup (hash, NM_L2TP_KEY_LCP_ECHO_INTERVAL);
if (value && strlen (value)) { if (value && strlen (value)) {
...@@ -536,6 +549,14 @@ advanced_dialog_new_hash_from_dialog (GtkWidget *dialog, GError **error) ...@@ -536,6 +549,14 @@ advanced_dialog_new_hash_from_dialog (GtkWidget *dialog, GError **error)
if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget))) if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)))
g_hash_table_insert (hash, g_strdup (NM_L2TP_KEY_NO_VJ_COMP), g_strdup ("yes")); g_hash_table_insert (hash, g_strdup (NM_L2TP_KEY_NO_VJ_COMP), g_strdup ("yes"));
widget = glade_xml_get_widget (xml, "ppp_usepcomp");
if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)))
g_hash_table_insert (hash, g_strdup (NM_L2TP_KEY_NO_PCOMP), g_strdup ("yes"));
widget = glade_xml_get_widget (xml, "ppp_useaccomp");
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)))
g_hash_table_insert (hash, g_strdup (NM_L2TP_KEY_USE_ACCOMP), g_strdup ("yes"));
widget = glade_xml_get_widget (xml, "ppp_send_echo_packets"); widget = glade_xml_get_widget (xml, "ppp_send_echo_packets");
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget))) { if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget))) {
g_hash_table_insert (hash, g_strdup (NM_L2TP_KEY_LCP_ECHO_FAILURE), g_strdup_printf ("%d", 5)); g_hash_table_insert (hash, g_strdup (NM_L2TP_KEY_LCP_ECHO_FAILURE), g_strdup_printf ("%d", 5));
......
...@@ -491,6 +491,36 @@ ...@@ -491,6 +491,36 @@
<property name="position">3</property> <property name="position">3</property>
</packing> </packing>
</child> </child>
<child>
<widget class="GtkCheckButton" id="ppp_usepcomp">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Use protocol _field compression negotiation</property>
<property name="use_underline">True</property>
<property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">4</property>
</packing>
</child>
<child>
<widget class="GtkCheckButton" id="ppp_useaccomp">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Use _Address/Control compression</property>
<property name="use_underline">True</property>
<property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">5</property>
</packing>
</child>
</widget> </widget>
</child> </child>
</widget> </widget>
......
...@@ -386,6 +386,8 @@ static ValidProperty valid_properties[] = { ...@@ -386,6 +386,8 @@ static ValidProperty valid_properties[] = {
{ NM_L2TP_KEY_NOBSDCOMP, G_TYPE_BOOLEAN, FALSE }, { NM_L2TP_KEY_NOBSDCOMP, G_TYPE_BOOLEAN, FALSE },
{ NM_L2TP_KEY_NODEFLATE, G_TYPE_BOOLEAN, FALSE }, { NM_L2TP_KEY_NODEFLATE, G_TYPE_BOOLEAN, FALSE },
{ NM_L2TP_KEY_NO_VJ_COMP, G_TYPE_BOOLEAN, FALSE }, { NM_L2TP_KEY_NO_VJ_COMP, G_TYPE_BOOLEAN, FALSE },
{ NM_L2TP_KEY_NO_PCOMP, G_TYPE_BOOLEAN, FALSE },
{ NM_L2TP_KEY_USE_ACCOMP, G_TYPE_BOOLEAN, FALSE },
{ NM_L2TP_KEY_LCP_ECHO_FAILURE, G_TYPE_UINT, FALSE }, { NM_L2TP_KEY_LCP_ECHO_FAILURE, G_TYPE_UINT, FALSE },
{ NM_L2TP_KEY_LCP_ECHO_INTERVAL, G_TYPE_UINT, FALSE }, { NM_L2TP_KEY_LCP_ECHO_INTERVAL, G_TYPE_UINT, FALSE },
{ NULL, G_TYPE_NONE, FALSE } { NULL, G_TYPE_NONE, FALSE }
...@@ -1026,6 +1028,14 @@ nm_l2tp_config_write (NML2tpPlugin *plugin, ...@@ -1026,6 +1028,14 @@ nm_l2tp_config_write (NML2tpPlugin *plugin,
if (value && !strcmp (value, "yes")) if (value && !strcmp (value, "yes"))
write_config_option (pppopt_fd, "novj\n"); write_config_option (pppopt_fd, "novj\n");
value = nm_setting_vpn_get_data_item (s_vpn, NM_L2TP_KEY_NO_PCOMP);
if (value && !strcmp (value, "yes"))
write_config_option (pppopt_fd, "nopcomp\n");
value = nm_setting_vpn_get_data_item (s_vpn, NM_L2TP_KEY_USE_ACCOMP);
if (!(value && !strcmp (value, "yes")))
write_config_option (pppopt_fd, "noaccomp\n");
value = nm_setting_vpn_get_data_item (s_vpn, NM_L2TP_KEY_LCP_ECHO_FAILURE); value = nm_setting_vpn_get_data_item (s_vpn, NM_L2TP_KEY_LCP_ECHO_FAILURE);
if (value && strlen (value)) { if (value && strlen (value)) {
long int tmp_int; long int tmp_int;
......
...@@ -63,6 +63,8 @@ ...@@ -63,6 +63,8 @@
#define NM_L2TP_KEY_NOBSDCOMP "nobsdcomp" #define NM_L2TP_KEY_NOBSDCOMP "nobsdcomp"
#define NM_L2TP_KEY_NODEFLATE "nodeflate" #define NM_L2TP_KEY_NODEFLATE "nodeflate"
#define NM_L2TP_KEY_NO_VJ_COMP "no-vj-comp" #define NM_L2TP_KEY_NO_VJ_COMP "no-vj-comp"
#define NM_L2TP_KEY_NO_PCOMP "nopcomp"
#define NM_L2TP_KEY_USE_ACCOMP "accomp"
#define NM_L2TP_KEY_LCP_ECHO_FAILURE "lcp-echo-failure" #define NM_L2TP_KEY_LCP_ECHO_FAILURE "lcp-echo-failure"
#define NM_L2TP_KEY_LCP_ECHO_INTERVAL "lcp-echo-interval" #define NM_L2TP_KEY_LCP_ECHO_INTERVAL "lcp-echo-interval"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment