Commit Graph

52 Commits

Author SHA1 Message Date
Dan Winship
c81fb49aa5 all: fix up multiple-include-guard defines
Previously, src/nm-ip4-config.h, libnm/nm-ip4-config.h, and
libnm-glib/nm-ip4-config.h all used "NM_IP4_CONFIG_H" as an include
guard, which meant that nm-test-utils.h could not tell which of them
was being included (and so, eg, if you tried to include
nm-ip4-config.h in a libnm test, it would fail to compile because
nm-test-utils.h was referring to symbols in src/nm-ip4-config.h).

Fix this by changing the include guards in the non-API-stable parts of
the tree:

  - libnm-glib/nm-ip4-config.h remains   NM_IP4_CONFIG_H
  - libnm/nm-ip4-config.h now uses     __NM_IP4_CONFIG_H__
  - src/nm-ip4-config.h now uses       __NETWORKMANAGER_IP4_CONFIG_H__

And likewise for all other headers.

The two non-"nm"-prefixed headers, libnm/NetworkManager.h and
src/NetworkManagerUtils.h are now __NETWORKMANAGER_H__ and
__NETWORKMANAGER_UTILS_H__ respectively, which, while not entirely
consistent with the general scheme, do still mostly make sense in
isolation.
2014-08-16 10:17:14 -04:00
Dan Winship
dc1b76432b include: drop nm-settings-flags.h, move NMSecretAgentGetSecretsFlags
For some reason, the flags used by o.fd.NM.SecretAgent.GetSecrets were
defined as both NMSecretAgentGetSecretsFlags in
libnm{,-glib}/nm-secret-agent.h, and then separately as
NMSettingsGetSecretsFlags in include/nm-settings-flags.h.
(NMSettingsGetSecretsFlags also had an additional internal-use-only
value, but that was added later after the duplication already
existed.)

