core: misc cleanup

spin-off of https://bugzilla.gnome.org/show_bug.cgi?id=680909
This commit is contained in:
Dan Winship 2014-07-23 10:56:26 -04:00
commit 4a6f91c77c
92 changed files with 289 additions and 373 deletions

View file

@ -57,15 +57,13 @@ sbin_PROGRAMS = NetworkManager
NetworkManager_SOURCES = \
main.c
NetworkManager_LDADD = libNetworkManager.la $(LIBNDP_LIBS)
NetworkManager_LDADD = libNetworkManager.la
noinst_LTLIBRARIES = libNetworkManager.la
nm_sources = \
config/nm-config.c \
config/nm-config.h \
config/nm-config-device.c \
config/nm-config-device.h \
\
devices/nm-device.c \
devices/nm-device.h \
@ -364,6 +362,7 @@ libNetworkManager_la_LIBADD = \
$(LIBNL_LIBS) \
$(POLKIT_LIBS) \
$(SYSTEMD_LOGIN_LIBS) \
$(LIBNDP_LIBS) \
$(LIBDL) \
$(LIBM)

View file

@ -28,9 +28,11 @@
#include <resolv.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <linux/if.h>
#include "NetworkManagerUtils.h"
#include "nm-utils.h"
#include "nm-setting-private.h"
#include "nm-logging.h"
#include "nm-device.h"
#include "nm-setting-connection.h"
@ -587,6 +589,9 @@ nm_match_spec_hwaddr (const GSList *specs, const char *hwaddr)
g_return_val_if_fail (hwaddr != NULL, FALSE);
if (nm_match_spec_string (specs, hwaddr))
return TRUE;
hwaddr_match = g_strdup_printf ("mac:%s", hwaddr);
matched = nm_match_spec_string (specs, hwaddr_match);
g_free (hwaddr_match);
@ -601,6 +606,9 @@ nm_match_spec_interface_name (const GSList *specs, const char *interface_name)
g_return_val_if_fail (interface_name != NULL, FALSE);
if (nm_match_spec_string (specs, interface_name))
return TRUE;
iface_match = g_strdup_printf ("interface-name:%s", interface_name);
matched = nm_match_spec_string (specs, iface_match);
g_free (iface_match);

View file

@ -26,12 +26,7 @@
#include <stdio.h>
#include <net/ethernet.h>
#include "nm-ip4-config.h"
#include "nm-setting-ip4-config.h"
#include "nm-ip6-config.h"
#include "nm-setting-ip6-config.h"
#include "nm-connection.h"
#include "nm-setting-private.h"
gboolean nm_ethernet_address_is_valid (const struct ether_addr *test_addr);

View file

@ -1,82 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/* NetworkManager -- Network link manager
*
* 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.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Copyright 2013 Red Hat, Inc.
*/
#include "config.h"
#include "nm-config-device.h"
#include <net/if_arp.h>
#include <nm-utils.h>
G_DEFINE_INTERFACE (NMConfigDevice, nm_config_device, G_TYPE_OBJECT)
static void
nm_config_device_default_init (NMConfigDeviceInterface *iface)
{
}
gboolean
nm_config_device_spec_match_list (NMConfigDevice *self, const char **config_specs)
{
GSList *specs = NULL;
gboolean match;
char buf[NM_UTILS_HWADDR_LEN_MAX + 1], *tmp;
int i;
g_return_val_if_fail (NM_IS_CONFIG_DEVICE (self), FALSE);
if (!config_specs)
return FALSE;
/* For compatibility, we allow an untagged MAC address, and for convenience,
* we allow untagged interface names as well.
*/
for (i = 0; config_specs[i]; i++) {
if (g_strcmp0 (config_specs[i], "*") == 0)
specs = g_slist_prepend (specs, g_strdup (config_specs[i]));
else if (nm_utils_iface_valid_name (config_specs[i]))
specs = g_slist_prepend (specs, g_strdup_printf ("interface-name:%s", config_specs[i]));
else if ( nm_utils_hwaddr_aton (config_specs[i], ARPHRD_ETHER, buf)
|| nm_utils_hwaddr_aton (config_specs[i], ARPHRD_INFINIBAND, buf)) {
tmp = g_ascii_strdown (config_specs[i], -1);
specs = g_slist_prepend (specs, g_strdup_printf ("mac:%s", tmp));
g_free (tmp);
} else
specs = g_slist_prepend (specs, g_strdup (config_specs[i]));
}
specs = g_slist_reverse (specs);
match = NM_CONFIG_DEVICE_GET_INTERFACE (self)->spec_match_list (self, specs);
g_slist_free_full (specs, g_free);
return match;
}
char *
nm_config_device_get_hwaddr (NMConfigDevice *self)
{
const guint8 *bytes;
guint len = 0;
bytes = NM_CONFIG_DEVICE_GET_INTERFACE (self)->get_hw_address (self, &len);
return nm_utils_hwaddr_ntoa_len (bytes, len);
}

View file

@ -1,47 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/* NetworkManager -- Network link manager
*
* 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.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Copyright 2013 Red Hat, Inc.
*/
#ifndef NM_CONFIG_DEVICE_H
#define NM_CONFIG_DEVICE_H
#include <glib-object.h>
#define NM_TYPE_CONFIG_DEVICE (nm_config_device_get_type ())
#define NM_CONFIG_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_CONFIG_DEVICE, NMConfigDevice))
#define NM_IS_CONFIG_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_CONFIG_DEVICE))
#define NM_CONFIG_DEVICE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), NM_TYPE_CONFIG_DEVICE, NMConfigDeviceInterface))
typedef struct _NMConfigDevice NMConfigDevice;
typedef struct _NMConfigDeviceInterface NMConfigDeviceInterface;
struct _NMConfigDeviceInterface {
GTypeInterface g_iface;
/* Methods */
gboolean (*spec_match_list) (NMConfigDevice *device, const GSList *specs);
const guint8 * (* get_hw_address) (NMConfigDevice *device, guint *out_len);
};
GType nm_config_device_get_type (void);
gboolean nm_config_device_spec_match_list (NMConfigDevice *device, const char **config_specs);
char *nm_config_device_get_hwaddr (NMConfigDevice *device);
#endif /* NM_CONFIG_DEVICE_H */

View file

