2005-10-09 04:28:16 +00:00
|
|
|
/* nm-tool - information tool for NetworkManager
|
|
|
|
|
*
|
|
|
|
|
* 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 2005 Red Hat, Inc.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include <glib.h>
|
|
|
|
|
#include <dbus/dbus.h>
|
|
|
|
|
#include <dbus/dbus-glib.h>
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <string.h>
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
2007-03-05 08:49:30 +00:00
|
|
|
#include <sys/socket.h>
|
|
|
|
|
#include <netinet/in.h>
|
|
|
|
|
#include <arpa/inet.h>
|
2005-10-09 04:28:16 +00:00
|
|
|
|
2007-03-05 08:49:30 +00:00
|
|
|
#include <nm-client.h>
|
|
|
|
|
#include <nm-device.h>
|
2008-06-10 15:54:23 +00:00
|
|
|
#include <nm-device-ethernet.h>
|
2007-03-05 08:49:30 +00:00
|
|
|
#include <nm-device-802-11-wireless.h>
|
2008-04-22 14:02:04 +00:00
|
|
|
#include <nm-gsm-device.h>
|
|
|
|
|
#include <nm-cdma-device.h>
|
2007-10-09 08:57:35 +00:00
|
|
|
#include <nm-utils.h>
|
2008-05-06 Dan Williams <dcbw@redhat.com>
* src/dhcp-manager/nm-dhcp-manager.c
- (nm_dhcp_manager_get_ip4_config): clean up; update for changes to
NMIP4Config to support multiple IP addresses
* src/NetworkManagerUtils.c
- (nm_utils_merge_ip4_config): update for multiple IP addresses
* src/nm-ip4-config.c
src/nm-ip4-config.h
- Store a list of IPv4 address/netmask/gateway tuples
- (nm_ip4_config_get_gateway, nm_ip4_config_set_gateway,
nm_ip4_config_get_netmask, nm_ip4_config_set_netmask,
nm_ip4_config_get_broadcast, nm_ip4_config_set_broadcast,
nm_ip4_config_set_address): remove
- (nm_ip4_config_take_address, nm_ip4_config_add_address,
nm_ip4_config_replace_address, nm_ip4_config_get_num_addresses):
new functions; handle multiple IPv4 addresses
* src/nm-device.c
src/ppp-manager/nm-ppp-manager.c
src/vpn-manager/nm-vpn-connection.c
src/NetworkManagerPolicy.c
test/nm-tool.c
libnm-glib/libnm-glib-test.c
- update for changes to NMIP4Config for multiple IPv4 addresses
* src/NetworkManagerSystem.c
- (nm_system_device_set_ip4_route): don't add the route if any address
is on the same subnet as the destination
- (check_one_address): ignore the exact match, just match family and
interface index
- (add_ip4_addresses): add all IPv4 addresses in an NMIP4Config to
an interface
- (nm_system_device_set_from_ip4_config): use add_ip4_addresses()
- (nm_system_vpn_device_set_from_ip4_config): use add_ip4_addresses()
* introspection/nm-ip4-config.xml
- Remove 'address', 'gateway', 'netmask', and 'broadcast' properties
- Add 'addresses' property which is an array of (uuu) tuples of
address/netmask/gateway
* libnm-util/nm-setting-ip4-config.c
- (set_property): use ip-address <-> GValue converters from nm-utils.c
* libnm-glib/nm-ip4-config.c
libnm-glib/nm-ip4-config.h
- Handle D-Bus interface changes to support multiple IP addresses
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3637 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-05-06 21:53:22 +00:00
|
|
|
#include <nm-setting-ip4-config.h>
|
2005-10-09 04:28:16 +00:00
|
|
|
|
2007-03-05 08:49:30 +00:00
|
|
|
static gboolean
|
|
|
|
|
get_nm_state (NMClient *client)
|
|
|
|
|
{
|
|
|
|
|
NMState state;
|
|
|
|
|
char *state_string;
|
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
|
|
|
|
|
state = nm_client_get_state (client);
|
|
|
|
|
|
|
|
|
|
switch (state) {
|
|
|
|
|
case NM_STATE_ASLEEP:
|
|
|
|
|
state_string = "asleep";
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case NM_STATE_CONNECTING:
|
|
|
|
|
state_string = "connecting";
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case NM_STATE_CONNECTED:
|
|
|
|
|
state_string = "connected";
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case NM_STATE_DISCONNECTED:
|
|
|
|
|
state_string = "disconnected";
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case NM_STATE_UNKNOWN:
|
|
|
|
|
default:
|
|
|
|
|
state_string = "unknown";
|
|
|
|
|
success = FALSE;
|
|
|
|
|
break;
|
2005-10-09 04:28:16 +00:00
|
|
|
}
|
|
|
|
|
|
2006-03-27 18:00:12 +00:00
|
|
|
printf ("State: %s\n\n", state_string);
|
2005-10-09 04:28:16 +00:00
|
|
|
|
|
|
|
|
return success;
|
|
|
|
|
}
|
|
|
|
|
|
2007-03-05 08:49:30 +00:00
|
|
|
static void
|
|
|
|
|
print_string (const char *label, const char *data)
|
2005-10-09 04:28:16 +00:00
|
|
|
{
|
|
|
|
|
#define SPACING 18
|
|
|
|
|
int label_len = 0;
|
|
|
|
|
char spaces[50];
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
g_return_if_fail (label != NULL);
|
|
|
|
|
g_return_if_fail (data != NULL);
|
|
|
|
|
|
|
|
|
|
label_len = strlen (label);
|
|
|
|
|
if (label_len > SPACING)
|
|
|
|
|
label_len = SPACING - 1;
|
|
|
|
|
for (i = 0; i < (SPACING - label_len); i++)
|
|
|
|
|
spaces[i] = 0x20;
|
|
|
|
|
spaces[i] = 0x00;
|
|
|
|
|
|
2006-01-11 20:07:56 +00:00
|
|
|
printf (" %s:%s%s\n", label, &spaces[0], data);
|
2005-10-09 04:28:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-03-05 08:49:30 +00:00
|
|
|
static void
|
2007-10-03 18:20:35 +00:00
|
|
|
detail_access_point (gpointer data, gpointer user_data)
|
2005-10-09 04:28:16 +00:00
|
|
|
{
|
2007-03-05 08:49:30 +00:00
|
|
|
NMAccessPoint *ap = NM_ACCESS_POINT (data);
|
|
|
|
|
const char *active_bssid = (const char *) user_data;
|
|
|
|
|
GString *str;
|
|
|
|
|
gboolean active = FALSE;
|
2007-08-28 14:47:31 +00:00
|
|
|
guint32 flags, wpa_flags, rsn_flags;
|
2007-09-24 14:58:52 +00:00
|
|
|
const GByteArray * ssid;
|
2007-03-05 08:49:30 +00:00
|
|
|
char *tmp;
|
|
|
|
|
|
2007-08-28 14:47:31 +00:00
|
|
|
flags = nm_access_point_get_flags (ap);
|
|
|
|
|
wpa_flags = nm_access_point_get_wpa_flags (ap);
|
|
|
|
|
rsn_flags = nm_access_point_get_rsn_flags (ap);
|
2007-03-05 08:49:30 +00:00
|
|
|
|
|
|
|
|
if (active_bssid) {
|
2007-10-05 16:00:06 +00:00
|
|
|
const char *current_bssid = nm_access_point_get_hw_address (ap);
|
2007-03-05 08:49:30 +00:00
|
|
|
if (current_bssid && !strcmp (current_bssid, active_bssid))
|
|
|
|
|
active = TRUE;
|
2005-10-09 04:28:16 +00:00
|
|
|
}
|
|
|
|
|
|
2007-03-05 08:49:30 +00:00
|
|
|
str = g_string_new (NULL);
|
|
|
|
|
g_string_append_printf (str,
|
2007-10-16 14:16:51 +00:00
|
|
|
"%s, %s, Freq %d MHz, Rate %d Mb/s, Strength %d",
|
2008-04-15 20:39:34 +00:00
|
|
|
(nm_access_point_get_mode (ap) == NM_802_11_MODE_INFRA) ? "Infra" : "Ad-Hoc",
|
2007-10-16 14:16:51 +00:00
|
|
|
nm_access_point_get_hw_address (ap),
|
2007-09-25 18:56:02 +00:00
|
|
|
nm_access_point_get_frequency (ap),
|
2008-03-12 17:44:39 +00:00
|
|
|
nm_access_point_get_max_bitrate (ap) / 1000,
|
2007-03-05 08:49:30 +00:00
|
|
|
nm_access_point_get_strength (ap));
|
2005-10-09 04:28:16 +00:00
|
|
|
|
2007-08-28 14:47:31 +00:00
|
|
|
if ( !(flags & NM_802_11_AP_FLAGS_PRIVACY)
|
|
|
|
|
&& (wpa_flags != NM_802_11_AP_SEC_NONE)
|
|
|
|
|
&& (rsn_flags != NM_802_11_AP_SEC_NONE))
|
2007-03-05 08:49:30 +00:00
|
|
|
g_string_append (str, ", Encrypted: ");
|
2005-10-09 04:28:16 +00:00
|
|
|
|
2007-08-28 14:47:31 +00:00
|
|
|
if ( (flags & NM_802_11_AP_FLAGS_PRIVACY)
|
|
|
|
|
&& (wpa_flags == NM_802_11_AP_SEC_NONE)
|
|
|
|
|
&& (rsn_flags == NM_802_11_AP_SEC_NONE))
|
2007-03-05 08:49:30 +00:00
|
|
|
g_string_append (str, " WEP");
|
2007-08-28 14:47:31 +00:00
|
|
|
if (wpa_flags != NM_802_11_AP_SEC_NONE)
|
2007-03-05 08:49:30 +00:00
|
|
|
g_string_append (str, " WPA");
|
2007-08-28 14:47:31 +00:00
|
|
|
if (rsn_flags != NM_802_11_AP_SEC_NONE)
|
2007-03-05 08:49:30 +00:00
|
|
|
g_string_append (str, " WPA2");
|
2007-08-28 14:47:31 +00:00
|
|
|
if ( (wpa_flags & NM_802_11_AP_SEC_KEY_MGMT_802_1X)
|
|
|
|
|
|| (rsn_flags & NM_802_11_AP_SEC_KEY_MGMT_802_1X))
|
2007-03-05 08:49:30 +00:00
|
|
|
g_string_append (str, " Enterprise");
|
2005-10-09 04:28:16 +00:00
|
|
|
|
2007-03-05 08:49:30 +00:00
|
|
|
/* FIXME: broadcast/hidden */
|
2005-10-09 04:28:16 +00:00
|
|
|
|
2007-06-27 16:18:52 +00:00
|
|
|
ssid = nm_access_point_get_ssid (ap);
|
|
|
|
|
tmp = g_strdup_printf (" %s%s", active ? "*" : "",
|
|
|
|
|
ssid ? nm_utils_escape_ssid (ssid->data, ssid->len) : "(none)");
|
2005-10-09 04:28:16 +00:00
|
|
|
|
2007-03-05 08:49:30 +00:00
|
|
|
print_string (tmp, str->str);
|
2006-01-30 18:45:17 +00:00
|
|
|
|
2007-03-05 08:49:30 +00:00
|
|
|
g_string_free (str, TRUE);
|
|
|
|
|
g_free (tmp);
|
|
|
|
|
}
|
2006-01-30 18:45:17 +00:00
|
|
|
|
2007-03-05 08:49:30 +00:00
|
|
|
static gchar *
|
|
|
|
|
ip4_address_as_string (guint32 ip)
|
|
|
|
|
{
|
|
|
|
|
struct in_addr tmp_addr;
|
|
|
|
|
gchar *ip_string;
|
2006-01-30 18:45:17 +00:00
|
|
|
|
2007-03-05 08:49:30 +00:00
|
|
|
tmp_addr.s_addr = ip;
|
|
|
|
|
ip_string = inet_ntoa (tmp_addr);
|
2006-01-30 18:45:17 +00:00
|
|
|
|
2007-03-05 08:49:30 +00:00
|
|
|
return g_strdup (ip_string);
|
2006-01-30 18:45:17 +00:00
|
|
|
}
|
|
|
|
|
|
2008-04-07 Dan Williams <dcbw@redhat.com>
* include/NetworkManager.h
- Remove the DOWN and CANCELLED device states
- Add UNMANAGED and UNAVAILABLE device states
- Document the device states
* introspection/nm-device.xml
src/nm-device-interface.c
src/nm-device-interface.h
- Add the 'managed' property
* test/nm-tool.c
- (detail_device): print out device state
* src/NetworkManagerSystem.h
src/backends/NetworkManagerArch.c
src/backends/NetworkManagerDebian.c
src/backends/NetworkManagerFrugalware.c
src/backends/NetworkManagerGentoo.c
src/backends/NetworkManagerMandriva.c
src/backends/NetworkManagerPaldo.c
src/backends/NetworkManagerRedHat.c
src/backends/NetworkManagerSlackware.c
src/backends/NetworkManagerSuSE.c
- (nm_system_device_get_system_config, nm_system_device_get_disabled
nm_system_device_free_system_config): remove; they were unused and
their functionality should be re-implemented in each distro's
system settings service plugin
* src/nm-gsm-device.c
src/nm-gsm-device.h
src/nm-cdma-device.c
src/nm-cdma-device.h
- (*_new): take the 'managed' argument
* src/nm-device.c
- (nm_device_set_address): remove, fold into nm_device_bring_up()
- (nm_device_init): start in unmanaged state, not disconnected
- (constructor): don't start device until the system settings service
has had a chance to figure out if the device is managed or not
- (nm_device_deactivate, nm_device_bring_up, nm_device_bring_down):
don't set device state here, let callers handle that as appropriate
- (nm_device_dispose): don't touch the device if it's not managed
- (set_property, get_property, nm_device_class_init): implement the
'managed' property
- (nm_device_state_changed): bring the device up if its now managed,
and deactivate it if it used to be active
- (nm_device_get_managed, nm_device_set_managed): do the right thing
with the managed state
* src/nm-hal-manager.c
- (wired_device_creator, wireless_device_creator, modem_device_creator):
take initial managed state and pass it along to device constructors
- (create_device_and_add_to_list): get managed state and pass to
type creators
* src/nm-device-802-11-wireless.c
- (real_can_activate): fold in most of
nm_device_802_11_wireless_can_activate()
- (can_scan): can't scan in UNAVAILABLE or UNMANAGED
- (link_timeout_cb): instead of deactivating, change device state and
let the device state handler to it
- (real_update_hw_address): clean up
- (state_changed_cb): when entering UNAVAILABLE state, schedule an idle
handler to transition to DISCONNECTED if the device isn't rfkilled
* src/nm-device-802-3-ethernet.c
- (set_carrier): move above callers and get rid of prototype
- (device_state_changed): when entering UNAVAILABLE state, schedule an
idle handler to transition to DISCONNECTED if the device has a
carrier
- (real_update_hw_address): clean up
- (link_timeout_cb, ppp_state_changed): change state instead of calling
deactivation directly as deactivation doesn't change state anymore
* src/NetworkManagerPolicy.c
- (schedule_activate_check): yay, remove wireless_enabled hack since
the NMManager and wireless devices work that out themselves now
- (device_state_changed): change to a switch and update for new device
states
- (device_carrier_changed): remove; device handles this now through
state changes
- (device_added): don't care about carrier any more; the initial
activation check will happen when the device transitions to
DISCONNECTED
* src/nm-manager.c
- (dispose): clear unmanaged devices
- (handle_unmanaged_devices): update unmanaged device list and toggle
the managed property on each device when needed
- (system_settings_properties_changed_cb): handle signals from the
system settings service
- (system_settings_get_unmanaged_devices_cb): handle callback from
getting the unmanaged device list method call
- (query_unmanaged_devices): ask the system settings service for its
list of unmanaged devices
- (nm_manager_name_owner_changed, initial_get_connections): get unmanaged
devices
- (manager_set_wireless_enabled): push rfkill state down to wireless
devices directly and let them handle the necessary state transitions
- (manager_device_state_changed): update for new device states
- (nm_manager_add_device): set initial rfkill state on wireless devices
- (nm_manager_remove_device): don't touch the device if it's unmanaged
- (nm_manager_activate_connection): return error if the device is
unmanaged
- (nm_manager_sleep): handle new device states correctly; don't change
the state of unavailable/unmanaged devices
* libnm-glib/nm-device-802-11-wireless.c
- (state_changed_cb): update for new device states
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3540 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-04-08 02:58:02 +00:00
|
|
|
static const char *
|
|
|
|
|
get_dev_state_string (NMDeviceState state)
|
|
|
|
|
{
|
|
|
|
|
if (state == NM_DEVICE_STATE_UNMANAGED)
|
|
|
|
|
return "unmanaged";
|
|
|
|
|
else if (state == NM_DEVICE_STATE_UNAVAILABLE)
|
|
|
|
|
return "unavailable";
|
|
|
|
|
else if (state == NM_DEVICE_STATE_DISCONNECTED)
|
|
|
|
|
return "disconnected";
|
|
|
|
|
else if (state == NM_DEVICE_STATE_PREPARE)
|
|
|
|
|
return "connecting (prepare)";
|
|
|
|
|
else if (state == NM_DEVICE_STATE_CONFIG)
|
|
|
|
|
return "connecting (configuring)";
|
|
|
|
|
else if (state == NM_DEVICE_STATE_NEED_AUTH)
|
|
|
|
|
return "connecting (need authentication)";
|
|
|
|
|
else if (state == NM_DEVICE_STATE_IP_CONFIG)
|
|
|
|
|
return "connecting (getting IP configuration)";
|
|
|
|
|
else if (state == NM_DEVICE_STATE_ACTIVATED)
|
|
|
|
|
return "connected";
|
|
|
|
|
else if (state == NM_DEVICE_STATE_FAILED)
|
|
|
|
|
return "connection failed";
|
|
|
|
|
return "unknown";
|
|
|
|
|
}
|
|
|
|
|
|
2007-03-05 08:49:30 +00:00
|
|
|
static void
|
|
|
|
|
detail_device (gpointer data, gpointer user_data)
|
2005-10-09 04:28:16 +00:00
|
|
|
{
|
2007-03-05 08:49:30 +00:00
|
|
|
NMDevice *device = NM_DEVICE (data);
|
2008-06-06 03:31:58 +00:00
|
|
|
NMClient *client = NM_CLIENT (user_data);
|
2007-03-05 08:49:30 +00:00
|
|
|
char *tmp;
|
|
|
|
|
NMDeviceState state;
|
2007-10-27 02:58:32 +00:00
|
|
|
guint32 caps;
|
|
|
|
|
guint32 speed;
|
2008-03-24 15:17:30 +00:00
|
|
|
const GArray *array;
|
2008-06-06 03:31:58 +00:00
|
|
|
const GPtrArray *connections;
|
|
|
|
|
int j;
|
2007-03-05 08:49:30 +00:00
|
|
|
|
|
|
|
|
state = nm_device_get_state (device);
|
|
|
|
|
|
2008-03-24 15:17:30 +00:00
|
|
|
printf ("- Device: %s ----------------------------------------------------------------\n",
|
|
|
|
|
nm_device_get_iface (device));
|
2007-03-05 08:49:30 +00:00
|
|
|
|
|
|
|
|
/* General information */
|
2008-06-10 15:54:23 +00:00
|
|
|
if (NM_IS_DEVICE_ETHERNET (device))
|
2007-03-05 08:49:30 +00:00
|
|
|
print_string ("Type", "Wired");
|
|
|
|
|
else if (NM_IS_DEVICE_802_11_WIRELESS (device))
|
|
|
|
|
print_string ("Type", "802.11 Wireless");
|
2008-04-22 14:02:04 +00:00
|
|
|
else if (NM_IS_GSM_DEVICE (device))
|
|
|
|
|
print_string ("Type", "Mobile Broadband (GSM)");
|
|
|
|
|
else if (NM_IS_CDMA_DEVICE (device))
|
|
|
|
|
print_string ("Type", "Mobile Broadband (CDMA)");
|
2007-03-05 08:49:30 +00:00
|
|
|
|
2008-03-24 15:17:30 +00:00
|
|
|
print_string ("Driver", nm_device_get_driver (device) ? nm_device_get_driver (device) : "(unknown)");
|
2007-03-05 08:49:30 +00:00
|
|
|
|
2008-04-07 Dan Williams <dcbw@redhat.com>
* include/NetworkManager.h
- Remove the DOWN and CANCELLED device states
- Add UNMANAGED and UNAVAILABLE device states
- Document the device states
* introspection/nm-device.xml
src/nm-device-interface.c
src/nm-device-interface.h
- Add the 'managed' property
* test/nm-tool.c
- (detail_device): print out device state
* src/NetworkManagerSystem.h
src/backends/NetworkManagerArch.c
src/backends/NetworkManagerDebian.c
src/backends/NetworkManagerFrugalware.c
src/backends/NetworkManagerGentoo.c
src/backends/NetworkManagerMandriva.c
src/backends/NetworkManagerPaldo.c
src/backends/NetworkManagerRedHat.c
src/backends/NetworkManagerSlackware.c
src/backends/NetworkManagerSuSE.c
- (nm_system_device_get_system_config, nm_system_device_get_disabled
nm_system_device_free_system_config): remove; they were unused and
their functionality should be re-implemented in each distro's
system settings service plugin
* src/nm-gsm-device.c
src/nm-gsm-device.h
src/nm-cdma-device.c
src/nm-cdma-device.h
- (*_new): take the 'managed' argument
* src/nm-device.c
- (nm_device_set_address): remove, fold into nm_device_bring_up()
- (nm_device_init): start in unmanaged state, not disconnected
- (constructor): don't start device until the system settings service
has had a chance to figure out if the device is managed or not
- (nm_device_deactivate, nm_device_bring_up, nm_device_bring_down):
don't set device state here, let callers handle that as appropriate
- (nm_device_dispose): don't touch the device if it's not managed
- (set_property, get_property, nm_device_class_init): implement the
'managed' property
- (nm_device_state_changed): bring the device up if its now managed,
and deactivate it if it used to be active
- (nm_device_get_managed, nm_device_set_managed): do the right thing
with the managed state
* src/nm-hal-manager.c
- (wired_device_creator, wireless_device_creator, modem_device_creator):
take initial managed state and pass it along to device constructors
- (create_device_and_add_to_list): get managed state and pass to
type creators
* src/nm-device-802-11-wireless.c
- (real_can_activate): fold in most of
nm_device_802_11_wireless_can_activate()
- (can_scan): can't scan in UNAVAILABLE or UNMANAGED
- (link_timeout_cb): instead of deactivating, change device state and
let the device state handler to it
- (real_update_hw_address): clean up
- (state_changed_cb): when entering UNAVAILABLE state, schedule an idle
handler to transition to DISCONNECTED if the device isn't rfkilled
* src/nm-device-802-3-ethernet.c
- (set_carrier): move above callers and get rid of prototype
- (device_state_changed): when entering UNAVAILABLE state, schedule an
idle handler to transition to DISCONNECTED if the device has a
carrier
- (real_update_hw_address): clean up
- (link_timeout_cb, ppp_state_changed): change state instead of calling
deactivation directly as deactivation doesn't change state anymore
* src/NetworkManagerPolicy.c
- (schedule_activate_check): yay, remove wireless_enabled hack since
the NMManager and wireless devices work that out themselves now
- (device_state_changed): change to a switch and update for new device
states
- (device_carrier_changed): remove; device handles this now through
state changes
- (device_added): don't care about carrier any more; the initial
activation check will happen when the device transitions to
DISCONNECTED
* src/nm-manager.c
- (dispose): clear unmanaged devices
- (handle_unmanaged_devices): update unmanaged device list and toggle
the managed property on each device when needed
- (system_settings_properties_changed_cb): handle signals from the
system settings service
- (system_settings_get_unmanaged_devices_cb): handle callback from
getting the unmanaged device list method call
- (query_unmanaged_devices): ask the system settings service for its
list of unmanaged devices
- (nm_manager_name_owner_changed, initial_get_connections): get unmanaged
devices
- (manager_set_wireless_enabled): push rfkill state down to wireless
devices directly and let them handle the necessary state transitions
- (manager_device_state_changed): update for new device states
- (nm_manager_add_device): set initial rfkill state on wireless devices
- (nm_manager_remove_device): don't touch the device if it's unmanaged
- (nm_manager_activate_connection): return error if the device is
unmanaged
- (nm_manager_sleep): handle new device states correctly; don't change
the state of unavailable/unmanaged devices
* libnm-glib/nm-device-802-11-wireless.c
- (state_changed_cb): update for new device states
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3540 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-04-08 02:58:02 +00:00
|
|
|
print_string ("State", get_dev_state_string (state));
|
2007-03-05 08:49:30 +00:00
|
|
|
|
2008-06-06 03:31:58 +00:00
|
|
|
connections = nm_client_get_active_connections (client);
|
|
|
|
|
for (j = 0; connections && (j < connections->len); j++) {
|
|
|
|
|
NMActiveConnection *candidate = g_ptr_array_index (connections, j);
|
|
|
|
|
const GPtrArray *devices = nm_active_connection_get_devices (candidate);
|
|
|
|
|
NMDevice *candidate_dev;
|
|
|
|
|
|
|
|
|
|
if (!devices || !devices->len)
|
|
|
|
|
continue;
|
|
|
|
|
candidate_dev = g_ptr_array_index (devices, 0);
|
|
|
|
|
|
|
|
|
|
if ((candidate_dev == device) && nm_active_connection_get_default(candidate))
|
|
|
|
|
print_string ("Default", "yes");
|
|
|
|
|
else
|
|
|
|
|
print_string ("Default", "no");
|
|
|
|
|
}
|
|
|
|
|
|
2007-03-05 08:49:30 +00:00
|
|
|
tmp = NULL;
|
2008-06-10 15:54:23 +00:00
|
|
|
if (NM_IS_DEVICE_ETHERNET (device))
|
|
|
|
|
tmp = g_strdup (nm_device_ethernet_get_hw_address (NM_DEVICE_ETHERNET (device)));
|
2007-03-05 08:49:30 +00:00
|
|
|
else if (NM_IS_DEVICE_802_11_WIRELESS (device))
|
2007-11-13 20:03:31 +00:00
|
|
|
tmp = g_strdup (nm_device_802_11_wireless_get_hw_address (NM_DEVICE_802_11_WIRELESS (device)));
|
2007-03-05 08:49:30 +00:00
|
|
|
|
|
|
|
|
if (tmp) {
|
|
|
|
|
print_string ("HW Address", tmp);
|
|
|
|
|
g_free (tmp);
|
2005-10-09 04:28:16 +00:00
|
|
|
}
|
|
|
|
|
|
2007-03-05 08:49:30 +00:00
|
|
|
/* Capabilities */
|
|
|
|
|
caps = nm_device_get_capabilities (device);
|
|
|
|
|
printf ("\n Capabilities:\n");
|
|
|
|
|
if (caps & NM_DEVICE_CAP_NM_SUPPORTED)
|
|
|
|
|
print_string (" Supported", "yes");
|
|
|
|
|
else
|
|
|
|
|
print_string (" Supported", "no");
|
|
|
|
|
if (caps & NM_DEVICE_CAP_CARRIER_DETECT)
|
|
|
|
|
print_string (" Carrier Detect", "yes");
|
|
|
|
|
|
|
|
|
|
speed = 0;
|
2008-06-10 15:54:23 +00:00
|
|
|
if (NM_IS_DEVICE_ETHERNET (device)) {
|
2007-10-27 02:58:32 +00:00
|
|
|
/* Speed in Mb/s */
|
2008-06-10 15:54:23 +00:00
|
|
|
speed = nm_device_ethernet_get_speed (NM_DEVICE_ETHERNET (device));
|
2007-10-27 02:58:32 +00:00
|
|
|
} else if (NM_IS_DEVICE_802_11_WIRELESS (device)) {
|
|
|
|
|
/* Speed in b/s */
|
2007-03-05 08:49:30 +00:00
|
|
|
speed = nm_device_802_11_wireless_get_bitrate (NM_DEVICE_802_11_WIRELESS (device));
|
2008-06-10 15:54:23 +00:00
|
|
|
speed /= 1000;
|
2007-10-27 02:58:32 +00:00
|
|
|
}
|
2007-03-05 08:49:30 +00:00
|
|
|
|
|
|
|
|
if (speed) {
|
|
|
|
|
char *speed_string;
|
|
|
|
|
|
2007-10-27 02:58:32 +00:00
|
|
|
speed_string = g_strdup_printf ("%u Mb/s", speed);
|
2007-03-05 08:49:30 +00:00
|
|
|
print_string (" Speed", speed_string);
|
|
|
|
|
g_free (speed_string);
|
2005-10-09 04:28:16 +00:00
|
|
|
}
|
|
|
|
|
|
2007-03-05 08:49:30 +00:00
|
|
|
/* Wireless specific information */
|
|
|
|
|
if ((NM_IS_DEVICE_802_11_WIRELESS (device))) {
|
2007-08-28 14:47:31 +00:00
|
|
|
guint32 wcaps;
|
2007-06-22 15:09:02 +00:00
|
|
|
NMAccessPoint *active_ap = NULL;
|
2007-10-05 16:00:06 +00:00
|
|
|
const char *active_bssid = NULL;
|
2008-03-27 14:13:47 +00:00
|
|
|
const GPtrArray *aps;
|
2007-03-05 08:49:30 +00:00
|
|
|
|
|
|
|
|
printf ("\n Wireless Settings\n");
|
|
|
|
|
|
2007-08-28 14:47:31 +00:00
|
|
|
wcaps = nm_device_802_11_wireless_get_capabilities (NM_DEVICE_802_11_WIRELESS (device));
|
2007-03-05 08:49:30 +00:00
|
|
|
|
2007-08-28 14:47:31 +00:00
|
|
|
if (wcaps & (NM_802_11_DEVICE_CAP_CIPHER_WEP40 | NM_802_11_DEVICE_CAP_CIPHER_WEP104))
|
2007-03-05 08:49:30 +00:00
|
|
|
print_string (" WEP Encryption", "yes");
|
2007-08-28 14:47:31 +00:00
|
|
|
if (wcaps & NM_802_11_DEVICE_CAP_WPA)
|
2007-03-05 08:49:30 +00:00
|
|
|
print_string (" WPA Encryption", "yes");
|
2007-08-28 14:47:31 +00:00
|
|
|
if (wcaps & NM_802_11_DEVICE_CAP_RSN)
|
2007-03-05 08:49:30 +00:00
|
|
|
print_string (" WPA2 Encryption", "yes");
|
|
|
|
|
|
2007-06-22 15:09:02 +00:00
|
|
|
if (nm_device_get_state (device) == NM_DEVICE_STATE_ACTIVATED) {
|
2007-10-03 18:20:35 +00:00
|
|
|
active_ap = nm_device_802_11_wireless_get_active_access_point (NM_DEVICE_802_11_WIRELESS (device));
|
2007-06-22 15:09:02 +00:00
|
|
|
active_bssid = active_ap ? nm_access_point_get_hw_address (active_ap) : NULL;
|
|
|
|
|
}
|
2007-03-05 08:49:30 +00:00
|
|
|
|
2007-10-03 18:20:35 +00:00
|
|
|
printf ("\n Wireless Access Points%s\n", active_ap ? "(* = Current AP)" : "");
|
2007-03-05 08:49:30 +00:00
|
|
|
|
2007-10-03 18:20:35 +00:00
|
|
|
aps = nm_device_802_11_wireless_get_access_points (NM_DEVICE_802_11_WIRELESS (device));
|
2008-03-31 13:56:57 +00:00
|
|
|
if (aps && aps->len)
|
|
|
|
|
g_ptr_array_foreach ((GPtrArray *) aps, detail_access_point, (gpointer) active_bssid);
|
2008-06-10 15:54:23 +00:00
|
|
|
} else if (NM_IS_DEVICE_ETHERNET (device)) {
|
2007-03-05 08:49:30 +00:00
|
|
|
printf ("\n Wired Settings\n");
|
|
|
|
|
/* FIXME */
|
|
|
|
|
#if 0
|
|
|
|
|
if (link_active)
|
|
|
|
|
print_string (" Hardware Link", "yes");
|
2005-10-09 04:28:16 +00:00
|
|
|
else
|
2007-03-05 08:49:30 +00:00
|
|
|
print_string (" Hardware Link", "no");
|
|
|
|
|
#endif
|
|
|
|
|
}
|
2005-10-09 04:28:16 +00:00
|
|
|
|
2007-03-05 08:49:30 +00:00
|
|
|
/* IP Setup info */
|
|
|
|
|
if (state == NM_DEVICE_STATE_ACTIVATED) {
|
|
|
|
|
NMIP4Config *cfg = nm_device_get_ip4_config (device);
|
2008-05-06 Dan Williams <dcbw@redhat.com>
* src/dhcp-manager/nm-dhcp-manager.c
- (nm_dhcp_manager_get_ip4_config): clean up; update for changes to
NMIP4Config to support multiple IP addresses
* src/NetworkManagerUtils.c
- (nm_utils_merge_ip4_config): update for multiple IP addresses
* src/nm-ip4-config.c
src/nm-ip4-config.h
- Store a list of IPv4 address/netmask/gateway tuples
- (nm_ip4_config_get_gateway, nm_ip4_config_set_gateway,
nm_ip4_config_get_netmask, nm_ip4_config_set_netmask,
nm_ip4_config_get_broadcast, nm_ip4_config_set_broadcast,
nm_ip4_config_set_address): remove
- (nm_ip4_config_take_address, nm_ip4_config_add_address,
nm_ip4_config_replace_address, nm_ip4_config_get_num_addresses):
new functions; handle multiple IPv4 addresses
* src/nm-device.c
src/ppp-manager/nm-ppp-manager.c
src/vpn-manager/nm-vpn-connection.c
src/NetworkManagerPolicy.c
test/nm-tool.c
libnm-glib/libnm-glib-test.c
- update for changes to NMIP4Config for multiple IPv4 addresses
* src/NetworkManagerSystem.c
- (nm_system_device_set_ip4_route): don't add the route if any address
is on the same subnet as the destination
- (check_one_address): ignore the exact match, just match family and
interface index
- (add_ip4_addresses): add all IPv4 addresses in an NMIP4Config to
an interface
- (nm_system_device_set_from_ip4_config): use add_ip4_addresses()
- (nm_system_vpn_device_set_from_ip4_config): use add_ip4_addresses()
* introspection/nm-ip4-config.xml
- Remove 'address', 'gateway', 'netmask', and 'broadcast' properties
- Add 'addresses' property which is an array of (uuu) tuples of
address/netmask/gateway
* libnm-util/nm-setting-ip4-config.c
- (set_property): use ip-address <-> GValue converters from nm-utils.c
* libnm-glib/nm-ip4-config.c
libnm-glib/nm-ip4-config.h
- Handle D-Bus interface changes to support multiple IP addresses
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3637 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-05-06 21:53:22 +00:00
|
|
|
GSList *iter;
|
2005-10-09 04:28:16 +00:00
|
|
|
|
2008-05-06 Dan Williams <dcbw@redhat.com>
* src/dhcp-manager/nm-dhcp-manager.c
- (nm_dhcp_manager_get_ip4_config): clean up; update for changes to
NMIP4Config to support multiple IP addresses
* src/NetworkManagerUtils.c
- (nm_utils_merge_ip4_config): update for multiple IP addresses
* src/nm-ip4-config.c
src/nm-ip4-config.h
- Store a list of IPv4 address/netmask/gateway tuples
- (nm_ip4_config_get_gateway, nm_ip4_config_set_gateway,
nm_ip4_config_get_netmask, nm_ip4_config_set_netmask,
nm_ip4_config_get_broadcast, nm_ip4_config_set_broadcast,
nm_ip4_config_set_address): remove
- (nm_ip4_config_take_address, nm_ip4_config_add_address,
nm_ip4_config_replace_address, nm_ip4_config_get_num_addresses):
new functions; handle multiple IPv4 addresses
* src/nm-device.c
src/ppp-manager/nm-ppp-manager.c
src/vpn-manager/nm-vpn-connection.c
src/NetworkManagerPolicy.c
test/nm-tool.c
libnm-glib/libnm-glib-test.c
- update for changes to NMIP4Config for multiple IPv4 addresses
* src/NetworkManagerSystem.c
- (nm_system_device_set_ip4_route): don't add the route if any address
is on the same subnet as the destination
- (check_one_address): ignore the exact match, just match family and
interface index
- (add_ip4_addresses): add all IPv4 addresses in an NMIP4Config to
an interface
- (nm_system_device_set_from_ip4_config): use add_ip4_addresses()
- (nm_system_vpn_device_set_from_ip4_config): use add_ip4_addresses()
* introspection/nm-ip4-config.xml
- Remove 'address', 'gateway', 'netmask', and 'broadcast' properties
- Add 'addresses' property which is an array of (uuu) tuples of
address/netmask/gateway
* libnm-util/nm-setting-ip4-config.c
- (set_property): use ip-address <-> GValue converters from nm-utils.c
* libnm-glib/nm-ip4-config.c
libnm-glib/nm-ip4-config.h
- Handle D-Bus interface changes to support multiple IP addresses
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3637 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-05-06 21:53:22 +00:00
|
|
|
printf ("\n IPv4 Settings:\n");
|
2005-10-09 04:28:16 +00:00
|
|
|
|
2008-05-06 Dan Williams <dcbw@redhat.com>
* src/dhcp-manager/nm-dhcp-manager.c
- (nm_dhcp_manager_get_ip4_config): clean up; update for changes to
NMIP4Config to support multiple IP addresses
* src/NetworkManagerUtils.c
- (nm_utils_merge_ip4_config): update for multiple IP addresses
* src/nm-ip4-config.c
src/nm-ip4-config.h
- Store a list of IPv4 address/netmask/gateway tuples
- (nm_ip4_config_get_gateway, nm_ip4_config_set_gateway,
nm_ip4_config_get_netmask, nm_ip4_config_set_netmask,
nm_ip4_config_get_broadcast, nm_ip4_config_set_broadcast,
nm_ip4_config_set_address): remove
- (nm_ip4_config_take_address, nm_ip4_config_add_address,
nm_ip4_config_replace_address, nm_ip4_config_get_num_addresses):
new functions; handle multiple IPv4 addresses
* src/nm-device.c
src/ppp-manager/nm-ppp-manager.c
src/vpn-manager/nm-vpn-connection.c
src/NetworkManagerPolicy.c
test/nm-tool.c
libnm-glib/libnm-glib-test.c
- update for changes to NMIP4Config for multiple IPv4 addresses
* src/NetworkManagerSystem.c
- (nm_system_device_set_ip4_route): don't add the route if any address
is on the same subnet as the destination
- (check_one_address): ignore the exact match, just match family and
interface index
- (add_ip4_addresses): add all IPv4 addresses in an NMIP4Config to
an interface
- (nm_system_device_set_from_ip4_config): use add_ip4_addresses()
- (nm_system_vpn_device_set_from_ip4_config): use add_ip4_addresses()
* introspection/nm-ip4-config.xml
- Remove 'address', 'gateway', 'netmask', and 'broadcast' properties
- Add 'addresses' property which is an array of (uuu) tuples of
address/netmask/gateway
* libnm-util/nm-setting-ip4-config.c
- (set_property): use ip-address <-> GValue converters from nm-utils.c
* libnm-glib/nm-ip4-config.c
libnm-glib/nm-ip4-config.h
- Handle D-Bus interface changes to support multiple IP addresses
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3637 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-05-06 21:53:22 +00:00
|
|
|
for (iter = (GSList *) nm_ip4_config_get_addresses (cfg); iter; iter = g_slist_next (iter)) {
|
|
|
|
|
NMSettingIP4Address *addr = iter->data;
|
2006-03-02 Robert Love <rml@novell.com>
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
2006-03-02 23:01:33 +00:00
|
|
|
|
2008-05-06 Dan Williams <dcbw@redhat.com>
* src/dhcp-manager/nm-dhcp-manager.c
- (nm_dhcp_manager_get_ip4_config): clean up; update for changes to
NMIP4Config to support multiple IP addresses
* src/NetworkManagerUtils.c
- (nm_utils_merge_ip4_config): update for multiple IP addresses
* src/nm-ip4-config.c
src/nm-ip4-config.h
- Store a list of IPv4 address/netmask/gateway tuples
- (nm_ip4_config_get_gateway, nm_ip4_config_set_gateway,
nm_ip4_config_get_netmask, nm_ip4_config_set_netmask,
nm_ip4_config_get_broadcast, nm_ip4_config_set_broadcast,
nm_ip4_config_set_address): remove
- (nm_ip4_config_take_address, nm_ip4_config_add_address,
nm_ip4_config_replace_address, nm_ip4_config_get_num_addresses):
new functions; handle multiple IPv4 addresses
* src/nm-device.c
src/ppp-manager/nm-ppp-manager.c
src/vpn-manager/nm-vpn-connection.c
src/NetworkManagerPolicy.c
test/nm-tool.c
libnm-glib/libnm-glib-test.c
- update for changes to NMIP4Config for multiple IPv4 addresses
* src/NetworkManagerSystem.c
- (nm_system_device_set_ip4_route): don't add the route if any address
is on the same subnet as the destination
- (check_one_address): ignore the exact match, just match family and
interface index
- (add_ip4_addresses): add all IPv4 addresses in an NMIP4Config to
an interface
- (nm_system_device_set_from_ip4_config): use add_ip4_addresses()
- (nm_system_vpn_device_set_from_ip4_config): use add_ip4_addresses()
* introspection/nm-ip4-config.xml
- Remove 'address', 'gateway', 'netmask', and 'broadcast' properties
- Add 'addresses' property which is an array of (uuu) tuples of
address/netmask/gateway
* libnm-util/nm-setting-ip4-config.c
- (set_property): use ip-address <-> GValue converters from nm-utils.c
* libnm-glib/nm-ip4-config.c
libnm-glib/nm-ip4-config.h
- Handle D-Bus interface changes to support multiple IP addresses
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3637 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-05-06 21:53:22 +00:00
|
|
|
tmp = ip4_address_as_string (addr->address);
|
|
|
|
|
print_string (" Address", tmp);
|
|
|
|
|
g_free (tmp);
|
2006-03-02 Robert Love <rml@novell.com>
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
2006-03-02 23:01:33 +00:00
|
|
|
|
2008-05-06 Dan Williams <dcbw@redhat.com>
* src/dhcp-manager/nm-dhcp-manager.c
- (nm_dhcp_manager_get_ip4_config): clean up; update for changes to
NMIP4Config to support multiple IP addresses
* src/NetworkManagerUtils.c
- (nm_utils_merge_ip4_config): update for multiple IP addresses
* src/nm-ip4-config.c
src/nm-ip4-config.h
- Store a list of IPv4 address/netmask/gateway tuples
- (nm_ip4_config_get_gateway, nm_ip4_config_set_gateway,
nm_ip4_config_get_netmask, nm_ip4_config_set_netmask,
nm_ip4_config_get_broadcast, nm_ip4_config_set_broadcast,
nm_ip4_config_set_address): remove
- (nm_ip4_config_take_address, nm_ip4_config_add_address,
nm_ip4_config_replace_address, nm_ip4_config_get_num_addresses):
new functions; handle multiple IPv4 addresses
* src/nm-device.c
src/ppp-manager/nm-ppp-manager.c
src/vpn-manager/nm-vpn-connection.c
src/NetworkManagerPolicy.c
test/nm-tool.c
libnm-glib/libnm-glib-test.c
- update for changes to NMIP4Config for multiple IPv4 addresses
* src/NetworkManagerSystem.c
- (nm_system_device_set_ip4_route): don't add the route if any address
is on the same subnet as the destination
- (check_one_address): ignore the exact match, just match family and
interface index
- (add_ip4_addresses): add all IPv4 addresses in an NMIP4Config to
an interface
- (nm_system_device_set_from_ip4_config): use add_ip4_addresses()
- (nm_system_vpn_device_set_from_ip4_config): use add_ip4_addresses()
* introspection/nm-ip4-config.xml
- Remove 'address', 'gateway', 'netmask', and 'broadcast' properties
- Add 'addresses' property which is an array of (uuu) tuples of
address/netmask/gateway
* libnm-util/nm-setting-ip4-config.c
- (set_property): use ip-address <-> GValue converters from nm-utils.c
* libnm-glib/nm-ip4-config.c
libnm-glib/nm-ip4-config.h
- Handle D-Bus interface changes to support multiple IP addresses
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3637 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-05-06 21:53:22 +00:00
|
|
|
tmp = ip4_address_as_string (addr->netmask);
|
|
|
|
|
print_string (" Netmask", tmp);
|
|
|
|
|
g_free (tmp);
|
2005-10-09 04:28:16 +00:00
|
|
|
|
2008-05-06 Dan Williams <dcbw@redhat.com>
* src/dhcp-manager/nm-dhcp-manager.c
- (nm_dhcp_manager_get_ip4_config): clean up; update for changes to
NMIP4Config to support multiple IP addresses
* src/NetworkManagerUtils.c
- (nm_utils_merge_ip4_config): update for multiple IP addresses
* src/nm-ip4-config.c
src/nm-ip4-config.h
- Store a list of IPv4 address/netmask/gateway tuples
- (nm_ip4_config_get_gateway, nm_ip4_config_set_gateway,
nm_ip4_config_get_netmask, nm_ip4_config_set_netmask,
nm_ip4_config_get_broadcast, nm_ip4_config_set_broadcast,
nm_ip4_config_set_address): remove
- (nm_ip4_config_take_address, nm_ip4_config_add_address,
nm_ip4_config_replace_address, nm_ip4_config_get_num_addresses):
new functions; handle multiple IPv4 addresses
* src/nm-device.c
src/ppp-manager/nm-ppp-manager.c
src/vpn-manager/nm-vpn-connection.c
src/NetworkManagerPolicy.c
test/nm-tool.c
libnm-glib/libnm-glib-test.c
- update for changes to NMIP4Config for multiple IPv4 addresses
* src/NetworkManagerSystem.c
- (nm_system_device_set_ip4_route): don't add the route if any address
is on the same subnet as the destination
- (check_one_address): ignore the exact match, just match family and
interface index
- (add_ip4_addresses): add all IPv4 addresses in an NMIP4Config to
an interface
- (nm_system_device_set_from_ip4_config): use add_ip4_addresses()
- (nm_system_vpn_device_set_from_ip4_config): use add_ip4_addresses()
* introspection/nm-ip4-config.xml
- Remove 'address', 'gateway', 'netmask', and 'broadcast' properties
- Add 'addresses' property which is an array of (uuu) tuples of
address/netmask/gateway
* libnm-util/nm-setting-ip4-config.c
- (set_property): use ip-address <-> GValue converters from nm-utils.c
* libnm-glib/nm-ip4-config.c
libnm-glib/nm-ip4-config.h
- Handle D-Bus interface changes to support multiple IP addresses
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3637 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-05-06 21:53:22 +00:00
|
|
|
tmp = ip4_address_as_string (addr->gateway);
|
|
|
|
|
print_string (" Gateway", tmp);
|
|
|
|
|
g_free (tmp);
|
|
|
|
|
printf ("\n");
|
|
|
|
|
}
|
2005-10-09 04:28:16 +00:00
|
|
|
|
2007-03-05 08:49:30 +00:00
|
|
|
array = nm_ip4_config_get_nameservers (cfg);
|
|
|
|
|
if (array) {
|
|
|
|
|
int i;
|
2005-10-09 04:28:16 +00:00
|
|
|
|
2007-03-05 08:49:30 +00:00
|
|
|
for (i = 0; i < array->len; i++) {
|
|
|
|
|
tmp = ip4_address_as_string (g_array_index (array, guint32, i));
|
|
|
|
|
print_string (" DNS", tmp);
|
|
|
|
|
g_free (tmp);
|
|
|
|
|
}
|
|
|
|
|
}
|
2005-10-09 04:28:16 +00:00
|
|
|
}
|
|
|
|
|
|
2007-03-05 08:49:30 +00:00
|
|
|
printf ("\n\n");
|
|
|
|
|
}
|
2005-10-09 04:28:16 +00:00
|
|
|
|
|
|
|
|
|
2007-03-05 08:49:30 +00:00
|
|
|
int
|
|
|
|
|
main (int argc, char *argv[])
|
2005-10-09 04:28:16 +00:00
|
|
|
{
|
2007-03-05 08:49:30 +00:00
|
|
|
NMClient *client;
|
2008-03-27 14:13:47 +00:00
|
|
|
const GPtrArray *devices;
|
2005-10-09 04:28:16 +00:00
|
|
|
|
|
|
|
|
g_type_init ();
|
|
|
|
|
|
2007-03-05 08:49:30 +00:00
|
|
|
client = nm_client_new ();
|
|
|
|
|
if (!client) {
|
|
|
|
|
exit (1);
|
2005-10-09 04:28:16 +00:00
|
|
|
}
|
|
|
|
|
|
2006-01-11 20:07:56 +00:00
|
|
|
printf ("\nNetworkManager Tool\n\n");
|
2005-10-09 04:28:16 +00:00
|
|
|
|
2007-03-05 08:49:30 +00:00
|
|
|
if (!get_nm_state (client)) {
|
2006-01-11 20:07:56 +00:00
|
|
|
fprintf (stderr, "\n\nNetworkManager appears not to be running (could not get its state).\n");
|
2005-10-09 04:28:16 +00:00
|
|
|
exit (1);
|
|
|
|
|
}
|
|
|
|
|
|
2008-03-27 14:13:47 +00:00
|
|
|
devices = nm_client_get_devices (client);
|
2008-06-06 03:31:58 +00:00
|
|
|
g_ptr_array_foreach ((GPtrArray *) devices, detail_device, client);
|
2007-03-05 08:49:30 +00:00
|
|
|
|
|
|
|
|
g_object_unref (client);
|
2005-10-09 04:28:16 +00:00
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|