summary refs log tree commit diff
path: root/libnm-util/nm-setting-ppp.c
diff options
context:
space:
mode:
Diffstat (limited to 'libnm-util/nm-setting-ppp.c')
-rw-r--r--libnm-util/nm-setting-ppp.c230
1 files changed, 103 insertions, 127 deletions
diff --git a/libnm-util/nm-setting-ppp.c b/libnm-util/nm-setting-ppp.c
index 237af9c8..a01d3e10 100644
--- a/libnm-util/nm-setting-ppp.c
+++ b/libnm-util/nm-setting-ppp.c
@@ -1,9 +1,6 @@
 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
 
 /*
- * Dan Williams <dcbw@redhat.com>
- * Tambet Ingo <tambet@gmail.com>
- *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
@@ -19,11 +16,13 @@
  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  * Boston, MA 02110-1301 USA.
  *
- * (C) Copyright 2007 - 2013 Red Hat, Inc.
- * (C) Copyright 2007 - 2008 Novell, Inc.
+ * Copyright 2007 - 2013 Red Hat, Inc.
+ * Copyright 2007 - 2008 Novell, Inc.
  */
 
-#include <glib/gi18n.h>
+#include "config.h"
+
+#include <glib/gi18n-lib.h>
 
 #include "nm-setting-ppp.h"
 #include "nm-setting-private.h"
