/**
 * nm_setting_wired_get_refuse_mschap:
 * @setting: the #NMSettingPPP
 *
 * Returns: the #NMSettingPPP:refuse-mschap property of the setting
 **/
gboolean
nm_setting_ppp_get_refuse_mschap (NMSettingPPP *setting)
{
	g_return_val_if_fail (NM_IS_SETTING_PPP (setting), FALSE);

	return NM_SETTING_PPP_GET_PRIVATE (setting)->refuse_mschap;
}
Exemple #2
0
static gboolean
verify (NMSetting *setting, GSList *all_settings, GError **error)
{
	NMSettingPPPPrivate *priv = NM_SETTING_PPP_GET_PRIVATE (setting);

	/* FIXME: Do we even want this or can we just let pppd evaluate the options? */
	if (priv->mru > 0) {
		if (priv->mru < 128 || priv->mru > 16384) {
			g_set_error (error,
			             NM_SETTING_PPP_ERROR,
			             NM_SETTING_PPP_ERROR_INVALID_PROPERTY,
			             _("'%d' is out of valid range <128-16384>"),
			             priv->mru);
			g_prefix_error (error, "%s.%s: ", NM_SETTING_PPP_SETTING_NAME, NM_SETTING_PPP_MRU);
			return FALSE;
		}
	}

	if (priv->lcp_echo_failure > 0) {
		/* lcp_echo_interval must also be non-zero */
		if (priv->lcp_echo_interval == 0) {
			g_set_error (error,
			             NM_SETTING_PPP_ERROR,
			             NM_SETTING_PPP_ERROR_INVALID_PROPERTY,
			             _("setting this property requires non-zero '%s' property"),
			             NM_SETTING_PPP_LCP_ECHO_INTERVAL);
			g_prefix_error (error, "%s.%s: ", NM_SETTING_PPP_SETTING_NAME, NM_SETTING_PPP_LCP_ECHO_FAILURE);
			return FALSE;
		}
	}

	return TRUE;
}
/**
 * nm_setting_wired_get_noauth:
 * @setting: the #NMSettingPPP
 *
 * Returns: the #NMSettingPPP:noauth property of the setting
 **/
gboolean
nm_setting_ppp_get_noauth (NMSettingPPP *setting)
{
	g_return_val_if_fail (NM_IS_SETTING_PPP (setting), FALSE);

	return NM_SETTING_PPP_GET_PRIVATE (setting)->noauth;
}
Exemple #4
0
/**
 * nm_setting_ppp_get_mtu:
 * @setting: the #NMSettingPPP
 *
 * Returns: the #NMSettingPPP:mtu property of the setting
 **/
guint32
nm_setting_ppp_get_mtu (NMSettingPPP *setting)
{
	g_return_val_if_fail (NM_IS_SETTING_PPP (setting), 0);

	return NM_SETTING_PPP_GET_PRIVATE (setting)->mtu;
}
Exemple #5
0
/**
 * nm_setting_ppp_get_lcp_echo_interval:
 * @setting: the #NMSettingPPP
 *
 * Returns: the #NMSettingPPP:lcp-echo-interval property of the setting
 **/
guint32
nm_setting_ppp_get_lcp_echo_interval (NMSettingPPP *setting)
{
	g_return_val_if_fail (NM_IS_SETTING_PPP (setting), 0);

	return NM_SETTING_PPP_GET_PRIVATE (setting)->lcp_echo_interval;
}
Exemple #6
0
/**
 * nm_setting_ppp_get_mppe_stateful:
 * @setting: the #NMSettingPPP
 *
 * Returns: the #NMSettingPPP:mppe-stateful property of the setting
 **/
gboolean
nm_setting_ppp_get_mppe_stateful (NMSettingPPP *setting)
{
	g_return_val_if_fail (NM_IS_SETTING_PPP (setting), FALSE);

	return NM_SETTING_PPP_GET_PRIVATE (setting)->mppe_stateful;
}
Exemple #7
0
/**
 * nm_setting_ppp_get_require_mppe_128:
 * @setting: the #NMSettingPPP
 *
 * Returns: the #NMSettingPPP:require-mppe-128 property of the setting
 **/
