* src/NetworkManagerAP.c, src/NetworkManagerAP.h: Have the function
nm_ap_set_timestamp() take the second and micro-second parameters as
direct arguments, which avoids both a dynamic memory allocation and a
structure-to-structure copy! Add a new interface, the aptly named
nm_ap_set_timestamp_via_timestamp(), to set the timestamp from an
existing GTimeVal, as nm_ap_set_timestamp() once did, for use with
the return from nm_ap_get_timestamp(). New users should use the new
nm_ap_set_timestamp(), not nm_ap_set_timestamp_via_timestamp(), for
the extreme benefit to performance.
* src/NetworkManagerAPList.c, src/nm-dbus-nmi.c,
src/backends/NetworkManagerSuSE.c: Use the new functions as needed.
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1569 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* gnome/applet/Makefile.am: Define AUTOSTARTDIR.
* gnome/applet/applet.c: Add 'Remove' option to the right click menu,
to exit the applet. As a sweet side-effect, idea courtesy of Chris
Rivera, detect if the applet was auto-started. If so, ask the user
if he or she would like to stop automatically running the applet on
login. If so, disable autostart.
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1561 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* NetworkManager.pc.in: Provide an -I to the NetworkManager include
directory in CFLAGS so developers can actually use NetworkManager.h.
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1560 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* src/dhcp-manager/nm-dhcp-manager.c: Use preprocessor defines and not
open-coded integer constants. Add state_to_string() to map a given
state to a textual description, and provide that when notifying of
state change.
* src/dhcp-manager/nm-dhcp-manager.h: Provide defines for the dhcdbd
states, copied and cleaned up from dhcdbd.d. Ideally, we would use
this header directly, but it is currently not installed on most
systems.
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1559 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
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
* gnome/applet/applet-notifications.h
- Protect prototype of nma_send_event_notification() because it
includes libnotify-specific types
- Include libnotify/libnotify.h too, since we technically need it
* gnome/applet/applet.c
- (nma_show_vpn_failure_dialog): fix usage of g_return_if_fail
- (nma_show_vpn_login_banner_dialog): add some error checking
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1551 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
Clean up activation cancellation. Should be a lot faster now. Observed
an issue with wireless devices between stage 2 and 3 of activation, where
activation would be cancelled, but the device thread wouldn't notice until
the supplicant association timed out. Reorganize activation such that
a cancellation handler gets immediately scheduled in the device's thread,
and devices have a chance to perform any custom cleanup too.
* src/nm-device.[ch]
- (activation_cancel_handler): new device-type-specific function
for cleaning up device-type-specific stuff on cancellation
- (cancel_activation): removed
- (nm_device_activation_cancel): subsume functionality of
real_cancel_activation, but instead of doing anything, punt
operation to a handler that's run in device-thread context
- (nm_device_schedule_activation_handle_cancel): fix spelling of
a warning message
- (activation_handle_cancel_helper): cancellation handler run in
device-thread context, calls device-type-specific cancelation,
then tears down the activation request
- (real_activation_cancel_handler): generic cancellation handler,
deals with cancelling any in-process DHCP request
- (nm_device_activate_stage1_device_prepare,
nm_device_activate_stage2_device_config,
nm_device_activate_stage3_ip_config_start,
nm_device_activate_stage4_ip_config_get,
nm_device_activate_stage4_ip_config_timeout,
nm_device_activate_stage5_ip_commit): don't call
nm_device_schedule_activation_handle_cancel() any more, since
cancellation will have been already scheduled for us by
nm_device_activation_cancel(). Just exit the function and
assume that the cancel handler will be called next.
* src/nm-device-802-3-ethernet.c
- (real_act_stage2_config): remove; didn't do anything anyway
* src/nm-device-802-11-wireless.c
- (supplicant_status_cb): ensure we don't do anything if the activation
got cancelled
- (real_activation_cancel_handler): implement; cancel user key request
on activation cancellation
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1549 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* src/nm-device-802-11-wireless.c
- (supplicant_send_network_config): assume that drivers that don't
support WPA pretty much suck, and can't handle NM scanning
along with wpa_supplicant.
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1548 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
Fix a crash if an "Other wireless network" was chosen, failed, then
chosen again from the applet's menu. If the other network wasn't
noticed in a scan, it wouldn't have any capabilities, but would still
be listed because the user forced the network. To fix this, we set
sensible capabilities on the forced network, which will get overwritten
with the correct ones if the network shows up later in a scan.
* src/nm-ap-security.h
- Add a new "get_default_capabilities_func" member to the
NMAPSecurity class
* src/nm-ap-security.c
- (nm_ap_security_get_default_capabilities): new function
* src/nm-ap-security.c
src/nm-ap-security-wep.c
src/nm-ap-security-wpa-psk.c
src/nm-ap-security-wpa-eap.c
- Implement get_default_capabilities_func() for all, which
uses the information contained in a specific NMAPSecurity
object to determine default AP capabilites necessary
to support that object
As a secondary measure, we now prune artificial access points that fail
to be activated right away. The thing failed, and we have no scan data for
it, so it's pretty much useless since security information is only saved
in the applets when a connection is successful.
* src/NetworkManagerAPList.c
- (nm_ap_list_merge_scanned_ap): mark any ap noticed in a scan
not artificial. If we see it, it's no longer a figment of the
user's imagination :)
* src/NetworkManagerPolicy.c
- (nm_policy_activation_failed): send along the failed AP if we
have it
* src/nm-device-802-11-wireless.c
- (real_activation_failure_handler): remove artificial APs from
the device list, because activation failed
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1542 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
Add support for retrieving both the per-device speed and the
per-network maximum supported rate. Then change the getProperties
DBUS API for both networks and devices to report this informaiton.
Finally, display the information via both nm-applet and nm-tool:
* gnome/applet/applet-dbus-devices.c: Grab the speed from getProperties
and set it.
* gnome/applet/applet.c: Display the device's speed in the 'Connection
Information' dialog.
* gnome/applet/applet.glade: Update the UI to show per-device speed.
* gnome/applet/nm-device.c, gnome/applet/nm-device.h: Add interfaces
network_device_get_speed() and network_device_set_speed() for
retrieving and setting, respectively, a network device's current
speed.
* src/nm-dbus-device.c: Send the device's speed on getProperties.
* src/nm-device-802-11-wireless.c: Return the rate in Mb/s, not Kb/s,
in the function nm_device_802_11_wireless_get_bitrate() -- it does
not matter (yet) what the units are, because we only feed it its own
output. Implement SIOCGIRATE and set the per-network maximum
supported rate during scanning.
* src/nm-device-802-11-wireless.h: Export the function
nm_device_802_11_wireless_get_bitrate().
* src/nm-device-802-3-ethernet.c, src/nm-device-802-3-ethernet.h: Add
function nm_device_802_3_ethernet_get_speed() for returning an
802.3's current speed, in Mb/s.
* test/nm-tool.c: Display the per-device current speed, if available,
and the per-network maximum rate.
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1540 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* src/nm-device-802-11-wireless.c
- (nm_device_802_11_wireless_set_scan_interval): don't scan-spam the
card when it gets initialized. Since devices don't get added to
the scan list until they are initialized, this function wasn't
setting the intitial scan interval correctly, and was leaving
it at 0. This caused cards to get many scan requests in a short
amount of time when they were initialized
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1539 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* gnome/applet/applet.c: Do not set the pixbuf if we don't have an
active device. But do not do what we used to do and override the
state, which caused the dreaded icon race of '05.
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1538 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
Commit Dan's update of my previous commit:
* src/nm-device-802-11-wireless.c: Always set the mode, because the
set_mode() function itself does the check. But do only set the
frequency if in Ad-Hoc mode.
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1537 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
Patch by Brian Magnuson <magnuson@rcn.com>:
* src/nm-device-802-11-wireless.c: During scanning, only set the wireless
mode to infrastructure if it is not currently in infrastructure mode.
For some driver, setting the mode is a costly operation, apparently.
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1536 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* src/vpn-manager/nm-vpn-act-request.[ch]
- (nm_vpn_act_request_is_activated): don't use a switch/case for
just one value
- (nm_vpn_act_request_is_failed): new function; return whether or
not the vpn activation request has failed
* src/vpn-manager/nm-vpn-manager.c
- (nm_vpn_manager_deactivate_vpn_connection): tell the vpn service
daemon to kill the connection when the activation request fails.
Fixes issue where NM would get confused if the VPN activation
request timed out, and would not allow further VPN connections
on that service.
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1530 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* gnome/applet/applet.c
- (nma_menu_add_vpn_menu): until the NM VPN manager can deal with
overlapping connection requests, disable all VPN menu items
but the active VPN connection
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1529 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* src/vpn-manager/nm-vpn-connection.c
- (nm_vpn_connection_set_parent_device): fix C&P error which
called g_object_unref() on the connection's parent device
when it should have been ref-ed instead. Fixes crash with
repeated vpn connect requests
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1528 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* src/vpn-manager/nm-vpn-service.c
- (nm_vpn_service_start_connection): if the vpn service daemon is
already running, don't blindly ask it to connect, but wait until
it's in the STOPPED state first. Fixes an assertion when user
starts a second vpn connection without stopping the first.
- (nm_vpn_service_stage2_daemon_wait): ensure the vpn service's
dbus service exists before continuing with the connection
process, and reduce latency while waiting for it to become
available
- (nm_vpn_service_schedule_stage2_daemon_wait): reduce latency
waiting for the vpn service daemon to become available
- General log message cleanups; show progress via "Stage x of 4"
rather than not telling anyone how many stages there are
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1526 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* src/NetworkManagerSystem.h: Add nm_system_should_modify_resolv_conf.
* src/backends/NetworkManagerSuSE.c: Implement the interface
nm_system_should_modify_resolv_conf() for SUSE.
* src/backends/NetworkManagerDebian.c,
src/backends/NetworkManagerGentoo.c,
src/backends/NetworkManagerRedHat.c,
src/backends/NetworkManagerSlackware.c: Add stub.
* src/named-manager/Makefile.am: Grab includes from src.
* src/named-manager/nm-named-manager.c: Allow backends to disable the
automatic updating of resolv.conf. This is useful for testing,
broken static configurations, and administrator lock-down.
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1524 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* src/nm-device-802-11-wireless.c
- Move all the wpa_supplicant-related management stuff into its
own struct, just for oranization's sake
- (supplicant_exec): when exec-ing wpa_supplicant, connect its stdout
to a GIOChannel/GSource
- (supplicant_log_stdout): new function; grab output from the
wpa_supplicant stdout pipe and write it to our logs.
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1519 4912f4e0-d625-0410-9fb7-b9a5a253dbdc