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 = \
-I${top_builddir}/libnm-core \
$(GLIB_CFLAGS) \
$(DBUS_CFLAGS) \
-DNETWORKMANAGER_COMPILATION \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
-DNMCONFDIR=\"$(nmconfdir)\" \
-DSYSCONFDIR=\"$(sysconfdir)\" \
......
......@@ -5,6 +5,7 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/libnm-core \
-I$(top_builddir)/libnm-core \
-I$(top_srcdir)/callouts \
-DNETWORKMANAGER_COMPILATION \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
$(GLIB_CFLAGS) \
$(DBUS_CFLAGS)
......
......@@ -31,6 +31,7 @@
#include "nm-dbus-glib-types.h"
#include "nm-dispatcher-api.h"
#include "nm-utils.h"
#include "nm-utils-private.h"
/*******************************************/
......
......@@ -22,14 +22,6 @@
#ifndef 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"
gboolean print_ip4_config (NMIP4Config *cfg4, NmCli *nmc, const char *group_prefix, const char *one_field);
......
......@@ -33,25 +33,6 @@
#include <readline/readline.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 "common.h"
#include "settings.h"
......
......@@ -29,39 +29,6 @@
#include <glib.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 "common.h"
#include "devices.h"
......
......@@ -25,8 +25,6 @@
#include <glib.h>
#include <glib/gi18n.h>
#include <nm-client.h>
#include <nm-setting-connection.h>
#include "utils.h"
#include "network-manager.h"
......
......@@ -33,9 +33,6 @@
#include <glib.h>
#include <glib/gi18n.h>
#include <nm-client.h>
#include <nm-setting-connection.h>
#include <nm-remote-settings.h>
#include "nmcli.h"
#include "utils.h"
......
......@@ -20,10 +20,7 @@
#ifndef NMC_NMCLI_H
#define NMC_NMCLI_H
#include <glib.h>
#include <nm-client.h>
#include <nm-remote-settings.h>
#include <NetworkManager.h>
/* nmcli exit codes */
typedef enum {
......
......@@ -25,7 +25,6 @@
#include <glib.h>
#include <glib/gi18n.h>
#include <nm-utils.h>
#include "utils.h"
#include "common.h"
......
......@@ -20,30 +20,6 @@
#ifndef 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 "utils.h"
......
......@@ -20,8 +20,6 @@
#ifndef NMC_UTILS_H
#define NMC_UTILS_H
#include <glib.h>
#include "nmcli.h"
/* === Types === */
......
......@@ -40,7 +40,7 @@
#include <glib/gi18n.h>
#include "nm-client.h"
#include <NetworkManager.h>
#define PROGRESS_STEPS 15
#define WAIT_STARTUP_TAG "wait-startup"
......
......@@ -19,10 +19,7 @@
#ifndef NM_EDITOR_BINDINGS_H
#define NM_EDITOR_BINDINGS_H
#include <glib-object.h>
#include <nm-connection.h>
#include <nm-setting-wireless-security.h>
#include <nm-setting-vlan.h>
#include <NetworkManager.h>
G_BEGIN_DECLS
......
......@@ -28,16 +28,7 @@
#include "config.h"
#include <glib/gi18n.h>
#include <nm-utils.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 <NetworkManager.h>
#include "nm-editor-utils.h"
#if 0
......
......@@ -19,8 +19,7 @@
#ifndef NM_EDITOR_UTILS_H
#define NM_EDITOR_UTILS_H
#include <glib-object.h>
#include <nm-remote-settings.h>
#include <NetworkManager.h>
G_BEGIN_DECLS
......
......@@ -29,9 +29,7 @@
#include <stdlib.h>
#include <glib/gi18n-lib.h>
#include <nm-access-point.h>
#include <nm-device-wifi.h>
#include <nm-utils.h>
#include <NetworkManager.h>
#include "nmtui.h"
#include "nmt-connect-connection-list.h"
......
......@@ -41,9 +41,7 @@
#include <linux/if_arp.h>
#include <glib/gi18n-lib.h>
#include <nm-device.h>
#include <nm-device-infiniband.h>
#include <nm-utils.h>
#include <NetworkManager.h>
#include "nmtui.h"
#include "nmt-device-entry.h"
......
......@@ -21,8 +21,7 @@
#include "nmt-page-grid.h"
#include <nm-connection.h>
#include <nm-device.h>
#include <NetworkManager.h>
G_BEGIN_DECLS
......
......@@ -21,7 +21,7 @@
#include "nmt-newt.h"
#include <nm-remote-connection.h>
#include <NetworkManager.h>
G_BEGIN_DECLS
......
......@@ -19,7 +19,7 @@
#ifndef NMT_EDITOR_PAGE_H
#define NMT_EDITOR_PAGE_H
#include <nm-connection.h>
#include <NetworkManager.h>
#include "nmt-page-grid.h"
......
......@@ -19,7 +19,7 @@
#ifndef NMT_EDITOR_H
#define NMT_EDITOR_H
#include <nm-connection.h>
#include <NetworkManager.h>
#include "nmt-newt.h"
......
......@@ -31,7 +31,7 @@
#include <string.h>
#include <dbus/dbus-glib.h>
#include <nm-utils.h>
#include <NetworkManager.h>
#include "nmt-mac-entry.h"
......
......@@ -30,8 +30,7 @@
#include <glib.h>
#include <glib/gi18n-lib.h>
#include <nm-device.h>
#include <nm-utils.h>
#include <NetworkManager.h>
#include "nmt-page-main.h"
#include "nmt-device-entry.h"
......
......@@ -26,8 +26,6 @@
#include <glib.h>
#include <glib/gi18n-lib.h>
#include <nm-device-ethernet.h>
#include "nm-editor-bindings.h"
#include "nmt-page-vlan.h"
......
......@@ -31,7 +31,6 @@
#include <glib.h>
#include <glib/gi18n-lib.h>
#include <nm-utils.h>
#include "nmt-page-wifi.h"
#include "nmt-mac-entry.h"
......
......@@ -19,7 +19,7 @@
#ifndef NMT_ROUTE_EDITOR_H
#define NMT_ROUTE_EDITOR_H
#include <nm-connection.h>
#include <NetworkManager.h>
#include "nmt-newt.h"
......
......@@ -33,8 +33,7 @@
#include <stdlib.h>
#include <glib/gi18n-lib.h>
#include <nm-setting-ip4-config.h>
#include <nm-setting-ip6-config.h>
#include <NetworkManager.h>
#include "nmt-route-entry.h"
#include "nmt-ip-entry.h"
......
......@@ -32,7 +32,8 @@
#include <glib/gi18n-lib.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-entry.h"
......
......@@ -35,8 +35,6 @@
#include <dbus/dbus-glib.h>
#include <glib/gi18n-lib.h>
#include <nm-utils.h>
#include "nmt-secret-agent.h"
#include "nmt-newt.h"
......
......@@ -19,7 +19,7 @@
#ifndef NMT_SECRET_AGENT_H
#define NMT_SECRET_AGENT_H
#include <nm-secret-agent.h>
#include <NetworkManager.h>
G_BEGIN_DECLS
......
......@@ -27,8 +27,7 @@
#include "config.h"
#include <glib/gi18n-lib.h>
#include <nm-remote-connection.h>
#include <NetworkManager.h>
#include "nmt-slave-list.h"
......
......@@ -32,7 +32,6 @@
#include <stdlib.h>
#include <glib/gi18n-lib.h>
#include <nm-utils.h>
#include "nmt-newt.h"
......
......@@ -28,7 +28,7 @@
#include <stdlib.h>
#include <glib/gi18n-lib.h>
#include <nm-utils.h>
#include <NetworkManager.h>
#include "nmtui.h"
#include "nmtui-edit.h"
......
......@@ -33,10 +33,7 @@
#include <glib.h>
#include <glib/gi18n-lib.h>
#include <nm-client.h>
#include <nm-connection.h>
#include <nm-remote-settings.h>
#include <nm-utils.h>
#include <NetworkManager.h>
#include "nmt-newt.h"
#include "nm-editor-bindings.h"
......
......@@ -19,8 +19,7 @@
#ifndef NMTUI_H
#define NMTUI_H
#include <nm-client.h>
#include <nm-remote-settings.h>
#include <NetworkManager.h>
G_BEGIN_DECLS
......
......@@ -29,12 +29,7 @@
#include <glib.h>
#include <dbus/dbus-glib.h>
#include <nm-connection.h>
#include <nm-setting-connection.h>
#include <nm-setting-wired.h>
#include <nm-setting-ip4-config.h>
#include <nm-dbus-interface.h>
#include <nm-utils.h>
#include <NetworkManager.h>
#define DBUS_TYPE_G_MAP_OF_VARIANT (dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_VALUE))
#define DBUS_TYPE_G_MAP_OF_MAP_OF_VARIANT (dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, DBUS_TYPE_G_MAP_OF_VARIANT))
......
......@@ -28,13 +28,7 @@
*/
#include <glib.h>
#include <nm-remote-settings.h>
#include <nm-connection.h>
#include <nm-setting-connection.h>
#include <nm-setting-wired.h>
#include <nm-setting-ip4-config.h>
#include <nm-utils.h>
#include <NetworkManager.h>
static void
added_cb (NMRemoteSettings *settings,
......
......@@ -30,12 +30,7 @@
#include <glib.h>
#include <dbus/dbus-glib.h>
#include <nm-connection.h>
#include <nm-setting-connection.h>
#include <nm-setting-wired.h>
#include <nm-setting-ip4-config.h>
#include <nm-dbus-interface.h>
#include <nm-utils.h>
#include <NetworkManager.h>
#define DBUS_TYPE_G_MAP_OF_VARIANT (dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_VALUE))
#define DBUS_TYPE_G_MAP_OF_MAP_OF_VARIANT (dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, DBUS_TYPE_G_MAP_OF_VARIANT))
......
......@@ -29,12 +29,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <nm-client.h>
#include <nm-device.h>
#include <nm-device-wifi.h>
#include <nm-access-point.h>
#include <nm-dbus-interface.h>
#include <nm-utils.h>
#include <NetworkManager.h>
/* Convert flags to string */
static char *
......
......@@ -29,7 +29,7 @@
#include <dbus/dbus-glib.h>
#include <stdio.h>
#include <nm-dbus-interface.h>
#include <NetworkManager.h>
#define DBUS_TYPE_G_ARRAY_OF_OBJECT_PATH (dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_G_OBJECT_PATH))
......
......@@ -29,11 +29,7 @@
#include <stdlib.h>
#include <signal.h>
#include <nm-connection.h>
#include <nm-setting-connection.h>
#include <nm-dbus-interface.h>
#include <nm-utils.h>
#include <nm-remote-settings.h>
#include <NetworkManager.h>
/* Global variables */
......
......@@ -5,6 +5,7 @@ SUBDIRS = . tests
AM_CPPFLAGS = \
-I${top_srcdir}/include \
-DG_LOG_DOMAIN=\""libnm"\" \
-DNETWORKMANAGER_COMPILATION \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
$(GLIB_CFLAGS) \
$(DBUS_CFLAGS)
......
......@@ -58,7 +58,6 @@
/**
* SECTION:nm-connection
* @short_description: Describes a connection to specific network or provider
* @include: nm-connection.h
*
* An #NMConnection describes all the settings and configuration values that
* are necessary to configure network devices for operation on a specific
......
......@@ -23,6 +23,10 @@
#ifndef NM_CONNECTION_H
#define NM_CONNECTION_H
#if !defined (__NETWORKMANAGER_H_INSIDE__) && !defined (NETWORKMANAGER_COMPILATION)
#error "Only <NetworkManager.h> can be included directly."
#endif
#include <glib.h>
#include <glib-object.h>
#include <nm-setting.h>
......
......@@ -35,7 +35,6 @@
/**
* SECTION:nm-setting-8021x
* @short_description: Describes 802.1x-authenticated connection properties
* @include: nm-setting-8021x.h
*
* The #NMSetting8021x object is a #NMSetting subclass that describes
* properties necessary for connection to 802.1x-authenticated networks, such as
......
......@@ -23,6 +23,10 @@
#ifndef NM_SETTING_8021X_H
#define NM_SETTING_8021X_H
#if !defined (__NETWORKMANAGER_H_INSIDE__) && !defined (NETWORKMANAGER_COMPILATION)
#error "Only <NetworkManager.h> can be included directly."
#endif
#include <nm-setting.h>
G_BEGIN_DECLS
......
......@@ -30,7 +30,6 @@
/**
* SECTION:nm-setting-adsl
* @short_description: Describes ADSL-based properties
* @include: nm-setting-adsl.h
*
* The #NMSettingAdsl object is a #NMSetting subclass that describes
* properties of ADSL connections.
......
......@@ -22,6 +22,10 @@
#ifndef NM_SETTING_ADSL_H
#define NM_SETTING_ADSL_H
#if !defined (__NETWORKMANAGER_H_INSIDE__) && !defined (NETWORKMANAGER_COMPILATION)
#error "Only <NetworkManager.h> can be included directly."
#endif
#include <nm-setting.h>
G_BEGIN_DECLS
......
......@@ -34,7 +34,6 @@
/**
* SECTION:nm-setting-bluetooth
* @short_description: Describes Bluetooth connection properties
* @include: nm-setting-bluetooth.h
*
* The #NMSettingBluetooth object is a #NMSetting subclass that describes