2004-06-24 14:18:37 +00:00
|
|
|
/* NetworkManager -- Network link manager
|
|
|
|
|
*
|
|
|
|
|
* Dan Williams <dcbw@redhat.com>
|
|
|
|
|
*
|
|
|
|
|
* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
|
*
|
|
|
|
|
* (C) Copyright 2004 Red Hat, Inc.
|
|
|
|
|
*/
|
|
|
|
|
|
2006-05-24 14:16:48 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
|
# include <config.h>
|
|
|
|
|
#endif
|
|
|
|
|
|
2004-06-24 14:18:37 +00:00
|
|
|
#include <glib.h>
|
2004-07-27 16:15:36 +00:00
|
|
|
#include <dbus/dbus.h>
|
2004-08-02 21:12:40 +00:00
|
|
|
#include <dbus/dbus-glib-lowlevel.h>
|
2004-06-24 14:18:37 +00:00
|
|
|
#include <dbus/dbus-glib.h>
|
|
|
|
|
#include <getopt.h>
|
|
|
|
|
#include <errno.h>
|
|
|
|
|
#include <stdlib.h>
|
2004-12-21 06:49:21 +00:00
|
|
|
#include <signal.h>
|
2004-06-24 14:18:37 +00:00
|
|
|
#include <unistd.h>
|
|
|
|
|
#include <fcntl.h>
|
|
|
|
|
#include <sys/stat.h>
|
2004-10-15 15:59:25 +00:00
|
|
|
#include <sys/types.h>
|
2006-05-24 15:53:07 +00:00
|
|
|
#include <glib/gi18n.h>
|
2004-06-24 14:18:37 +00:00
|
|
|
|
|
|
|
|
#include "NetworkManager.h"
|
2005-03-14 Ray Strode <rstrode@redhat.com>
Fourth (probably working) cut at porting to
dbus 0.30 api and new hal. This cut adds
some new logging macros to make debugging
easier.
* dispatcher-daemon/NetworkManagerDispatcher.c:
* info-daemon/NetworkmanagerInfo.c:
* info-daemon/NetworkManagerInfoPassphraseDialog.c:
* info-daemon/NetworkManagerInfoVPN.c:
* src/NetworkManager.c:
* src/NetworkManagerAP.c:
* src/NetworkManagerAPList.c:
* src/NetworkManagerDHCP.c:
* src/NetworkManagerDbus.c:
* src/NetworkManagerDevice.c:
* src/NetworkManagerPolicy.c:
* src/NetworkManagerSystem.c:
* src/NetworkManagerUtils.c:
* src/NetworkManagerWireless.c:
* src/autoip.c:
* src/nm-dbus-nm.c:
* src/backends/NetworkManagerDebian.c:
* src/backends/NetworkManagerGentoo.c:
* src/backends/NetworkManagerRedHat.c:
* src/backends/NetworkManagerSlackware.c:
use new logging macros.
* dispatcher-daemon/NetworkManagerDispatcher.c:
(nmd_dbus_filter): s/dbus_free/g_free/
* info-daemon/Makefile.am: link in utils library.
* info-daemon/NetworkmanagerInfo.c: use new logging
macros.
(nmi_dbus_get_network): don't assume enumerations
are 32-bit.
(nmi_dbus_nmi_message_handler): don't free what
doesn't belong to us.
* libnm_glib/libnm_glib.c:
(libnm_glib_get_nm_status):
(libnm_glib_init): don't free what doesn't
belong to us.
(libnm_glib_dbus): strdup result, so it doesn't get
lost when message is unref'd.
* panel-applet/NMWirelessAppletDbus.c:
(nmwa_dbus_update_devices): s/dbus_free/g_free/
* src/NetworkManager.c:
(nm_monitor_wired_link_state): request initial status
dump of all cards when we start up, instead of relying
on /sys/.../carrier.
(nm_info_handler), (nm_set_up_log_handlers):
log handlers to specify what syslog priorites
the logging macros default to.
* src/NetworkManagerAPList.c:
(nm_ap_list_populate_from_nmi):
s/dbus_free_string_array/g_strfreev/
* src/NetworkManagerDbus.c:
(nm_dbus_get_network_object):
validate d-bus message argument types.
Advance message iterator after reading argument,
prepend instead of append to GSList.
* src/NetworkManagerDevice.c:
(nm_device_probe_wired_link_status):
remove redundant /sys in /sys path. remove wrong
contents == NULL means has carrier assumption.
* src/nm-netlink-monitor.c
(nm_netlink_monitor_request_status): implement
function to ask kernel to dump interface link
status over netlink socket.
* test/*.c: s/dbus_free/g_free/
* utils/nm-utils.h:
(nm_print_backtrace): new macro to print backtrace.
(nm_get_timestamp): new macro to get sub-second precise
unix timestamp.
(nm_info), (nm_debug), (nm_warning), (nm_error):
new logging functions. nm_info just prints,
nm_debug includes timestamp and function,
nm_warning includes function, nm_error includes
backtrace and sigtrap.
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@497 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2005-03-15 05:30:15 +00:00
|
|
|
#include "nm-utils.h"
|
2004-06-24 14:18:37 +00:00
|
|
|
#include "NetworkManagerUtils.h"
|
2007-02-09 08:50:35 +00:00
|
|
|
#include "nm-device-interface.h"
|
2007-02-08 15:34:26 +00:00
|
|
|
#include "nm-manager.h"
|
|
|
|
|
#include "nm-hal-manager.h"
|
2005-12-31 08:21:24 +00:00
|
|
|
#include "nm-device.h"
|
|
|
|
|
#include "nm-device-802-3-ethernet.h"
|
|
|
|
|
#include "nm-device-802-11-wireless.h"
|
2004-06-24 14:18:37 +00:00
|
|
|
#include "NetworkManagerPolicy.h"
|
|
|
|
|
#include "NetworkManagerDbus.h"
|
2004-08-02 21:12:40 +00:00
|
|
|
#include "NetworkManagerAP.h"
|
2004-07-27 16:15:36 +00:00
|
|
|
#include "NetworkManagerAPList.h"
|
2004-11-16 02:41:53 +00:00
|
|
|
#include "NetworkManagerSystem.h"
|
2004-12-21 06:49:21 +00:00
|
|
|
#include "nm-named-manager.h"
|
2005-04-15 15:43:42 +00:00
|
|
|
#include "nm-dbus-vpn.h"
|
2006-10-13 19:41:47 +00:00
|
|
|
#include "nm-dbus-manager.h"
|
2006-11-25 15:41:04 +00:00
|
|
|
#include "nm-supplicant-manager.h"
|
2005-03-11 20:12:57 +00:00
|
|
|
#include "nm-netlink-monitor.h"
|
2006-02-27 04:31:52 +00:00
|
|
|
#include "nm-logging.h"
|
2004-06-24 14:18:37 +00:00
|
|
|
|
2006-02-27 20:06:24 +00:00
|
|
|
#define NM_DEFAULT_PID_FILE LOCALSTATEDIR"/run/NetworkManager.pid"
|
|
|
|
|
|
2004-06-24 14:18:37 +00:00
|
|
|
/*
|
|
|
|
|
* Globals
|
|
|
|
|
*/
|
2007-02-08 15:34:26 +00:00
|
|
|
static NMManager *manager = NULL;
|
2007-02-19 13:09:32 +00:00
|
|
|
static GMainLoop *main_loop = NULL;
|
|
|
|
|
static NMData *nm_data = NULL;
|
2004-06-24 14:18:37 +00:00
|
|
|
|
|
|
|
|
static void nm_data_free (NMData *data);
|
|
|
|
|
|
2006-03-05 Dan Williams <dcbw@redhat.com>
Process netlink messages in device subclasses rather than in
NetworkManager.c. Also add support for recognizing Wireless Events.
* configure.in
- Find GLIB_GENMARSHAL
* src/Makefile.am
- Since we're marshalling custom types for wireless event signals,
we get to create our own marshallers using GLIB_GENMARSHAL
* src/NetworkManager.c
- (nm_monitor_wired_link_state): renamed to nm_monitor_setup
- (nm_monitor_setup): renamed from nm_monitor_wired_link_state, and
cut down somewhat. We no longer process signals here.
- (nm_data_new): create the netlink monitor here, and remove a
useless call to nm_policy_schedule_device_change_check()
- (nm_data_free): get rid of the netlink monitor here
- (nm_device_link_activated, nm_device_link_deactivated): removed
- (main): don't create the netlink monitor here, let nm_data_new
do that. Call nm_policy_schedule_device_change_check() right
before we jump to the mainloop to figure out which device
to use first
* src/NetworkManagerSystem.[ch]
- (nm_system_get_rtnl_index_from_iface, nm_system_get_iface_from_rtnl_index):
convert back and forth from interface names to interface
indexes
* src/nm-device-802-11-wireless.c
- (real_init): connect to wireless-event signals from the netlink
monitor object
- (nm_device_802_11_wireless_event): new function, schedule handler
for wireless event signals from the netlink monitor object. We
want the handler to run in the device's context
- (wireless_event_helper): handle wireless-event signals from netlink
- (nm_device_802_11_wireless_dispose): disconnect wireless-event
signal handler
* src/nm-device-802-11-wireless.h
- remove unused prototype for nm_device_802_11_wireless_new
* src/nm-device-802-3-ethernet.c
- (real_init): new function; set up signal handlers for link events
- (nm_device_802_3_ethernet_link_activated): new function, schedule
handler for netlink link activated events on device's main loop
- (link_activated_helper): when we get a link activated event, set
the device's link to be active
- (nm_device_802_3_ethernet_link_deactivated): new function; schedule
handler for netlink link deactivated events on device's main loop
- (link_deactivated_helper): when we get a link deactivated event, set
the device's link to be inactive
- (nm_device_802_3_ethernet_dispose): disconnect signal handler on
dispose
* src/nm-device-802-3-ethernet.h
- remove unused prototype for nm_device_802_3_ethernet_new
* src/nm-device.[ch]
- (nm_get_device_by_iface_locked): variant of nm_get_device_by_iface
but locks the device list
- (nm_device_set_active_link): a little bit of cleanup and de-indenting
* src/nm-netlink-monitor.[ch]
- (nm_netlink_monitor_class_install_signals): New signal
"wireless-event"
- (nm_netlink_monitor_new): keep reference to NMData so we can get
at the device list
- (nm_netlink_monitor_event_handler): expand for wireless events too
* src/nm-marshal-main.c
- Include generated nm-marshal.c and nm-marshal.h
* src/nm-marshal.list
- List of custom marshal functions
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1555 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-03-06 01:10:58 +00:00
|
|
|
static void
|
2007-02-19 13:09:32 +00:00
|
|
|
nm_error_monitoring_device_link_state (NMNetlinkMonitor *monitor,
|
|
|
|
|
GError *error,
|
|
|
|
|
gpointer user_data)
|
2006-03-05 Dan Williams <dcbw@redhat.com>
Process netlink messages in device subclasses rather than in
NetworkManager.c. Also add support for recognizing Wireless Events.
* configure.in
- Find GLIB_GENMARSHAL
* src/Makefile.am
- Since we're marshalling custom types for wireless event signals,
we get to create our own marshallers using GLIB_GENMARSHAL
* src/NetworkManager.c
- (nm_monitor_wired_link_state): renamed to nm_monitor_setup
- (nm_monitor_setup): renamed from nm_monitor_wired_link_state, and
cut down somewhat. We no longer process signals here.
- (nm_data_new): create the netlink monitor here, and remove a
useless call to nm_policy_schedule_device_change_check()
- (nm_data_free): get rid of the netlink monitor here
- (nm_device_link_activated, nm_device_link_deactivated): removed
- (main): don't create the netlink monitor here, let nm_data_new
do that. Call nm_policy_schedule_device_change_check() right
before we jump to the mainloop to figure out which device
to use first
* src/NetworkManagerSystem.[ch]
- (nm_system_get_rtnl_index_from_iface, nm_system_get_iface_from_rtnl_index):
convert back and forth from interface names to interface
indexes
* src/nm-device-802-11-wireless.c
- (real_init): connect to wireless-event signals from the netlink
monitor object
- (nm_device_802_11_wireless_event): new function, schedule handler
for wireless event signals from the netlink monitor object. We
want the handler to run in the device's context
- (wireless_event_helper): handle wireless-event signals from netlink
- (nm_device_802_11_wireless_dispose): disconnect wireless-event
signal handler
* src/nm-device-802-11-wireless.h
- remove unused prototype for nm_device_802_11_wireless_new
* src/nm-device-802-3-ethernet.c
- (real_init): new function; set up signal handlers for link events
- (nm_device_802_3_ethernet_link_activated): new function, schedule
handler for netlink link activated events on device's main loop
- (link_activated_helper): when we get a link activated event, set
the device's link to be active
- (nm_device_802_3_ethernet_link_deactivated): new function; schedule
handler for netlink link deactivated events on device's main loop
- (link_deactivated_helper): when we get a link deactivated event, set
the device's link to be inactive
- (nm_device_802_3_ethernet_dispose): disconnect signal handler on
dispose
* src/nm-device-802-3-ethernet.h
- remove unused prototype for nm_device_802_3_ethernet_new
* src/nm-device.[ch]
- (nm_get_device_by_iface_locked): variant of nm_get_device_by_iface
but locks the device list
- (nm_device_set_active_link): a little bit of cleanup and de-indenting
* src/nm-netlink-monitor.[ch]
- (nm_netlink_monitor_class_install_signals): New signal
"wireless-event"
- (nm_netlink_monitor_new): keep reference to NMData so we can get
at the device list
- (nm_netlink_monitor_event_handler): expand for wireless events too
* src/nm-marshal-main.c
- Include generated nm-marshal.c and nm-marshal.h
* src/nm-marshal.list
- List of custom marshal functions
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1555 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-03-06 01:10:58 +00:00
|
|
|
{
|
|
|
|
|
/* FIXME: Try to handle the error instead of just printing it. */
|
|
|
|
|
nm_warning ("error monitoring wired ethernet link state: %s\n",
|
2007-02-19 13:09:32 +00:00
|
|
|
error->message);
|
2006-03-05 Dan Williams <dcbw@redhat.com>
Process netlink messages in device subclasses rather than in
NetworkManager.c. Also add support for recognizing Wireless Events.
* configure.in
- Find GLIB_GENMARSHAL
* src/Makefile.am
- Since we're marshalling custom types for wireless event signals,
we get to create our own marshallers using GLIB_GENMARSHAL
* src/NetworkManager.c
- (nm_monitor_wired_link_state): renamed to nm_monitor_setup
- (nm_monitor_setup): renamed from nm_monitor_wired_link_state, and
cut down somewhat. We no longer process signals here.
- (nm_data_new): create the netlink monitor here, and remove a
useless call to nm_policy_schedule_device_change_check()
- (nm_data_free): get rid of the netlink monitor here
- (nm_device_link_activated, nm_device_link_deactivated): removed
- (main): don't create the netlink monitor here, let nm_data_new
do that. Call nm_policy_schedule_device_change_check() right
before we jump to the mainloop to figure out which device
to use first
* src/NetworkManagerSystem.[ch]
- (nm_system_get_rtnl_index_from_iface, nm_system_get_iface_from_rtnl_index):
convert back and forth from interface names to interface
indexes
* src/nm-device-802-11-wireless.c
- (real_init): connect to wireless-event signals from the netlink
monitor object
- (nm_device_802_11_wireless_event): new function, schedule handler
for wireless event signals from the netlink monitor object. We
want the handler to run in the device's context
- (wireless_event_helper): handle wireless-event signals from netlink
- (nm_device_802_11_wireless_dispose): disconnect wireless-event
signal handler
* src/nm-device-802-11-wireless.h
- remove unused prototype for nm_device_802_11_wireless_new
* src/nm-device-802-3-ethernet.c
- (real_init): new function; set up signal handlers for link events
- (nm_device_802_3_ethernet_link_activated): new function, schedule
handler for netlink link activated events on device's main loop
- (link_activated_helper): when we get a link activated event, set
the device's link to be active
- (nm_device_802_3_ethernet_link_deactivated): new function; schedule
handler for netlink link deactivated events on device's main loop
- (link_deactivated_helper): when we get a link deactivated event, set
the device's link to be inactive
- (nm_device_802_3_ethernet_dispose): disconnect signal handler on
dispose
* src/nm-device-802-3-ethernet.h
- remove unused prototype for nm_device_802_3_ethernet_new
* src/nm-device.[ch]
- (nm_get_device_by_iface_locked): variant of nm_get_device_by_iface
but locks the device list
- (nm_device_set_active_link): a little bit of cleanup and de-indenting
* src/nm-netlink-monitor.[ch]
- (nm_netlink_monitor_class_install_signals): New signal
"wireless-event"
- (nm_netlink_monitor_new): keep reference to NMData so we can get
at the device list
- (nm_netlink_monitor_event_handler): expand for wireless events too
* src/nm-marshal-main.c
- Include generated nm-marshal.c and nm-marshal.h
* src/nm-marshal.list
- List of custom marshal functions
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1555 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-03-06 01:10:58 +00:00
|
|
|
}
|
|
|
|
|
|
2007-02-19 13:09:32 +00:00
|
|
|
static gboolean
|
|
|
|
|
nm_monitor_setup (void)
|
2006-03-05 Dan Williams <dcbw@redhat.com>
Process netlink messages in device subclasses rather than in
NetworkManager.c. Also add support for recognizing Wireless Events.
* configure.in
- Find GLIB_GENMARSHAL
* src/Makefile.am
- Since we're marshalling custom types for wireless event signals,
we get to create our own marshallers using GLIB_GENMARSHAL
* src/NetworkManager.c
- (nm_monitor_wired_link_state): renamed to nm_monitor_setup
- (nm_monitor_setup): renamed from nm_monitor_wired_link_state, and
cut down somewhat. We no longer process signals here.
- (nm_data_new): create the netlink monitor here, and remove a
useless call to nm_policy_schedule_device_change_check()
- (nm_data_free): get rid of the netlink monitor here
- (nm_device_link_activated, nm_device_link_deactivated): removed
- (main): don't create the netlink monitor here, let nm_data_new
do that. Call nm_policy_schedule_device_change_check() right
before we jump to the mainloop to figure out which device
to use first
* src/NetworkManagerSystem.[ch]
- (nm_system_get_rtnl_index_from_iface, nm_system_get_iface_from_rtnl_index):
convert back and forth from interface names to interface
indexes
* src/nm-device-802-11-wireless.c
- (real_init): connect to wireless-event signals from the netlink
monitor object
- (nm_device_802_11_wireless_event): new function, schedule handler
for wireless event signals from the netlink monitor object. We
want the handler to run in the device's context
- (wireless_event_helper): handle wireless-event signals from netlink
- (nm_device_802_11_wireless_dispose): disconnect wireless-event
signal handler
* src/nm-device-802-11-wireless.h
- remove unused prototype for nm_device_802_11_wireless_new
* src/nm-device-802-3-ethernet.c
- (real_init): new function; set up signal handlers for link events
- (nm_device_802_3_ethernet_link_activated): new function, schedule
handler for netlink link activated events on device's main loop
- (link_activated_helper): when we get a link activated event, set
the device's link to be active
- (nm_device_802_3_ethernet_link_deactivated): new function; schedule
handler for netlink link deactivated events on device's main loop
- (link_deactivated_helper): when we get a link deactivated event, set
the device's link to be inactive
- (nm_device_802_3_ethernet_dispose): disconnect signal handler on
dispose
* src/nm-device-802-3-ethernet.h
- remove unused prototype for nm_device_802_3_ethernet_new
* src/nm-device.[ch]
- (nm_get_device_by_iface_locked): variant of nm_get_device_by_iface
but locks the device list
- (nm_device_set_active_link): a little bit of cleanup and de-indenting
* src/nm-netlink-monitor.[ch]
- (nm_netlink_monitor_class_install_signals): New signal
"wireless-event"
- (nm_netlink_monitor_new): keep reference to NMData so we can get
at the device list
- (nm_netlink_monitor_event_handler): expand for wireless events too
* src/nm-marshal-main.c
- Include generated nm-marshal.c and nm-marshal.h
* src/nm-marshal.list
- List of custom marshal functions
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1555 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-03-06 01:10:58 +00:00
|
|
|
{
|
|
|
|
|
GError *error = NULL;
|
2007-02-19 13:09:32 +00:00
|
|
|
NMNetlinkMonitor *monitor;
|
2006-03-05 Dan Williams <dcbw@redhat.com>
Process netlink messages in device subclasses rather than in
NetworkManager.c. Also add support for recognizing Wireless Events.
* configure.in
- Find GLIB_GENMARSHAL
* src/Makefile.am
- Since we're marshalling custom types for wireless event signals,
we get to create our own marshallers using GLIB_GENMARSHAL
* src/NetworkManager.c
- (nm_monitor_wired_link_state): renamed to nm_monitor_setup
- (nm_monitor_setup): renamed from nm_monitor_wired_link_state, and
cut down somewhat. We no longer process signals here.
- (nm_data_new): create the netlink monitor here, and remove a
useless call to nm_policy_schedule_device_change_check()
- (nm_data_free): get rid of the netlink monitor here
- (nm_device_link_activated, nm_device_link_deactivated): removed
- (main): don't create the netlink monitor here, let nm_data_new
do that. Call nm_policy_schedule_device_change_check() right
before we jump to the mainloop to figure out which device
to use first
* src/NetworkManagerSystem.[ch]
- (nm_system_get_rtnl_index_from_iface, nm_system_get_iface_from_rtnl_index):
convert back and forth from interface names to interface
indexes
* src/nm-device-802-11-wireless.c
- (real_init): connect to wireless-event signals from the netlink
monitor object
- (nm_device_802_11_wireless_event): new function, schedule handler
for wireless event signals from the netlink monitor object. We
want the handler to run in the device's context
- (wireless_event_helper): handle wireless-event signals from netlink
- (nm_device_802_11_wireless_dispose): disconnect wireless-event
signal handler
* src/nm-device-802-11-wireless.h
- remove unused prototype for nm_device_802_11_wireless_new
* src/nm-device-802-3-ethernet.c
- (real_init): new function; set up signal handlers for link events
- (nm_device_802_3_ethernet_link_activated): new function, schedule
handler for netlink link activated events on device's main loop
- (link_activated_helper): when we get a link activated event, set
the device's link to be active
- (nm_device_802_3_ethernet_link_deactivated): new function; schedule
handler for netlink link deactivated events on device's main loop
- (link_deactivated_helper): when we get a link deactivated event, set
the device's link to be inactive
- (nm_device_802_3_ethernet_dispose): disconnect signal handler on
dispose
* src/nm-device-802-3-ethernet.h
- remove unused prototype for nm_device_802_3_ethernet_new
* src/nm-device.[ch]
- (nm_get_device_by_iface_locked): variant of nm_get_device_by_iface
but locks the device list
- (nm_device_set_active_link): a little bit of cleanup and de-indenting
* src/nm-netlink-monitor.[ch]
- (nm_netlink_monitor_class_install_signals): New signal
"wireless-event"
- (nm_netlink_monitor_new): keep reference to NMData so we can get
at the device list
- (nm_netlink_monitor_event_handler): expand for wireless events too
* src/nm-marshal-main.c
- Include generated nm-marshal.c and nm-marshal.h
* src/nm-marshal.list
- List of custom marshal functions
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1555 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-03-06 01:10:58 +00:00
|
|
|
|
2007-02-19 13:09:32 +00:00
|
|
|
monitor = nm_netlink_monitor_get ();
|
2006-03-05 Dan Williams <dcbw@redhat.com>
Process netlink messages in device subclasses rather than in
NetworkManager.c. Also add support for recognizing Wireless Events.
* configure.in
- Find GLIB_GENMARSHAL
* src/Makefile.am
- Since we're marshalling custom types for wireless event signals,
we get to create our own marshallers using GLIB_GENMARSHAL
* src/NetworkManager.c
- (nm_monitor_wired_link_state): renamed to nm_monitor_setup
- (nm_monitor_setup): renamed from nm_monitor_wired_link_state, and
cut down somewhat. We no longer process signals here.
- (nm_data_new): create the netlink monitor here, and remove a
useless call to nm_policy_schedule_device_change_check()
- (nm_data_free): get rid of the netlink monitor here
- (nm_device_link_activated, nm_device_link_deactivated): removed
- (main): don't create the netlink monitor here, let nm_data_new
do that. Call nm_policy_schedule_device_change_check() right
before we jump to the mainloop to figure out which device
to use first
* src/NetworkManagerSystem.[ch]
- (nm_system_get_rtnl_index_from_iface, nm_system_get_iface_from_rtnl_index):
convert back and forth from interface names to interface
indexes
* src/nm-device-802-11-wireless.c
- (real_init): connect to wireless-event signals from the netlink
monitor object
- (nm_device_802_11_wireless_event): new function, schedule handler
for wireless event signals from the netlink monitor object. We
want the handler to run in the device's context
- (wireless_event_helper): handle wireless-event signals from netlink
- (nm_device_802_11_wireless_dispose): disconnect wireless-event
signal handler
* src/nm-device-802-11-wireless.h
- remove unused prototype for nm_device_802_11_wireless_new
* src/nm-device-802-3-ethernet.c
- (real_init): new function; set up signal handlers for link events
- (nm_device_802_3_ethernet_link_activated): new function, schedule
handler for netlink link activated events on device's main loop
- (link_activated_helper): when we get a link activated event, set
the device's link to be active
- (nm_device_802_3_ethernet_link_deactivated): new function; schedule
handler for netlink link deactivated events on device's main loop
- (link_deactivated_helper): when we get a link deactivated event, set
the device's link to be inactive
- (nm_device_802_3_ethernet_dispose): disconnect signal handler on
dispose
* src/nm-device-802-3-ethernet.h
- remove unused prototype for nm_device_802_3_ethernet_new
* src/nm-device.[ch]
- (nm_get_device_by_iface_locked): variant of nm_get_device_by_iface
but locks the device list
- (nm_device_set_active_link): a little bit of cleanup and de-indenting
* src/nm-netlink-monitor.[ch]
- (nm_netlink_monitor_class_install_signals): New signal
"wireless-event"
- (nm_netlink_monitor_new): keep reference to NMData so we can get
at the device list
- (nm_netlink_monitor_event_handler): expand for wireless events too
* src/nm-marshal-main.c
- Include generated nm-marshal.c and nm-marshal.h
* src/nm-marshal.list
- List of custom marshal functions
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1555 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-03-06 01:10:58 +00:00
|
|
|
nm_netlink_monitor_open_connection (monitor, &error);
|
|
|
|
|
if (error != NULL)
|
|
|
|
|
{
|
|
|
|
|
nm_warning ("could not monitor wired ethernet devices: %s",
|
2007-02-19 13:09:32 +00:00
|
|
|
error->message);
|
2006-03-05 Dan Williams <dcbw@redhat.com>
Process netlink messages in device subclasses rather than in
NetworkManager.c. Also add support for recognizing Wireless Events.
* configure.in
- Find GLIB_GENMARSHAL
* src/Makefile.am
- Since we're marshalling custom types for wireless event signals,
we get to create our own marshallers using GLIB_GENMARSHAL
* src/NetworkManager.c
- (nm_monitor_wired_link_state): renamed to nm_monitor_setup
- (nm_monitor_setup): renamed from nm_monitor_wired_link_state, and
cut down somewhat. We no longer process signals here.
- (nm_data_new): create the netlink monitor here, and remove a
useless call to nm_policy_schedule_device_change_check()
- (nm_data_free): get rid of the netlink monitor here
- (nm_device_link_activated, nm_device_link_deactivated): removed
- (main): don't create the netlink monitor here, let nm_data_new
do that. Call nm_policy_schedule_device_change_check() right
before we jump to the mainloop to figure out which device
to use first
* src/NetworkManagerSystem.[ch]
- (nm_system_get_rtnl_index_from_iface, nm_system_get_iface_from_rtnl_index):
convert back and forth from interface names to interface
indexes
* src/nm-device-802-11-wireless.c
- (real_init): connect to wireless-event signals from the netlink
monitor object
- (nm_device_802_11_wireless_event): new function, schedule handler
for wireless event signals from the netlink monitor object. We
want the handler to run in the device's context
- (wireless_event_helper): handle wireless-event signals from netlink
- (nm_device_802_11_wireless_dispose): disconnect wireless-event
signal handler
* src/nm-device-802-11-wireless.h
- remove unused prototype for nm_device_802_11_wireless_new
* src/nm-device-802-3-ethernet.c
- (real_init): new function; set up signal handlers for link events
- (nm_device_802_3_ethernet_link_activated): new function, schedule
handler for netlink link activated events on device's main loop
- (link_activated_helper): when we get a link activated event, set
the device's link to be active
- (nm_device_802_3_ethernet_link_deactivated): new function; schedule
handler for netlink link deactivated events on device's main loop
- (link_deactivated_helper): when we get a link deactivated event, set
the device's link to be inactive
- (nm_device_802_3_ethernet_dispose): disconnect signal handler on
dispose
* src/nm-device-802-3-ethernet.h
- remove unused prototype for nm_device_802_3_ethernet_new
* src/nm-device.[ch]
- (nm_get_device_by_iface_locked): variant of nm_get_device_by_iface
but locks the device list
- (nm_device_set_active_link): a little bit of cleanup and de-indenting
* src/nm-netlink-monitor.[ch]
- (nm_netlink_monitor_class_install_signals): New signal
"wireless-event"
- (nm_netlink_monitor_new): keep reference to NMData so we can get
at the device list
- (nm_netlink_monitor_event_handler): expand for wireless events too
* src/nm-marshal-main.c
- Include generated nm-marshal.c and nm-marshal.h
* src/nm-marshal.list
- List of custom marshal functions
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1555 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-03-06 01:10:58 +00:00
|
|
|
g_error_free (error);
|
|
|
|
|
g_object_unref (monitor);
|
2007-02-19 13:09:32 +00:00
|
|
|
return FALSE;
|
2006-03-05 Dan Williams <dcbw@redhat.com>
Process netlink messages in device subclasses rather than in
NetworkManager.c. Also add support for recognizing Wireless Events.
* configure.in
- Find GLIB_GENMARSHAL
* src/Makefile.am
- Since we're marshalling custom types for wireless event signals,
we get to create our own marshallers using GLIB_GENMARSHAL
* src/NetworkManager.c
- (nm_monitor_wired_link_state): renamed to nm_monitor_setup
- (nm_monitor_setup): renamed from nm_monitor_wired_link_state, and
cut down somewhat. We no longer process signals here.
- (nm_data_new): create the netlink monitor here, and remove a
useless call to nm_policy_schedule_device_change_check()
- (nm_data_free): get rid of the netlink monitor here
- (nm_device_link_activated, nm_device_link_deactivated): removed
- (main): don't create the netlink monitor here, let nm_data_new
do that. Call nm_policy_schedule_device_change_check() right
before we jump to the mainloop to figure out which device
to use first
* src/NetworkManagerSystem.[ch]
- (nm_system_get_rtnl_index_from_iface, nm_system_get_iface_from_rtnl_index):
convert back and forth from interface names to interface
indexes
* src/nm-device-802-11-wireless.c
- (real_init): connect to wireless-event signals from the netlink
monitor object
- (nm_device_802_11_wireless_event): new function, schedule handler
for wireless event signals from the netlink monitor object. We
want the handler to run in the device's context
- (wireless_event_helper): handle wireless-event signals from netlink
- (nm_device_802_11_wireless_dispose): disconnect wireless-event
signal handler
* src/nm-device-802-11-wireless.h
- remove unused prototype for nm_device_802_11_wireless_new
* src/nm-device-802-3-ethernet.c
- (real_init): new function; set up signal handlers for link events
- (nm_device_802_3_ethernet_link_activated): new function, schedule
handler for netlink link activated events on device's main loop
- (link_activated_helper): when we get a link activated event, set
the device's link to be active
- (nm_device_802_3_ethernet_link_deactivated): new function; schedule
handler for netlink link deactivated events on device's main loop
- (link_deactivated_helper): when we get a link deactivated event, set
the device's link to be inactive
- (nm_device_802_3_ethernet_dispose): disconnect signal handler on
dispose
* src/nm-device-802-3-ethernet.h
- remove unused prototype for nm_device_802_3_ethernet_new
* src/nm-device.[ch]
- (nm_get_device_by_iface_locked): variant of nm_get_device_by_iface
but locks the device list
- (nm_device_set_active_link): a little bit of cleanup and de-indenting
* src/nm-netlink-monitor.[ch]
- (nm_netlink_monitor_class_install_signals): New signal
"wireless-event"
- (nm_netlink_monitor_new): keep reference to NMData so we can get
at the device list
- (nm_netlink_monitor_event_handler): expand for wireless events too
* src/nm-marshal-main.c
- Include generated nm-marshal.c and nm-marshal.h
* src/nm-marshal.list
- List of custom marshal functions
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1555 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-03-06 01:10:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
g_signal_connect (G_OBJECT (monitor), "error",
|
|
|
|
|
G_CALLBACK (nm_error_monitoring_device_link_state),
|
2007-02-19 13:09:32 +00:00
|
|
|
NULL);
|
2006-03-05 Dan Williams <dcbw@redhat.com>
Process netlink messages in device subclasses rather than in
NetworkManager.c. Also add support for recognizing Wireless Events.
* configure.in
- Find GLIB_GENMARSHAL
* src/Makefile.am
- Since we're marshalling custom types for wireless event signals,
we get to create our own marshallers using GLIB_GENMARSHAL
* src/NetworkManager.c
- (nm_monitor_wired_link_state): renamed to nm_monitor_setup
- (nm_monitor_setup): renamed from nm_monitor_wired_link_state, and
cut down somewhat. We no longer process signals here.
- (nm_data_new): create the netlink monitor here, and remove a
useless call to nm_policy_schedule_device_change_check()
- (nm_data_free): get rid of the netlink monitor here
- (nm_device_link_activated, nm_device_link_deactivated): removed
- (main): don't create the netlink monitor here, let nm_data_new
do that. Call nm_policy_schedule_device_change_check() right
before we jump to the mainloop to figure out which device
to use first
* src/NetworkManagerSystem.[ch]
- (nm_system_get_rtnl_index_from_iface, nm_system_get_iface_from_rtnl_index):
convert back and forth from interface names to interface
indexes
* src/nm-device-802-11-wireless.c
- (real_init): connect to wireless-event signals from the netlink
monitor object
- (nm_device_802_11_wireless_event): new function, schedule handler
for wireless event signals from the netlink monitor object. We
want the handler to run in the device's context
- (wireless_event_helper): handle wireless-event signals from netlink
- (nm_device_802_11_wireless_dispose): disconnect wireless-event
signal handler
* src/nm-device-802-11-wireless.h
- remove unused prototype for nm_device_802_11_wireless_new
* src/nm-device-802-3-ethernet.c
- (real_init): new function; set up signal handlers for link events
- (nm_device_802_3_ethernet_link_activated): new function, schedule
handler for netlink link activated events on device's main loop
- (link_activated_helper): when we get a link activated event, set
the device's link to be active
- (nm_device_802_3_ethernet_link_deactivated): new function; schedule
handler for netlink link deactivated events on device's main loop
- (link_deactivated_helper): when we get a link deactivated event, set
the device's link to be inactive
- (nm_device_802_3_ethernet_dispose): disconnect signal handler on
dispose
* src/nm-device-802-3-ethernet.h
- remove unused prototype for nm_device_802_3_ethernet_new
* src/nm-device.[ch]
- (nm_get_device_by_iface_locked): variant of nm_get_device_by_iface
but locks the device list
- (nm_device_set_active_link): a little bit of cleanup and de-indenting
* src/nm-netlink-monitor.[ch]
- (nm_netlink_monitor_class_install_signals): New signal
"wireless-event"
- (nm_netlink_monitor_new): keep reference to NMData so we can get
at the device list
- (nm_netlink_monitor_event_handler): expand for wireless events too
* src/nm-marshal-main.c
- Include generated nm-marshal.c and nm-marshal.h
* src/nm-marshal.list
- List of custom marshal functions
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1555 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-03-06 01:10:58 +00:00
|
|
|
|
2007-01-04 12:06:26 +00:00
|
|
|
nm_netlink_monitor_attach (monitor, NULL);
|
2006-03-05 Dan Williams <dcbw@redhat.com>
Process netlink messages in device subclasses rather than in
NetworkManager.c. Also add support for recognizing Wireless Events.
* configure.in
- Find GLIB_GENMARSHAL
* src/Makefile.am
- Since we're marshalling custom types for wireless event signals,
we get to create our own marshallers using GLIB_GENMARSHAL
* src/NetworkManager.c
- (nm_monitor_wired_link_state): renamed to nm_monitor_setup
- (nm_monitor_setup): renamed from nm_monitor_wired_link_state, and
cut down somewhat. We no longer process signals here.
- (nm_data_new): create the netlink monitor here, and remove a
useless call to nm_policy_schedule_device_change_check()
- (nm_data_free): get rid of the netlink monitor here
- (nm_device_link_activated, nm_device_link_deactivated): removed
- (main): don't create the netlink monitor here, let nm_data_new
do that. Call nm_policy_schedule_device_change_check() right
before we jump to the mainloop to figure out which device
to use first
* src/NetworkManagerSystem.[ch]
- (nm_system_get_rtnl_index_from_iface, nm_system_get_iface_from_rtnl_index):
convert back and forth from interface names to interface
indexes
* src/nm-device-802-11-wireless.c
- (real_init): connect to wireless-event signals from the netlink
monitor object
- (nm_device_802_11_wireless_event): new function, schedule handler
for wireless event signals from the netlink monitor object. We
want the handler to run in the device's context
- (wireless_event_helper): handle wireless-event signals from netlink
- (nm_device_802_11_wireless_dispose): disconnect wireless-event
signal handler
* src/nm-device-802-11-wireless.h
- remove unused prototype for nm_device_802_11_wireless_new
* src/nm-device-802-3-ethernet.c
- (real_init): new function; set up signal handlers for link events
- (nm_device_802_3_ethernet_link_activated): new function, schedule
handler for netlink link activated events on device's main loop
- (link_activated_helper): when we get a link activated event, set
the device's link to be active
- (nm_device_802_3_ethernet_link_deactivated): new function; schedule
handler for netlink link deactivated events on device's main loop
- (link_deactivated_helper): when we get a link deactivated event, set
the device's link to be inactive
- (nm_device_802_3_ethernet_dispose): disconnect signal handler on
dispose
* src/nm-device-802-3-ethernet.h
- remove unused prototype for nm_device_802_3_ethernet_new
* src/nm-device.[ch]
- (nm_get_device_by_iface_locked): variant of nm_get_device_by_iface
but locks the device list
- (nm_device_set_active_link): a little bit of cleanup and de-indenting
* src/nm-netlink-monitor.[ch]
- (nm_netlink_monitor_class_install_signals): New signal
"wireless-event"
- (nm_netlink_monitor_new): keep reference to NMData so we can get
at the device list
- (nm_netlink_monitor_event_handler): expand for wireless events too
* src/nm-marshal-main.c
- Include generated nm-marshal.c and nm-marshal.h
* src/nm-marshal.list
- List of custom marshal functions
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1555 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-03-06 01:10:58 +00:00
|
|
|
|
|
|
|
|
/* Request initial status of cards */
|
|
|
|
|
nm_netlink_monitor_request_status (monitor, NULL);
|
2007-02-19 13:09:32 +00:00
|
|
|
|
|
|
|
|
return TRUE;
|
2006-03-05 Dan Williams <dcbw@redhat.com>
Process netlink messages in device subclasses rather than in
NetworkManager.c. Also add support for recognizing Wireless Events.
* configure.in
- Find GLIB_GENMARSHAL
* src/Makefile.am
- Since we're marshalling custom types for wireless event signals,
we get to create our own marshallers using GLIB_GENMARSHAL
* src/NetworkManager.c
- (nm_monitor_wired_link_state): renamed to nm_monitor_setup
- (nm_monitor_setup): renamed from nm_monitor_wired_link_state, and
cut down somewhat. We no longer process signals here.
- (nm_data_new): create the netlink monitor here, and remove a
useless call to nm_policy_schedule_device_change_check()
- (nm_data_free): get rid of the netlink monitor here
- (nm_device_link_activated, nm_device_link_deactivated): removed
- (main): don't create the netlink monitor here, let nm_data_new
do that. Call nm_policy_schedule_device_change_check() right
before we jump to the mainloop to figure out which device
to use first
* src/NetworkManagerSystem.[ch]
- (nm_system_get_rtnl_index_from_iface, nm_system_get_iface_from_rtnl_index):
convert back and forth from interface names to interface
indexes
* src/nm-device-802-11-wireless.c
- (real_init): connect to wireless-event signals from the netlink
monitor object
- (nm_device_802_11_wireless_event): new function, schedule handler
for wireless event signals from the netlink monitor object. We
want the handler to run in the device's context
- (wireless_event_helper): handle wireless-event signals from netlink
- (nm_device_802_11_wireless_dispose): disconnect wireless-event
signal handler
* src/nm-device-802-11-wireless.h
- remove unused prototype for nm_device_802_11_wireless_new
* src/nm-device-802-3-ethernet.c
- (real_init): new function; set up signal handlers for link events
- (nm_device_802_3_ethernet_link_activated): new function, schedule
handler for netlink link activated events on device's main loop
- (link_activated_helper): when we get a link activated event, set
the device's link to be active
- (nm_device_802_3_ethernet_link_deactivated): new function; schedule
handler for netlink link deactivated events on device's main loop
- (link_deactivated_helper): when we get a link deactivated event, set
the device's link to be inactive
- (nm_device_802_3_ethernet_dispose): disconnect signal handler on
dispose
* src/nm-device-802-3-ethernet.h
- remove unused prototype for nm_device_802_3_ethernet_new
* src/nm-device.[ch]
- (nm_get_device_by_iface_locked): variant of nm_get_device_by_iface
but locks the device list
- (nm_device_set_active_link): a little bit of cleanup and de-indenting
* src/nm-netlink-monitor.[ch]
- (nm_netlink_monitor_class_install_signals): New signal
"wireless-event"
- (nm_netlink_monitor_new): keep reference to NMData so we can get
at the device list
- (nm_netlink_monitor_event_handler): expand for wireless events too
* src/nm-marshal-main.c
- Include generated nm-marshal.c and nm-marshal.h
* src/nm-marshal.list
- List of custom marshal functions
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1555 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-03-06 01:10:58 +00:00
|
|
|
}
|
|
|
|
|
|
2004-06-24 14:18:37 +00:00
|
|
|
/*
|
|
|
|
|
* nm_data_new
|
|
|
|
|
*
|
|
|
|
|
* Create data structure used in callbacks from libhal.
|
|
|
|
|
*
|
|
|
|
|
*/
|
2007-02-16 11:23:49 +00:00
|
|
|
static NMData *nm_data_new (void)
|
2004-06-24 14:18:37 +00:00
|
|
|
{
|
2007-01-04 12:06:26 +00:00
|
|
|
NMData * data;
|
|
|
|
|
|
2006-08-04 15:46:06 +00:00
|
|
|
data = g_slice_new0 (NMData);
|
2004-12-21 06:49:21 +00:00
|
|
|
|
2004-08-06 18:19:06 +00:00
|
|
|
/* Initialize the access point lists */
|
2004-09-08 18:14:42 +00:00
|
|
|
data->allowed_ap_list = nm_ap_list_new (NETWORK_TYPE_ALLOWED);
|
2004-08-05 18:54:29 +00:00
|
|
|
data->invalid_ap_list = nm_ap_list_new (NETWORK_TYPE_INVALID);
|
2004-09-08 18:14:42 +00:00
|
|
|
if (!data->allowed_ap_list || !data->invalid_ap_list)
|
2004-06-24 14:18:37 +00:00
|
|
|
{
|
|
|
|
|
nm_data_free (data);
|
2005-03-14 Ray Strode <rstrode@redhat.com>
Fourth (probably working) cut at porting to
dbus 0.30 api and new hal. This cut adds
some new logging macros to make debugging
easier.
* dispatcher-daemon/NetworkManagerDispatcher.c:
* info-daemon/NetworkmanagerInfo.c:
* info-daemon/NetworkManagerInfoPassphraseDialog.c:
* info-daemon/NetworkManagerInfoVPN.c:
* src/NetworkManager.c:
* src/NetworkManagerAP.c:
* src/NetworkManagerAPList.c:
* src/NetworkManagerDHCP.c:
* src/NetworkManagerDbus.c:
* src/NetworkManagerDevice.c:
* src/NetworkManagerPolicy.c:
* src/NetworkManagerSystem.c:
* src/NetworkManagerUtils.c:
* src/NetworkManagerWireless.c:
* src/autoip.c:
* src/nm-dbus-nm.c:
* src/backends/NetworkManagerDebian.c:
* src/backends/NetworkManagerGentoo.c:
* src/backends/NetworkManagerRedHat.c:
* src/backends/NetworkManagerSlackware.c:
use new logging macros.
* dispatcher-daemon/NetworkManagerDispatcher.c:
(nmd_dbus_filter): s/dbus_free/g_free/
* info-daemon/Makefile.am: link in utils library.
* info-daemon/NetworkmanagerInfo.c: use new logging
macros.
(nmi_dbus_get_network): don't assume enumerations
are 32-bit.
(nmi_dbus_nmi_message_handler): don't free what
doesn't belong to us.
* libnm_glib/libnm_glib.c:
(libnm_glib_get_nm_status):
(libnm_glib_init): don't free what doesn't
belong to us.
(libnm_glib_dbus): strdup result, so it doesn't get
lost when message is unref'd.
* panel-applet/NMWirelessAppletDbus.c:
(nmwa_dbus_update_devices): s/dbus_free/g_free/
* src/NetworkManager.c:
(nm_monitor_wired_link_state): request initial status
dump of all cards when we start up, instead of relying
on /sys/.../carrier.
(nm_info_handler), (nm_set_up_log_handlers):
log handlers to specify what syslog priorites
the logging macros default to.
* src/NetworkManagerAPList.c:
(nm_ap_list_populate_from_nmi):
s/dbus_free_string_array/g_strfreev/
* src/NetworkManagerDbus.c:
(nm_dbus_get_network_object):
validate d-bus message argument types.
Advance message iterator after reading argument,
prepend instead of append to GSList.
* src/NetworkManagerDevice.c:
(nm_device_probe_wired_link_status):
remove redundant /sys in /sys path. remove wrong
contents == NULL means has carrier assumption.
* src/nm-netlink-monitor.c
(nm_netlink_monitor_request_status): implement
function to ask kernel to dump interface link
status over netlink socket.
* test/*.c: s/dbus_free/g_free/
* utils/nm-utils.h:
(nm_print_backtrace): new macro to print backtrace.
(nm_get_timestamp): new macro to get sub-second precise
unix timestamp.
(nm_info), (nm_debug), (nm_warning), (nm_error):
new logging functions. nm_info just prints,
nm_debug includes timestamp and function,
nm_warning includes function, nm_error includes
backtrace and sigtrap.
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@497 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2005-03-15 05:30:15 +00:00
|
|
|
nm_warning ("could not create access point lists.");
|
2006-03-05 Dan Williams <dcbw@redhat.com>
Process netlink messages in device subclasses rather than in
NetworkManager.c. Also add support for recognizing Wireless Events.
* configure.in
- Find GLIB_GENMARSHAL
* src/Makefile.am
- Since we're marshalling custom types for wireless event signals,
we get to create our own marshallers using GLIB_GENMARSHAL
* src/NetworkManager.c
- (nm_monitor_wired_link_state): renamed to nm_monitor_setup
- (nm_monitor_setup): renamed from nm_monitor_wired_link_state, and
cut down somewhat. We no longer process signals here.
- (nm_data_new): create the netlink monitor here, and remove a
useless call to nm_policy_schedule_device_change_check()
- (nm_data_free): get rid of the netlink monitor here
- (nm_device_link_activated, nm_device_link_deactivated): removed
- (main): don't create the netlink monitor here, let nm_data_new
do that. Call nm_policy_schedule_device_change_check() right
before we jump to the mainloop to figure out which device
to use first
* src/NetworkManagerSystem.[ch]
- (nm_system_get_rtnl_index_from_iface, nm_system_get_iface_from_rtnl_index):
convert back and forth from interface names to interface
indexes
* src/nm-device-802-11-wireless.c
- (real_init): connect to wireless-event signals from the netlink
monitor object
- (nm_device_802_11_wireless_event): new function, schedule handler
for wireless event signals from the netlink monitor object. We
want the handler to run in the device's context
- (wireless_event_helper): handle wireless-event signals from netlink
- (nm_device_802_11_wireless_dispose): disconnect wireless-event
signal handler
* src/nm-device-802-11-wireless.h
- remove unused prototype for nm_device_802_11_wireless_new
* src/nm-device-802-3-ethernet.c
- (real_init): new function; set up signal handlers for link events
- (nm_device_802_3_ethernet_link_activated): new function, schedule
handler for netlink link activated events on device's main loop
- (link_activated_helper): when we get a link activated event, set
the device's link to be active
- (nm_device_802_3_ethernet_link_deactivated): new function; schedule
handler for netlink link deactivated events on device's main loop
- (link_deactivated_helper): when we get a link deactivated event, set
the device's link to be inactive
- (nm_device_802_3_ethernet_dispose): disconnect signal handler on
dispose
* src/nm-device-802-3-ethernet.h
- remove unused prototype for nm_device_802_3_ethernet_new
* src/nm-device.[ch]
- (nm_get_device_by_iface_locked): variant of nm_get_device_by_iface
but locks the device list
- (nm_device_set_active_link): a little bit of cleanup and de-indenting
* src/nm-netlink-monitor.[ch]
- (nm_netlink_monitor_class_install_signals): New signal
"wireless-event"
- (nm_netlink_monitor_new): keep reference to NMData so we can get
at the device list
- (nm_netlink_monitor_event_handler): expand for wireless events too
* src/nm-marshal-main.c
- Include generated nm-marshal.c and nm-marshal.h
* src/nm-marshal.list
- List of custom marshal functions
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1555 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-03-06 01:10:58 +00:00
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return data;
|
2004-06-24 14:18:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* nm_data_free
|
|
|
|
|
*
|
|
|
|
|
* Free data structure used in callbacks.
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
static void nm_data_free (NMData *data)
|
|
|
|
|
{
|
|
|
|
|
g_return_if_fail (data != NULL);
|
|
|
|
|
|
2004-09-08 18:14:42 +00:00
|
|
|
nm_ap_list_unref (data->allowed_ap_list);
|
2004-08-05 18:54:29 +00:00
|
|
|
nm_ap_list_unref (data->invalid_ap_list);
|
2004-07-27 16:15:36 +00:00
|
|
|
|
2005-05-05 16:52:04 +00:00
|
|
|
g_object_unref (data->named_manager);
|
|
|
|
|
|
2006-08-04 15:46:06 +00:00
|
|
|
g_slice_free (NMData, data);
|
2004-06-24 14:18:37 +00:00
|
|
|
}
|
|
|
|
|
|
2006-10-13 19:41:47 +00:00
|
|
|
static void
|
|
|
|
|
nm_name_owner_changed_handler (NMDBusManager *mgr,
|
|
|
|
|
const char *name,
|
|
|
|
|
const char *old,
|
|
|
|
|
const char *new,
|
|
|
|
|
gpointer user_data)
|
2005-06-23 12:20:32 +00:00
|
|
|
{
|
2006-10-13 19:41:47 +00:00
|
|
|
NMData * data = (NMData *) user_data;
|
|
|
|
|
gboolean old_owner_good = (old && (strlen (old) > 0));
|
|
|
|
|
gboolean new_owner_good = (new && (strlen (new) > 0));
|
2005-06-23 12:20:32 +00:00
|
|
|
|
2007-02-08 15:34:26 +00:00
|
|
|
if (strcmp (name, NMI_DBUS_SERVICE) == 0) {
|
2007-02-19 13:09:32 +00:00
|
|
|
if (!old_owner_good && new_owner_good)
|
2006-10-14 12:50:20 +00:00
|
|
|
/* NMI appeared, update stuff */
|
|
|
|
|
nm_policy_schedule_allowed_ap_list_update (data);
|
2005-06-23 12:20:32 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2007-02-19 13:09:32 +00:00
|
|
|
static void
|
|
|
|
|
nm_signal_handler (int signo)
|
|
|
|
|
{
|
|
|
|
|
static int in_fatal = 0;
|
|
|
|
|
|
|
|
|
|
/* avoid loops */
|
|
|
|
|
if (in_fatal > 0)
|
|
|
|
|
return;
|
|
|
|
|
++in_fatal;
|
|
|
|
|
|
|
|
|
|
switch (signo)
|
|
|
|
|
{
|
|
|
|
|
case SIGSEGV:
|
|
|
|
|
case SIGBUS:
|
|
|
|
|
case SIGILL:
|
|
|
|
|
case SIGABRT:
|
|
|
|
|
nm_warning ("Caught signal %d. Generating backtrace...", signo);
|
|
|
|
|
nm_logging_backtrace ();
|
|
|
|
|
exit (1);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case SIGFPE:
|
|
|
|
|
case SIGPIPE:
|
|
|
|
|
/* let the fatal signals interrupt us */
|
|
|
|
|
--in_fatal;
|
|
|
|
|
|
|
|
|
|
nm_warning ("Caught signal %d, shutting down abnormally. Generating backtrace...", signo);
|
|
|
|
|
nm_logging_backtrace ();
|
|
|
|
|
g_main_loop_quit (main_loop);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case SIGINT:
|
|
|
|
|
case SIGTERM:
|
|
|
|
|
/* let the fatal signals interrupt us */
|
|
|
|
|
--in_fatal;
|
|
|
|
|
|
|
|
|
|
nm_warning ("Caught signal %d, shutting down normally.", signo);
|
|
|
|
|
g_main_loop_quit (main_loop);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case SIGHUP:
|
|
|
|
|
--in_fatal;
|
|
|
|
|
/* FIXME:
|
|
|
|
|
* Reread config stuff like system config files, VPN service files, etc
|
|
|
|
|
*/
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case SIGUSR1:
|
|
|
|
|
--in_fatal;
|
|
|
|
|
/* FIXME:
|
|
|
|
|
* Play with log levels or something
|
|
|
|
|
*/
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
signal (signo, nm_signal_handler);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
setup_signals (void)
|
|
|
|
|
{
|
|
|
|
|
struct sigaction action;
|
|
|
|
|
sigset_t mask;
|
|
|
|
|
|
|
|
|
|
sigemptyset (&mask);
|
|
|
|
|
action.sa_handler = nm_signal_handler;
|
|
|
|
|
action.sa_mask = mask;
|
|
|
|
|
action.sa_flags = 0;
|
|
|
|
|
sigaction (SIGTERM, &action, NULL);
|
|
|
|
|
sigaction (SIGINT, &action, NULL);
|
|
|
|
|
sigaction (SIGILL, &action, NULL);
|
|
|
|
|
sigaction (SIGBUS, &action, NULL);
|
|
|
|
|
sigaction (SIGFPE, &action, NULL);
|
|
|
|
|
sigaction (SIGHUP, &action, NULL);
|
|
|
|
|
sigaction (SIGSEGV, &action, NULL);
|
|
|
|
|
sigaction (SIGABRT, &action, NULL);
|
|
|
|
|
sigaction (SIGUSR1, &action, NULL);
|
|
|
|
|
}
|
|
|
|
|
|
2006-02-27 20:00:25 +00:00
|
|
|
static void
|
2006-02-27 05:50:28 +00:00
|
|
|
write_pidfile (const char *pidfile)
|
|
|
|
|
{
|
2006-02-27 20:00:25 +00:00
|
|
|
char pid[16];
|
2006-02-27 05:50:28 +00:00
|
|
|
int fd;
|
2006-02-27 20:00:25 +00:00
|
|
|
|
|
|
|
|
if ((fd = open (pidfile, O_CREAT|O_WRONLY|O_TRUNC, 00644)) < 0)
|
|
|
|
|
{
|
|
|
|
|
nm_warning ("Opening %s failed: %s", pidfile, strerror (errno));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
snprintf (pid, sizeof (pid), "%d", getpid ());
|
|
|
|
|
if (write (fd, pid, strlen (pid)) < 0)
|
|
|
|
|
nm_warning ("Writing to %s failed: %s", pidfile, strerror (errno));
|
|
|
|
|
if (close (fd))
|
|
|
|
|
nm_warning ("Closing %s failed: %s", pidfile, strerror (errno));
|
2006-02-27 05:50:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* nm_print_usage
|
|
|
|
|
*
|
|
|
|
|
* Prints program usage.
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
static void nm_print_usage (void)
|
|
|
|
|
{
|
|
|
|
|
fprintf (stderr,
|
|
|
|
|
"\n"
|
|
|
|
|
"NetworkManager monitors all network connections and automatically\n"
|
|
|
|
|
"chooses the best connection to use. It also allows the user to\n"
|
|
|
|
|
"specify wireless access points which wireless cards in the computer\n"
|
|
|
|
|
"should associate with.\n"
|
|
|
|
|
"\n");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2004-06-24 14:18:37 +00:00
|
|
|
/*
|
|
|
|
|
* main
|
|
|
|
|
*
|
|
|
|
|
*/
|
2006-10-13 19:41:47 +00:00
|
|
|
int
|
|
|
|
|
main (int argc, char *argv[])
|
2004-06-24 14:18:37 +00:00
|
|
|
{
|
2006-10-13 19:41:47 +00:00
|
|
|
GOptionContext *opt_ctx = NULL;
|
2006-05-28 02:55:44 +00:00
|
|
|
gboolean become_daemon = FALSE;
|
2006-05-28 03:30:44 +00:00
|
|
|
gboolean show_usage = FALSE;
|
2006-02-27 05:50:28 +00:00
|
|
|
char * pidfile = NULL;
|
2006-02-27 20:06:24 +00:00
|
|
|
char * user_pidfile = NULL;
|
2007-02-08 15:34:26 +00:00
|
|
|
NMPolicy *policy;
|
|
|
|
|
NMHalManager *hal_manager = NULL;
|
2007-02-19 13:09:32 +00:00
|
|
|
NMVPNManager *vpn_manager = NULL;
|
2006-10-13 19:41:47 +00:00
|
|
|
NMDBusManager * dbus_mgr;
|
|
|
|
|
DBusConnection *dbus_connection;
|
2006-11-25 15:41:04 +00:00
|
|
|
NMSupplicantManager * sup_mgr = NULL;
|
2006-10-13 19:41:47 +00:00
|
|
|
int exit_status = EXIT_FAILURE;
|
|
|
|
|
|
|
|
|
|
GOptionEntry options[] = {
|
|
|
|
|
{"no-daemon", 0, 0, G_OPTION_ARG_NONE, &become_daemon, "Don't become a daemon", NULL},
|
2007-02-16 11:23:49 +00:00
|
|
|
{"pid-file", 0, 0, G_OPTION_ARG_FILENAME, &user_pidfile, "Specify the location of a PID file", "filename"},
|
2006-10-13 19:41:47 +00:00
|
|
|
{"info", 0, 0, G_OPTION_ARG_NONE, &show_usage, "Show application information", NULL},
|
|
|
|
|
{NULL}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
if (getuid () != 0) {
|
2005-03-14 Ray Strode <rstrode@redhat.com>
Fourth (probably working) cut at porting to
dbus 0.30 api and new hal. This cut adds
some new logging macros to make debugging
easier.
* dispatcher-daemon/NetworkManagerDispatcher.c:
* info-daemon/NetworkmanagerInfo.c:
* info-daemon/NetworkManagerInfoPassphraseDialog.c:
* info-daemon/NetworkManagerInfoVPN.c:
* src/NetworkManager.c:
* src/NetworkManagerAP.c:
* src/NetworkManagerAPList.c:
* src/NetworkManagerDHCP.c:
* src/NetworkManagerDbus.c:
* src/NetworkManagerDevice.c:
* src/NetworkManagerPolicy.c:
* src/NetworkManagerSystem.c:
* src/NetworkManagerUtils.c:
* src/NetworkManagerWireless.c:
* src/autoip.c:
* src/nm-dbus-nm.c:
* src/backends/NetworkManagerDebian.c:
* src/backends/NetworkManagerGentoo.c:
* src/backends/NetworkManagerRedHat.c:
* src/backends/NetworkManagerSlackware.c:
use new logging macros.
* dispatcher-daemon/NetworkManagerDispatcher.c:
(nmd_dbus_filter): s/dbus_free/g_free/
* info-daemon/Makefile.am: link in utils library.
* info-daemon/NetworkmanagerInfo.c: use new logging
macros.
(nmi_dbus_get_network): don't assume enumerations
are 32-bit.
(nmi_dbus_nmi_message_handler): don't free what
doesn't belong to us.
* libnm_glib/libnm_glib.c:
(libnm_glib_get_nm_status):
(libnm_glib_init): don't free what doesn't
belong to us.
(libnm_glib_dbus): strdup result, so it doesn't get
lost when message is unref'd.
* panel-applet/NMWirelessAppletDbus.c:
(nmwa_dbus_update_devices): s/dbus_free/g_free/
* src/NetworkManager.c:
(nm_monitor_wired_link_state): request initial status
dump of all cards when we start up, instead of relying
on /sys/.../carrier.
(nm_info_handler), (nm_set_up_log_handlers):
log handlers to specify what syslog priorites
the logging macros default to.
* src/NetworkManagerAPList.c:
(nm_ap_list_populate_from_nmi):
s/dbus_free_string_array/g_strfreev/
* src/NetworkManagerDbus.c:
(nm_dbus_get_network_object):
validate d-bus message argument types.
Advance message iterator after reading argument,
prepend instead of append to GSList.
* src/NetworkManagerDevice.c:
(nm_device_probe_wired_link_status):
remove redundant /sys in /sys path. remove wrong
contents == NULL means has carrier assumption.
* src/nm-netlink-monitor.c
(nm_netlink_monitor_request_status): implement
function to ask kernel to dump interface link
status over netlink socket.
* test/*.c: s/dbus_free/g_free/
* utils/nm-utils.h:
(nm_print_backtrace): new macro to print backtrace.
(nm_get_timestamp): new macro to get sub-second precise
unix timestamp.
(nm_info), (nm_debug), (nm_warning), (nm_error):
new logging functions. nm_info just prints,
nm_debug includes timestamp and function,
nm_warning includes function, nm_error includes
backtrace and sigtrap.
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@497 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2005-03-15 05:30:15 +00:00
|
|
|
g_printerr ("You must be root to run NetworkManager!\n");
|
2006-10-13 19:41:47 +00:00
|
|
|
goto exit;
|
2004-10-15 15:59:25 +00:00
|
|
|
}
|
2004-06-24 14:18:37 +00:00
|
|
|
|
2006-05-24 14:16:48 +00:00
|
|
|
bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
|
|
|
|
|
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
|
|
|
|
|
textdomain (GETTEXT_PACKAGE);
|
|
|
|
|
|
2004-06-24 14:18:37 +00:00
|
|
|
/* Parse options */
|
2006-10-13 19:41:47 +00:00
|
|
|
opt_ctx = g_option_context_new("");
|
|
|
|
|
g_option_context_add_main_entries(opt_ctx, options, NULL);
|
|
|
|
|
g_option_context_parse(opt_ctx, &argc, &argv, NULL);
|
|
|
|
|
g_option_context_free(opt_ctx);
|
|
|
|
|
|
|
|
|
|
if (show_usage == TRUE) {
|
2006-05-28 03:30:44 +00:00
|
|
|
nm_print_usage();
|
2006-10-13 19:41:47 +00:00
|
|
|
exit_status = EXIT_SUCCESS;
|
|
|
|
|
goto exit;
|
2006-05-28 03:30:44 +00:00
|
|
|
}
|
2004-06-24 14:18:37 +00:00
|
|
|
|
2006-10-13 19:41:47 +00:00
|
|
|
pidfile = g_strdup (user_pidfile ? user_pidfile : NM_DEFAULT_PID_FILE);
|
|
|
|
|
|
|
|
|
|
/* Tricky: become_daemon is FALSE by default, so unless it's TRUE because
|
|
|
|
|
* of a CLI option, it'll become TRUE after this
|
|
|
|
|
*/
|
|
|
|
|
become_daemon = !become_daemon;
|
|
|
|
|
if (become_daemon) {
|
|
|
|
|
if (daemon (0, 0) < 0) {
|
2006-02-27 20:06:24 +00:00
|
|
|
int saved_errno;
|
2005-03-14 Ray Strode <rstrode@redhat.com>
Fourth (probably working) cut at porting to
dbus 0.30 api and new hal. This cut adds
some new logging macros to make debugging
easier.
* dispatcher-daemon/NetworkManagerDispatcher.c:
* info-daemon/NetworkmanagerInfo.c:
* info-daemon/NetworkManagerInfoPassphraseDialog.c:
* info-daemon/NetworkManagerInfoVPN.c:
* src/NetworkManager.c:
* src/NetworkManagerAP.c:
* src/NetworkManagerAPList.c:
* src/NetworkManagerDHCP.c:
* src/NetworkManagerDbus.c:
* src/NetworkManagerDevice.c:
* src/NetworkManagerPolicy.c:
* src/NetworkManagerSystem.c:
* src/NetworkManagerUtils.c:
* src/NetworkManagerWireless.c:
* src/autoip.c:
* src/nm-dbus-nm.c:
* src/backends/NetworkManagerDebian.c:
* src/backends/NetworkManagerGentoo.c:
* src/backends/NetworkManagerRedHat.c:
* src/backends/NetworkManagerSlackware.c:
use new logging macros.
* dispatcher-daemon/NetworkManagerDispatcher.c:
(nmd_dbus_filter): s/dbus_free/g_free/
* info-daemon/Makefile.am: link in utils library.
* info-daemon/NetworkmanagerInfo.c: use new logging
macros.
(nmi_dbus_get_network): don't assume enumerations
are 32-bit.
(nmi_dbus_nmi_message_handler): don't free what
doesn't belong to us.
* libnm_glib/libnm_glib.c:
(libnm_glib_get_nm_status):
(libnm_glib_init): don't free what doesn't
belong to us.
(libnm_glib_dbus): strdup result, so it doesn't get
lost when message is unref'd.
* panel-applet/NMWirelessAppletDbus.c:
(nmwa_dbus_update_devices): s/dbus_free/g_free/
* src/NetworkManager.c:
(nm_monitor_wired_link_state): request initial status
dump of all cards when we start up, instead of relying
on /sys/.../carrier.
(nm_info_handler), (nm_set_up_log_handlers):
log handlers to specify what syslog priorites
the logging macros default to.
* src/NetworkManagerAPList.c:
(nm_ap_list_populate_from_nmi):
s/dbus_free_string_array/g_strfreev/
* src/NetworkManagerDbus.c:
(nm_dbus_get_network_object):
validate d-bus message argument types.
Advance message iterator after reading argument,
prepend instead of append to GSList.
* src/NetworkManagerDevice.c:
(nm_device_probe_wired_link_status):
remove redundant /sys in /sys path. remove wrong
contents == NULL means has carrier assumption.
* src/nm-netlink-monitor.c
(nm_netlink_monitor_request_status): implement
function to ask kernel to dump interface link
status over netlink socket.
* test/*.c: s/dbus_free/g_free/
* utils/nm-utils.h:
(nm_print_backtrace): new macro to print backtrace.
(nm_get_timestamp): new macro to get sub-second precise
unix timestamp.
(nm_info), (nm_debug), (nm_warning), (nm_error):
new logging functions. nm_info just prints,
nm_debug includes timestamp and function,
nm_warning includes function, nm_error includes
backtrace and sigtrap.
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@497 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2005-03-15 05:30:15 +00:00
|
|
|
|
2006-02-27 20:06:24 +00:00
|
|
|
saved_errno = errno;
|
2006-10-13 19:41:47 +00:00
|
|
|
nm_error ("Could not daemonize: %s [error %u]",
|
|
|
|
|
g_strerror (saved_errno),
|
|
|
|
|
saved_errno);
|
|
|
|
|
goto exit;
|
2006-02-27 20:06:24 +00:00
|
|
|
}
|
|
|
|
|
write_pidfile (pidfile);
|
2005-01-22 04:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
2006-05-05 19:42:20 +00:00
|
|
|
/*
|
|
|
|
|
* Set the umask to 0022, which results in 0666 & ~0022 = 0644.
|
|
|
|
|
* Otherwise, if root (or an su'ing user) has a wacky umask, we could
|
|
|
|
|
* write out an unreadable resolv.conf.
|
|
|
|
|
*/
|
|
|
|
|
umask (022);
|
|
|
|
|
|
2004-06-24 14:18:37 +00:00
|
|
|
g_type_init ();
|
|
|
|
|
if (!g_thread_supported ())
|
|
|
|
|
g_thread_init (NULL);
|
2005-01-29 23:34:31 +00:00
|
|
|
dbus_g_thread_init ();
|
2007-02-19 13:09:32 +00:00
|
|
|
|
|
|
|
|
setup_signals ();
|
|
|
|
|
|
2006-02-27 04:31:52 +00:00
|
|
|
nm_logging_setup (become_daemon);
|
2005-03-14 Ray Strode <rstrode@redhat.com>
Fourth (probably working) cut at porting to
dbus 0.30 api and new hal. This cut adds
some new logging macros to make debugging
easier.
* dispatcher-daemon/NetworkManagerDispatcher.c:
* info-daemon/NetworkmanagerInfo.c:
* info-daemon/NetworkManagerInfoPassphraseDialog.c:
* info-daemon/NetworkManagerInfoVPN.c:
* src/NetworkManager.c:
* src/NetworkManagerAP.c:
* src/NetworkManagerAPList.c:
* src/NetworkManagerDHCP.c:
* src/NetworkManagerDbus.c:
* src/NetworkManagerDevice.c:
* src/NetworkManagerPolicy.c:
* src/NetworkManagerSystem.c:
* src/NetworkManagerUtils.c:
* src/NetworkManagerWireless.c:
* src/autoip.c:
* src/nm-dbus-nm.c:
* src/backends/NetworkManagerDebian.c:
* src/backends/NetworkManagerGentoo.c:
* src/backends/NetworkManagerRedHat.c:
* src/backends/NetworkManagerSlackware.c:
use new logging macros.
* dispatcher-daemon/NetworkManagerDispatcher.c:
(nmd_dbus_filter): s/dbus_free/g_free/
* info-daemon/Makefile.am: link in utils library.
* info-daemon/NetworkmanagerInfo.c: use new logging
macros.
(nmi_dbus_get_network): don't assume enumerations
are 32-bit.
(nmi_dbus_nmi_message_handler): don't free what
doesn't belong to us.
* libnm_glib/libnm_glib.c:
(libnm_glib_get_nm_status):
(libnm_glib_init): don't free what doesn't
belong to us.
(libnm_glib_dbus): strdup result, so it doesn't get
lost when message is unref'd.
* panel-applet/NMWirelessAppletDbus.c:
(nmwa_dbus_update_devices): s/dbus_free/g_free/
* src/NetworkManager.c:
(nm_monitor_wired_link_state): request initial status
dump of all cards when we start up, instead of relying
on /sys/.../carrier.
(nm_info_handler), (nm_set_up_log_handlers):
log handlers to specify what syslog priorites
the logging macros default to.
* src/NetworkManagerAPList.c:
(nm_ap_list_populate_from_nmi):
s/dbus_free_string_array/g_strfreev/
* src/NetworkManagerDbus.c:
(nm_dbus_get_network_object):
validate d-bus message argument types.
Advance message iterator after reading argument,
prepend instead of append to GSList.
* src/NetworkManagerDevice.c:
(nm_device_probe_wired_link_status):
remove redundant /sys in /sys path. remove wrong
contents == NULL means has carrier assumption.
* src/nm-netlink-monitor.c
(nm_netlink_monitor_request_status): implement
function to ask kernel to dump interface link
status over netlink socket.
* test/*.c: s/dbus_free/g_free/
* utils/nm-utils.h:
(nm_print_backtrace): new macro to print backtrace.
(nm_get_timestamp): new macro to get sub-second precise
unix timestamp.
(nm_info), (nm_debug), (nm_warning), (nm_error):
new logging functions. nm_info just prints,
nm_debug includes timestamp and function,
nm_warning includes function, nm_error includes
backtrace and sigtrap.
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@497 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2005-03-15 05:30:15 +00:00
|
|
|
nm_info ("starting...");
|
2004-08-23 19:20:49 +00:00
|
|
|
|
2007-02-19 13:09:32 +00:00
|
|
|
nm_system_init ();
|
|
|
|
|
main_loop = g_main_loop_new (NULL, FALSE);
|
2004-08-25 20:52:19 +00:00
|
|
|
|
2004-06-24 14:18:37 +00:00
|
|
|
/* Initialize our instance data */
|
2007-02-16 11:23:49 +00:00
|
|
|
nm_data = nm_data_new ();
|
2006-10-13 19:41:47 +00:00
|
|
|
if (!nm_data) {
|
|
|
|
|
nm_error ("Failed to initialize.");
|
|
|
|
|
goto pidfile;
|
2006-03-05 Dan Williams <dcbw@redhat.com>
Process netlink messages in device subclasses rather than in
NetworkManager.c. Also add support for recognizing Wireless Events.
* configure.in
- Find GLIB_GENMARSHAL
* src/Makefile.am
- Since we're marshalling custom types for wireless event signals,
we get to create our own marshallers using GLIB_GENMARSHAL
* src/NetworkManager.c
- (nm_monitor_wired_link_state): renamed to nm_monitor_setup
- (nm_monitor_setup): renamed from nm_monitor_wired_link_state, and
cut down somewhat. We no longer process signals here.
- (nm_data_new): create the netlink monitor here, and remove a
useless call to nm_policy_schedule_device_change_check()
- (nm_data_free): get rid of the netlink monitor here
- (nm_device_link_activated, nm_device_link_deactivated): removed
- (main): don't create the netlink monitor here, let nm_data_new
do that. Call nm_policy_schedule_device_change_check() right
before we jump to the mainloop to figure out which device
to use first
* src/NetworkManagerSystem.[ch]
- (nm_system_get_rtnl_index_from_iface, nm_system_get_iface_from_rtnl_index):
convert back and forth from interface names to interface
indexes
* src/nm-device-802-11-wireless.c
- (real_init): connect to wireless-event signals from the netlink
monitor object
- (nm_device_802_11_wireless_event): new function, schedule handler
for wireless event signals from the netlink monitor object. We
want the handler to run in the device's context
- (wireless_event_helper): handle wireless-event signals from netlink
- (nm_device_802_11_wireless_dispose): disconnect wireless-event
signal handler
* src/nm-device-802-11-wireless.h
- remove unused prototype for nm_device_802_11_wireless_new
* src/nm-device-802-3-ethernet.c
- (real_init): new function; set up signal handlers for link events
- (nm_device_802_3_ethernet_link_activated): new function, schedule
handler for netlink link activated events on device's main loop
- (link_activated_helper): when we get a link activated event, set
the device's link to be active
- (nm_device_802_3_ethernet_link_deactivated): new function; schedule
handler for netlink link deactivated events on device's main loop
- (link_deactivated_helper): when we get a link deactivated event, set
the device's link to be inactive
- (nm_device_802_3_ethernet_dispose): disconnect signal handler on
dispose
* src/nm-device-802-3-ethernet.h
- remove unused prototype for nm_device_802_3_ethernet_new
* src/nm-device.[ch]
- (nm_get_device_by_iface_locked): variant of nm_get_device_by_iface
but locks the device list
- (nm_device_set_active_link): a little bit of cleanup and de-indenting
* src/nm-netlink-monitor.[ch]
- (nm_netlink_monitor_class_install_signals): New signal
"wireless-event"
- (nm_netlink_monitor_new): keep reference to NMData so we can get
at the device list
- (nm_netlink_monitor_event_handler): expand for wireless events too
* src/nm-marshal-main.c
- Include generated nm-marshal.c and nm-marshal.h
* src/nm-marshal.list
- List of custom marshal functions
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1555 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-03-06 01:10:58 +00:00
|
|
|
}
|
2004-06-24 14:18:37 +00:00
|
|
|
|
2007-02-19 13:09:32 +00:00
|
|
|
/* Create watch functions that monitor cards for link status. */
|
|
|
|
|
if (!nm_monitor_setup ())
|
|
|
|
|
goto done;
|
|
|
|
|
|
2006-10-13 19:41:47 +00:00
|
|
|
/* Initialize our DBus service & connection */
|
2007-01-04 12:06:26 +00:00
|
|
|
dbus_mgr = nm_dbus_manager_get ();
|
2006-10-13 19:41:47 +00:00
|
|
|
dbus_connection = nm_dbus_manager_get_dbus_connection (dbus_mgr);
|
|
|
|
|
if (!dbus_connection) {
|
|
|
|
|
nm_error ("Failed to initialize. "
|
|
|
|
|
"Either dbus is not running, or the "
|
|
|
|
|
"NetworkManager dbus security policy "
|
|
|
|
|
"was not loaded.");
|
|
|
|
|
goto done;
|
2004-06-24 14:18:37 +00:00
|
|
|
}
|
2007-02-19 13:09:32 +00:00
|
|
|
|
|
|
|
|
g_signal_connect (dbus_mgr,
|
|
|
|
|
"name-owner-changed",
|
|
|
|
|
G_CALLBACK (nm_name_owner_changed_handler),
|
|
|
|
|
nm_data);
|
|
|
|
|
|
2007-03-02 Tambet Ingo <tambet@ximian.com>
* libnm-glib/nm-device-802-11-wireless.c: Cache networks (bssids) list.
We get signalled when it changes.
* libnm-glib/nm-client.c: Cache NMState and device list, we get signalled
when it changes.
* libnm-glib/nm-device.c: Cache the device state property.
* libnm-glib/nm-access-point.c: Cache the strength property.
* src/nm-device-802-11-wireless.c: Fix wireless device scanning scheduler.
The new algorithm is to start from SCAN_INTERVAL_MIN (currently defined as 0)
and add a SCAN_INTERVAL_STEP (currently 20 seconds) with each successful scan
until SCAN_INTERVAL_MAX (currently 120 seconds) is reached. Do not scan while
the device is down, activating, or activated (in case of A/B/G cards).
Remove some old dead ifdef'ed out code that used to configure wireless devices,
it's all done through supplicant now.
* src/supplicant-manager/nm-supplicant-interface.c: Fix the reference
counting issues with pending calls which caused leaks and crashes when
interface was removed (now that the interface actually gets removed).
* src/nm-call-store.c: Make a copy of data before running a foreach
with user callback on it - The most common usage pattern is to cancel
(and thus remove) all pending calls with foreach which would modify
the hash table we're iterating over.
* src/nm-manager.c: When a device is added, make sure it is "up". When
it's removed or disabled due to disabling wireless or networking, bring
it down.
* include/NetworkManager.h: Add new device state NM_DEVICE_STATE_DOWN.
* src/nm-device-802-11-wireless.c:
* src/nm-device-802-3-ethernet.c:
* src/nm-device.c:
- Remove "init" virtual function, all gobjects have a place for that
already (constructor).
- Replace "start" virtual function with "bring_up", devices can be
brought up and down more than just on startup now.
- Add "is_up" virtual function.
- Implement one way to bring a device down instead of previous 4 different
ways, each of witch did something different.
* src/NetworkManagerUtils.c (nm_dev_sock_open): This doesn't need an NMDevice,
all it needs is the device interface.
Get rid of NMData.dev_list (3 members to go).
Get rif of NMData in a lot of places.
* gnome/libnm_glib/libnm_glib.c: Make it compile again.
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2395 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-03-02 09:30:48 +00:00
|
|
|
manager = nm_manager_new ();
|
2007-06-11 13:36:34 +00:00
|
|
|
g_object_set_data (G_OBJECT (manager), "NM_DATA_HACK", nm_data);
|
2007-03-02 Tambet Ingo <tambet@ximian.com>
* libnm-glib/nm-device-802-11-wireless.c: Cache networks (bssids) list.
We get signalled when it changes.
* libnm-glib/nm-client.c: Cache NMState and device list, we get signalled
when it changes.
* libnm-glib/nm-device.c: Cache the device state property.
* libnm-glib/nm-access-point.c: Cache the strength property.
* src/nm-device-802-11-wireless.c: Fix wireless device scanning scheduler.
The new algorithm is to start from SCAN_INTERVAL_MIN (currently defined as 0)
and add a SCAN_INTERVAL_STEP (currently 20 seconds) with each successful scan
until SCAN_INTERVAL_MAX (currently 120 seconds) is reached. Do not scan while
the device is down, activating, or activated (in case of A/B/G cards).
Remove some old dead ifdef'ed out code that used to configure wireless devices,
it's all done through supplicant now.
* src/supplicant-manager/nm-supplicant-interface.c: Fix the reference
counting issues with pending calls which caused leaks and crashes when
interface was removed (now that the interface actually gets removed).
* src/nm-call-store.c: Make a copy of data before running a foreach
with user callback on it - The most common usage pattern is to cancel
(and thus remove) all pending calls with foreach which would modify
the hash table we're iterating over.
* src/nm-manager.c: When a device is added, make sure it is "up". When
it's removed or disabled due to disabling wireless or networking, bring
it down.
* include/NetworkManager.h: Add new device state NM_DEVICE_STATE_DOWN.
* src/nm-device-802-11-wireless.c:
* src/nm-device-802-3-ethernet.c:
* src/nm-device.c:
- Remove "init" virtual function, all gobjects have a place for that
already (constructor).
- Replace "start" virtual function with "bring_up", devices can be
brought up and down more than just on startup now.
- Add "is_up" virtual function.
- Implement one way to bring a device down instead of previous 4 different
ways, each of witch did something different.
* src/NetworkManagerUtils.c (nm_dev_sock_open): This doesn't need an NMDevice,
all it needs is the device interface.
Get rid of NMData.dev_list (3 members to go).
Get rif of NMData in a lot of places.
* gnome/libnm_glib/libnm_glib.c: Make it compile again.
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2395 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-03-02 09:30:48 +00:00
|
|
|
policy = nm_policy_new (manager);
|
|
|
|
|
|
2007-02-19 13:09:32 +00:00
|
|
|
nm_dbus_manager_register_signal_handler (dbus_mgr,
|
|
|
|
|
NMI_DBUS_INTERFACE,
|
|
|
|
|
NULL,
|
|
|
|
|
nm_dbus_nmi_signal_handler,
|
2007-03-02 Tambet Ingo <tambet@ximian.com>
* libnm-glib/nm-device-802-11-wireless.c: Cache networks (bssids) list.
We get signalled when it changes.
* libnm-glib/nm-client.c: Cache NMState and device list, we get signalled
when it changes.
* libnm-glib/nm-device.c: Cache the device state property.
* libnm-glib/nm-access-point.c: Cache the strength property.
* src/nm-device-802-11-wireless.c: Fix wireless device scanning scheduler.
The new algorithm is to start from SCAN_INTERVAL_MIN (currently defined as 0)
and add a SCAN_INTERVAL_STEP (currently 20 seconds) with each successful scan
until SCAN_INTERVAL_MAX (currently 120 seconds) is reached. Do not scan while
the device is down, activating, or activated (in case of A/B/G cards).
Remove some old dead ifdef'ed out code that used to configure wireless devices,
it's all done through supplicant now.
* src/supplicant-manager/nm-supplicant-interface.c: Fix the reference
counting issues with pending calls which caused leaks and crashes when
interface was removed (now that the interface actually gets removed).
* src/nm-call-store.c: Make a copy of data before running a foreach
with user callback on it - The most common usage pattern is to cancel
(and thus remove) all pending calls with foreach which would modify
the hash table we're iterating over.
* src/nm-manager.c: When a device is added, make sure it is "up". When
it's removed or disabled due to disabling wireless or networking, bring
it down.
* include/NetworkManager.h: Add new device state NM_DEVICE_STATE_DOWN.
* src/nm-device-802-11-wireless.c:
* src/nm-device-802-3-ethernet.c:
* src/nm-device.c:
- Remove "init" virtual function, all gobjects have a place for that
already (constructor).
- Replace "start" virtual function with "bring_up", devices can be
brought up and down more than just on startup now.
- Add "is_up" virtual function.
- Implement one way to bring a device down instead of previous 4 different
ways, each of witch did something different.
* src/NetworkManagerUtils.c (nm_dev_sock_open): This doesn't need an NMDevice,
all it needs is the device interface.
Get rid of NMData.dev_list (3 members to go).
Get rif of NMData in a lot of places.
* gnome/libnm_glib/libnm_glib.c: Make it compile again.
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2395 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-03-02 09:30:48 +00:00
|
|
|
manager);
|
2007-02-08 15:34:26 +00:00
|
|
|
|
2006-11-25 15:41:04 +00:00
|
|
|
/* Initialize the supplicant manager */
|
|
|
|
|
sup_mgr = nm_supplicant_manager_get ();
|
|
|
|
|
if (!sup_mgr) {
|
|
|
|
|
nm_error ("Failed to initialize the supplicant manager.");
|
|
|
|
|
goto done;
|
|
|
|
|
}
|
|
|
|
|
|
2007-02-19 13:09:32 +00:00
|
|
|
vpn_manager = nm_vpn_manager_new (manager, nm_data);
|
|
|
|
|
if (!vpn_manager) {
|
2006-10-13 19:41:47 +00:00
|
|
|
nm_warning ("Failed to start the VPN manager.");
|
|
|
|
|
goto done;
|
|
|
|
|
}
|
2005-04-15 15:43:42 +00:00
|
|
|
|
2006-10-13 19:41:47 +00:00
|
|
|
nm_data->named_manager = nm_named_manager_new ();
|
|
|
|
|
if (!nm_data->named_manager) {
|
|
|
|
|
nm_warning ("Failed to start the named manager.");
|
|
|
|
|
goto done;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Start our DBus service */
|
|
|
|
|
if (!nm_dbus_manager_start_service (dbus_mgr)) {
|
|
|
|
|
nm_warning ("Failed to start the named manager.");
|
|
|
|
|
goto done;
|
|
|
|
|
}
|
2004-12-05 21:28:42 +00:00
|
|
|
|
2007-02-08 15:34:26 +00:00
|
|
|
hal_manager = nm_hal_manager_new (manager, nm_data);
|
|
|
|
|
if (!hal_manager)
|
|
|
|
|
goto done;
|
2006-10-13 19:41:47 +00:00
|
|
|
|
|
|
|
|
/* If NMI is running, grab allowed wireless network lists from it ASAP */
|
2007-02-19 13:09:32 +00:00
|
|
|
if (nm_dbus_manager_name_has_owner (dbus_mgr, NMI_DBUS_SERVICE))
|
2006-10-13 19:41:47 +00:00
|
|
|
nm_policy_schedule_allowed_ap_list_update (nm_data);
|
2004-08-02 21:12:40 +00:00
|
|
|
|
2004-08-16 19:46:43 +00:00
|
|
|
/* We run dhclient when we need to, and we don't want any stray ones
|
|
|
|
|
* lying around upon launch.
|
|
|
|
|
*/
|
2005-05-03 Dan Williams <dcbw@redhat.com>
* Kill dhcpcd. We now use "dhcdbd", a dbus daemon that controls dhclient.
This means that NetworkManager shouldn't have DHCP issues anymore. It also
means you need dhcdbd, which you can get here (get the latest one):
http://people.redhat.com/jvdias/dhcdbd/
Technically NetworkManager can use any DHCP daemon that uses the same DBUS
interface as dhcdbd.
* Rewrite device activation to facilitate the new DHCP infrastructure and
future improvements. Its now "activation request" based, ie there is a single
activation request composed of the device, access point, and other info which
follows the entire activation process. There are 5 stages of the activation
process which correspond to:
1) Device preparation
2) Device configuration (bring it up, set ESSID/Key/etc)
3) IP Config Start (fire off DHCP if we're using it)
4) IP Config Get (grab config from DHCP or static config files)
5) IP Config Commit (set device's IP address, DNS, etc)
Note that there is no longer a "scanning" step, since the access point must
be known _before_ activation starts. If the access point drops out or does
not exist for some reason, the entire activation process fails and must be
restarted for a different access point or device.
Patch from Bill Moss:
* gnome/applet/applet.c
- Fix type of vpn_failure dialog -> vpn_banner dialog
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@597 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2005-05-03 20:41:36 +00:00
|
|
|
// nm_system_kill_all_dhcp_daemons ();
|
2004-08-16 19:46:43 +00:00
|
|
|
|
|
|
|
|
/* Bring up the loopback interface. */
|
2004-08-24 00:31:47 +00:00
|
|
|
nm_system_enable_loopback ();
|
2004-08-16 19:46:43 +00:00
|
|
|
|
2006-03-05 Dan Williams <dcbw@redhat.com>
Process netlink messages in device subclasses rather than in
NetworkManager.c. Also add support for recognizing Wireless Events.
* configure.in
- Find GLIB_GENMARSHAL
* src/Makefile.am
- Since we're marshalling custom types for wireless event signals,
we get to create our own marshallers using GLIB_GENMARSHAL
* src/NetworkManager.c
- (nm_monitor_wired_link_state): renamed to nm_monitor_setup
- (nm_monitor_setup): renamed from nm_monitor_wired_link_state, and
cut down somewhat. We no longer process signals here.
- (nm_data_new): create the netlink monitor here, and remove a
useless call to nm_policy_schedule_device_change_check()
- (nm_data_free): get rid of the netlink monitor here
- (nm_device_link_activated, nm_device_link_deactivated): removed
- (main): don't create the netlink monitor here, let nm_data_new
do that. Call nm_policy_schedule_device_change_check() right
before we jump to the mainloop to figure out which device
to use first
* src/NetworkManagerSystem.[ch]
- (nm_system_get_rtnl_index_from_iface, nm_system_get_iface_from_rtnl_index):
convert back and forth from interface names to interface
indexes
* src/nm-device-802-11-wireless.c
- (real_init): connect to wireless-event signals from the netlink
monitor object
- (nm_device_802_11_wireless_event): new function, schedule handler
for wireless event signals from the netlink monitor object. We
want the handler to run in the device's context
- (wireless_event_helper): handle wireless-event signals from netlink
- (nm_device_802_11_wireless_dispose): disconnect wireless-event
signal handler
* src/nm-device-802-11-wireless.h
- remove unused prototype for nm_device_802_11_wireless_new
* src/nm-device-802-3-ethernet.c
- (real_init): new function; set up signal handlers for link events
- (nm_device_802_3_ethernet_link_activated): new function, schedule
handler for netlink link activated events on device's main loop
- (link_activated_helper): when we get a link activated event, set
the device's link to be active
- (nm_device_802_3_ethernet_link_deactivated): new function; schedule
handler for netlink link deactivated events on device's main loop
- (link_deactivated_helper): when we get a link deactivated event, set
the device's link to be inactive
- (nm_device_802_3_ethernet_dispose): disconnect signal handler on
dispose
* src/nm-device-802-3-ethernet.h
- remove unused prototype for nm_device_802_3_ethernet_new
* src/nm-device.[ch]
- (nm_get_device_by_iface_locked): variant of nm_get_device_by_iface
but locks the device list
- (nm_device_set_active_link): a little bit of cleanup and de-indenting
* src/nm-netlink-monitor.[ch]
- (nm_netlink_monitor_class_install_signals): New signal
"wireless-event"
- (nm_netlink_monitor_new): keep reference to NMData so we can get
at the device list
- (nm_netlink_monitor_event_handler): expand for wireless events too
* src/nm-marshal-main.c
- Include generated nm-marshal.c and nm-marshal.h
* src/nm-marshal.list
- List of custom marshal functions
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1555 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-03-06 01:10:58 +00:00
|
|
|
/* Run the main loop */
|
2006-10-13 19:41:47 +00:00
|
|
|
exit_status = EXIT_SUCCESS;
|
2007-02-19 13:09:32 +00:00
|
|
|
g_main_loop_run (main_loop);
|
2004-08-23 19:20:49 +00:00
|
|
|
|
2006-10-13 19:41:47 +00:00
|
|
|
done:
|
2005-04-06 16:45:48 +00:00
|
|
|
nm_print_open_socks ();
|
2006-11-25 07:09:11 +00:00
|
|
|
|
2007-02-19 13:09:32 +00:00
|
|
|
if (vpn_manager)
|
|
|
|
|
nm_vpn_manager_dispose (vpn_manager);
|
2006-11-25 07:09:11 +00:00
|
|
|
|
2007-02-08 15:34:26 +00:00
|
|
|
nm_hal_manager_destroy (hal_manager);
|
|
|
|
|
nm_policy_destroy (policy);
|
|
|
|
|
|
|
|
|
|
if (manager)
|
|
|
|
|
g_object_unref (manager);
|
|
|
|
|
|
2004-06-24 14:18:37 +00:00
|
|
|
nm_data_free (nm_data);
|
2006-11-25 15:41:04 +00:00
|
|
|
|
|
|
|
|
if (sup_mgr)
|
|
|
|
|
g_object_unref (sup_mgr);
|
|
|
|
|
|
2006-10-13 19:41:47 +00:00
|
|
|
/* nm_data_free needs the dbus connection, so must kill the
|
|
|
|
|
* dbus manager after that.
|
|
|
|
|
*/
|
|
|
|
|
g_object_unref (dbus_mgr);
|
2006-02-27 04:31:52 +00:00
|
|
|
nm_logging_shutdown ();
|
2004-06-24 14:18:37 +00:00
|
|
|
|
2006-10-13 19:41:47 +00:00
|
|
|
pidfile:
|
2006-02-27 05:50:28 +00:00
|
|
|
if (pidfile)
|
|
|
|
|
unlink (pidfile);
|
2006-10-13 19:41:47 +00:00
|
|
|
g_free (pidfile);
|
2006-02-27 05:50:28 +00:00
|
|
|
|
2006-10-13 19:41:47 +00:00
|
|
|
exit:
|
|
|
|
|
exit (exit_status);
|
2004-06-24 14:18:37 +00:00
|
|
|
}
|