2004-08-11 Dan Williams <dcbw@redhat.com>
* info-daemon/NetworkManagerInfo.c: - (main): clean up Seth's code style * info-daemon/NetworkManagerInfoDbus.c: - Use the more aptly-named path/service/interface constants from NetworkManager - Don't return empty strings ("") as object paths ever, instead return errors * panel-applet/NMWirelessApplet.c: - Clean up Seth's code style * src/NetworkManager.[ch] - (nm_remove_device_from_list): remove anything having to do with pending_device - (main, nm_print_usage): change --daemon=[yes|no] -> --no-daemon * src/NetworkManagerAPList.[ch] - Move Iter struct right above the iter functions to preserve opacity - (nm_ap_list_remove_ap): implement - (nm_ap_list_update_network): deal with errors returned from nm_dbus_get_network_priority(), remove AP if NetworkManagerInfo doesn't know anything about it - (nm_ap_list_diff): user NMAPList iterators - (nm_ap_list_print_members): implement debugging function * src/NetworkManagerDbus.[ch] - (nm_dbus_nm_get_active_device): remove anything to do with pending_device - (nm_dbus_get_user_key_for_network): remove DBusPendingCall stuff (unused), and move the actual key setting stuff into NetworkManagerDevice.c - (nm_dbus_get_network_priority): return -1 now on errors - (nm_dbus_nmi_filter): fix strcmp() error that caused PreferredNetworkUpdate signals to get lost, and force the active device to update its "best" ap when AP lists change - (nm_dbus_nm_message_handler): Update conditions for returning "connecting" for a "status" method call due to pending_device member removal * src/NetworkManagerDevice.[ch] - Move NMDevice structure to the top - Add a wireless scan mutex and a best_ap mutex to the Wireless Options structure - Remove Pending Action stuff from everywhere - (nm_device_activation_*): We now "begin" activation and start a thread to do the activation for us. This thread blocks until all conditions for activation have been met (ie for wireless devices, we need a valid WEP key and a "best" ap), and then setup up the interface and runs dhclient. We have to do this because there is no guaruntee how long dhclient takes, and while we are blocking on it, we cannot run our main loop and respond to dbus method calls or HAL device removals/inserts - (nm_device_set_user_key_for_network): Move logic here from NetworkManagerDbus.c so we can tell nm_device_activation_worker() that we've got a key - (nm_device_*_best_ap): lock access to best_ap member of Wireless Options structure - (nm_device_get_path_for_ap): dumb it down so the list doesn't lock against itself when diffing (AP appear/disappear signal functions make sure the AP is actually in the device's list) - (nm_device_update_best_ap): move logic from nm_wireless_is_ap_better() here * src/NetworkManagerPolicy.c - Remove anything to do with pending_device - Adjust device activation to deal with activation-in-worker-thread * src/NetworkManagerUtils.c - Clean up locking debugging a bit * src/NetworkManagerWireless.[ch] - (nm_wireless_is_ap_better): remove, stick logic in nm_device_update_best_ap(). This function was badly named and is better as a device function * panel-applet/.cvsignore: add git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@46 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
@@ -148,10 +148,8 @@ void nm_remove_device_from_list (NMData *data, const char *udi)
|
||||
{
|
||||
if (data->active_device && (dev == data->active_device))
|
||||
data->active_device = NULL;
|
||||
else if (data->pending_device && (dev == data->pending_device))
|
||||
data->pending_device = NULL;
|
||||
|
||||
nm_device_pending_action_cancel (dev);
|
||||
nm_device_activation_cancel (dev);
|
||||
nm_device_unref (dev);
|
||||
|
||||
/* Remove the device entry from the device list and free its data */
|
||||
@@ -445,7 +443,6 @@ static void nm_data_free (NMData *data)
|
||||
g_return_if_fail (data != NULL);
|
||||
|
||||
nm_device_unref (data->active_device);
|
||||
nm_device_unref (data->pending_device);
|
||||
|
||||
g_slist_foreach (data->dev_list, nm_data_dev_list_element_free, NULL);
|
||||
g_slist_free (data->dev_list);
|
||||
@@ -483,11 +480,11 @@ void nm_data_set_state_modified (NMData *data, gboolean modified)
|
||||
*/
|
||||
static void nm_print_usage (void)
|
||||
{
|
||||
fprintf (stderr, "\n" "usage : NetworkManager [--daemon=yes|no] [--help]\n");
|
||||
fprintf (stderr, "\n" "usage : NetworkManager [--no-daemon] [--help]\n");
|
||||
fprintf (stderr,
|
||||
"\n"
|
||||
" --daemon=yes|no Become a daemon\n"
|
||||
" --help Show this information and exit\n"
|
||||
" --no-daemon Become a daemon\n"
|
||||
" --help Show this information and exit\n"
|
||||
"\n"
|
||||
"NetworkManager monitors all network connections and automatically\n"
|
||||
"chooses the best connection to use. It also allows the user to\n"
|
||||
@@ -517,7 +514,7 @@ int main( int argc, char *argv[] )
|
||||
const char *opt;
|
||||
|
||||
static struct option options[] = {
|
||||
{"daemon", 1, NULL, 0},
|
||||
{"no-daemon", 0, NULL, 0},
|
||||
{"help", 0, NULL, 0},
|
||||
{NULL, 0, NULL, 0}
|
||||
};
|
||||
@@ -535,18 +532,8 @@ int main( int argc, char *argv[] )
|
||||
nm_print_usage ();
|
||||
exit (EXIT_SUCCESS);
|
||||
}
|
||||
else if (strcmp (opt, "daemon") == 0)
|
||||
{
|
||||
if (strcmp ("yes", optarg) == 0)
|
||||
become_daemon = TRUE;
|
||||
else if (strcmp ("no", optarg) == 0)
|
||||
become_daemon = FALSE;
|
||||
else
|
||||
{
|
||||
nm_print_usage ();
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
else if (strcmp (opt, "no-daemon") == 0)
|
||||
become_daemon = FALSE;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
Reference in New Issue
Block a user