about summary refs log tree commit diff
path: root/shared
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2016-08-03 22:59:23 +0200
committerMichael Biebl <biebl@debian.org>2016-08-03 22:59:23 +0200
commitd6201f5d8daada3d64a0a3e0038e14eebec683ce (patch)
tree035500728cc23e7ee5368c3fd605270265a077f7 /shared
parent73e152af6e3fb4f5848bfb8394484026ff119003 (diff)
Imported Upstream version 1.2.4 upstream/1.2.4
Diffstat (limited to 'shared')
-rw-r--r--shared/Makefile.am1
-rw-r--r--shared/Makefile.in2
-rw-r--r--shared/nm-common-macros.h43
-rw-r--r--shared/nm-glib.h18
-rw-r--r--shared/nm-macros-internal.h21
-rw-r--r--shared/nm-version-macros.h7
-rw-r--r--shared/nm-version-macros.h.in5
7 files changed, 80 insertions, 17 deletions
diff --git a/shared/Makefile.am b/shared/Makefile.am
index c042fdbe..c6ede00b 100644
--- a/shared/Makefile.am
+++ b/shared/Makefile.am
@@ -1,5 +1,6 @@
 EXTRA_DIST = \
      gsystem-local-alloc.h \
+     nm-common-macros.h \
      nm-dbus-compat.h \
      nm-default.h \
      nm-glib.h \
diff --git a/shared/Makefile.in b/shared/Makefile.in
index 3dfa7f57..26f46bb4 100644
--- a/shared/Makefile.in
+++ b/shared/Makefile.in
@@ -265,6 +265,7 @@ NEWT_LIBS = @NEWT_LIBS@
 NM = @NM@
 NMEDIT = @NMEDIT@
 NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT = @NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT@
+NM_CONFIG_DEFAULT_DNS_RC_MANAGER = @NM_CONFIG_DEFAULT_DNS_RC_MANAGER@
 NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT = @NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT@
 NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT = @NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT@
 NM_MAJOR_VERSION = @NM_MAJOR_VERSION@
@@ -397,6 +398,7 @@ with_resolvconf = @with_resolvconf@
 with_valgrind = @with_valgrind@
 EXTRA_DIST = \
      gsystem-local-alloc.h \
+     nm-common-macros.h \
      nm-dbus-compat.h \
      nm-default.h \
      nm-glib.h \
diff --git a/shared/nm-common-macros.h b/shared/nm-common-macros.h
new file mode 100644
index 00000000..922117c3
--- /dev/null
+++ b/shared/nm-common-macros.h
@@ -0,0 +1,43 @@
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/* NetworkManager -- Network link manager
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301 USA.
+ *
+ * (C) Copyright 2016 Red Hat, Inc.
+ */
+
+#ifndef __NM_COMMON_MACROS_H__
+#define __NM_COMMON_MACROS_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"
+#define NM_AUTH_PERMISSION_ENABLE_DISABLE_WIFI        "org.freedesktop.NetworkManager.enable-disable-wifi"
+#define NM_AUTH_PERMISSION_ENABLE_DISABLE_WWAN        "org.freedesktop.NetworkManager.enable-disable-wwan"
+#define NM_AUTH_PERMISSION_ENABLE_DISABLE_WIMAX       "org.freedesktop.NetworkManager.enable-disable-wimax"
+#define NM_AUTH_PERMISSION_NETWORK_CONTROL            "org.freedesktop.NetworkManager.network-control"
+#define NM_AUTH_PERMISSION_WIFI_SHARE_PROTECTED       "org.freedesktop.NetworkManager.wifi.share.protected"
+#define NM_AUTH_PERMISSION_WIFI_SHARE_OPEN            "org.freedesktop.NetworkManager.wifi.share.open"
+#define NM_AUTH_PERMISSION_SETTINGS_MODIFY_SYSTEM     "org.freedesktop.NetworkManager.settings.modify.system"
+#define NM_AUTH_PERMISSION_SETTINGS_MODIFY_OWN        "org.freedesktop.NetworkManager.settings.modify.own"
+#define NM_AUTH_PERMISSION_SETTINGS_MODIFY_HOSTNAME   "org.freedesktop.NetworkManager.settings.modify.hostname"
+#define NM_AUTH_PERMISSION_SETTINGS_MODIFY_GLOBAL_DNS "org.freedesktop.NetworkManager.settings.modify.global-dns"
+#define NM_AUTH_PERMISSION_RELOAD                     "org.freedesktop.NetworkManager.reload"
+
+/******************************************************************************/
+
+#endif /* __NM_COMMON_MACROS_H__ */
diff --git a/shared/nm-glib.h b/shared/nm-glib.h
index c92d6f0f..5f8ebc7f 100644
--- a/shared/nm-glib.h
+++ b/shared/nm-glib.h
@@ -374,4 +374,22 @@ _nm_g_hash_table_get_keys_as_array (GHashTable *hash_table,
                                __VA_ARGS__)
 #endif
 
