Commit 2b72cc26 authored by Thomas Haller's avatar Thomas Haller

core/trivial: give names in src/nm-dispatcher.h header an "NM" prefix

Stuff defined in header files should have an NM prefix, although
this is a project-internal header.

Rename.
parent 9e60de87
......@@ -5238,7 +5238,7 @@ dhcp4_lease_change (NMDevice *self, NMIP4Config *config)
}
/* Notify dispatcher scripts of new DHCP4 config */
nm_dispatcher_call (DISPATCHER_ACTION_DHCP4_CHANGE,
nm_dispatcher_call (NM_DISPATCHER_ACTION_DHCP4_CHANGE,
nm_device_get_settings_connection (self),
nm_device_get_applied_connection (self),
self,
......@@ -6006,7 +6006,7 @@ dhcp6_lease_change (NMDevice *self)
}
/* Notify dispatcher scripts of new DHCPv6 config */
nm_dispatcher_call (DISPATCHER_ACTION_DHCP6_CHANGE,
nm_dispatcher_call (NM_DISPATCHER_ACTION_DHCP6_CHANGE,
settings_connection,
nm_device_get_applied_connection (self),
self, NULL, NULL, NULL);
......@@ -7947,7 +7947,7 @@ activate_stage5_ip4_config_commit (NMDevice *self)
&& nm_device_activate_ip4_state_in_conf (self)
&& (nm_device_get_state (self) > NM_DEVICE_STATE_IP_CONFIG)) {
/* Notify dispatcher scripts of new DHCP4 config */
nm_dispatcher_call (DISPATCHER_ACTION_DHCP4_CHANGE,
nm_dispatcher_call (NM_DISPATCHER_ACTION_DHCP4_CHANGE,
nm_device_get_settings_connection (self),
nm_device_get_applied_connection (self),
self,
......@@ -8082,7 +8082,7 @@ activate_stage5_ip6_config_commit (NMDevice *self)
/* If IPv6 wasn't the first IP to complete, and DHCP was used,
* then ensure dispatcher scripts get the DHCP lease information.
*/
nm_dispatcher_call (DISPATCHER_ACTION_DHCP6_CHANGE,
nm_dispatcher_call (NM_DISPATCHER_ACTION_DHCP6_CHANGE,
nm_device_get_settings_connection (self),
nm_device_get_applied_connection (self),
self,
......@@ -9617,7 +9617,7 @@ ip_check_pre_up (NMDevice *self)
priv->dispatcher.post_state = NM_DEVICE_STATE_SECONDARIES;
priv->dispatcher.post_state_reason = NM_DEVICE_STATE_REASON_NONE;
if (!nm_dispatcher_call (DISPATCHER_ACTION_PRE_UP,
if (!nm_dispatcher_call (NM_DISPATCHER_ACTION_PRE_UP,
nm_device_get_settings_connection (self),
nm_device_get_applied_connection (self),
self,
......@@ -12139,14 +12139,14 @@ _set_state_full (NMDevice *self,
priv->ignore_carrier = nm_config_data_get_ignore_carrier (NM_CONFIG_GET_DATA, self);
if (quitting) {
nm_dispatcher_call_sync (DISPATCHER_ACTION_PRE_DOWN,
nm_dispatcher_call_sync (NM_DISPATCHER_ACTION_PRE_DOWN,
nm_act_request_get_settings_connection (req),
nm_act_request_get_applied_connection (req),
self);
} else {
priv->dispatcher.post_state = NM_DEVICE_STATE_DISCONNECTED;
priv->dispatcher.post_state_reason = reason;
if (!nm_dispatcher_call (DISPATCHER_ACTION_PRE_DOWN,
if (!nm_dispatcher_call (NM_DISPATCHER_ACTION_PRE_DOWN,
nm_act_request_get_settings_connection (req),
nm_act_request_get_applied_connection (req),
self,
......@@ -12179,7 +12179,7 @@ _set_state_full (NMDevice *self,
case NM_DEVICE_STATE_ACTIVATED:
_LOGI (LOGD_DEVICE, "Activation: successful, device activated.");
nm_device_update_metered (self);
nm_dispatcher_call (DISPATCHER_ACTION_UP,
nm_dispatcher_call (NM_DISPATCHER_ACTION_UP,
nm_act_request_get_settings_connection (req),
nm_act_request_get_applied_connection (req),
self, NULL, NULL, NULL);
......@@ -12274,12 +12274,12 @@ _set_state_full (NMDevice *self,
if ( (old_state == NM_DEVICE_STATE_ACTIVATED || old_state == NM_DEVICE_STATE_DEACTIVATING)
&& (state != NM_DEVICE_STATE_DEACTIVATING)) {
if (quitting) {
nm_dispatcher_call_sync (DISPATCHER_ACTION_DOWN,
nm_dispatcher_call_sync (NM_DISPATCHER_ACTION_DOWN,
nm_act_request_get_settings_connection (req),
nm_act_request_get_applied_connection (req),
self);
} else {
nm_dispatcher_call (DISPATCHER_ACTION_DOWN,
nm_dispatcher_call (NM_DISPATCHER_ACTION_DOWN,
nm_act_request_get_settings_connection (req),
nm_act_request_get_applied_connection (req),
self, NULL, NULL, NULL);
......
......@@ -106,7 +106,7 @@ update_state (NMConnectivity *self, NMConnectivityState state)
_notify (self, PROP_STATE);
/* Notify dispatcher scripts of a connectivity state change */
nm_dispatcher_call_connectivity (DISPATCHER_ACTION_CONNECTIVITY_CHANGE, state);
nm_dispatcher_call_connectivity (NM_DISPATCHER_ACTION_CONNECTIVITY_CHANGE, state);
}
}
......
......@@ -70,14 +70,14 @@ static Monitor monitors[3] = {
};
static const Monitor*
_get_monitor_by_action (DispatcherAction action)
_get_monitor_by_action (NMDispatcherAction action)
{
switch (action) {
case DISPATCHER_ACTION_PRE_UP:
case DISPATCHER_ACTION_VPN_PRE_UP:
case NM_DISPATCHER_ACTION_PRE_UP:
case NM_DISPATCHER_ACTION_VPN_PRE_UP:
return &monitors[MONITOR_INDEX_PRE_UP];
case DISPATCHER_ACTION_PRE_DOWN:
case DISPATCHER_ACTION_VPN_PRE_DOWN:
case NM_DISPATCHER_ACTION_PRE_DOWN:
case NM_DISPATCHER_ACTION_VPN_PRE_DOWN:
return &monitors[MONITOR_INDEX_PRE_DOWN];
default:
return &monitors[MONITOR_INDEX_DEFAULT];
......@@ -311,9 +311,9 @@ fill_vpn_props (NMProxyConfig *proxy_config,
}
typedef struct {
DispatcherAction action;
NMDispatcherAction action;
guint request_id;
DispatcherFunc callback;
NMDispatcherFunc callback;
gpointer user_data;
guint idle_id;
} DispatchInfo;
......@@ -362,7 +362,7 @@ dispatch_result_to_string (DispatchResult result)
}
static void
dispatcher_results_process (guint request_id, DispatcherAction action, GVariantIter *results)
dispatcher_results_process (guint request_id, NMDispatcherAction action, GVariantIter *results)
{
const char *script, *err;
guint32 result;
......@@ -440,22 +440,22 @@ dispatcher_done_cb (GObject *proxy, GAsyncResult *result, gpointer user_data)
}
static const char *action_table[] = {
[DISPATCHER_ACTION_HOSTNAME] = NMD_ACTION_HOSTNAME,
[DISPATCHER_ACTION_PRE_UP] = NMD_ACTION_PRE_UP,
[DISPATCHER_ACTION_UP] = NMD_ACTION_UP,
[DISPATCHER_ACTION_PRE_DOWN] = NMD_ACTION_PRE_DOWN,
[DISPATCHER_ACTION_DOWN] = NMD_ACTION_DOWN,
[DISPATCHER_ACTION_VPN_PRE_UP] = NMD_ACTION_VPN_PRE_UP,
[DISPATCHER_ACTION_VPN_UP] = NMD_ACTION_VPN_UP,
[DISPATCHER_ACTION_VPN_PRE_DOWN] = NMD_ACTION_VPN_PRE_DOWN,
[DISPATCHER_ACTION_VPN_DOWN] = NMD_ACTION_VPN_DOWN,
[DISPATCHER_ACTION_DHCP4_CHANGE] = NMD_ACTION_DHCP4_CHANGE,
[DISPATCHER_ACTION_DHCP6_CHANGE] = NMD_ACTION_DHCP6_CHANGE,
[DISPATCHER_ACTION_CONNECTIVITY_CHANGE] = NMD_ACTION_CONNECTIVITY_CHANGE
[NM_DISPATCHER_ACTION_HOSTNAME] = NMD_ACTION_HOSTNAME,
[NM_DISPATCHER_ACTION_PRE_UP] = NMD_ACTION_PRE_UP,
[NM_DISPATCHER_ACTION_UP] = NMD_ACTION_UP,
[NM_DISPATCHER_ACTION_PRE_DOWN] = NMD_ACTION_PRE_DOWN,
[NM_DISPATCHER_ACTION_DOWN] = NMD_ACTION_DOWN,
[NM_DISPATCHER_ACTION_VPN_PRE_UP] = NMD_ACTION_VPN_PRE_UP,
[NM_DISPATCHER_ACTION_VPN_UP] = NMD_ACTION_VPN_UP,
[NM_DISPATCHER_ACTION_VPN_PRE_DOWN] = NMD_ACTION_VPN_PRE_DOWN,
[NM_DISPATCHER_ACTION_VPN_DOWN] = NMD_ACTION_VPN_DOWN,
[NM_DISPATCHER_ACTION_DHCP4_CHANGE] = NMD_ACTION_DHCP4_CHANGE,
[NM_DISPATCHER_ACTION_DHCP6_CHANGE] = NMD_ACTION_DHCP6_CHANGE,
[NM_DISPATCHER_ACTION_CONNECTIVITY_CHANGE] = NMD_ACTION_CONNECTIVITY_CHANGE
};
static const char *
action_to_string (DispatcherAction action)
action_to_string (NMDispatcherAction action)
{
g_assert ((gsize) action < G_N_ELEMENTS (action_table));
return action_table[action];
......@@ -474,7 +474,7 @@ dispatcher_idle_cb (gpointer user_data)
}
static gboolean
_dispatcher_call (DispatcherAction action,
_dispatcher_call (NMDispatcherAction action,
gboolean blocking,
NMSettingsConnection *settings_connection,
NMConnection *applied_connection,
......@@ -484,7 +484,7 @@ _dispatcher_call (DispatcherAction action,
NMProxyConfig *vpn_proxy_config,
NMIP4Config *vpn_ip4_config,
NMIP6Config *vpn_ip6_config,
DispatcherFunc callback,
NMDispatcherFunc callback,
gpointer user_data,
guint *out_call_id)
{
......@@ -517,8 +517,8 @@ _dispatcher_call (DispatcherAction action,
_ensure_requests ();
/* All actions except 'hostname' and 'connectivity-change' require a device */
if ( action == DISPATCHER_ACTION_HOSTNAME
|| action == DISPATCHER_ACTION_CONNECTIVITY_CHANGE) {
if ( action == NM_DISPATCHER_ACTION_HOSTNAME
|| action == NM_DISPATCHER_ACTION_CONNECTIVITY_CHANGE) {
_LOGD ("(%u) dispatching action '%s'%s",
reqid, action_to_string (action),
blocking
......@@ -589,8 +589,8 @@ _dispatcher_call (DispatcherAction action,
g_variant_builder_init (&vpn_ip6_props, G_VARIANT_TYPE_VARDICT);
/* hostname and connectivity-change actions don't send device data */
if ( action != DISPATCHER_ACTION_HOSTNAME
&& action != DISPATCHER_ACTION_CONNECTIVITY_CHANGE) {
if ( action != NM_DISPATCHER_ACTION_HOSTNAME
&& action != NM_DISPATCHER_ACTION_CONNECTIVITY_CHANGE) {
fill_device_props (device,
&device_props,
&device_proxy_props,
......@@ -695,7 +695,7 @@ done:
/**
* nm_dispatcher_call:
* @action: the %DispatcherAction
* @action: the %NMDispatcherAction
* @settings_connection: the #NMSettingsConnection the action applies to
* @applied_connection: the currently applied connection
* @device: the #NMDevice the action applies to
......@@ -710,11 +710,11 @@ done:
* Returns: %TRUE if the action was dispatched, %FALSE on failure
*/
gboolean
nm_dispatcher_call (DispatcherAction action,
nm_dispatcher_call (NMDispatcherAction action,
NMSettingsConnection *settings_connection,
NMConnection *applied_connection,
NMDevice *device,
DispatcherFunc callback,
NMDispatcherFunc callback,
gpointer user_data,
guint *out_call_id)
{
......@@ -725,7 +725,7 @@ nm_dispatcher_call (DispatcherAction action,
/**
* nm_dispatcher_call_sync():
* @action: the %DispatcherAction
* @action: the %NMDispatcherAction
* @settings_connection: the #NMSettingsConnection the action applies to
* @applied_connection: the currently applied connection
* @device: the #NMDevice the action applies to
......@@ -736,7 +736,7 @@ nm_dispatcher_call (DispatcherAction action,
* Returns: %TRUE if the action was dispatched, %FALSE on failure
*/
gboolean
nm_dispatcher_call_sync (DispatcherAction action,
nm_dispatcher_call_sync (NMDispatcherAction action,
NMSettingsConnection *settings_connection,
NMConnection *applied_connection,
NMDevice *device)
......@@ -747,7 +747,7 @@ nm_dispatcher_call_sync (DispatcherAction action,
/**
* nm_dispatcher_call_vpn():
* @action: the %DispatcherAction
* @action: the %NMDispatcherAction
* @settings_connection: the #NMSettingsConnection the action applies to
* @applied_connection: the currently applied connection
* @parent_device: the parent #NMDevice of the VPN connection
......@@ -766,7 +766,7 @@ nm_dispatcher_call_sync (DispatcherAction action,
* Returns: %TRUE if the action was dispatched, %FALSE on failure
*/
gboolean
nm_dispatcher_call_vpn (DispatcherAction action,
nm_dispatcher_call_vpn (NMDispatcherAction action,
NMSettingsConnection *settings_connection,
NMConnection *applied_connection,
NMDevice *parent_device,
......@@ -774,7 +774,7 @@ nm_dispatcher_call_vpn (DispatcherAction action,
NMProxyConfig *vpn_proxy_config,
NMIP4Config *vpn_ip4_config,
NMIP6Config *vpn_ip6_config,
DispatcherFunc callback,
NMDispatcherFunc callback,
gpointer user_data,
guint *out_call_id)
{
......@@ -785,7 +785,7 @@ nm_dispatcher_call_vpn (DispatcherAction action,
/**
* nm_dispatcher_call_vpn_sync():
* @action: the %DispatcherAction
* @action: the %NMDispatcherAction
* @settings_connection: the #NMSettingsConnection the action applies to
* @applied_connection: the currently applied connection
* @parent_device: the parent #NMDevice of the VPN connection
......@@ -800,7 +800,7 @@ nm_dispatcher_call_vpn (DispatcherAction action,
* Returns: %TRUE if the action was dispatched, %FALSE on failure
*/
gboolean
nm_dispatcher_call_vpn_sync (DispatcherAction action,
nm_dispatcher_call_vpn_sync (NMDispatcherAction action,
NMSettingsConnection *settings_connection,
NMConnection *applied_connection,
NMDevice *parent_device,
......@@ -816,7 +816,7 @@ nm_dispatcher_call_vpn_sync (DispatcherAction action,
/**
* nm_dispatcher_call_connectivity():
* @action: the %DispatcherAction
* @action: the %NMDispatcherAction
* @connectivity_state: the #NMConnectivityState value
*
* This method does not block the caller.
......@@ -824,7 +824,7 @@ nm_dispatcher_call_vpn_sync (DispatcherAction action,
* Returns: %TRUE if the action was dispatched, %FALSE on failure
*/
gboolean
nm_dispatcher_call_connectivity (DispatcherAction action,
nm_dispatcher_call_connectivity (NMDispatcherAction action,
NMConnectivityState connectivity_state)
{
return _dispatcher_call (action, FALSE, NULL, NULL, NULL, connectivity_state,
......
......@@ -19,44 +19,42 @@
* Copyright (C) 2005 - 2008 Novell, Inc.
*/
#ifndef __NETWORKMANAGER_DISPATCHER_H__
#define __NETWORKMANAGER_DISPATCHER_H__
#include <stdio.h>
#ifndef __NM_DISPATCHER_H__
#define __NM_DISPATCHER_H__
#include "nm-connection.h"
typedef enum {
DISPATCHER_ACTION_HOSTNAME,
DISPATCHER_ACTION_PRE_UP,
DISPATCHER_ACTION_UP,
DISPATCHER_ACTION_PRE_DOWN,
DISPATCHER_ACTION_DOWN,
DISPATCHER_ACTION_VPN_PRE_UP,
DISPATCHER_ACTION_VPN_UP,
DISPATCHER_ACTION_VPN_PRE_DOWN,
DISPATCHER_ACTION_VPN_DOWN,
DISPATCHER_ACTION_DHCP4_CHANGE,
DISPATCHER_ACTION_DHCP6_CHANGE,
DISPATCHER_ACTION_CONNECTIVITY_CHANGE
} DispatcherAction;
NM_DISPATCHER_ACTION_HOSTNAME,
NM_DISPATCHER_ACTION_PRE_UP,
NM_DISPATCHER_ACTION_UP,
NM_DISPATCHER_ACTION_PRE_DOWN,
NM_DISPATCHER_ACTION_DOWN,
NM_DISPATCHER_ACTION_VPN_PRE_UP,
NM_DISPATCHER_ACTION_VPN_UP,
NM_DISPATCHER_ACTION_VPN_PRE_DOWN,
NM_DISPATCHER_ACTION_VPN_DOWN,
NM_DISPATCHER_ACTION_DHCP4_CHANGE,
NM_DISPATCHER_ACTION_DHCP6_CHANGE,
NM_DISPATCHER_ACTION_CONNECTIVITY_CHANGE
} NMDispatcherAction;
typedef void (*DispatcherFunc) (guint call_id, gpointer user_data);
typedef void (*NMDispatcherFunc) (guint call_id, gpointer user_data);
gboolean nm_dispatcher_call (DispatcherAction action,
gboolean nm_dispatcher_call (NMDispatcherAction action,
NMSettingsConnection *settings_connection,
NMConnection *applied_connection,
NMDevice *device,
DispatcherFunc callback,
NMDispatcherFunc callback,
gpointer user_data,
guint *out_call_id);
gboolean nm_dispatcher_call_sync (DispatcherAction action,
gboolean nm_dispatcher_call_sync (NMDispatcherAction action,
NMSettingsConnection *settings_connection,
NMConnection *applied_connection,
NMDevice *device);
gboolean nm_dispatcher_call_vpn (DispatcherAction action,
gboolean nm_dispatcher_call_vpn (NMDispatcherAction action,
NMSettingsConnection *settings_connection,
NMConnection *applied_connection,
NMDevice *parent_device,
......@@ -64,11 +62,11 @@ gboolean nm_dispatcher_call_vpn (DispatcherAction action,
NMProxyConfig *vpn_proxy_config,
NMIP4Config *vpn_ip4_config,
NMIP6Config *vpn_ip6_config,
DispatcherFunc callback,
NMDispatcherFunc callback,
gpointer user_data,
guint *out_call_id);
gboolean nm_dispatcher_call_vpn_sync (DispatcherAction action,
gboolean nm_dispatcher_call_vpn_sync (NMDispatcherAction action,
NMSettingsConnection *settings_connection,
NMConnection *applied_connection,
NMDevice *parent_device,
......@@ -77,11 +75,11 @@ gboolean nm_dispatcher_call_vpn_sync (DispatcherAction action,
NMIP4Config *vpn_ip4_config,
NMIP6Config *vpn_ip6_config);
gboolean nm_dispatcher_call_connectivity (DispatcherAction action,
gboolean nm_dispatcher_call_connectivity (NMDispatcherAction action,
NMConnectivityState state);
void nm_dispatcher_call_cancel (guint call_id);
void nm_dispatcher_init (void);
#endif /* __NETWORKMANAGER_DISPATCHER_H__ */
#endif /* __NM_DISPATCHER_H__ */
......@@ -428,7 +428,7 @@ settings_set_hostname_cb (const char *hostname,
}
if (!ret)
nm_dispatcher_call (DISPATCHER_ACTION_HOSTNAME, NULL, NULL, NULL, NULL, NULL, NULL);
nm_dispatcher_call (NM_DISPATCHER_ACTION_HOSTNAME, NULL, NULL, NULL, NULL, NULL, NULL);
}
static void
......
......@@ -2143,7 +2143,7 @@ hostnamed_properties_changed (GDBusProxy *proxy,
g_free (priv->hostname.value);
priv->hostname.value = g_strdup (hostname);
_notify (self, PROP_HOSTNAME);
nm_dispatcher_call (DISPATCHER_ACTION_HOSTNAME, NULL, NULL, NULL, NULL, NULL, NULL);
nm_dispatcher_call (NM_DISPATCHER_ACTION_HOSTNAME, NULL, NULL, NULL, NULL, NULL, NULL);
}
g_variant_unref (v_hostname);
......
......@@ -535,7 +535,7 @@ _set_vpn_state (NMVpnConnection *self,
*/
break;
case STATE_PRE_UP:
if (!nm_dispatcher_call_vpn (DISPATCHER_ACTION_VPN_PRE_UP,
if (!nm_dispatcher_call_vpn (NM_DISPATCHER_ACTION_VPN_PRE_UP,
_get_settings_connection (self, FALSE),
_get_applied_connection (self),
parent_dev,
......@@ -555,7 +555,7 @@ _set_vpn_state (NMVpnConnection *self,
nm_active_connection_clear_secrets (NM_ACTIVE_CONNECTION (self));
/* Let dispatcher scripts know we're up and running */
nm_dispatcher_call_vpn (DISPATCHER_ACTION_VPN_UP,
nm_dispatcher_call_vpn (NM_DISPATCHER_ACTION_VPN_UP,
_get_settings_connection (self, FALSE),
_get_applied_connection (self),
parent_dev,
......@@ -577,7 +577,7 @@ _set_vpn_state (NMVpnConnection *self,
break;
case STATE_DEACTIVATING:
if (quitting) {
nm_dispatcher_call_vpn_sync (DISPATCHER_ACTION_VPN_PRE_DOWN,
nm_dispatcher_call_vpn_sync (NM_DISPATCHER_ACTION_VPN_PRE_DOWN,
_get_settings_connection (self, FALSE),
_get_applied_connection (self),
parent_dev,
......@@ -586,7 +586,7 @@ _set_vpn_state (NMVpnConnection *self,
priv->ip4_config,
priv->ip6_config);
} else {
if (!nm_dispatcher_call_vpn (DISPATCHER_ACTION_VPN_PRE_DOWN,
if (!nm_dispatcher_call_vpn (NM_DISPATCHER_ACTION_VPN_PRE_DOWN,
_get_settings_connection (self, FALSE),
_get_applied_connection (self),
parent_dev,
......@@ -611,7 +611,7 @@ _set_vpn_state (NMVpnConnection *self,
&& old_vpn_state <= STATE_DEACTIVATING) {
/* Let dispatcher scripts know we're about to go down */
if (quitting) {
nm_dispatcher_call_vpn_sync (DISPATCHER_ACTION_VPN_DOWN,
nm_dispatcher_call_vpn_sync (NM_DISPATCHER_ACTION_VPN_DOWN,
_get_settings_connection (self, FALSE),
_get_applied_connection (self),
parent_dev,
......@@ -620,7 +620,7 @@ _set_vpn_state (NMVpnConnection *self,
NULL,
NULL);
} else {
nm_dispatcher_call_vpn (DISPATCHER_ACTION_VPN_DOWN,
nm_dispatcher_call_vpn (NM_DISPATCHER_ACTION_VPN_DOWN,
_get_settings_connection (self, FALSE),
_get_applied_connection (self),
parent_dev,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment