2007-02-08 15:34:26 +00:00
|
|
|
#ifndef NM_MANAGER_H
|
|
|
|
|
#define NM_MANAGER_H 1
|
|
|
|
|
|
|
|
|
|
#include <glib/gtypes.h>
|
|
|
|
|
#include <glib-object.h>
|
|
|
|
|
#include <dbus/dbus-glib.h>
|
|
|
|
|
#include "nm-device.h"
|
2007-09-20 11:25:47 +00:00
|
|
|
#include "nm-device-interface.h"
|
2007-02-08 15:34:26 +00:00
|
|
|
|
|
|
|
|
#define NM_TYPE_MANAGER (nm_manager_get_type ())
|
|
|
|
|
#define NM_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_MANAGER, NMManager))
|
|
|
|
|
#define NM_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_MANAGER, NMManagerClass))
|
|
|
|
|
#define NM_IS_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_MANAGER))
|
|
|
|
|
#define NM_IS_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_MANAGER))
|
|
|
|
|
#define NM_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_MANAGER, NMManagerClass))
|
|
|
|
|
|
|
|
|
|
#define NM_MANAGER_STATE "state"
|
|
|
|
|
#define NM_MANAGER_WIRELESS_ENABLED "wireless-enabled"
|
2007-10-15 14:46:37 +00:00
|
|
|
#define NM_MANAGER_WIRELESS_HARDWARE_ENABLED "wireless-hardware-enabled"
|
2008-03-20 19:56:12 +00:00
|
|
|
#define NM_MANAGER_ACTIVE_CONNECTIONS "active-connections"
|
2007-02-08 15:34:26 +00:00
|
|
|
|
2008-09-18 Dan Williams <dcbw@redhat.com>
Implement support for honoring configured and automatic hostnames, and for
setting the configured hostname.
* introspection/nm-ip4-config.xml
src/nm-ip4-config.c
src/nm-ip4-config.h
src/dhcp-manager/nm-dhcp-manager.c
- Remove useless hostname property; it's not really part of the IPv4
config
* introspection/nm-settings-system.xml
libnm-glib/nm-dbus-settings-system.c
libnm-glib/nm-dbus-settings-system.h
- Add SetHostname() call to system settings D-Bus interface
- Add Hostname property to system settings D-Bus interface
- (nm_dbus_settings_system_save_hostname,
nm_dbus_settings_system_get_hostname): implement
* src/nm-device.c
src/nm-device.h
- (nm_device_get_dhcp4_config): implement
* src/nm-manager.c
src/nm-manager.h
- Fetch and track system settings service hostname changes, and proxy
the changes via a GObject property of the manager
* system-settings/src/nm-system-config-interface.c
system-settings/src/nm-system-config-interface.h
- Replace nm_system_config_interface_supports_add() with a capabilities
bitfield
* system-settings/src/nm-system-config-error.c
system-settings/src/nm-system-config-error.h
- Add additional errors
* system-settings/src/dbus-settings.c
system-settings/src/dbus-settings.h
- (get_property, nm_sysconfig_settings_class_init): add hostname
property; first plugin returning a hostname wins
- (impl_settings_add_connection): use plugin capabilities instead of
nm_system_config_interface_supports_add()
- (impl_settings_save_hostname): implement hostname saving
* src/NetworkManagerPolicy.c
- (lookup_thread_run_cb, lookup_thread_worker, lookup_thread_new,
lookup_thread_die): implement an asynchronous hostname lookup thread
which given an IPv4 address tries to look up the hostname for that
address with reverse DNS
- (get_best_device): split out best device code from
update_routing_and_dns()
- (update_etc_hosts): update /etc/hosts with the machine's new hostname
to preserve the 127.0.0.1 reverse mapping that so many things require
- (set_system_hostname): set a given hostname
- (update_system_hostname): implement hostname policy; a configured
hostname (from the system settings service) is used if available,
otherwise an automatically determined hostname from DHCP, VPN, etc.
If there was no automatically determined hostname, reverse DNS of
the best device's IP address will be used, and as a last resort the
hostname 'localhost.localdomain' is set.
- (update_routing_and_dns): use get_best_device(); update the system
hostname when the network config changes
- (hostname_changed): update system hostname if the system settings
service signals a hostname change
- (nm_policy_new): list for system settings service hostname changes
- (nm_policy_destroy): ensure that an in-progress hostname lookup thread
gets told to die
* system-settings/plugins/keyfile/plugin.c
system-settings/plugins/ifcfg-suse/plugin.c
- (get_property, sc_plugin_ifcfg_class_init): implement hostname and
capabilities properties
* system-settings/plugins/ifcfg-fedora/shvar.c
- (svOpenFile): re-enable R/W access of ifcfg files since the plugin
writes out /etc/sysconfig/network now
* system-settings/plugins/ifcfg-fedora/plugin.c
- (plugin_get_hostname): get hostname from /etc/sysconfig/network
- (plugin_set_hostname): save hostname to /etc/sysconfig/network
- (sc_network_changed_cb): handle changes to /etc/sysconfig/network
- (sc_plugin_ifcfg_init): monitor /etc/sysconfig/network for changes
- (get_property, set_property, sc_plugin_ifcfg_class_init): implement
hostname get/set and capabilities get
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4077 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-09-18 15:16:44 +00:00
|
|
|
/* Not exported */
|
|
|
|
|
#define NM_MANAGER_HOSTNAME "hostname"
|
|
|
|
|
|
2007-09-27 02:18:49 +00:00
|
|
|
#define NM_MANAGER_CONNECTION_PROXY_TAG "dbus-proxy"
|
2007-10-19 04:55:05 +00:00
|
|
|
#define NM_MANAGER_CONNECTION_SECRETS_PROXY_TAG "dbus-secrets-proxy"
|
2007-09-27 02:18:49 +00:00
|
|
|
|
2007-02-08 15:34:26 +00:00
|
|
|
typedef struct {
|
|
|
|
|
GObject parent;
|
|
|
|
|
} NMManager;
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
GObjectClass parent;
|
|
|
|
|
|
|
|
|
|
/* Signals */
|
|
|
|
|
void (*device_added) (NMManager *manager, NMDevice *device);
|
|
|
|
|
void (*device_removed) (NMManager *manager, NMDevice *device);
|
2008-03-07 23:17:48 +00:00
|
|
|
void (*state_changed) (NMManager *manager, guint state);
|
2007-10-15 14:46:37 +00:00
|
|
|
void (*properties_changed) (NMManager *manager, GHashTable *properties);
|
2007-10-07 23:33:28 +00:00
|
|
|
|
2008-02-20 22:37:39 +00:00
|
|
|
void (*connections_added) (NMManager *manager, NMConnectionScope scope);
|
2007-10-07 23:33:28 +00:00
|
|
|
|
2007-10-01 15:38:39 +00:00
|
|
|
void (*connection_added) (NMManager *manager,
|
|
|
|
|
NMConnection *connection,
|
2008-02-20 22:37:39 +00:00
|
|
|
NMConnectionScope scope);
|
2007-02-08 15:34:26 +00:00
|
|
|
|
2007-10-06 04:28:46 +00:00
|
|
|
void (*connection_updated) (NMManager *manager,
|
|
|
|
|
NMConnection *connection,
|
2008-02-20 22:37:39 +00:00
|
|
|
NMConnectionScope scope);
|
2007-10-06 04:28:46 +00:00
|
|
|
|
2007-10-01 15:38:39 +00:00
|
|
|
void (*connection_removed) (NMManager *manager,
|
|
|
|
|
NMConnection *connection,
|
2008-02-20 22:37:39 +00:00
|
|
|
NMConnectionScope scope);
|
2007-02-08 15:34:26 +00:00
|
|
|
} NMManagerClass;
|
|
|
|
|
|
|
|
|
|
GType nm_manager_get_type (void);
|
|
|
|
|
|
2008-08-04 22:24:58 +00:00
|
|
|
NMManager *nm_manager_get (void);
|
2007-02-08 15:34:26 +00:00
|
|
|
|
2007-06-22 15:09:02 +00:00
|
|
|
/* Device handling */
|
|
|
|
|
|
2007-02-08 15:34:26 +00:00
|
|
|
GSList *nm_manager_get_devices (NMManager *manager);
|
2007-06-22 15:09:02 +00:00
|
|
|
|
2008-03-26 13:43:01 +00:00
|
|
|
const char * nm_manager_activate_connection (NMManager *manager,
|
|
|
|
|
NMConnection *connection,
|
|
|
|
|
const char *specific_object,
|
|
|
|
|
const char *device_path,
|
|
|
|
|
gboolean user_requested,
|
|
|
|
|
GError **error);
|
2007-06-22 15:09:02 +00:00
|
|
|
|
2008-03-26 13:43:01 +00:00
|
|
|
gboolean nm_manager_deactivate_connection (NMManager *manager,
|
|
|
|
|
const char *connection_path,
|
|
|
|
|
GError **error);
|
2007-10-01 15:38:39 +00:00
|
|
|
|
2007-06-22 15:09:02 +00:00
|
|
|
/* State handling */
|
|
|
|
|
|
2007-02-08 15:34:26 +00:00
|
|
|
NMState nm_manager_get_state (NMManager *manager);
|
|
|
|
|
|
2007-06-22 15:09:02 +00:00
|
|
|
/* Connections */
|
2007-09-09 22:18:42 +00:00
|
|
|
|
2008-02-20 22:37:39 +00:00
|
|
|
GSList *nm_manager_get_connections (NMManager *manager, NMConnectionScope scope);
|
2007-09-09 22:18:42 +00:00
|
|
|
|
|
|
|
|
NMConnection * nm_manager_get_connection_by_object_path (NMManager *manager,
|
2008-02-20 22:37:39 +00:00
|
|
|
NMConnectionScope scope,
|
2007-09-09 22:18:42 +00:00
|
|
|
const char *path);
|
2007-02-08 15:34:26 +00:00
|
|
|
|
2008-03-26 13:43:01 +00:00
|
|
|
GPtrArray * nm_manager_get_active_connections_by_connection (NMManager *manager,
|
|
|
|
|
NMConnection *connection);
|
|
|
|
|
|
2007-02-08 15:34:26 +00:00
|
|
|
#endif /* NM_MANAGER_H */
|