@ -27,6 +27,7 @@
#include "nm-logging.h"
#include "nm-utils.h"
#include "nm-glib-compat.h"
#include "nm-device.h"
#include <gio/gio.h>
#include <glib/gi18n.h>
@ -177,11 +178,20 @@ nm_config_get_value (NMConfig *config, const char *group, const char *key, GErro
}
gboolean
nm_config_get_ignore_carrier (NMConfig *config, NMConfigDevice *device)
nm_config_get_ignore_carrier (NMConfig *config, NMDevice *device)
{
NMConfigPrivate *priv = NM_CONFIG_GET_PRIVATE (config);
GSList *specs = NULL;
int i;
gboolean match;
return nm_config_device_spec_match_list (device, (const char **) priv->ignore_carrier);
for (i = 0; priv->ignore_carrier[i]; i++)
specs = g_slist_prepend (specs, priv->ignore_carrier[i]);
match = nm_device_spec_match_list (device, specs);
g_slist_free (specs);
return match;
}
/************************************************************************/
@ -227,18 +237,29 @@ merge_no_auto_default_state (NMConfig *config)
}
gboolean
nm_config_get_ethernet_can_auto_default (NMConfig *config, NMConfigDevice *device)
nm_config_get_ethernet_can_auto_default (NMConfig *config, NMDevice *device)
{
NMConfigPrivate *priv = NM_CONFIG_GET_PRIVATE (config);
GSList *specs = NULL;
int i;
gboolean match;
return !nm_config_device_spec_match_list (device, (const char **) priv->no_auto_default);
for (i = 0; priv->no_auto_default[i]; i++)
specs = g_slist_prepend (specs, priv->no_auto_default[i]);
match = nm_device_spec_match_list (device, specs);
g_slist_free (specs);
return !match;
}
void
nm_config_set_ethernet_no_auto_default (NMConfig *config, NMConfigDevice *device)
nm_config_set_ethernet_no_auto_default (NMConfig *config, NMDevice *device)
{
NMConfigPrivate *priv = NM_CONFIG_GET_PRIVATE (config);
char *current;
const guint8 *hwaddr;
guint hwaddr_len;
char *current, *hwaddr_str;
GString *updated;
GError *error = NULL;
@ -253,7 +274,10 @@ nm_config_set_ethernet_no_auto_default (NMConfig *config, NMConfigDevice *device
g_string_append_c (updated, '\n');
}
g_string_append (updated, nm_config_device_get_hwaddr (device));
hwaddr = nm_device_get_hw_address (device, &hwaddr_len);
hwaddr_str = nm_utils_hwaddr_ntoa_len (hwaddr, hwaddr_len);
g_string_append (updated, hwaddr_str);
g_free (hwaddr_str);
g_string_append_c (updated, '\n');
if (!g_file_set_contents (priv->no_auto_default_file, updated->str, updated->len, &error)) {

View file

@ -25,7 +25,7 @@
#include <glib.h>
#include <glib-object.h>
#include "nm-config-device.h"
#include "nm-types.h"
G_BEGIN_DECLS
@ -61,10 +61,10 @@ const char *nm_config_get_connectivity_uri (NMConfig *config);
const guint nm_config_get_connectivity_interval (NMConfig *config);
const char *nm_config_get_connectivity_response (NMConfig *config);
gboolean nm_config_get_ethernet_can_auto_default (NMConfig *config, NMConfigDevice *device);
void nm_config_set_ethernet_no_auto_default (NMConfig *config, NMConfigDevice *device);
gboolean nm_config_get_ethernet_can_auto_default (NMConfig *config, NMDevice *device);
void nm_config_set_ethernet_no_auto_default (NMConfig *config, NMDevice *device);
gboolean nm_config_get_ignore_carrier (NMConfig *config, NMConfigDevice *device);
gboolean nm_config_get_ignore_carrier (NMConfig *config, NMDevice *device);
char *nm_config_get_value (NMConfig *config, const char *group, const char *key, GError **error);

View file

@ -2,10 +2,13 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/include \
-I$(top_srcdir)/libnm-util \
-I$(top_builddir)/libnm-util \
-I$(top_srcdir)/src/ \
-I$(top_srcdir)/src/config \
-I$(top_srcdir)/src/devices \
-DG_LOG_DOMAIN=\""NetworkManager"\" \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
$(GLIB_CFLAGS) \
$(DBUS_CFLAGS) \
-DSRCDIR=\""$(srcdir)"\"
noinst_PROGRAMS = \

View file

@ -24,78 +24,82 @@
#include <netinet/ether.h>
#include "nm-test-device.h"
#include "nm-config-device.h"
#include "nm-utils.h"
#include "nm-device-private.h"
static void nm_test_device_config_device_interface_init (NMConfigDeviceInterface *iface);
static GObjectClass *g_object_class;
G_DEFINE_TYPE_WITH_CODE (NMTestDevice, nm_test_device, G_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE (NM_TYPE_CONFIG_DEVICE, nm_test_device_config_device_interface_init))
G_DEFINE_TYPE (NMTestDevice, nm_test_device, NM_TYPE_DEVICE)
static void
nm_test_device_init (NMTestDevice *self)
{
}
/* We jump over NMDevice's construct/destruct methods, which require NMPlatform
* and NMConnectionProvider to be initialized.
*/
static GObject*
constructor (GType type,
guint n_construct_params,
GObjectConstructParam *construct_params)
{
return g_object_class->constructor (type,
n_construct_params,
construct_params);
}
static void
constructed (GObject *object)
{
NMDevice *device = NM_DEVICE (object);
nm_device_update_hw_address (device);
g_object_class->constructed (object);
}
static void
dispose (GObject *object)
{
g_object_class->dispose (object);
}
static void
finalize (GObject *object)
{
NMTestDevice *self = NM_TEST_DEVICE (object);
g_object_class->finalize (object);
}
g_free (self->hwaddr);
g_free (self->hwaddr_bytes);
G_OBJECT_CLASS (nm_test_device_parent_class)->finalize (object);
static guint
get_hw_address_length (NMDevice *dev, gboolean *out_permanent)
{
if (out_permanent)
*out_permanent = TRUE;
return ETH_ALEN;
}
static void
nm_test_device_class_init (NMTestDeviceClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
NMDeviceClass *device_class = NM_DEVICE_CLASS (klass);
g_object_class = g_type_class_peek (G_TYPE_OBJECT);
object_class->constructor = constructor;
object_class->constructed = constructed;
object_class->dispose = dispose;
object_class->finalize = finalize;
device_class->get_hw_address_length = get_hw_address_length;
}
static gboolean
spec_match_list (NMConfigDevice *device, const GSList *specs)
{
NMTestDevice *self = NM_TEST_DEVICE (device);
const GSList *iter;
const char *spec;
for (iter = specs; iter; iter = iter->next) {
spec = iter->data;
if (g_str_has_prefix (spec, "mac:") && !strcmp (spec + 4, self->hwaddr))
return TRUE;
}
return FALSE;
}
static const guint8 *
get_hw_address (NMConfigDevice *device, guint *out_len)
{
NMTestDevice *self = NM_TEST_DEVICE (device);
if (out_len)
*out_len = ETH_ALEN;
return self->hwaddr_bytes;
}
static void
nm_test_device_config_device_interface_init (NMConfigDeviceInterface *iface)
{
iface->spec_match_list = spec_match_list;
iface->get_hw_address = get_hw_address;
}
NMTestDevice *
NMDevice *
nm_test_device_new (const char *hwaddr)
{
NMTestDevice *self = g_object_new (NM_TYPE_TEST_DEVICE, NULL);
self->hwaddr = g_strdup (hwaddr);
self->hwaddr_bytes = g_malloc (ETH_ALEN);
nm_utils_hwaddr_aton (hwaddr, ARPHRD_ETHER, self->hwaddr_bytes);
return self;
return g_object_new (NM_TYPE_TEST_DEVICE,
NM_DEVICE_IFACE, "dummy:",
NM_DEVICE_HW_ADDRESS, hwaddr,
NULL);
}

View file

@ -21,7 +21,7 @@
#ifndef NM_TEST_DEVICE_H
#define NM_TEST_DEVICE_H
#include <glib-object.h>
#include <nm-device.h>
G_BEGIN_DECLS
@ -33,19 +33,17 @@ G_BEGIN_DECLS
#define NM_TEST_DEVICE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_TEST_DEVICE, NMTestDeviceClass))
typedef struct {
GObject parent;
NMDevice parent;
char *hwaddr;
guint8 *hwaddr_bytes;
} NMTestDevice;
typedef struct {
GObjectClass parent;
NMDeviceClass parent;
} NMTestDeviceClass;
GType nm_test_device_get_type (void);
NMTestDevice *nm_test_device_new (const char *hwaddr);
NMDevice *nm_test_device_new (const char *hwaddr);
G_END_DECLS

View file

@ -163,7 +163,7 @@ test_config_no_auto_default (void)
GError *error = NULL;
int fd, nwrote;
char *state_file;
NMTestDevice *dev1, *dev2, *dev3, *dev4;
NMDevice *dev1, *dev2, *dev3, *dev4;
fd = g_file_open_tmp (NULL, &state_file, &error);
g_assert_no_error (error);
@ -185,13 +185,13 @@ test_config_no_auto_default (void)
dev3 = nm_test_device_new ("33:33:33:33:33:33");
dev4 = nm_test_device_new ("44:44:44:44:44:44");
g_assert (!nm_config_get_ethernet_can_auto_default (config, NM_CONFIG_DEVICE (dev1)));
g_assert (!nm_config_get_ethernet_can_auto_default (config, NM_CONFIG_DEVICE (dev2)));
g_assert (nm_config_get_ethernet_can_auto_default (config, NM_CONFIG_DEVICE (dev3)));
g_assert (!nm_config_get_ethernet_can_auto_default (config, NM_CONFIG_DEVICE (dev4)));
g_assert (!nm_config_get_ethernet_can_auto_default (config, dev1));
g_assert (!nm_config_get_ethernet_can_auto_default (config, dev2));
g_assert (nm_config_get_ethernet_can_auto_default (config, dev3));
g_assert (!nm_config_get_ethernet_can_auto_default (config, dev4));
nm_config_set_ethernet_no_auto_default (config, NM_CONFIG_DEVICE (dev3));
g_assert (!nm_config_get_ethernet_can_auto_default (config, NM_CONFIG_DEVICE (dev3)));
nm_config_set_ethernet_no_auto_default (config, dev3);
g_assert (!nm_config_get_ethernet_can_auto_default (config, dev3));
g_object_unref (config);
@ -201,10 +201,10 @@ test_config_no_auto_default (void)
config = nm_config_new (&error);
g_assert_no_error (error);
g_assert (!nm_config_get_ethernet_can_auto_default (config, NM_CONFIG_DEVICE (dev1)));
g_assert (!nm_config_get_ethernet_can_auto_default (config, NM_CONFIG_DEVICE (dev2)));
g_assert (!nm_config_get_ethernet_can_auto_default (config, NM_CONFIG_DEVICE (dev3)));
g_assert (!nm_config_get_ethernet_can_auto_default (config, NM_CONFIG_DEVICE (dev4)));
g_assert (!nm_config_get_ethernet_can_auto_default (config, dev1));
g_assert (!nm_config_get_ethernet_can_auto_default (config, dev2));
g_assert (!nm_config_get_ethernet_can_auto_default (config, dev3));
g_assert (!nm_config_get_ethernet_can_auto_default (config, dev4));
g_object_unref (config);

View file

@ -7,17 +7,13 @@ AM_CPPFLAGS = \
-I${top_builddir}/src \
-I${top_srcdir}/src/logging \
-I${top_srcdir}/src/devices \
-I${top_srcdir}/src/settings \
-I${top_srcdir}/src/platform \
-I${top_srcdir}/src/ppp-manager \
-I${top_srcdir}/include \
-I${top_builddir}/libnm-util \
-I${top_srcdir}/libnm-util \
-DG_LOG_DOMAIN=\""NetworkManager-adsl"\" \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
$(DBUS_CFLAGS) \
$(POLKIT_CFLAGS) \
$(LIBNL_CFLAGS) \
$(GUDEV_CFLAGS)
GLIB_GENERATED = nm-adsl-enum-types.h nm-adsl-enum-types.c

View file

@ -15,10 +15,7 @@ AM_CPPFLAGS = \
-I${top_srcdir}/libnm-util \
-DG_LOG_DOMAIN=\""NetworkManager-bluetooth"\" \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
$(DBUS_CFLAGS) \
$(POLKIT_CFLAGS) \
$(LIBNL_CFLAGS) \
$(GUDEV_CFLAGS)
$(DBUS_CFLAGS)
GLIB_GENERATED = nm-bt-enum-types.h nm-bt-enum-types.c
GLIB_MKENUMS_H_FLAGS = --identifier-prefix NM

View file

@ -25,7 +25,6 @@
#include <glib-object.h>
#include "NetworkManager.h"
#include "nm-platform.h"
#include "nm-device.h"
/* WARNING: this file is private API between NetworkManager and its internal

View file

@ -33,6 +33,9 @@
#include "nm-device-private.h"
#include "nm-enum-types.h"
#include "nm-dbus-manager.h"
#include "nm-activation-request.h"
#include "nm-ip4-config.h"
#include "nm-platform.h"
#include "nm-device-infiniband-glue.h"

View file

@ -35,6 +35,9 @@
#include "nm-device-private.h"
#include "nm-enum-types.h"
#include "nm-dbus-manager.h"
#include "nm-connection-provider.h"
#include "nm-activation-request.h"
#include "nm-ip4-config.h"
#include "nm-platform.h"
#include "nm-utils.h"

View file

@ -51,11 +51,15 @@
#include "nm-dbus-manager.h"
#include "nm-utils.h"
#include "nm-logging.h"
#include "nm-activation-request.h"
#include "nm-setting-ip4-config.h"
#include "nm-ip4-config.h"
#include "nm-setting-ip6-config.h"
#include "nm-ip6-config.h"
#include "nm-setting-connection.h"
#include "nm-dnsmasq-manager.h"
#include "nm-dhcp4-config.h"
#include "nm-dhcp6-config.h"
#include "nm-rfkill-manager.h"
#include "nm-firewall-manager.h"
#include "nm-properties-changed-signal.h"
@ -66,7 +70,6 @@
#include "nm-manager-auth.h"
#include "nm-dbus-glib-types.h"
#include "nm-dispatcher.h"
#include "nm-config-device.h"
#include "nm-config.h"
#include "nm-dns-manager.h"
@ -75,10 +78,7 @@ static void impl_device_delete (NMDevice *device, DBusGMethodInvocation *con
#include "nm-device-glue.h"
static void nm_device_config_device_interface_init (NMConfigDeviceInterface *iface);
G_DEFINE_ABSTRACT_TYPE_WITH_CODE (NMDevice, nm_device, G_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE (NM_TYPE_CONFIG_DEVICE, nm_device_config_device_interface_init))
G_DEFINE_ABSTRACT_TYPE (NMDevice, nm_device, G_TYPE_OBJECT)
#define NM_DEVICE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE, NMDevicePrivate))
@ -7139,13 +7139,6 @@ nm_device_init (NMDevice *self)
priv->ip6_saved_properties = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, g_free);
}
static void
nm_device_config_device_interface_init (NMConfigDeviceInterface *iface)
{
iface->spec_match_list = (gboolean (*) (NMConfigDevice *, const GSList *)) nm_device_spec_match_list;
iface->get_hw_address = (const guint8 * (*) (NMConfigDevice *, guint *)) nm_device_get_hw_address;
}
/*
* Get driver info from SIOCETHTOOL ioctl() for 'iface'
* Returns driver and firmware versions to 'driver_version and' 'firmware_version'
@ -7252,7 +7245,7 @@ constructed (GObject *object)
/* Have to call update_initial_hw_address() before calling get_ignore_carrier() */
if (device_has_capability (dev, NM_DEVICE_CAP_CARRIER_DETECT)) {
priv->ignore_carrier = nm_config_get_ignore_carrier (nm_config_get (), NM_CONFIG_DEVICE (dev));
priv->ignore_carrier = nm_config_get_ignore_carrier (nm_config_get (), dev);
check_carrier (dev);
nm_log_info (LOGD_HW,

View file

@ -28,15 +28,8 @@
#include "NetworkManager.h"
#include "nm-types.h"
#include "nm-activation-request.h"
#include "nm-ip4-config.h"
#include "nm-ip6-config.h"
#include "nm-dhcp4-config.h"
#include "nm-dhcp6-config.h"
#include "nm-connection.h"
#include "nm-rfkill-manager.h"
#include "nm-connection-provider.h"
#include "nm-platform.h"
/* Properties */
#define NM_DEVICE_UDI "udi"

View file

@ -7,7 +7,6 @@ AM_CPPFLAGS = \
-I${top_builddir}/src \
-I${top_srcdir}/src/logging \
-I${top_srcdir}/src/devices \
-I${top_srcdir}/src/settings \
-I${top_srcdir}/src/platform \
-I${top_srcdir}/src/posix-signals \
-I${top_srcdir}/include \
@ -15,10 +14,7 @@ AM_CPPFLAGS = \
-I${top_srcdir}/libnm-util \
-DG_LOG_DOMAIN=\""NetworkManager-team"\" \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
$(DBUS_CFLAGS) \
$(POLKIT_CFLAGS) \
$(LIBNL_CFLAGS) \
$(GUDEV_CFLAGS)
$(DBUS_CFLAGS)
if WITH_TEAMDCTL
AM_CPPFLAGS += ${LIBTEAMDCTL_CFLAGS}

View file

@ -26,6 +26,7 @@
#include "nm-team-factory.h"
#include "nm-device-team.h"
#include "nm-logging.h"
#include "nm-platform.h"
static GType nm_team_factory_get_type (void);

View file

@ -17,10 +17,7 @@ AM_CPPFLAGS = \
-I${top_srcdir}/libnm-util \
-DG_LOG_DOMAIN=\""NetworkManager-wifi"\" \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
$(DBUS_CFLAGS) \
$(POLKIT_CFLAGS) \
$(LIBNL_CFLAGS) \
$(GUDEV_CFLAGS)
$(DBUS_CFLAGS)
GLIB_GENERATED = nm-wifi-enum-types.h nm-wifi-enum-types.c
GLIB_MKENUMS_H_FLAGS = --identifier-prefix NM

View file

@ -53,6 +53,7 @@
#include "nm-manager.h"
#include "nm-enum-types.h"
#include "nm-dbus-manager.h"
#include "nm-platform.h"
#include "nm-wifi-enum-types.h"
/* This is a bug; but we can't really change API now... */

View file

@ -52,6 +52,7 @@
#include "nm-setting-wireless-security.h"
#include "nm-setting-8021x.h"
#include "nm-setting-ip4-config.h"
#include "nm-ip4-config.h"
#include "nm-setting-ip6-config.h"
#include "nm-platform.h"
#include "nm-manager-auth.h"

View file

@ -24,6 +24,7 @@
#include "nm-device-wifi.h"
#include "nm-device-olpc-mesh.h"
#include "nm-settings-connection.h"
#include "nm-platform.h"
#define NM_TYPE_WIFI_FACTORY (nm_wifi_factory_get_type ())
#define NM_WIFI_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_WIFI_FACTORY, NMWifiFactory))

View file

@ -2,7 +2,6 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/include \
-I$(top_srcdir)/libnm-util \
-I$(top_builddir)/libnm-util \
-I$(top_srcdir)/src/platform \
-I$(top_srcdir)/src/logging \
-I$(top_srcdir)/src \
-I$(top_srcdir)/src/devices/wifi \

View file

@ -10,10 +10,7 @@ AM_CPPFLAGS = \
-DG_LOG_DOMAIN=\""NetworkManager-wimax"\" \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
$(DBUS_CFLAGS) \
$(POLKIT_CFLAGS) \
$(IWMX_SDK_CFLAGS) \
$(LIBNL_CFLAGS) \
$(GUDEV_CFLAGS)
$(IWMX_SDK_CFLAGS)
pkglib_LTLIBRARIES = libnm-device-plugin-wimax.la

View file

@ -36,8 +36,10 @@
#include "nm-logging.h"
#include "nm-device-private.h"
#include "NetworkManagerUtils.h"
#include "nm-active-connection.h"
#include "nm-dbus-manager.h"
#include "nm-connection.h"
#include "nm-platform.h"
#include "nm-setting-connection.h"
#include "nm-setting-wimax.h"
#include "nm-utils.h"

View file

@ -22,6 +22,7 @@
#include "nm-device-factory.h"
#include "nm-device-wimax.h"
#include "nm-platform.h"
#define NM_TYPE_WIMAX_FACTORY (nm_wimax_factory_get_type ())
#define NM_WIMAX_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_WIMAX_FACTORY, NMWimaxFactory))

View file

@ -15,7 +15,6 @@ AM_CPPFLAGS = \
-DG_LOG_DOMAIN=\""NetworkManager-wwan"\" \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
$(DBUS_CFLAGS) \
$(POLKIT_CFLAGS) \
$(MM_GLIB_CFLAGS)
BUILT_SOURCES = $(null)

View file

@ -26,6 +26,7 @@
#include "nm-logging.h"
#include "NetworkManagerUtils.h"
#include "nm-device-private.h"
#include "nm-platform.h"
G_DEFINE_TYPE (NMModemBroadband, nm_modem_broadband, NM_TYPE_MODEM)

View file

@ -34,6 +34,7 @@
#include "nm-dbus-glib-types.h"
#include "nm-dhcp-client.h"
#include "nm-dhcp-utils.h"
#include "nm-platform.h"
typedef struct {
char * iface;

View file

@ -27,6 +27,7 @@
#include "nm-dhcp-dhclient-utils.h"
#include "nm-ip4-config.h"
#include "nm-utils.h"
#include "nm-platform.h"
#include "NetworkManagerUtils.h"
#define CLIENTID_TAG "send dhcp-client-identifier"

View file

@ -27,6 +27,7 @@
#include "nm-dhcp-utils.h"
#include "nm-utils.h"
#include "NetworkManagerUtils.h"
#include "nm-platform.h"
/********************************************/

View file

@ -25,6 +25,7 @@
#include "nm-dhcp-dhclient-utils.h"
#include "nm-utils.h"
#include "nm-ip4-config.h"
#include "nm-platform.h"
#define DEBUG 0

View file

@ -26,6 +26,7 @@
#include "nm-dhcp-utils.h"
#include "nm-logging.h"
#include "nm-platform.h"
#include "nm-test-utils.h"

View file

@ -21,6 +21,7 @@
#include <string.h>
#include "nm-dns-utils.h"
#include "nm-platform.h"
#include "nm-utils.h"
static void

View file

@ -55,6 +55,7 @@
#include "nm-posix-signals.h"
#include "nm-session-monitor.h"
#include "nm-dispatcher.h"
#include "nm-settings.h"
#if !defined(NM_DIST_VERSION)
# define NM_DIST_VERSION VERSION

View file

@ -37,7 +37,7 @@
#include "nm-active-connection.h"
#include "nm-settings-connection.h"
#include "nm-posix-signals.h"
#include "nm-auth-subject.h"
G_DEFINE_TYPE (NMActRequest, nm_act_request, NM_TYPE_ACTIVE_CONNECTION)

View file

@ -23,6 +23,7 @@
#include <glib.h>
#include <glib-object.h>
#include "nm-types.h"
#include "nm-connection.h"
#include "nm-active-connection.h"
@ -35,9 +36,9 @@
#define NM_IS_ACT_REQUEST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_ACT_REQUEST))
#define NM_ACT_REQUEST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_ACT_REQUEST, NMActRequestClass))
typedef struct {
struct _NMActRequest {
NMActiveConnection parent;
} NMActRequest;
};
typedef struct {
NMActiveConnectionClass parent;

View file

@ -28,6 +28,7 @@
#include "nm-device.h"
#include "nm-settings-connection.h"
#include "nm-manager-auth.h"
#include "nm-auth-subject.h"
#include "NetworkManagerUtils.h"
#include "nm-active-connection-glue.h"

View file

@ -24,7 +24,6 @@
#include <glib-object.h>
#include "nm-types.h"
#include "nm-connection.h"
#include "nm-auth-subject.h"
#define NM_TYPE_ACTIVE_CONNECTION (nm_active_connection_get_type ())
#define NM_ACTIVE_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_ACTIVE_CONNECTION, NMActiveConnection))
@ -57,9 +56,9 @@
#define NM_ACTIVE_CONNECTION_INT_MASTER "int-master"
#define NM_ACTIVE_CONNECTION_INT_MASTER_READY "int-master-ready"
typedef struct {
struct _NMActiveConnection {
GObject parent;
} NMActiveConnection;
};
typedef struct {
GObjectClass parent;

View file

@ -31,6 +31,8 @@
#include <polkit/polkit.h>
#endif
#include "nm-types.h"
#define NM_TYPE_AUTH_SUBJECT (nm_auth_subject_get_type ())
#define NM_AUTH_SUBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_AUTH_SUBJECT, NMAuthSubject))
#define NM_AUTH_SUBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_AUTH_SUBJECT, NMAuthSubjectClass))
@ -38,9 +40,9 @@
#define NM_IS_AUTH_SUBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_AUTH_SUBJECT))
#define NM_AUTH_SUBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_AUTH_SUBJECT, NMAuthSubjectClass))
typedef struct {
struct _NMAuthSubject {
GObject parent;
} NMAuthSubject;
};
typedef struct {
GObjectClass parent;

View file

@ -19,13 +19,13 @@
#include <glib-object.h>
#include <nm-connection.h>
#include "nm-types.h"
#define NM_TYPE_CONNECTION_PROVIDER (nm_connection_provider_get_type ())
#define NM_CONNECTION_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_CONNECTION_PROVIDER, NMConnectionProvider))
#define NM_IS_CONNECTION_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_CONNECTION_PROVIDER))
#define NM_CONNECTION_PROVIDER_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), NM_TYPE_CONNECTION_PROVIDER, NMConnectionProvider))
typedef struct _NMConnectionProvider NMConnectionProvider;
#define NM_CP_SIGNAL_CONNECTION_ADDED "cp-connection-added"
#define NM_CP_SIGNAL_CONNECTION_UPDATED "cp-connection-updated"
#define NM_CP_SIGNAL_CONNECTION_REMOVED "cp-connection-removed"

View file

@ -26,6 +26,7 @@
#include <gio/gio.h>
#include "NetworkManager.h"
#include "nm-types.h"
#define NM_TYPE_CONNECTIVITY (nm_connectivity_get_type ())
#define NM_CONNECTIVITY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_CONNECTIVITY, NMConnectivity))
@ -40,9 +41,9 @@
#define NM_CONNECTIVITY_RESPONSE "response"
#define NM_CONNECTIVITY_STATE "state"
typedef struct {
struct _NMConnectivity {
GObject parent;
} NMConnectivity;
};
typedef struct {
GObjectClass parent;

View file

@ -27,6 +27,8 @@
#include <dbus/dbus.h>
#include <dbus/dbus-glib.h>
#include "nm-types.h"
G_BEGIN_DECLS
typedef gboolean (* NMDBusSignalHandlerFunc) (DBusConnection * connection,
@ -45,9 +47,9 @@ typedef gboolean (* NMDBusSignalHandlerFunc) (DBusConnection * connection,
#define NM_DBUS_MANAGER_PRIVATE_CONNECTION_NEW "private-connection-new"
#define NM_DBUS_MANAGER_PRIVATE_CONNECTION_DISCONNECTED "private-connection-disconnected"
typedef struct {
struct _NMDBusManager {
GObject parent;
} NMDBusManager;
};
typedef struct {
GObjectClass parent;

View file

@ -24,6 +24,8 @@
#include <glib.h>
#include <glib-object.h>
#include "nm-types.h"
#define NM_TYPE_DHCP4_CONFIG (nm_dhcp4_config_get_type ())
#define NM_DHCP4_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DHCP4_CONFIG, NMDHCP4Config))
#define NM_DHCP4_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DHCP4_CONFIG, NMDHCP4ConfigClass))
@ -31,9 +33,9 @@
#define NM_IS_DHCP4_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_DHCP4_CONFIG))
#define NM_DHCP4_CONFIG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DHCP4_CONFIG, NMDHCP4ConfigClass))
typedef struct {
struct _NMDHCP4Config {
GObject parent;
} NMDHCP4Config;
};
typedef struct {
GObjectClass parent;

View file

@ -24,6 +24,8 @@
#include <glib.h>
#include <glib-object.h>
#include "nm-types.h"
#define NM_TYPE_DHCP6_CONFIG (nm_dhcp6_config_get_type ())
#define NM_DHCP6_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DHCP6_CONFIG, NMDHCP6Config))
#define NM_DHCP6_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DHCP6_CONFIG, NMDHCP6ConfigClass))
@ -31,9 +33,9 @@
#define NM_IS_DHCP6_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_DHCP6_CONFIG))
#define NM_DHCP6_CONFIG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DHCP6_CONFIG, NMDHCP6ConfigClass))
typedef struct {
struct _NMDHCP6Config {
GObject parent;
} NMDHCP6Config;
};
typedef struct {
GObjectClass parent;

View file

@ -30,6 +30,9 @@
#include "nm-utils.h"
#include "nm-logging.h"
#include "nm-dbus-manager.h"
#include "nm-device.h"
#include "nm-dhcp4-config.h"
#include "nm-dhcp6-config.h"
#include "nm-dbus-glib-types.h"
#include "nm-glib-compat.h"

View file

@ -25,9 +25,7 @@
#include <glib.h>
#include <stdio.h>
#include "nm-device.h"
#include "nm-ip4-config.h"
#include "nm-ip6-config.h"
#include "nm-types.h"
#include "nm-connection.h"
typedef enum {

View file

@ -23,7 +23,7 @@
#include <glib-object.h>
#include "nm-platform.h"
#include "nm-types.h"
#include "nm-setting-ip4-config.h"
#define NM_TYPE_IP4_CONFIG (nm_ip4_config_get_type ())
@ -33,9 +33,9 @@
#define NM_IS_IP4_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_IP4_CONFIG))
#define NM_IP4_CONFIG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_IP4_CONFIG, NMIP4ConfigClass))
typedef struct {
struct _NMIP4Config {
GObject parent;
} NMIP4Config;
};
typedef struct {
GObjectClass parent;

View file

@ -23,7 +23,7 @@
#include <glib-object.h>
#include "nm-platform.h"
#include "nm-types.h"
#include "nm-setting-ip6-config.h"
#define NM_TYPE_IP6_CONFIG (nm_ip6_config_get_type ())
@ -33,9 +33,9 @@
#define NM_IS_IP6_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_IP6_CONFIG))
#define NM_IP6_CONFIG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_IP6_CONFIG, NMIP6ConfigClass))
typedef struct {
struct _NMIP6Config {
GObject parent;
} NMIP6Config;
};
typedef struct {
GObjectClass parent;

View file

@ -32,6 +32,7 @@
#include "nm-logging.h"
#include "nm-dbus-manager.h"
#include "nm-auth-subject.h"
#include "nm-session-monitor.h"
struct NMAuthChain {
guint32 refcount;

View file

@ -25,9 +25,7 @@
#include <dbus/dbus-glib.h>
#include <nm-connection.h>
#include "nm-dbus-manager.h"
#include "nm-session-monitor.h"
#include "nm-auth-subject.h"
#include "nm-types.h"
#define NM_AUTH_PERMISSION_ENABLE_DISABLE_NETWORK "org.freedesktop.NetworkManager.enable-disable-network"
#define NM_AUTH_PERMISSION_SLEEP_WAKE "org.freedesktop.NetworkManager.sleep-wake"

View file

@ -68,7 +68,9 @@
#include "nm-sleep-monitor.h"
#include "nm-connectivity.h"
#include "nm-policy.h"
#include "nm-connection-provider.h"
#include "nm-session-monitor.h"
#include "nm-activation-request.h"
#define NM_AUTOIP_DBUS_SERVICE "org.freedesktop.nm_avahi_autoipd"
#define NM_AUTOIP_DBUS_IFACE "org.freedesktop.nm_avahi_autoipd"

View file

@ -25,9 +25,9 @@
#include <glib.h>
#include <glib-object.h>
#include <dbus/dbus-glib.h>
#include "nm-device.h"
#include "nm-settings.h"
#include "nm-auth-subject.h"
#include "nm-types.h"
#include "nm-connection.h"
#define NM_TYPE_MANAGER (nm_manager_get_type ())
#define NM_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_MANAGER, NMManager))
@ -77,9 +77,9 @@ typedef enum {
#define NM_MANAGER_ACTIVE_CONNECTION_REMOVED "active-connection-removed"
typedef struct {
struct _NMManager {
GObject parent;
} NMManager;
};
typedef struct {
GObjectClass parent;

View file

@ -43,6 +43,11 @@
#include "nm-dispatcher.h"
#include "nm-utils.h"
#include "nm-glib-compat.h"
#include "nm-manager.h"
#include "nm-settings.h"
#include "nm-settings-connection.h"
#include "nm-dhcp4-config.h"
#include "nm-dhcp6-config.h"
typedef struct {
NMManager *manager;

View file

@ -22,8 +22,7 @@
#ifndef NM_POLICY_H
#define NM_POLICY_H
#include "nm-manager.h"
#include "nm-settings.h"
#include "nm-types.h"
#define NM_TYPE_POLICY (nm_policy_get_type ())
#define NM_POLICY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_POLICY, NMPolicy))
@ -37,9 +36,9 @@
#define NM_POLICY_ACTIVATING_IP4_DEVICE "activating-ip4-device"
#define NM_POLICY_ACTIVATING_IP6_DEVICE "activating-ip6-device"
typedef struct {
struct _NMPolicy {
GObject parent;
} NMPolicy;
};
typedef struct {
GObjectClass parent;

View file

@ -21,6 +21,8 @@
#include <glib-object.h>
#include "nm-types.h"
#ifndef NM_RFKILL_MANAGER_H
#define NM_RFKILL_MANAGER_H
@ -51,9 +53,9 @@ typedef enum {
#define NM_IS_RFKILL_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_RFKILL_MANAGER))
#define NM_RFKILL_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_RFKILL_MANAGER, NMRfkillManagerClass))
typedef struct {
struct _NMRfkillManager {
GObject parent;
} NMRfkillManager;
};
typedef struct {
GObjectClass parent;

View file

@ -23,6 +23,8 @@
#include <glib-object.h>
#include "nm-types.h"
G_BEGIN_DECLS
#define NM_TYPE_SESSION_MONITOR (nm_session_monitor_get_type ())
@ -34,7 +36,6 @@ G_BEGIN_DECLS
#define NM_SESSION_MONITOR_CHANGED "changed"
typedef struct _NMSessionMonitor NMSessionMonitor;
typedef struct _NMSessionMonitorClass NMSessionMonitorClass;
GType nm_session_monitor_get_type (void) G_GNUC_CONST;

View file

@ -22,6 +22,8 @@
#include <glib-object.h>
#include "nm-types.h"
G_BEGIN_DECLS
#define NM_TYPE_SLEEP_MONITOR (nm_sleep_monitor_get_type ())
@ -34,7 +36,6 @@ G_BEGIN_DECLS
#define NM_SLEEP_MONITOR_SLEEPING "sleeping"
#define NM_SLEEP_MONITOR_RESUMING "resuming"
typedef struct _NMSleepMonitor NMSleepMonitor;
typedef struct _NMSleepMonitorClass NMSleepMonitorClass;
GType nm_sleep_monitor_get_type (void) G_GNUC_CONST;

View file

@ -21,6 +21,35 @@
#ifndef NM_TYPES_H
#define NM_TYPES_H
typedef struct _NMDevice NMDevice;
/* core */
typedef struct _NMActiveConnection NMActiveConnection;
typedef struct _NMActRequest NMActRequest;
typedef struct _NMAuthSubject NMAuthSubject;
typedef struct _NMConnectionProvider NMConnectionProvider;
typedef struct _NMConnectivity NMConnectivity;
typedef struct _NMDBusManager NMDBusManager;
typedef struct _NMDevice NMDevice;
typedef struct _NMDHCP4Config NMDHCP4Config;
typedef struct _NMDHCP6Config NMDHCP6Config;
typedef struct _NMIP4Config NMIP4Config;
typedef struct _NMIP6Config NMIP6Config;
typedef struct _NMManager NMManager;
typedef struct _NMPolicy NMPolicy;
typedef struct _NMRfkillManager NMRfkillManager;
typedef struct _NMSessionMonitor NMSessionMonitor;
typedef struct _NMSleepMonitor NMSleepMonitor;
/* platform */
typedef struct _NMPlatformIP4Address NMPlatformIP4Address;
typedef struct _NMPlatformIP4Route NMPlatformIP4Route;
typedef struct _NMPlatformIP6Address NMPlatformIP6Address;
typedef struct _NMPlatformIP6Route NMPlatformIP6Route;
typedef struct _NMPlatformLink NMPlatformLink;
/* settings */
typedef struct _NMAgentManager NMAgentManager;
typedef struct _NMSecretAgent NMSecretAgent;
typedef struct _NMSettings NMSettings;
typedef struct _NMSettingsConnection NMSettingsConnection;
#endif /* NM_TYPES_H */

View file

@ -30,6 +30,7 @@
#include <NetworkManager.h>
#include "gsystem-local-alloc.h"
#include "nm-types.h"
#define NM_TYPE_PLATFORM (nm_platform_get_type ())
#define NM_PLATFORM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_PLATFORM, NMPlatform))
@ -120,7 +121,7 @@ typedef enum {
int ifindex; \
;
typedef struct {
struct _NMPlatformLink {
__NMPlatformObject_COMMON;
char name[IFNAMSIZ];
NMLinkType type;
@ -133,7 +134,7 @@ typedef struct {
gboolean connected;
gboolean arp;
guint mtu;
} NMPlatformLink;
};
typedef enum {
NM_PLATFORM_SIGNAL_ADDED,
@ -208,24 +209,24 @@ typedef struct {
* NMPlatformIP4Address:
* @timestamp: timestamp as returned by nm_utils_get_monotonic_timestamp_s()
**/
typedef struct {
struct _NMPlatformIP4Address {
__NMPlatformIPAddress_COMMON;
in_addr_t address;
in_addr_t peer_address; /* PTP peer address */
char label[IFNAMSIZ];
} NMPlatformIP4Address;
};
G_STATIC_ASSERT (G_STRUCT_OFFSET (NMPlatformIPAddress, address_ptr) == G_STRUCT_OFFSET (NMPlatformIP4Address, address));
/**
* NMPlatformIP6Address:
* @timestamp: timestamp as returned by nm_utils_get_monotonic_timestamp_s()
**/
typedef struct {
struct _NMPlatformIP6Address {
__NMPlatformIPAddress_COMMON;
struct in6_addr address;
struct in6_addr peer_address;
guint flags; /* ifa_flags from <linux/if_addr.h>, field type "unsigned int" is as used in rtnl_addr_get_flags. */
} NMPlatformIP6Address;
};
G_STATIC_ASSERT (G_STRUCT_OFFSET (NMPlatformIPAddress, address_ptr) == G_STRUCT_OFFSET (NMPlatformIP6Address, address));
#undef __NMPlatformIPAddress_COMMON
@ -249,18 +250,18 @@ typedef struct {
};
} NMPlatformIPRoute;
typedef struct {
struct _NMPlatformIP4Route {
__NMPlatformIPRoute_COMMON;
in_addr_t network;
in_addr_t gateway;
} NMPlatformIP4Route;
};
G_STATIC_ASSERT (G_STRUCT_OFFSET (NMPlatformIPRoute, network_ptr) == G_STRUCT_OFFSET (NMPlatformIP4Route, network));
typedef struct {
struct _NMPlatformIP6Route {
__NMPlatformIPRoute_COMMON;
struct in6_addr network;
struct in6_addr gateway;
} NMPlatformIP6Route;
};
G_STATIC_ASSERT (G_STRUCT_OFFSET (NMPlatformIPRoute, network_ptr) == G_STRUCT_OFFSET (NMPlatformIP6Route, network));
#undef __NMPlatformIPRoute_COMMON

View file

@ -54,6 +54,7 @@
#include "nm-dbus-manager.h"
#include "nm-logging.h"
#include "nm-posix-signals.h"
#include "nm-platform.h"
static void impl_ppp_manager_need_secrets (NMPPPManager *manager,
DBusGMethodInvocation *context);

View file

@ -28,6 +28,7 @@
#include "NetworkManagerUtils.h"
#include "nm-logging.h"
#include "nm-platform.h"
#define debug(...) nm_log_dbg (LOGD_IP6, __VA_ARGS__)
#define warning(...) nm_log_warn (LOGD_IP6, __VA_ARGS__)

View file

@ -2,19 +2,14 @@ AM_CPPFLAGS = \
-I${top_srcdir} \
-I$(top_srcdir)/include \
-I${top_srcdir}/src \
-I${top_srcdir}/src/devices \
-I${top_srcdir}/src/logging \
-I${top_srcdir}/src/platform \
-I${top_srcdir}/src/posix-signals \
-I${top_srcdir}/libnm-util \
-I${top_builddir}/libnm-util \
-I${srcdir}/.. \
-DG_LOG_DOMAIN=\""NetworkManager"\" \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
$(GLIB_CFLAGS) \
$(DBUS_CFLAGS) \
$(POLKIT_CFLAGS) \
$(LIBNL_CFLAGS) \
$(LIBNDP_CFLAGS)
AM_CFLAGS = $(CODE_COVERAGE_CFLAGS)
@ -31,6 +26,5 @@ noinst_PROGRAMS = \
rdisc_SOURCES = \
rdisc.c
rdisc_LDADD = \
$(top_builddir)/src/libNetworkManager.la \
$(LIBNDP_LIBS)
$(top_builddir)/src/libNetworkManager.la

View file

@ -36,6 +36,9 @@
#include "nm-setting-vpn.h"
#include "nm-setting-connection.h"
#include "nm-enum-types.h"
#include "nm-auth-subject.h"
#include "nm-dbus-manager.h"
#include "nm-session-monitor.h"
G_DEFINE_TYPE (NMAgentManager, nm_agent_manager, G_TYPE_OBJECT)

View file

@ -26,6 +26,7 @@
#include <nm-connection.h>
#include "nm-settings-flags.h"
#include "nm-secret-agent.h"
#include "nm-types.h"
#define NM_TYPE_AGENT_MANAGER (nm_agent_manager_get_type ())
#define NM_AGENT_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_AGENT_MANAGER, NMAgentManager))
@ -45,9 +46,9 @@ typedef enum {
NM_AGENT_MANAGER_ERROR_USER_CANCELED /*< nick=UserCanceled >*/
} NMAgentManagerError;
typedef struct {
struct _NMAgentManager {
GObject parent;
} NMAgentManager;
};
typedef struct {
GObjectClass parent;

View file

@ -33,6 +33,7 @@
#include "nm-dbus-glib-types.h"
#include "nm-glib-compat.h"
#include "nm-logging.h"
#include "nm-auth-subject.h"
G_DEFINE_TYPE (NMSecretAgent, nm_secret_agent, G_TYPE_OBJECT)

View file

@ -27,9 +27,8 @@
#include <dbus/dbus-glib-lowlevel.h>
#include <nm-connection.h>
#include "nm-dbus-manager.h"
#include "nm-types.h"
#include "nm-settings-flags.h"
#include "nm-auth-subject.h"
/* NOTE: ensure these capabilities match those in introspection/nm-secret-agent.xml and
* libnm-glib/nm-secret-agent.h.
@ -46,9 +45,9 @@ typedef enum {
#define NM_IS_SECRET_AGENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_SECRET_AGENT))
#define NM_SECRET_AGENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SECRET_AGENT, NMSecretAgentClass))
typedef struct {
struct _NMSecretAgent {
GObject parent;
} NMSecretAgent;
};
typedef struct {
GObjectClass parent;

View file

@ -38,6 +38,7 @@
#include "nm-dbus-glib-types.h"
#include "nm-logging.h"
#include "nm-manager-auth.h"
#include "nm-auth-subject.h"
#include "nm-agent-manager.h"
#include "NetworkManagerUtils.h"
#include "nm-properties-changed-signal.h"

View file

@ -22,10 +22,11 @@
#ifndef NM_SETTINGS_CONNECTION_H
#define NM_SETTINGS_CONNECTION_H
#include <net/ethernet.h>
#include <nm-connection.h>
#include "nm-settings-flags.h"
#include "nm-auth-subject.h"
#include <net/ethernet.h>
#include "nm-types.h"
G_BEGIN_DECLS
@ -49,7 +50,6 @@ G_BEGIN_DECLS
#define NM_SETTINGS_CONNECTION_VISIBLE "visible"
#define NM_SETTINGS_CONNECTION_UNSAVED "unsaved"
typedef struct _NMSettingsConnection NMSettingsConnection;
typedef struct _NMSettingsConnectionClass NMSettingsConnectionClass;
typedef void (*NMSettingsConnectionCommitFunc) (NMSettingsConnection *connection,

View file

@ -58,9 +58,11 @@
#include "nm-settings.h"
#include "nm-settings-connection.h"
#include "nm-settings-error.h"
#include "nm-system-config-interface.h"
#include "nm-logging.h"
#include "nm-dbus-manager.h"
#include "nm-manager-auth.h"
#include "nm-auth-subject.h"
#include "nm-session-monitor.h"
#include "plugins/keyfile/plugin.h"
#include "nm-agent-manager.h"
@ -1578,7 +1580,7 @@ default_wired_clear_tag (NMSettings *self,
g_signal_handlers_disconnect_by_func (connection, G_CALLBACK (default_wired_connection_updated_by_user_cb), self);
if (add_to_no_auto_default)
nm_config_set_ethernet_no_auto_default (NM_SETTINGS_GET_PRIVATE (self)->config, NM_CONFIG_DEVICE (device));
nm_config_set_ethernet_no_auto_default (NM_SETTINGS_GET_PRIVATE (self)->config, device);
}
void
@ -1603,7 +1605,7 @@ nm_settings_device_added (NMSettings *self, NMDevice *device)
if ( !nm_device_get_managed (device)
|| g_object_get_data (G_OBJECT (device), DEFAULT_WIRED_CONNECTION_TAG)
|| have_connection_for_device (self, device)
|| !nm_config_get_ethernet_can_auto_default (priv->config, NM_CONFIG_DEVICE (device)))
|| !nm_config_get_ethernet_can_auto_default (priv->config, device))
return;
hw_address = nm_device_get_hw_address (device, &len);

View file

@ -28,10 +28,7 @@
#include <nm-connection.h>
#include "nm-settings-connection.h"
#include "nm-system-config-interface.h"
#include "nm-device.h"
#include "nm-secret-agent.h"
#include "nm-types.h"
#define NM_TYPE_SETTINGS (nm_settings_get_type ())
#define NM_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SETTINGS, NMSettings))
@ -52,9 +49,9 @@
#define NM_SETTINGS_SIGNAL_CONNECTION_VISIBILITY_CHANGED "connection-visibility-changed"
#define NM_SETTINGS_SIGNAL_AGENT_REGISTERED "agent-registered"
typedef struct {
struct _NMSettings {
GObject parent_instance;
} NMSettings;
};
typedef struct {
GObjectClass parent_class;

View file

@ -20,6 +20,7 @@
*/
#include "nm-system-config-interface.h"
#include "nm-settings-connection.h"
static void
interface_init (gpointer g_iface)

View file

@ -25,7 +25,7 @@
#include <glib.h>
#include <glib-object.h>
#include <nm-connection.h>
#include <nm-settings-connection.h>
#include "nm-types.h"
G_BEGIN_DECLS

View file

@ -10,7 +10,6 @@ AM_CPPFLAGS = \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
$(GLIB_CFLAGS) \
$(DBUS_CFLAGS) \
$(POLKIT_CFLAGS) \
-DNMCONFDIR=\"$(nmconfdir)\"
# 'noinst' here because this is an example plugin we don't want to install

View file

@ -32,13 +32,11 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/src/posix-signals \
-I$(top_srcdir)/src/config \
-I$(top_srcdir)/include \
-I$(top_srcdir)/libnm-glib \
-I$(top_srcdir)/libnm-util \
-I$(top_builddir)/libnm-util \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
$(GLIB_CFLAGS) \
$(DBUS_CFLAGS) \
$(POLKIT_CFLAGS) \
$(NSS_CFLAGS) \
-DG_LOG_DOMAIN=\""NetworkManager-ifcfg-rh"\" \
-DSYSCONFDIR=\"$(sysconfdir)\" \
@ -53,7 +51,6 @@ libnm_settings_plugin_ifcfg_rh_la_SOURCES = \
libnm_settings_plugin_ifcfg_rh_la_LDFLAGS = -module -avoid-version
libnm_settings_plugin_ifcfg_rh_la_LIBADD = \
$(top_builddir)/libnm-util/libnm-util.la \
$(top_builddir)/libnm-glib/libnm-glib.la \
libifcfg-rh-io.la \
$(GLIB_LIBS)

View file

@ -6,12 +6,10 @@ SUBDIRS=network-scripts
AM_CPPFLAGS = \
$(GLIB_CFLAGS) \
$(DBUS_CFLAGS) \
$(CODE_COVERAGE_CFLAGS) \
-I$(top_srcdir)/include \
-I$(top_srcdir)/libnm-util \
-I$(top_builddir)/libnm-util \
-I$(top_srcdir)/libnm-glib \
-I$(top_srcdir)/src/ \
-I$(top_srcdir)/src/logging \
-I$(top_srcdir)/src/platform \
@ -31,8 +29,7 @@ AM_LDFLAGS = \
$(CODE_COVERAGE_LDFLAGS)
AM_LDADD = \
$(top_builddir)/libnm-util/libnm-util.la \
$(top_builddir)/libnm-glib/libnm-glib.la
$(top_builddir)/libnm-util/libnm-util.la
noinst_PROGRAMS = test-ifcfg-rh test-ifcfg-rh-utils

View file

@ -1,13 +1,10 @@
AM_CPPFLAGS = \
$(GLIB_CFLAGS) \
$(DBUS_CFLAGS) \
$(POLKIT_CFLAGS) \
-I${top_srcdir}/src \
-I${top_srcdir}/src/settings \
-I$(top_srcdir)/include \
-I$(top_srcdir)/libnm-util \
-I$(top_builddir)/libnm-util \
-I$(top_srcdir)/libnm-glib \
-DG_LOG_DOMAIN=\""NetworkManager-ifcfg-suse"\" \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
-DSYSCONFDIR=\"$(sysconfdir)\"
@ -21,6 +18,5 @@ libnm_settings_plugin_ifcfg_suse_la_SOURCES = \
libnm_settings_plugin_ifcfg_suse_la_LDFLAGS = -module -avoid-version
libnm_settings_plugin_ifcfg_suse_la_LIBADD = \
$(top_builddir)/libnm-util/libnm-util.la \
$(top_builddir)/libnm-glib/libnm-glib.la \
$(GLIB_LIBS)

View file

@ -9,15 +9,11 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/src/platform \
-I$(top_srcdir)/src/settings \
-I$(top_srcdir)/include \
-I$(top_srcdir)/libnm-glib \
-I$(top_srcdir)/libnm-util \
-I$(top_builddir)/libnm-util \
-DG_LOG_DOMAIN=\""NetworkManager-ifnet"\" \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
$(GLIB_CFLAGS) \
$(DBUS_CFLAGS) \
$(POLKIT_CFLAGS) \
$(GUDEV_CFLAGS) \
-DSYSCONFDIR=\"$(sysconfdir)\"
-DSBINDIR=\"$(sbindir)\"
@ -35,7 +31,6 @@ libnm_settings_plugin_ifnet_la_LDFLAGS = -module -avoid-version
libnm_settings_plugin_ifnet_la_LIBADD = \
$(top_builddir)/libnm-util/libnm-util.la \
$(top_builddir)/libnm-glib/libnm-glib.la \
lib-ifnet-io.la\
$(GLIB_LIBS) \
$(GUDEV_LIBS)

View file

@ -4,7 +4,6 @@ if ENABLE_TESTS
AM_CPPFLAGS= \
-I$(srcdir)/../ \
-I$(top_srcdir)/libnm-glib \
-I$(top_srcdir)/libnm-util \
-I$(top_builddir)/libnm-util \
-I$(top_srcdir)/include \
@ -17,8 +16,6 @@ AM_CPPFLAGS= \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
$(CHECK_CFLAGS) \
$(GLIB_CFLAGS) \
$(DBUS_CFLAGS) \
$(POLKIT_CFLAGS) \
$(CODE_COVERAGE_CFLAGS) \
-DTEST_WPA_SUPPLICANT_CONF='"$(srcdir)/wpa_supplicant.conf"' \
-DSYSCONFDIR=\"nonexistent\"

View file

@ -8,14 +8,11 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/src/config \
-I$(top_srcdir)/src/settings \
-I$(top_srcdir)/include \
-I$(top_srcdir)/libnm-glib \
-I$(top_srcdir)/libnm-util \
-I$(top_builddir)/libnm-util \
-DG_LOG_DOMAIN=\""NetworkManager-ifupdown"\" \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
$(GLIB_CFLAGS) \
$(DBUS_CFLAGS) \
$(POLKIT_CFLAGS) \
$(GUDEV_CFLAGS) \
-DSYSCONFDIR=\"$(sysconfdir)\"

View file

@ -4,7 +4,6 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/include \
-I$(top_srcdir)/libnm-util \
-I$(top_builddir)/libnm-util \
-I$(top_srcdir)/libnm-glib \
-I$(top_srcdir)/src \
-I$(top_srcdir)/src/logging \
-I$(top_srcdir)/src/settings \
@ -12,8 +11,6 @@ AM_CPPFLAGS = \
-DG_LOG_DOMAIN=\""NetworkManager-ifupdown"\" \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
$(GLIB_CFLAGS) \
$(DBUS_CFLAGS) \
$(POLKIT_CFLAGS) \
-DTEST_ENI_DIR=\"$(abs_srcdir)\"
noinst_PROGRAMS = test-ifupdown
@ -25,7 +22,6 @@ test_ifupdown_SOURCES = \
test_ifupdown_LDADD = \
$(top_builddir)/src/libNetworkManager.la \
$(top_builddir)/libnm-glib/libnm-glib.la \
$(top_builddir)/libnm-util/libnm-util.la \
$(DBUS_LIBS)

View file

@ -14,7 +14,6 @@ AM_CPPFLAGS = \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
$(GLIB_CFLAGS) \
$(DBUS_CFLAGS) \
$(POLKIT_CFLAGS) \
-DNMCONFDIR=\"$(nmconfdir)\"
noinst_LTLIBRARIES = \

View file

@ -8,14 +8,12 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/include \
-I$(top_srcdir)/libnm-util \
-I$(top_builddir)/libnm-util \
-I$(top_srcdir)/libnm-glib \
-I$(top_srcdir)/src \
-I$(top_srcdir)/src/logging \
-I$(top_srcdir)/src/settings \
-I$(srcdir)/../ \
$(GLIB_CFLAGS) \
$(DBUS_CFLAGS) \
$(POLKIT_CFLAGS) \
$(CODE_COVERAGE_CFLAGS) \
-DG_LOG_DOMAIN=\""NetworkManager-keyfile"\" \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
@ -34,7 +32,6 @@ test_keyfile_SOURCES = \
test_keyfile_LDADD = \
$(top_builddir)/src/libNetworkManager.la \
$(top_builddir)/libnm-glib/libnm-glib.la \
$(top_builddir)/libnm-util/libnm-util.la \
$(DBUS_LIBS) \
$(CODE_COVERAGE_LDFLAGS)

View file

@ -4,8 +4,7 @@ AM_CPPFLAGS = \
-I$(top_builddir)/libnm-util \
-I$(top_srcdir)/src/settings \
-DG_LOG_DOMAIN=\""NetworkManager"\" \
$(GLIB_CFLAGS) \
$(DBUS_CFLAGS)
$(GLIB_CFLAGS)
noinst_PROGRAMS = \
test-wired-defname

View file

@ -4,7 +4,6 @@ AM_CPPFLAGS = \
-I$(top_builddir)/libnm-util \
-I$(top_srcdir)/src/logging \
-I$(top_srcdir)/src/platform \
-I$(top_srcdir)/src/logging \
-I$(top_srcdir)/src/dhcp-manager \
-I$(top_srcdir)/src \
-I$(top_builddir)/src \

View file

@ -23,6 +23,7 @@
#include <arpa/inet.h>
#include "nm-ip4-config.h"
#include "nm-platform.h"
static void
addr_init (NMPlatformIP4Address *a, const char *addr, const char *peer, guint plen)

View file

@ -25,6 +25,7 @@
#include "nm-ip6-config.h"
#include "nm-logging.h"
#include "nm-platform.h"
#include "nm-test-utils.h"
static NMIP6Config *

View file

@ -22,6 +22,8 @@
#include <string.h>
#include "NetworkManagerUtils.h"
#include "nm-ip4-config.h"
#include "nm-ip6-config.h"
#include "nm-platform.h"
static void

View file

@ -33,6 +33,9 @@
#include "nm-setting-connection.h"
#include "nm-setting-vpn.h"
#include "nm-setting-ip4-config.h"
#include "nm-ip4-config.h"
#include "nm-setting-ip6-config.h"
#include "nm-ip6-config.h"
#include "nm-dbus-manager.h"
#include "nm-platform.h"
#include "nm-logging.h"

View file

@ -27,6 +27,7 @@
#include "NetworkManagerVPN.h"
#include "nm-device.h"
#include "nm-auth-subject.h"
#include "nm-active-connection.h"
#define NM_TYPE_VPN_CONNECTION (nm_vpn_connection_get_type ())
#define NM_VPN_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_VPN_CONNECTION, NMVPNConnection))