#define NM_DISPATCHER_DBUS_PATH "/org/freedesktop/nm_dispatcher"
#define NMD_CONNECTION_PROPS_PATH "path"
+#define NMD_CONNECTION_PROPS_FILENAME "filename"
#define NMD_DEVICE_PROPS_INTERFACE "interface"
#define NMD_DEVICE_PROPS_IP_INTERFACE "ip-interface"
{
const char *iface = NULL, *ip_iface = NULL;
const char *uuid = NULL, *id = NULL, *path;
+ const char *filename = NULL;
NMDeviceState dev_state = NM_DEVICE_STATE_UNKNOWN;
GVariant *value;
char **envp = NULL, *path_item;
if (!strcmp (action, "hostname"))
goto done;
+ /* config filename */
+ if (g_variant_lookup (connection_props, NMD_CONNECTION_PROPS_FILENAME, "&s", &filename))
+ items = g_slist_prepend (items, g_strdup_printf ("CONNECTION_FILENAME=%s", filename));
+
/* Canonicalize the VPN interface name; "" is used when passing it through
* D-Bus so make sure that's fixed up here.
*/
PATH=
CONNECTION_UUID=3fd2a33a-d81b-423f-ae99-e6baba742311
CONNECTION_ID=Random Connection
+CONNECTION_FILENAME=/callouts/tests/dispatcher-old-down
DEVICE_IFACE=wlan0
DEVICE_IP_IFACE=wlan0
PATH=
CONNECTION_UUID=3fd2a33a-d81b-423f-ae99-e6baba742311
CONNECTION_ID=Random Connection
+CONNECTION_FILENAME=/callouts/tests/dispatcher-old-up
DEVICE_IFACE=wlan0
DEVICE_IP_IFACE=wlan0
IP4_ADDRESS_0=192.168.1.119/24 192.168.1.1
PATH=
CONNECTION_UUID=355653c0-34d3-4777-ad25-f9a498b7ef8e
CONNECTION_ID=Random Connection
+CONNECTION_FILENAME=/callouts/tests/dispatcher-old-vpn-down
DEVICE_IFACE=wlan0
DEVICE_IP_IFACE=tun0
IP4_ADDRESS_0=192.168.1.119/24 192.168.1.1
PATH=
CONNECTION_UUID=355653c0-34d3-4777-ad25-f9a498b7ef8e
CONNECTION_ID=Random Connection
+CONNECTION_FILENAME=/callouts/tests/dispatcher-old-vpn-up
DEVICE_IFACE=wlan0
DEVICE_IP_IFACE=tun0
IP4_ADDRESS_0=192.168.1.119/24 192.168.1.1
static gboolean
parse_main (GKeyFile *kf,
+ const char *filename,
GVariant **out_con_dict,
GVariant **out_con_props,
char **out_expected_iface,
g_variant_builder_add (&props, "{sv}",
"connection-path",
g_variant_new_object_path ("/org/freedesktop/NetworkManager/Connections/5"));
+ /* Strip out the non-fixed portion of the filename */
+ filename = strstr (filename, "/callouts");
+ g_variant_builder_add (&props, "{sv}",
+ "filename",
+ g_variant_new_string (filename));
*out_con_props = g_variant_builder_end (&props);
return TRUE;
return FALSE;
if (!parse_main (kf,
+ file,
out_con_dict,
out_con_props,
out_expected_iface,
The name (ID) of the connection profile.
</para></listitem>
</varlistentry>
+ <varlistentry>
+ <term><varname>CONNECTION_FILENAME</varname></term>
+ <listitem><para>
+ The backing file name of the connection profile (if any).
+ </para></listitem>
+ </varlistentry>
<varlistentry>
<term><varname>DEVICE_IFACE</varname></term>
<listitem><para>
#include "nm-dhcp6-config.h"
#include "nm-dbus-glib-types.h"
#include "nm-glib-compat.h"
+#include "nm-settings-connection.h"
#define CALL_TIMEOUT (1000 * 60 * 10) /* 10 minutes for all scripts */
if (connection) {
GVariant *connection_dict;
+ const char *filename;
connection_dict = nm_connection_to_dbus (connection, NM_CONNECTION_SERIALIZE_NO_SECRETS);
connection_hash = nm_utils_connection_dict_to_hash (connection_dict);
value_hash_add_object_path (connection_props,
NMD_CONNECTION_PROPS_PATH,
nm_connection_get_path (connection));
+ filename = nm_settings_connection_get_filename (NM_SETTINGS_CONNECTION (connection));
+ if (filename) {
+ value_hash_add_str (connection_props,
+ NMD_CONNECTION_PROPS_FILENAME,
+ filename);
+ }
} else {
connection_hash = value_hash_create ();
connection_props = value_hash_create ();