1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2 /* NetworkManager -- Network link manager
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 * Copyright (C) 2007 - 2008 Novell, Inc.
19 * Copyright (C) 2007 - 2010 Red Hat, Inc.
22 #ifndef __NETWORKMANAGER_MANAGER_H__
23 #define __NETWORKMANAGER_MANAGER_H__
25 #include "nm-exported-object.h"
26 #include "nm-settings-connection.h"
28 #define NM_TYPE_MANAGER (nm_manager_get_type ())
29 #define NM_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_MANAGER, NMManager))
30 #define NM_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_MANAGER, NMManagerClass))
31 #define NM_IS_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_MANAGER))
32 #define NM_IS_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_MANAGER))
33 #define NM_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_MANAGER, NMManagerClass))
35 #define NM_MANAGER_VERSION "version"
36 #define NM_MANAGER_STATE "state"
37 #define NM_MANAGER_STARTUP "startup"
38 #define NM_MANAGER_NETWORKING_ENABLED "networking-enabled"
39 #define NM_MANAGER_WIRELESS_ENABLED "wireless-enabled"
40 #define NM_MANAGER_WIRELESS_HARDWARE_ENABLED "wireless-hardware-enabled"
41 #define NM_MANAGER_WWAN_ENABLED "wwan-enabled"
42 #define NM_MANAGER_WWAN_HARDWARE_ENABLED "wwan-hardware-enabled"
43 #define NM_MANAGER_WIMAX_ENABLED "wimax-enabled"
44 #define NM_MANAGER_WIMAX_HARDWARE_ENABLED "wimax-hardware-enabled"
45 #define NM_MANAGER_ACTIVE_CONNECTIONS "active-connections"
46 #define NM_MANAGER_CONNECTIVITY "connectivity"
47 #define NM_MANAGER_PRIMARY_CONNECTION "primary-connection"
48 #define NM_MANAGER_PRIMARY_CONNECTION_TYPE "primary-connection-type"
49 #define NM_MANAGER_ACTIVATING_CONNECTION "activating-connection"
50 #define NM_MANAGER_DEVICES "devices"
51 #define NM_MANAGER_METERED "metered"
52 #define NM_MANAGER_GLOBAL_DNS_CONFIGURATION "global-dns-configuration"
53 #define NM_MANAGER_ALL_DEVICES "all-devices"
56 #define NM_MANAGER_HOSTNAME "hostname"
57 #define NM_MANAGER_SLEEPING "sleeping"
58 #define NM_MANAGER_STATE_FILE "state-file"
60 /* Internal signals */
61 #define NM_MANAGER_ACTIVE_CONNECTION_ADDED "active-connection-added"
62 #define NM_MANAGER_ACTIVE_CONNECTION_REMOVED "active-connection-removed"
63 #define NM_MANAGER_CONFIGURE_QUIT "configure-quit"
64 #define NM_MANAGER_STATE_CHANGED "state-changed"
68 NMExportedObject parent;
72 NMExportedObjectClass parent;
75 void (*device_added) (NMManager *manager, NMDevice *device);
76 void (*device_removed) (NMManager *manager, NMDevice *device);
77 void (*state_changed) (NMManager *manager, guint state);
80 GType nm_manager_get_type (void);
82 /* nm_manager_setup() should only be used by main.c */
83 NMManager * nm_manager_setup (const char *state_file,
84 gboolean initial_net_enabled,
85 gboolean initial_wifi_enabled,
86 gboolean initial_wwan_enabled);
88 NMManager * nm_manager_get (void);
90 gboolean nm_manager_start (NMManager *manager,
92 void nm_manager_stop (NMManager *manager);
93 NMState nm_manager_get_state (NMManager *manager);
94 const GSList *nm_manager_get_active_connections (NMManager *manager);
95 GSList * nm_manager_get_activatable_connections (NMManager *manager);
99 const GSList * nm_manager_get_devices (NMManager *manager);
101 NMDevice * nm_manager_get_device_by_ifindex (NMManager *manager,
104 char * nm_manager_get_connection_iface (NMManager *self,
105 NMConnection *connection,
106 NMDevice **out_parent,
109 NMActiveConnection *nm_manager_activate_connection (NMManager *manager,
110 NMSettingsConnection *connection,
111 const char *specific_object,
113 NMAuthSubject *subject,
116 gboolean nm_manager_deactivate_connection (NMManager *manager,
117 const char *connection_path,
118 NMDeviceStateReason reason,
122 #endif /* __NETWORKMANAGER_MANAGER_H__ */