Commit a99508ed authored by Dan Williams's avatar Dan Williams

2008-04-18 Dan Williams <dcbw@redhat.com>

	* libnm-util/nm-setting-ppp.c
	  libnm-util/nm-setting-ppp.h
	  src/ppp-manager/nm-ppp-manager.c
		- Add 'refuse-pap' and 'refuse-mschapv2' options



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3577 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
parent 5e3121ce
2008-04-18 Dan Williams <dcbw@redhat.com>
* libnm-util/nm-setting-ppp.c
libnm-util/nm-setting-ppp.h
src/ppp-manager/nm-ppp-manager.c
- Add 'refuse-pap' and 'refuse-mschapv2' options
2008-04-18 Dan Williams <dcbw@redhat.com>
* libnm-util/nm-setting-ppp.c
......
......@@ -8,8 +8,10 @@ enum {
PROP_0,
PROP_NOAUTH,
PROP_REFUSE_EAP,
PROP_REFUSE_PAP,
PROP_REFUSE_CHAP,
PROP_REFUSE_MSCHAP,
PROP_REFUSE_MSCHAPV2,
PROP_NOBSDCOMP,
PROP_NODEFLATE,
PROP_REQUIRE_MPPE,
......@@ -34,7 +36,14 @@ nm_setting_ppp_new (void)
static gboolean
verify (NMSetting *setting, GSList *all_settings)
{
/* NMSettingPPP *self = NM_SETTING_PPP (setting); */
NMSettingPPP *self = NM_SETTING_PPP (setting);
if (self->noauth) {
if (self->require_mppe) {
g_warning ("Option 'noauth' incompatible with 'require-mppe'");
return FALSE;
}
}
/* FIXME: Do we even want this or can we just let pppd evaluate the options? */
return TRUE;
......@@ -59,12 +68,18 @@ set_property (GObject *object, guint prop_id,
case PROP_REFUSE_EAP:
setting->refuse_eap = g_value_get_boolean (value);
break;
case PROP_REFUSE_PAP:
setting->refuse_pap = g_value_get_boolean (value);
break;
case PROP_REFUSE_CHAP:
setting->refuse_chap = g_value_get_boolean (value);
break;
case PROP_REFUSE_MSCHAP:
setting->refuse_mschap = g_value_get_boolean (value);
break;
case PROP_REFUSE_MSCHAPV2:
setting->refuse_mschapv2 = g_value_get_boolean (value);
break;
case PROP_NOBSDCOMP:
setting->nobsdcomp = g_value_get_boolean (value);
break;
......@@ -117,12 +132,18 @@ get_property (GObject *object, guint prop_id,
case PROP_REFUSE_EAP:
g_value_set_boolean (value, setting->refuse_eap);
break;
case PROP_REFUSE_PAP:
g_value_set_boolean (value, setting->refuse_pap);
break;
case PROP_REFUSE_CHAP:
g_value_set_boolean (value, setting->refuse_chap);
break;
case PROP_REFUSE_MSCHAP:
g_value_set_boolean (value, setting->refuse_mschap);
break;
case PROP_REFUSE_MSCHAPV2:
g_value_set_boolean (value, setting->refuse_mschapv2);
break;
case PROP_NOBSDCOMP:
g_value_set_boolean (value, setting->nobsdcomp);
break;
......@@ -190,6 +211,14 @@ nm_setting_ppp_class_init (NMSettingPPPClass *setting_class)
FALSE,
G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE));
g_object_class_install_property
(object_class, PROP_REFUSE_PAP,
g_param_spec_boolean (NM_SETTING_PPP_REFUSE_PAP,
"Refuse PAP",
"Refuse PAP",
FALSE,
G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE));
g_object_class_install_property
(object_class, PROP_REFUSE_CHAP,
g_param_spec_boolean (NM_SETTING_PPP_REFUSE_CHAP,
......@@ -206,6 +235,14 @@ nm_setting_ppp_class_init (NMSettingPPPClass *setting_class)
FALSE,
G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE));
g_object_class_install_property
(object_class, PROP_REFUSE_MSCHAPV2,
g_param_spec_boolean (NM_SETTING_PPP_REFUSE_MSCHAPV2,
"Refuse MSCHAPv2",
"Refuse MSCHAPv2",
FALSE,
G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE));
g_object_class_install_property
(object_class, PROP_NOBSDCOMP,
g_param_spec_boolean (NM_SETTING_PPP_NOBSDCOMP,
......
......@@ -18,8 +18,10 @@ G_BEGIN_DECLS
#define NM_SETTING_PPP_NOAUTH "noauth"
#define NM_SETTING_PPP_REFUSE_EAP "refuse-eap"
#define NM_SETTING_PPP_REFUSE_PAP "refuse-pap"
#define NM_SETTING_PPP_REFUSE_CHAP "refuse-chap"
#define NM_SETTING_PPP_REFUSE_MSCHAP "refuse-mschap"
#define NM_SETTING_PPP_REFUSE_MSCHAPV2 "refuse-mschapv2"
#define NM_SETTING_PPP_NOBSDCOMP "nobsdcomp"
#define NM_SETTING_PPP_NODEFLATE "nodeflate"
#define NM_SETTING_PPP_REQUIRE_MPPE "require-mppe"
......@@ -37,8 +39,10 @@ typedef struct {
gboolean noauth;
gboolean refuse_eap;
gboolean refuse_pap;
gboolean refuse_chap;
gboolean refuse_mschap;
gboolean refuse_mschapv2;
gboolean nobsdcomp;
gboolean nodeflate;
gboolean require_mppe;
......
......@@ -527,10 +527,14 @@ create_pppd_cmd_line (NMSettingPPP *setting,
nm_cmd_line_add_string (cmd, "noauth");
if (setting->refuse_eap)
nm_cmd_line_add_string (cmd, "refuse-eap");
if (setting->refuse_pap)
nm_cmd_line_add_string (cmd, "refuse-pap");
if (setting->refuse_chap)
nm_cmd_line_add_string (cmd, "refuse-chap");
if (setting->refuse_mschap)
nm_cmd_line_add_string (cmd, "refuse-mschap");
if (setting->refuse_mschapv2)
nm_cmd_line_add_string (cmd, "refuse-mschap-v2");
if (setting->nobsdcomp)
nm_cmd_line_add_string (cmd, "nobsdcomp");
if (setting->nodeflate)
......
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