all: merge branch 'pre-gdbus-bgo622927'

Misc pre-gdbus-port stuff

https://bugzilla.gnome.org/show_bug.cgi?id=622927
This commit is contained in:
Dan Winship 2015-07-24 13:25:55 -04:00
commit 232d045c2e
396 changed files with 1991 additions and 2400 deletions

View file

@ -22,7 +22,6 @@
#include <string.h>
#include <glib-object.h>
#include <nm-dbus-interface.h>
#include <nm-connection.h>
@ -30,6 +29,7 @@
#include <nm-setting-ip6-config.h>
#include <nm-setting-connection.h>
#include "nm-glib.h"
#include "nm-dispatcher-api.h"
#include "nm-utils.h"

View file

@ -21,7 +21,7 @@
#ifndef __NETWORKMANAGER_DISPATCHER_UTILS_H__
#define __NETWORKMANAGER_DISPATCHER_UTILS_H__
#include <glib.h>
#include "nm-glib.h"
char **
nm_dispatcher_utils_construct_envp (const char *action,

View file

@ -32,13 +32,11 @@
#include <errno.h>
#include <arpa/inet.h>
#include <glib.h>
#include <glib-unix.h>
#include "nm-glib.h"
#include "nm-dispatcher-api.h"
#include "nm-dispatcher-utils.h"
#include "nm-glib-compat.h"
#include "nmdbus-dispatcher.h"

View file

@ -23,9 +23,8 @@
#include <arpa/inet.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <glib-object.h>
#include "nm-glib.h"
#include "nm-core-internal.h"
#include "nm-dispatcher-utils.h"
#include "nm-dispatcher-api.h"

View file

@ -21,7 +21,6 @@
#include "config.h"
#include <glib.h>
#include <glib/gi18n.h>
#include <stdio.h>
#include <stdlib.h>
@ -30,6 +29,7 @@
#include <readline/readline.h>
#include <readline/history.h>
#include "nm-glib.h"
#include "common.h"
#include "utils.h"
#include "nm-secret-agent-simple.h"

View file

@ -21,7 +21,6 @@
#include "config.h"
#include <glib.h>
#include <glib/gi18n.h>
#include <stdio.h>
#include <stdlib.h>
@ -30,8 +29,7 @@
#include <readline/readline.h>
#include <readline/history.h>
#include "nm-glib-compat.h"
#include "nm-glib.h"
#include "common.h"
#include "utils.h"

View file

@ -19,7 +19,6 @@
#include "config.h"
#include <glib.h>
#include <glib/gi18n.h>
#include <stdio.h>
#include <string.h>
@ -31,6 +30,7 @@
#include <readline/readline.h>
#include <readline/history.h>
#include "nm-glib.h"
#include "gsystem-local-alloc.h"
#include "utils.h"
#include "common.h"

View file

@ -25,9 +25,9 @@
#include <errno.h>
#include <readline/readline.h>
#include <glib.h>
#include <glib/gi18n.h>
#include "nm-glib.h"
#include "nm-secret-agent-simple.h"
#include "polkit-agent.h"
#include "utils.h"

View file

@ -22,14 +22,13 @@
#include <string.h>
#include <stdlib.h>
#include <glib.h>
#include <glib/gi18n.h>
#include "nm-glib.h"
#include "polkit-agent.h"
#include "utils.h"
#include "general.h"
/* Available fields for 'general status' */
static NmcOutputField nmc_fields_nm_status[] = {
{"RUNNING", N_("RUNNING"), 15}, /* 0 */

View file

@ -33,12 +33,11 @@
#include <readline/readline.h>
#include <readline/history.h>
#include <glib.h>
#include <glib/gi18n.h>
#include "nm-glib.h"
#include "polkit-agent.h"
#include "nmcli.h"
#include "nm-glib-compat.h"
#include "utils.h"
#include "common.h"
#include "connections.h"

View file

@ -27,9 +27,9 @@
#include <unistd.h>
#include <termios.h>
#include <glib.h>
#include <glib/gi18n-lib.h>
#include "nm-glib.h"
#include "polkit-agent.h"
#include "nm-polkit-listener.h"
#include "common.h"
@ -142,7 +142,7 @@ nmc_start_polkit_agent_start_try (NmCli *nmc)
#else
/* polkit agent is not avalable; implement stub functions. */
#include <glib.h>
#include "nm-glib.h"
#include "nmcli.h"
#include "polkit-agent.h"

View file

@ -22,13 +22,12 @@
#include <stdlib.h>
#include <arpa/inet.h>
#include <glib.h>
#include <glib/gi18n.h>
#include "nm-glib.h"
#include "utils.h"
#include "common.h"
#include "settings.h"
#include "nm-glib-compat.h"
#include "nm-macros-internal.h"
#include "gsystem-local-alloc.h"

View file

@ -29,9 +29,9 @@
#include <netinet/in.h>
#include <arpa/inet.h>
#include <glib.h>
#include <glib/gi18n.h>
#include "nm-glib.h"
#include "utils.h"
int

View file

@ -36,10 +36,9 @@
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <glib.h>
#include <glib/gi18n-lib.h>
#include "nm-glib-compat.h"
#include "nm-glib.h"
#include "nm-polkit-listener.h"
G_DEFINE_TYPE (NMPolkitListener, nm_polkit_listener, POLKIT_AGENT_TYPE_LISTENER)

View file

@ -19,11 +19,11 @@
#ifndef __NM_POLKIT_LISTENER_H__
#define __NM_POLKIT_LISTENER_H__
#include <glib.h>
#define POLKIT_AGENT_I_KNOW_API_IS_SUBJECT_TO_CHANGE
#include <polkitagent/polkitagent.h>
#include "nm-glib.h"
G_BEGIN_DECLS
#define NM_TYPE_POLKIT_LISTENER (nm_polkit_listener_get_type ())

View file

@ -41,7 +41,8 @@
#include <glib/gi18n.h>
#include <NetworkManager.h>
#include "nm-glib-compat.h"
#include "nm-glib.h"
#define PROGRESS_STEPS 15
#define WAIT_STARTUP_TAG "wait-startup"

View file

@ -19,9 +19,9 @@
#ifndef NMT_NEWT_TYPES_H
#define NMT_NEWT_TYPES_H
#include <glib-object.h>
#include <newt.h>
#include "nm-glib-compat.h"
#include "nm-glib.h"
G_BEGIN_DECLS

View file

@ -30,7 +30,7 @@
#include <glib/gi18n-lib.h>
#include "nm-glib-compat.h"
#include "nm-glib.h"
#include "nmt-newt-utils.h"
static void

View file

@ -20,7 +20,8 @@
#define NMT_NEWT_UTILS_H
#include <newt.h>
#include <glib.h>
#include "nm-glib.h"
G_BEGIN_DECLS

View file

@ -33,7 +33,6 @@
#include <string.h>
#include "nm-editor-bindings.h"
#include "nm-gvaluearray-compat.h"
static void
value_transform_string_int (const GValue *src_value,

View file

@ -27,10 +27,10 @@
#include "nmt-editor.h"
#include <glib.h>
#include <glib/gi18n-lib.h>
#include <nm-utils.h>
#include "nm-glib.h"
#include "nmtui.h"
#include "nm-editor-utils.h"

View file

@ -19,6 +19,7 @@
#ifndef NMT_MAC_ENTRY_H
#define NMT_MAC_ENTRY_H
#include "nm-glib.h"
#include "nm-utils.h"
#include "nmt-newt.h"

View file

@ -27,9 +27,9 @@
#include "config.h"
#include <glib.h>
#include <glib/gi18n-lib.h>
#include "nm-glib.h"
#include "nmt-page-bond.h"
#include "nmt-address-list.h"

View file

@ -23,9 +23,9 @@
#include "config.h"
#include <glib.h>
#include <glib/gi18n-lib.h>
#include "nm-glib.h"
#include "nmt-page-bridge-port.h"
G_DEFINE_TYPE (NmtPageBridgePort, nmt_page_bridge_port, NMT_TYPE_EDITOR_PAGE)

View file

@ -23,9 +23,9 @@
#include "config.h"
#include <glib.h>
#include <glib/gi18n-lib.h>
#include "nm-glib.h"
#include "nmt-page-bridge.h"
#include "nmt-address-list.h"

View file

@ -23,9 +23,9 @@
#include "config.h"
#include <glib.h>
#include <glib/gi18n-lib.h>
#include "nm-glib.h"
#include "nmt-page-dsl.h"
#include "nmt-page-ethernet.h"
#include "nmt-page-ppp.h"

View file

@ -19,6 +19,7 @@
#ifndef NMT_PAGE_DSL_H
#define NMT_PAGE_DSL_H
#include "nm-glib.h"
#include "nmt-editor-page-device.h"
G_BEGIN_DECLS

View file

@ -23,9 +23,9 @@
#include "config.h"
#include <glib.h>
#include <glib/gi18n-lib.h>
#include "nm-glib.h"
#include "nmt-page-ethernet.h"
#include "nmt-mac-entry.h"
#include "nmt-mtu-entry.h"

View file

@ -23,9 +23,9 @@
#include "config.h"
#include <glib.h>
#include <glib/gi18n-lib.h>
#include "nm-glib.h"
#include "nmt-page-infiniband.h"
#include "nmt-mtu-entry.h"

View file

@ -25,9 +25,9 @@
#include <stdlib.h>
#include <glib.h>
#include <glib/gi18n-lib.h>
#include "nm-glib.h"
#include "nmt-page-ip4.h"
#include "nmt-ip-entry.h"
#include "nmt-address-list.h"

View file

@ -25,9 +25,9 @@
#include <stdlib.h>
#include <glib.h>
#include <glib/gi18n-lib.h>
#include "nm-glib.h"
#include "nmt-page-ip6.h"
#include "nmt-ip-entry.h"
#include "nmt-address-list.h"

View file

@ -25,9 +25,9 @@
#include <stdlib.h>
#include <glib.h>
#include <glib/gi18n-lib.h>
#include "nm-glib.h"
#include "nmt-page-ppp.h"
#include "nmt-newt-section.h"
#include "nmt-newt-separator.h"

View file

@ -23,9 +23,9 @@
#include "config.h"
#include <glib.h>
#include <glib/gi18n-lib.h>
#include "nm-glib.h"
#include "nmt-page-team-port.h"
G_DEFINE_TYPE (NmtPageTeamPort, nmt_page_team_port, NMT_TYPE_EDITOR_PAGE)

View file

@ -23,9 +23,9 @@
#include "config.h"
#include <glib.h>
#include <glib/gi18n-lib.h>
#include "nm-glib.h"
#include "nmt-page-team.h"
#include "nmt-slave-list.h"

View file

@ -19,6 +19,7 @@
#ifndef NMT_PAGE_TEAM_H
#define NMT_PAGE_TEAM_H
#include "nm-glib.h"
#include "nmt-editor-page-device.h"
G_BEGIN_DECLS

View file

@ -23,9 +23,9 @@
#include "config.h"
#include <glib.h>
#include <glib/gi18n-lib.h>
#include "nm-glib.h"
#include "nm-editor-bindings.h"
#include "nmt-page-vlan.h"

View file

@ -29,9 +29,9 @@
#include <stdlib.h>
#include <glib.h>
#include <glib/gi18n-lib.h>
#include "nm-glib.h"
#include "nmt-page-wifi.h"
#include "nmt-mac-entry.h"
#include "nmt-mtu-entry.h"

View file

@ -27,9 +27,9 @@
#include "config.h"
#include <glib.h>
#include <glib/gi18n-lib.h>
#include "nm-glib.h"
#include "nmt-route-editor.h"
#include "nmt-route-table.h"

View file

@ -19,7 +19,7 @@
#ifndef NMT_UTILS_H
#define NMT_UTILS_H
#include <glib-object.h>
#include "nm-glib.h"
G_BEGIN_DECLS

View file

@ -30,11 +30,11 @@
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <glib/gi18n-lib.h>
#include <NetworkManager.h>
#include "nm-glib.h"
#include "nmt-newt.h"
#include "nm-editor-bindings.h"

View file

@ -31,7 +31,6 @@
#include "config.h"
#include <string.h>
#include <glib.h>
#include <gmodule.h>
#include <glib/gi18n.h>
@ -39,6 +38,7 @@
#include <nm-setting-connection.h>
#include <nm-setting-vpn.h>
#include "nm-glib.h"
#include "vpn-helpers.h"
#define NM_VPN_API_SUBJECT_TO_CHANGE

View file

@ -19,12 +19,13 @@
#ifndef _VPN_HELPERS_H_
#define _VPN_HELPERS_H_
#include <glib.h>
#include <nm-connection.h>
#define NM_VPN_API_SUBJECT_TO_CHANGE
#include <nm-vpn-plugin-ui-interface.h>
#include "nm-glib.h"
GHashTable *vpn_get_plugins (GError **error);
NMVpnPluginUiInterface *vpn_get_plugin_by_service (const char *service);

View file

@ -297,7 +297,7 @@ PKG_CHECK_MODULES(GLIB, [gio-unix-2.0 >= 2.37.6 gmodule-2.0],
dnl GLIB_VERSION_MIN_REQUIRED should match the version above.
dnl GLIB_VERSION_MAX_ALLOWED should be set to the same version;
dnl nm-glib-compat.h will cause it to be overridden for the functions
dnl nm-glib.h will cause it to be overridden for the functions
dnl we have compat versions of.
GLIB_CFLAGS="$GLIB_CFLAGS -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_32 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_32"

View file

@ -1,7 +1,8 @@
EXTRA_DIST = \
gsystem-local-alloc.h \
nm-dbus-compat.h \
nm-dbus-glib-types.h \
nm-glib-compat.h \
nm-glib.h \
nm-gvaluearray-compat.h \
nm-test-utils.h \
nm-macros-internal.h

74
include/nm-dbus-compat.h Normal file
View file

@ -0,0 +1,74 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/*
* 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 2015 Red Hat, Inc.
*/
#ifndef __NM_DBUS_COMPAT_H__
#define __NM_DBUS_COMPAT_H__
/* Copied from <dbus/dbus-shared.h> */
/* Bus names */
/** The bus name used to talk to the bus itself. */
#define DBUS_SERVICE_DBUS "org.freedesktop.DBus"
/* Paths */
/** The object path used to talk to the bus itself. */
#define DBUS_PATH_DBUS "/org/freedesktop/DBus"
/** The object path used in local/in-process-generated messages. */
#define DBUS_PATH_LOCAL "/org/freedesktop/DBus/Local"
/* Interfaces, these #define don't do much other than
* catch typos at compile time
*/
/** The interface exported by the object with #DBUS_SERVICE_DBUS and #DBUS_PATH_DBUS */
#define DBUS_INTERFACE_DBUS "org.freedesktop.DBus"
/** The interface supported by introspectable objects */
#define DBUS_INTERFACE_INTROSPECTABLE "org.freedesktop.DBus.Introspectable"
/** The interface supported by objects with properties */
#define DBUS_INTERFACE_PROPERTIES "org.freedesktop.DBus.Properties"
/** The interface supported by most dbus peers */
#define DBUS_INTERFACE_PEER "org.freedesktop.DBus.Peer"
/** This is a special interface whose methods can only be invoked
* by the local implementation (messages from remote apps aren't
* allowed to specify this interface).
*/
#define DBUS_INTERFACE_LOCAL "org.freedesktop.DBus.Local"
/* Owner flags */
#define DBUS_NAME_FLAG_ALLOW_REPLACEMENT 0x1 /**< Allow another service to become the primary owner if requested */
#define DBUS_NAME_FLAG_REPLACE_EXISTING 0x2 /**< Request to replace the current primary owner */
#define DBUS_NAME_FLAG_DO_NOT_QUEUE 0x4 /**< If we can not become the primary owner do not place us in the queue */
/* Replies to request for a name */
#define DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER 1 /**< Service has become the primary owner of the requested name */
#define DBUS_REQUEST_NAME_REPLY_IN_QUEUE 2 /**< Service could not become the primary owner and has been placed in the queue */
#define DBUS_REQUEST_NAME_REPLY_EXISTS 3 /**< Service is already in the queue */
#define DBUS_REQUEST_NAME_REPLY_ALREADY_OWNER 4 /**< Service is already the primary owner */
/* Replies to releasing a name */
#define DBUS_RELEASE_NAME_REPLY_RELEASED 1 /**< Service was released from the given name */
#define DBUS_RELEASE_NAME_REPLY_NON_EXISTENT 2 /**< The given name does not exist on the bus */
#define DBUS_RELEASE_NAME_REPLY_NOT_OWNER 3 /**< Service is not an owner of the given name */
/* Replies to service starts */
#define DBUS_START_REPLY_SUCCESS 1 /**< Service was auto started */
#define DBUS_START_REPLY_ALREADY_RUNNING 2 /**< Service was already running */
#endif /* __NM_DBUS_COMPAT_H__ */

View file

@ -17,15 +17,13 @@
* Copyright 2008 - 2011 Red Hat, Inc.
*/
#ifndef __NM_GLIB_COMPAT_H__
#define __NM_GLIB_COMPAT_H__
#ifndef __NM_GLIB_H__
#define __NM_GLIB_H__
#include <glib.h>
#include <glib-object.h>
#include <gio/gio.h>
#include <string.h>
#ifdef __clang__
#undef G_GNUC_BEGIN_IGNORE_DEPRECATIONS
@ -43,7 +41,6 @@
#include "nm-gvaluearray-compat.h"
static inline void
__g_type_ensure (GType type)
{
@ -261,4 +258,4 @@ _g_key_file_save_to_file (GKeyFile *key_file,
#endif
#endif /* __NM_GLIB_COMPAT_H__ */
#endif /* __NM_GLIB_H__ */

View file

@ -20,10 +20,6 @@
#ifndef __NM_GVALUEARRAY_COMPAT_H__
#define __NM_GVALUEARRAY_COMPAT_H__
#include <glib.h>
#include "nm-glib-compat.h"
#define g_value_array_get_type() \
G_GNUC_EXTENSION ({ \
G_GNUC_BEGIN_IGNORE_DEPRECATIONS \

View file

@ -22,8 +22,7 @@
#ifndef __NM_MACROS_INTERNAL_H__
#define __NM_MACROS_INTERNAL_H__
#include <glib.h>
#include "nm-glib.h"
/********************************************************/

View file

@ -86,14 +86,12 @@
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <glib.h>
#include <glib-object.h>
#include <string.h>
#include <errno.h>
#include "nm-glib.h"
#include "nm-utils.h"
#include "nm-macros-internal.h"
#include "nm-glib-compat.h"
#include "gsystem-local-alloc.h"
#ifdef __NETWORKMANAGER_LOGGING_H__

View file

@ -17,6 +17,8 @@ nodist_libnmdbus_la_SOURCES = \
nmdbus-active-connection.h \
nmdbus-agent-manager.c \
nmdbus-agent-manager.h \
nmdbus-device-adsl.c \
nmdbus-device-adsl.h \
nmdbus-device-bond.c \
nmdbus-device-bond.h \
nmdbus-device-bridge.c \
@ -35,6 +37,12 @@ nodist_libnmdbus_la_SOURCES = \
nmdbus-device-infiniband.h \
nmdbus-device-macvlan.c \
nmdbus-device-macvlan.h \
nmdbus-device-modem.c \
nmdbus-device-modem.h \
nmdbus-device-olpc-mesh.c \
nmdbus-device-olpc-mesh.h \
nmdbus-device-team.c \
nmdbus-device-team.h \
nmdbus-device-tun.c \
nmdbus-device-tun.h \
nmdbus-device-veth.c \

View file

@ -2,6 +2,7 @@
<node name="/" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0">
<interface name="org.freedesktop.NetworkManager.Connection.Active">
<annotation name="org.gtk.GDBus.C.Name" value="ActiveConnection"/>
<tp:docstring>
Objects that implement the Connection.Active interface represent an attempt
to connect to a network using the details provided by a Connection object.

View file

@ -2,6 +2,7 @@
<node name="/" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0">
<interface name="org.freedesktop.NetworkManager.DHCP4Config">
<annotation name="org.gtk.GDBus.C.Name" value="Dhcp4Config"/>
<tp:docstring>
Options and configuration returned by the IPv4 DHCP server.
</tp:docstring>

View file

@ -2,6 +2,7 @@
<node name="/" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0">
<interface name="org.freedesktop.NetworkManager.DHCP6Config">
<annotation name="org.gtk.GDBus.C.Name" value="Dhcp6Config"/>
<tp:docstring>
Options and configuration returned by the IPv6 DHCP server.
</tp:docstring>

View file

@ -23,13 +23,13 @@
#include "config.h"
#include <glib.h>
#include <string.h>
#include <strings.h>
#include <unistd.h>
#include <stdlib.h>
#include <glib/gi18n-lib.h>
#include "nm-glib.h"
#include "crypto.h"
#include "nm-errors.h"

View file

@ -24,7 +24,7 @@
#ifndef __CRYPTO_H__
#define __CRYPTO_H__
#include <glib.h>
#include "nm-glib.h"
#define MD5_HASH_LEN 20
#define CIPHER_DES_EDE3_CBC "DES-EDE3-CBC"

View file

@ -23,7 +23,6 @@
#include "config.h"
#include <glib.h>
#include <glib/gi18n-lib.h>
#include <gnutls/gnutls.h>
@ -31,6 +30,7 @@
#include <gnutls/x509.h>
#include <gnutls/pkcs12.h>
#include "nm-glib.h"
#include "crypto.h"
#include "nm-errors.h"

View file

@ -23,7 +23,6 @@
#include "config.h"
#include <glib.h>
#include <glib/gi18n-lib.h>
#include <prinit.h>
@ -36,6 +35,7 @@
#include <ciferfam.h>
#include <p12plcy.h>
#include "nm-glib.h"
#include "crypto.h"
#include "nm-errors.h"

View file

@ -22,9 +22,9 @@
#include "config.h"
#include <glib-object.h>
#include <glib/gi18n-lib.h>
#include <string.h>
#include "nm-glib.h"
#include "nm-connection.h"
#include "nm-connection-private.h"
#include "nm-utils.h"

View file

@ -33,8 +33,8 @@
* and some test programs.
**/
#include <gio/gio.h>
#include "nm-glib.h"
#include "nm-connection.h"
#include "nm-core-enum-types.h"
#include "nm-dbus-interface.h"

View file

@ -21,10 +21,9 @@
#include "config.h"
#include <string.h>
#include <gio/gio.h>
#include <glib/gi18n-lib.h>
#include "nm-glib-compat.h"
#include "nm-glib.h"
#include "nm-core-internal.h"
typedef struct {

View file

@ -21,10 +21,9 @@
#include "config.h"
#include <string.h>
#include <gio/gio.h>
#include "nm-glib.h"
#include "nm-errors.h"
#include "nm-glib-compat.h"
#include "nm-dbus-interface.h"
#include "nm-vpn-dbus-interface.h"
#include "nm-core-internal.h"

View file

@ -22,13 +22,12 @@
#ifndef __NM_KEYFILE_INTERNAL_H__
#define __NM_KEYFILE_INTERNAL_H__
#include <glib.h>
#include <sys/types.h>
#include "nm-glib.h"
#include "nm-connection.h"
#include "nm-setting-8021x.h"
/*********************************************************/
#define NM_KEYFILE_CERT_SCHEME_PREFIX_BLOB "data:;base64,"

View file

@ -30,14 +30,13 @@
#include <string.h>
#include <glib/gi18n-lib.h>
#include "nm-glib.h"
#include "nm-core-internal.h"
#include "nm-macros-internal.h"
#include "gsystem-local-alloc.h"
#include "nm-glib-compat.h"
#include "nm-keyfile-internal.h"
#include "nm-keyfile-utils.h"
typedef struct {
NMConnection *connection;
GKeyFile *keyfile;

View file

@ -20,10 +20,10 @@
#include "config.h"
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include "nm-glib.h"
#include "gsystem-local-alloc.h"
#include "nm-keyfile-utils.h"
#include "nm-keyfile-internal.h"
@ -31,7 +31,6 @@
#include "nm-setting-wireless.h"
#include "nm-setting-wireless-security.h"
typedef struct {
const char *setting;
const char *alias;

View file

@ -30,6 +30,7 @@
#include <string.h>
#include <glib/gi18n-lib.h>
#include "nm-glib.h"
#include "nm-setting.h"
#include "nm-setting-connection.h"
#include "nm-setting-ip4-config.h"
@ -43,7 +44,6 @@
#include "nm-utils.h"
#include "gsystem-local-alloc.h"
#include "nm-glib-compat.h"
#include "nm-keyfile-internal.h"
#include "nm-keyfile-utils.h"

View file

@ -22,13 +22,12 @@
#include "config.h"
#include "nm-property-compare.h"
#include "nm-glib-compat.h"
#include <string.h>
#include <math.h>
#include <netinet/in.h>
#include <gio/gio.h>
#include "nm-property-compare.h"
#include "nm-glib.h"
static gint
_nm_property_compare_collection (GVariant *value1, GVariant *value2)

View file

@ -23,7 +23,7 @@
#ifndef __NM_PROPERTY_COMPARE_H__
#define __NM_PROPERTY_COMPARE_H__
#include <glib.h>
#include "nm-glib.h"
int nm_property_compare (GVariant *value1, GVariant *value2);

View file

@ -26,11 +26,11 @@
#include <arpa/inet.h>
#include <glib/gi18n-lib.h>
#include "nm-glib.h"
#include "nm-setting-ip-config.h"
#include "nm-setting-ip4-config.h"
#include "nm-setting-ip6-config.h"
#include "nm-utils.h"
#include "nm-glib-compat.h"
#include "nm-setting-private.h"
#include "nm-utils-private.h"

View file

@ -21,10 +21,10 @@
#ifndef __NM_SETTING_PRIVATE_H__
#define __NM_SETTING_PRIVATE_H__
#include "nm-glib.h"
#include "nm-setting.h"
#include "nm-connection.h"
#include "nm-core-enum-types.h"
#include "nm-glib-compat.h"
#include "nm-core-internal.h"

View file

@ -24,8 +24,8 @@
#include <string.h>
#include "nm-glib.h"
#include "nm-setting-serial.h"
#include "nm-glib-compat.h"
#include "nm-setting-private.h"
/**

View file

@ -24,8 +24,8 @@
#include <string.h>
#include <glib/gi18n-lib.h>
#include <gio/gio.h>
#include "nm-glib.h"
#include "nm-setting.h"
#include "nm-setting-private.h"
#include "nm-utils.h"

View file

@ -31,9 +31,9 @@
#include <gmodule.h>
#include <glib/gi18n-lib.h>
#include "nm-glib.h"
#include "nm-utils.h"
#include "nm-utils-private.h"
#include "nm-glib-compat.h"
#include "nm-setting-private.h"
#include "crypto.h"
#include "gsystem-local-alloc.h"

View file

@ -24,8 +24,7 @@
#include <arpa/inet.h>
#include <netinet/in.h>
#include "nm-glib-compat.h"
#include "nm-glib.h"
#include "nm-property-compare.h"
#include "nm-test-utils.h"

View file

@ -23,13 +23,13 @@
#include "config.h"
#include <glib.h>
#include <unistd.h>
#include <stdlib.h>
#include <glib/gi18n.h>
#include <stdio.h>
#include <string.h>
#include "nm-glib.h"
#include "crypto.h"
#include "nm-utils.h"
#include "nm-errors.h"

View file

@ -23,10 +23,10 @@
#include "config.h"
#include <glib.h>
#include <string.h>
#include <nm-utils.h>
#include "nm-glib.h"
#include "gsystem-local-alloc.h"
#include "nm-setting-private.h"
@ -62,7 +62,6 @@
#include "nm-setting-wireless-security.h"
#include "nm-simple-connection.h"
#include "nm-keyfile-internal.h"
#include "nm-glib-compat.h"
#include "nm-test-utils.h"
#include "test-general-enums.h"

View file

@ -21,9 +21,9 @@
#include "config.h"
#include <glib.h>
#include <string.h>
#include "nm-glib.h"
#include "nm-setting-8021x.h"
#include "nm-setting-cdma.h"
#include "nm-setting-connection.h"

View file

@ -21,11 +21,11 @@
#include "config.h"
#include <glib.h>
#include <string.h>
#include <nm-utils.h>
#include "nm-glib.h"
#include "nm-setting-connection.h"
#include "nm-setting-8021x.h"

View file

@ -21,9 +21,9 @@
#include "config.h"
#include <glib.h>
#include <string.h>
#include <nm-utils.h>
#include "nm-glib.h"
#include "nm-setting-dcb.h"
#include "nm-connection.h"
#include "nm-errors.h"

View file

@ -21,11 +21,11 @@
#include "config.h"
#include <glib.h>
#include <string.h>
#include <nm-utils.h>
#include "nm-glib.h"
#include "nm-setting-8021x.h"
#include "nm-setting-cdma.h"
#include "nm-setting-connection.h"

View file

@ -30,6 +30,8 @@
#include <netinet/in.h>
#include <arpa/inet.h>
#include "nm-glib.h"
#include "nm-client.h"
#include "nm-device.h"
#include "nm-device-ethernet.h"
@ -38,7 +40,6 @@
#include "nm-active-connection.h"
#include "nm-vpn-connection.h"
#include "nm-setting-ip4-config.h"
#include "nm-glib-compat.h"
static gboolean
test_wireless_enabled (NMClient *client)

View file

@ -26,14 +26,12 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <dbus/dbus.h>
#include <dbus/dbus-glib-lowlevel.h>
#include "nm-glib.h"
#include "NetworkManager.h"
#include "libnm_glib.h"
#include "nm-glib-compat.h"
#define DBUS_NO_SERVICE_ERROR "org.freedesktop.DBus.Error.ServiceDoesNotExist"

View file

@ -24,14 +24,13 @@
#include <string.h>
#include <netinet/ether.h>
#include "nm-glib-compat.h"
#include <nm-connection.h>
#include <nm-setting-connection.h>
#include <nm-setting-wireless.h>
#include <nm-setting-wireless-security.h>
#include <nm-utils.h>
#include "nm-glib.h"
#include "nm-access-point.h"
#include "NetworkManager.h"
#include "nm-types-private.h"

View file

@ -23,6 +23,7 @@
#include <string.h>
#include "nm-glib.h"
#include "NetworkManager.h"
#include "nm-active-connection.h"
#include "nm-object-private.h"
@ -31,7 +32,6 @@
#include "nm-device-private.h"
#include "nm-connection.h"
#include "nm-vpn-connection.h"
#include "nm-glib-compat.h"
#include "nm-dbus-helpers-private.h"
static GType _nm_active_connection_type_for_path (DBusGConnection *connection,
@ -120,7 +120,7 @@ _nm_active_connection_type_for_path (DBusGConnection *connection,
GValue value = G_VALUE_INIT;
GType type;
proxy = _nm_dbus_new_proxy_for_connection (connection, path, "org.freedesktop.DBus.Properties");
proxy = _nm_dbus_new_proxy_for_connection (connection, path, DBUS_INTERFACE_PROPERTIES);
if (!proxy) {
g_warning ("%s: couldn't create D-Bus object proxy.", __func__);
return G_TYPE_INVALID;
@ -197,7 +197,7 @@ _nm_active_connection_type_for_path_async (DBusGConnection *connection,
async_data->callback = callback;
async_data->user_data = user_data;
proxy = _nm_dbus_new_proxy_for_connection (connection, path, "org.freedesktop.DBus.Properties");
proxy = _nm_dbus_new_proxy_for_connection (connection, path, DBUS_INTERFACE_PROPERTIES);
dbus_g_proxy_begin_call (proxy, "Get",
async_got_type, async_data, NULL,
G_TYPE_STRING, NM_DBUS_INTERFACE_ACTIVE_CONNECTION,

View file

@ -25,6 +25,7 @@
#include <string.h>
#include <nm-utils.h>
#include "nm-glib.h"
#include "nm-client.h"
#include "nm-device-ethernet.h"
#include "nm-device-wifi.h"
@ -35,7 +36,6 @@
#include "nm-vpn-connection.h"
#include "nm-object-cache.h"
#include "nm-dbus-glib-types.h"
#include "nm-glib-compat.h"
void _nm_device_wifi_set_wireless_enabled (NMDeviceWifi *device, gboolean enabled);
@ -1798,23 +1798,19 @@ constructed (GObject *object)
object,
NULL);
if (_nm_object_is_connection_private (NM_OBJECT (object)))
priv->manager_running = TRUE;
else {
priv->bus_proxy = dbus_g_proxy_new_for_name (nm_object_get_connection (NM_OBJECT (object)),
DBUS_SERVICE_DBUS,
DBUS_PATH_DBUS,
DBUS_INTERFACE_DBUS);
g_assert (priv->bus_proxy);
priv->bus_proxy = dbus_g_proxy_new_for_name (nm_object_get_connection (NM_OBJECT (object)),
DBUS_SERVICE_DBUS,
DBUS_PATH_DBUS,
DBUS_INTERFACE_DBUS);
g_assert (priv->bus_proxy);
dbus_g_proxy_add_signal (priv->bus_proxy, "NameOwnerChanged",
G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING,
G_TYPE_INVALID);
dbus_g_proxy_connect_signal (priv->bus_proxy,
"NameOwnerChanged",
G_CALLBACK (proxy_name_owner_changed),
object, NULL);
}
dbus_g_proxy_add_signal (priv->bus_proxy, "NameOwnerChanged",
G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING,
G_TYPE_INVALID);
dbus_g_proxy_connect_signal (priv->bus_proxy,
"NameOwnerChanged",
G_CALLBACK (proxy_name_owner_changed),
object, NULL);
g_signal_connect (object, "notify::" NM_CLIENT_WIRELESS_ENABLED,
G_CALLBACK (wireless_enabled_cb), NULL);
@ -1835,15 +1831,13 @@ init_sync (GInitable *initable, GCancellable *cancellable, GError **error)
if (!nm_client_parent_initable_iface->init (initable, cancellable, error))
return FALSE;
if (!_nm_object_is_connection_private (NM_OBJECT (client))) {
if (!dbus_g_proxy_call (priv->bus_proxy,
"NameHasOwner", error,
G_TYPE_STRING, NM_DBUS_SERVICE,
G_TYPE_INVALID,
G_TYPE_BOOLEAN, &priv->manager_running,
G_TYPE_INVALID))
return FALSE;
}
if (!dbus_g_proxy_call (priv->bus_proxy,
"NameHasOwner", error,
G_TYPE_STRING, NM_DBUS_SERVICE,
G_TYPE_INVALID,
G_TYPE_BOOLEAN, &priv->manager_running,
G_TYPE_INVALID))
return FALSE;
if (priv->manager_running && !get_permissions_sync (client, error))
return FALSE;
@ -1953,16 +1947,12 @@ init_async (GAsyncInitable *initable, int io_priority,
user_data, init_async);
g_simple_async_result_set_op_res_gboolean (init_data->result, TRUE);
if (_nm_object_is_connection_private (NM_OBJECT (init_data->client)))
finish_init (init_data);
else {
/* Check if NM is running */
dbus_g_proxy_begin_call (priv->bus_proxy, "NameHasOwner",
init_async_got_manager_running,
init_data, NULL,
G_TYPE_STRING, NM_DBUS_SERVICE,
G_TYPE_INVALID);
}
/* Check if NM is running */
dbus_g_proxy_begin_call (priv->bus_proxy, "NameHasOwner",
init_async_got_manager_running,
init_data, NULL,
G_TYPE_STRING, NM_DBUS_SERVICE,
G_TYPE_INVALID);
}
static gboolean

View file

@ -21,13 +21,12 @@
#ifndef NM_DBUS_HELPERS_PRIVATE_H
#define NM_DBUS_HELPERS_PRIVATE_H
#include <gio/gio.h>
#include <dbus/dbus.h>
#include <dbus/dbus-glib-lowlevel.h>
DBusGConnection *_nm_dbus_new_connection (GError **error);
#include "nm-glib.h"
gboolean _nm_dbus_is_connection_private (DBusGConnection *connection);
DBusGConnection *_nm_dbus_new_connection (GError **error);
DBusGProxy * _nm_dbus_new_proxy_for_connection (DBusGConnection *connection,
const char *path,

View file

@ -21,80 +21,27 @@
#include "config.h"
#include <string.h>
#include <gio/gio.h>
#include <dbus/dbus.h>
#include <dbus/dbus-glib-lowlevel.h>
#include "nm-glib.h"
#include "nm-dbus-helpers-private.h"
#include "NetworkManager.h"
static dbus_int32_t priv_slot = -1;
static gboolean
_ensure_dbus_data_slot (void)
{
static gsize init_value = 0;
gboolean success = TRUE;
if (g_once_init_enter (&init_value)) {
success = dbus_connection_allocate_data_slot (&priv_slot);
g_once_init_leave (&init_value, 1);
}
return success;
}
DBusGConnection *
_nm_dbus_new_connection (GError **error)
{
DBusGConnection *connection = NULL;
if (!_ensure_dbus_data_slot ()) {
g_set_error (error, DBUS_GERROR, DBUS_GERROR_FAILED, "failed to allocated data slot");
return NULL;
}
#if HAVE_DBUS_GLIB_100
/* If running as root try the private bus first */
if (0 == geteuid ()) {
connection = dbus_g_connection_open ("unix:path=" NMRUNDIR "/private", error);
if (connection) {
DBusConnection *dbus_connection = dbus_g_connection_get_connection (connection);
/* Mark this connection as private */
dbus_connection_set_data (dbus_connection, priv_slot, GUINT_TO_POINTER (TRUE), NULL);
dbus_connection_set_exit_on_disconnect (dbus_connection, FALSE);
return connection;
}
/* Fall back to a bus if for some reason private socket isn't available */
g_clear_error (error);
}
#endif
if (connection == NULL)
connection = dbus_g_bus_get (DBUS_BUS_SYSTEM, error);
return connection;
}
gboolean
_nm_dbus_is_connection_private (DBusGConnection *connection)
{
if (!_ensure_dbus_data_slot ())
return FALSE;
return !!dbus_connection_get_data (dbus_g_connection_get_connection (connection), priv_slot);
}
DBusGProxy *
_nm_dbus_new_proxy_for_connection (DBusGConnection *connection,
const char *path,
const char *interface)
{
/* Private connections can't use dbus_g_proxy_new_for_name() or
* dbus_g_proxy_new_for_name_owner() because peer-to-peer connections don't
* have either a bus daemon or name owners, both of which those functions
* require.
*/
if (_nm_dbus_is_connection_private (connection))
return dbus_g_proxy_new_for_peer (connection, path, interface);
return dbus_g_proxy_new_for_name (connection, NM_DBUS_SERVICE, path, interface);
}

View file

@ -23,12 +23,11 @@
#include <string.h>
#include <netinet/ether.h>
#include "nm-glib-compat.h"
#include <nm-setting-connection.h>
#include <nm-setting-bond.h>
#include <nm-utils.h>
#include "nm-glib.h"
#include "nm-device-bond.h"
#include "nm-device-private.h"
#include "nm-object-private.h"

View file

@ -23,12 +23,11 @@
#include <string.h>
#include <netinet/ether.h>
#include "nm-glib-compat.h"
#include <nm-setting-connection.h>
#include <nm-setting-bridge.h>
#include <nm-utils.h>
#include "nm-glib.h"
#include "nm-device-bridge.h"
#include "nm-device-private.h"
#include "nm-object-private.h"

View file

@ -24,11 +24,10 @@
#include <string.h>
#include <netinet/ether.h>
#include "nm-glib-compat.h"
#include <nm-setting-connection.h>
#include <nm-setting-bluetooth.h>
#include "nm-glib.h"
#include "nm-device-bt.h"
#include "nm-device-private.h"
#include "nm-object-private.h"

View file

@ -24,12 +24,11 @@
#include <string.h>
#include <netinet/ether.h>
#include "nm-glib-compat.h"
#include <nm-setting-connection.h>
#include <nm-setting-wired.h>
#include <nm-setting-pppoe.h>
#include "nm-glib.h"
#include "nm-device-ethernet.h"
#include "nm-device-private.h"
#include "nm-object-private.h"

View file

@ -24,12 +24,11 @@
#include <linux/if_infiniband.h>
#include <netinet/ether.h>
#include "nm-glib-compat.h"
#include <nm-setting-connection.h>
#include <nm-setting-infiniband.h>
#include <nm-utils.h>
#include "nm-glib.h"
#include "nm-device-infiniband.h"
#include "nm-device-private.h"
#include "nm-object-private.h"

View file

@ -23,12 +23,11 @@
#include <string.h>
#include "nm-glib-compat.h"
#include <nm-setting-connection.h>
#include <nm-setting-gsm.h>
#include <nm-setting-cdma.h>
#include "nm-glib.h"
#include "nm-device-modem.h"
#include "nm-device-private.h"
#include "nm-object-private.h"

View file

@ -22,11 +22,10 @@
#include <string.h>
#include "nm-glib-compat.h"
#include <nm-setting-connection.h>
#include <nm-setting-olpc-mesh.h>
#include "nm-glib.h"
#include "nm-device-olpc-mesh.h"
#include "nm-device-private.h"
#include "nm-object-private.h"

View file

@ -23,12 +23,11 @@
#include <string.h>
#include <netinet/ether.h>
#include "nm-glib-compat.h"
#include <nm-setting-connection.h>
#include <nm-setting-team.h>
#include <nm-utils.h>
#include "nm-glib.h"
#include "nm-device-team.h"
#include "nm-device-private.h"
#include "nm-object-private.h"

View file

@ -23,12 +23,11 @@
#include <string.h>
#include <netinet/ether.h>
#include "nm-glib-compat.h"
#include <nm-setting-connection.h>
#include <nm-setting-vlan.h>
#include <nm-utils.h>
#include "nm-glib.h"
#include "nm-device-vlan.h"
#include "nm-device-private.h"
#include "nm-object-private.h"

View file

@ -24,12 +24,11 @@
#include <string.h>
#include <netinet/ether.h>
#include "nm-glib-compat.h"
#include <nm-setting-connection.h>
#include <nm-setting-wireless.h>
#include <nm-setting-wireless-security.h>
#include "nm-glib.h"
#include "nm-device-wifi.h"
#include "nm-device-private.h"
#include "nm-object-private.h"

View file

@ -24,11 +24,10 @@
#include <string.h>
#include <netinet/ether.h>
#include "nm-glib-compat.h"
#include <nm-setting-connection.h>
#include <nm-setting-wimax.h>
#include "nm-glib.h"
#include "nm-device-wimax.h"
#include "nm-object-private.h"
#include "nm-object-cache.h"

View file

@ -26,6 +26,7 @@
#include <glib/gi18n-lib.h>
#include <gudev/gudev.h>
#include "nm-glib.h"
#include "NetworkManager.h"
#include "nm-device-ethernet.h"
#include "nm-device-adsl.h"
@ -47,7 +48,6 @@
#include "nm-remote-connection.h"
#include "nm-types.h"
#include "nm-dbus-glib-types.h"
#include "nm-glib-compat.h"
#include "nm-utils.h"
#include "nm-dbus-helpers-private.h"
@ -887,7 +887,7 @@ _nm_device_type_for_path (DBusGConnection *connection,
GValue value = G_VALUE_INIT;
NMDeviceType nm_dtype;
proxy = _nm_dbus_new_proxy_for_connection (connection, path, "org.freedesktop.DBus.Properties");
proxy = _nm_dbus_new_proxy_for_connection (connection, path, DBUS_INTERFACE_PROPERTIES);
if (!proxy) {
g_warning ("%s: couldn't create D-Bus object proxy.", __func__);
return G_TYPE_INVALID;
@ -987,7 +987,7 @@ _nm_device_type_for_path_async (DBusGConnection *connection,
async_data->callback = callback;
async_data->user_data = user_data;
proxy = _nm_dbus_new_proxy_for_connection (connection, path, "org.freedesktop.DBus.Properties");
proxy = _nm_dbus_new_proxy_for_connection (connection, path, DBUS_INTERFACE_PROPERTIES);
dbus_g_proxy_begin_call (proxy, "Get",
async_got_type, async_data, NULL,
G_TYPE_STRING, NM_DBUS_INTERFACE_DEVICE,

View file

@ -21,7 +21,7 @@
#include "config.h"
#include <string.h>
#include <glib.h>
#include "nm-glib.h"
#include "nm-object-cache.h"
#include "nm-object.h"

View file

@ -21,8 +21,7 @@
#ifndef NM_OBJECT_CACHE_H
#define NM_OBJECT_CACHE_H
#include <glib.h>
#include <glib-object.h>
#include "nm-glib.h"
#include "nm-object.h"
G_BEGIN_DECLS

Some files were not shown because too many files have changed in this diff Show more