Commit d0b05b34 authored by Dan Winship's avatar Dan Winship

libnm: add NetworkManager.h, disallow including individual headers

Add NetworkManager.h, which includes all of the other NM header, and
require all external users of libnm to use that rather than the
individual headers.

(An exception is made for nm-dbus-interface.h,
nm-vpn-dbus-interface.h, and nm-version.h, which can be included
separately.)
parent 3ddce748
...@@ -6,6 +6,7 @@ AM_CPPFLAGS = \ ...@@ -6,6 +6,7 @@ AM_CPPFLAGS = \
-I${top_builddir}/libnm-core \ -I${top_builddir}/libnm-core \
$(GLIB_CFLAGS) \ $(GLIB_CFLAGS) \
$(DBUS_CFLAGS) \ $(DBUS_CFLAGS) \
-DNETWORKMANAGER_COMPILATION \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \ -DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
-DNMCONFDIR=\"$(nmconfdir)\" \ -DNMCONFDIR=\"$(nmconfdir)\" \
-DSYSCONFDIR=\"$(sysconfdir)\" \ -DSYSCONFDIR=\"$(sysconfdir)\" \
......
...@@ -5,6 +5,7 @@ AM_CPPFLAGS = \ ...@@ -5,6 +5,7 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/libnm-core \ -I$(top_srcdir)/libnm-core \
-I$(top_builddir)/libnm-core \ -I$(top_builddir)/libnm-core \
-I$(top_srcdir)/callouts \ -I$(top_srcdir)/callouts \
-DNETWORKMANAGER_COMPILATION \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \ -DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
$(GLIB_CFLAGS) \ $(GLIB_CFLAGS) \
$(DBUS_CFLAGS) $(DBUS_CFLAGS)
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include "nm-dbus-glib-types.h" #include "nm-dbus-glib-types.h"
#include "nm-dispatcher-api.h" #include "nm-dispatcher-api.h"
#include "nm-utils.h" #include "nm-utils.h"
#include "nm-utils-private.h"
/*******************************************/ /*******************************************/
......
...@@ -22,14 +22,6 @@ ...@@ -22,14 +22,6 @@
#ifndef NMC_COMMON_H #ifndef NMC_COMMON_H
#define NMC_COMMON_H #define NMC_COMMON_H
#include <glib.h>
#include <nm-ip4-config.h>
#include <nm-ip6-config.h>
#include <nm-dhcp4-config.h>
#include <nm-dhcp6-config.h>
#include <nm-device.h>
#include "nmcli.h" #include "nmcli.h"
gboolean print_ip4_config (NMIP4Config *cfg4, NmCli *nmc, const char *group_prefix, const char *one_field); gboolean print_ip4_config (NMIP4Config *cfg4, NmCli *nmc, const char *group_prefix, const char *one_field);
......
...@@ -33,25 +33,6 @@ ...@@ -33,25 +33,6 @@
#include <readline/readline.h> #include <readline/readline.h>
#include <readline/history.h> #include <readline/history.h>
#include <nm-client.h>
#include <nm-device-ethernet.h>
#include <nm-device-adsl.h>
#include <nm-device-wifi.h>
#if WITH_WIMAX
#include <nm-device-wimax.h>
#endif
#include <nm-device-modem.h>
#include <nm-device-bt.h>
#include <nm-device-olpc-mesh.h>
#include <nm-device-infiniband.h>
#include <nm-device-bond.h>
#include <nm-device-team.h>
#include <nm-device-bridge.h>
#include <nm-device-vlan.h>
#include <nm-remote-settings.h>
#include <nm-vpn-connection.h>
#include <nm-utils.h>
#include "utils.h" #include "utils.h"
#include "common.h" #include "common.h"
#include "settings.h" #include "settings.h"
......
...@@ -29,39 +29,6 @@ ...@@ -29,39 +29,6 @@
#include <glib.h> #include <glib.h>
#include <glib/gi18n.h> #include <glib/gi18n.h>
#include <nm-client.h>
#include <nm-device.h>
#include <nm-device-ethernet.h>
#include <nm-device-adsl.h>
#include <nm-device-wifi.h>
#include <nm-device-modem.h>
#include <nm-device-bt.h>
#include <nm-device-olpc-mesh.h>
#if WITH_WIMAX
#include <nm-device-wimax.h>
#endif
#include <nm-device-infiniband.h>
#include <nm-device-bond.h>
#include <nm-device-bridge.h>
#include <nm-device-vlan.h>
#include <nm-utils.h>
#include <nm-setting-ip4-config.h>
#include <nm-setting-ip6-config.h>
#include <nm-vpn-connection.h>
#include <nm-setting-connection.h>
#include <nm-setting-wired.h>
#include <nm-setting-adsl.h>
#include <nm-setting-pppoe.h>
#include <nm-setting-wireless.h>
#include <nm-setting-gsm.h>
#include <nm-setting-cdma.h>
#include <nm-setting-bluetooth.h>
#include <nm-setting-olpc-mesh.h>
#if WITH_WIMAX
#include <nm-setting-wimax.h>
#endif
#include <nm-setting-infiniband.h>
#include "utils.h" #include "utils.h"
#include "common.h" #include "common.h"
#include "devices.h" #include "devices.h"
......
...@@ -25,8 +25,6 @@ ...@@ -25,8 +25,6 @@
#include <glib.h> #include <glib.h>
#include <glib/gi18n.h> #include <glib/gi18n.h>
#include <nm-client.h>
#include <nm-setting-connection.h>
#include "utils.h" #include "utils.h"
#include "network-manager.h" #include "network-manager.h"
......
...@@ -33,9 +33,6 @@ ...@@ -33,9 +33,6 @@
#include <glib.h> #include <glib.h>
#include <glib/gi18n.h> #include <glib/gi18n.h>
#include <nm-client.h>
#include <nm-setting-connection.h>
#include <nm-remote-settings.h>
#include "nmcli.h" #include "nmcli.h"
#include "utils.h" #include "utils.h"
......
...@@ -20,10 +20,7 @@ ...@@ -20,10 +20,7 @@
#ifndef NMC_NMCLI_H #ifndef NMC_NMCLI_H
#define NMC_NMCLI_H #define NMC_NMCLI_H
#include <glib.h> #include <NetworkManager.h>
#include <nm-client.h>
#include <nm-remote-settings.h>
/* nmcli exit codes */ /* nmcli exit codes */
typedef enum { typedef enum {
......
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
#include <glib.h> #include <glib.h>
#include <glib/gi18n.h> #include <glib/gi18n.h>
#include <nm-utils.h>
#include "utils.h" #include "utils.h"
#include "common.h" #include "common.h"
......
...@@ -20,30 +20,6 @@ ...@@ -20,30 +20,6 @@
#ifndef NMC_SETTINGS_H #ifndef NMC_SETTINGS_H
#define NMC_SETTINGS_H #define NMC_SETTINGS_H
#include <nm-setting-connection.h>
#include <nm-setting-wired.h>
#include <nm-setting-adsl.h>
#include <nm-setting-8021x.h>
#include <nm-setting-wireless.h>
#include <nm-setting-wireless-security.h>
#include <nm-setting-ip4-config.h>
#include <nm-setting-ip6-config.h>
#include <nm-setting-serial.h>
#include <nm-setting-ppp.h>
#include <nm-setting-pppoe.h>
#include <nm-setting-gsm.h>
#include <nm-setting-cdma.h>
#include <nm-setting-bluetooth.h>
#include <nm-setting-olpc-mesh.h>
#include <nm-setting-vpn.h>
#include <nm-setting-wimax.h>
#include <nm-setting-infiniband.h>
#include <nm-setting-bond.h>
#include <nm-setting-bridge.h>
#include <nm-setting-bridge-port.h>
#include <nm-setting-vlan.h>
#include <nm-setting-dcb.h>
#include "nmcli.h" #include "nmcli.h"
#include "utils.h" #include "utils.h"
......
...@@ -20,8 +20,6 @@ ...@@ -20,8 +20,6 @@
#ifndef NMC_UTILS_H #ifndef NMC_UTILS_H
#define NMC_UTILS_H #define NMC_UTILS_H
#include <glib.h>
#include "nmcli.h" #include "nmcli.h"
/* === Types === */ /* === Types === */
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
#include <glib/gi18n.h> #include <glib/gi18n.h>
#include "nm-client.h" #include <NetworkManager.h>
#define PROGRESS_STEPS 15 #define PROGRESS_STEPS 15
#define WAIT_STARTUP_TAG "wait-startup" #define WAIT_STARTUP_TAG "wait-startup"
......
...@@ -19,10 +19,7 @@ ...@@ -19,10 +19,7 @@
#ifndef NM_EDITOR_BINDINGS_H #ifndef NM_EDITOR_BINDINGS_H
#define NM_EDITOR_BINDINGS_H #define NM_EDITOR_BINDINGS_H
#include <glib-object.h> #include <NetworkManager.h>
#include <nm-connection.h>
#include <nm-setting-wireless-security.h>
#include <nm-setting-vlan.h>
G_BEGIN_DECLS G_BEGIN_DECLS
......
...@@ -28,16 +28,7 @@ ...@@ -28,16 +28,7 @@
#include "config.h" #include "config.h"
#include <glib/gi18n.h> #include <glib/gi18n.h>
#include <nm-utils.h> #include <NetworkManager.h>
#include <nm-device-bond.h>
#include <nm-device-bridge.h>
#include <nm-device-team.h>
#include <nm-device-ethernet.h>
#include <nm-device-infiniband.h>
#include <nm-device-team.h>
#include <nm-device-vlan.h>
#include <nm-device-wifi.h>
#include "nm-editor-utils.h" #include "nm-editor-utils.h"
#if 0 #if 0
......
...@@ -19,8 +19,7 @@ ...@@ -19,8 +19,7 @@
#ifndef NM_EDITOR_UTILS_H #ifndef NM_EDITOR_UTILS_H
#define NM_EDITOR_UTILS_H #define NM_EDITOR_UTILS_H
#include <glib-object.h> #include <NetworkManager.h>
#include <nm-remote-settings.h>
G_BEGIN_DECLS G_BEGIN_DECLS
......
...@@ -29,9 +29,7 @@ ...@@ -29,9 +29,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <glib/gi18n-lib.h> #include <glib/gi18n-lib.h>
#include <nm-access-point.h> #include <NetworkManager.h>
#include <nm-device-wifi.h>
#include <nm-utils.h>
#include "nmtui.h" #include "nmtui.h"
#include "nmt-connect-connection-list.h" #include "nmt-connect-connection-list.h"
......
...@@ -41,9 +41,7 @@ ...@@ -41,9 +41,7 @@
#include <linux/if_arp.h> #include <linux/if_arp.h>
#include <glib/gi18n-lib.h> #include <glib/gi18n-lib.h>
#include <nm-device.h> #include <NetworkManager.h>
#include <nm-device-infiniband.h>
#include <nm-utils.h>
#include "nmtui.h" #include "nmtui.h"
#include "nmt-device-entry.h" #include "nmt-device-entry.h"
......
...@@ -21,8 +21,7 @@ ...@@ -21,8 +21,7 @@
#include "nmt-page-grid.h" #include "nmt-page-grid.h"
#include <nm-connection.h> #include <NetworkManager.h>
#include <nm-device.h>
G_BEGIN_DECLS G_BEGIN_DECLS
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
#include "nmt-newt.h" #include "nmt-newt.h"
#include <nm-remote-connection.h> #include <NetworkManager.h>
G_BEGIN_DECLS G_BEGIN_DECLS
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#ifndef NMT_EDITOR_PAGE_H #ifndef NMT_EDITOR_PAGE_H
#define NMT_EDITOR_PAGE_H #define NMT_EDITOR_PAGE_H
#include <nm-connection.h> #include <NetworkManager.h>
#include "nmt-page-grid.h" #include "nmt-page-grid.h"
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#ifndef NMT_EDITOR_H #ifndef NMT_EDITOR_H
#define NMT_EDITOR_H #define NMT_EDITOR_H
#include <nm-connection.h> #include <NetworkManager.h>
#include "nmt-newt.h" #include "nmt-newt.h"
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#include <string.h> #include <string.h>
#include <dbus/dbus-glib.h> #include <dbus/dbus-glib.h>
#include <nm-utils.h> #include <NetworkManager.h>
#include "nmt-mac-entry.h" #include "nmt-mac-entry.h"
......
...@@ -30,8 +30,7 @@ ...@@ -30,8 +30,7 @@
#include <glib.h> #include <glib.h>
#include <glib/gi18n-lib.h> #include <glib/gi18n-lib.h>
#include <nm-device.h> #include <NetworkManager.h>
#include <nm-utils.h>
#include "nmt-page-main.h" #include "nmt-page-main.h"
#include "nmt-device-entry.h" #include "nmt-device-entry.h"
......
...@@ -26,8 +26,6 @@ ...@@ -26,8 +26,6 @@
#include <glib.h> #include <glib.h>
#include <glib/gi18n-lib.h> #include <glib/gi18n-lib.h>
#include <nm-device-ethernet.h>
#include "nm-editor-bindings.h" #include "nm-editor-bindings.h"
#include "nmt-page-vlan.h" #include "nmt-page-vlan.h"
......
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
#include <glib.h> #include <glib.h>
#include <glib/gi18n-lib.h> #include <glib/gi18n-lib.h>
#include <nm-utils.h>
#include "nmt-page-wifi.h" #include "nmt-page-wifi.h"
#include "nmt-mac-entry.h" #include "nmt-mac-entry.h"
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#ifndef NMT_ROUTE_EDITOR_H #ifndef NMT_ROUTE_EDITOR_H
#define NMT_ROUTE_EDITOR_H #define NMT_ROUTE_EDITOR_H
#include <nm-connection.h> #include <NetworkManager.h>
#include "nmt-newt.h" #include "nmt-newt.h"
......
...@@ -33,8 +33,7 @@ ...@@ -33,8 +33,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <glib/gi18n-lib.h> #include <glib/gi18n-lib.h>
#include <nm-setting-ip4-config.h> #include <NetworkManager.h>
#include <nm-setting-ip6-config.h>
#include "nmt-route-entry.h" #include "nmt-route-entry.h"
#include "nmt-ip-entry.h" #include "nmt-ip-entry.h"
......
...@@ -32,7 +32,8 @@ ...@@ -32,7 +32,8 @@
#include <glib/gi18n-lib.h> #include <glib/gi18n-lib.h>
#include <dbus/dbus-glib.h> #include <dbus/dbus-glib.h>
#include <nm-utils.h> #include <NetworkManager.h>
#include <nm-utils-private.h>
#include "nmt-route-table.h" #include "nmt-route-table.h"
#include "nmt-route-entry.h" #include "nmt-route-entry.h"
......
...@@ -35,8 +35,6 @@ ...@@ -35,8 +35,6 @@
#include <dbus/dbus-glib.h> #include <dbus/dbus-glib.h>
#include <glib/gi18n-lib.h> #include <glib/gi18n-lib.h>
#include <nm-utils.h>
#include "nmt-secret-agent.h" #include "nmt-secret-agent.h"
#include "nmt-newt.h" #include "nmt-newt.h"
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#ifndef NMT_SECRET_AGENT_H #ifndef NMT_SECRET_AGENT_H
#define NMT_SECRET_AGENT_H #define NMT_SECRET_AGENT_H
#include <nm-secret-agent.h> #include <NetworkManager.h>
G_BEGIN_DECLS G_BEGIN_DECLS
......
...@@ -27,8 +27,7 @@ ...@@ -27,8 +27,7 @@
#include "config.h" #include "config.h"
#include <glib/gi18n-lib.h> #include <glib/gi18n-lib.h>
#include <NetworkManager.h>
#include <nm-remote-connection.h>
#include "nmt-slave-list.h" #include "nmt-slave-list.h"
......
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
#include <stdlib.h> #include <stdlib.h>
#include <glib/gi18n-lib.h> #include <glib/gi18n-lib.h>
#include <nm-utils.h>
#include "nmt-newt.h" #include "nmt-newt.h"
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <glib/gi18n-lib.h> #include <glib/gi18n-lib.h>
#include <nm-utils.h> #include <NetworkManager.h>
#include "nmtui.h" #include "nmtui.h"
#include "nmtui-edit.h" #include "nmtui-edit.h"
......
...@@ -33,10 +33,7 @@ ...@@ -33,10 +33,7 @@
#include <glib.h> #include <glib.h>
#include <glib/gi18n-lib.h> #include <glib/gi18n-lib.h>
#include <nm-client.h> #include <NetworkManager.h>
#include <nm-connection.h>
#include <nm-remote-settings.h>
#include <nm-utils.h>
#include "nmt-newt.h" #include "nmt-newt.h"
#include "nm-editor-bindings.h" #include "nm-editor-bindings.h"
......
...@@ -19,8 +19,7 @@ ...@@ -19,8 +19,7 @@