platform: add reason attribute to all signals

This commit is contained in:
Pavel Šimerda
2013-08-02 18:51:06 +02:00
parent c1bbacae4c
commit 356cad68fa
11 changed files with 61 additions and 49 deletions

View File

@@ -39,7 +39,6 @@
#include "NetworkManagerUtils.h" #include "NetworkManagerUtils.h"
#include "nm-logging.h" #include "nm-logging.h"
#include "nm-enum-types.h" #include "nm-enum-types.h"
#include "nm-platform.h"
#include "nm-dbus-manager.h" #include "nm-dbus-manager.h"
#include "nm-platform.h" #include "nm-platform.h"
@@ -321,7 +320,7 @@ error:
} }
static void static void
lost_link (NMPlatform *platform, int ifindex, NMPlatformLink *info, NMDeviceAdsl *device_adsl) lost_link (NMPlatform *platform, int ifindex, NMPlatformLink *info, NMPlatformReason reason, NMDeviceAdsl *device_adsl)
{ {
NMDeviceAdslPrivate *priv = NM_DEVICE_ADSL_GET_PRIVATE (device_adsl); NMDeviceAdslPrivate *priv = NM_DEVICE_ADSL_GET_PRIVATE (device_adsl);
NMDevice *device = NM_DEVICE (device_adsl); NMDevice *device = NM_DEVICE (device_adsl);

View File

@@ -325,12 +325,12 @@ static void cp_connection_updated (NMConnectionProvider *cp, NMConnection *conne
static const char *state_to_string (NMDeviceState state); static const char *state_to_string (NMDeviceState state);
static void link_changed_cb (NMPlatform *platform, int ifindex, NMPlatformLink *info, NMDevice *device); static void link_changed_cb (NMPlatform *platform, int ifindex, NMPlatformLink *info, NMPlatformReason reason, NMDevice *device);
static void check_carrier (NMDevice *device); static void check_carrier (NMDevice *device);
static void nm_device_queued_ip_config_change_clear (NMDevice *self); static void nm_device_queued_ip_config_change_clear (NMDevice *self);
static void update_ip_config (NMDevice *self); static void update_ip_config (NMDevice *self);
static void device_ip_changed (NMPlatform *platform, int ifindex, gpointer platform_object, gpointer user_data); static void device_ip_changed (NMPlatform *platform, int ifindex, gpointer platform_object, NMPlatformReason reason, gpointer user_data);
static const char const *platform_ip_signals[] = { static const char const *platform_ip_signals[] = {
NM_PLATFORM_IP4_ADDRESS_ADDED, NM_PLATFORM_IP4_ADDRESS_ADDED,
@@ -1149,7 +1149,7 @@ nm_device_set_carrier (NMDevice *device, gboolean carrier)
} }
static void static void
link_changed_cb (NMPlatform *platform, int ifindex, NMPlatformLink *info, NMDevice *device) link_changed_cb (NMPlatform *platform, int ifindex, NMPlatformLink *info, NMPlatformReason reason, NMDevice *device)
{ {
NMDeviceClass *klass = NM_DEVICE_GET_CLASS (device); NMDeviceClass *klass = NM_DEVICE_GET_CLASS (device);
@@ -5911,7 +5911,7 @@ queued_ip_config_change (gpointer user_data)
} }
static void static void
device_ip_changed (NMPlatform *platform, int ifindex, gpointer platform_object, gpointer user_data) device_ip_changed (NMPlatform *platform, int ifindex, gpointer platform_object, NMPlatformReason reason, gpointer user_data)
{ {
NMDevice *self = user_data; NMDevice *self = user_data;

View File

@@ -2246,6 +2246,7 @@ static void
platform_link_added_cb (NMPlatform *platform, platform_link_added_cb (NMPlatform *platform,
int ifindex, int ifindex,
NMPlatformLink *link, NMPlatformLink *link,
NMPlatformReason reason,
gpointer user_data) gpointer user_data)
{ {
NMManager *self = NM_MANAGER (user_data); NMManager *self = NM_MANAGER (user_data);
@@ -2358,6 +2359,7 @@ static void
platform_link_removed_cb (NMPlatform *platform, platform_link_removed_cb (NMPlatform *platform,
int ifindex, int ifindex,
NMPlatformLink *link, NMPlatformLink *link,
NMPlatformReason reason,
gpointer user_data) gpointer user_data)
{ {
NMManager *self = NM_MANAGER (user_data); NMManager *self = NM_MANAGER (user_data);

View File

@@ -179,7 +179,7 @@ link_added_emit (gpointer user_data)
device = link_get (info->platform, info->ifindex); device = link_get (info->platform, info->ifindex);
g_assert (device); g_assert (device);
g_signal_emit_by_name (info->platform, NM_PLATFORM_LINK_ADDED, info->ifindex, &(device->link)); g_signal_emit_by_name (info->platform, NM_PLATFORM_LINK_ADDED, info->ifindex, &device->link, NM_PLATFORM_REASON_INTERNAL);
return FALSE; return FALSE;
} }
@@ -249,7 +249,7 @@ link_delete (NMPlatform *platform, int ifindex)
memset (route, 0, sizeof (*route)); memset (route, 0, sizeof (*route));
} }
g_signal_emit_by_name (platform, NM_PLATFORM_LINK_REMOVED, ifindex, &deleted_device); g_signal_emit_by_name (platform, NM_PLATFORM_LINK_REMOVED, ifindex, &deleted_device, NM_PLATFORM_REASON_INTERNAL);
return TRUE; return TRUE;
} }
@@ -298,7 +298,7 @@ link_changed (NMPlatform *platform, NMFakePlatformLink *device)
NMFakePlatformPrivate *priv = NM_FAKE_PLATFORM_GET_PRIVATE (platform); NMFakePlatformPrivate *priv = NM_FAKE_PLATFORM_GET_PRIVATE (platform);
int i; int i;
g_signal_emit_by_name (platform, "link-changed", device->link.ifindex, &device->link); g_signal_emit_by_name (platform, "link-changed", device->link.ifindex, &device->link, NM_PLATFORM_REASON_INTERNAL);
if (device->link.master) { if (device->link.master) {
NMFakePlatformLink *master = link_get (platform, device->link.master); NMFakePlatformLink *master = link_get (platform, device->link.master);
@@ -755,12 +755,12 @@ ip4_address_add (NMPlatform *platform, int ifindex, in_addr_t addr, int plen, gu
continue; continue;
memcpy (item, &address, sizeof (address)); memcpy (item, &address, sizeof (address));
g_signal_emit_by_name (platform, NM_PLATFORM_IP4_ADDRESS_CHANGED, ifindex, &address); g_signal_emit_by_name (platform, NM_PLATFORM_IP4_ADDRESS_CHANGED, ifindex, &address, NM_PLATFORM_REASON_INTERNAL);
return TRUE; return TRUE;
} }
g_array_append_val (priv->ip4_addresses, address); g_array_append_val (priv->ip4_addresses, address);
g_signal_emit_by_name (platform, NM_PLATFORM_IP4_ADDRESS_ADDED, ifindex, &address); g_signal_emit_by_name (platform, NM_PLATFORM_IP4_ADDRESS_ADDED, ifindex, &address, NM_PLATFORM_REASON_INTERNAL);
return TRUE; return TRUE;
} }
@@ -791,12 +791,12 @@ ip6_address_add (NMPlatform *platform, int ifindex, struct in6_addr addr, int pl
continue; continue;
memcpy (item, &address, sizeof (address)); memcpy (item, &address, sizeof (address));
g_signal_emit_by_name (platform, NM_PLATFORM_IP6_ADDRESS_CHANGED, ifindex, &address); g_signal_emit_by_name (platform, NM_PLATFORM_IP6_ADDRESS_CHANGED, ifindex, &address, NM_PLATFORM_REASON_INTERNAL);
return TRUE; return TRUE;
} }
g_array_append_val (priv->ip6_addresses, address); g_array_append_val (priv->ip6_addresses, address);
g_signal_emit_by_name (platform, NM_PLATFORM_IP6_ADDRESS_ADDED, ifindex, &address); g_signal_emit_by_name (platform, NM_PLATFORM_IP6_ADDRESS_ADDED, ifindex, &address, NM_PLATFORM_REASON_INTERNAL);
return TRUE; return TRUE;
} }
@@ -815,7 +815,7 @@ ip4_address_delete (NMPlatform *platform, int ifindex, in_addr_t addr, int plen)
memcpy (&deleted_address, address, sizeof (deleted_address)); memcpy (&deleted_address, address, sizeof (deleted_address));
memset (address, 0, sizeof (*address)); memset (address, 0, sizeof (*address));
g_signal_emit_by_name (platform, NM_PLATFORM_IP4_ADDRESS_REMOVED, ifindex, &deleted_address); g_signal_emit_by_name (platform, NM_PLATFORM_IP4_ADDRESS_REMOVED, ifindex, &deleted_address, NM_PLATFORM_REASON_INTERNAL);
return TRUE; return TRUE;
} }
} }
@@ -838,7 +838,7 @@ ip6_address_delete (NMPlatform *platform, int ifindex, struct in6_addr addr, int
memcpy (&deleted_address, address, sizeof (deleted_address)); memcpy (&deleted_address, address, sizeof (deleted_address));
memset (address, 0, sizeof (*address)); memset (address, 0, sizeof (*address));
g_signal_emit_by_name (platform, NM_PLATFORM_IP6_ADDRESS_REMOVED, ifindex, &deleted_address); g_signal_emit_by_name (platform, NM_PLATFORM_IP6_ADDRESS_REMOVED, ifindex, &deleted_address, NM_PLATFORM_REASON_INTERNAL);
return TRUE; return TRUE;
} }
} }
@@ -962,12 +962,12 @@ ip4_route_add (NMPlatform *platform, int ifindex, in_addr_t network, int plen,
continue; continue;
memcpy (item, &route, sizeof (route)); memcpy (item, &route, sizeof (route));
g_signal_emit_by_name (platform, NM_PLATFORM_IP4_ROUTE_CHANGED, ifindex, &route); g_signal_emit_by_name (platform, NM_PLATFORM_IP4_ROUTE_CHANGED, ifindex, &route, NM_PLATFORM_REASON_INTERNAL);
return TRUE; return TRUE;
} }
g_array_append_val (priv->ip4_routes, route); g_array_append_val (priv->ip4_routes, route);
g_signal_emit_by_name (platform, NM_PLATFORM_IP4_ROUTE_ADDED, ifindex, &route); g_signal_emit_by_name (platform, NM_PLATFORM_IP4_ROUTE_ADDED, ifindex, &route, NM_PLATFORM_REASON_INTERNAL);
return TRUE; return TRUE;
} }
@@ -999,12 +999,12 @@ ip6_route_add (NMPlatform *platform, int ifindex, struct in6_addr network, int p
continue; continue;
memcpy (item, &route, sizeof (route)); memcpy (item, &route, sizeof (route));
g_signal_emit_by_name (platform, NM_PLATFORM_IP6_ROUTE_CHANGED, ifindex, &route); g_signal_emit_by_name (platform, NM_PLATFORM_IP6_ROUTE_CHANGED, ifindex, &route, NM_PLATFORM_REASON_INTERNAL);
return TRUE; return TRUE;
} }
g_array_append_val (priv->ip6_routes, route); g_array_append_val (priv->ip6_routes, route);
g_signal_emit_by_name (platform, NM_PLATFORM_IP6_ROUTE_ADDED, ifindex, &route); g_signal_emit_by_name (platform, NM_PLATFORM_IP6_ROUTE_ADDED, ifindex, &route, NM_PLATFORM_REASON_INTERNAL);
return TRUE; return TRUE;
} }
@@ -1057,7 +1057,7 @@ ip4_route_delete (NMPlatform *platform, int ifindex, in_addr_t network, int plen
memcpy (&deleted_route, route, sizeof (deleted_route)); memcpy (&deleted_route, route, sizeof (deleted_route));
memset (route, 0, sizeof (*route)); memset (route, 0, sizeof (*route));
g_signal_emit_by_name (platform, NM_PLATFORM_IP4_ROUTE_REMOVED, ifindex, &deleted_route); g_signal_emit_by_name (platform, NM_PLATFORM_IP4_ROUTE_REMOVED, ifindex, &deleted_route, NM_PLATFORM_REASON_INTERNAL);
return TRUE; return TRUE;
} }
@@ -1072,7 +1072,7 @@ ip6_route_delete (NMPlatform *platform, int ifindex, struct in6_addr network, in
memcpy (&deleted_route, route, sizeof (deleted_route)); memcpy (&deleted_route, route, sizeof (deleted_route));
memset (route, 0, sizeof (*route)); memset (route, 0, sizeof (*route));
g_signal_emit_by_name (platform, NM_PLATFORM_IP6_ROUTE_REMOVED, ifindex, &deleted_route); g_signal_emit_by_name (platform, NM_PLATFORM_IP6_ROUTE_REMOVED, ifindex, &deleted_route, NM_PLATFORM_REASON_INTERNAL);
return TRUE; return TRUE;
} }