Fix this by moving NMSecretAgentGetSecretsFlags from libnm to
nm-dbus-interface.h, adding the internal-use-only value to it as well,
updating the core code to use that, and then removing
nm-settings-flags.h.
2014-08-01 14:34:39 -04:00
Dan Winship
b28f6526c2 core: fill in nm-types.h, clean out other headers
Clean up some of the cross-includes between headers (which made it so
that, eg, if you included NetworkManagerUtils.h in a test program, you
would need to build the test with -I$(top_srcdir)/src/platform, and if
you included nm-device.h you'd need $(POLKIT_CFLAGS)) by moving all
GObject struct definitions for src/ and src/settings/ into nm-types.h
(which already existed to solve the NMDevice/NMActRequest circular
references).

Update various .c files to explicitly include the headers they used to
get implicitly, and remove some now-unnecessary -I options from
Makefiles.
2014-07-23 10:56:26 -04:00
Dan Williams
4237df8c21 core: allow active connection 'master' to be set after object creation
We want to create the object earlier now, and figuring out the master is
a lot of code that we don't want to run before creating the object.  The
master still must be set before exporting the object over D-Bus though,
as before.
2013-10-31 14:15:08 -05:00
Dan Williams
0e595abcf3 core: pass NMAuthSubject around activation paths instead of uid + dbus sender 2013-10-31 14:15:08 -05:00
Pavel Šimerda
5affa446aa core: remove assume from nm-activation-request
Whether an active connection is assumed or connected from scratch is
only important during nm_device_activate(). When the activation process
is set up, there's no difference from any other active connection.

Acked-by: Dan Winship <danw@gnome.org>
Acked-by: Thomas Haller <thaller@redhat.com>
2013-08-22 22:06:47 +02:00
Dan Winship
5a223b9089 core: make nm-properties-changed-signal always export the right properties
Change the way that nm-properties-changed-signal works, and parse the
dbus-binding-tool-generated info to get the exact list of properties
that it's expected to export.

This makes NM_PROPERTY_PARAM_NO_EXPORT unnecessary, and also fixes the
problem of properties like NMDevice:hw-address being exported on
classes where it shouldn't be.
2013-05-20 16:38:33 -03:00
Dan Williams
84603c2380 core: move most activation request logic to the active connection class
We'll want to use NMActiveConnection more in the manager and also fold
the PendingActivation functionality into it.  All this functionality
applies to the VPN connections too, so it makes sense to have it all
in the base class instead of both NMActRequest and NMVPNConnection.
2012-12-17 17:01:10 -06:00
Dan Williams
b4a11a86f7 core: rework master/slave handling 2012-11-30 13:21:51 -06:00
Jiří Klimeš
65ce4e52ef core: add some helper functions to activation request 2012-09-24 10:38:26 +02:00
Jiří Klimeš
edb85e9720 core: fix NM_IS_*_CLASS(klass) macros
The argument is 'klass' not 'obj'.
2012-07-27 13:15:54 +02:00
Dan Williams
db94e37eb5 core: wait for dependencies before continuing with device activation
Before jumping to activation stage 1, make sure dependencies are activated.
2012-03-01 17:40:17 -06:00
Dan Williams
0b8ff52fdd core: track active connection dependencies
Track a master active connection and emit wait/ready/fail when
it changes state.  This signal is intended for devices to
delay their activation until a master device is ready.
2012-03-01 17:40:17 -06:00
Dan Williams
7aa2a8271d core: use NMActiveConnection objects throughout activation paths
They are the basic class that tracks active connections, and we're
going to use them for connection dependencies.  So use the fact that
both NMVPNConnection and NMActRequest have the same base class
instead of using object paths.
2012-03-01 17:40:17 -06:00
Dan Williams
b378c3089c core: make NMActiveConnection a base class for NMActRequest and NMVPNConnection
That was always the goal, but never got there.  This time we need it
for real to abstract handling of dependent connections so bite the
bullet and make it happen.
2012-02-09 17:54:26 -06:00
Dan Williams
4e4bfeb499 core: add nm-secrets-flags.h for secret agent flags typedef
Make it clearer what's going on instead of using flags here and there
and numbers elsewhere.
2011-03-29 22:53:22 -05:00
Dan Williams
0e6a5365d4 core: move secrets handling to NMSettingsConnection
It's the thing that owns the secrets anyway, and it simplifies things to
have the secrets handling there instead of half in NMActRequest and
half in NMManager.  It also means we can get rid of the ugly signals
that NMSettingsConnection had to emit to get agent's secrets, and
we can consolidate the requests for the persistent secrets that the
NMSettingsConnection owned into NMSettingsConnection itself instead
of also in NMAgentManager.

Since the NMActRequest and the NMVPNConnection classes already tracked
the underlying NMSettingsConnection representing the activation, its
trivial to just have them ask the NMSettingsConnection for secrets
instead of talking to the NMAgentManager.  Thus, only the
NMSettingsConnection now has to know about the agent manager, and it
presents a cleaner interface to other objects further up the chain,
instead of having bits of the secrets request splattered around the
activation request, the VPN connection, the NMManager, etc.
2011-01-27 10:41:02 -06:00
Dan Williams
4427774d57 agents: filter agents by UID for user-requested connections
When a user makes an explicit request for secrets via GetSecrets
or activates a device, don't ask other users' agents for secrets.
Restrict secrets request to agents owned by the user that made the
initial activate or GetSecrets request.

Automatic activations still request secrets from any available agent.
2011-01-26 18:36:08 -06:00
Dan Williams
68ab26143b core: use GetSecrets flags everywhere 2011-01-18 14:57:44 -06:00
Dan Williams
62a2c34e27 core: simplify secrets handling during activation
Instead of a bizare mechanism of signals back to the manager
object that used to be required because of the user/system settings
split, let each place that needs secrets request those secrets
itself.  This flattens the secrets request process a ton and
the code flow significantly.

Previously the get secrets flow was something like this:

nm_act_request_get_secrets ()
    nm_secrets_provider_interface_get_secrets ()
        emits manager-get-secrets signal
            provider_get_secerts ()
                system_get_secrets ()
                    system_get_secrets_idle_cb ()
                        nm_sysconfig_connection_get_secrets ()
                            system_get_secrets_reply_cb ()
                                nm_secrets_provider_interface_get_secrets_result ()
                                    signal failure or success

now instead we do something like this:

nm_agent_manager_get_secrets ()
    nm_agent_manager_get_secrets ()
        request_start_secrets ()
            nm_sysconfig_connection_get_secrets ()
                return failure or success to callback
2010-12-13 21:14:23 -06:00
Dan Williams
37c411abc9 core: add 'default6' property to ActiveConnection implementations 2010-04-15 15:26:11 -07:00
Dan Williams
78bb1c01b7 core: implement connection assumption
Mark activation requests that contain connections to be assumed,
and use that to short-circuit various parts of the activation
process by not touching various device attributes, since they
are already set up.  Also ensure the device is not deactivated
when it initially becomes managed, because that would kill the
connection we are about to assume.
2009-08-05 18:03:09 -04:00
Dan Williams
c9067d8fed everything: use libgudev instead of HAL; merge NM and nm-system-settings
The only thing that doesn't work yet is the system-settings service's
"auto eth" connections for ethernet devices that don't have an existing
connection.  Might also have issues with unmanaged devices that can't
provide a MAC address until they are brought up, but we'll see.
2009-06-11 00:39:12 -04:00
Dan Williams
15e64d31ea modem: remove SECRETS_CALLER_HSO_GSM; ModemManager abstracts modems for us
Fixes a bug where if GSM secrets were required, the connection would fail
because they were requested with SECRETS_CALLER_HSO_GSM, but the function
to handle retrieved secrets only expected SECRETS_CALLER_GSM.
2009-05-20 12:30:09 -04:00
Przemysław Grzegorczyk
bac45aa0d5 clean up glib includes (bgo #564376)
Only <glib.h> and <gtk/gtk.h> need to be included.
2009-01-19 00:16:40 -05:00
Dan Williams
24e50f7f6f 2008-11-02 Dan Williams <dcbw@redhat.com>
* Add license headers to everything in src/



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4247 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-11-03 04:13:42 +00:00
Dan Williams
02b28e6cd2 2008-08-15 Dan Williams <dcbw@redhat.com>
Do connection sharing in a cleaner manner; all required iptables rules
	are now stored in the activation request and pertain only to the device
	which is being shared to other computers.

	* src/nm-activation-request.c
	  src/nm-activation-request.h
		- (nm_act_request_add_share_rule): new function; add a sharing rule to
			the activation request which will get torn down automatically when
			the activation request dies
		- (nm_act_request_set_shared): push sharing rules to iptables when sharing
			is started, and tear them down when sharing is stopped

	* src/nm-device.c
		- (start_sharing): start up sharing by doing the required iptables magic
		- (share_init): poke the right bits of the kernel and load the right
			modules for NAT
		- (nm_device_activate_stage5_ip_config_commit): start NAT-ing this
			connection if it's a 'shared' connection

	* src/NetworkManagerPolicy.c
		- Remove all sharing stuff; done in the device code itself



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3969 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-08-15 15:34:28 +00:00
Dan Williams
b3d2fb40e6 2008-08-14 Dan Williams <dcbw@redhat.com>
* src/nm-activation-request.h
		- Add HSO secrets caller

	* src/nm-gsm-device.c
	  src/nm-gsm-device.h
		- (modem_wait_for_reply): add a 'user_data' argument so callers can pass
			something to the callback function
		- (set_apn, set_apn_done): call class dial function, not a static one
		- (nm_gsm_device_class_init): add a class 'dial' function

	* src/nm-hal-manager.c
		- (get_hso_netdev): find the hso-driven hardware's net device
		- (modem_device_creator): recognize hso-driven hardware and create the
			right type of device object for it

	* src/Makefile.am
	  src/nm-hso-gsm-device.c
	  src/nm-hso-gsm-device.h
		- Implement support for devices driven by the 'hso' driver as a subclass
			of NMGsmDevice



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3961 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-08-14 17:03:12 +00:00
Dan Williams
8c79f16f5d 2008-07-01 Dan Williams <dcbw@redhat.com>
Fix mobile broadband username/password issues.  NM was never requesting
	mobile broadband secrets, nor was it passing back the username and password
	if it had them.

	* marshallers/nm-marshal.list
		- Add some new types for activation request objects

	* src/nm-activation-request.c
	  src/nm-activation-request.h
		- (get_secrets_cb): pass the caller type in the signal
		- (nm_act_request_request_connection_secrets): take a caller type, so
			that GetSecrets() reply handlers know who asked for the secrets in
			the first place; use secret hints too so the settings service can
			figure out exactly what NM wants (ie, PIN or the PPP password)

	* src/ppp-manager/nm-ppp-manager.c
	  src/ppp-manager/nm-ppp-manager.h
		- (impl_ppp_manager_need_secrets): nm_connection_need_secrets() won't
			detect needed secrets when the secret could be blank, like GSM/CDMA
			passwords.  So always ask for secrets, and send a hint as to what
			secret we really want.
		- (nm_ppp_manager_update_secrets): make function more generic by making
			the device specific class figure out the username and password, and
			accept an error argument to return back over D-Bus

	* src/nm-device-wifi.c
		- (link_timeout_cb, handle_auth_or_fail): update for changes to
			nm_act_request_request_connection_secrets()
		- (real_connection_secrets_updated): update for 'caller' changes

	* src/nm-device.c
	  src/nm-device.h
		- (connection_secrets_updated_cb, connection_secrets_failed_cb): update
			for 'caller' changes

	* src/nm-device-ethernet.c
		- (real_connection_secrets_updated): update for 'caller' changes and
			move logic for getting PPPoE username and password here before
			calling nm_ppp_manager_update_secrets()
		- (link_timeout_cb, handle_auth_or_fail): update for changes to
			nm_act_request_request_connection_secrets()

	* src/nm-cdma-device.c
		- (real_connection_secrets_updated): pass username and password back
			to the PPP manager when required

	* src/nm-gsm-device.c
		- (enter_pin): send the required secret name to the settings service
		- (real_connection_secrets_updated): pass username and password back
			to the PPP manager when required



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3794 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-07-01 20:21:31 +00:00
Dan Williams
b0cf66eda8 2008-06-26 Dan Williams <dcbw@redhat.com>
* Update FSF address in license headers (Michael Biebl <biebl@debian.org>)



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3775 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-06-26 18:31:52 +00:00
Dan Williams
ac64d14e8d 2008-06-09 Dan Williams <dcbw@redhat.com>
* src/nm-activation-request.c
	  src/nm-activation-request.h
		- (nm_act_request_set_shared, nm_act_request_get_shared,
		   nm_act_request_get_device): new functions to facilitate connection
			sharing



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3736 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-06-10 02:02:21 +00:00
Dan Williams
d92960e47f Add nm_act_request_get_default()
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3706 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-05-29 20:30:02 +00:00
Dan Williams
095da180c8 2008-04-21 Dan Williams <dcbw@redhat.com>
* src/nm-activation-request.c
	  src/nm-activation-request.h
		- (dispose): ensure to disconnect from the device's state-changed signal
			when appropriate so the signal doesn't get handled by an already
			disposed NMActRequest
		- (device_state_changed): update is_default here too just to make sure
			default is only True when the child device is activated
		- (nm_act_request_set_default): new function

	* src/NetworkManagerPolicy.c
		- (update_routing_and_dns): set 'default' on the active connection which
			has the default route and DNS



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3584 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-04-22 02:40:47 +00:00
Dan Williams
ec89663e7d 2008-03-26 Dan Williams <dcbw@redhat.com>
Rework VPN connection handling for a more consistent D-Bus API.  The
	VPNManager object has been removed, and active VPN connections are now the
	same as any other active connection.  The Manager object's ActivateConnection
	and DeactivateConnection methods are used to start and stop a VPN connection,
	and the VPNConnection objects are subclasses of the ActiveConnection objects.
	When activating a VPN connection, pass the path of the active connection
	to which the VPN connection is tied in the 'specific_object' argument.

	Consequently, the libnm-glib API has been reworked to match this arrangement,
	with the VPNManager object removed, and the NMVPNConnection objects now
	being subclasses of NMActiveConnection.



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3504 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-03-26 13:43:01 +00:00
Dan Williams
393685203f 2008-03-20 Dan Williams <dcbw@redhat.com>
* introspection/nm-manager.xml
	  introspection/nm-manager-client.xml
		- (ActivateConnection): return the object path of the active connection
			on success
		- (GetActiveConnections): remove
		- (DeactivateConnection): new function; deactivate a currently active
			connection
		- Add an ActiveConnections property which returns an array of
			active connection object paths

	* introspection/nm-device.xml
		- (Deactivate): remove

	* introspection/all.xml
		- Add ActiveConnection introspection

	* introspection/nm-active-connection.xml
		- Add the ActiveConnection object

	* include/NetworkManager.h
		- Add the Connection.Active D-Bus interface

	* src/nm-device-interface.c
		- (impl_device_deactivate): remove

	* src/nm-activation-request.c
	  src/nm-activation-request.c
	  src/Makefile.am
		- Implement the Connection.Active D-Bus interface

	* src/nm-manager.c
		- (get_property, nm_manager_class_init): add ACTIVE_CONNECTIONS property
		- (nm_manager_activate_device): return the active connection path
		- (connection_added_default_handler, impl_manager_activate_connection):
			return the active connection to the caller
		- (add_one_connection_element, impl_manager_get_active_connections):
			remove
		- (impl_manager_deactivate_connection): new function; deactivate an
			active connection

	* libnm-glib/nm-device.c
	  libnm-glib/nm-device.h
		- Remove Deactivate() function



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3484 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-03-20 19:56:12 +00:00
Dan Williams
70e79d60dd 2008-03-17 Dan Williams <dcbw@redhat.com>
Split the 802.1x bits out of the wireless-security setting so they are
	generalized enough for wired 802.1x to use too.

	* introspection/nm-exported-connection.xml
		- GetSecrets now returns 'a{sa{sv}}' (a hash of settings hashes) instead
			of just a hash of the secrets for one setting

	* libnm-util/nm-setting-wireless-security.c
	  libnm-util/nm-setting-wireless-security.h
		- Remove 802.1x-specific stuff
		- Added leap-username and leap-password properties for old-school LEAP

	* src/nm-device.c
	  src/nm-device.h
		- (connection_secrets_updated_cb): take a list of updated settings names,
			not just one

	* src/supplicant-manager/nm-supplicant-config.c
	  src/supplicant-manager/nm-supplicant-config.h
		- (nm_supplicant_config_add_setting_wireless_security): remove 802.1x
			specific stuff; fix for updated LEAP bits; punt 802.1x stuff
			to nm_supplicant_config_add_setting_8021x()
		- (nm_supplicant_config_add_setting_8021x): add an 802-1x setting to
			the supplicant config

	* src/nm-device-802-11-wireless.c
		- (build_supplicant_config): pass in the 802.1x setting too, if any
		- (real_connection_secrets_updated): take a list of updated settings
			names, not just one

	* src/nm-device-802-3-ethernet.c
	  src/nm-cdma-device.c
	  src/nm-gsm-device.c
		- (real_connection_secrets_updated_cb): take a list of updated settings
			names, not just one

	* src/nm-activation-request.c
	  src/nm-activation-request.h
		- (nm_act_request_class_init): the 'connection-secrets-updated' signal
			now passes a list of updated settings names, not just one
		- (update_one_setting): new function; handle one updated setting
		- (get_secrets_cb): handle multiple settings returned from the
			settings service; have to be careful of ordering here as there are
			some dependencies between settings (ex. wireless-security and 802.1x
			in some cases)

	* src/marshallers/nm-marshal.list
		- new marshaller for connection-secrets-updated signal

	* libnm-util/nm-setting-8021x.c
		- Add back the 'pin' and 'psk' settings, for EAP-SIM and EAP-PSK auth
			methods
		- (verify): a valid 'eap' property is now required

	* libnm-util/nm-connection.c
		- (register_default_settings): add priorities to settings; there are
			some dependencies between settings, and during the need_secrets
			calls this priority needs to be respected.  For example, only the
			wireless-security setting knows whether or not the connection is
			going to use 802.1x or now, so it must be asked for secrets before
			any existing 802.1x setting is
		- (nm_connection_lookup_setting_type): expose

	* libnm-util/nm-setting-wireless.c
		- (verify): should verify even if all_settings is NULL; otherwise won't
			catch the case where there is missing security

	* libnm-util/nm-setting-wireless-security.c
		- Remove everything to do with 802.1x
		- Add old-school LEAP specific properties for username and password
		- (need_secrets): rework LEAP secrets checking
		- (verify): rework for LEAP and 802.1x verification



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3470 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-03-17 19:37:23 +00:00
Dan Williams
fb67dd539b 2007-10-21 Dan Williams <dcbw@redhat.com>
* src/nm-activation-request.h
	  src/nm-activation-request.c
		- (nm_act_request_set_specific_object): new function; allow setting the
			specific object if one isn't set yet



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2991 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-10-22 01:51:41 +00:00
Tambet Ingo
485bcfe571 2007-09-28 Tambet Ingo <tambet@gmail.com>
* src/nm-manager.c:
        * src/nm-manager.h:
        Implement device activation through NMManager.
        Implement "pending device activation" here - If the connection
isn't found,
        we try to wait for up to 5 seconds for the connection to be
provided.
        Add NMConnectionType argument to "connection-added" and
"connection-removed"
        signals.
        (nm_manager_get): Remove. Finally.

        * src/nm-activation-request.c: 
        * src/nm-activation-request.h: 
        Remove all the deferred activation code.

        * src/nm-device.c: Remove all the deferred activation code. Once
        * the device
        activation is started, it's started. Update the activation
virtual function
        signature.

        * src/nm-device-interface.c:
        * src/nm-device-interface.h:
        Device activation now takes only NMActRequest argument.
        Don't expose device activation directly on dbus, it's supposed
to go through
        NMManager now.

        * src/NetworkManagerPolicy.c (nm_policy_device_change_check):
        * Make the code
        a bit more compact.
        Use the new device activation methods through NMManager.

        * introspection/nm-manager-client.xml: 
        * introspection/nm-manager.xml: 
        * libnm-glib/nm-client.c:
        * libnm-glib/nm-client.h:
        Add device activation method.
        
        * libnm-glib/nm-device.c: 
        * libnm-glib/nm-device.h: 
        * introspection/nm-device.xml: 
        Remove device activation method. It's done through NMManager
now.

        * src/vpn-manager/nm-vpn-manager.c (impl_vpn_manager_connect):
        * Use the shiny
        new (nm_manager_get_device_by_path) function, get rid of our own
)find_device).



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2915 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-10-01 15:38:39 +00:00
Dan Williams
b1bd00af07 2007-09-26 Dan Williams <dcbw@redhat.com>
* src/nm-manager.c
	  src/nm-manager.h
	  src/nm-activation-request.c
	  src/nm-activation-request.h
		- Move the GetSecrets stuff out of the NMManager instance because it
			doesn't really need to be there and complicates things

	* src/nm-device.c
		- (connection_secrets_failed_cb, device_activation_go): connect to the
			connection-secrets-failed signal and deactivate the device if
			the GetSecrets call fails

	* src/nm-device-802-11-wireless.c
		- (link_timeout_cb, supplicant_connection_timeout_cb,
		   real_act_stage2_config, real_act_stage4_ip_config_timeout): request
			secrets and give correct hints about whether new secrets should be
			asked for by the client or not



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2899 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-09-27 04:52:03 +00:00
Dan Williams
a4ab8e22e6 2007-09-25 Dan Williams <dcbw@redhat.com>
* src/nm-activation-request.c
	  src/nm-activation-request.h
		- (nm_act_request_is_deferred): new function



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2870 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-09-25 06:07:24 +00:00
Dan Williams
92ee635c59 2007-09-14 Dan Williams <dcbw@redhat.com>
Implement deferred activation handling in the NMActRequest class.  When a
	client wants to activate a device but must create the NMConnection details
	on the fly, there likely hasn't been enough time yet for NM to receive the
	new connection signal and grab all the connection details.  So the
	activation is deferred (and bounded by a timer) for a while, and if the
	connection appears within the window, it is activated.

	* src/nm-activation-request.c
	  src/nm-activation-request.h
		- (nm_act_request_class_init): two new signals to support deferred
			activation, to allow the listener to handle both timeout and success
		- (nm_act_request_new_deferred): new function, starts the deferred
			activation timeout handler and listens to the NMManager for
			new-connection signals to notice when the connection comes in



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2811 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-09-14 19:43:28 +00:00
Dan Williams
937d1add73 2007-09-11 Dan Williams <dcbw@redhat.com>
* libnm-util/nm-setting.c
	  libnm-util/nm-setting.h
		- (nm_setting_update_secrets): new function; add a virtual function that
			subclasses can implement to update their secrets
		- (setting_wireless_security_update_secrets): implement that function
			for the 802-11-wireless-security subclass

	* libnm-util/nm-connection.c
	  libnm-util/nm-connection.h
		- (nm_connection_update_secrets): update secrets for a Setting and
			emit a signal on success

	* src/nm-manager.c
	  src/nm-manager.h
	  src/nm-marshal.list
		- (connection_get_settings_cb): enable system settings bits
		- (nm_manager_get_connection_secrets, get_secrets_cb): add function
			to request secrets from the settings dbus service and to
			push those secrets to the NMConnection itself

	* src/nm-activation-request.c
	  src/nm-activation-request.h
		- Attach to the 'secrets-updated' signal of the NMConnection that's
			currently being activated, and proxy that signal to other listeners.
			Goes through the activation request because the activation request
			is the thing that manages the lifetime of the NMConnection that's
			being activated.

	* src/nm-device-802-11-wireless.c
		- (real_connection_secrets_updated): implement the connection secrets
			updated notification and restart activation when secrets are
			received
		- (real_act_stage2_config): request secrets from the settings dbus
			service if secrets are needed

	* src/nm-device.c
	  src/nm-device.h
		- (clear_act_request, nm_device_activation_cancel,
		   nm_device_deactivate_quickly, nm_device_dispose): consolidate places
			where the activation request is cleared
		- (nm_device_activate, connection_secrets_updated_cb): attach to the
			updated secrets signal of activation request and add a function
			that subclasses can override to handle it easily



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2782 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-09-11 18:02:27 +00:00
Dan Williams
7a8f33aa3d 2007-08-28 Dan Williams <dcbw@redhat.com>
Remove NMAPSecurity objects, they are replaced with flags on the APs for
	each AP's capabilities, and by NMConnection/NMSettings objects for user
	defined connections.

	* include/NetworkManager.h
		- Redefine 802.11 security properties.  There are now device capabilities
			and AP flags and AP security flags.  It was way to unclear before.

	* src/Makefile.am
	  src/nm-ap-security-leap.h
	  src/nm-ap-security-leap.c
	  src/nm-ap-security-wpa-eap.c
	  src/nm-ap-security-wpa-eap.h
	  src/nm-ap-security-private.h
	  src/nm-ap-security-wpa-psk.c
	  src/nm-ap-security-wpa-psk.h
	  src/nm-ap-security-wep.c
	  src/nm-ap-security-wep.h
	  src/nm-ap-security.c
	  src/nm-ap-security.h
		- Removed, to be replaced with NMConnection/NMSettings objects

	* src/nm-dbus-nmi.c
	  src/nm-dbus-nmi.h
		- Removed, to be replaced by code that talks to the new info daemon
			interface and gets NMConnection/NMSettings objects

	* src/backends/NetworkManagerSuSE.c
		- Remove usage of NMAPSecurity; should be replaced by a system-level
			info-daemon that does the same thing but talks the new info-daemon
			D-Bus interface

	* src/NetworkManagerAP.h
	  src/NetworkManagerAP.c
	  src/NetworkManagerAPList.c
	  libnm-glib/libnm-glib-test.c
		- Remove usage of NMAPSecurity objects and adjust to new flags for
			WPA/RSN

	* libnm-glib/nm-access-point.c
	  libnm-glib/nm-access-point.h
	  introspection/nm-access-point.xml
	  test/nm-tool.c
		- Adjust to new flags for AP security

	* utils/nm-utils.c
	  utils/nm-utils.h
	  src/vpn-manager/nm-dbus-vpn.c
		- Remove D-Bus pending call stuff from nm-utils and put it in the VPN
			stuff which is the only place it's used

	* src/nm-device-interface.c
	  src/nm-device-interface.h
	  introspection/nm-device.xml
	  src/nm-activation-request.c
	  src/nm-activation-request.h
	  src/nm-device.c
		- Add a new 'specific_object' argument that hints to NM what actual
			AP or other device-specific thing the connection should apply to.
			NMConnection objects can apply to more than one actual device/AP.

	* libnm-util/nm-connection.c
	* libnm-util/nm-connection.h
		- Add 'have_secrets" call stubs

	* libnm-util/cipher.h
		- Move NM_AUTH_TYPE_* defines here for now

	* src/nm-device-802-11-wireless.c
		- Remove usage of NMAPSecurity, to be replaced with NMConnection/
			NMSettings objects

	* src/NetworkManagerDbus.c
	* src/NetworkManagerPolicy.c
		- Remove usage of update_allowed_networks, should be pushing data in
			a different manner



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2738 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-08-28 14:47:31 +00:00
Tambet Ingo
9d1808c4e5 2007-06-11 Tambet Ingo <tambet@ximian.com>
* src/nm-device.c: Make the activation stage virtual functions take NMDevice
	argument. The activation request is easy to retrieve.

	* src/nm-activation-request.c: Convert to GObject. Do not include half of NM headers
	just to be a convenient location for devices to store random stuff.




