static void
nm_setting_vpn_class_init (NMSettingVPNClass *setting_class)
{
	GObjectClass *object_class = G_OBJECT_CLASS (setting_class);
	NMSettingClass *parent_class = NM_SETTING_CLASS (setting_class);

	g_type_class_add_private (setting_class, sizeof (NMSettingVPNPrivate));

	/* virtual methods */
	object_class->set_property = set_property;
	object_class->get_property = get_property;
	object_class->finalize     = finalize;

	parent_class->verify            = verify;
	parent_class->update_one_secret = update_one_secret;
	parent_class->get_secret_flags  = get_secret_flags;
	parent_class->set_secret_flags  = set_secret_flags;
	parent_class->need_secrets      = need_secrets;
	parent_class->compare_property  = compare_property;
	parent_class->clear_secrets_with_flags = clear_secrets_with_flags;

	/* Properties */
	/**
	 * NMSettingVPN:service-type:
	 *
	 * D-Bus service name of the VPN plugin that this setting uses to connect to
	 * its network.  i.e. org.freedesktop.NetworkManager.vpnc for the vpnc
	 * plugin.
	 **/
	g_object_class_install_property
		(object_class, PROP_SERVICE_TYPE,
		 g_param_spec_string (NM_SETTING_VPN_SERVICE_TYPE, "", "",
		                      NULL,
		                      G_PARAM_READWRITE |
		                      G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingVPN:user-name:
	 *
	 * If the VPN connection requires a user name for authentication, that name
	 * should be provided here.  If the connection is available to more than one
	 * user, and the VPN requires each user to supply a different name, then
	 * leave this property empty.  If this property is empty, NetworkManager
	 * will automatically supply the username of the user which requested the
	 * VPN connection.
	 **/
	g_object_class_install_property
		(object_class, PROP_USER_NAME,
		 g_param_spec_string (NM_SETTING_VPN_USER_NAME, "", "",
		                      NULL,
		                      G_PARAM_READWRITE |
		                      G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingVPN:persistent:
	 *
	 * If the VPN service supports persistence, and this property is %TRUE,
	 * the VPN will attempt to stay connected across link changes and outages,
	 * until explicitly disconnected.
	 **/
	g_object_class_install_property
		(object_class, PROP_PERSISTENT,
		 g_param_spec_boolean (NM_SETTING_VPN_PERSISTENT, "", "",
		                       FALSE,
		                       G_PARAM_READWRITE |
		                       G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingVPN:data:
	 *
	 * Dictionary of key/value pairs of VPN plugin specific data.  Both keys and
	 * values must be strings.
	 **/
	g_object_class_install_property
		(object_class, PROP_DATA,
		 _nm_param_spec_specialized (NM_SETTING_VPN_DATA, "", "",
		                             DBUS_TYPE_G_MAP_OF_STRING,
		                             G_PARAM_READWRITE |
		                             G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingVPN:secrets:
	 *
	 * Dictionary of key/value pairs of VPN plugin specific secrets like
	 * passwords or private keys.  Both keys and values must be strings.
	 **/
	g_object_class_install_property
		(object_class, PROP_SECRETS,
		 _nm_param_spec_specialized (NM_SETTING_VPN_SECRETS, "", "",
		                             DBUS_TYPE_G_MAP_OF_STRING,
		                             G_PARAM_READWRITE |
		                             NM_SETTING_PARAM_SECRET |
		                             G_PARAM_STATIC_STRINGS));
}
static void
nm_setting_ppp_class_init (NMSettingPppClass *setting_class)
{
	GObjectClass *object_class = G_OBJECT_CLASS (setting_class);
	NMSettingClass *parent_class = NM_SETTING_CLASS (setting_class);

	g_type_class_add_private (setting_class, sizeof (NMSettingPppPrivate));

	/* virtual methods */
	object_class->set_property = set_property;
	object_class->get_property = get_property;
	parent_class->verify       = verify;

	/* Properties */
	/**
	 * NMSettingPpp: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.
	 **/
	g_object_class_install_property
		(object_class, PROP_NOAUTH,
		 g_param_spec_boolean (NM_SETTING_PPP_NOAUTH, "", "",
		                       TRUE,
		                       G_PARAM_READWRITE |
		                       G_PARAM_CONSTRUCT |
		                       G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingPpp:refuse-eap:
	 *
	 * If %TRUE, the EAP authentication method will not be used.
	 **/
	g_object_class_install_property
		(object_class, PROP_REFUSE_EAP,
		 g_param_spec_boolean (NM_SETTING_PPP_REFUSE_EAP, "", "",
		                       FALSE,
		                       G_PARAM_READWRITE |
		                       G_PARAM_CONSTRUCT |
		                       G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingPpp:refuse-pap:
	 *
	 * If %TRUE, the PAP authentication method will not be used.
	 **/
	g_object_class_install_property
		(object_class, PROP_REFUSE_PAP,
		 g_param_spec_boolean (NM_SETTING_PPP_REFUSE_PAP, "", "",
		                       FALSE,
		                       G_PARAM_READWRITE |
		                       G_PARAM_CONSTRUCT |
		                       G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingPpp:refuse-chap:
	 *
	 * If %TRUE, the CHAP authentication method will not be used.
	 **/
	g_object_class_install_property
		(object_class, PROP_REFUSE_CHAP,
		 g_param_spec_boolean (NM_SETTING_PPP_REFUSE_CHAP, "", "",
		                       FALSE,
		                       G_PARAM_READWRITE |
		                       G_PARAM_CONSTRUCT |
		                       G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingPpp:refuse-mschap:
	 *
	 * If %TRUE, the MSCHAP authentication method will not be used.
	 **/
	g_object_class_install_property
		(object_class, PROP_REFUSE_MSCHAP,
		 g_param_spec_boolean (NM_SETTING_PPP_REFUSE_MSCHAP, "", "",
		                       FALSE,
		                       G_PARAM_READWRITE |
		                       G_PARAM_CONSTRUCT |
		                       G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingPpp:refuse-mschapv2:
	 *
	 * If %TRUE, the MSCHAPv2 authentication method will not be used.
	 **/
	g_object_class_install_property
		(object_class, PROP_REFUSE_MSCHAPV2,
		 g_param_spec_boolean (NM_SETTING_PPP_REFUSE_MSCHAPV2, "", "",
		                       FALSE,
		                       G_PARAM_READWRITE |
		                       G_PARAM_CONSTRUCT |
		                       G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingPpp:nobsdcomp:
	 *
	 * If %TRUE, BSD compression will not be requested.
	 **/
	g_object_class_install_property
		(object_class, PROP_NOBSDCOMP,
		 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:
	 *
	 * If %TRUE, "deflate" compression will not be requested.
	 **/
	g_object_class_install_property
		(object_class, PROP_NODEFLATE,
		 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:
	 *
	 * If %TRUE, Van Jacobsen TCP header compression will not be requested.
	 **/
	g_object_class_install_property
		(object_class, PROP_NO_VJ_COMP,
		 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:
	 *
	 * 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.
	 **/
	g_object_class_install_property
		(object_class, PROP_REQUIRE_MPPE,
		 g_param_spec_boolean (NM_SETTING_PPP_REQUIRE_MPPE, "", "",
		                       FALSE,
		                       G_PARAM_READWRITE |
		                       G_PARAM_CONSTRUCT |
		                       G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingPpp:require-mppe-128:
	 *
	 * If %TRUE, 128-bit MPPE (Microsoft Point-to-Point Encrpytion) will be
	 * required for the PPP session, and the "require-mppe" property must also
	 * be set to %TRUE.  If 128-bit MPPE is not available the session will fail.
	 **/
	g_object_class_install_property
		(object_class, PROP_REQUIRE_MPPE_128,
		 g_param_spec_boolean (NM_SETTING_PPP_REQUIRE_MPPE_128, "", "",
		                       FALSE,
		                       G_PARAM_READWRITE  | G_PARAM_CONSTRUCT |
		                       G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingPpp:mppe-stateful:
	 *
	 * If %TRUE, stateful MPPE is used.  See pppd documentation for more
	 * information on stateful MPPE.
	 **/
	g_object_class_install_property
		(object_class, PROP_MPPE_STATEFUL,
		 g_param_spec_boolean (NM_SETTING_PPP_MPPE_STATEFUL, "", "",
		                       FALSE,
		                       G_PARAM_READWRITE |
		                       G_PARAM_CONSTRUCT |
		                       G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingPpp: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.
	 **/
	g_object_class_install_property
		(object_class, PROP_CRTSCTS,
		 g_param_spec_boolean (NM_SETTING_PPP_CRTSCTS, "", "",
		                       FALSE,
		                       G_PARAM_READWRITE |
		                       G_PARAM_CONSTRUCT |
		                       G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingPpp: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.
	 **/
	g_object_class_install_property
		(object_class, PROP_BAUD,
		 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:
	 *
	 * 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.
	 */
	g_object_class_install_property
		(object_class, PROP_MRU,
		 g_param_spec_uint (NM_SETTING_PPP_MRU, "", "",
		                    0, 16384, 0,
		                    G_PARAM_READWRITE |
		                    G_PARAM_CONSTRUCT |
		                    G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingPpp:mtu:
	 *
	 * If non-zero, instruct pppd to send packets no larger than the specified
	 * size.
	 **/
	g_object_class_install_property
		(object_class, PROP_MTU,
		 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:
	 *
	 * 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 "lcp-echo-interval" property must also be set to a non-zero
	 * value if this property is used.
	 **/
	g_object_class_install_property
		(object_class, PROP_LCP_ECHO_FAILURE,
		 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:
	 *
	 * 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.
	 **/
	g_object_class_install_property
		(object_class, PROP_LCP_ECHO_INTERVAL,
		 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));
}
Exemple #3
0
static void
nm_setting_gsm_class_init (NMSettingGsmClass *setting_class)
{
	GObjectClass *object_class = G_OBJECT_CLASS (setting_class);
	NMSettingClass *parent_class = NM_SETTING_CLASS (setting_class);

	g_type_class_add_private (setting_class, sizeof (NMSettingGsmPrivate));

	/* virtual methods */
	object_class->set_property = set_property;
	object_class->get_property = get_property;
	object_class->finalize     = finalize;
	parent_class->verify       = verify;
	parent_class->need_secrets = need_secrets;

	/* Properties */

	/**
	 * NMSettingGsm:number:
	 *
	 * Number to dial when establishing a PPP data session with the GSM-based
	 * mobile broadband network.  Many modems do not require PPP for connections
	 * to the mobile network and thus this property should be left blank, which
	 * allows NetworkManager to select the appropriate settings automatically.
	 **/
	g_object_class_install_property
		(object_class, PROP_NUMBER,
		 g_param_spec_string (NM_SETTING_GSM_NUMBER,
						  "Number",
		                  "Number to dial when establishing a PPP data session "
		                  "with the GSM-based mobile broadband network.  Many "
		                  "modems do not require PPP for connections to the "
		                  "mobile network and thus this property should be left "
		                  "blank, which allows NetworkManager to select the "
		                  "appropriate settings automatically.",
						  NULL,
						  G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE));

	/**
	 * NMSettingGsm:username:
	 *
	 * The username used to authenticate with the network, if required.  Many
	 * providers do not require a username, or accept any username.  But if a
	 * username is required, it is specified here.
	 **/
	g_object_class_install_property
		(object_class, PROP_USERNAME,
		 g_param_spec_string (NM_SETTING_GSM_USERNAME,
						  "Username",
						  "Username used to authenticate with the network, if "
						  "required.  Note that many providers do not require "
						  "a username or accept any username.",
						  NULL,
						  G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE));

	/**
	 * NMSettingGsm:password:
	 *
	 * The password used to authenticate with the network, if required.  Many
	 * providers do not require a password, or accept any password.  But if a
	 * password is required, it is specified here.
	 **/
	g_object_class_install_property
		(object_class, PROP_PASSWORD,
		 g_param_spec_string (NM_SETTING_GSM_PASSWORD,
						  "Password",
						  "Password used to authenticate with the network, if "
						  "required.  Note that many providers do not require "
						  "a password or accept any password.",
						  NULL,
						  G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE | NM_SETTING_PARAM_SECRET));

	/**
	 * NMSettingGsm:password-flags:
	 *
	 * Flags indicating how to handle #NMSettingGsm:password:.
	 **/
	g_object_class_install_property (object_class, PROP_PASSWORD_FLAGS,
		 g_param_spec_uint (NM_SETTING_GSM_PASSWORD_FLAGS,
		                    "Password Flags",
		                    "Flags indicating how to handle the GSM password.",
		                    NM_SETTING_SECRET_FLAG_NONE,
		                    NM_SETTING_SECRET_FLAGS_ALL,
		                    NM_SETTING_SECRET_FLAG_NONE,
		                    G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE));

	/**
	 * NMSettingGsm:apn:
	 *
	 * The GPRS Access Point Name specifying the APN used when establishing a
	 * data session with the GSM-based network.  The APN often determines how
	 * the user will be billed for their network usage and whether the user has
	 * access to the Internet or just a provider-specific walled-garden, so it
	 * is important to use the correct APN for the user's mobile broadband plan.
	 * The APN may only be composed of the characters a-z, 0-9, ., and - per
	 * GSM 03.60 Section 14.9.
	 **/
	g_object_class_install_property
		(object_class, PROP_APN,
		 g_param_spec_string (NM_SETTING_GSM_APN,
						  "APN",
						  "The GPRS Access Point Name specifying the APN used "
						  "when establishing a data session with the GSM-based "
						  "network.  The APN often determines how the user will "
						  "be billed for their network usage and whether the "
						  "user has access to the Internet or just a provider-"
						  "specific walled-garden, so it is important to use "
						  "the correct APN for the user's mobile broadband "
						  "plan.  The APN may only be composed of the characters "
						  "a-z, 0-9, ., and - per GSM 03.60 Section 14.9.",
						  NULL,
						  G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE));

	/**
	 * NMSettingGsm:network-id:
	 *
	 * The Network ID (GSM LAI format, ie MCC-MNC) to force specific network
	 * registration.  If the Network ID is specified, NetworkManager will
	 * attempt to force the device to register only on the specified network.
	 * This can be used to ensure that the device does not roam when direct
	 * roaming control of the device is not otherwise possible.
	 **/
	g_object_class_install_property
		(object_class, PROP_NETWORK_ID,
		 g_param_spec_string (NM_SETTING_GSM_NETWORK_ID,
						  "Network ID",
						  "The Network ID (GSM LAI format, ie MCC-MNC) to force "
						  "specific network registration.  If the Network ID is "
						  "specified, NetworkManager will attempt to force the "
						  "device to register only on the specified network.  "
						  "This can be used to ensure that the device does not "
						  "roam when direct roaming control of the device is "
						  "not otherwise possible.",
						  NULL,
						  G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE));

	/**
	 * NMSettingGsm:network-type:
	 *
	 * Network preference to force the device to only use specific network
	 * technologies.  Permitted values are those specified by
	 * #NMSettingGsmNetworkType.  Note that not all devices allow network
	 * preference control.
	 *
	 * Deprecated: 0.9.10: No longer used. Network type setting should be done talking to ModemManager directly.
	 **/
	g_object_class_install_property
		(object_class, PROP_NETWORK_TYPE,
		 g_param_spec_int (NM_SETTING_GSM_NETWORK_TYPE,
		                   "Network type",
		                   "Network preference to force the device to only use "
		                   "specific network technologies.  The permitted values "
		                   "are: -1: any, 0: 3G only, 1: GPRS/EDGE only, "
		                   "2: prefer 3G, 3: prefer 2G, 4: prefer 4G/LTE, 5: 4G/LTE only. "
		                   "Notes: This property is deprecated and NetworkManager from 0.9.10 "
		                   "onwards doesn't use this property when talking to ModemManager."
		                   "Also, not all devices allow network preference control.",
		                   NM_SETTING_GSM_NETWORK_TYPE_ANY,
		                   NM_SETTING_GSM_NETWORK_TYPE_4G,
		                   NM_SETTING_GSM_NETWORK_TYPE_ANY,
		                   G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE));

	/**
	 * NMSettingGsm:allowed-bands:
	 *
	 * Bitfield of allowed frequency bands.  Note that not all devices allow
	 * frequency band control.  Permitted values are those specified by
	 * #NMSettingGsmNetworkBand.
	 *
	 * Deprecated: 0.9.10: No longer used. Band setting should be done talking to ModemManager directly.
	 **/
	g_object_class_install_property
		(object_class, PROP_ALLOWED_BANDS,
		 g_param_spec_uint (NM_SETTING_GSM_ALLOWED_BANDS,
		                    "Allowed Bands",
		                    "Bitfield of allowed frequency bands."
		                    "Notes: This property is deprecated and NetworkManager from 0.9.10 "
		                    "onwards doesn't use this property when talking to ModemManager."
		                    "Also, not all devices allow frequency band control.",
		                    NM_SETTING_GSM_BAND_UNKNOWN,
		                    NM_SETTING_GSM_BANDS_MAX,
		                    NM_SETTING_GSM_BAND_ANY,
		                    G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE));

	/**
	 * NMSettingGsm:pin:
	 *
	 * If the SIM is locked with a PIN it must be unlocked before any other
	 * operations are requested.  Specify the PIN here to allow operation of
	 * the device.
	 **/
	g_object_class_install_property
		(object_class, PROP_PIN,
		 g_param_spec_string (NM_SETTING_GSM_PIN,
						  "PIN",
						  "If the SIM is locked with a PIN it must be unlocked "
						  "before any other operations are requested.  Specify "
						  "the PIN here to allow operation of the device.",
						  NULL,
						  G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE | NM_SETTING_PARAM_SECRET));

	/**
	 * NMSettingGsm:pin-flags:
	 *
	 * Flags indicating how to handle #NMSettingGsm:pin.
	 **/
	g_object_class_install_property (object_class, PROP_PIN_FLAGS,
		 g_param_spec_uint (NM_SETTING_GSM_PIN_FLAGS,
		                    "PIN Flags",
		                    "Flags indicating how to handle the GSM SIM PIN.",
		                    NM_SETTING_SECRET_FLAG_NONE,
		                    NM_SETTING_SECRET_FLAGS_ALL,
		                    NM_SETTING_SECRET_FLAG_NONE,
		                    G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE));

	/**
	 * NMSettingGsm:home-only:
	 *
	 * When TRUE, only connections to the home network will be allowed.
	 * Connections to roaming networks will not be made.
	 **/
	g_object_class_install_property
		(object_class, PROP_HOME_ONLY,
		 g_param_spec_boolean (NM_SETTING_GSM_HOME_ONLY,
						  "Home Only",
						  "When TRUE, only connections to the home network will "
						  "be allowed.  Connections to roaming networks will "
						  "not be made.",
						  FALSE,
						  G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE));
}
static void
nm_setting_vpn_class_init (NMSettingVpnClass *setting_class)
{
	GObjectClass *object_class = G_OBJECT_CLASS (setting_class);
	NMSettingClass *parent_class = NM_SETTING_CLASS (setting_class);

	g_type_class_add_private (setting_class, sizeof (NMSettingVpnPrivate));

	/* virtual methods */
	object_class->set_property = set_property;
	object_class->get_property = get_property;
	object_class->finalize     = finalize;

	parent_class->verify            = verify;
	parent_class->update_one_secret = update_one_secret;
	parent_class->get_secret_flags  = get_secret_flags;
	parent_class->set_secret_flags  = set_secret_flags;
	parent_class->need_secrets      = need_secrets;
	parent_class->compare_property  = compare_property;
	parent_class->clear_secrets_with_flags = clear_secrets_with_flags;

	/* Properties */
	/**
	 * NMSettingVpn:service-type:
	 *
	 * D-Bus service name of the VPN plugin that this setting uses to connect to
	 * its network.  i.e. org.freedesktop.NetworkManager.vpnc for the vpnc
	 * plugin.
	 **/
	g_object_class_install_property
		(object_class, PROP_SERVICE_TYPE,
		 g_param_spec_string (NM_SETTING_VPN_SERVICE_TYPE, "", "",
		                      NULL,
		                      G_PARAM_READWRITE |
		                      G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingVpn:user-name:
	 *
	 * If the VPN connection requires a user name for authentication, that name
	 * should be provided here.  If the connection is available to more than one
	 * user, and the VPN requires each user to supply a different name, then
	 * leave this property empty.  If this property is empty, NetworkManager
	 * will automatically supply the username of the user which requested the
	 * VPN connection.
	 **/
	g_object_class_install_property
		(object_class, PROP_USER_NAME,
		 g_param_spec_string (NM_SETTING_VPN_USER_NAME, "", "",
		                      NULL,
		                      G_PARAM_READWRITE |
		                      G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingVpn:persistent:
	 *
	 * If the VPN service supports persistence, and this property is %TRUE,
	 * the VPN will attempt to stay connected across link changes and outages,
	 * until explicitly disconnected.
	 **/
	g_object_class_install_property
		(object_class, PROP_PERSISTENT,
		 g_param_spec_boolean (NM_SETTING_VPN_PERSISTENT, "", "",
		                       FALSE,
		                       G_PARAM_READWRITE |
		                       G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingVpn:data:
	 *
	 * Dictionary of key/value pairs of VPN plugin specific data.  Both keys and
	 * values must be strings.
	 *
	 * Type: GHashTable(utf8,utf8)
	 **/
	/* ---keyfile---
	 * property: data
	 * variable: separate variables named after keys of the dictionary
	 * description: The keys of the data dictionary are used as variable names directly
	 *   under [vpn] section.
	 * example: remote=ovpn.corp.com cipher=AES-256-CBC username=joe
	 * ---end---
	 */
	g_object_class_install_property
		(object_class, PROP_DATA,
		 g_param_spec_boxed (NM_SETTING_VPN_DATA, "", "",
		                     G_TYPE_HASH_TABLE,
		                     G_PARAM_READWRITE |
		                     G_PARAM_STATIC_STRINGS));
	_nm_setting_class_transform_property (parent_class, NM_SETTING_VPN_DATA,
	                                      G_VARIANT_TYPE ("a{ss}"),
	                                      _nm_utils_strdict_to_dbus,
	                                      _nm_utils_strdict_from_dbus);

	/**
	 * NMSettingVpn:secrets:
	 *
	 * Dictionary of key/value pairs of VPN plugin specific secrets like
	 * passwords or private keys.  Both keys and values must be strings.
	 *
	 * Type: GHashTable(utf8,utf8)
	 **/
	/* ---keyfile---
	 * property: secrets
	 * variable: separate variables named after keys of the dictionary
	 * description: The keys of the secrets dictionary are used as variable names directly
	 *   under [vpn-secrets] section.
	 * example: password=Popocatepetl
	 * ---end---
	 */
	g_object_class_install_property
		(object_class, PROP_SECRETS,
		 g_param_spec_boxed (NM_SETTING_VPN_SECRETS, "", "",
		                     G_TYPE_HASH_TABLE,
		                     G_PARAM_READWRITE |
		                     NM_SETTING_PARAM_SECRET |
		                     G_PARAM_STATIC_STRINGS));
	_nm_setting_class_transform_property (parent_class, NM_SETTING_VPN_SECRETS,
	                                      G_VARIANT_TYPE ("a{ss}"),
	                                      _nm_utils_strdict_to_dbus,
	                                      _nm_utils_strdict_from_dbus);

	/**
	 * NMSettingVpn:timeout:
	 *
	 * Timeout for the VPN service to establish the connection. Some services
	 * may take quite a long time to connect.
	 * Value of 0 means a default timeout, which is 60 seconds (unless overriden
	 * by vpn.timeout in configuration file). Values greater than zero mean
	 * timeout in seconds.
	 *
	 * Since: 1.2
	 **/
	g_object_class_install_property
		(object_class, PROP_TIMEOUT,
		 g_param_spec_uint (NM_SETTING_VPN_TIMEOUT, "", "",
		                    0, G_MAXUINT32, 0,
		                    G_PARAM_READWRITE |
		                    G_PARAM_STATIC_STRINGS));
}
static void
nm_setting_bridge_class_init (NMSettingBridgeClass *setting_class)
{
	GObjectClass *object_class = G_OBJECT_CLASS (setting_class);
	NMSettingClass *parent_class = NM_SETTING_CLASS (setting_class);

	g_type_class_add_private (setting_class, sizeof (NMSettingBridgePrivate));

	/* virtual methods */
	object_class->set_property = set_property;
	object_class->get_property = get_property;
	object_class->finalize     = finalize;
	parent_class->verify       = verify;
	parent_class->get_virtual_iface_name = get_virtual_iface_name;

	/* Properties */
	/**
	 * NMSettingBridge:interface-name:
	 *
	 * The name of the virtual in-kernel briding network interface
	 **/
	g_object_class_install_property
		(object_class, PROP_INTERFACE_NAME,
		 g_param_spec_string (NM_SETTING_BRIDGE_INTERFACE_NAME,
		                      "InterfaceName",
		                      "The name of the virtual in-kernel bridging network interface",
		                      NULL,
		                      G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE));

	/**
	 * NMSettingBridge:stp:
	 *
	 * Controls whether Spanning Tree Protocol (STP) is enabled for this bridge.
	 **/
	 g_object_class_install_property
		 (object_class, PROP_STP,
		  g_param_spec_boolean (NM_SETTING_BRIDGE_STP,
		                        "STP",
		                        "Controls whether Spanning Tree Protocol (STP) "
		                        "is enabled for this bridge.",
		                        TRUE,
		                        G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE));

	/**
	 * NMSettingBridge:priority:
	 *
	 * Sets the Spanning Tree Protocol (STP) priority for this bridge.  Lower
	 * values are "better"; the lowest priority bridge will be elected the root
	 * bridge.
	 **/
	 g_object_class_install_property
		 (object_class, PROP_PRIORITY,
		  g_param_spec_uint (NM_SETTING_BRIDGE_PRIORITY,
		                     "Priority",
		                     "Sets the Spanning Tree Protocol (STP) priority "
		                     "for this bridge.  Lower values are 'better'; the "
		                     "lowest priority bridge will be elected the root "
		                     "bridge.",
		                     0, G_MAXUINT16, 0x80,
		                     G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE));

	/**
	 * NMSettingBridge:forward-delay:
	 *
	 * The Spanning Tree Protocol (STP) forwarding delay, in seconds.
	 **/
	 g_object_class_install_property
		 (object_class, PROP_FORWARD_DELAY,
		  g_param_spec_uint (NM_SETTING_BRIDGE_FORWARD_DELAY,
		                     "ForwardDelay",
		                     "The Spanning Tree Protocol (STP) forwarding "
		                     "delay, in seconds.",
		                     0, BR_MAX_FORWARD_DELAY, 15,
		                     G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE));

	/**
	 * NMSettingBridge:hello-time:
	 *
	 * The Spanning Tree Protocol (STP) hello time, in seconds.
	 **/
	 g_object_class_install_property
		 (object_class, PROP_HELLO_TIME,
		  g_param_spec_uint (NM_SETTING_BRIDGE_HELLO_TIME,
		                     "HelloTime",
		                     "The Spanning Tree Protocol (STP) hello time, in "
		                     "seconds.",
		                     0, BR_MAX_HELLO_TIME, 2,
		                     G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE));

	/**
	 * NMSettingBridge:max-age:
	 *
	 * The Spanning Tree Protocol (STP) maximum message age, in seconds.
	 **/
	 g_object_class_install_property
		 (object_class, PROP_MAX_AGE,
		  g_param_spec_uint (NM_SETTING_BRIDGE_MAX_AGE,
		                     "MaxAge",
		                     "The Spanning Tree Protocol (STP) maximum message "
		                     "age, in seconds.",
		                     0, BR_MAX_MAX_AGE, 20,
		                     G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE));

	/**
	 * NMSettingBridge:ageing-time:
	 *
	 * The ethernet MAC address aging time, in seconds.
	 **/
	 g_object_class_install_property
		 (object_class, PROP_AGEING_TIME,
		  g_param_spec_uint (NM_SETTING_BRIDGE_AGEING_TIME,
		                     "AgeingTime",
		                     "The ethernet MAC address aging time, in seconds.",
		                     0, BR_MAX_AGEING_TIME, 300,
		                     G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE));
}
static void
nm_setting_wireless_class_init (NMSettingWirelessClass *setting_class)
{
	GObjectClass *object_class = G_OBJECT_CLASS (setting_class);
	NMSettingClass *parent_class = NM_SETTING_CLASS (setting_class);

	g_type_class_add_private (setting_class, sizeof (NMSettingWirelessPrivate));

	/* virtual methods */
	object_class->set_property = set_property;
	object_class->get_property = get_property;
	object_class->finalize     = finalize;
	parent_class->verify       = verify;

	/* Properties */
	/**
	 * NMSettingWireless:ssid:
	 *
	 * SSID of the Wi-Fi network. Must be specified.
	 **/
	g_object_class_install_property
		(object_class, PROP_SSID,
		 _nm_param_spec_specialized (NM_SETTING_WIRELESS_SSID, "", "",
		                             DBUS_TYPE_G_UCHAR_ARRAY,
		                             G_PARAM_READWRITE |
		                             G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingWireless:mode:
	 *
	 * Wi-Fi network mode; one of "infrastructure", "adhoc" or "ap".  If blank,
	 * infrastructure is assumed.
	 **/
	g_object_class_install_property
		(object_class, PROP_MODE,
		 g_param_spec_string (NM_SETTING_WIRELESS_MODE, "", "",
		                      NULL,
		                      G_PARAM_READWRITE |
		                      G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingWireless:band:
	 *
	 * 802.11 frequency band of the network.  One of "a" for 5GHz 802.11a or
	 * "bg" for 2.4GHz 802.11.  This will lock associations to the Wi-Fi network
	 * to the specific band, i.e. if "a" is specified, the device will not
	 * associate with the same network in the 2.4GHz band even if the network's
	 * settings are compatible.  This setting depends on specific driver
	 * capability and may not work with all drivers.
	 **/
	g_object_class_install_property
		(object_class, PROP_BAND,
		 g_param_spec_string (NM_SETTING_WIRELESS_BAND, "", "",
		                      NULL,
		                      G_PARAM_READWRITE |
		                      G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingWireless:channel:
	 *
	 * Wireless channel to use for the Wi-Fi connection.  The device will only
	 * join (or create for Ad-Hoc networks) a Wi-Fi network on the specified
	 * channel.  Because channel numbers overlap between bands, this property
	 * also requires the "band" property to be set.
	 **/
	g_object_class_install_property
		(object_class, PROP_CHANNEL,
		 g_param_spec_uint (NM_SETTING_WIRELESS_CHANNEL, "", "",
		                    0, G_MAXUINT32, 0,
		                    G_PARAM_READWRITE |
		                    G_PARAM_CONSTRUCT |
		                    G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingWireless:bssid:
	 *
	 * If specified, directs the device to only associate with the given access
	 * point.  This capability is highly driver dependent and not supported by
	 * all devices.  Note: this property does not control the BSSID used when
	 * creating an Ad-Hoc network and is unlikely to in the future.
	 **/
	g_object_class_install_property
		(object_class, PROP_BSSID,
		 _nm_param_spec_specialized (NM_SETTING_WIRELESS_BSSID, "", "",
		                             DBUS_TYPE_G_UCHAR_ARRAY,
		                             G_PARAM_READWRITE |
		                             G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingWireless:rate:
	 *
	 * If non-zero, directs the device to only use the specified bitrate for
	 * communication with the access point.  Units are in Kb/s, ie 5500 = 5.5
	 * Mbit/s.  This property is highly driver dependent and not all devices
	 * support setting a static bitrate.
	 **/
	g_object_class_install_property
		(object_class, PROP_RATE,
		 g_param_spec_uint (NM_SETTING_WIRELESS_RATE, "", "",
		                    0, G_MAXUINT32, 0,
		                    G_PARAM_READWRITE |
		                    G_PARAM_CONSTRUCT |
		                    NM_SETTING_PARAM_FUZZY_IGNORE |
		                    G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingWireless:tx-power:
	 *
	 * If non-zero, directs the device to use the specified transmit power.
	 * Units are dBm.  This property is highly driver dependent and not all
	 * devices support setting a static transmit power.
	 **/
	g_object_class_install_property
		(object_class, PROP_TX_POWER,
		 g_param_spec_uint (NM_SETTING_WIRELESS_TX_POWER, "", "",
		                    0, G_MAXUINT32, 0,
		                    G_PARAM_READWRITE |
		                    G_PARAM_CONSTRUCT |
		                    NM_SETTING_PARAM_FUZZY_IGNORE |
		                    G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingWireless:mac-address:
	 *
	 * If specified, this connection will only apply to the Wi-Fi device whose
	 * permanent MAC address matches. This property does not change the MAC
	 * address of the device (i.e. MAC spoofing).
	 **/
	g_object_class_install_property
		(object_class, PROP_MAC_ADDRESS,
		 _nm_param_spec_specialized (NM_SETTING_WIRELESS_MAC_ADDRESS, "", "",
		                             DBUS_TYPE_G_UCHAR_ARRAY,
		                             G_PARAM_READWRITE |
		                             G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingWireless:cloned-mac-address:
	 *
	 * If specified, request that the Wi-Fi device use this MAC address instead
	 * of its permanent MAC address.  This is known as MAC cloning or spoofing.
	 **/
	g_object_class_install_property
		(object_class, PROP_CLONED_MAC_ADDRESS,
		 _nm_param_spec_specialized (NM_SETTING_WIRELESS_CLONED_MAC_ADDRESS, "", "",
		                             DBUS_TYPE_G_UCHAR_ARRAY,
		                             G_PARAM_READWRITE |
		                             G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingWireless:mac-address-blacklist:
	 *
	 * A list of permanent MAC addresses of Wi-Fi devices to which this
	 * connection should never apply.  Each MAC address should be given in the
	 * standard hex-digits-and-colons notation (eg "00:11:22:33:44:55").
	 **/
	g_object_class_install_property
		(object_class, PROP_MAC_ADDRESS_BLACKLIST,
		 _nm_param_spec_specialized (NM_SETTING_WIRELESS_MAC_ADDRESS_BLACKLIST, "", "",
		                             DBUS_TYPE_G_LIST_OF_STRING,
		                             G_PARAM_READWRITE |
		                             NM_SETTING_PARAM_FUZZY_IGNORE |
		                             G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingWireless:seen-bssids:
	 *
	 * A list of BSSIDs (each BSSID formatted as a MAC address like
	 * "00:11:22:33:44:55") that have been detected as part of the Wi-Fi
	 * network.  NetworkManager internally tracks previously seen BSSIDs. The
	 * property is only meant for reading and reflects the BSSID list of
	 * NetworkManager. The changes you make to this property will not be
	 * preserved.
	 **/
	g_object_class_install_property
		(object_class, PROP_SEEN_BSSIDS,
		 _nm_param_spec_specialized (NM_SETTING_WIRELESS_SEEN_BSSIDS, "", "",
		                             DBUS_TYPE_G_LIST_OF_STRING,
		                             G_PARAM_READWRITE |
		                             NM_SETTING_PARAM_FUZZY_IGNORE |
		                             G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingWireless:mtu:
	 *
	 * If non-zero, only transmit packets of the specified size or smaller,
	 * breaking larger packets up into multiple Ethernet frames.
	 **/
	g_object_class_install_property
		(object_class, PROP_MTU,
		 g_param_spec_uint (NM_SETTING_WIRELESS_MTU, "", "",
		                    0, G_MAXUINT32, 0,
		                    G_PARAM_READWRITE |
		                    G_PARAM_CONSTRUCT |
		                    NM_SETTING_PARAM_FUZZY_IGNORE |
		                    G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingWireless:security:
	 *
	 * If the wireless connection has any security restrictions, like 802.1x,
	 * WEP, or WPA, set this property to
	 * %NM_SETTING_WIRELESS_SECURITY_SETTING_NAME and ensure the connection
	 * contains a valid #NMSettingWirelessSecurity setting.
	 *
	 * Deprecated: 0.9.10: No longer used. Security restrictions are recognized
	 * by the presence of a #NMSettingWirelessSecurity setting in the
	 * connection.
	 **/
	g_object_class_install_property
		(object_class, PROP_SEC,
		 g_param_spec_string (NM_SETTING_WIRELESS_SEC, "", "",
		                      NULL,
		                      G_PARAM_READWRITE |
		                      G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingWireless:hidden:
	 *
	 * If %TRUE, indicates this network is a non-broadcasting network that hides
	 * its SSID.  In this case various workarounds may take place, such as
	 * probe-scanning the SSID for more reliable network discovery.  However,
	 * these workarounds expose inherent insecurities with hidden SSID networks,
	 * and thus hidden SSID networks should be used with caution.
	 **/
	g_object_class_install_property
		(object_class, PROP_HIDDEN,
		 g_param_spec_boolean (NM_SETTING_WIRELESS_HIDDEN, "", "",
		                       FALSE,
		                       G_PARAM_READWRITE |
		                       G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingWireless:powersave:
	 *
	 * If set to %FALSE, Wi-Fi power saving behavior is disabled.  If set to
	 * %TRUE, Wi-Fi power saving behavior is enabled.  All other values are
	 * reserved.  Note that even though only boolean values are allowed, the
	 * property type is an unsigned integer to allow for future expansion.
	 *
	 * Since: 1.2
	 **/
	g_object_class_install_property
		(object_class, PROP_POWERSAVE,
		 g_param_spec_uint (NM_SETTING_WIRELESS_POWERSAVE, "", "",
		                    0, G_MAXUINT32, 0,
		                    G_PARAM_READWRITE |
		                    G_PARAM_STATIC_STRINGS));
}
static void
nm_setting_bridge_port_class_init (NMSettingBridgePortClass *setting_class)
{
	GObjectClass *object_class = G_OBJECT_CLASS (setting_class);
	NMSettingClass *parent_class = NM_SETTING_CLASS (setting_class);

	g_type_class_add_private (setting_class, sizeof (NMSettingBridgePortPrivate));

	/* virtual methods */
	object_class->set_property = set_property;
	object_class->get_property = get_property;
	parent_class->verify       = verify;

	/* Properties */
	/**
	 * NMSettingBridgePort:priority:
	 *
	 * The Spanning Tree Protocol (STP) priority of this bridge port.
	 *
	 * Since: 0.9.8
	 **/
	g_object_class_install_property
		(object_class, PROP_PRIORITY,
		 g_param_spec_uint (NM_SETTING_BRIDGE_PORT_PRIORITY,
		                    "Priority",
		                    "The Spanning Tree Protocol (STP) priority of this bridge port",
		                    0, BR_MAX_PORT_PRIORITY, BR_DEF_PRIORITY,
		                    G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE));

	/**
	 * NMSettingBridgePort:path-cost:
	 *
	 * The Spanning Tree Protocol (STP) port cost for destinations via this port.
	 *
	 * Since: 0.9.8
	 **/
	 g_object_class_install_property
		 (object_class, PROP_PATH_COST,
		 g_param_spec_uint (NM_SETTING_BRIDGE_PORT_PATH_COST,
		                    "Path Cost",
		                    "The Spanning Tree Protocol (STP) port cost for "
		                    "destinations via this port.",
		                    0, BR_MAX_PATH_COST, 100,
		                    G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE));

	/**
	 * NMSettingBridgePort:hairpin-mode:
	 *
	 * Enables or disabled 'hairpin mode' for the port, which allows frames to
	 * be sent back out through the port the frame was received on.
	 *
	 * Since: 0.9.8
	 **/
	 g_object_class_install_property
		 (object_class, PROP_HAIRPIN_MODE,
		 g_param_spec_boolean (NM_SETTING_BRIDGE_PORT_HAIRPIN_MODE,
		                       "Hairpin Mode",
		                       "Enables or disabled 'hairpin mode' for the "
		                       "port, which allows frames to be sent back out "
		                       "through the port the frame was received on.",
		                       FALSE,
		                       G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE));

}
static void
nm_setting_ip_tunnel_class_init (NMSettingIPTunnelClass *setting_class)
{
	GObjectClass *object_class = G_OBJECT_CLASS (setting_class);
	NMSettingClass *parent_class = NM_SETTING_CLASS (setting_class);

	g_type_class_add_private (setting_class, sizeof (NMSettingIPTunnelPrivate));

	/* virtual methods */
	object_class->set_property = set_property;
	object_class->get_property = get_property;
	object_class->finalize     = finalize;
	parent_class->verify       = verify;

	/**
	 * NMSettingIPTunnel:parent:
	 *
	 * If given, specifies the parent interface name or parent connection UUID
	 * the new device will be bound to so that tunneled packets will only be
	 * routed via that interface.
	 *
	 * Since: 1.2
	 **/
	g_object_class_install_property
		(object_class, PROP_PARENT,
		 g_param_spec_string (NM_SETTING_IP_TUNNEL_PARENT, "", "",
		                      NULL,
		                      G_PARAM_READWRITE |
		                      NM_SETTING_PARAM_INFERRABLE |
		                      G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingIPTunnel:mode:
	 *
	 * The tunneling mode, for example %NM_IP_TUNNEL_MODE_IPIP or
	 * %NM_IP_TUNNEL_MODE_GRE.
	 *
	 * Since: 1.2
	 **/
	g_object_class_install_property
		(object_class, PROP_MODE,
		 g_param_spec_uint (NM_SETTING_IP_TUNNEL_MODE, "", "",
		                    0, G_MAXUINT, 0,
		                    G_PARAM_READWRITE |
		                    NM_SETTING_PARAM_INFERRABLE |
		                    G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingIPTunnel:local:
	 *
	 * The local endpoint of the tunnel; the value can be empty, otherwise it
	 * must contain an IPv4 or IPv6 address.
	 *
	 * Since: 1.2
	 **/
	g_object_class_install_property
		(object_class, PROP_LOCAL,
		 g_param_spec_string (NM_SETTING_IP_TUNNEL_LOCAL, "", "",
		                      NULL,
		                      G_PARAM_READWRITE |
		                      NM_SETTING_PARAM_INFERRABLE |
		                      G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingIPTunnel:remote:
	 *
	 * The remote endpoint of the tunnel; the value must contain an IPv4 or IPv6
	 * address.
	 *
	 * Since: 1.2
	 **/
	g_object_class_install_property
		(object_class, PROP_REMOTE,
		 g_param_spec_string (NM_SETTING_IP_TUNNEL_REMOTE, "", "",
		                      NULL,
		                      G_PARAM_READWRITE |
		                      NM_SETTING_PARAM_INFERRABLE |
		                      G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingIPTunnel:ttl
	 *
	 * The TTL to assign to tunneled packets. 0 is a special value meaning that
	 * packets inherit the TTL value.
	 *
	 * Since: 1.2
	 **/
	g_object_class_install_property
		(object_class, PROP_TTL,
		 g_param_spec_uint (NM_SETTING_IP_TUNNEL_TTL, "", "",
		                    0, 255, 0,
		                    G_PARAM_READWRITE |
		                    G_PARAM_CONSTRUCT |
		                    NM_SETTING_PARAM_INFERRABLE |
		                    G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingIPTunnel:tos
	 *
	 * The type of service (IPv4) or traffic class (IPv6) field to be set on
	 * tunneled packets.
	 *
	 * Since: 1.2
	 **/
	g_object_class_install_property
		(object_class, PROP_TOS,
		 g_param_spec_uint (NM_SETTING_IP_TUNNEL_TOS, "", "",
		                    0, 255, 0,
		                    G_PARAM_READWRITE |
		                    G_PARAM_CONSTRUCT |
		                    NM_SETTING_PARAM_INFERRABLE |
		                    G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingIPTunnel:path-mtu-discovery
	 *
	 * Whether to enable Path MTU Discovery on this tunnel.
	 *
	 * Since: 1.2
	 **/
	g_object_class_install_property
		(object_class, PROP_PATH_MTU_DISCOVERY,
		 g_param_spec_boolean (NM_SETTING_IP_TUNNEL_PATH_MTU_DISCOVERY, "", "",
		                       TRUE,
		                       G_PARAM_READWRITE |
		                       G_PARAM_CONSTRUCT |
		                       NM_SETTING_PARAM_INFERRABLE |
		                       G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingIPTunnel:input-key:
	 *
	 * The key used for tunnel input packets; the property is valid only for
	 * certain tunnel modes (GRE, IP6GRE). If empty, no key is used.
	 *
	 * Since: 1.2
	 **/
	g_object_class_install_property
		(object_class, PROP_INPUT_KEY,
		 g_param_spec_string (NM_SETTING_IP_TUNNEL_INPUT_KEY, "", "",
		                      NULL,
		                      G_PARAM_READWRITE |
		                      NM_SETTING_PARAM_INFERRABLE |
		                      G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingIPTunnel:output-key:
	 *
	 * The key used for tunnel output packets; the property is valid only for
	 * certain tunnel modes (GRE, IP6GRE). If empty, no key is used.
	 *
	 * Since: 1.2
	 **/
	g_object_class_install_property
		(object_class, PROP_OUTPUT_KEY,
		 g_param_spec_string (NM_SETTING_IP_TUNNEL_OUTPUT_KEY, "", "",
		                      NULL,
		                      G_PARAM_READWRITE |
		                      NM_SETTING_PARAM_INFERRABLE |
		                      G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingIPTunnel:encapsulation-limit:
	 *
	 * How many additional levels of encapsulation are permitted to be prepended
	 * to packets. This property applies only to IPv6 tunnels.
	 *
	 * Since: 1.2
	 **/
	g_object_class_install_property
		(object_class, PROP_ENCAPSULATION_LIMIT,
		 g_param_spec_uint (NM_SETTING_IP_TUNNEL_ENCAPSULATION_LIMIT, "", "",
		                    0, 255, 0,
		                    G_PARAM_READWRITE |
		                    G_PARAM_CONSTRUCT |
		                    NM_SETTING_PARAM_INFERRABLE |
		                    G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingIPTunnel:flow-label:
	 *
	 * The flow label to assign to tunnel packets. This property applies only to
	 * IPv6 tunnels.
	 *
	 * Since: 1.2
	 **/
	g_object_class_install_property
		(object_class, PROP_FLOW_LABEL,
		 g_param_spec_uint (NM_SETTING_IP_TUNNEL_FLOW_LABEL, "", "",
		                    0, (1 << 20) - 1, 0,
		                    G_PARAM_READWRITE |
		                    G_PARAM_CONSTRUCT |
		                    NM_SETTING_PARAM_INFERRABLE |
		                    G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingIPTunel:mtu:
	 *
	 * If non-zero, only transmit packets of the specified size or smaller,
	 * breaking larger packets up into multiple fragments.
	 *
	 * Since: 1.2
	 **/
	g_object_class_install_property
		(object_class, PROP_MTU,
		 g_param_spec_uint (NM_SETTING_IP_TUNNEL_MTU, "", "",
		                    0, G_MAXUINT, 0,
		                    G_PARAM_READWRITE |
		                    G_PARAM_CONSTRUCT |
		                    NM_SETTING_PARAM_FUZZY_IGNORE |
		                    G_PARAM_STATIC_STRINGS));
}
static void
nm_setting_vlan_class_init (NMSettingVlanClass *setting_class)
{
	GObjectClass *object_class = G_OBJECT_CLASS (setting_class);
	NMSettingClass *parent_class = NM_SETTING_CLASS (setting_class);

	g_type_class_add_private (setting_class, sizeof (NMSettingVlanPrivate));

	/* virtual methods */
	object_class->set_property = set_property;
	object_class->get_property = get_property;
	object_class->finalize     = finalize;
	parent_class->verify       = verify;
	parent_class->get_virtual_iface_name = get_virtual_iface_name;

	/* Properties */

	/**
	 * NMSettingVlan:interface-name:
	 *
	 * If given, specifies the kernel name of the VLAN interface. If not given,
	 * a default name will be constructed from the interface described by the
	 * parent interface and the #NMSettingVlan:id , ex 'eth2.1'. The parent
	 * interface may be given by the #NMSettingVlan:parent property or by a
	 * hardware address property, eg #NMSettingWired:mac-address or
	 * #NMSettingInfiniband:mac-address.
	 **/
	g_object_class_install_property
		(object_class, PROP_IFACE_NAME,
		g_param_spec_string (NM_SETTING_VLAN_INTERFACE_NAME,
		                     "InterfaceName",
		                     "If given, specifies the kernel name of the VLAN "
		                     "interface. If not given, a default name will be "
		                     "constructed from the interface described by the "
		                     "parent interface and the 'id' property, ex "
		                     "'eth2.1'. The parent interface may be given by "
		                     "the 'parent' property or by a hardware address "
		                     "property, eg the 'wired' or 'infiniband' "
		                     "settings' 'mac-address' property.",
		                     NULL,
		                     G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE));

	/**
	 * NMSettingVlan:parent:
	 *
	 * If given, specifies the parent interface name or parent connection UUID
	 * from which this VLAN interface should be created.  If this property is
	 * not specified, the connection must contain a hardware address in a
	 * hardware-specific setting, like #NMSettingWired:mac-address or
	 * #NMSettingInfiniband:mac-address.
	 **/
	g_object_class_install_property
		(object_class, PROP_PARENT,
		g_param_spec_string (NM_SETTING_VLAN_PARENT,
		                     "Parent",
		                     "If given, specifies the parent interface name or "
		                     "parent connection UUID from which this VLAN "
		                     "interface should be created.  If this property is "
		                     "not specified, the connection must contain a "
		                     "hardware address in a hardware-specific setting, "
		                     "like the 'wired' or 'infiniband' settings' "
		                     "'mac-address' property.",
		                     NULL,
		                     G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE));

	/**
	 * NMSettingVlan:id:
	 *
	 * The VLAN identifier the interface created by this connection should be
	 * assigned.
	 **/
	g_object_class_install_property
		(object_class, PROP_ID,
		 g_param_spec_uint (NM_SETTING_VLAN_ID,
		                    "VLAN ID",
		                    "The VLAN indentifier the interface created by "
		                    "this connection should be assigned.",
		                    0, 4095, 0,
		                    G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE));

	/**
	 * NMSettingVlan:flags:
	 *
	 * One or more of %NMVlanFlags which control the behavior and features of
	 * the VLAN interface.
	 **/
	g_object_class_install_property
		(object_class, PROP_FLAGS,
		 g_param_spec_uint (NM_SETTING_VLAN_FLAGS,
		                    "VLAN flags",
		                    "One or more flags which control the behavior and "
		                    "features of the VLAN interface.  Flags include "
		                    "reordering of output packet headers (0x01), use "
		                    "of the GVRP protocol (0x02), and loose binding "
		                    "of the interface to its master device's operating "
		                    "state (0x04).",
		                    0, G_MAXUINT32, 0,
		                    G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE));

	/**
	 * NMSettingVlan:ingress-priority-map:
	 *
	 * For incoming packets, a list of mappings from 802.1p priorities to Linux
	 * SKB priorities.  The mapping is given in the format 'from:to' where both
	 * 'from' and 'to' are unsigned integers, ie '7:3'.
	 **/
	g_object_class_install_property
		(object_class, PROP_INGRESS_PRIORITY_MAP,
		_nm_param_spec_specialized (NM_SETTING_VLAN_INGRESS_PRIORITY_MAP,
		                            "VLAN ingress priority mapping",
		                            "For incoming packets, a list of mappings "
		                            "from 802.1p priorities to Linux SKB "
		                            "priorities.  The mapping is given in the "
		                            "format 'from:to' where both 'from' and "
		                            "'to' are unsigned integers, ie '7:3'.",
		                            DBUS_TYPE_G_LIST_OF_STRING,
		                            G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE));

	/**
	 * NMSettingVlan:egress-priority-map:
	 *
	 * For outgoing packets, a list of mappings from Linux SKB priorities to
	 * 802.1p priorities.  The mapping is given in the format 'from:to'
	 * where both 'from' and 'to' are unsigned integers, ie '7:3'.
	 **/
	g_object_class_install_property
		(object_class, PROP_EGRESS_PRIORITY_MAP,
		_nm_param_spec_specialized (NM_SETTING_VLAN_EGRESS_PRIORITY_MAP,
		                            "VLAN egress priority mapping",
		                            "For outgoing packets, a list of mappings "
		                            "from Linux SKB priorities to 802.1p "
		                            "priorities.  The mapping is given in the "
		                            "format 'from:to' where both 'from' and "
		                            "'to' are unsigned integers, ie '7:3'.",
		                            DBUS_TYPE_G_LIST_OF_STRING,
		                            G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE));
}
static void
nm_setting_connection_class_init (NMSettingConnectionClass *setting_class)
{
	GObjectClass *object_class = G_OBJECT_CLASS (setting_class);
	NMSettingClass *parent_class = NM_SETTING_CLASS (setting_class);

	g_type_class_add_private (setting_class, sizeof (NMSettingConnectionPrivate));

	/* virtual methods */
	object_class->set_property = set_property;
	object_class->get_property = get_property;
	object_class->finalize     = finalize;
	parent_class->verify       = verify;
	parent_class->compare_property = compare_property;

	/* Properties */

	/**
	 * NMSettingConnection:id:
	 *
	 * A human readable unique idenfier for the connection, like "Work WiFi" or
	 * "T-Mobile 3G".
	 **/
	g_object_class_install_property
		(object_class, PROP_ID,
		 g_param_spec_string (NM_SETTING_CONNECTION_ID,
						  "ID",
						  "User-readable connection identifier/name.  Must be "
						  "one or more characters and may change over the lifetime "
						  "of the connection if the user decides to rename it.",
						  NULL,
						  G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE | NM_SETTING_PARAM_FUZZY_IGNORE));

	/**
	 * NMSettingConnection:uuid:
	 *
	 * A universally unique idenfier for the connection, for example generated
	 * with libuuid.  Should be assigned when the connection is created, and
	 * never changed as long as the connection still applies to the same
	 * network.  For example, should not be changed when the
	 * #NMSettingConnection:id or #NMSettingIP4Config changes, but might need
	 * to be re-created when the WiFi SSID, mobile broadband network provider,
	 * or #NMSettingConnection:type changes.
	 *
	 * The UUID must be in the format '2815492f-7e56-435e-b2e9-246bd7cdc664'
	 * (ie, contains only hexadecimal characters and '-').  A suitable UUID may
	 * be generated by nm_utils_uuid_generate() or
	 * nm_utils_uuid_generate_from_string().
	 **/
	g_object_class_install_property
		(object_class, PROP_UUID,
		 g_param_spec_string (NM_SETTING_CONNECTION_UUID,
						  "UUID",
						  "Universally unique connection identifier.  Must be "
						  "in the format '2815492f-7e56-435e-b2e9-246bd7cdc664' "
						  "(ie, contains only hexadecimal characters and '-'). "
						  "The UUID should be assigned when the connection is "
						  "created and never changed as long as the connection "
						  "still applies to the same network.  For example, "
						  "it should not be changed when the user changes the "
						  "connection's 'id', but should be recreated when the "
						  "WiFi SSID, mobile broadband network provider, or the "
						  "connection type changes.",
						  NULL,
						  G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE | NM_SETTING_PARAM_FUZZY_IGNORE));

	/**
	 * NMSettingConnection:type:
	 *
	 * The general hardware type of the device used for the network connection,
	 * contains the name of the #NMSetting object that describes that hardware
	 * type's parameters.  For example, for WiFi devices, the name of the
	 * #NMSettingWireless setting.
	 **/
	g_object_class_install_property
		(object_class, PROP_TYPE,
		 g_param_spec_string (NM_SETTING_CONNECTION_TYPE,
						  "Type",
						  "Base type of the connection.  For hardware-dependent "
						  "connections, should contain the setting name of the "
						  "hardware-type specific setting (ie, '802-3-ethernet' "
						  "or '802-11-wireless' or 'bluetooth', etc), and for "
						  "non-hardware dependent connections like VPN or "
						  "otherwise, should contain the setting name of that "
						  "setting type (ie, 'vpn' or 'bridge', etc).",
						  NULL,
						  G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE));

	/**
	 * NMSettingConnection:permissions:
	 * 
	 * An array of strings defining what access a given user has to this
	 * connection.  If this is NULL or empty, all users are allowed to access
	 * this connection.  Otherwise a user is allowed to access this connection
	 * if and only if they are in this list. Each entry is of the form
	 * "[type]:[id]:[reserved]", for example:
	 *
	 *    user:dcbw:blah
	 *
	 * At this time only the 'user' [type] is allowed.  Any other values are
	 * ignored and reserved for future use.  [id] is the username that this
	 * permission refers to, which may not contain the ':' character. Any
	 * [reserved] information present must be ignored and is reserved for
	 * future use.  All of [type], [id], and [reserved] must be valid UTF-8.
	 */
	g_object_class_install_property
		(object_class, PROP_PERMISSIONS,
		 _nm_param_spec_specialized (NM_SETTING_CONNECTION_PERMISSIONS,
		                  "Permissions",
		                  "An array of strings defining what access a given "
		                  "user has to this connection.  If this is NULL or "
		                  "empty, all users are allowed to access this "
		                  "connection.  Otherwise a user is allowed to access "
		                  "this connection if and only if they are in this "
		                  "array. Each entry is of the form "
		                  "\"[type]:[id]:[reserved]\", for example: "
		                  "\"user:dcbw:blah\"  At this time only the 'user' "
		                  "[type] is allowed.  Any other values are ignored and "
		                  "reserved for future use.  [id] is the username that "
		                  "this permission refers to, which may not contain the "
		                  "':' character.  Any [reserved] information (if "
		                  "present) must be ignored and is reserved for future "
		                  "use.  All of [type], [id], and [reserved] must be "
		                  "valid UTF-8.",
		                  DBUS_TYPE_G_LIST_OF_STRING,
		                  G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE));

	/**
	 * NMSettingConnection:autoconnect:
	 *
	 * Whether or not the connection should be automatically connected by
	 * NetworkManager when the resources for the connection are available.
	 * %TRUE to automatically activate the connection, %FALSE to require manual
	 * intervention to activate the connection.  Defaults to %TRUE.
	 **/
	g_object_class_install_property
		(object_class, PROP_AUTOCONNECT,
		 g_param_spec_boolean (NM_SETTING_CONNECTION_AUTOCONNECT,
						   "Autoconnect",
						   "If TRUE, NetworkManager will activate this connection "
						   "when its network resources are available.  If FALSE, "
						   "the connection must be manually activated by the user "
						   "or some other mechanism.",
						   TRUE,
						   G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE | NM_SETTING_PARAM_FUZZY_IGNORE));

	/**
	 * NMSettingConnection:timestamp:
	 *
	 * The time, in seconds since the Unix Epoch, that the connection was last
	 * _successfully_ fully activated.
	 **/
	g_object_class_install_property
		(object_class, PROP_TIMESTAMP,
		 g_param_spec_uint64 (NM_SETTING_CONNECTION_TIMESTAMP,
						  "Timestamp",
						  "Timestamp (in seconds since the Unix Epoch) that the "
						  "connection was last successfully activated.  Settings "
						  "services should update the connection timestamp "
						  "periodically when the connection is active to ensure "
						  "that an active connection has the latest timestamp.",
						  0, G_MAXUINT64, 0,
						  G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE | NM_SETTING_PARAM_FUZZY_IGNORE));

	/**
	 * NMSettingConnection:read-only:
	 *
	 * %TRUE if the connection can be modified using the providing settings
	 * service's D-Bus interface with the right privileges, or %FALSE
	 * if the connection is read-only and cannot be modified.
	 **/
	g_object_class_install_property
	    (object_class, PROP_READ_ONLY,
	     g_param_spec_boolean (NM_SETTING_CONNECTION_READ_ONLY,
	                      "Read-Only",
	                      "If TRUE, the connection is read-only and cannot be "
	                      "changed by the user or any other mechanism.  This is "
	                      "normally set for system connections whose plugin "
	                      "cannot yet write updated connections back out.",
	                      FALSE,
	                      G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE | NM_SETTING_PARAM_FUZZY_IGNORE));

	/**
	 * NMSettingConnection:zone:
	 *
	 * The trust level of a the connection.
	 * Free form case-insensitive string (for example "Home", "Work", "Public").
	 * NULL or unspecified zone means the connection will be placed in the
	 * default zone as defined by the firewall.
	 **/
	g_object_class_install_property
		(object_class, PROP_ZONE,
		 g_param_spec_string (NM_SETTING_CONNECTION_ZONE,
						  "Zone",
						  "The trust level of a the connection."
						  "Free form case-insensitive string (for example "
						  "\"Home\", \"Work\", \"Public\").  NULL or "
						  "unspecified zone means the connection will be "
						  "placed in the default zone as defined by the "
						  "firewall.",
						  NULL,
						  G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE | NM_SETTING_PARAM_FUZZY_IGNORE));

	/**
	 * NMSettingConnection:master:
	 *
	 * Interface name of the master device or UUID of the master connection.
	 **/
	g_object_class_install_property
		(object_class, PROP_MASTER,
		 g_param_spec_string (NM_SETTING_CONNECTION_MASTER,
		                      "Master",
		                      "Interface name of the master device or UUID of "
		                      "the master connection",
		                      NULL,
		                      G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE | NM_SETTING_PARAM_FUZZY_IGNORE));

	/**
	 * NMSettingConnection:slave-type:
	 *
	 * Setting name describing the type of slave device (ie
	 * #NM_SETTING_BOND_SETTING_NAME) or NULL if this connection is not a slave.
	 **/
	g_object_class_install_property
		(object_class, PROP_SLAVE_TYPE,
		 g_param_spec_string (NM_SETTING_CONNECTION_SLAVE_TYPE,
		                      "Slave-Type",
		                      "Setting name describing the type of slave "
		                      "this connection is (ie, 'bond') or NULL if this "
		                      "connection is not a slave.",
		                      NULL,
		                      G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE | NM_SETTING_PARAM_FUZZY_IGNORE));

	/**
	 * NMSettingConnection:secondaries:
	 *
	 * List of connection UUIDs that should be activated when the base connection
	 * itself is activated.
	 **/
	g_object_class_install_property
		(object_class, PROP_SECONDARIES,
		 _nm_param_spec_specialized (NM_SETTING_CONNECTION_SECONDARIES,
		                             "Secondaries",
		                             "List of connection UUIDs that should be activated "
		                             "when the base connection itself is activated.",
		                             DBUS_TYPE_G_LIST_OF_STRING,
		                             G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE | NM_SETTING_PARAM_FUZZY_IGNORE));
}
Exemple #11
0
static void
nm_setting_serial_class_init (NMSettingSerialClass *setting_class)
{
	GObjectClass *object_class = G_OBJECT_CLASS (setting_class);
	NMSettingClass *parent_class = NM_SETTING_CLASS (setting_class);

	g_type_class_add_private (setting_class, sizeof (NMSettingSerialPrivate));

	/* virtual methods */
	object_class->set_property = set_property;
	object_class->get_property = get_property;
	parent_class->verify       = verify;

	/* Properties */

	/**
	 * NMSettingSerial:baud:
	 *
	 * Speed to use for communication over the serial port.  Note that this value
	 * usually has no effect for mobile broadband modems as they generally
	 * ignore speed settings and use the highest available speed.
	 **/
	g_object_class_install_property
		(object_class, PROP_BAUD,
		 g_param_spec_uint (NM_SETTING_SERIAL_BAUD,
						"Baud",
						"Speed to use for communication over the serial port.  "
						"Note that this value usually has no effect for mobile "
						"broadband modems as they generally ignore speed "
						"settings and use the highest available speed.",
						0, G_MAXUINT, 57600,
						G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE));

	/**
	 * NMSettingSerial:bits:
	 *
	 * Byte-width of the serial communication.
	 **/
	g_object_class_install_property
		(object_class, PROP_BITS,
		 g_param_spec_uint (NM_SETTING_SERIAL_BITS,
						"Bits",
						"Byte-width of the serial communication.  The 8 in "
						"'8n1' for example.",
						5, 8, 8,
						G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE));

	/**
	 * NMSettingSerial:parity:
	 *
	 * Parity setting of the serial port.  Either 'E' for even parity, 'o' for
	 * odd parity, or 'n' for no parity.
	 **/
	g_object_class_install_property
		(object_class, PROP_PARITY,
		 g_param_spec_char (NM_SETTING_SERIAL_PARITY,
						"Parity",
						"Parity setting of the serial port.  Either 'E' for even "
						"parity, 'o' for odd parity, or 'n' for no parity.",
						'E', 'o', 'n',
						G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE));

	/**
	 * NMSettingSerial:stopbits:
	 *
	 * Number of stop bits for communication on the serial port.  Either 1 or 2.
	 * The 1 in '8n1' for example.
	 **/
	g_object_class_install_property
		(object_class, PROP_STOPBITS,
		 g_param_spec_uint (NM_SETTING_SERIAL_STOPBITS,
						"Stopbits",
						"Number of stop bits for communication on the serial "
						"port.  Either 1 or 2.  The 1 in '8n1' for example.",
						1, 2, 1,
						G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE));

	/**
	 * NMSettingSerial:send-delay:
	 *
	 * Time to delay between each byte sent to the modem, in microseconds.
	 **/
	g_object_class_install_property
		(object_class, PROP_SEND_DELAY,
		 g_param_spec_uint64 (NM_SETTING_SERIAL_SEND_DELAY,
						  "SendDelay",
						  "Time to delay between each byte sent to the modem, "
						  "in microseconds.",
						  0, G_MAXUINT64, 0,
						  G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE));
}
static void
nm_setting_ip6_config_class_init (NMSettingIP6ConfigClass *ip6_class)
{
	GObjectClass *object_class = G_OBJECT_CLASS (ip6_class);
	NMSettingClass *setting_class = NM_SETTING_CLASS (ip6_class);

	g_type_class_add_private (ip6_class, sizeof (NMSettingIP6ConfigPrivate));

	/* virtual methods */
	object_class->set_property = set_property;
	object_class->get_property = get_property;
	setting_class->verify = verify;

	/* Properties */

	/* ---ifcfg-rh---
	 * property: method
	 * variable: IPV6INIT, IPV6FORWARDING, IPV6_AUTOCONF, DHCPV6C
	 * default:  IPV6INIT=yes; IPV6FORWARDING=no; IPV6_AUTOCONF=!IPV6FORWARDING, DHCPV6=no
	 * description: Method used for IPv6 protocol configuration.
	 *   ignore ~ IPV6INIT=no; auto ~ IPV6_AUTOCONF=yes; dhcp ~ IPV6_AUTOCONF=no and DHCPV6C=yes
	 * ---end---
	 */

	/* ---keyfile---
	 * property: dns
	 * format: list of DNS IP addresses
	 * description: List of DNS servers.
	 * example: dns=2001:4860:4860::8888;2001:4860:4860::8844;
	 * ---end---
	 * ---ifcfg-rh---
	 * property: dns
	 * variable: DNS1, DNS2, ...
	 * format:   string
	 * description: List of DNS servers. NetworkManager uses the variables both
	 *   for IPv4 and IPv6.
	 * ---end---
	 */

	/* ---ifcfg-rh---
	 * property: dns-search
	 * variable: DOMAIN
	 * format:   string (space-separated domains)
	 * description: List of DNS search domains.
	 * ---end---
	 */

	/* ---keyfile---
	 * property: addresses
	 * variable: address1, address2, ...
	 * format: address/plen
	 * description: List of static IP addresses.
	 * example: address1=abbe::cafe/96 address2=2001::1234
	 * ---end---
	 * ---ifcfg-rh---
	 * property: addresses
	 * variable: IPV6ADDR, IPV6ADDR_SECONDARIES
	 * description: List of static IP addresses.
	 * example: IPV6ADDR=ab12:9876::1
	 *   IPV6ADDR_SECONDARIES="ab12:9876::2 ab12:9876::3"
	 * ---end---
	 */

	/* ---keyfile---
	 * property: gateway
	 * variable: gateway
	 * format: string
	 * description: Gateway IP addresses as a string.
	 * example: gateway=abbe::1
	 * ---end---
	 * ---ifcfg-rh---
	 * property: gateway
	 * variable: IPV6_DEFAULTGW
	 * description: Gateway IP address.
	 * example: IPV6_DEFAULTGW=abbe::1
	 * ---end---
	 */

	/* ---keyfile---
	 * property: routes
	 * variable: route1, route2, ...
	 * format: route/plen[,gateway,metric]
	 * description: List of IP routes.
	 * example: route1=2001:4860:4860::/64,2620:52:0:2219:222:68ff:fe11:5403
	 * ---end---
	 * ---ifcfg-rh---
	 * property: routes
	 * variable: (none)
	 * description: List of static routes. They are not stored in ifcfg-* file,
	 *   but in route6-* file instead in the form of command line for 'ip route add'.
	 * ---end---
	 */

	/* ---ifcfg-rh---
	 * property: ignore-auto-routes
	 * variable: IPV6_PEERROUTES(+)
	 * default: yes
	 * description: IPV6_PEERROUTES has the opposite meaning as 'ignore-auto-routes' property.
	 * ---end---
	 */

	/* ---ifcfg-rh---
	 * property: ignore-auto-dns
	 * variable: IPV6_PEERDNS(+)
	 * default: yes
	 * description: IPV6_PEERDNS has the opposite meaning as 'ignore-auto-dns' property.
	 * ---end---
	 */

	/* ---ifcfg-rh---
	 * property: dhcp-hostname
	 * variable: DHCP_HOSTNAME
	 * description: Hostname to send the DHCP server.
	 * ---end---
	 */

	/* ---ifcfg-rh---
	 * property: never-default
	 * variable: IPV6_DEFROUTE(+), (and IPV6_DEFAULTGW, IPV6_DEFAULTDEV in /etc/sysconfig/network)
	 * default: IPV6_DEFROUTE=yes (when no variable specified)
	 * description: IPV6_DEFROUTE=no tells NetworkManager that this connection
	 *   should not be assigned the default IPv6 route. IPV6_DEFROUTE has the opposite
	 *   meaning as 'never-default' property.
	 * ---end---
	 */

	/* ---ifcfg-rh---
	 * property: may-fail
	 * variable: IPV6_FAILURE_FATAL(+)
	 * default: no
	 * description: IPV6_FAILURE_FATAL has the opposite meaning as 'may-fail' property.
	 * ---end---
	 */

	/* ---ifcfg-rh---
	 * property: route-metric
	 * variable: IPV6_ROUTE_METRIC(+)
	 * default: -1
	 * description: IPV6_ROUTE_METRIC is the default IPv6 metric for routes on this connection.
	 *   If set to -1, a default metric based on the device type is used.
	 * ---end---
	 */

	/**
	 * NMSettingIP6Config:ip6-privacy:
	 *
	 * Configure IPv6 Privacy Extensions for SLAAC, described in RFC4941.  If
	 * enabled, it makes the kernel generate a temporary IPv6 address in
	 * addition to the public one generated from MAC address via modified
	 * EUI-64.  This enhances privacy, but could cause problems in some
	 * applications, on the other hand.  The permitted values are: -1: unknown,
	 * 0: disabled, 1: enabled (prefer public address), 2: enabled (prefer temporary
	 * addresses).
	 *
	 * Having a per-connection setting set to "-1" (unknown) means fallback to
	 * global configuration "ipv6.ip6-privacy".
	 *
	 * If also global configuration is unspecified or set to "-1", fallback to read
	 * "/proc/sys/net/ipv6/conf/default/use_tempaddr".
	 *
	 * Note that this setting is distinct from the Stable Privacy addresses
	 * that can be enabled with the "addr-gen-mode" property's "stable-privacy"
	 * setting as another way of avoiding host tracking with IPv6 addresses.
	 **/
	/* ---ifcfg-rh---
	 * property: ip6-privacy
	 * variable: IPV6_PRIVACY, IPV6_PRIVACY_PREFER_PUBLIC_IP(+)
	 * values: IPV6_PRIVACY: no, yes (rfc3041 or rfc4941);
	 *   IPV6_PRIVACY_PREFER_PUBLIC_IP: yes, no
	 * default: no
	 * description: Configure IPv6 Privacy Extensions for SLAAC (RFC4941).
	 * example: IPV6_PRIVACY=rfc3041 IPV6_PRIVACY_PREFER_PUBLIC_IP=yes
	 * ---end---
	 */
	g_object_class_install_property
		(object_class, PROP_IP6_PRIVACY,
		 g_param_spec_enum (NM_SETTING_IP6_CONFIG_IP6_PRIVACY, "", "",
		                    NM_TYPE_SETTING_IP6_CONFIG_PRIVACY,
		                    NM_SETTING_IP6_CONFIG_PRIVACY_UNKNOWN,
		                    G_PARAM_READWRITE |
		                    G_PARAM_CONSTRUCT |
		                    G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingIP6Config:addr-gen-mode:
	 *
	 * Configure method for creating the address for use with RFC4862 IPv6
	 * Stateless Address Autoconfiguration. The permitted values are: "eui64",
	 * "stable-privacy" or unset.
	 *
	 * If the property is set to "eui64", the addresses will be generated
	 * using the interface tokens derived from  hardware address. This makes
	 * the host part of the address to stay constant, making it possible
	 * to track host's presence when it changes networks. The address changes
	 * when the interface hardware is replaced.
	 *
	 * The value of "stable-privacy" enables use of cryptographically
	 * secure hash of a secret host-specific key along with the connection
	 * identification and the network address as specified by RFC7217.
	 * This makes it impossible to use the address track host's presence,
	 * and makes the address stable when the network interface hardware is
	 * replaced.
	 *
	 * Leaving this unset causes a default that could be subject to change
	 * in future versions to be used.
	 *
	 * Note that this setting is distinct from the Privacy Extensions as
	 * configured by "ip6-privacy" property and it does not affect the
	 * temporary addresses configured with this option.
	 *
	 * Since: 1.2
	 **/
	/* ---ifcfg-rh---
	 * property: addr-gen-mode
	 * variable: IPV6_ADDR_GEN_MODE
	 * values: IPV6_ADDR_GEN_MODE: eui64, stable-privacy
	 * default: eui64
	 * description: Configure IPv6 Stable Privacy addressing for SLAAC (RFC7217).
	 * example: IPV6_ADDR_GEN_MODE=stable-privacy
	 * ---end---
	 */
	g_object_class_install_property
		(object_class, PROP_ADDR_GEN_MODE,
		 g_param_spec_int (NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE, "", "",
		                   G_MININT, G_MAXINT,
		                   NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE_STABLE_PRIVACY,
		                   G_PARAM_READWRITE |
		                   G_PARAM_CONSTRUCT |
		                   G_PARAM_STATIC_STRINGS));

	/* IP6-specific property overrides */

	/* ---dbus---
	 * property: dns
	 * format: array of byte array
	 * description: Array of IP addresses of DNS servers (in network byte order)
	 * ---end---
	 */
	_nm_setting_class_transform_property (setting_class,
	                                      NM_SETTING_IP_CONFIG_DNS,
	                                      G_VARIANT_TYPE ("aay"),
	                                      ip6_dns_to_dbus,
	                                      ip6_dns_from_dbus);

	/* ---dbus---
	 * property: addresses
	 * format: array of legacy IPv6 address struct (a(ayuay))
	 * description: Deprecated in favor of the 'address-data' and 'gateway'
	 *   properties, but this can be used for backward-compatibility with older
	 *   daemons. Note that if you send this property the daemon will ignore
	 *   'address-data' and 'gateway'.
	 *
	 *   Array of IPv6 address structures.  Each IPv6 address structure is
	 *   composed of an IPv6 address, a prefix length (1 - 128), and an IPv6
	 *   gateway address. The gateway may be zeroed out if no gateway exists for
	 *   that subnet.
	 * ---end---
	 */
	_nm_setting_class_override_property (setting_class,
	                                     NM_SETTING_IP_CONFIG_ADDRESSES,
	                                     G_VARIANT_TYPE ("a(ayuay)"),
	                                     ip6_addresses_get,
	                                     ip6_addresses_set,
	                                     NULL);

	/* ---dbus---
	 * property: address-data
	 * format: array of vardict
	 * description: Array of IPv6 addresses. Each address dictionary contains at
	 *   least 'address' and 'prefix' entries, containing the IP address as a
	 *   string, and the prefix length as a uint32. Additional attributes may
	 *   also exist on some addresses.
	 * ---end---
	 */
	_nm_setting_class_add_dbus_only_property (setting_class,
	                                          "address-data",
	                                          G_VARIANT_TYPE ("aa{sv}"),
	                                          ip6_address_data_get,
	                                          ip6_address_data_set);

	/* ---dbus---
	 * property: routes
	 * format: array of legacy IPv6 route struct (a(ayuayu))
	 * description: Deprecated in favor of the 'route-data' property, but this
	 *   can be used for backward-compatibility with older daemons. Note that if
	 *   you send this property the daemon will ignore 'route-data'.
	 *
	 *   Array of IPv6 route structures.  Each IPv6 route structure is
	 *   composed of an IPv6 address, a prefix length (1 - 128), an IPv6
	 *   next hop address (which may be zeroed out if there is no next hop),
	 *   and a metric. If the metric is 0, NM will choose an appropriate
	 *   default metric for the device.
	 * ---end---
	 */
	_nm_setting_class_override_property (setting_class,
	                                     NM_SETTING_IP_CONFIG_ROUTES,
	                                     G_VARIANT_TYPE ("a(ayuayu)"),
	                                     ip6_routes_get,
	                                     ip6_routes_set,
	                                     NULL);

	/* ---dbus---
	 * property: route-data
	 * format: array of vardict
	 * description: Array of IPv6 routes. Each route dictionary contains at
	 *   least 'dest' and 'prefix' entries, containing the destination IP
	 *   address as a string, and the prefix length as a uint32. Most routes
	 *   will also have a 'next-hop' entry, containing the next hop IP address as
	 *   a string. If the route has a 'metric' entry (containing a uint32), that
	 *   will be used as the metric for the route (otherwise NM will pick a
	 *   default value appropriate to the device). Additional attributes may
	 *   also exist on some routes.
	 * ---end---
	 */
	_nm_setting_class_add_dbus_only_property (setting_class,
	                                          "route-data",
	                                          G_VARIANT_TYPE ("aa{sv}"),
	                                          ip6_route_data_get,
	                                          ip6_route_data_set);
}
static void
nm_setting_ip4_config_class_init (NMSettingIP4ConfigClass *ip4_class)
{
	NMSettingClass *setting_class = NM_SETTING_CLASS (ip4_class);
	GObjectClass *object_class = G_OBJECT_CLASS (ip4_class);

	g_type_class_add_private (setting_class, sizeof (NMSettingIP4ConfigPrivate));

	/* virtual methods */
	object_class->set_property = set_property;
	object_class->get_property = get_property;
	object_class->finalize     = finalize;
	setting_class->verify = verify;

	/* properties */

	/* ---ifcfg-rh---
	 * property: method
	 * variable: BOOTPROTO
	 * format:   string
	 * values:   none, dhcp (bootp), static, ibft, autoip, shared
	 * default:  none
	 * description: Method used for IPv4 protocol configuration.
	 * ---end---
	 */

	/* ---keyfile---
	 * property: dns
	 * format: list of DNS IP addresses
	 * description: List of DNS servers.
	 * example: dns=1.2.3.4;8.8.8.8;8.8.4.4;
	 * ---end---
	 * ---ifcfg-rh---
	 * property: dns
	 * variable: DNS1, DNS2, ...
	 * format:   string
	 * description: List of DNS servers. Even if NetworkManager supports many DNS
	 *   servers, initscripts and resolver only care about the first three, usually.
	 * example: DNS1=1.2.3.4 DNS2=10.0.0.254 DNS3=8.8.8.8
	 * ---end---
	 */

	/* ---ifcfg-rh---
	 * property: dns-search
	 * variable: DOMAIN
	 * format:   string (space-separated domains)
	 * description: List of DNS search domains.
	 * ---end---
	 */

	/* ---keyfile---
	 * property: addresses
	 * variable: address1, address2, ...
	 * format: address/plen
	 * description: List of static IP addresses.
	 * example: address1=192.168.100.100/24 address2=10.1.1.5/24
	 * ---end---
	 * ---ifcfg-rh---
	 * property: addresses
	 * variable: IPADDR, PREFIX, IPADDR1, PREFIX1, ...
	 * description: List of static IP addresses.
	 * example: IPADDR=10.5.5.23 PREFIX=24 IPADDR1=1.1.1.2 PREFIX1=16
	 * ---end---
	 */

	/* ---keyfile---
	 * property: gateway
	 * variable: gateway
	 * format: string
	 * description: Gateway IP addresses as a string.
	 * example: gateway=192.168.100.1
	 * ---end---
	 * ---ifcfg-rh---
	 * property: gateway
	 * variable: GATEWAY
	 * description: Gateway IP address.
	 * example: GATEWAY=10.5.5.1
	 * ---end---
	 */

	/* ---keyfile---
	 * property: routes
	 * variable: route1, route2, ...
	 * format: route/plen[,gateway,metric]
	 * description: List of IP routes.
	 * example: route1=8.8.8.0/24,10.1.1.1,77
	 *   route2=7.7.0.0/16
	 * ---end---
	 * ---ifcfg-rh---
	 * property: routes
	 * variable: ADDRESS1, NETMASK1, GATEWAY1, METRIC1, ...
	 * description: List of static routes. They are not stored in ifcfg-* file,
	 *   but in route-* file instead.
	 * ---end---
	 */

	/* ---ifcfg-rh---
	 * property: ignore-auto-routes
	 * variable: PEERROUTES(+)
	 * default: yes
	 * description: PEERROUTES has the opposite meaning as 'ignore-auto-routes' property.
	 * ---end---
	 */

	/* ---ifcfg-rh---
	 * property: ignore-auto-dns
	 * variable: PEERDNS
	 * default: yes
	 * description: PEERDNS has the opposite meaning as 'ignore-auto-dns' property.
	 * ---end---
	 */

	/* ---ifcfg-rh---
	 * property: dhcp-send-hostname
	 * variable: DHCP_SEND_HOSTNAME(+)
	 * default: yes
	 * description: Whether DHCP_HOSTNAME should be sent to the DHCP server.
	 * ---end---
	 */

	/* ---ifcfg-rh---
	 * property: dhcp-hostname
	 * variable: DHCP_HOSTNAME
	 * description: Hostname to send to the DHCP server. When both DHCP_HOSTNAME and
	 *    DHCP_FQDN are specified only the latter is used.
	 * ---end---
	 */

	/* ---ifcfg-rh---
	 * property: never-default
	 * variable: DEFROUTE (GATEWAYDEV in /etc/sysconfig/network)
	 * default: yes
	 * description: DEFROUTE=no tells NetworkManager that this connection
	 *   should not be assigned the default route. DEFROUTE has the opposite
	 *   meaning as 'never-default' property.
	 * ---end---
	 */

	/* ---ifcfg-rh---
	 * property: may-fail
	 * variable: IPV4_FAILURE_FATAL(+)
	 * default: no
	 * description: IPV4_FAILURE_FATAL has the opposite meaning as 'may-fail' property.
	 * ---end---
	 */

	/* ---ifcfg-rh---
	 * property: route-metric
	 * variable: IPV4_ROUTE_METRIC(+)
	 * default: -1
	 * description: IPV4_ROUTE_METRIC is the default IPv4 metric for routes on this connection.
	 *   If set to -1, a default metric based on the device type is used.
	 * ---end---
	 */

	/**
	 * NMSettingIP4Config:dhcp-client-id:
	 *
	 * A string sent to the DHCP server to identify the local machine which the
	 * DHCP server may use to customize the DHCP lease and options.
	 **/
	/* ---ifcfg-rh---
	 * property: dhcp-client-id
	 * variable: DHCP_CLIENT_ID(+)
	 * description: A string sent to the DHCP server to identify the local machine.
	 * example: DHCP_CLIENT_ID=ax-srv-1
	 * ---end---
	 */
	g_object_class_install_property
		(object_class, PROP_DHCP_CLIENT_ID,
		 g_param_spec_string (NM_SETTING_IP4_CONFIG_DHCP_CLIENT_ID, "", "",
		                      NULL,
		                      G_PARAM_READWRITE |
		                      G_PARAM_STATIC_STRINGS));

	/* ---ifcfg-rh---
	 * property: dad-timeout
	 * variable: ARPING_WAIT
	 * default: missing variable means global default (config override or 3)
	 * description: Timeout (in seconds) for performing DAD before configuring
	 * IPv4 addresses. 0 turns off the DAD completely, -1 means default value.
	 * example: ARPING_WAIT=2
	 * ---end---
	 */

	/* ---ifcfg-rh---
	 * property: dhcp-timeout
	 * variable: IPV4_DHCP_TIMEOUT(+)
	 * description: A timeout after which the DHCP transaction fails in case of no response.
	 * example: IPV4_DHCP_TIMEOUT=10
	 * ---end---
	 */

	/**
	 * NMSettingIP4Config:dhcp-fqdn:
	 *
	 * If the #NMSettingIPConfig:dhcp-send-hostname property is %TRUE, then the
	 * specified FQDN will be sent to the DHCP server when acquiring a lease. This
	 * property and #NMSettingIPConfig:dhcp-hostname are mutually exclusive and
	 * cannot be set at the same time.
	 *
	 * Since: 1.2
	 */
	/* ---ifcfg-rh---
	 * property: dhcp-fqdn
	 * variable: DHCP_FQDN
	 * description: FQDN to send to the DHCP server. When both DHCP_HOSTNAME and
	 *    DHCP_FQDN are specified only the latter is used.
	 * example: DHCP_FQDN=foo.bar.com
	 * ---end---
	 */
	g_object_class_install_property
		(object_class, PROP_DHCP_FQDN,
		 g_param_spec_string (NM_SETTING_IP4_CONFIG_DHCP_FQDN, "", "",
		                      NULL,
		                      G_PARAM_READWRITE |
		                      G_PARAM_STATIC_STRINGS));

	/* IP4-specific property overrides */

	/* ---dbus---
	 * property: dns
	 * format: array of uint32
	 * description: Array of IP addresses of DNS servers (as network-byte-order
	 *   integers)
	 * ---end---
	 */
	_nm_setting_class_transform_property (setting_class,
	                                      NM_SETTING_IP_CONFIG_DNS,
	                                      G_VARIANT_TYPE ("au"),
	                                      ip4_dns_to_dbus,
	                                      ip4_dns_from_dbus);

	/* ---dbus---
	 * property: addresses
	 * format: array of array of uint32
	 * description: Deprecated in favor of the 'address-data' and 'gateway'
	 *   properties, but this can be used for backward-compatibility with older
	 *   daemons. Note that if you send this property the daemon will ignore
	 *   'address-data' and 'gateway'.
	 *
	 *   Array of IPv4 address structures.  Each IPv4 address structure is
	 *   composed of 3 32-bit values; the first being the IPv4 address (network
	 *   byte order), the second the prefix (1 - 32), and last the IPv4 gateway
	 *   (network byte order). The gateway may be left as 0 if no gateway exists
	 *   for that subnet.
	 * ---end---
	 */
	_nm_setting_class_override_property (setting_class,
	                                     NM_SETTING_IP_CONFIG_ADDRESSES,
	                                     G_VARIANT_TYPE ("aau"),
	                                     ip4_addresses_get,
	                                     ip4_addresses_set,
	                                     NULL);

	_nm_setting_class_add_dbus_only_property (setting_class,
	                                          "address-labels",
	                                          G_VARIANT_TYPE_STRING_ARRAY,
	                                          ip4_address_labels_get,
	                                          NULL);

	/* ---dbus---
	 * property: address-data
	 * format: array of vardict
	 * description: Array of IPv4 addresses. Each address dictionary contains at
	 *   least 'address' and 'prefix' entries, containing the IP address as a
	 *   string, and the prefix length as a uint32. Additional attributes may
	 *   also exist on some addresses.
	 * ---end---
	 */
	_nm_setting_class_add_dbus_only_property (setting_class,
	                                          "address-data",
	                                          G_VARIANT_TYPE ("aa{sv}"),
	                                          ip4_address_data_get,
	                                          ip4_address_data_set);

	/* ---dbus---
	 * property: routes
	 * format: array of array of uint32
	 * description: Deprecated in favor of the 'route-data' property, but this
	 *   can be used for backward-compatibility with older daemons. Note that if
	 *   you send this property the daemon will ignore 'route-data'.
	 *
	 *   Array of IPv4 route structures.  Each IPv4 route structure is composed
	 *   of 4 32-bit values; the first being the destination IPv4 network or
	 *   address (network byte order), the second the destination network or
	 *   address prefix (1 - 32), the third being the next-hop (network byte
	 *   order) if any, and the fourth being the route metric. If the metric is
	 *   0, NM will choose an appropriate default metric for the device. (There
	 *   is no way to explicitly specify an actual metric of 0 with this
	 *   property.)
	 * ---end---
	 */
	_nm_setting_class_override_property (setting_class,
	                                     NM_SETTING_IP_CONFIG_ROUTES,
	                                     G_VARIANT_TYPE ("aau"),
	                                     ip4_routes_get,
	                                     ip4_routes_set,
	                                     NULL);

	/* ---dbus---
	 * property: route-data
	 * format: array of vardict
	 * description: Array of IPv4 routes. Each route dictionary contains at
	 *   least 'dest' and 'prefix' entries, containing the destination IP
	 *   address as a string, and the prefix length as a uint32. Most routes
	 *   will also have a 'gateway' entry, containing the gateway IP address as
	 *   a string. If the route has a 'metric' entry (containing a uint32), that
	 *   will be used as the metric for the route (otherwise NM will pick a
	 *   default value appropriate to the device). Additional attributes may
	 *   also exist on some routes.
	 * ---end---
	 */
	_nm_setting_class_add_dbus_only_property (setting_class,
	                                          "route-data",
	                                          G_VARIANT_TYPE ("aa{sv}"),
	                                          ip4_route_data_get,
	                                          ip4_route_data_set);

}
static gboolean
verify (NMSetting *setting, NMConnection *connection, GError **error)
{
	NMSettingIP4ConfigPrivate *priv = NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting);
	NMSettingIPConfig *s_ip = NM_SETTING_IP_CONFIG (setting);
	NMSettingVerifyResult ret;
	const char *method;

	ret = NM_SETTING_CLASS (nm_setting_ip4_config_parent_class)->verify (setting, connection, error);
	if (ret != NM_SETTING_VERIFY_SUCCESS)
		return ret;

	method = nm_setting_ip_config_get_method (s_ip);
	/* Base class already checked that it exists */
	g_assert (method);

	if (!strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_MANUAL)) {
		if (nm_setting_ip_config_get_num_addresses (s_ip) == 0) {
			g_set_error (error,
			             NM_CONNECTION_ERROR,
			             NM_CONNECTION_ERROR_MISSING_PROPERTY,
			             _("this property cannot be empty for '%s=%s'"),
			             NM_SETTING_IP_CONFIG_METHOD, method);
			g_prefix_error (error, "%s.%s: ", NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP_CONFIG_ADDRESSES);
			return FALSE;
		}
	} else if (   !strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_LINK_LOCAL)
	           || !strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_SHARED)
	           || !strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_DISABLED)) {
		if (nm_setting_ip_config_get_num_dns (s_ip) > 0) {
			g_set_error (error,
			             NM_CONNECTION_ERROR,
			             NM_CONNECTION_ERROR_INVALID_PROPERTY,
			             _("this property is not allowed for '%s=%s'"),
			             NM_SETTING_IP_CONFIG_METHOD, method);
			g_prefix_error (error, "%s.%s: ", NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP_CONFIG_DNS);
			return FALSE;
		}

		if (nm_setting_ip_config_get_num_dns_searches (s_ip) > 0) {
			g_set_error (error,
			             NM_CONNECTION_ERROR,
			             NM_CONNECTION_ERROR_INVALID_PROPERTY,
			             _("this property is not allowed for '%s=%s'"),
			             NM_SETTING_IP_CONFIG_METHOD, method);
			g_prefix_error (error, "%s.%s: ", NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP_CONFIG_DNS_SEARCH);
			return FALSE;
		}

		/* Shared allows IP addresses; link-local and disabled do not */
		if (strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_SHARED) != 0) {
			if (nm_setting_ip_config_get_num_addresses (s_ip) > 0) {
				g_set_error (error,
				             NM_CONNECTION_ERROR,
				             NM_CONNECTION_ERROR_INVALID_PROPERTY,
				             _("this property is not allowed for '%s=%s'"),
				             NM_SETTING_IP_CONFIG_METHOD, method);
				g_prefix_error (error, "%s.%s: ", NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP_CONFIG_ADDRESSES);
				return FALSE;
			}
		}
	} else if (!strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_AUTO)) {
		/* nothing to do */
	} else {
		g_set_error_literal (error,
		                     NM_CONNECTION_ERROR,
		                     NM_CONNECTION_ERROR_INVALID_PROPERTY,
		                     _("property is invalid"));
		g_prefix_error (error, "%s.%s: ", NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP_CONFIG_METHOD);
		return FALSE;
	}

	if (priv->dhcp_client_id && !strlen (priv->dhcp_client_id)) {
		g_set_error_literal (error,
		                     NM_CONNECTION_ERROR,
		                     NM_CONNECTION_ERROR_INVALID_PROPERTY,
		                     _("property is empty"));
		g_prefix_error (error, "%s.%s: ", NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP4_CONFIG_DHCP_CLIENT_ID);
		return FALSE;
	}

	if (priv->dhcp_fqdn && !*priv->dhcp_fqdn) {
		g_set_error_literal (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY,
		                     _("property is empty"));
		g_prefix_error (error, "%s.%s: ", NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP4_CONFIG_DHCP_FQDN);
		return FALSE;
	}

	if (priv->dhcp_fqdn && !strchr (priv->dhcp_fqdn, '.')) {
		g_set_error (error,
		             NM_CONNECTION_ERROR,
		             NM_CONNECTION_ERROR_INVALID_PROPERTY,
		             _("'%s' is not a valid FQDN"), priv->dhcp_fqdn);
		g_prefix_error (error, "%s.%s: ", NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP4_CONFIG_DHCP_FQDN);
		return FALSE;
	}

	if (priv->dhcp_fqdn && nm_setting_ip_config_get_dhcp_hostname (s_ip)) {
		g_set_error_literal (error,
		                     NM_CONNECTION_ERROR,
		                     NM_CONNECTION_ERROR_INVALID_PROPERTY,
		                     _("property cannot be set when dhcp-hostname is also set"));
		g_prefix_error (error, "%s.%s: ", NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP4_CONFIG_DHCP_FQDN);
		return FALSE;
	}

	return TRUE;
}
static void
nm_setting_proxy_class_init (NMSettingProxyClass *setting_class)
{
	GObjectClass *object_class = G_OBJECT_CLASS (setting_class);
	NMSettingClass *parent_class = NM_SETTING_CLASS (setting_class);

	g_type_class_add_private (setting_class, sizeof (NMSettingProxyPrivate));

	/* virtual methods */
	object_class->set_property = set_property;
	object_class->get_property = get_property;
	object_class->finalize = finalize;
	parent_class->verify = verify;

	/**
	 * NMSettingProxy:method:
	 *
	 * Method for proxy configuration, Default is "NONE"
	 *
	 * Since: 1.6
	 **/
	g_object_class_install_property
	    (object_class, PROP_METHOD,
	     g_param_spec_int (NM_SETTING_PROXY_METHOD, "", "",
	                       G_MININT32, G_MAXINT32, NM_SETTING_PROXY_METHOD_NONE,
	                       G_PARAM_READWRITE |
	                       G_PARAM_CONSTRUCT |
	                       G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingProxy:browser-only:
	 *
	 * TRUE if Proxy is for Browser Stuff.
	 *
	 * Since: 1.6
	 **/
	g_object_class_install_property
	    (object_class, PROP_BROWSER_ONLY,
	     g_param_spec_boolean (NM_SETTING_PROXY_BROWSER_ONLY, "", "",
		                       FALSE,
		                       G_PARAM_READWRITE |
		                       G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingProxy:pac-url:
	 *
	 * PAC Url for obtaining PAC File.
	 *
	 * Since: 1.6
	 **/
	g_object_class_install_property
	    (object_class, PROP_PAC_URL,
	     g_param_spec_string (NM_SETTING_PROXY_PAC_URL, "", "",
	                          NULL,
	                          G_PARAM_READWRITE |
	                          G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingProxy:pac-script:
	 *
	 * PAC Script For the connection.
	 *
	 * Since: 1.6
	 **/
	g_object_class_install_property
	    (object_class, PROP_PAC_SCRIPT,
	     g_param_spec_string (NM_SETTING_PROXY_PAC_SCRIPT, "", "",
	                          NULL,
	                          G_PARAM_READWRITE |
	                          G_PARAM_STATIC_STRINGS));
}
static void
nm_setting_pppoe_class_init (NMSettingPPPOEClass *setting_class)
{
	GObjectClass *object_class = G_OBJECT_CLASS (setting_class);
	NMSettingClass *parent_class = NM_SETTING_CLASS (setting_class);

	g_type_class_add_private (setting_class, sizeof (NMSettingPPPOEPrivate));

	/* virtual methods */
	object_class->set_property = set_property;
	object_class->get_property = get_property;
	parent_class->verify       = verify;
	parent_class->need_secrets = need_secrets;

	/* Properties */
	/**
	 * NMSettingPPPOE:service:
	 *
	 * If specified, instruct PPPoE to only initiate sessions with access
	 * concentrators that provide the specified serivce.  For most providers,
	 * this should be left blank.  It is only required if there are multiple
	 * access concentrators or a specific service is known to be required.
	 **/
	g_object_class_install_property
		(object_class, PROP_SERVICE,
		 g_param_spec_string (NM_SETTING_PPPOE_SERVICE,
						  "Service",
						  "If specified, instruct PPPoE to only initiate sessions "
						  "with access concentrators that provide the specified "
						  "serivce.  For most providers, this should be left "
						  "blank.  It is only required if there are multiple "
						  "access concentrators or a specific service is known "
						  "to be required.",
						  NULL,
						  G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE));

	/**
	 * NMSettingPPPOE:username:
	 *
	 * Username used to authenticate with the PPPoE service.
	 **/
	g_object_class_install_property
		(object_class, PROP_USERNAME,
		 g_param_spec_string (NM_SETTING_PPPOE_USERNAME,
						  "Username",
						  "Username used to authenticate with the PPPoE service.",
						  NULL,
						  G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE));

	/**
	 * NMSettingPPPOE:password:
	 *
	 * Password used to authenticate with the PPPoE service.
	 **/
	g_object_class_install_property
		(object_class, PROP_PASSWORD,
		 g_param_spec_string (NM_SETTING_PPPOE_PASSWORD,
						  "Password",
						  "Password used to authenticate with the PPPoE service.",
						  NULL,
						  G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE | NM_SETTING_PARAM_SECRET));
}
static void
nm_setting_macvlan_class_init (NMSettingMacvlanClass *setting_class)
{
    GObjectClass *object_class = G_OBJECT_CLASS (setting_class);
    NMSettingClass *parent_class = NM_SETTING_CLASS (setting_class);

    g_type_class_add_private (setting_class, sizeof (NMSettingMacvlanPrivate));

    /* virtual methods */
    object_class->set_property = set_property;
    object_class->get_property = get_property;
    object_class->finalize     = finalize;
    parent_class->verify       = verify;

    /* Properties */

    /**
     * NMSettingMacvlan:parent:
     *
     * If given, specifies the parent interface name or parent connection UUID
     * from which this MAC-VLAN interface should be created.  If this property is
     * not specified, the connection must contain an #NMSettingWired setting
     * with a #NMSettingWired:mac-address property.
     *
     * Since: 1.2
     **/
    g_object_class_install_property
    (object_class, PROP_PARENT,
     g_param_spec_string (NM_SETTING_MACVLAN_PARENT, "", "",
                          NULL,
                          G_PARAM_READWRITE |
                          G_PARAM_CONSTRUCT |
                          NM_SETTING_PARAM_INFERRABLE |
                          G_PARAM_STATIC_STRINGS));

    /**
     * NMSettingMacvlan:mode:
     *
     * The macvlan mode, which specifies the communication mechanism between multiple
     * macvlans on the same lower device.
     *
     * Since: 1.2
     **/
    g_object_class_install_property
    (object_class, PROP_MODE,
     g_param_spec_uint (NM_SETTING_MACVLAN_MODE, "", "",
                        0, G_MAXUINT, 0,
                        G_PARAM_READWRITE |
                        G_PARAM_CONSTRUCT |
                        NM_SETTING_PARAM_INFERRABLE |
                        G_PARAM_STATIC_STRINGS));

    /**
     * NMSettingMacvlan:promiscuous:
     *
     * Whether the interface should be put in promiscuous mode.
     *
     * Since: 1.2
     **/
    g_object_class_install_property
    (object_class, PROP_PROMISCUOUS,
     g_param_spec_boolean (NM_SETTING_MACVLAN_PROMISCUOUS, "", "",
                           TRUE,
                           G_PARAM_READWRITE |
                           G_PARAM_CONSTRUCT |
                           NM_SETTING_PARAM_INFERRABLE |
                           G_PARAM_STATIC_STRINGS));

    /**
     * NMSettingMacvlan:tap:
     *
     * Whether the interface should be a MACVTAP.
     *
     * Since: 1.2
     **/
    g_object_class_install_property
    (object_class, PROP_TAP,
     g_param_spec_boolean (NM_SETTING_MACVLAN_TAP, "", "",
                           FALSE,
                           G_PARAM_READWRITE |
                           G_PARAM_CONSTRUCT |
                           NM_SETTING_PARAM_INFERRABLE |
                           G_PARAM_STATIC_STRINGS));
}
static void
nm_setting_ip6_config_class_init (NMSettingIP6ConfigClass *setting_class)
{
	GObjectClass *object_class = G_OBJECT_CLASS (setting_class);
	NMSettingClass *parent_class = NM_SETTING_CLASS (setting_class);

	g_type_class_add_private (setting_class, sizeof (NMSettingIP6ConfigPrivate));

	/* virtual methods */
	object_class->set_property = set_property;
	object_class->get_property = get_property;
	object_class->finalize     = finalize;
	parent_class->verify       = verify;

	/* Properties */
	g_object_class_install_property
		(object_class, PROP_METHOD,
		 g_param_spec_string (NM_SETTING_IP6_CONFIG_METHOD,
						      "Method",
						      "IP configuration method",
						      NULL,
						      G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE));

	g_object_class_install_property
		(object_class, PROP_DNS,
		 _nm_param_spec_specialized (NM_SETTING_IP6_CONFIG_DNS,
							   "DNS",
							   "List of DNS servers",
							   DBUS_TYPE_G_ARRAY_OF_ARRAY_OF_UCHAR,
							   G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE));

	g_object_class_install_property
		(object_class, PROP_DNS_SEARCH,
		 _nm_param_spec_specialized (NM_SETTING_IP6_CONFIG_DNS_SEARCH,
							   "DNS search",
							   "List of DNS search domains",
							   DBUS_TYPE_G_LIST_OF_STRING,
							   G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE));

	g_object_class_install_property
		(object_class, PROP_ADDRESSES,
		 _nm_param_spec_specialized (NM_SETTING_IP6_CONFIG_ADDRESSES,
							   "Addresses",
							   "List of NMSettingIP6Addresses",
							   DBUS_TYPE_G_ARRAY_OF_IP6_ADDRESS,
							   G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE));

	g_object_class_install_property
		(object_class, PROP_ROUTES,
		 _nm_param_spec_specialized (NM_SETTING_IP6_CONFIG_ROUTES,
							   "Routes",
							   "List of NMSettingIP6Addresses",
							   DBUS_TYPE_G_ARRAY_OF_IP6_ROUTE,
							   G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE));

	g_object_class_install_property
		(object_class, PROP_IGNORE_AUTO_ROUTES,
		 g_param_spec_boolean (NM_SETTING_IP6_CONFIG_IGNORE_AUTO_ROUTES,
						   "Ignore automatic routes",
						   "Ignore automatic routes",
						   FALSE,
						   G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE));

	g_object_class_install_property
		(object_class, PROP_IGNORE_AUTO_DNS,
		 g_param_spec_boolean (NM_SETTING_IP6_CONFIG_IGNORE_AUTO_DNS,
						   "Ignore DHCPv6/RDNSS DNS",
						   "Ignore DHCPv6/RDNSS DNS",
						   FALSE,
						   G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE));

	g_object_class_install_property
		(object_class, PROP_NEVER_DEFAULT,
		 g_param_spec_boolean (NM_SETTING_IP6_CONFIG_NEVER_DEFAULT,
						   "Never default",
						   "Never make this connection the default IPv6 connection",
						   FALSE,
						   G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE));

}
static void
nm_setting_ip4_config_class_init (NMSettingIP4ConfigClass *setting_class)
{
	GObjectClass *object_class = G_OBJECT_CLASS (setting_class);
	NMSettingClass *parent_class = NM_SETTING_CLASS (setting_class);

	g_type_class_add_private (setting_class, sizeof (NMSettingIP4ConfigPrivate));

	/* virtual methods */
	object_class->set_property = set_property;
	object_class->get_property = get_property;
	object_class->finalize     = finalize;
	parent_class->verify       = verify;

	/* Properties */
	/**
	 * NMSettingIP4Config:method:
	 *
	 * IPv4 configuration method.  If 'auto' is specified then the appropriate
	 * automatic method (DHCP, PPP, etc) is used for the interface and most
	 * other properties can be left unset.  If 'link-local' is specified, then a
	 * link-local address in the 169.254/16 range will be assigned to the
	 * interface.  If 'manual' is specified, static IP addressing is used and at
	 * least one IP address must be given in the 'addresses' property.  If
	 * 'shared' is specified (indicating that this connection will provide
	 * network access to other computers) then the interface is assigned an
	 * address in the 10.42.x.1/24 range and a DHCP and forwarding DNS server
	 * are started, and the interface is NAT-ed to the current default network
	 * connection.  'disabled' means IPv4 will not be used on this connection.
	 * This property must be set.
	 **/
	g_object_class_install_property
		(object_class, PROP_METHOD,
		 g_param_spec_string (NM_SETTING_IP4_CONFIG_METHOD,
						      "Method",
						      "IPv4 configuration method.  If 'auto' is specified "
						      "then the appropriate automatic method (DHCP, PPP, "
						      "etc) is used for the interface and most other "
						      "properties can be left unset.  If 'link-local' "
						      "is specified, then a link-local address in the "
						      "169.254/16 range will be assigned to the "
						      "interface.  If 'manual' is specified, static IP "
						      "addressing is used and at least one IP address "
						      "must be given in the 'addresses' property.  If "
						      "'shared' is specified (indicating that this "
						      "connection will provide network access to other "
						      "computers) then the interface is assigned an "
						      "address in the 10.42.x.1/24 range and a DHCP and "
						      "forwarding DNS server are started, and the "
						      "interface is NAT-ed to the current default network "
						      "connection.  'disabled' means IPv4 will not be "
						      "used on this connection.  This property must be set.",
						      NULL,
						      G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE));

	/**
	 * NMSettingIP4Config:dns:
	 *
	 * List of DNS servers (network byte order).  For the 'auto' method, these
	 * DNS servers are appended to those (if any) returned by automatic
	 * configuration.  DNS servers cannot be used with the 'shared', 'link-local',
	 * or 'disabled' methods as there is no usptream network.  In all other
	 * methods, these DNS servers are used as the only DNS servers for this
	 * connection.
	 **/
	g_object_class_install_property
		(object_class, PROP_DNS,
		 _nm_param_spec_specialized (NM_SETTING_IP4_CONFIG_DNS,
							   "DNS",
							   "List of DNS servers (network byte order). For "
							   "the 'auto' method, these DNS servers are "
							   "appended to those (if any) returned by automatic "
							   "configuration.  DNS servers cannot be used with "
							   "the 'shared', 'link-local', or 'disabled' "
							   "methods as there is no usptream network.  In all "
							   "other methods, these DNS servers are used as the "
							   "only DNS servers for this connection.",
							   DBUS_TYPE_G_UINT_ARRAY,
							   G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE));

	/**
	 * NMSettingIP4Config:dns-search:
	 *
	 * List of DNS search domains.  For the 'auto' method, these search domains
	 * are appended to those returned by automatic configuration. Search domains
	 * cannot be used with the 'shared', 'link-local', or 'disabled' methods as
	 * there is no upstream network.  In all other methods, these search domains
	 * are used as the only search domains for this connection.
	 **/
	g_object_class_install_property
		(object_class, PROP_DNS_SEARCH,
		 _nm_param_spec_specialized (NM_SETTING_IP4_CONFIG_DNS_SEARCH,
							   "DNS search",
							   "List of DNS search domains.  For the 'auto' "
							   "method, these search domains are appended to "
							   "those returned by automatic configuration. "
							   "Search domains cannot be used with the 'shared', "
							   "'link-local', or 'disabled' methods as there is "
							   "no upstream network.  In all other methods, these "
							   "search domains are used as the only search domains "
							   "for this connection.",
							   DBUS_TYPE_G_LIST_OF_STRING,
							   G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE));

	/**
	 * NMSettingIP4Config:addresses:
	 *
	 * Array of IPv4 address structures.  Each IPv4 address structure is
	 * composed of 3 32-bit values; the first being the IPv4 address (network
	 * byte order), the second the prefix (1 - 32), and last the IPv4 gateway
	 * (network byte order). The gateway may be left as 0 if no gateway exists
	 * for that subnet.  For the 'auto' method, given IP addresses are appended
	 * to those returned by automatic configuration.  Addresses cannot be used
	 * with the 'shared', 'link-local', or 'disabled' methods as addressing is
	 * either automatic or disabled with these methods.
	 **/
	g_object_class_install_property
		(object_class, PROP_ADDRESSES,
		 _nm_param_spec_specialized (NM_SETTING_IP4_CONFIG_ADDRESSES,
							   "Addresses",
							   "Array of IPv4 address structures.  Each IPv4 "
							   "address structure is composed of 3 32-bit values; "
							   "the first being the IPv4 address (network byte "
							   "order), the second the prefix (1 - 32), and "
							   "last the IPv4 gateway (network byte order). The "
							   "gateway may be left as 0 if no gateway exists "
							   "for that subnet.  For the 'auto' method, given "
							   "IP addresses are appended to those returned by "
							   "automatic configuration.  Addresses cannot be "
							   "used with the 'shared', 'link-local', or "
							   "'disabled' methods as addressing is either "
							   "automatic or disabled with these methods.",
							   DBUS_TYPE_G_ARRAY_OF_ARRAY_OF_UINT,
							   G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE));

	/**
	 * NMSettingIP4Config:routes:
	 *
	 * Array of IPv4 route structures.  Each IPv4 route structure is composed
	 * of 4 32-bit values; the first being the destination IPv4 network or
	 * address (network byte order), the second the destination network or
	 * address prefix (1 - 32), the third being the next-hop (network byte
	 * order) if any, and the fourth being the route metric. For the 'auto'
	 * method, given IP routes are appended to those returned by automatic
	 * configuration.  Routes cannot be used with the 'shared', 'link-local',
	 * or 'disabled' methods because there is no upstream network.
	 **/
	g_object_class_install_property
		(object_class, PROP_ROUTES,
		 _nm_param_spec_specialized (NM_SETTING_IP4_CONFIG_ROUTES,
							   "Routes",
							   "Array of IPv4 route structures.  Each IPv4 route "
							   "structure is composed of 4 32-bit values; the "
							   "first being the destination IPv4 network or "
							   "address (network byte order), the second the "
							   "destination network or address prefix (1 - 32), "
							   "the third being the next-hop (network byte order) "
							   "if any, and the fourth being the route metric. "
							   "For the 'auto' method, given IP routes are "
							   "appended to those returned by automatic "
							   "configuration.  Routes cannot be used with the "
							   "'shared', 'link-local', or 'disabled', methods "
							   "as there is no upstream network.",
							   DBUS_TYPE_G_ARRAY_OF_ARRAY_OF_UINT,
							   G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE));

	/**
	 * NMSettingIP4Config:ignore-auto-routes:
	 *
	 * When the method is set to 'auto' and this property to TRUE, automatically
	 * configured routes are ignored and only routes specified in
	 * #NMSettingIP4Config:routes, if any, are used.
	 **/
	g_object_class_install_property
		(object_class, PROP_IGNORE_AUTO_ROUTES,
		 g_param_spec_boolean (NM_SETTING_IP4_CONFIG_IGNORE_AUTO_ROUTES,
						   "Ignore automatic routes",
						   "When the method is set to 'auto' and this property "
						   "to TRUE, automatically configured routes are "
						   "ignored and only routes specified in the 'routes' "
						   "property, if any, are used.",
						   FALSE,
						   G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE));

	/**
	 * NMSettingIP4Config:ignore-auto-dns:
	 *
	 * When the method is set to 'auto' and this property to TRUE, automatically
	 * configured nameservers and search domains are ignored and only nameservers
	 * and search domains specified in #NMSettingIP4Config:dns and
	 * #NMSettingIP4Config:dns-search, if any, are used.
	 **/
	g_object_class_install_property
		(object_class, PROP_IGNORE_AUTO_DNS,
		 g_param_spec_boolean (NM_SETTING_IP4_CONFIG_IGNORE_AUTO_DNS,
						   "Ignore automatic DNS",
						   "When the method is set to 'auto' and this property "
						   "to TRUE, automatically configured nameservers and "
						   "search domains are ignored and only nameservers and "
						   "search domains specified in the 'dns' and 'dns-search' "
						   "properties, if any, are used.",
						   FALSE,
						   G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE));

	/**
	 * NMSettingIP4Config:dhcp-client-id:
	 *
	 * A string sent to the DHCP server to identify the local machine which the
	 * DHCP server may use to cusomize the DHCP lease and options.
	 **/
	g_object_class_install_property
		(object_class, PROP_DHCP_CLIENT_ID,
		 g_param_spec_string (NM_SETTING_IP4_CONFIG_DHCP_CLIENT_ID,
						   "DHCP Client ID",
						   "A string sent to the DHCP server to identify the "
						   "local machine which the DHCP server may use to "
						   "cusomize the DHCP lease and options.",
						   NULL,
						   G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE));

	/**
	 * NMSettingIP4Config:dhcp-send-hostname:
	 *
	 * If TRUE, a hostname is sent to the DHCP server when acquiring a lease.
	 * Some DHCP servers use this hostname to update DNS databases, essentially
	 * providing a static hostname for the computer.  If
	 * #NMSettingIP4Config:dhcp-hostname is empty and this property is TRUE,
	 * the current persistent hostname of the computer is sent.
	 **/
	g_object_class_install_property
		(object_class, PROP_DHCP_SEND_HOSTNAME,
		 g_param_spec_boolean (NM_SETTING_IP4_CONFIG_DHCP_SEND_HOSTNAME,
						   "Send DHCP hostname",
						   "If TRUE, a hostname is sent to the DHCP server when "
						   "acquiring a lease.  Some DHCP servers use this "
						   "hostname to update DNS databases, essentially "
						   "providing a static hostname for the computer.  If "
						   "the 'dhcp-hostname' property is empty and this "
						   "property is TRUE, the current persistent hostname "
						   "of the computer is sent.",
						   TRUE,
						   G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE));

	/**
	 * NMSettingIP4Config:dhcp-hostname:
	 *
	 * If the #NMSettingIP4Config:dhcp-send-hostname property is TRUE, then the
	 * specified name will be sent to the DHCP server when acquiring a lease.
	 **/
	g_object_class_install_property
		(object_class, PROP_DHCP_HOSTNAME,
		 g_param_spec_string (NM_SETTING_IP4_CONFIG_DHCP_HOSTNAME,
						   "DHCP Hostname",
						   "If the 'dhcp-send-hostname' property is TRUE, then "
						   "the specified name will be sent to the DHCP server "
						   "when acquiring a lease.",
						   NULL,
						   G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE));

	/**
	 * NMSettingIP4Config:never-default:
	 *
	 * If TRUE, this connection will never be the default IPv4 connection,
	 * meaning it will never be assigned the default route by NetworkManager.
	 **/
	g_object_class_install_property
		(object_class, PROP_NEVER_DEFAULT,
		 g_param_spec_boolean (NM_SETTING_IP4_CONFIG_NEVER_DEFAULT,
						   "Never default",
						   "If TRUE, this connection will never be the default "
						   "IPv4 connection, meaning it will never be assigned "
						   "the default route by NetworkManager.",
						   FALSE,
						   G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE));

	/**
	 * NMSettingIP4Config:may-fail:
	 *
	 * If TRUE, allow overall network configuration to proceed even if IPv4
	 * configuration times out.  Note that at least one IP configuration
	 * must succeed or overall network configuration will still fail.  For
	 * example, in IPv6-only networks, setting this property to TRUE allows
	 * the overall network configuration to succeed if IPv4 configuration fails
	 * but IPv6 configuration completes successfully.
	 **/
	g_object_class_install_property
		(object_class, PROP_MAY_FAIL,
		 g_param_spec_boolean (NM_SETTING_IP4_CONFIG_MAY_FAIL,
						   "May Fail",
						   "If TRUE, allow overall network configuration to "
						   "proceed even if IPv4 configuration times out. "
						   "Note that at least one IP configuration must "
						   "succeed or overall network configuration will still "
						   "fail.  For example, in IPv6-only networks, setting "
						   "this property to TRUE allows the overall network "
						   "configuration to succeed if IPv4 configuration "
						   "fails but IPv6 configuration completes successfully.",
						   TRUE,
						   G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE));
}
static void
nm_setting_wired_class_init (NMSettingWiredClass *setting_class)
{
	GObjectClass *object_class = G_OBJECT_CLASS (setting_class);
	NMSettingClass *parent_class = NM_SETTING_CLASS (setting_class);

	g_type_class_add_private (setting_class, sizeof (NMSettingWiredPrivate));

	/* virtual methods */
	object_class->set_property = set_property;
	object_class->get_property = get_property;
	object_class->finalize     = finalize;
	parent_class->verify       = verify;

	/* Properties */
	/**
	 * NMSettingWired:port:
	 *
	 * Specific port type to use if multiple the device supports multiple
	 * attachment methods.  One of 'tp' (Twisted Pair), 'aui' (Attachment Unit
	 * Interface), 'bnc' (Thin Ethernet) or 'mii' (Media Independent Interface.
	 * If the device supports only one port type, this setting is ignored.
	 **/
	g_object_class_install_property
		(object_class, PROP_PORT,
		 g_param_spec_string (NM_SETTING_WIRED_PORT,
						  "Port",
						  "Specific port type to use if multiple the device "
						  "supports multiple attachment methods.  One of "
						  "'tp' (Twisted Pair), 'aui' (Attachment Unit Interface), "
						  "'bnc' (Thin Ethernet) or 'mii' (Media Independent "
						  "Interface.  If the device supports only one port "
						  "type, this setting is ignored.",
						  NULL,
						  G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE));

	/**
	 * NMSettingWired:speed:
	 *
	 * If non-zero, request that the device use only the specified speed. 
	 * In Mbit/s, ie 100 == 100Mbit/s.
	 **/
	g_object_class_install_property
		(object_class, PROP_SPEED,
		 g_param_spec_uint (NM_SETTING_WIRED_SPEED,
						"Speed",
						"If non-zero, request that the device use only the "
						"specified speed.  In Mbit/s, ie 100 == 100Mbit/s.",
						0, G_MAXUINT32, 0,
						G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE));

	/**
	 * NMSettingWired:duplex:
	 *
	 * If specified, request that the device only use the specified duplex mode.
	 * Either 'half' or 'full'.
	 **/
	g_object_class_install_property
		(object_class, PROP_DUPLEX,
		 g_param_spec_string (NM_SETTING_WIRED_DUPLEX,
						  "Duplex",
						  "If specified, request that the device only use the "
						  "specified duplex mode.  Either 'half' or 'full'.",
						  NULL,
						  G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE));

	/**
	 * NMSettingEthernet:auto-negotiate:
	 *
	 * If TRUE, allow auto-negotiation of port speed and duplex mode.  If FALSE,
	 * do not allow auto-negotiation, in which case the 'speed' and 'duplex'
	 * properties should be set.
	 **/
	g_object_class_install_property
		(object_class, PROP_AUTO_NEGOTIATE,
		 g_param_spec_boolean (NM_SETTING_WIRED_AUTO_NEGOTIATE,
						   "AutoNegotiate",
						   "If TRUE, allow auto-negotiation of port speed and "
						   "duplex mode.  If FALSE, do not allow auto-negotiation,"
						   "in which case the 'speed' and 'duplex' properties "
						   "should be set.",
						   TRUE,
						   G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE));

	/**
	 * NMSettingWired:mac-address:
	 *
	 * If specified, this connection will only apply to the ethernet device
	 * whose permanent MAC address matches. This property does not change the MAC address
	 * of the device (i.e. MAC spoofing).
	 **/
	g_object_class_install_property
		(object_class, PROP_MAC_ADDRESS,
		 _nm_param_spec_specialized (NM_SETTING_WIRED_MAC_ADDRESS,
							   "Device MAC Address",
							   "If specified, this connection will only apply to "
							   "the ethernet device whose permanent MAC address matches.  "
							   "This property does not change the MAC address "
							   "of the device (i.e. MAC spoofing).",
							   DBUS_TYPE_G_UCHAR_ARRAY,
							   G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE));

	/**
	 * NMSettingWired:cloned-mac-address:
	 *
	 * If specified, request that the device use this MAC address instead of its
	 * permanent MAC address.  This is known as MAC cloning or spoofing.
	 **/
	g_object_class_install_property
		(object_class, PROP_CLONED_MAC_ADDRESS,
		 _nm_param_spec_specialized (NM_SETTING_WIRED_CLONED_MAC_ADDRESS,
	                                     "Cloned MAC Address",
	                                     "If specified, request that the device use "
	                                     "this MAC address instead of its permanent MAC address.  "
	                                     "This is known as MAC cloning or spoofing.",
	                                     DBUS_TYPE_G_UCHAR_ARRAY,
	                                     G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE));
    
	/**
	 * NMSettingWired:mac-address-blacklist:
	 *
	 * If specified, this connection will never apply to the ethernet device
	 * whose permanent MAC address matches an address in the list.  Each
	 * MAC address is in the standard hex-digits-and-colons notation
	 * (00:11:22:33:44:55).
	 **/
	g_object_class_install_property
		(object_class, PROP_MAC_ADDRESS_BLACKLIST,
		 _nm_param_spec_specialized (NM_SETTING_WIRED_MAC_ADDRESS_BLACKLIST,
		                             "MAC Address Blacklist",
		                             "If specified, this connection will never apply to "
		                             "the ethernet device whose permanent MAC address matches "
		                             "an address in the list.  Each MAC address is in the "
		                             "standard hex-digits-and-colons notation (00:11:22:33:44:55).",
		                             DBUS_TYPE_G_LIST_OF_STRING,
		                             G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE | NM_SETTING_PARAM_FUZZY_IGNORE));

	/**
	 * NMSettingWired:mtu:
	 *
	 * If non-zero, only transmit packets of the specified size or smaller,
	 * breaking larger packets up into multiple Ethernet frames.
	 **/
	g_object_class_install_property
		(object_class, PROP_MTU,
		 g_param_spec_uint (NM_SETTING_WIRED_MTU,
						"MTU",
						"If non-zero, only transmit packets of the specified "
						"size or smaller, breaking larger packets up into "
						"multiple Ethernet frames.",
						0, G_MAXUINT32, 0,
						G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE | NM_SETTING_PARAM_FUZZY_IGNORE));

	/**
	 * NMSettingWired:s390-subchannels:
	 *
	 * Identifies specific subchannels that this network device uses for
	 * communcation with z/VM or s390 host.  Like #NMSettingWired:mac-address
	 * for non-z/VM devices, this property can be used to ensure this connection
	 * only applies to the network device that uses these subchannels.  The
	 * list should contain exactly 3 strings, and each string may only be
	 * composed of hexadecimal characters and the period (.) character.
	 **/
	g_object_class_install_property
		(object_class, PROP_S390_SUBCHANNELS,
		 _nm_param_spec_specialized (NM_SETTING_WIRED_S390_SUBCHANNELS,
		                       "z/VM Subchannels",
		                       "Identifies specific subchannels that this "
		                       "network device uses for communcation with z/VM "
		                       "or s390 host.  Like the 'mac-address' property "
		                       "for non-z/VM devices, this property can be used "
		                       "to ensure this connection only applies to the "
		                       "network device that uses these subchannels. The "
		                       "list should contain exactly 3 strings, and each "
		                       "string may only be composed of hexadecimal "
		                       "characters and the period (.) character.",
		                       DBUS_TYPE_G_ARRAY_OF_STRING,
		                       G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE));

	/**
	 * NMSettingWired:s390-nettype:
	 *
	 * s390 network device type; one of 'qeth', 'lcs', or 'ctc', representing
	 * the different types of virtual network devices available on s390 systems.
	 **/
	g_object_class_install_property
		(object_class, PROP_S390_NETTYPE,
		 g_param_spec_string (NM_SETTING_WIRED_S390_NETTYPE,
						  "s390 Net Type",
						  "s390 network device type; one of 'qeth', 'lcs', or "
						  "'ctc', representing the different types of virtual "
						  "network devices available on s390 systems.",
						  NULL,
						  G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE));

	/**
	 * NMSettingWired:s390-options:
	 *
	 * Dictionary of key/value pairs of s390-specific device options.  Both keys
	 * and values must be strings.  Allowed keys include 'portno', 'layer2',
	 * 'portname', 'protocol', among others.  Key names must contain only
	 * alphanumeric characters (ie, [a-zA-Z0-9]).
	 **/
	g_object_class_install_property
		(object_class, PROP_S390_OPTIONS,
		 _nm_param_spec_specialized (NM_SETTING_WIRED_S390_OPTIONS,
							   "s390 Options",
							   "Dictionary of key/value pairs of s390-specific "
							   "device options.  Both keys and values must be "
							   "strings.  Allowed keys include 'portno', "
							   "'layer2', 'portname', 'protocol', among others.",
							   DBUS_TYPE_G_MAP_OF_STRING,
							   G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE));
}
static void
nm_setting_infiniband_class_init (NMSettingInfinibandClass *setting_class)
{
	GObjectClass *object_class = G_OBJECT_CLASS (setting_class);
	NMSettingClass *parent_class = NM_SETTING_CLASS (setting_class);

	g_type_class_add_private (setting_class, sizeof (NMSettingInfinibandPrivate));

	/* virtual methods */
	object_class->set_property = set_property;
	object_class->get_property = get_property;
	object_class->finalize     = finalize;

	parent_class->verify                 = verify;
	parent_class->get_virtual_iface_name = get_virtual_iface_name;

	/* Properties */
	/**
	 * NMSettingInfiniband:mac-address:
	 *
	 * If specified, this connection will only apply to the IPoIB
	 * device whose permanent MAC address matches. This property does
	 * not change the MAC address of the device (i.e. MAC spoofing).
	 **/
	g_object_class_install_property
		(object_class, PROP_MAC_ADDRESS,
		 _nm_param_spec_specialized (NM_SETTING_INFINIBAND_MAC_ADDRESS,
		                             "Device MAC Address",
		                             "If specified, this connection will only apply to "
		                             "the IPoIB device whose permanent MAC address matches.  "
		                             "This property does not change the MAC address "
		                             "of the device (i.e. MAC spoofing).",
		                             DBUS_TYPE_G_UCHAR_ARRAY,
		                             G_PARAM_READWRITE | NM_SETTING_PARAM_INFERRABLE));

	/**
	 * NMSettingInfiniband:mtu:
	 *
	 * If non-zero, only transmit packets of the specified size or smaller,
	 * breaking larger packets up into multiple frames.
	 **/
	g_object_class_install_property
		(object_class, PROP_MTU,
		 g_param_spec_uint (NM_SETTING_INFINIBAND_MTU,
		                    "MTU",
		                    "If non-zero, only transmit packets of the specified "
		                    "size or smaller, breaking larger packets up into "
		                    "multiple frames.",
		                    0, G_MAXUINT32, 0,
		                    G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_FUZZY_IGNORE));

	/**
	 * NMSettingInfiniband:transport-mode:
	 *
	 * The IP-over-InfiniBand transport mode. Either 'datagram' or
	 * 'connected'.
	 **/
	g_object_class_install_property
		(object_class, PROP_TRANSPORT_MODE,
		 g_param_spec_string (NM_SETTING_INFINIBAND_TRANSPORT_MODE,
		                      "Transport Mode",
		                      "The IPoIB transport mode. Either 'datagram' or 'connected'.",
		                      NULL,
		                      G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_INFERRABLE));

	/**
	 * NMSettingInfiniband:p-key:
	 *
	 * The InfiniBand P_Key to use for this device. A value of -1
	 * means to use the default P_Key (aka "the P_Key at index 0").
	 * Otherwise it is a 16-bit unsigned integer, whose high bit
	 * is set if it is a "full membership" P_Key.
	 **/
	g_object_class_install_property
		(object_class, PROP_P_KEY,
		 g_param_spec_int (NM_SETTING_INFINIBAND_P_KEY,
		                   "P_Key",
		                   "The InfiniBand P_Key. Either -1 for the "
		                   "default, or a 16-bit unsigned integer.",
		                   -1, 0xFFFF, -1,
		                   G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_INFERRABLE));

	/**
	 * NMSettingInfiniband:parent:
	 *
	 * The interface name of the parent device of this device. Normally
	 * %NULL, but if #NMSettingInfiniband:p_key is set, then you must
	 * specify the base device by setting either this property or
	 * #NMSettingInfiniband:mac-address.
	 **/
	g_object_class_install_property
		(object_class, PROP_PARENT,
		 g_param_spec_string (NM_SETTING_INFINIBAND_PARENT,
		                      "Parent",
		                      "The interface name of the parent device, or NULL",
		                      NULL,
		                      G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_INFERRABLE));

}
static void
nm_setting_infiniband_class_init (NMSettingInfinibandClass *setting_class)
{
	GObjectClass *object_class = G_OBJECT_CLASS (setting_class);
	NMSettingClass *parent_class = NM_SETTING_CLASS (setting_class);

	g_type_class_add_private (setting_class, sizeof (NMSettingInfinibandPrivate));

	/* virtual methods */
	object_class->set_property = set_property;
	object_class->get_property = get_property;
	object_class->finalize     = finalize;

	parent_class->verify       = verify;

	/* Properties */
	/**
	 * NMSettingInfiniband:mac-address:
	 *
	 * If specified, this connection will only apply to the IPoIB device whose
	 * permanent MAC address matches. This property does not change the MAC
	 * address of the device (i.e. MAC spoofing).
	 **/
	/* ---keyfile---
	 * property: mac-address
	 * format: ususal hex-digits-and-colons notation
	 * description: MAC address in traditional hex-digits-and-colons notation, or
	 *   or semicolon separated list of 20 decimal bytes (obsolete)
	 * example: mac-address= 80:00:00:6d:fe:80:00:00:00:00:00:00:00:02:55:00:70:33:cf:01
	 * ---end---
	 * ---ifcfg-rh---
	 * property: mac-address
	 * variable: HWADDR
	 * description: IBoIP 20-byte hardware address of the device (in traditional
	 *   hex-digits-and-colons notation).
	 * example: HWADDR=01:02:03:04:05:06:07:08:09:0A:01:02:03:04:05:06:07:08:09:11
	 * ---end---
	 */
	g_object_class_install_property
		(object_class, PROP_MAC_ADDRESS,
		 g_param_spec_string (NM_SETTING_INFINIBAND_MAC_ADDRESS, "", "",
		                      NULL,
		                      G_PARAM_READWRITE |
		                      NM_SETTING_PARAM_INFERRABLE |
		                      G_PARAM_STATIC_STRINGS));
	_nm_setting_class_transform_property (parent_class, NM_SETTING_INFINIBAND_MAC_ADDRESS,
	                                      G_VARIANT_TYPE_BYTESTRING,
	                                      _nm_utils_hwaddr_to_dbus,
	                                      _nm_utils_hwaddr_from_dbus);

	/**
	 * NMSettingInfiniband:mtu:
	 *
	 * If non-zero, only transmit packets of the specified size or smaller,
	 * breaking larger packets up into multiple frames.
	 **/
	/* ---ifcfg-rh---
	 * property: mtu
	 * variable: MTU
	 * description: MTU of the interface.
	 * ---end---
	 */
	g_object_class_install_property
		(object_class, PROP_MTU,
		 g_param_spec_uint (NM_SETTING_INFINIBAND_MTU, "", "",
		                    0, G_MAXUINT32, 0,
		                    G_PARAM_READWRITE |
		                    G_PARAM_CONSTRUCT |
		                    NM_SETTING_PARAM_FUZZY_IGNORE |
		                    G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingInfiniband:transport-mode:
	 *
	 * The IP-over-InfiniBand transport mode. Either "datagram" or
	 * "connected".
	 **/
	/* ---ifcfg-rh---
	 * property: transport-mode
	 * variable: CONNECTED_MODE
	 * default: CONNECTED_MODE=no
	 * description: CONNECTED_MODE=yes for "connected" mode, CONNECTED_MODE=no for
	 *   "datagram" mode
	 * ---end---
	 */
	g_object_class_install_property
		(object_class, PROP_TRANSPORT_MODE,
		 g_param_spec_string (NM_SETTING_INFINIBAND_TRANSPORT_MODE, "", "",
		                      NULL,
		                      G_PARAM_READWRITE |
		                      G_PARAM_CONSTRUCT |
		                      NM_SETTING_PARAM_INFERRABLE |
		                      G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingInfiniband:p-key:
	 *
	 * The InfiniBand P_Key to use for this device. A value of -1 means to use
	 * the default P_Key (aka "the P_Key at index 0").  Otherwise it is a 16-bit
	 * unsigned integer, whose high bit is set if it is a "full membership"
	 * P_Key.
	 **/
	/* ---ifcfg-rh---
	 * property: p-key
	 * variable: PKEY_ID (and PKEY=yes)
	 * default: PKEY=no
	 * description: InfiniBand P_Key. The value can be a hex number prefixed with "0x"
	 *   or a decimal number.
	 *   When PKEY_ID is specified, PHYSDEV and DEVICE also must be specified.
	 * example: PKEY=yes PKEY_ID=2 PHYSDEV=mlx4_ib0 DEVICE=mlx4_ib0.8002
	 * ---end---
	 */
	g_object_class_install_property
		(object_class, PROP_P_KEY,
		 g_param_spec_int (NM_SETTING_INFINIBAND_P_KEY, "", "",
		                   -1, 0xFFFF, -1,
		                   G_PARAM_READWRITE |
		                   G_PARAM_CONSTRUCT |
		                   NM_SETTING_PARAM_INFERRABLE |
		                   G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingInfiniband:parent:
	 *
	 * The interface name of the parent device of this device. Normally %NULL,
	 * but if the #NMSettingInfiniband:p_key property is set, then you must
	 * specify the base device by setting either this property or
	 * #NMSettingInfiniband:mac-address.
	 **/
	/* ---ifcfg-rh---
	 * property: parent
	 * variable: PHYSDEV (PKEY=yes)
	 * default: PKEY=no
	 * description: InfiniBand parent device.
	 * example: PHYSDEV=ib0
	 * ---end---
	 */
	g_object_class_install_property
		(object_class, PROP_PARENT,
		 g_param_spec_string (NM_SETTING_INFINIBAND_PARENT, "", "",
		                      NULL,
		                      G_PARAM_READWRITE |
		                      G_PARAM_CONSTRUCT |
		                      NM_SETTING_PARAM_INFERRABLE |
		                      G_PARAM_STATIC_STRINGS));

}
Exemple #23
0
static void
nm_setting_vpn_class_init (NMSettingVPNClass *setting_class)
{
	GObjectClass *object_class = G_OBJECT_CLASS (setting_class);
	NMSettingClass *parent_class = NM_SETTING_CLASS (setting_class);

	g_type_class_add_private (setting_class, sizeof (NMSettingVPNPrivate));

	/* virtual methods */
	object_class->set_property = set_property;
	object_class->get_property = get_property;
	object_class->finalize     = finalize;

	parent_class->verify            = verify;
	parent_class->update_one_secret = update_one_secret;
	parent_class->get_secret_flags  = get_secret_flags;
	parent_class->set_secret_flags  = set_secret_flags;
	parent_class->need_secrets      = need_secrets;
	parent_class->compare_property  = compare_property;
	parent_class->clear_secrets_with_flags = clear_secrets_with_flags;

	/* Properties */
	/**
	 * NMSettingVPN:service-type:
	 *
	 * D-Bus service name of the VPN plugin that this setting uses to connect
	 * to its network.  i.e. org.freedesktop.NetworkManager.vpnc for the vpnc
	 * plugin.
	 **/
	g_object_class_install_property
		(object_class, PROP_SERVICE_TYPE,
		 g_param_spec_string (NM_SETTING_VPN_SERVICE_TYPE,
						  "Service type",
						  "D-Bus service name of the VPN plugin that this "
						  "setting uses to connect to its network.  i.e. "
						  "org.freedesktop.NetworkManager.vpnc for the vpnc "
						  "plugin.",
						  NULL,
						  G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE));

	/**
	 * NMSettingVPN:user-name:
	 *
	 * If the VPN connection requires a user name for authentication, that name
	 * should be provided here.  If the connection is available to more than
	 * one user, and the VPN requires each user to supply a different name, then
	 * leave this property empty.  If this property is empty, NetworkManager
	 * will automatically supply the username of the user which requested the
	 * VPN connection.
	 **/
	g_object_class_install_property
		(object_class, PROP_USER_NAME,
		 g_param_spec_string (NM_SETTING_VPN_USER_NAME,
		                      "User name",
		                      "If the VPN connection requires a user name for "
		                      "authentication, that name should be provided here.  "
		                      "If the connection is available to more than one "
		                      "user, and the VPN requires each user to supply a "
		                      "different name, then leave this property empty.  If "
		                      "this property is empty, NetworkManager will "
		                      "automatically supply the username of the user which "
		                      "requested the VPN connection.",
		                      NULL,
		                      G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE));

	/**
	 * NMSettingVPN:data:
	 *
	 * Dictionary of key/value pairs of VPN plugin specific data.  Both keys
	 * and values must be strings.
	 **/
	g_object_class_install_property
		(object_class, PROP_DATA,
		 _nm_param_spec_specialized (NM_SETTING_VPN_DATA,
							   "Data",
							   "Dictionary of key/value pairs of VPN plugin "
							   "specific data.  Both keys and values must be "
							   "strings.",
							   DBUS_TYPE_G_MAP_OF_STRING,
							   G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE));

	/**
	 * NMSettingVPN:secrets:
	 *
	 * Dictionary of key/value pairs of VPN plugin specific secrets like
	 * passwords or private keys.  Both keys and values must be strings.
	 **/
	g_object_class_install_property
		(object_class, PROP_SECRETS,
		 _nm_param_spec_specialized (NM_SETTING_VPN_SECRETS,
							   "Secrets",
							   "Dictionary of key/value pairs of VPN plugin "
							   "specific secrets like passwords or private keys."
							   "  Both keys and values must be strings.",
							   DBUS_TYPE_G_MAP_OF_STRING,
							   G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE | NM_SETTING_PARAM_SECRET));
}
static void
nm_setting_wired_class_init (NMSettingWiredClass *setting_class)
{
	GObjectClass *object_class = G_OBJECT_CLASS (setting_class);
	NMSettingClass *parent_class = NM_SETTING_CLASS (setting_class);

	g_type_class_add_private (setting_class, sizeof (NMSettingWiredPrivate));

	/* virtual methods */
	object_class->set_property = set_property;
	object_class->get_property = get_property;
	object_class->finalize     = finalize;
	parent_class->verify       = verify;

	/* Properties */
	/**
	 * NMSettingWired:port:
	 *
	 * Specific port type to use if multiple the device supports multiple
	 * attachment methods.  One of "tp" (Twisted Pair), "aui" (Attachment Unit
	 * Interface), "bnc" (Thin Ethernet) or "mii" (Media Independent Interface.
	 * If the device supports only one port type, this setting is ignored.
	 **/
	g_object_class_install_property
		(object_class, PROP_PORT,
		 g_param_spec_string (NM_SETTING_WIRED_PORT, "", "",
		                      NULL,
		                      G_PARAM_READWRITE |
		                      G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingWired:speed:
	 *
	 * If non-zero, request that the device use only the specified speed.  In
	 * Mbit/s, ie 100 == 100Mbit/s.
	 **/
	g_object_class_install_property
		(object_class, PROP_SPEED,
		 g_param_spec_uint (NM_SETTING_WIRED_SPEED, "", "",
		                    0, G_MAXUINT32, 0,
		                    G_PARAM_READWRITE |
		                    G_PARAM_CONSTRUCT |
		                    G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingWired:duplex:
	 *
	 * If specified, request that the device only use the specified duplex mode.
	 * Either "half" or "full".
	 **/
	g_object_class_install_property
		(object_class, PROP_DUPLEX,
		 g_param_spec_string (NM_SETTING_WIRED_DUPLEX, "", "",
		                      NULL,
		                      G_PARAM_READWRITE |
		                      G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingWired:auto-negotiate:
	 *
	 * If %TRUE, allow auto-negotiation of port speed and duplex mode.  If
	 * %FALSE, do not allow auto-negotiation, in which case the "speed" and
	 * "duplex" properties should be set.
	 **/
	g_object_class_install_property
		(object_class, PROP_AUTO_NEGOTIATE,
		 g_param_spec_boolean (NM_SETTING_WIRED_AUTO_NEGOTIATE, "", "",
		                       TRUE,
		                       G_PARAM_READWRITE |
		                       G_PARAM_CONSTRUCT |
		                       G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingWired:mac-address:
	 *
	 * If specified, this connection will only apply to the Ethernet device
	 * whose permanent MAC address matches. This property does not change the
	 * MAC address of the device (i.e. MAC spoofing).
	 **/
	g_object_class_install_property
		(object_class, PROP_MAC_ADDRESS,
		 _nm_param_spec_specialized (NM_SETTING_WIRED_MAC_ADDRESS, "", "",
		                             DBUS_TYPE_G_UCHAR_ARRAY,
		                             G_PARAM_READWRITE |
		                             NM_SETTING_PARAM_INFERRABLE |
		                             G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingWired:cloned-mac-address:
	 *
	 * If specified, request that the device use this MAC address instead of its
	 * permanent MAC address.  This is known as MAC cloning or spoofing.
	 **/
	g_object_class_install_property
		(object_class, PROP_CLONED_MAC_ADDRESS,
		 _nm_param_spec_specialized (NM_SETTING_WIRED_CLONED_MAC_ADDRESS, "", "",
		                             DBUS_TYPE_G_UCHAR_ARRAY,
		                             G_PARAM_READWRITE |
		                             NM_SETTING_PARAM_INFERRABLE |
		                             G_PARAM_STATIC_STRINGS));
    
	/**
	 * NMSettingWired:mac-address-blacklist:
	 *
	 * If specified, this connection will never apply to the Ethernet device
	 * whose permanent MAC address matches an address in the list.  Each MAC
	 * address is in the standard hex-digits-and-colons notation
	 * (00:11:22:33:44:55).
	 **/
	g_object_class_install_property
		(object_class, PROP_MAC_ADDRESS_BLACKLIST,
		 _nm_param_spec_specialized (NM_SETTING_WIRED_MAC_ADDRESS_BLACKLIST, "", "",
		                             DBUS_TYPE_G_LIST_OF_STRING,
		                             G_PARAM_READWRITE |
		                             NM_SETTING_PARAM_FUZZY_IGNORE |
		                             G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingWired:mtu:
	 *
	 * If non-zero, only transmit packets of the specified size or smaller,
	 * breaking larger packets up into multiple Ethernet frames.
	 **/
	g_object_class_install_property
		(object_class, PROP_MTU,
		 g_param_spec_uint (NM_SETTING_WIRED_MTU, "", "",
		                    0, G_MAXUINT32, 0,
		                    G_PARAM_READWRITE |
		                    G_PARAM_CONSTRUCT |
		                    NM_SETTING_PARAM_FUZZY_IGNORE |
		                    G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingWired:s390-subchannels:
	 *
	 * Identifies specific subchannels that this network device uses for
	 * communication with z/VM or s390 host.  Like the
	 * #NMSettingWired:mac-address property for non-z/VM devices, this property
	 * can be used to ensure this connection only applies to the network device
	 * that uses these subchannels.  The list should contain exactly 3 strings,
	 * and each string may only be composed of hexadecimal characters and the
	 * period (.) character.
	 **/
	g_object_class_install_property
		(object_class, PROP_S390_SUBCHANNELS,
		 _nm_param_spec_specialized (NM_SETTING_WIRED_S390_SUBCHANNELS, "", "",
		                             DBUS_TYPE_G_ARRAY_OF_STRING,
		                             G_PARAM_READWRITE |
		                             NM_SETTING_PARAM_INFERRABLE |
		                             G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingWired:s390-nettype:
	 *
	 * s390 network device type; one of "qeth", "lcs", or "ctc", representing
	 * the different types of virtual network devices available on s390 systems.
	 **/
	g_object_class_install_property
		(object_class, PROP_S390_NETTYPE,
		 g_param_spec_string (NM_SETTING_WIRED_S390_NETTYPE, "", "",
		                      NULL,
		                      G_PARAM_READWRITE |
		                      NM_SETTING_PARAM_INFERRABLE |
		                      G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingWired:s390-options:
	 *
	 * Dictionary of key/value pairs of s390-specific device options.  Both keys
	 * and values must be strings.  Allowed keys include "portno", "layer2",
	 * "portname", "protocol", among others.  Key names must contain only
	 * alphanumeric characters (ie, [a-zA-Z0-9]).
	 **/
	g_object_class_install_property
		(object_class, PROP_S390_OPTIONS,
		 _nm_param_spec_specialized (NM_SETTING_WIRED_S390_OPTIONS, "", "",
		                             DBUS_TYPE_G_MAP_OF_STRING,
		                             G_PARAM_READWRITE |
		                             NM_SETTING_PARAM_INFERRABLE |
		                             G_PARAM_STATIC_STRINGS));
}
static void
nm_setting_wireless_class_init (NMSettingWirelessClass *setting_class)
{
	GObjectClass *object_class = G_OBJECT_CLASS (setting_class);
	NMSettingClass *parent_class = NM_SETTING_CLASS (setting_class);

	g_type_class_add_private (setting_class, sizeof (NMSettingWirelessPrivate));

	/* virtual methods */
	object_class->set_property = set_property;
	object_class->get_property = get_property;
	object_class->finalize     = finalize;
	parent_class->verify       = verify;

	/* Properties */
	/**
	 * NMSettingWireless:ssid:
	 *
	 * SSID of the WiFi network.
	 **/
	g_object_class_install_property
		(object_class, PROP_SSID,
		 _nm_param_spec_specialized (NM_SETTING_WIRELESS_SSID,
							   "SSID",
							   "SSID of the WiFi network.  Must be specified.",
							   DBUS_TYPE_G_UCHAR_ARRAY,
							   G_PARAM_READWRITE));

	/**
	 * NMSettingWireless:mode:
	 *
	 * WiFi network mode; one of 'infrastructure', 'adhoc' or 'ap'.  If blank,
	 * infrastructure is assumed.
	 **/
	g_object_class_install_property
		(object_class, PROP_MODE,
		 g_param_spec_string (NM_SETTING_WIRELESS_MODE,
						  "Mode",
						  "WiFi network mode; one of 'infrastructure', "
						  "'adhoc' or 'ap'.  If blank, infrastructure is assumed.",
						  NULL,
						  G_PARAM_READWRITE));

	/**
	 * NMSettingWireless:band:
	 *
	 * 802.11 frequency band of the network.  One of 'a' for 5GHz 802.11a or
	 * 'bg' for 2.4GHz 802.11.  This will lock associations to the WiFi network
	 * to the specific band, i.e. if 'a' is specified, the device will not
	 * associate with the same network in the 2.4GHz band even if the network's
	 * settings are compatible.  This setting depends on specific driver
	 * capability and may not work with all drivers.
	 **/
	g_object_class_install_property
		(object_class, PROP_BAND,
		 g_param_spec_string (NM_SETTING_WIRELESS_BAND,
						  "Band",
						  "802.11 frequency band of the network.  One of 'a' "
						  "for 5GHz 802.11a or 'bg' for 2.4GHz 802.11.  This "
						  "will lock associations to the WiFi network to the "
						  "specific band, i.e. if 'a' is specified, the device "
						  "will not associate with the same network in the "
						  "2.4GHz band even if the network's settings are "
						  "compatible.  This setting depends on specific driver "
						  "capability and may not work with all drivers.",
						  NULL,
						  G_PARAM_READWRITE));

	/**
	 * NMSettingWireless:channel:
	 *
	 * Wireless channel to use for the WiFi connection.  The device will only
	 * join (or create for Ad-Hoc networks) a WiFi network on the specified
	 * channel.  Because channel numbers overlap between bands, this property
	 * also requires the 'band' property to be set.
	 **/
	g_object_class_install_property
		(object_class, PROP_CHANNEL,
		 g_param_spec_uint (NM_SETTING_WIRELESS_CHANNEL,
						"Channel",
						"Wireless channel to use for the WiFi connection.  The "
						"device will only join (or create for Ad-Hoc networks) "
						"a WiFi network on the specified channel.  Because "
						"channel numbers overlap between bands, this property "
						"also requires the 'band' property to be set.",
						0, G_MAXUINT32, 0,
						G_PARAM_READWRITE | G_PARAM_CONSTRUCT));

	/**
	 * NMSettingWireless:bssid:
	 *
	 * If specified, directs the device to only associate with the given access
	 * point.  This capability is highly driver dependent and not supported by
	 * all devices.  Note: this property does not control the BSSID used when
	 * creating an Ad-Hoc network and is unlikely to in the future.
	 **/
	g_object_class_install_property
		(object_class, PROP_BSSID,
		 _nm_param_spec_specialized (NM_SETTING_WIRELESS_BSSID,
							   "BSSID",
							   "If specified, directs the device to only associate "
							   "with the given access point.  This capability is "
							   "highly driver dependent and not supported by all "
							   "devices.  Note: this property does not control "
							   "the BSSID used when creating an Ad-Hoc network "
							   "and is unlikely to in the future.",
							   DBUS_TYPE_G_UCHAR_ARRAY,
							   G_PARAM_READWRITE));

	/**
	 * NMSettingWireless:rate:
	 *
	 * If non-zero, directs the device to only use the specified bitrate for
	 * communication with the access point.  Units are in Kb/s, ie 5500 = 5.5
	 * Mbit/s.  This property is highly driver dependent and not all devices
	 * support setting a static bitrate.
	 **/
	g_object_class_install_property
		(object_class, PROP_RATE,
		 g_param_spec_uint (NM_SETTING_WIRELESS_RATE,
						"Rate",
						"If non-zero, directs the device to only use the "
						"specified bitrate for communication with the access "
						"point.  Units are in Kb/s, ie 5500 = 5.5 Mbit/s.  This "
						"property is highly driver dependent and not all devices "
						"support setting a static bitrate.",
						0, G_MAXUINT32, 0,
						G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_FUZZY_IGNORE));

	/**
	 * NMSettingWireless:tx-power:
	 *
	 * If non-zero, directs the device to use the specified transmit power.
	 * Units are dBm.  This property is highly driver dependent and not all
	 * devices support setting a static transmit power.
	 **/
	g_object_class_install_property
		(object_class, PROP_TX_POWER,
		 g_param_spec_uint (NM_SETTING_WIRELESS_TX_POWER,
						"TX Power",
						"If non-zero, directs the device to use the specified "
						"transmit power.  Units are dBm.  This property is highly "
						"driver dependent and not all devices support setting a "
						"static transmit power.",
						0, G_MAXUINT32, 0,
						G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_FUZZY_IGNORE));

	/**
	 * NMSettingWireless:mac-address:
	 *
	 * If specified, this connection will only apply to the WiFi device
	 * whose permanent MAC address matches. This property does not change the MAC address
	 * of the device (i.e. MAC spoofing).
	 **/
	g_object_class_install_property
		(object_class, PROP_MAC_ADDRESS,
		 _nm_param_spec_specialized (NM_SETTING_WIRELESS_MAC_ADDRESS,
							   "Device MAC Address",
							   "If specified, this connection will only apply to "
							   "the WiFi device whose permanent MAC address matches.  "
							   "This property does not change the MAC address "
							   "of the device (i.e. MAC spoofing).",
							   DBUS_TYPE_G_UCHAR_ARRAY,
							   G_PARAM_READWRITE));

	/**
	 * NMSettingWireless:cloned-mac-address:
	 *
	 * If specified, request that the Wifi device use this MAC address instead of its
	 * permanent MAC address.  This is known as MAC cloning or spoofing.
	 **/
	g_object_class_install_property
		(object_class, PROP_CLONED_MAC_ADDRESS,
		 _nm_param_spec_specialized (NM_SETTING_WIRELESS_CLONED_MAC_ADDRESS,
	                                     "Spoof MAC Address",
	                                     "If specified, request that the WiFi device use "
	                                     "this MAC address instead of its permanent MAC address.  "
	                                     "This is known as MAC cloning or spoofing.",
	                                     DBUS_TYPE_G_UCHAR_ARRAY,
	                                     G_PARAM_READWRITE));

	/**
	 * NMSettingWireless:mac-address-blacklist:
	 *
	 * A list of permanent MAC addresses of Wi-Fi devices to which this
	 * connection should never apply.  Each MAC address should be given in the
	 * standard hex-digits-and-colons notation (eg '00:11:22:33:44:55').
	 **/
	g_object_class_install_property
		(object_class, PROP_MAC_ADDRESS_BLACKLIST,
		 _nm_param_spec_specialized (NM_SETTING_WIRELESS_MAC_ADDRESS_BLACKLIST,
		                             "MAC Address Blacklist",
		                             "A list of permanent MAC addresses of Wi-Fi "
		                             "devices to which this connection should "
		                             "never apply.  Each MAC address should be "
		                             "given in the standard hex-digits-and-colons "
		                             "notation (eg '00:11:22:33:44:55').",
		                             DBUS_TYPE_G_LIST_OF_STRING,
		                             G_PARAM_READWRITE | NM_SETTING_PARAM_FUZZY_IGNORE));

	/**
	 * NMSettingWireless:seen-bssids:
	 *
	 * A list of BSSIDs (each BSSID formatted as a MAC address like
	 * '00:11:22:33:44:55') that have been detected as part of the Wi-FI network.
	 * NetworkManager internally tracks previously seen BSSIDs. The property is only
	 * meant for reading and reflects the BBSID list of NetworkManager. The changes you
	 * make to this property will not be preserved.
	 **/
	g_object_class_install_property
		(object_class, PROP_SEEN_BSSIDS,
		 _nm_param_spec_specialized (NM_SETTING_WIRELESS_SEEN_BSSIDS,
		                             "Seen BSSIDS",
		                             "A list of BSSIDs (each BSSID formatted as a MAC "
		                             "address like 00:11:22:33:44:55') that have been "
		                             "detected as part of the WiFI network. "
		                             "NetworkManager internally tracks previously seen "
		                             "BSSIDs. The property is only meant for reading "
		                             "and reflects the BBSID list of NetworkManager. "
		                             "The changes you make to this property will not be "
		                             "preserved.",
		                             DBUS_TYPE_G_LIST_OF_STRING,
		                             G_PARAM_READWRITE | NM_SETTING_PARAM_FUZZY_IGNORE));

	/**
	 * NMSettingWireless:mtu:
	 *
	 * If non-zero, only transmit packets of the specified size or smaller,
	 * breaking larger packets up into multiple Ethernet frames.
	 **/
	g_object_class_install_property
		(object_class, PROP_MTU,
		 g_param_spec_uint (NM_SETTING_WIRELESS_MTU,
						"MTU",
						"If non-zero, only transmit packets of the specified "
						"size or smaller, breaking larger packets up into "
						"multiple Ethernet frames.",
						0, G_MAXUINT32, 0,
						G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_FUZZY_IGNORE));

	/**
	 * NMSettingWireless:security:
	 *
	 * If the wireless connection has any security restrictions, like 802.1x,
	 * WEP, or WPA, set this property to '802-11-wireless-security' and ensure
	 * the connection contains a valid 802-11-wireless-security setting.
	 *
	 * Deprecated: 0.9.10: No longer used. Security rescrictions are recognized by
	 * the presence of NM_SETTING_WIRELESS_SECURITY_SETTING_NAME in the connection.
	 **/
	g_object_class_install_property
		(object_class, PROP_SEC,
		 g_param_spec_string (NM_SETTING_WIRELESS_SEC,
						  "Security",
						  "If the wireless connection has any security "
						  "restrictions, like 802.1x, WEP, or WPA, set this "
						  "property to '" NM_SETTING_WIRELESS_SECURITY_SETTING_NAME "' "
						  "and ensure the connection contains a valid "
						  NM_SETTING_WIRELESS_SECURITY_SETTING_NAME " setting.",
						  NULL,
						  G_PARAM_READWRITE));

	/**
	 * NMSettingWireless:hidden:
	 *
	 * If %TRUE, indicates this network is a non-broadcasting network that
	 * hides its SSID.  In this case various workarounds may take place, such
	 * as probe-scanning the SSID for more reliable network discovery.  However,
	 * these workarounds expose inherent insecurities with hidden SSID networks,
	 * and thus hidden SSID networks should be used with caution.
	 **/
	g_object_class_install_property
		(object_class, PROP_HIDDEN,
		 g_param_spec_boolean (NM_SETTING_WIRELESS_HIDDEN,
		                       "Hidden",
		                       "If TRUE, indicates this network is a non-broadcasting "
		                       "network that hides its SSID.  In this case various "
		                       "workarounds may take place, such as probe-scanning "
		                       "the SSID for more reliable network discovery.  "
		                       "However, these workarounds expose inherent "
		                       "insecurities with hidden SSID networks, and thus "
		                       "hidden SSID networks should be used with caution.",
		                       FALSE,
		                       G_PARAM_READWRITE));
}
static void
nm_setting_gsm_class_init (NMSettingGsmClass *setting_class)
{
	GObjectClass *object_class = G_OBJECT_CLASS (setting_class);
	NMSettingClass *parent_class = NM_SETTING_CLASS (setting_class);

	g_type_class_add_private (setting_class, sizeof (NMSettingGsmPrivate));

	/* virtual methods */
	object_class->set_property = set_property;
	object_class->get_property = get_property;
	object_class->finalize     = finalize;
	parent_class->verify       = verify;
	parent_class->verify_secrets = verify_secrets;
	parent_class->need_secrets = need_secrets;

	/* Properties */

	/**
	 * NMSettingGsm:number:
	 *
	 * Number to dial when establishing a PPP data session with the GSM-based
	 * mobile broadband network.  Many modems do not require PPP for connections
	 * to the mobile network and thus this property should be left blank, which
	 * allows NetworkManager to select the appropriate settings automatically.
	 **/
	g_object_class_install_property
		(object_class, PROP_NUMBER,
		 g_param_spec_string (NM_SETTING_GSM_NUMBER, "", "",
		                      NULL,
		                      G_PARAM_READWRITE |
		                      G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingGsm:username:
	 *
	 * The username used to authenticate with the network, if required.  Many
	 * providers do not require a username, or accept any username.  But if a
	 * username is required, it is specified here.
	 **/
	g_object_class_install_property
		(object_class, PROP_USERNAME,
		 g_param_spec_string (NM_SETTING_GSM_USERNAME, "", "",
		                      NULL,
		                      G_PARAM_READWRITE |
		                      G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingGsm:password:
	 *
	 * The password used to authenticate with the network, if required.  Many
	 * providers do not require a password, or accept any password.  But if a
	 * password is required, it is specified here.
	 **/
	g_object_class_install_property
		(object_class, PROP_PASSWORD,
		 g_param_spec_string (NM_SETTING_GSM_PASSWORD, "", "",
		                      NULL,
		                      G_PARAM_READWRITE |
		                      NM_SETTING_PARAM_SECRET |
		                      G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingGsm:password-flags:
	 *
	 * Flags indicating how to handle the #NMSettingGsm:password property.
	 **/
	g_object_class_install_property
		(object_class, PROP_PASSWORD_FLAGS,
		 g_param_spec_flags (NM_SETTING_GSM_PASSWORD_FLAGS, "", "",
		                     NM_TYPE_SETTING_SECRET_FLAGS,
		                     NM_SETTING_SECRET_FLAG_NONE,
		                     G_PARAM_READWRITE |
		                     G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingGsm:apn:
	 *
	 * The GPRS Access Point Name specifying the APN used when establishing a
	 * data session with the GSM-based network.  The APN often determines how
	 * the user will be billed for their network usage and whether the user has
	 * access to the Internet or just a provider-specific walled-garden, so it
	 * is important to use the correct APN for the user's mobile broadband plan.
	 * The APN may only be composed of the characters a-z, 0-9, ., and - per GSM
	 * 03.60 Section 14.9.
	 **/
	g_object_class_install_property
		(object_class, PROP_APN,
		 g_param_spec_string (NM_SETTING_GSM_APN, "", "",
		                      NULL,
		                      G_PARAM_READWRITE |
		                      G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingGsm:network-id:
	 *
	 * The Network ID (GSM LAI format, ie MCC-MNC) to force specific network
	 * registration.  If the Network ID is specified, NetworkManager will
	 * attempt to force the device to register only on the specified network.
	 * This can be used to ensure that the device does not roam when direct
	 * roaming control of the device is not otherwise possible.
	 **/
	g_object_class_install_property
		(object_class, PROP_NETWORK_ID,
		 g_param_spec_string (NM_SETTING_GSM_NETWORK_ID, "", "",
		                      NULL,
		                      G_PARAM_READWRITE |
		                      G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingGsm:pin:
	 *
	 * If the SIM is locked with a PIN it must be unlocked before any other
	 * operations are requested.  Specify the PIN here to allow operation of the
	 * device.
	 **/
	g_object_class_install_property
		(object_class, PROP_PIN,
		 g_param_spec_string (NM_SETTING_GSM_PIN, "", "",
		                      NULL,
		                      G_PARAM_READWRITE |
		                      NM_SETTING_PARAM_SECRET |
		                      G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingGsm:pin-flags:
	 *
	 * Flags indicating how to handle the #NMSettingGsm:pin property.
	 **/
	g_object_class_install_property
		(object_class, PROP_PIN_FLAGS,
		 g_param_spec_flags (NM_SETTING_GSM_PIN_FLAGS, "", "",
		                     NM_TYPE_SETTING_SECRET_FLAGS,
		                     NM_SETTING_SECRET_FLAG_NONE,
		                     G_PARAM_READWRITE |
		                     G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingGsm:home-only:
	 *
	 * When %TRUE, only connections to the home network will be allowed.
	 * Connections to roaming networks will not be made.
	 **/
	g_object_class_install_property
		(object_class, PROP_HOME_ONLY,
		 g_param_spec_boolean (NM_SETTING_GSM_HOME_ONLY, "", "",
		                       FALSE,
		                       G_PARAM_READWRITE |
		                       G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingGsm:device-id:
	 *
	 * The device unique identifier (as given by the WWAN management service)
	 * which this connection applies to.  If given, the connection will only
	 * apply to the specified device.
	 *
	 * Since: 1.2
	 **/
	g_object_class_install_property
		(object_class, PROP_DEVICE_ID,
		 g_param_spec_string (NM_SETTING_GSM_DEVICE_ID, "", "",
		                      NULL,
		                      G_PARAM_READWRITE |
		                      G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingGsm:sim-id:
	 *
	 * The SIM card unique identifier (as given by the WWAN management service)
	 * which this connection applies to.  If given, the connection will apply
	 * to any device also allowed by #NMSettingGsm:device-id which contains a
	 * SIM card matching the given identifier.
	 *
	 * Since: 1.2
	 **/
	g_object_class_install_property
		(object_class, PROP_SIM_ID,
		 g_param_spec_string (NM_SETTING_GSM_SIM_ID, "", "",
		                      NULL,
		                      G_PARAM_READWRITE |
		                      G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingGsm:sim-operator-id:
	 *
	 * A MCC/MNC string like "310260" or "21601" identifying the specific
	 * mobile network operator which this connection applies to.  If given,
	 * the connection will apply to any device also allowed by
	 * #NMSettingGsm:device-id and #NMSettingGsm:sim-id which contains a SIM
	 * card provisioined by the given operator.
	 *
	 * Since: 1.2
	 **/
	g_object_class_install_property
		(object_class, PROP_SIM_OPERATOR_ID,
		 g_param_spec_string (NM_SETTING_GSM_SIM_OPERATOR_ID, "", "",
		                      NULL,
		                      G_PARAM_READWRITE |
		                      G_PARAM_STATIC_STRINGS));

	/* Ignore incoming deprecated properties */
	_nm_setting_class_add_dbus_only_property (parent_class, "allowed-bands",
	                                          G_VARIANT_TYPE_UINT32,
	                                          NULL, NULL);
	_nm_setting_class_add_dbus_only_property (parent_class, "network-type",
	                                          G_VARIANT_TYPE_INT32,
	                                          NULL, NULL);
}
static void
nm_setting_ip6_config_class_init (NMSettingIP6ConfigClass *setting_class)
{
	GObjectClass *object_class = G_OBJECT_CLASS (setting_class);
	NMSettingClass *parent_class = NM_SETTING_CLASS (setting_class);

	g_type_class_add_private (setting_class, sizeof (NMSettingIP6ConfigPrivate));

	/* virtual methods */
	object_class->set_property = set_property;
	object_class->get_property = get_property;
	object_class->finalize     = finalize;
	parent_class->verify       = verify;

	/* Properties */
	/**
	 * NMSettingIP6Config:method:
	 *
	 * IPv6 configuration method.  If 'auto' is specified then the appropriate
	 * automatic method (DHCP, PPP, advertisement, etc) is used for the
	 * interface and most other properties can be left unset.  To force the use
	 * of DHCP only, specify 'dhcp'; this  method is only valid for ethernet-
	 * based hardware.  If 'link-local' is specified, then an IPv6 link-local
	 * address will be assigned to the interface.  If 'manual' is specified,
	 * static IP addressing is used and at least one IP address must be given
	 * in the 'addresses' property.  If 'ignored' is specified, IPv6
	 * configuration is not done. This property must be set.  NOTE: the 'shared'
	 * method are not yet supported.
	 **/
	g_object_class_install_property
		(object_class, PROP_METHOD,
		 g_param_spec_string (NM_SETTING_IP6_CONFIG_METHOD,
						      "Method",
						      "IPv6 configuration method.  If 'auto' is specified "
						      "then the appropriate automatic method (PPP, router "
						      "advertisement, etc) is used for the device and "
						      "most other properties can be left unset.  To force "
						      "the use of DHCP only, specify 'dhcp'; this method "
						      "is only valid for ethernet-based hardware.  If "
						      "'link-local' is specified, then an IPv6 link-local "
						      "address will be assigned to the interface.  If "
						      "'manual' is specified, static IP addressing is "
						      "used and at least one IP address must be given in "
						      " the 'addresses' property.  If 'ignored' is "
						      "specified, IPv6 configuration is not done. This "
						      "property must be set.  NOTE: the 'shared' method"
						      "is not yet supported.",
						      NULL,
						      G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE));

	/**
	 * NMSettingIP6Config:dns:
	 *
	 * Array of DNS servers, where each member of the array is a byte array
	 * containing the IPv6 address of the DNS server (in network byte order).
	 * For the 'auto' method, these DNS servers are appended to those (if any)
	 * returned by automatic configuration.  DNS servers cannot be used with
	 * the 'shared' or 'link-local' methods as there is no usptream network. In
	 * all other methods, these DNS servers are used as the only DNS servers for
	 * this connection.
	 **/
	g_object_class_install_property
		(object_class, PROP_DNS,
		 _nm_param_spec_specialized (NM_SETTING_IP6_CONFIG_DNS,
							   "DNS",
							   "Array of DNS servers, where each member of the "
							   "array is a byte array containing the IPv6 address "
							   "of the DNS server (in network byte order). For "
							   "the 'auto' method, these DNS servers are "
							   "appended to those (if any) returned by automatic "
							   "configuration.  DNS servers cannot be used with "
							   "the 'shared' or 'link-local' methods as there is "
							   "no usptream network.  In all other methods, "
							   "these DNS servers are used as the only DNS "
							   "servers for this connection.",
							   DBUS_TYPE_G_ARRAY_OF_ARRAY_OF_UCHAR,
							   G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE));

	/**
	 * NMSettingIP6Config:dns-search:
	 *
	 * List of DNS search domains.  For the 'auto' method, these search domains
	 * are appended to those returned by automatic configuration. Search domains
	 * cannot be used with the 'shared' or 'link-local' methods as there is no
	 * upstream network.  In all other methods, these search domains are used
	 * as the only search domains for this connection.
	 **/
	g_object_class_install_property
		(object_class, PROP_DNS_SEARCH,
		 _nm_param_spec_specialized (NM_SETTING_IP6_CONFIG_DNS_SEARCH,
							   "DNS search",
							   "List of DNS search domains.  For the 'auto' "
							   "method, these search domains are appended to "
							   "those returned by automatic configuration. "
							   "Search domains cannot be used with the 'shared' "
							   "or 'link-local' methods as there is no upstream "
							   "network.  In all other methods, these search "
							   "domains are used as the only search domains for "
							   "this connection.",
							   DBUS_TYPE_G_LIST_OF_STRING,
							   G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE));

	/**
	 * NMSettingIP6Config:addresses:
	 *
	 * Array of IPv6 address structures.  Each IPv6 address structure is
	 * composed of 3 members, the first being a byte array containing the IPv6
	 * address (network byte order), the second a 32-bit integer containing the
	 * IPv6 address prefix, and the third a byte array containing the IPv6
	 * address (network byte order) of the gateway associated with this address,
	 * if any.  If no gateway is given, the third element should be given as
	 * all zeros.  For the 'auto' method, given IP addresses are appended to
	 * those returned by automatic configuration.  Addresses cannot be used with
	 * the 'shared' or 'link-local' methods as the interface is automatically
	 * assigned an address with these methods.
	 **/
	g_object_class_install_property
		(object_class, PROP_ADDRESSES,
		 _nm_param_spec_specialized (NM_SETTING_IP6_CONFIG_ADDRESSES,
							   "Addresses",
							   "Array of IPv6 address structures.  Each IPv6 "
							   "address structure is composed of 3 members, the "
							   "first being a byte array containing the IPv6 "
							   "address (network byte order), the second a "
							   "32-bit integer containing the IPv6 address "
							   "prefix, and the third a byte array containing "
							   "the IPv6 address (network byte order) of the "
							   "gateway associated with this address, if any. "
							   "If no gateway is given, the third element should "
							   "be given as all zeros.  For the 'auto' method, "
							   "given IP addresses are appended to those returned "
							   "by automatic configuration.  Addresses cannot be "
							   "used with the 'shared' or 'link-local' methods "
							   "as the interface is automatically assigned an "
							   "address with these methods.",
							   DBUS_TYPE_G_ARRAY_OF_IP6_ADDRESS,
							   G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE));

	/**
	 * NMSettingIP6Config:routes:
	 *
	 * Array of IPv6 route structures.  Each IPv6 route structure is composed
	 * of 4 members; the first being the destination IPv6 network or
	 * address (network byte order) as a byte array, the second the destination
	 * network or address IPv6 prefix, the third being the next-hop IPv6 address
	 * (network byte order) if any, and the fourth being the route metric. For
	 * the 'auto' method, given IP routes are appended to those returned by
	 * automatic configuration.  Routes cannot be used with the 'shared' or
	 * 'link-local' methods because there is no upstream network.
	 **/
	g_object_class_install_property
		(object_class, PROP_ROUTES,
		 _nm_param_spec_specialized (NM_SETTING_IP6_CONFIG_ROUTES,
							   "Routes",
							   "Array of IPv6 route structures.  Each IPv6 route "
							   "structure is composed of 4 members; the first "
							   "being the destination IPv6 network or address "
							   "(network byte order) as a byte array, the second "
							   "the destination network or address IPv6 prefix, "
							   "the third being the next-hop IPv6 address "
							   "(network byte order) if any, and the fourth "
							   "being the route metric. For the 'auto' method, "
							   "given IP routes are appended to those returned "
							   "by automatic configuration.  Routes cannot be "
							   "used with the 'shared' or 'link-local' methods "
							   "because there is no upstream network.",
							   DBUS_TYPE_G_ARRAY_OF_IP6_ROUTE,
							   G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE));

	/**
	 * NMSettingIP6Config:ignore-auto-routes:
	 *
	 * When the method is set to 'auto' or 'dhcp' and this property is set to
	 * TRUE, automatically configured routes are ignored and only routes
	 * specified in #NMSettingIP6Config:routes, if any, are used.
	 **/
	g_object_class_install_property
		(object_class, PROP_IGNORE_AUTO_ROUTES,
		 g_param_spec_boolean (NM_SETTING_IP6_CONFIG_IGNORE_AUTO_ROUTES,
						   "Ignore automatic routes",
						   "When the method is set to 'auto' or 'dhcp' and this "
						   "property is set to TRUE, automatically configured "
						   "routes are ignored and only routes specified in the "
						   "'routes' property, if any, are used.",
						   FALSE,
						   G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE));

	/**
	 * NMSettingIP6Config:ignore-auto-dns:
	 *
	 * When the method is set to 'auto' or 'dhcp' and this property is set to
	 * TRUE, automatically configured nameservers and search domains are ignored
	 * and only nameservers and search domains specified in
	 * #NMSettingIP6Config:dns and #NMSettingIP6Config:dns-search, if any, are
	 * used.
	 **/
	g_object_class_install_property
		(object_class, PROP_IGNORE_AUTO_DNS,
		 g_param_spec_boolean (NM_SETTING_IP6_CONFIG_IGNORE_AUTO_DNS,
						   "Ignore DHCPv6/RDNSS DNS",
						   "When the method is set to 'auto' or 'dhcp' and this "
						   "property is set to TRUE, automatically configured "
						   "nameservers and search domains are ignored and only "
						   "nameservers and search domains specified in the 'dns' "
						   "and 'dns-search' properties, if any, are used.",
						   FALSE,
						   G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE));

	/**
	 * NMSettingIP6Config:never-default:
	 *
	 * If TRUE, this connection will never be the default IPv6 connection,
	 * meaning it will never be assigned the default IPv6 route by NetworkManager.
	 **/
	g_object_class_install_property
		(object_class, PROP_NEVER_DEFAULT,
		 g_param_spec_boolean (NM_SETTING_IP6_CONFIG_NEVER_DEFAULT,
						   "Never default",
						   "If TRUE, this connection will never be the default "
						   "IPv6 connection, meaning it will never be assigned "
						   "the default IPv6 route by NetworkManager.",
						   FALSE,
						   G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE));

	/**
	 * NMSettingIP6Config:may-fail:
	 *
	 * If TRUE, allow overall network configuration to proceed even if IPv6
	 * configuration times out.  Note that at least one IP configuration
	 * must succeed or overall network configuration will still fail.  For
	 * example, in IPv4-only networks, setting this property to TRUE allows
	 * the overall network configuration to succeed if IPv6 configuration fails
	 * but IPv4 configuration completes successfully.
	 **/
	g_object_class_install_property
		(object_class, PROP_MAY_FAIL,
		 g_param_spec_boolean (NM_SETTING_IP6_CONFIG_MAY_FAIL,
						   "May Fail",
						   "If TRUE, allow overall network configuration to "
						   "proceed even if IPv6 configuration times out. "
						   "Note that at least one IP configuration must "
						   "succeed or overall network configuration will still "
						   "fail.  For example, in IPv4-only networks, setting "
						   "this property to TRUE allows the overall network "
						   "configuration to succeed if IPv6 configuration "
						   "fails but IPv4 configuration completes successfully.",
						   TRUE,
						   G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE));

	/**
	 * NMSettingIP6Config:ip6-privacy:
	 *
	 * Configure IPv6 Privacy Extensions for SLAAC, described in RFC4941.
	 * If enabled, it makes the kernel generate a temporary IPv6 address
	 * in addition to the public one generated from MAC address via
	 * modified EUI-64.  This enhances privacy, but could cause problems
	 * in some applications, on the other hand.  The permitted values
	 * are: 0: disabled, 1: enabled (prefer public address),
	 * 2: enabled (prefer temporary addresses).
	 **/
	g_object_class_install_property
		(object_class, PROP_IP6_PRIVACY,
		 g_param_spec_int (NM_SETTING_IP6_CONFIG_IP6_PRIVACY,
		                   "Configure IPv6 Privacy",
		                   "Configure IPv6 Privacy Extensions for SLAAC, described "
		                   "in RFC4941.  If enabled, it makes the kernel generate "
		                   "a temporary IPv6 address in addition to the public one "
		                   "generated from MAC address via modified EUI-64.  This "
		                   "enhances privacy, but could cause problems in some "
		                   "applications, on the other hand.  The permitted values "
		                   "are: 0: disabled, 1: enabled (prefer public address), "
		                   "2: enabled (prefer temporary addresses).",
		                   NM_SETTING_IP6_CONFIG_PRIVACY_UNKNOWN,
		                   NM_SETTING_IP6_CONFIG_PRIVACY_PREFER_TEMP_ADDR,
		                   NM_SETTING_IP6_CONFIG_PRIVACY_UNKNOWN,
		                   G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE));

}
static void
nm_setting_bridge_port_class_init (NMSettingBridgePortClass *setting_class)
{
	GObjectClass *object_class = G_OBJECT_CLASS (setting_class);
	NMSettingClass *parent_class = NM_SETTING_CLASS (setting_class);

	g_type_class_add_private (setting_class, sizeof (NMSettingBridgePortPrivate));

	/* virtual methods */
	object_class->set_property = set_property;
	object_class->get_property = get_property;
	parent_class->verify       = verify;

	/* Properties */
	/**
	 * NMSettingBridgePort:priority:
	 *
	 * The Spanning Tree Protocol (STP) priority of this bridge port.
	 **/
	/* ---ifcfg-rh---
	 * property: priority
	 * variable: BRIDGING_OPTS: priority=
	 * values: 0 - 63
	 * default: 32
	 * description: STP priority.
	 * ---end---
	 */
	g_object_class_install_property
		(object_class, PROP_PRIORITY,
		 g_param_spec_uint (NM_SETTING_BRIDGE_PORT_PRIORITY, "", "",
		                    0, BR_MAX_PORT_PRIORITY, BR_DEF_PRIORITY,
		                    G_PARAM_READWRITE |
		                    G_PARAM_CONSTRUCT |
		                    NM_SETTING_PARAM_INFERRABLE |
		                    G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingBridgePort:path-cost:
	 *
	 * The Spanning Tree Protocol (STP) port cost for destinations via this
	 * port.
	 **/
	/* ---ifcfg-rh---
	 * property: path-cost
	 * variable: BRIDGING_OPTS: path_cost=
	 * values: 1 - 65535
	 * default: 100
	 * description: STP cost.
	 * ---end---
	 */
	g_object_class_install_property
		(object_class, PROP_PATH_COST,
		 g_param_spec_uint (NM_SETTING_BRIDGE_PORT_PATH_COST, "", "",
		                    0, BR_MAX_PATH_COST, 100,
		                    G_PARAM_READWRITE |
		                    G_PARAM_CONSTRUCT |
		                    NM_SETTING_PARAM_INFERRABLE |
		                    G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingBridgePort:hairpin-mode:
	 *
	 * Enables or disabled "hairpin mode" for the port, which allows frames to
	 * be sent back out through the port the frame was received on.
	 **/
	/* ---ifcfg-rh---
	 * property: hairpin-mode
	 * variable: BRIDGING_OPTS: hairpin_mode=
	 * default: yes
	 * description: Hairpin mode of the bridge port.
	 * ---end---
	 */
	g_object_class_install_property
		(object_class, PROP_HAIRPIN_MODE,
		 g_param_spec_boolean (NM_SETTING_BRIDGE_PORT_HAIRPIN_MODE, "", "",
		                       FALSE,
		                       G_PARAM_READWRITE |
		                       NM_SETTING_PARAM_INFERRABLE |
		                       G_PARAM_STATIC_STRINGS));
}
static gboolean
verify (NMSetting *setting, NMConnection *connection, GError **error)
{
	NMSettingIP6ConfigPrivate *priv = NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting);
	NMSettingIPConfig *s_ip = NM_SETTING_IP_CONFIG (setting);
	NMSettingVerifyResult ret;
	const char *method;

	ret = NM_SETTING_CLASS (nm_setting_ip6_config_parent_class)->verify (setting, connection, error);
	if (ret != NM_SETTING_VERIFY_SUCCESS)
		return ret;

	method = nm_setting_ip_config_get_method (s_ip);
	/* Base class already checked that it exists */
	g_assert (method);

	if (!strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_MANUAL)) {
		if (nm_setting_ip_config_get_num_addresses (s_ip) == 0) {
			g_set_error (error,
			             NM_CONNECTION_ERROR,
			             NM_CONNECTION_ERROR_MISSING_PROPERTY,
			             _("this property cannot be empty for '%s=%s'"),
			             NM_SETTING_IP_CONFIG_METHOD, method);
			g_prefix_error (error, "%s.%s: ", NM_SETTING_IP6_CONFIG_SETTING_NAME, NM_SETTING_IP_CONFIG_ADDRESSES);
			return FALSE;
		}
	} else if (   !strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_IGNORE)
	           || !strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL)
	           || !strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_SHARED)) {
		if (nm_setting_ip_config_get_num_dns (s_ip) > 0) {
			g_set_error (error,
			             NM_CONNECTION_ERROR,
			             NM_CONNECTION_ERROR_INVALID_PROPERTY,
			             _("this property is not allowed for '%s=%s'"),
			             NM_SETTING_IP_CONFIG_METHOD, method);
			g_prefix_error (error, "%s.%s: ", NM_SETTING_IP6_CONFIG_SETTING_NAME, NM_SETTING_IP_CONFIG_DNS);
			return FALSE;
		}

		if (nm_setting_ip_config_get_num_dns_searches (s_ip) > 0) {
			g_set_error (error,
			             NM_CONNECTION_ERROR,
			             NM_CONNECTION_ERROR_INVALID_PROPERTY,
			             _("this property is not allowed for '%s=%s'"),
			             NM_SETTING_IP_CONFIG_METHOD, method);
			g_prefix_error (error, "%s.%s: ", NM_SETTING_IP6_CONFIG_SETTING_NAME, NM_SETTING_IP_CONFIG_DNS_SEARCH);
			return FALSE;
		}

		if (nm_setting_ip_config_get_num_addresses (s_ip) > 0) {
			g_set_error (error,
			             NM_CONNECTION_ERROR,
			             NM_CONNECTION_ERROR_INVALID_PROPERTY,
			             _("this property is not allowed for '%s=%s'"),
			             NM_SETTING_IP_CONFIG_METHOD, method);
			g_prefix_error (error, "%s.%s: ", NM_SETTING_IP6_CONFIG_SETTING_NAME, NM_SETTING_IP_CONFIG_ADDRESSES);
			return FALSE;
		}
	} else if (   !strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_AUTO)
	           || !strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_DHCP)) {
		/* nothing to do */
	} else {
		g_set_error_literal (error,
		                     NM_CONNECTION_ERROR,
		                     NM_CONNECTION_ERROR_INVALID_PROPERTY,
		                     _("property is invalid"));
		g_prefix_error (error, "%s.%s: ", NM_SETTING_IP6_CONFIG_SETTING_NAME, NM_SETTING_IP_CONFIG_METHOD);
		return FALSE;
	}

	if (!NM_IN_SET (priv->addr_gen_mode,
	                NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE_EUI64,
	                NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE_STABLE_PRIVACY)) {
		g_set_error_literal (error,
		                     NM_CONNECTION_ERROR,
		                     NM_CONNECTION_ERROR_INVALID_PROPERTY,
		                      _("property is invalid"));
		g_prefix_error (error, "%s.%s: ", NM_SETTING_IP6_CONFIG_SETTING_NAME, NM_SETTING_IP_CONFIG_METHOD);
		return FALSE;
	}

	return TRUE;
}
static void
nm_setting_vlan_class_init (NMSettingVlanClass *setting_class)
{
	GObjectClass *object_class = G_OBJECT_CLASS (setting_class);
	NMSettingClass *parent_class = NM_SETTING_CLASS (setting_class);

	g_type_class_add_private (setting_class, sizeof (NMSettingVlanPrivate));

	/* virtual methods */
	object_class->set_property = set_property;
	object_class->get_property = get_property;
	object_class->finalize     = finalize;
	parent_class->verify       = verify;

	/* Properties */

	/**
	 * NMSettingVlan:parent:
	 *
	 * If given, specifies the parent interface name or parent connection UUID
	 * from which this VLAN interface should be created.  If this property is
	 * not specified, the connection must contain an #NMSettingWired setting
	 * with a #NMSettingWired:mac-address property.
	 **/
	/* ---ifcfg-rh---
	 * property: parent
	 * variable: DEVICE or PHYSDEV
	 * description: Parent interface of the VLAN.
	 * ---end---
	 */
	g_object_class_install_property
		(object_class, PROP_PARENT,
		 g_param_spec_string (NM_SETTING_VLAN_PARENT, "", "",
		                      NULL,
		                      G_PARAM_READWRITE |
		                      G_PARAM_CONSTRUCT |
		                      NM_SETTING_PARAM_INFERRABLE |
		                      G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingVlan:id:
	 *
	 * The VLAN identifier that the interface created by this connection should
	 * be assigned. The valid range is from 0 to 4094, without the reserved id 4095.
	 **/
	/* ---ifcfg-rh---
	 * property: id
	 * variable: VLAN_ID or DEVICE
	 * description: VLAN identifier.
	 * ---end---
	 */
	g_object_class_install_property
		(object_class, PROP_ID,
		 g_param_spec_uint (NM_SETTING_VLAN_ID, "", "",
		                    0, 4095, 0,
		                    G_PARAM_READWRITE |
		                    G_PARAM_CONSTRUCT |
		                    NM_SETTING_PARAM_INFERRABLE |
		                    G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingVlan:flags:
	 *
	 * One or more flags which control the behavior and features of the VLAN
	 * interface.  Flags include %NM_VLAN_FLAG_REORDER_HEADERS (reordering of
	 * output packet headers), %NM_VLAN_FLAG_GVRP (use of the GVRP protocol),
	 * and %NM_VLAN_FLAG_LOOSE_BINDING (loose binding of the interface to its
	 * master device's operating state). %NM_VLAN_FLAG_MVRP (use of the MVRP
	 * protocol).
	 *
	 * The default value of this property is NM_VLAN_FLAG_REORDER_HEADERS,
	 * but it used to be 0. To preserve backward compatibility, the default-value
	 * in the D-Bus API continues to be 0 and a missing property on D-Bus
	 * is still considered as 0.
	 **/
	/* ---ifcfg-rh---
	 * property: flags
	 * variable: GVRP, MVRP, VLAN_FLAGS
	 * values: "yes or "no" for GVRP and MVRP; "LOOSE_BINDING" and "NO_REORDER_HDR" for VLAN_FLAGS
	 * description: VLAN flags.
	 * ---end---
	 */
	g_object_class_install_property
		(object_class, PROP_FLAGS,
		 g_param_spec_flags (NM_SETTING_VLAN_FLAGS, "", "",
		                     NM_TYPE_VLAN_FLAGS,
		                     NM_VLAN_FLAG_REORDER_HEADERS,
		                     G_PARAM_READWRITE |
		                     G_PARAM_CONSTRUCT |
		                     NM_SETTING_PARAM_INFERRABLE |
		                     G_PARAM_STATIC_STRINGS));
	_nm_setting_class_override_property (parent_class, NM_SETTING_VLAN_FLAGS,
	                                     NULL,
	                                     _override_flags_get,
	                                     NULL,
	                                     _override_flags_not_set);

	/**
	 * NMSettingVlan:ingress-priority-map:
	 *
	 * For incoming packets, a list of mappings from 802.1p priorities to Linux
	 * SKB priorities.  The mapping is given in the format "from:to" where both
	 * "from" and "to" are unsigned integers, ie "7:3".
	 **/
	/* ---ifcfg-rh---
	 * property: ingress-priority-map
	 * variable: VLAN_INGRESS_PRIORITY_MAP
	 * description: Ingress priority mapping.
	 * example: VLAN_INGRESS_PRIORITY_MAP=4:2,3:5
	 * ---end---
	 */
	g_object_class_install_property
		(object_class, PROP_INGRESS_PRIORITY_MAP,
		 g_param_spec_boxed (NM_SETTING_VLAN_INGRESS_PRIORITY_MAP, "", "",
		                     G_TYPE_STRV,
		                     G_PARAM_READWRITE |
		                     NM_SETTING_PARAM_INFERRABLE |
		                     G_PARAM_STATIC_STRINGS));

	/**
	 * NMSettingVlan:egress-priority-map:
	 *
	 * For outgoing packets, a list of mappings from Linux SKB priorities to
	 * 802.1p priorities.  The mapping is given in the format "from:to" where
	 * both "from" and "to" are unsigned integers, ie "7:3".
	 **/
	/* ---ifcfg-rh---
	 * property: egress-priority-map
	 * variable: VLAN_EGRESS_PRIORITY_MAP
	 * description: Egress priority mapping.
	 * example: VLAN_EGRESS_PRIORITY_MAP=5:4,4:1,3:7
	 * ---end---
	 */
	g_object_class_install_property
		(object_class, PROP_EGRESS_PRIORITY_MAP,
		 g_param_spec_boxed (NM_SETTING_VLAN_EGRESS_PRIORITY_MAP, "", "",
		                     G_TYPE_STRV,
		                     G_PARAM_READWRITE |
		                     NM_SETTING_PARAM_INFERRABLE |
		                     G_PARAM_STATIC_STRINGS));

	/* ---ifcfg-rh---
	 * property: interface-name
	 * variable: PHYSDEV and VLAN_ID, or DEVICE
	 * description: VLAN interface name.
	 *   If all variables are set, parent device from PHYSDEV takes precedence over DEVICE,
	 *   but VLAN id from DEVICE takes precedence over VLAN_ID.
	 * example: PHYSDEV=eth0, VLAN_ID=12; or DEVICE=eth0.12
	 * ---end---
	 * ---dbus---
	 * property: interface-name
	 * format: string
	 * description: Deprecated in favor of connection.interface-name, but can
	 *   be used for backward-compatibility with older daemons, to set the
	 *   vlan's interface name.
	 * ---end---
	 */
	_nm_setting_class_add_dbus_only_property (parent_class, "interface-name",
	                                          G_VARIANT_TYPE_STRING,
	                                          _nm_setting_get_deprecated_virtual_interface_name,
	                                          NULL);
}