+#if !GLIB_CHECK_VERSION(2, 44, 0)
+static inline gpointer
+g_steal_pointer (gpointer pp)
+{
+	gpointer *ptr = (gpointer *) pp;
+	gpointer ref;
+
+	ref = *ptr;
+	*ptr = NULL;
+
+	return ref;
+}
+
+/* type safety */
+#define g_steal_pointer(pp) \
+  (0 ? (*(pp)) : (g_steal_pointer) (pp))
+#endif
+
 #endif  /* __NM_GLIB_H__ */
diff --git a/shared/nm-macros-internal.h b/shared/nm-macros-internal.h
index 384bca66..fe27b761 100644
--- a/shared/nm-macros-internal.h
+++ b/shared/nm-macros-internal.h
@@ -27,6 +27,7 @@
 /********************************************************/
 
 #define _nm_packed __attribute__ ((packed))
+#define _nm_unused __attribute__ ((unused))
 
 #define nm_auto(fcn) __attribute__ ((cleanup(fcn)))
 
@@ -45,6 +46,14 @@ _nm_auto_unset_gvalue_impl (GValue *v)
 }
 #define nm_auto_unset_gvalue nm_auto(_nm_auto_unset_gvalue_impl)
 
+static inline void
+_nm_auto_free_gstring_impl (GString **str)
+{
+	if (*str)
+		g_string_free (*str, TRUE);
+}
+#define nm_auto_free_gstring nm_auto(_nm_auto_free_gstring_impl)
+
 /********************************************************/
 
 /* http://stackoverflow.com/a/11172679 */
@@ -326,18 +335,6 @@ _notify (obj_type *obj, _PropertyEnums prop) \
 
 /*****************************************************************************/
 
-#define nm_unauto(pp)                                               \
-    ({                                                              \
-        G_STATIC_ASSERT (sizeof *(pp) == sizeof (gpointer));        \
-        gpointer *_pp = (gpointer *) (pp);                          \
-        gpointer _p = *_pp;                                         \
-                                                                    \
-        *_pp = NULL;                                                \
-        _p;                                                         \
-    })
-
-/*****************************************************************************/
-
 static inline gpointer
 nm_g_object_ref (gpointer obj)
 {
diff --git a/shared/nm-version-macros.h b/shared/nm-version-macros.h
index 50c9748d..e8bd4f84 100644
--- a/shared/nm-version-macros.h
+++ b/shared/nm-version-macros.h
@@ -45,7 +45,7 @@
  * Evaluates to the micro version number of NetworkManager which this source
  * compiled against.
  */
-#define NM_MICRO_VERSION (2)
+#define NM_MICRO_VERSION (4)
 
 /**
  * NM_CHECK_VERSION:
@@ -70,9 +70,10 @@
 #define NM_VERSION_1_2    (NM_ENCODE_VERSION (1, 2, 0))
 #define NM_VERSION_1_2_2  (NM_ENCODE_VERSION (1, 2, 2))
 #define NM_VERSION_1_2_4  (NM_ENCODE_VERSION (1, 2, 4))
+#define NM_VERSION_1_2_6  (NM_ENCODE_VERSION (1, 2, 6))
 #define NM_VERSION_1_4    (NM_ENCODE_VERSION (1, 4, 0))
 
-#define NM_VERSION_CUR_STABLE  NM_VERSION_1_2_2
-#define NM_VERSION_NEXT_STABLE NM_VERSION_1_2_4
+#define NM_VERSION_CUR_STABLE  NM_VERSION_1_2_4
+#define NM_VERSION_NEXT_STABLE NM_VERSION_1_2_6
 
 #endif  /* __NM_VERSION_MACROS_H__ */
diff --git a/shared/nm-version-macros.h.in b/shared/nm-version-macros.h.in
index 3e0ef361..71f66fef 100644
--- a/shared/nm-version-macros.h.in
+++ b/shared/nm-version-macros.h.in
@@ -70,9 +70,10 @@
 #define NM_VERSION_1_2    (NM_ENCODE_VERSION (1, 2, 0))
 #define NM_VERSION_1_2_2  (NM_ENCODE_VERSION (1, 2, 2))
 #define NM_VERSION_1_2_4  (NM_ENCODE_VERSION (1, 2, 4))
+#define NM_VERSION_1_2_6  (NM_ENCODE_VERSION (1, 2, 6))
 #define NM_VERSION_1_4    (NM_ENCODE_VERSION (1, 4, 0))
 
-#define NM_VERSION_CUR_STABLE  NM_VERSION_1_2_2
-#define NM_VERSION_NEXT_STABLE NM_VERSION_1_2_4
+#define NM_VERSION_CUR_STABLE  NM_VERSION_1_2_4
+#define NM_VERSION_NEXT_STABLE NM_VERSION_1_2_6
 
 #endif  /* __NM_VERSION_MACROS_H__ */