Commit c9067d8f authored by Dan Williams's avatar Dan Williams

everything: use libgudev instead of HAL; merge NM and nm-system-settings

The only thing that doesn't work yet is the system-settings service's
"auto eth" connections for ethernet devices that don't have an existing
connection.  Might also have issues with unmanaged devices that can't
provide a MAC address until they are brought up, but we'll see.
parent 69eccdae
......@@ -204,10 +204,6 @@ else
fi
AM_CONDITIONAL(NO_GIO, test x"$have_gio" == "xno")
PKG_CHECK_MODULES(HAL, hal >= 0.5.0)
AC_SUBST(HAL_CFLAGS)
AC_SUBST(HAL_LIBS)
PKG_CHECK_MODULES(LIBNL, libnl-1 >= 1.0-pre8)
AC_SUBST(LIBNL_CFLAGS)
AC_SUBST(LIBNL_LIBS)
......@@ -447,6 +443,7 @@ src/ppp-manager/Makefile
src/dnsmasq-manager/Makefile
src/modem-manager/Makefile
src/bluez-manager/Makefile
src/system-settings/Makefile
src/backends/Makefile
libnm-util/libnm-util.pc
libnm-util/Makefile
......@@ -459,7 +456,6 @@ gfilemonitor/Makefile
callouts/Makefile
tools/Makefile
system-settings/Makefile
system-settings/src/Makefile
system-settings/plugins/Makefile
system-settings/plugins/ifupdown/Makefile
system-settings/plugins/ifcfg-rh/Makefile
......
......@@ -2,9 +2,9 @@
<node name="/" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0">
<interface name="org.freedesktop.NetworkManager.Device">
<property name="Udi" type="s" access="read">
<property name="Path" type="s" access="read">
<tp:docstring>
HAL UDI for the device.
Udev path of the device in sysfs.
</tp:docstring>
</property>
<property name="Interface" type="s" access="read">
......
......@@ -44,12 +44,6 @@
</tp:docstring>
</property>
<property name="UnmanagedDevices" type="ao" access="read">
<tp:docstring>
The list of HAL UDIs of devices that should not be managed by NetworkManager.
</tp:docstring>
</property>
<signal name="PropertiesChanged">
<arg name="properties" type="a{sv}" tp:type="String_Variant_Map">
<tp:docstring>
......
......@@ -11,7 +11,7 @@ VOID:UINT,UINT,UINT
VOID:STRING,STRING
VOID:STRING,UCHAR
VOID:STRING,OBJECT
VOID:STRING,STRING,POINTER,POINTER
VOID:POINTER,POINTER
VOID:STRING,STRING,STRING,UINT
VOID:OBJECT,UINT,UINT
VOID:STRING,INT
......@@ -20,3 +20,5 @@ VOID:OBJECT,OBJECT,ENUM
VOID:POINTER,STRING
POINTER:POINTER
VOID:STRING,BOXED
BOOLEAN:POINTER,STRING,BOOLEAN,UINT,STRING,STRING
......@@ -8,6 +8,7 @@ SUBDIRS= \
dnsmasq-manager \
modem-manager \
bluez-manager \
system-settings \
. \
tests
......@@ -21,7 +22,9 @@ INCLUDES = -I${top_srcdir} \
-I${top_srcdir}/src/dnsmasq-manager \
-I${top_srcdir}/src/modem-manager \
-I$(top_srcdir)/src/bluez-manager \
-I$(top_srcdir)/src/system-settings \
-I${top_srcdir}/libnm-util \
-I${top_srcdir}/libnm-glib \
-I${top_srcdir}/callouts
###########################################
......@@ -71,14 +74,14 @@ NetworkManager_SOURCES = \
NetworkManagerAP.h \
nm-dbus-manager.h \
nm-dbus-manager.c \
nm-hal-manager.c \
nm-hal-manager.h \
nm-udev-manager.c \
nm-udev-manager.h \
nm-hostname-provider.c \
nm-hostname-provider.h \
nm-ip4-config.c \
nm-ip4-config.h \
nm-secrets-provider-interface.c \
nm-secrets-provider-interface.h \
nm-active-connection.h \
nm-active-connection.c \
NetworkManager.c \
......@@ -150,6 +153,7 @@ NetworkManager_CPPFLAGS = \
$(GUDEV_CFLAGS) \
$(OPENSSL_CFLAGS) \
$(LIBNL_CFLAGS) \
$(GMODULE_CFLAGS) \
-DG_DISABLE_DEPRECATED \
-DBINDIR=\"$(bindir)\" \
-DSBINDIR=\"$(sbindir)\" \
......@@ -167,6 +171,7 @@ NetworkManager_LDADD = \
$(HAL_LIBS) \
$(GUDEV_LIBS) \
$(LIBNL_LIBS) \
$(GMODULE_LIBS) \
$(top_builddir)/marshallers/libmarshallers.la \
./named-manager/libnamed-manager.la \
./vpn-manager/libvpn-manager.la \
......@@ -176,6 +181,7 @@ NetworkManager_LDADD = \
./ppp-manager/libppp-manager.la \
./modem-manager/libmodem-manager.la \
./bluez-manager/libbluez-manager.la \
./system-settings/libsystem-settings.la \
./backends/libnmbackend.la \
$(top_builddir)/libnm-util/libnm-util.la
......
......@@ -36,6 +36,7 @@
#include <sys/stat.h>
#include <sys/types.h>
#include <glib/gi18n.h>
#include <gmodule.h>
#include <string.h>
#include "NetworkManager.h"
......@@ -243,6 +244,30 @@ write_pidfile (const char *pidfile)
nm_warning ("Closing %s failed: %s", pidfile, strerror (errno));
}
static gboolean
parse_config_file (const char *filename, char **plugins, GError **error)
{
GKeyFile *config;
config = g_key_file_new ();
if (!config) {
g_set_error (error, 0, 0,
"Not enough memory to load config file.");
return FALSE;
}
g_key_file_set_list_separator (config, ',');
if (!g_key_file_load_from_file (config, filename, G_KEY_FILE_NONE, error))
return FALSE;
*plugins = g_key_file_get_value (config, "main", "plugins", error);
if (*error)
return FALSE;
g_key_file_free (config);
return TRUE;
}
/*
* main
*
......@@ -251,10 +276,10 @@ int
main (int argc, char *argv[])
{
GOptionContext *opt_ctx = NULL;
gboolean become_daemon = FALSE;
gboolean g_fatal_warnings = FALSE;
char * pidfile = NULL;
char * user_pidfile = NULL;
gboolean become_daemon = FALSE;
gboolean g_fatal_warnings = FALSE;
char *pidfile = NULL, *user_pidfile = NULL;
char *config = NULL, *plugins = NULL;
gboolean success;
NMPolicy *policy = NULL;
NMVPNManager *vpn_manager = NULL;
......@@ -262,11 +287,14 @@ main (int argc, char *argv[])
NMDBusManager *dbus_mgr = NULL;
NMSupplicantManager *sup_mgr = NULL;
NMDHCPManager *dhcp_mgr = NULL;
GError *error = NULL;
GOptionEntry options[] = {
{"no-daemon", 0, 0, G_OPTION_ARG_NONE, &become_daemon, "Don't become a daemon", NULL},
{ "no-daemon", 0, 0, G_OPTION_ARG_NONE, &become_daemon, "Don't become a daemon", NULL },
{ "g-fatal-warnings", 0, 0, G_OPTION_ARG_NONE, &g_fatal_warnings, "Make all warnings fatal", NULL },
{"pid-file", 0, 0, G_OPTION_ARG_FILENAME, &user_pidfile, "Specify the location of a PID file", "filename"},
{ "pid-file", 0, 0, G_OPTION_ARG_FILENAME, &user_pidfile, "Specify the location of a PID file", "filename" },
{ "config", 0, 0, G_OPTION_ARG_FILENAME, &config, "Config file location", "/path/to/config.file" },
{ "plugins", 0, 0, G_OPTION_ARG_STRING, &plugins, "List of plugins separated by ,", "plugin1,plugin2" },
{NULL}
};
......@@ -275,6 +303,11 @@ main (int argc, char *argv[])
exit (1);
}
if (!g_module_supported ()) {
g_printerr ("GModules are not supported on your platform!");
exit (1);
}
bindtextdomain (GETTEXT_PACKAGE, NMLOCALEDIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
textdomain (GETTEXT_PACKAGE);
......@@ -297,6 +330,14 @@ main (int argc, char *argv[])
exit (1);
}
/* Parse the config file */
if (config) {
if (!parse_config_file (config, &plugins, &error)) {
g_warning ("Config file %s invalid: %s.", config, error->message);
exit (1);
}
}
pidfile = g_strdup (user_pidfile ? user_pidfile : NM_DEFAULT_PID_FILE);
/* Tricky: become_daemon is FALSE by default, so unless it's TRUE because
......@@ -358,9 +399,16 @@ main (int argc, char *argv[])
goto done;
}
manager = nm_manager_get ();
named_mgr = nm_named_manager_get ();
if (!named_mgr) {
nm_warning ("Failed to start the named manager.");
goto done;
}
manager = nm_manager_get (plugins, &error);
if (manager == NULL) {
nm_error ("Failed to initialize the network manager.");
nm_error ("Failed to initialize the network manager: %s",
error && error->message ? error->message : "(unknown)");
goto done;
}
......@@ -377,12 +425,6 @@ main (int argc, char *argv[])
goto done;
}
named_mgr = nm_named_manager_get ();
if (!named_mgr) {
nm_warning ("Failed to start the named manager.");
goto done;
}
dhcp_mgr = nm_dhcp_manager_get ();
if (!dhcp_mgr) {
nm_warning ("Failed to start the DHCP manager.");
......@@ -397,6 +439,8 @@ main (int argc, char *argv[])
goto done;
}
nm_manager_start (manager);
/* Bring up the loopback interface. */
nm_system_enable_loopback ();
......
......@@ -4,7 +4,10 @@
<busconfig>
<policy user="root">
<allow own="org.freedesktop.NetworkManager"/>
<allow own="org.freedesktop.NetworkManagerSystemSettings"/>
<allow send_destination="org.freedesktop.NetworkManager"/>
<allow send_destination="org.freedesktop.NetworkManagerSystemSettings"/>
<allow send_destination="org.freedesktop.NetworkManager"
send_interface="org.freedesktop.NetworkManager.PPP"/>
......@@ -56,7 +59,14 @@
</policy>
<policy context="default">
<deny own="org.freedesktop.NetworkManager"/>
<deny own="org.freedesktop.NetworkManagerSystemSettings"/>
<deny send_destination="org.freedesktop.NetworkManager"/>
<allow send_destination="org.freedesktop.NetworkManagerSystemSettings"/>
<!-- The org.freedesktop.NetworkManagerSettings.Connection.Secrets
interface is secured via PolicyKit.
-->
</policy>
<limit name="max_replies_per_connection">512</limit>
......
......@@ -648,7 +648,7 @@ auto_activate_device (gpointer user_data)
GError *error = NULL;
const char *device_path;
device_path = nm_device_get_udi (data->device);
device_path = nm_device_get_path (data->device);
if (!nm_manager_activate_connection (policy->manager,
best_connection,
specific_object,
......
......@@ -366,7 +366,7 @@ nm_utils_call_dispatcher (const char *action,
/* state */
value_hash_add_uint (device_props, NMD_DEVICE_PROPS_STATE, nm_device_get_state (device));
value_hash_add_object_path (device_props, NMD_DEVICE_PROPS_PATH, nm_device_get_udi (device));
value_hash_add_object_path (device_props, NMD_DEVICE_PROPS_PATH, nm_device_get_path (device));
}
dbus_g_proxy_call_no_reply (proxy, "Action",
......@@ -383,6 +383,32 @@ nm_utils_call_dispatcher (const char *action,
g_object_unref (dbus_mgr);
}
gboolean
nm_match_spec_hwaddr (const GSList *specs, const char *hwaddr)
{
const GSList *iter;
char *hwaddr_match, *p;
g_return_val_if_fail (hwaddr != NULL, FALSE);
p = hwaddr_match = g_strdup_printf ("mac:%s", hwaddr);
while (*p) {
*p = g_ascii_tolower (*p);
p++;
}
for (iter = specs; iter; iter = g_slist_next (iter)) {
if (!strcmp ((const char *) iter->data, hwaddr_match)) {
g_free (hwaddr_match);
return TRUE;
}
}
g_free (hwaddr_match);
return FALSE;
}
/*********************************/
static void
......@@ -449,3 +475,4 @@ value_hash_add_uint (GHashTable *hash,
value_hash_add (hash, key, value);
}
......@@ -46,6 +46,8 @@ void nm_utils_call_dispatcher (const char *action,
NMDevice *device,
const char *vpn_iface);
gboolean nm_match_spec_hwaddr (const GSList *specs, const char *hwaddr);
GHashTable *value_hash_create (void);
void value_hash_add (GHashTable *hash,
......
......@@ -129,12 +129,12 @@ stage1_prepare_done (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_d
if (required_secret) {
nm_device_state_changed (device, NM_DEVICE_STATE_NEED_AUTH, NM_DEVICE_STATE_REASON_NONE);
nm_act_request_request_connection_secrets (nm_device_get_act_request (device),
NM_SETTING_GSM_SETTING_NAME,
retry_secret,
SECRETS_CALLER_GSM,
required_secret,
NULL);
nm_act_request_get_secrets (nm_device_get_act_request (device),
NM_SETTING_GSM_SETTING_NAME,
retry_secret,
SECRETS_CALLER_GSM,
required_secret,
NULL);
} else
nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, translate_mm_error (error));
......@@ -237,12 +237,12 @@ real_act_stage1_prepare (NMDevice *device, NMDeviceStateReason *reason)
nm_device_state_changed (device, NM_DEVICE_STATE_NEED_AUTH, NM_DEVICE_STATE_REASON_NONE);
tries = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (connection), GSM_SECRETS_TRIES));
nm_act_request_request_connection_secrets (req,
setting_name,
tries ? TRUE : FALSE,
SECRETS_CALLER_GSM,
hint1,
hint2);
nm_act_request_get_secrets (req,
setting_name,
tries ? TRUE : FALSE,
SECRETS_CALLER_GSM,
hint1,
hint2);
g_object_set_data (G_OBJECT (connection), GSM_SECRETS_TRIES, GUINT_TO_POINTER (++tries));
if (hints)
......
This diff is collapsed.
......@@ -25,6 +25,7 @@
#include <glib-object.h>
#include "nm-connection.h"
#include "nm-active-connection.h"
#include "nm-secrets-provider-interface.h"
#define NM_TYPE_ACT_REQUEST (nm_act_request_get_type ())
#define NM_ACT_REQUEST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_ACT_REQUEST, NMActRequest))
......@@ -37,27 +38,18 @@ typedef struct {
GObject parent;
} NMActRequest;
typedef enum {
SECRETS_CALLER_NONE = 0,
SECRETS_CALLER_ETHERNET,
SECRETS_CALLER_WIFI,
SECRETS_CALLER_GSM,
SECRETS_CALLER_CDMA,
SECRETS_CALLER_PPP
} RequestSecretsCaller;
typedef struct {
GObjectClass parent;
/* Signals */
void (*connection_secrets_updated) (NMActRequest *req,
NMConnection *connection,
GSList *updated_settings,
RequestSecretsCaller caller);
void (*connection_secrets_failed) (NMActRequest *req,
NMConnection *connection,
const char *setting,
RequestSecretsCaller caller);
void (*secrets_updated) (NMActRequest *req,
NMConnection *connection,
GSList *updated_settings,
RequestSecretsCaller caller);
void (*secrets_failed) (NMActRequest *req,
NMConnection *connection,
const char *setting,
RequestSecretsCaller caller);
void (*properties_changed) (NMActRequest *req, GHashTable *properties);
} NMActRequestClass;
......@@ -70,12 +62,6 @@ NMActRequest *nm_act_request_new (NMConnection *connection,
gpointer *device); /* An NMDevice */
NMConnection *nm_act_request_get_connection (NMActRequest *req);
gboolean nm_act_request_request_connection_secrets (NMActRequest *req,
const char *setting_name,
gboolean request_new,
RequestSecretsCaller caller,
const char *hint1,
const char *hint2);
const char * nm_act_request_get_specific_object (NMActRequest *req);
void nm_act_request_set_specific_object (NMActRequest *req,
......@@ -99,4 +85,12 @@ void nm_act_request_add_share_rule (NMActRequest *req,
GObject * nm_act_request_get_device (NMActRequest *req);
gboolean nm_act_request_get_secrets (NMActRequest *req,
const char *setting_name,
gboolean request_new,
RequestSecretsCaller caller,
const char *hint1,
const char *hint2);
#endif /* NM_ACTIVATION_REQUEST_H */
......@@ -339,6 +339,24 @@ nm_dbus_manager_start_service (NMDBusManager *self)
return FALSE;
}
if (!dbus_g_proxy_call (priv->proxy, "RequestName", &err,
G_TYPE_STRING, NM_DBUS_SERVICE_SYSTEM_SETTINGS,
G_TYPE_UINT, DBUS_NAME_FLAG_DO_NOT_QUEUE,
G_TYPE_INVALID,
G_TYPE_UINT, &result,
G_TYPE_INVALID)) {
g_warning ("Could not acquire the NetworkManagerSystemSettings service.\n"
" Message: '%s'", err->message);
g_error_free (err);
return FALSE;
}
if (result != DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER) {
g_warning ("Could not acquire the NetworkManagerSystemSettings service "
"as it is already taken.");
return FALSE;
}
priv->started = TRUE;
return priv->started;
}
......
......@@ -104,6 +104,7 @@ typedef struct {
struct ether_addr hw_addr;
gboolean carrier;
guint32 ifindex;
guint state_to_disconnected_id;
char * carrier_file_path;
......@@ -131,6 +132,7 @@ enum {
PROP_HW_ADDRESS,
PROP_SPEED,
PROP_CARRIER,
PROP_IFINDEX,
LAST_PROP
};
......@@ -386,7 +388,7 @@ NMDeviceEthernet *
nm_device_ethernet_new (const char *udi,
const char *iface,
const char *driver,
gboolean managed)
guint32 ifindex)
{
g_return_val_if_fail (udi != NULL, NULL);
g_return_val_if_fail (iface != NULL, NULL);
......@@ -396,7 +398,7 @@ nm_device_ethernet_new (const char *udi,
NM_DEVICE_INTERFACE_UDI, udi,
NM_DEVICE_INTERFACE_IFACE, iface,
NM_DEVICE_INTERFACE_DRIVER, driver,
NM_DEVICE_INTERFACE_MANAGED, managed,
NM_DEVICE_ETHERNET_IFINDEX, ifindex,
NULL);
}
......@@ -427,6 +429,14 @@ nm_device_ethernet_get_carrier (NMDeviceEthernet *self)
return NM_DEVICE_ETHERNET_GET_PRIVATE (self)->carrier;
}
guint32
nm_device_ethernet_get_ifindex (NMDeviceEthernet *self)
{
g_return_val_if_fail (self != NULL, FALSE);
return NM_DEVICE_ETHERNET_GET_PRIVATE (self)->ifindex;
}
/* Returns speed in Mb/s */
static guint32
nm_device_ethernet_get_speed (NMDeviceEthernet *self)
......@@ -801,8 +811,12 @@ link_timeout_cb (gpointer user_data)
supplicant_interface_release (self);
nm_device_state_changed (dev, NM_DEVICE_STATE_NEED_AUTH, NM_DEVICE_STATE_REASON_SUPPLICANT_DISCONNECT);
nm_act_request_request_connection_secrets (req, setting_name, TRUE,
SECRETS_CALLER_ETHERNET, NULL, NULL);
nm_act_request_get_secrets (req,
setting_name,
TRUE,
SECRETS_CALLER_ETHERNET,
NULL,
NULL);
return FALSE;
......@@ -1078,8 +1092,12 @@ handle_auth_or_fail (NMDeviceEthernet *self,
* only ask for new secrets after the first failure.
*/
get_new = new_secrets ? TRUE : (tries ? TRUE : FALSE);
nm_act_request_request_connection_secrets (req, setting_name, get_new,
SECRETS_CALLER_ETHERNET, NULL, NULL);
nm_act_request_get_secrets (req,
setting_name,
get_new,
SECRETS_CALLER_ETHERNET,
NULL,
NULL);
g_object_set_data (G_OBJECT (connection), WIRED_SECRETS_TRIES, GUINT_TO_POINTER (++tries));
} else
......@@ -1445,6 +1463,21 @@ real_check_connection_compatible (NMDevice *device,
return TRUE;
}
static gboolean
spec_match_list (NMDevice *device, const GSList *specs)
{
struct ether_addr ether;
char *hwaddr;
gboolean matched;
nm_device_ethernet_get_address (NM_DEVICE_ETHERNET (device), &ether);
hwaddr = nm_ether_ntop (&ether);
matched = nm_match_spec_hwaddr (specs, hwaddr);
g_free (hwaddr);
return matched;
}
static void
nm_device_ethernet_dispose (GObject *object)
{
......@@ -1512,12 +1545,31 @@ get_property (GObject *object, guint prop_id,
case PROP_CARRIER:
g_value_set_boolean (value, nm_device_ethernet_get_carrier (device));
break;
case PROP_IFINDEX:
g_value_set_uint (value, nm_device_ethernet_get_ifindex (device));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
set_property (GObject *object, guint prop_id,
const GValue *value, GParamSpec *pspec)
{
NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (object);
switch (prop_id) {
case PROP_IFINDEX:
/* construct-only */
priv->ifindex = g_value_get_uint (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
nm_device_ethernet_class_init (NMDeviceEthernetClass *klass)
......@@ -1531,6 +1583,7 @@ nm_device_ethernet_class_init (NMDeviceEthernetClass *klass)
object_class->constructor = constructor;
object_class->dispose = nm_device_ethernet_dispose;
object_class->get_property = get_property;
object_class->set_property = set_property;
object_class->finalize = nm_device_ethernet_finalize;
parent_class->get_generic_capabilities = real_get_generic_capabilities;
......@@ -1550,6 +1603,7 @@ nm_device_ethernet_class_init (NMDeviceEthernetClass *klass)
parent_class->act_stage2_config = real_act_stage2_config;
parent_class->act_stage4_get_ip4_config = real_act_stage4_get_ip4_config;
parent_class->deactivate_quickly = real_deactivate_quickly;
parent_class->spec_match_list = spec_match_list;
/* properties */
g_object_class_install_property
......@@ -1576,6 +1630,14 @@ nm_device_ethernet_class_init (NMDeviceEthernetClass *klass)
FALSE,
G_PARAM_READABLE));
g_object_class_install_property
(object_class, PROP_IFINDEX,
g_param_spec_uint (NM_DEVICE_ETHERNET_IFINDEX,
"Ifindex",
"Interface index",
0, G_MAXUINT32, 0,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
/* Signals */
signals[PROPERTIES_CHANGED] =
nm_properties_changed_signal_new (object_class,
......
......@@ -39,6 +39,7 @@ G_BEGIN_DECLS
#define NM_DEVICE_ETHERNET_HW_ADDRESS "hw-address"
#define NM_DEVICE_ETHERNET_SPEED "speed"
#define NM_DEVICE_ETHERNET_CARRIER "carrier"
#define NM_DEVICE_ETHERNET_IFINDEX "ifindex"
typedef struct {
NMDevice parent;
......@@ -56,15 +57,17 @@ GType nm_device_ethernet_get_type (void);
NMDeviceEthernet *nm_device_ethernet_new (const char *udi,
const char *iface,
const char *driver,
gboolean managed);
const char *iface,
const char *driver,
guint32 ifindex);
void nm_device_ethernet_get_address (NMDeviceEthernet *dev,
struct ether_addr *addr);
gboolean nm_device_ethernet_get_carrier (NMDeviceEthernet *dev);
guint32 nm_device_ethernet_get_ifindex (NMDeviceEthernet *dev);
G_END_DECLS
#endif /* NM_DEVICE_ETHERNET_H */
......@@ -70,8 +70,8 @@ nm_device_interface_init (gpointer g_iface)
g_object_interface_install_property
(g_iface,
g_param_spec_string (NM_DEVICE_INTERFACE_UDI,
"Udi",
"HAL Udi",
"UDI",
"Unique Device Identifier",
NULL,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
......@@ -143,7 +143,7 @@ nm_device_interface_init (gpointer g_iface)
(g_iface, g_param_spec_boolean (NM_DEVICE_INTERFACE_MANAGED,
"Managed",
"Managed",
TRUE,
FALSE,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
/* Signals */
......@@ -270,3 +270,12 @@ nm_device_interface_get_state (NMDeviceInterface *device)
return state;
}
gboolean
nm_device_interface_spec_match_list (NMDeviceInterface *device,
const GSList *specs)
{
if (NM_DEVICE_INTERFACE_GET_INTERFACE (device)->spec_match_list)
return NM_DEVICE_INTERFACE_GET_INTERFACE (device)->spec_match_list (device, specs);
return FALSE;
}
......@@ -41,16 +41,16 @@ typedef enum
#define NM_DEVICE_INTERFACE_ERROR (nm_device_interface_error_quark ())
#define NM_TYPE_DEVICE_INTERFACE_ERROR (nm_device_interface_error_get_type ())
#define NM_DEVICE_INTERFACE_UDI "udi"
#define NM_DEVICE_INTERFACE_IFACE "interface"
#define NM_DEVICE_INTERFACE_DRIVER "driver"
#define NM_DEVICE_INTERFACE_UDI "udi"
#define NM_DEVICE_INTERFACE_IFACE "interface"
#define NM_DEVICE_INTERFACE_DRIVER "driver"
#define NM_DEVICE_INTERFACE_CAPABILITIES "capabilities"
#define NM_DEVICE_INTERFACE_IP4_ADDRESS "ip4-address"
#define NM_DEVICE_INTERFACE_IP4_CONFIG "ip4-config"
#define NM_DEVICE_INTERFACE_IP4_ADDRESS "ip4-address"
#define NM_DEVICE_INTERFACE_IP4_CONFIG "ip4-config"
#define NM_DEVICE_INTERFACE_DHCP4_CONFIG "dhcp4-config"
#define NM_DEVICE_INTERFACE_STATE "state"
#define NM_DEVICE_INTERFACE_DEVICE_TYPE "device-type" /* ugh */
#define NM_DEVICE_INTERFACE_MANAGED "managed"