@@ -417,7 +416,7 @@ nm_setting_ppp_init (NMSettingPPP *setting)
 
 static void
 set_property (GObject *object, guint prop_id,
-		    const GValue *value, GParamSpec *pspec)
+              const GValue *value, GParamSpec *pspec)
 {
 	NMSettingPPPPrivate *priv = NM_SETTING_PPP_GET_PRIVATE (object);
 
@@ -484,7 +483,7 @@ set_property (GObject *object, guint prop_id,
 
 static void
 get_property (GObject *object, guint prop_id,
-		    GValue *value, GParamSpec *pspec)
+              GValue *value, GParamSpec *pspec)
 {
 	NMSettingPPP *setting = NM_SETTING_PPP (object);
 
@@ -572,14 +571,11 @@ nm_setting_ppp_class_init (NMSettingPPPClass *setting_class)
 	 **/
 	g_object_class_install_property
 		(object_class, PROP_NOAUTH,
-		 g_param_spec_boolean (NM_SETTING_PPP_NOAUTH,
-						   "NoAuth",
-						   "If TRUE, do not require the other side (usually the "
-						   "PPP server) to authenticate itself to the client.  "
-						   "If FALSE, require authentication from the remote "
-						   "side.  In almost all cases, this should be TRUE.",
-						   TRUE,
-						   G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
+		 g_param_spec_boolean (NM_SETTING_PPP_NOAUTH, "", "",
+		                       TRUE,
+		                       G_PARAM_READWRITE |
+		                       G_PARAM_CONSTRUCT |
+		                       G_PARAM_STATIC_STRINGS));
 
 	/**
 	 * NMSettingPPP:refuse-eap:
@@ -588,11 +584,11 @@ nm_setting_ppp_class_init (NMSettingPPPClass *setting_class)
 	 **/
 	g_object_class_install_property
 		(object_class, PROP_REFUSE_EAP,
-		 g_param_spec_boolean (NM_SETTING_PPP_REFUSE_EAP,
-						   "Refuse EAP",
-						   "If TRUE, the EAP authentication method will not be used.",
-						   FALSE,
-						   G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
+		 g_param_spec_boolean (NM_SETTING_PPP_REFUSE_EAP, "", "",
+		                       FALSE,
+		                       G_PARAM_READWRITE |
+		                       G_PARAM_CONSTRUCT |
+		                       G_PARAM_STATIC_STRINGS));
 
 	/**
 	 * NMSettingPPP:refuse-pap:
@@ -601,11 +597,11 @@ nm_setting_ppp_class_init (NMSettingPPPClass *setting_class)
 	 **/
 	g_object_class_install_property
 		(object_class, PROP_REFUSE_PAP,
-		 g_param_spec_boolean (NM_SETTING_PPP_REFUSE_PAP,
-						   "Refuse PAP",
-						   "If TRUE, the PAP authentication method will not be used.",
-						   FALSE,
-						   G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
+		 g_param_spec_boolean (NM_SETTING_PPP_REFUSE_PAP, "", "",
+		                       FALSE,
+		                       G_PARAM_READWRITE |
+		                       G_PARAM_CONSTRUCT |
+		                       G_PARAM_STATIC_STRINGS));
 
 	/**
 	 * NMSettingPPP:refuse-chap:
@@ -614,11 +610,11 @@ nm_setting_ppp_class_init (NMSettingPPPClass *setting_class)
 	 **/
 	g_object_class_install_property
 		(object_class, PROP_REFUSE_CHAP,
-		 g_param_spec_boolean (NM_SETTING_PPP_REFUSE_CHAP,
-						   "Refuse CHAP",
-						   "If TRUE, the CHAP authentication method will not be used.",
-						   FALSE,
-						   G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
+		 g_param_spec_boolean (NM_SETTING_PPP_REFUSE_CHAP, "", "",
+		                       FALSE,
+		                       G_PARAM_READWRITE |
+		                       G_PARAM_CONSTRUCT |
+		                       G_PARAM_STATIC_STRINGS));
 
 	/**
 	 * NMSettingPPP:refuse-mschap:
@@ -627,11 +623,11 @@ nm_setting_ppp_class_init (NMSettingPPPClass *setting_class)
 	 **/
 	g_object_class_install_property
 		(object_class, PROP_REFUSE_MSCHAP,
-		 g_param_spec_boolean (NM_SETTING_PPP_REFUSE_MSCHAP,
-						   "Refuse MSCHAP",
-						   "If TRUE, the MSCHAP authentication method will not be used.",
-						   FALSE,
-						   G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
+		 g_param_spec_boolean (NM_SETTING_PPP_REFUSE_MSCHAP, "", "",
+		                       FALSE,
+		                       G_PARAM_READWRITE |
+		                       G_PARAM_CONSTRUCT |
+		                       G_PARAM_STATIC_STRINGS));
 
 	/**
 	 * NMSettingPPP:refuse-mschapv2:
@@ -640,11 +636,11 @@ nm_setting_ppp_class_init (NMSettingPPPClass *setting_class)
 	 **/
 	g_object_class_install_property
 		(object_class, PROP_REFUSE_MSCHAPV2,
-		 g_param_spec_boolean (NM_SETTING_PPP_REFUSE_MSCHAPV2,
-						   "Refuse MSCHAPv2",
-						   "If TRUE, the MSCHAPv2 authentication method will not be used.",
-						   FALSE,
-						   G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
+		 g_param_spec_boolean (NM_SETTING_PPP_REFUSE_MSCHAPV2, "", "",
+		                       FALSE,
+		                       G_PARAM_READWRITE |
+		                       G_PARAM_CONSTRUCT |
+		                       G_PARAM_STATIC_STRINGS));
 
 	/**
 	 * NMSettingPPP:nobsdcomp:
@@ -653,11 +649,12 @@ nm_setting_ppp_class_init (NMSettingPPPClass *setting_class)
 	 **/
 	g_object_class_install_property
 		(object_class, PROP_NOBSDCOMP,
-		 g_param_spec_boolean (NM_SETTING_PPP_NOBSDCOMP,
-						   "No BSD compression",
-						   "If TRUE, BSD compression will not be requested.",
-						   FALSE,
-						   G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_FUZZY_IGNORE));
+		 g_param_spec_boolean (NM_SETTING_PPP_NOBSDCOMP, "", "",
+		                       FALSE,
+		                       G_PARAM_READWRITE |
+		                       G_PARAM_CONSTRUCT |
+		                       NM_SETTING_PARAM_FUZZY_IGNORE |
+		                       G_PARAM_STATIC_STRINGS));
 
 	/**
 	 * NMSettingPPP:nodeflate:
@@ -666,11 +663,12 @@ nm_setting_ppp_class_init (NMSettingPPPClass *setting_class)
 	 **/
 	g_object_class_install_property
 		(object_class, PROP_NODEFLATE,
-		 g_param_spec_boolean (NM_SETTING_PPP_NODEFLATE,
-						   "No deflate",
-						   "If TRUE, 'deflate' compression will not be requested.",
-						   FALSE,
-						   G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_FUZZY_IGNORE));
+		 g_param_spec_boolean (NM_SETTING_PPP_NODEFLATE, "", "",
+		                       FALSE,
+		                       G_PARAM_READWRITE |
+		                       G_PARAM_CONSTRUCT |
+		                       NM_SETTING_PARAM_FUZZY_IGNORE |
+		                       G_PARAM_STATIC_STRINGS));
 
 	/**
 	 * NMSettingPPP:no-vj-comp:
@@ -679,11 +677,12 @@ nm_setting_ppp_class_init (NMSettingPPPClass *setting_class)
 	 **/
 	g_object_class_install_property
 		(object_class, PROP_NO_VJ_COMP,
-		 g_param_spec_boolean (NM_SETTING_PPP_NO_VJ_COMP,
-						   "No VJ compression",
-						   "If TRUE, Van Jacobsen TCP header compression will not be requested.",
-						   FALSE,
-						   G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_FUZZY_IGNORE));
+		 g_param_spec_boolean (NM_SETTING_PPP_NO_VJ_COMP, "", "",
+		                       FALSE,
+		                       G_PARAM_READWRITE |
+		                       G_PARAM_CONSTRUCT |
+		                       NM_SETTING_PARAM_FUZZY_IGNORE |
+		                       G_PARAM_STATIC_STRINGS));
 
 	/**
 	 * NMSettingPPP:require-mppe:
@@ -695,15 +694,11 @@ nm_setting_ppp_class_init (NMSettingPPPClass *setting_class)
 	 **/
 	g_object_class_install_property
 		(object_class, PROP_REQUIRE_MPPE,
-		 g_param_spec_boolean (NM_SETTING_PPP_REQUIRE_MPPE,
-						   "Require MPPE",
-						   "If TRUE, MPPE (Microsoft Point-to-Point Encrpytion) "
-						   "will be required for the PPP session.  If either "
-						   "64-bit or 128-bit MPPE is not available the session "
-						   "will fail.  Note that MPPE is not used on mobile "
-						   "broadband connections.",
-						   FALSE,
-						   G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
+		 g_param_spec_boolean (NM_SETTING_PPP_REQUIRE_MPPE, "", "",
+		                       FALSE,
+		                       G_PARAM_READWRITE |
+		                       G_PARAM_CONSTRUCT |
+		                       G_PARAM_STATIC_STRINGS));
 
 	/**
 	 * NMSettingPPP:require-mppe-128:
@@ -714,15 +709,10 @@ nm_setting_ppp_class_init (NMSettingPPPClass *setting_class)
 	 **/
 	g_object_class_install_property
 		(object_class, PROP_REQUIRE_MPPE_128,
-		 g_param_spec_boolean (NM_SETTING_PPP_REQUIRE_MPPE_128,
-						   "Require MPPE 128",
-						   "If TRUE, 128-bit MPPE (Microsoft Point-to-Point "
-						   "Encrpytion) will be required for the PPP session, "
-						   "and the '" NM_SETTING_PPP_REQUIRE_MPPE "' property "
-						   "must also be set to TRUE.  If 128-bit MPPE is not "
-						   "available the session will fail.",
-						   FALSE,
-						   G_PARAM_READWRITE  | G_PARAM_CONSTRUCT));
+		 g_param_spec_boolean (NM_SETTING_PPP_REQUIRE_MPPE_128, "", "",
+		                       FALSE,
+		                       G_PARAM_READWRITE  | G_PARAM_CONSTRUCT |
+		                       G_PARAM_STATIC_STRINGS));
 
 	/**
 	 * NMSettingPPP:mppe-stateful:
@@ -732,12 +722,11 @@ nm_setting_ppp_class_init (NMSettingPPPClass *setting_class)
 	 **/
 	g_object_class_install_property
 		(object_class, PROP_MPPE_STATEFUL,
-		 g_param_spec_boolean (NM_SETTING_PPP_MPPE_STATEFUL,
-						   "MPPE stateful",
-						   "If TRUE, stateful MPPE is used.  See pppd documentation "
-						   "for more information on stateful MPPE.",
-						   FALSE,
-						   G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
+		 g_param_spec_boolean (NM_SETTING_PPP_MPPE_STATEFUL, "", "",
+		                       FALSE,
+		                       G_PARAM_READWRITE |
+		                       G_PARAM_CONSTRUCT |
+		                       G_PARAM_STATIC_STRINGS));
 
 	/**
 	 * NMSettingPPP:crtscts:
@@ -748,14 +737,11 @@ nm_setting_ppp_class_init (NMSettingPPPClass *setting_class)
 	 **/
 	g_object_class_install_property
 		(object_class, PROP_CRTSCTS,
-		 g_param_spec_boolean (NM_SETTING_PPP_CRTSCTS,
-						   "CRTSCTS",
-						   "If TRUE, specify that pppd should set the serial "
-						   "port to use hardware flow control with RTS and CTS "
-						   "signals.  This value should normally be set to "
-						   "FALSE.",
-						   FALSE,
-						   G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
+		 g_param_spec_boolean (NM_SETTING_PPP_CRTSCTS, "", "",
+		                       FALSE,
+		                       G_PARAM_READWRITE |
+		                       G_PARAM_CONSTRUCT |
+		                       G_PARAM_STATIC_STRINGS));
 
 	/**
 	 * NMSettingPPP:baud:
@@ -766,13 +752,12 @@ nm_setting_ppp_class_init (NMSettingPPPClass *setting_class)
 	 **/
 	g_object_class_install_property
 		(object_class, PROP_BAUD,
-		 g_param_spec_uint (NM_SETTING_PPP_BAUD,
-						"Baud",
-						"If non-zero, instruct pppd to set the serial port to "
-						"the specified baudrate.  This value should normally be "
-						"left as 0 to automatically choose the speed.",
-						0, G_MAXUINT32, 0,
-						G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_FUZZY_IGNORE));
+		 g_param_spec_uint (NM_SETTING_PPP_BAUD, "", "",
+		                    0, G_MAXUINT32, 0,
+		                    G_PARAM_READWRITE |
+		                    G_PARAM_CONSTRUCT |
+		                    NM_SETTING_PARAM_FUZZY_IGNORE |
+		                    G_PARAM_STATIC_STRINGS));
 
 	/**
 	 * NMSettingPPP:mru:
@@ -783,13 +768,11 @@ nm_setting_ppp_class_init (NMSettingPPPClass *setting_class)
 	 */
 	g_object_class_install_property
 		(object_class, PROP_MRU,
-		 g_param_spec_uint (NM_SETTING_PPP_MRU,
-						"MRU",
-						"If non-zero, instruct pppd to request that the peer "
-						"send packets no larger than the specified size.  If "
-						"non-zero, the MRU should be between 128 and 16384.",
-						0, 16384, 0,
-						G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
+		 g_param_spec_uint (NM_SETTING_PPP_MRU, "", "",
+		                    0, 16384, 0,
+		                    G_PARAM_READWRITE |
+		                    G_PARAM_CONSTRUCT |
+		                    G_PARAM_STATIC_STRINGS));
 
 	/**
 	 * NMSettingPPP:mtu:
@@ -799,12 +782,12 @@ nm_setting_ppp_class_init (NMSettingPPPClass *setting_class)
 	 **/
 	g_object_class_install_property
 		(object_class, PROP_MTU,
-		 g_param_spec_uint (NM_SETTING_PPP_MTU,
-						"MTU",
-						"If non-zero, instruct pppd to send packets no larger "
-						"than the specified size.",
-						0, G_MAXUINT32, 0,
-						G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_FUZZY_IGNORE));
+		 g_param_spec_uint (NM_SETTING_PPP_MTU, "", "",
+		                    0, G_MAXUINT32, 0,
+		                    G_PARAM_READWRITE |
+		                    G_PARAM_CONSTRUCT |
+		                    NM_SETTING_PARAM_FUZZY_IGNORE |
+		                    G_PARAM_STATIC_STRINGS));
 
 	/**
 	 * NMSettingPPP:lcp-echo-failure:
@@ -816,16 +799,12 @@ nm_setting_ppp_class_init (NMSettingPPPClass *setting_class)
 	 **/
 	g_object_class_install_property
 		(object_class, PROP_LCP_ECHO_FAILURE,
-		 g_param_spec_uint (NM_SETTING_PPP_LCP_ECHO_FAILURE,
-						"LCP echo failure",
-						"If non-zero, instruct pppd to presume the connection to "
-						"the peer has failed if the specified number of LCP "
-						"echo-requests go unanswered by the peer.  The "
-						"'" NM_SETTING_PPP_LCP_ECHO_INTERVAL "' property must "
-						"also be set to a non-zero value if this property is "
-						"used.",
-						0, G_MAXUINT32, 0,
-						G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_FUZZY_IGNORE));
+		 g_param_spec_uint (NM_SETTING_PPP_LCP_ECHO_FAILURE, "", "",
+		                    0, G_MAXUINT32, 0,
+		                    G_PARAM_READWRITE |
+		                    G_PARAM_CONSTRUCT |
+		                    NM_SETTING_PARAM_FUZZY_IGNORE |
+		                    G_PARAM_STATIC_STRINGS));
 
 	/**
 	 * NMSettingPPP:lcp-echo-interval:
@@ -837,13 +816,10 @@ nm_setting_ppp_class_init (NMSettingPPPClass *setting_class)
 	 **/
 	g_object_class_install_property
 		(object_class, PROP_LCP_ECHO_INTERVAL,
-		 g_param_spec_uint (NM_SETTING_PPP_LCP_ECHO_INTERVAL,
-						"LCP echo interval",
-						"If non-zero, instruct pppd to send an LCP echo-request "
-						"frame to the peer every n seconds (where n is the "
-						"specified value).  Note that some PPP peers will respond "
-						"to echo requests and some will not, and it is not "
-						"possible to autodetect this.",
-						0, G_MAXUINT32, 0,
-						G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_FUZZY_IGNORE));
+		 g_param_spec_uint (NM_SETTING_PPP_LCP_ECHO_INTERVAL, "", "",
+		                    0, G_MAXUINT32, 0,
+		                    G_PARAM_READWRITE |
+		                    G_PARAM_CONSTRUCT |
+		                    NM_SETTING_PARAM_FUZZY_IGNORE |
+		                    G_PARAM_STATIC_STRINGS));
 }