git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2587 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-06-11 13:36:34 +00:00
Tambet Ingo
ff0fd77b08 2007-05-07 Tambet Ingo <tambet@ximian.com>
* libnm-glib/Makefile.am: Link with libnm-util to gain access to
	NMConnection.

	* libnm-glib/nm-device-802-11-wireless.c:
	(nm_device_802_3_ethernet_activate): Remove.

	* libnm-glib/nm-device-802-3-ethernet.c
	(nm_device_802_3_ethernet_activate): Remove.

	* libnm-glib/nm-device.c (nm_device_activate): Implement.

	* src/nm-device-802-3-ethernet.c: Implement the new activation using
	NMConnection.

	* src/nm-device-802-11-wireless.c: Store an activation AP once the
	activation has started.
	Implement the new activation using NMConnection.

	* src/nm-activation-request.c: Store a generic connection object instead
	of a wireless-specific AP.

	* src/NetworkManagerPolicy.c (create_connection): Implement. Depending
	on device type, create a device specific connection object suitable for
	device activation.

	* src/nm-device.c (nm_device_activate): Re-implement. Call the device
	specific check to validate the connection and on success start the
	activation.

	* src/nm-device-interface.h: Add a activate virtual function to the
	interface definition.

	* src/nm-device-interface.c (nm_device_interface_activate): Implement.
	(impl_device_activate): Implement.

	* introspection/nm-device.xml: Add a generic device activation interface
	that accepts an abstract NMConnection structure that has device-specific
	information in it.

	* introspection/nm-device-802-3-ethernet.xml: Remove the wired-specific
	activation interface.

	* introspection/nm-device-802-11-wireless.xml: Remove the wireless-specific
	activation interface.



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2569 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-05-07 15:17:45 +00:00
Tambet Ingo
8fa8ac4c80 2007-03-15 Tambet Ingo <tambet@ximian.com>
* src/nm-device-802-11-wireless.c (constructor): Initialize the iw_ext structures
	with zeroes before passing them to functions - the functions never do that and
	reading the values back may produce wrong values.
	(real_bring_up): Store the signal handler id ...
	(real_bring_down): ... So that it can be removed here.
	Disconnect the supplicant interface here as well.
	(nm_device_802_11_wireless_ap_list_get_ap_by_obj_path): Use the dbus object path
	from the access point instead of old $device/Networks/$essid.

	* src/nm-manager.c (nm_manager_get_state): Return NM_STATE_CONNECTED when the
	device state is connected (instead of just having link/carrier).

	* src/nm-activation-request.c: Don't store NMData in activation request, it's
	already easily accessible through the device.

	* src/NetworkManagerAP.c (nm_ap_init): Construct the dbus object path here and
	store it within the object.
	(nm_ap_get_dbus_path): Export it to public as well.

	* src/dhcp-manager/nm-dhcp-manager.c (nm_dhcp_manager_get): Keep the ownership
	of the singleton.



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2478 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-03-16 09:06:48 +00:00
Tambet Ingo
537b30f99e 2007-02-20 Tambet Ingo <tambet@ximian.com>
* libnm-glib/nm-device-802-11-wireless.c: Add "network-added" and
	"network-removed" signals.

	* libnm-glib/libnm-glib.pc.in: Require NetworkManager >= 0.7.0.

	* libnm-glib/nm-access-point.c: Add "strength-changed" signal, emit it
	when receiving the signal from dbus.

	* src/nm-device-802-11-wireless.c (get_property): Fix PROP_ACTIVE_NETWORK
	property.

	* src/NetworkManagerPolicy.c (state_changed): Fix a typo to make the
	deactivation of the previously activated device working again.

	* src/nm-activation-request.c: Remove NMActStage property and it's getter
	and setter.

	* src/nm-device.c (nm_device_is_activated): Remove.
	state == NM_DEVICE_STATE_ACTIVATED is just as easy to use.

	* include/NetworkManager.h: Remove NM_DBUS_NO_DEVICES_ERROR,
	NM_DBUS_NO_DIALUP_ERROR, NM_DBUS_NO_NETWORKS_ERROR,
	NM_DBUS_NO_ACTIVE_DEVICE_ERROR, NM_DBUS_NO_ACTIVE_NET_ERROR errors and
	NM_DBUS_SIGNAL_STATE_CHANGE signal.
	Remove NMNetworkStatus and NMActStage enums.



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2345 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-02-20 15:24:42 +00:00
Tambet Ingo
58b53400a5 2007-02-05 Tambet Ingo <tambet@ximian.com>
* src/NetworkManagerMain.h: Remove all references to DHCP manager.

	* src/NetworkManager.c: Don't initialize the DHCP manager, it's a
	singleton now.

	* src/nm-device.c: Use the new DHCP manager API.

	* src/nm-activation-request.c:
	* src/nm-activation-request.h:
		- Remove all dhcp related properties and methods.



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2284 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-02-05 09:50:11 +00:00
Dan Williams
4ed4b491fa 2005-12-31 Dan Williams <dcbw@redhat.com>
* refactor NMDevice into a GObject-based framework with separate
		objects for wired and wireless.  The following files are no
		longer used but should stick around for a bit so we don't
		loose code through the cracks:
			NetworkManagerDevice.c
			NetworkManagerDevice.h
			NetworkManagerWireless.c
			NetworkManagerWireless.h

	The intent here is to allow each device type to manage its own
	connection & activation life-cycle, ie to allow wireless devices
	to interface with wpa_supplicant, etc.  There's a fair bit of
	encapsulation breakage right now that should gradually get pulled
	back into each device, along with things like periodic property
	updates and link probing.


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1244 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2005-12-31 08:21:24 +00:00
Dan Williams
db4f5cedf7 2005-05-05 Dan Williams <dcbw@redhat.com>
* Expose activation stages to NetworkManager clients, like the applet
	* Add Diana's progress icons to the applet, cued off NM activation stage
	* Use more descriptive tooltips, cued off NM activation stage


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@611 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2005-05-06 02:58:06 +00:00