View File

@@ -760,7 +760,7 @@ object_has_ifindex (struct nl_object *object, int ifindex)
} }
} }
static gboolean refresh_object (NMPlatform *platform, struct nl_object *object, gboolean removed); static gboolean refresh_object (NMPlatform *platform, struct nl_object *object, gboolean removed, NMPlatformReason reason);
static void static void
check_cache_items (NMPlatform *platform, struct nl_cache *cache, int ifindex) check_cache_items (NMPlatform *platform, struct nl_cache *cache, int ifindex)
@@ -772,12 +772,12 @@ check_cache_items (NMPlatform *platform, struct nl_cache *cache, int ifindex)
debug ("cache %p object %p", cloned_cache, object); debug ("cache %p object %p", cloned_cache, object);
g_assert (nl_object_get_cache (object) == cloned_cache); g_assert (nl_object_get_cache (object) == cloned_cache);
if (object_has_ifindex (object, ifindex)) if (object_has_ifindex (object, ifindex))
refresh_object (platform, object, TRUE); refresh_object (platform, object, TRUE, NM_PLATFORM_REASON_CACHE_CHECK);
} }
} }
static void static void
announce_object (NMPlatform *platform, const struct nl_object *object, ObjectStatus status) announce_object (NMPlatform *platform, const struct nl_object *object, ObjectStatus status, NMPlatformReason reason)
{ {
NMLinuxPlatformPrivate *priv = NM_LINUX_PLATFORM_GET_PRIVATE (platform); NMLinuxPlatformPrivate *priv = NM_LINUX_PLATFORM_GET_PRIVATE (platform);
ObjectType object_type = object_type_from_nl_object (object); ObjectType object_type = object_type_from_nl_object (object);
@@ -825,7 +825,7 @@ announce_object (NMPlatform *platform, const struct nl_object *object, ObjectSta
break; break;
} }
g_signal_emit_by_name (platform, sig, device.ifindex, &device); g_signal_emit_by_name (platform, sig, device.ifindex, &device, reason);
} }
return; return;
case IP4_ADDRESS: case IP4_ADDRESS:
@@ -845,7 +845,7 @@ announce_object (NMPlatform *platform, const struct nl_object *object, ObjectSta
break; break;
} }
g_signal_emit_by_name (platform, sig, address.ifindex, &address); g_signal_emit_by_name (platform, sig, address.ifindex, &address, reason);
} }
return; return;
case IP6_ADDRESS: case IP6_ADDRESS:
@@ -853,7 +853,7 @@ announce_object (NMPlatform *platform, const struct nl_object *object, ObjectSta
NMPlatformIP6Address address; NMPlatformIP6Address address;
init_ip6_address (&address, (struct rtnl_addr *) object); init_ip6_address (&address, (struct rtnl_addr *) object);
g_signal_emit_by_name (platform, sig, address.ifindex, &address); g_signal_emit_by_name (platform, sig, address.ifindex, &address, reason);
} }
return; return;
case IP4_ROUTE: case IP4_ROUTE:
@@ -861,7 +861,7 @@ announce_object (NMPlatform *platform, const struct nl_object *object, ObjectSta
NMPlatformIP4Route route; NMPlatformIP4Route route;
init_ip4_route (&route, (struct rtnl_route *) object); init_ip4_route (&route, (struct rtnl_route *) object);
g_signal_emit_by_name (platform, sig, route.ifindex, &route); g_signal_emit_by_name (platform, sig, route.ifindex, &route, reason);
} }
return; return;
case IP6_ROUTE: case IP6_ROUTE:
@@ -869,7 +869,7 @@ announce_object (NMPlatform *platform, const struct nl_object *object, ObjectSta
NMPlatformIP6Route route; NMPlatformIP6Route route;
init_ip6_route (&route, (struct rtnl_route *) object); init_ip6_route (&route, (struct rtnl_route *) object);
g_signal_emit_by_name (platform, sig, route.ifindex, &route); g_signal_emit_by_name (platform, sig, route.ifindex, &route, reason);
} }
return; return;
default: default:
@@ -880,7 +880,7 @@ announce_object (NMPlatform *platform, const struct nl_object *object, ObjectSta
static struct nl_object * build_rtnl_link (int ifindex, const char *name, NMLinkType type); static struct nl_object * build_rtnl_link (int ifindex, const char *name, NMLinkType type);
static gboolean static gboolean
refresh_object (NMPlatform *platform, struct nl_object *object, gboolean removed) refresh_object (NMPlatform *platform, struct nl_object *object, gboolean removed, NMPlatformReason reason)
{ {
NMLinuxPlatformPrivate *priv = NM_LINUX_PLATFORM_GET_PRIVATE (platform); NMLinuxPlatformPrivate *priv = NM_LINUX_PLATFORM_GET_PRIVATE (platform);
auto_nl_object struct nl_object *cached_object = NULL; auto_nl_object struct nl_object *cached_object = NULL;
@@ -900,7 +900,7 @@ refresh_object (NMPlatform *platform, struct nl_object *object, gboolean removed
if (cached_object) { if (cached_object) {
nl_cache_remove (cached_object); nl_cache_remove (cached_object);
announce_object (platform, cached_object, REMOVED); announce_object (platform, cached_object, REMOVED, reason);
} }
} else { } else {
g_return_val_if_fail (kernel_object, FALSE); g_return_val_if_fail (kernel_object, FALSE);
@@ -912,7 +912,7 @@ refresh_object (NMPlatform *platform, struct nl_object *object, gboolean removed
nle = nl_cache_add (cache, kernel_object); nle = nl_cache_add (cache, kernel_object);
g_return_val_if_fail (!nle, FALSE); g_return_val_if_fail (!nle, FALSE);
announce_object (platform, kernel_object, cached_object ? CHANGED : ADDED); announce_object (platform, kernel_object, cached_object ? CHANGED : ADDED, reason);
/* Refresh the master device (even on enslave/release) */ /* Refresh the master device (even on enslave/release) */
if (object_type_from_nl_object (kernel_object) == LINK) { if (object_type_from_nl_object (kernel_object) == LINK) {
@@ -922,12 +922,12 @@ refresh_object (NMPlatform *platform, struct nl_object *object, gboolean removed
if (kernel_master) { if (kernel_master) {
master_object = build_rtnl_link (kernel_master, NULL, NM_LINK_TYPE_NONE); master_object = build_rtnl_link (kernel_master, NULL, NM_LINK_TYPE_NONE);
refresh_object (platform, master_object, FALSE); refresh_object (platform, master_object, FALSE, NM_PLATFORM_REASON_INTERNAL);
nl_object_put (master_object); nl_object_put (master_object);
} }
if (cached_master && cached_master != kernel_master) { if (cached_master && cached_master != kernel_master) {
master_object = build_rtnl_link (cached_master, NULL, NM_LINK_TYPE_NONE); master_object = build_rtnl_link (cached_master, NULL, NM_LINK_TYPE_NONE);
refresh_object (platform, master_object, FALSE); refresh_object (platform, master_object, FALSE, NM_PLATFORM_REASON_INTERNAL);
nl_object_put (master_object); nl_object_put (master_object);
} }
} }
@@ -959,7 +959,7 @@ add_object (NMPlatform *platform, struct nl_object *obj)
return FALSE; return FALSE;
} }
return refresh_object (platform, object, FALSE); return refresh_object (platform, object, FALSE, NM_PLATFORM_REASON_INTERNAL);
} }
/* Decreases the reference count if @obj for convenience */ /* Decreases the reference count if @obj for convenience */
@@ -992,7 +992,7 @@ delete_object (NMPlatform *platform, struct nl_object *obj)
return FALSE; return FALSE;
} }
refresh_object (platform, object, TRUE); refresh_object (platform, object, TRUE, NM_PLATFORM_REASON_INTERNAL);
return TRUE; return TRUE;
} }
@@ -1063,7 +1063,7 @@ event_notification (struct nl_msg *msg, gpointer user_data)
if (!g_hash_table_lookup (priv->udev_devices, GINT_TO_POINTER (ifindex))) if (!g_hash_table_lookup (priv->udev_devices, GINT_TO_POINTER (ifindex)))
return NL_OK; return NL_OK;
} }
announce_object (platform, cached_object, REMOVED); announce_object (platform, cached_object, REMOVED, NM_PLATFORM_REASON_EXTERNAL);
return NL_OK; return NL_OK;
case RTM_NEWLINK: case RTM_NEWLINK:
@@ -1084,7 +1084,7 @@ event_notification (struct nl_msg *msg, gpointer user_data)
error ("netlink cache error: %s", nl_geterror (nle)); error ("netlink cache error: %s", nl_geterror (nle));
return NL_OK; return NL_OK;
} }
announce_object (platform, kernel_object, ADDED); announce_object (platform, kernel_object, ADDED, NM_PLATFORM_REASON_EXTERNAL);
return NL_OK; return NL_OK;
} }
/* Ignore non-change /* Ignore non-change
@@ -1101,7 +1101,7 @@ event_notification (struct nl_msg *msg, gpointer user_data)
error ("netlink cache error: %s", nl_geterror (nle)); error ("netlink cache error: %s", nl_geterror (nle));
return NL_OK; return NL_OK;
} }
announce_object (platform, kernel_object, CHANGED); announce_object (platform, kernel_object, CHANGED, NM_PLATFORM_REASON_EXTERNAL);
return NL_OK; return NL_OK;
default: default:
@@ -1286,7 +1286,7 @@ link_change (NMPlatform *platform, int ifindex, struct rtnl_link *change)
return FALSE; return FALSE;
} }
return refresh_object (platform, (struct nl_object *) rtnllink, FALSE); return refresh_object (platform, (struct nl_object *) rtnllink, FALSE, NM_PLATFORM_REASON_INTERNAL);
} }
static gboolean static gboolean
@@ -2397,7 +2397,7 @@ udev_device_added (NMPlatform *platform,
return; return;
} }
announce_object (platform, (struct nl_object *) rtnllink, ADDED); announce_object (platform, (struct nl_object *) rtnllink, ADDED, NM_PLATFORM_REASON_EXTERNAL);
} }
static void static void
@@ -2431,7 +2431,7 @@ udev_device_removed (NMPlatform *platform,
auto_nl_object struct rtnl_link *device = rtnl_link_get (priv->link_cache, ifindex); auto_nl_object struct rtnl_link *device = rtnl_link_get (priv->link_cache, ifindex);
if (device) if (device)
announce_object (platform, (struct nl_object *) device, REMOVED); announce_object (platform, (struct nl_object *) device, REMOVED, NM_PLATFORM_REASON_EXTERNAL);
} }
} }

View File

@@ -27,6 +27,7 @@
#include "nm-platform.h" #include "nm-platform.h"
#include "nm-logging.h" #include "nm-logging.h"
#include "nm-enum-types.h"
#define debug(...) nm_log_dbg (LOGD_PLATFORM, __VA_ARGS__) #define debug(...) nm_log_dbg (LOGD_PLATFORM, __VA_ARGS__)
@@ -1734,7 +1735,7 @@ nm_platform_init (NMPlatform *object)
G_SIGNAL_RUN_FIRST, \ G_SIGNAL_RUN_FIRST, \
G_CALLBACK (method), \ G_CALLBACK (method), \
NULL, NULL, NULL, \ NULL, NULL, NULL, \
G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_POINTER); \ G_TYPE_NONE, 3, G_TYPE_INT, G_TYPE_POINTER, NM_TYPE_PLATFORM_REASON);
static void static void
nm_platform_class_init (NMPlatformClass *platform_class) nm_platform_class_init (NMPlatformClass *platform_class)

View File

@@ -49,6 +49,16 @@ typedef enum {
NM_PLATFORM_ERROR_NO_FIRMWARE NM_PLATFORM_ERROR_NO_FIRMWARE
} NMPlatformError; } NMPlatformError;
typedef enum {
NM_PLATFORM_REASON_NONE,
/* Event was requested by NetworkManager. */
NM_PLATFORM_REASON_INTERNAL,
/* Event came from the kernel. */
NM_PLATFORM_REASON_EXTERNAL,
/* Event is a result of cache checking and cleanups. */
NM_PLATFORM_REASON_CACHE_CHECK
} NMPlatformReason;
typedef enum { typedef enum {
/* Please don't interpret type numbers outside nm-platform and use functions /* Please don't interpret type numbers outside nm-platform and use functions
* like nm_platform_link_is_software() and nm_platform_supports_slaves(). * like nm_platform_link_is_software() and nm_platform_supports_slaves().

View File

@@ -7,7 +7,7 @@
#define IP6_PLEN 64 #define IP6_PLEN 64
static void static void
ip4_address_callback (NMPlatform *platform, int ifindex, NMPlatformIP4Address *received, SignalData *data) ip4_address_callback (NMPlatform *platform, int ifindex, NMPlatformIP4Address *received, NMPlatformReason reason, SignalData *data)
{ {
g_assert (received); g_assert (received);
g_assert_cmpint (received->ifindex, ==, ifindex); g_assert_cmpint (received->ifindex, ==, ifindex);
@@ -25,7 +25,7 @@ ip4_address_callback (NMPlatform *platform, int ifindex, NMPlatformIP4Address *r
} }
static void static void
ip6_address_callback (NMPlatform *platform, int ifindex, NMPlatformIP6Address *received, SignalData *data) ip6_address_callback (NMPlatform *platform, int ifindex, NMPlatformIP6Address *received, NMPlatformReason reason, SignalData *data)
{ {
g_assert (received); g_assert (received);
g_assert_cmpint (received->ifindex, ==, ifindex); g_assert_cmpint (received->ifindex, ==, ifindex);

View File

@@ -48,7 +48,7 @@ free_signal (SignalData *data)
} }
void void
link_callback (NMPlatform *platform, int ifindex, NMPlatformLink *received, SignalData *data) link_callback (NMPlatform *platform, int ifindex, NMPlatformLink *received, NMPlatformReason reason, SignalData *data)
{ {
GArray *links; GArray *links;

View File

@@ -33,7 +33,7 @@ void accept_signal (SignalData *data);
void wait_signal (SignalData *data); void wait_signal (SignalData *data);
void free_signal (SignalData *data); void free_signal (SignalData *data);
void link_callback (NMPlatform *platform, int ifindex, NMPlatformLink *received, SignalData *data); void link_callback (NMPlatform *platform, int ifindex, NMPlatformLink *received, NMPlatformReason reason, SignalData *data);
void run_command (const char *format, ...); void run_command (const char *format, ...);

View File

@@ -3,7 +3,7 @@
#define DEVICE_NAME "nm-test-device" #define DEVICE_NAME "nm-test-device"
static void static void
ip4_route_callback (NMPlatform *platform, int ifindex, NMPlatformIP4Route *received, SignalData *data) ip4_route_callback (NMPlatform *platform, int ifindex, NMPlatformIP4Route *received, NMPlatformReason reason, SignalData *data)
{ {
g_assert (received); g_assert (received);
g_assert_cmpint (received->ifindex, ==, ifindex); g_assert_cmpint (received->ifindex, ==, ifindex);
@@ -21,7 +21,7 @@ ip4_route_callback (NMPlatform *platform, int ifindex, NMPlatformIP4Route *recei
} }
static void static void
ip6_route_callback (NMPlatform *platform, int ifindex, NMPlatformIP6Route *received, SignalData *data) ip6_route_callback (NMPlatform *platform, int ifindex, NMPlatformIP6Route *received, NMPlatformReason reason, SignalData *data)
{ {
g_assert (received); g_assert (received);
g_assert_cmpint (received->ifindex, ==, ifindex); g_assert_cmpint (received->ifindex, ==, ifindex);