2008-11-03 04:13:42 +00:00
|
|
|
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
|
|
|
|
/* NetworkManager -- Network link manager
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2007 - 2008 Novell, Inc.
|
2010-05-22 15:55:30 +00:00
|
|
|
* Copyright (C) 2007 - 2010 Red Hat, Inc.
|
2008-11-03 04:13:42 +00:00
|
|
|
*/
|
|
|
|
|
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-13 18:10:11 +00:00
|
|
|
#ifndef __NETWORKMANAGER_MANAGER_H__
|
|
|
|
#define __NETWORKMANAGER_MANAGER_H__
|
2007-02-08 15:34:26 +00:00
|
|
|
|
2015-04-13 17:31:42 +00:00
|
|
|
#include "nm-exported-object.h"
|
2015-07-14 14:53:24 +00:00
|
|
|
#include "nm-settings-connection.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))
|
2012-07-27 11:15:54 +00:00
|
|
|
#define NM_IS_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_MANAGER))
|
2007-02-08 15:34:26 +00:00
|
|
|
#define NM_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_MANAGER, NMManagerClass))
|
|
|
|
|
2010-09-27 08:34:56 +00:00
|
|
|
#define NM_MANAGER_VERSION "version"
|
2016-09-15 20:34:24 +00:00
|
|
|
#define NM_MANAGER_CAPABILITIES "capabilities"
|
2010-05-22 15:55:30 +00:00
|
|
|
#define NM_MANAGER_STATE "state"
|
2013-08-13 21:45:34 +00:00
|
|
|
#define NM_MANAGER_STARTUP "startup"
|
2010-05-22 15:55:30 +00:00
|
|
|
#define NM_MANAGER_NETWORKING_ENABLED "networking-enabled"
|
|
|
|
#define NM_MANAGER_WIRELESS_ENABLED "wireless-enabled"
|
|
|
|
#define NM_MANAGER_WIRELESS_HARDWARE_ENABLED "wireless-hardware-enabled"
|
|
|
|
#define NM_MANAGER_WWAN_ENABLED "wwan-enabled"
|
|
|
|
#define NM_MANAGER_WWAN_HARDWARE_ENABLED "wwan-hardware-enabled"
|
2011-01-02 23:24:23 +00:00
|
|
|
#define NM_MANAGER_WIMAX_ENABLED "wimax-enabled"
|
|
|
|
#define NM_MANAGER_WIMAX_HARDWARE_ENABLED "wimax-hardware-enabled"
|
2010-05-22 15:55:30 +00:00
|
|
|
#define NM_MANAGER_ACTIVE_CONNECTIONS "active-connections"
|
2013-07-30 20:31:31 +00:00
|
|
|
#define NM_MANAGER_CONNECTIVITY "connectivity"
|
2013-08-22 17:06:51 +00:00
|
|
|
#define NM_MANAGER_PRIMARY_CONNECTION "primary-connection"
|
2014-10-23 17:56:52 +00:00
|
|
|
#define NM_MANAGER_PRIMARY_CONNECTION_TYPE "primary-connection-type"
|
2013-08-22 17:06:51 +00:00
|
|
|
#define NM_MANAGER_ACTIVATING_CONNECTION "activating-connection"
|
2014-01-08 18:18:33 +00:00
|
|
|
#define NM_MANAGER_DEVICES "devices"
|
2015-06-03 07:15:24 +00:00
|
|
|
#define NM_MANAGER_METERED "metered"
|
2015-07-03 09:06:39 +00:00
|
|
|
#define NM_MANAGER_GLOBAL_DNS_CONFIGURATION "global-dns-configuration"
|
2014-10-06 16:21:54 +00:00
|
|
|
#define NM_MANAGER_ALL_DEVICES "all-devices"
|
2010-05-22 15:55:30 +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"
|
2009-10-20 22:25:04 +00:00
|
|
|
#define NM_MANAGER_SLEEPING "sleeping"
|
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
|
|
|
|
2016-04-04 12:17:09 +00:00
|
|
|
/* signals */
|
|
|
|
#define NM_MANAGER_CHECK_PERMISSIONS "check-permissions"
|
|
|
|
#define NM_MANAGER_DEVICE_ADDED "device-added"
|
|
|
|
#define NM_MANAGER_DEVICE_REMOVED "device-removed"
|
|
|
|
#define NM_MANAGER_STATE_CHANGED "state-changed"
|
|
|
|
#define NM_MANAGER_USER_PERMISSIONS_CHANGED "user-permissions-changed"
|
|
|
|
|
2012-08-22 23:33:17 +00:00
|
|
|
/* Internal signals */
|
|
|
|
#define NM_MANAGER_ACTIVE_CONNECTION_ADDED "active-connection-added"
|
|
|
|
#define NM_MANAGER_ACTIVE_CONNECTION_REMOVED "active-connection-removed"
|
2014-10-29 14:12:18 +00:00
|
|
|
#define NM_MANAGER_CONFIGURE_QUIT "configure-quit"
|
2016-04-04 12:17:09 +00:00
|
|
|
#define NM_MANAGER_INTERNAL_DEVICE_ADDED "internal-device-added"
|
|
|
|
#define NM_MANAGER_INTERNAL_DEVICE_REMOVED "internal-device-removed"
|
2012-08-22 23:33:17 +00:00
|
|
|
|
|
|
|
|
2007-02-08 15:34:26 +00:00
|
|
|
GType nm_manager_get_type (void);
|
|
|
|
|
2015-08-03 13:26:31 +00:00
|
|
|
/* nm_manager_setup() should only be used by main.c */
|
2015-11-06 15:45:27 +00:00
|
|
|
NMManager * nm_manager_setup (void);
|
2009-06-11 04:39:12 +00:00
|
|
|
|
2014-09-05 18:15:44 +00:00
|
|
|
NMManager * nm_manager_get (void);
|
2011-09-26 16:30:24 +00:00
|
|
|
|
2015-08-03 13:26:31 +00:00
|
|
|
gboolean nm_manager_start (NMManager *manager,
|
|
|
|
GError **error);
|
2014-10-29 14:12:18 +00:00
|
|
|
void nm_manager_stop (NMManager *manager);
|
2014-09-05 18:15:44 +00:00
|
|
|
NMState nm_manager_get_state (NMManager *manager);
|
|
|
|
const GSList *nm_manager_get_active_connections (NMManager *manager);
|
|
|
|
GSList * nm_manager_get_activatable_connections (NMManager *manager);
|
2012-08-22 22:21:56 +00:00
|
|
|
|
2016-09-23 15:36:21 +00:00
|
|
|
void nm_manager_write_device_state (NMManager *manager);
|
|
|
|
|
2007-06-22 15:09:02 +00:00
|
|
|
/* Device handling */
|
|
|
|
|
2014-09-05 18:15:44 +00:00
|
|
|
const GSList * nm_manager_get_devices (NMManager *manager);
|
2016-09-09 13:17:28 +00:00
|
|
|
const char ** nm_manager_get_device_paths (NMManager *self);
|
2007-06-22 15:09:02 +00:00
|
|
|
|
2014-09-05 18:15:44 +00:00
|
|
|
NMDevice * nm_manager_get_device_by_ifindex (NMManager *manager,
|
|
|
|
int ifindex);
|
2016-07-01 10:11:01 +00:00
|
|
|
NMDevice * nm_manager_get_device_by_path (NMManager *manager,
|
|
|
|
const char *path);
|
2007-10-01 15:38:39 +00:00
|
|
|
|
2016-02-16 14:07:49 +00:00
|
|
|
char * nm_manager_get_connection_iface (NMManager *self,
|
|
|
|
NMConnection *connection,
|
|
|
|
NMDevice **out_parent,
|
|
|
|
GError **error);
|
|
|
|
|
2014-09-05 18:15:44 +00:00
|
|
|
NMActiveConnection *nm_manager_activate_connection (NMManager *manager,
|
2015-07-14 14:53:24 +00:00
|
|
|
NMSettingsConnection *connection,
|
2016-09-07 15:47:26 +00:00
|
|
|
NMConnection *applied_connection,
|
2014-09-05 18:15:44 +00:00
|
|
|
const char *specific_object,
|
|
|
|
NMDevice *device,
|
|
|
|
NMAuthSubject *subject,
|
|
|
|
GError **error);
|
2007-06-22 15:09:02 +00:00
|
|
|
|
2014-09-05 18:15:44 +00:00
|
|
|
gboolean nm_manager_deactivate_connection (NMManager *manager,
|
|
|
|
const char *connection_path,
|
|
|
|
NMDeviceStateReason reason,
|
|
|
|
GError **error);
|
2007-02-08 15:34:26 +00:00
|
|
|
|
2016-09-15 20:34:24 +00:00
|
|
|
void nm_manager_set_capability (NMManager *self, NMCapability cap);
|
2016-02-16 14:07:49 +00:00
|
|
|
|
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-13 18:10:11 +00:00
|
|
|
#endif /* __NETWORKMANAGER_MANAGER_H__ */
|