gboolean
nm_setting_ppp_get_require_mppe_128 (NMSettingPPP *setting)
{
	g_return_val_if_fail (NM_IS_SETTING_PPP (setting), FALSE);

	return NM_SETTING_PPP_GET_PRIVATE (setting)->require_mppe_128;
}
/**
 * nm_setting_ppp_get_baud:
 * @setting: the #NMSettingPpp
 *
 * Returns: the #NMSettingPpp:baud property of the setting
 **/
guint32
nm_setting_ppp_get_baud (NMSettingPpp *setting)
{
	g_return_val_if_fail (NM_IS_SETTING_PPP (setting), 0);

	return NM_SETTING_PPP_GET_PRIVATE (setting)->baud;
}
/**
 * nm_setting_ppp_get_crtscts:
 * @setting: the #NMSettingPpp
 *
 * Returns: the #NMSettingPpp:crtscts property of the setting
 **/
gboolean
nm_setting_ppp_get_crtscts (NMSettingPpp *setting)
{
	g_return_val_if_fail (NM_IS_SETTING_PPP (setting), FALSE);

	return NM_SETTING_PPP_GET_PRIVATE (setting)->crtscts;
}
/**
 * nm_setting_ppp_get_no_vj_comp:
 * @setting: the #NMSettingPpp
 *
 * Returns: the #NMSettingPpp:no-vj-comp property of the setting
 **/
gboolean
nm_setting_ppp_get_no_vj_comp (NMSettingPpp *setting)
{
	g_return_val_if_fail (NM_IS_SETTING_PPP (setting), FALSE);

	return NM_SETTING_PPP_GET_PRIVATE (setting)->no_vj_comp;
}
static void
set_property (GObject *object, guint prop_id,
              const GValue *value, GParamSpec *pspec)
{
	NMSettingPppPrivate *priv = NM_SETTING_PPP_GET_PRIVATE (object);

	switch (prop_id) {
	case PROP_NOAUTH:
		priv->noauth = g_value_get_boolean (value);
		break;
	case PROP_REFUSE_EAP:
		priv->refuse_eap = g_value_get_boolean (value);
		break;
	case PROP_REFUSE_PAP:
		priv->refuse_pap = g_value_get_boolean (value);
		break;
	case PROP_REFUSE_CHAP:
		priv->refuse_chap = g_value_get_boolean (value);
		break;
	case PROP_REFUSE_MSCHAP:
		priv->refuse_mschap = g_value_get_boolean (value);
		break;
	case PROP_REFUSE_MSCHAPV2:
		priv->refuse_mschapv2 = g_value_get_boolean (value);
		break;
	case PROP_NOBSDCOMP:
		priv->nobsdcomp = g_value_get_boolean (value);
		break;
	case PROP_NODEFLATE:
		priv->nodeflate = g_value_get_boolean (value);
		break;
	case PROP_NO_VJ_COMP:
		priv->no_vj_comp = g_value_get_boolean (value);
		break;
	case PROP_REQUIRE_MPPE:
		priv->require_mppe = g_value_get_boolean (value);
		break;
	case PROP_REQUIRE_MPPE_128:
		priv->require_mppe_128 = g_value_get_boolean (value);
		break;
	case PROP_MPPE_STATEFUL:
		priv->mppe_stateful = g_value_get_boolean (value);
		break;
	case PROP_CRTSCTS:
		priv->crtscts = g_value_get_boolean (value);
		break;
	case PROP_BAUD:
		priv->baud = g_value_get_uint (value);
		break;
	case PROP_MRU:
		priv->mru = g_value_get_uint (value);
		break;
	case PROP_MTU:
		priv->mtu = g_value_get_uint (value);
		break;
	case PROP_LCP_ECHO_FAILURE:
		priv->lcp_echo_failure = g_value_get_uint (value);
		break;
	case PROP_LCP_ECHO_INTERVAL:
		priv->lcp_echo_interval = g_value_get_uint (value);
		break;
	default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
		break;
	}
}