Commit graph

32 commits

Author SHA1 Message Date
Dan Winship 6793a32a8c libnm: port to GDBus
Port libnm-core/libnm to GDBus.

The NetworkManager daemon continues to use dbus-glib; the
previously-added connection hash/variant conversion methods are now
moved to NetworkManagerUtils (along with a few other utilities that
are now only needed by the daemon code).
2014-09-18 11:51:09 -04:00
Dan Winship 1a5cfc1f45 dispatcher: port to GDBus
Port nm-dispatcher to GDBus, mostly, using dbus-glib's GVariant
utilities to translate the return value of nm_connection_to_dbus().
2014-09-18 11:26:59 -04:00
Thomas Haller e1de236db1 build: add configure option not to install udev rules
Previously, user could only change the udev base directory,
but not disabling installation entirely.

Support this now with:
  ./configure --with-udev-dir=no
or
  ./configure --without-udev-dir

Also, just passing '--with-udev-dir' equals '--with-udev-dir=yes'.
Treat 'yes' equal to the default '/lib/udev'.

Also, check that the path is an absolute path starting with a '/'.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-08-26 19:37:51 +02:00
Dan Winship d0b05b34d5 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.)
2014-08-01 14:34:40 -04:00
Dan Winship a7c4d53d03 all: port everything to libnm
Since the API has not changed at this point, this is mostly just a
matter of updating Makefiles, and changing references to the library
name in comments.

NetworkManager cannot link to libnm due to the duplicated type/symbol
names. So it links to libnm-core.la directly, which means that
NetworkManager gets a separate copy of that code from libnm.so.
Everything else links to libnm.
2014-08-01 14:34:05 -04:00
Dan Winship 30c74c6007 build: more srcdir!=builddir fixes
nm-version.h was getting disted, making srcdir!=builddir work for
tarball builds, but not for git builds.

Also, remove "-I${top_builddir}/include" from all Makefile.ams, since
there's nothing generated in include/ any more.
2014-07-15 11:37:19 -04:00
Thomas Haller fb88ec99f1 build: create dispatcher directories pre-down.d and pre-up.d
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-07 01:17:16 +02:00
Dan Williams 4cc13befd3 dispatcher: rename executable to 'nm-dispatcher' 2014-06-06 13:43:45 -05:00
Dan Winship 9c4d86ee80 libnm-util, libnm-glib: add versioned deprecation/availability macros
Add versioned NM_DEPRECATED_IN_* and NM_AVAILABLE_IN_* macros, and tag
new/deprecated functions accordingly. (All currently-deprecated
functions are assumed to have been deprecated in 0.9.10.)

Add NM_VERSION_MIN_REQUIRED and NM_VERSION_MAX_ALLOWED macros which
can be set to determine which versions will cause warnings.

With the current settings, external consumers of the
libnm-util/libnm-glib APIs will have MIN_REQUIRED and MAX_ALLOWED both
set to NM_VERSION_0_9_8 by default, meaning they will get warnings
about functions added in 0.9.10. NM internally sets
NM_VERSION_MAX_ALLOWED to NM_VERSION_NEXT_STABLE to ensure that it is
always allowed to use all APIs.
2014-02-13 11:24:37 -05:00
Dan Winship bfce3f7dc8 build: switch from $(INCLUDES) to $(AM_CPPFLAGS) to make automake happy
Unfortunately, $(AM_CPPFLAGS) gets overridden by per-target _CPPFLAGS
variables, which $(INCLUDES) did not, so this requires some additional
changes.

In most places, I have just gotten rid of the per-target _CPPFLAGS
variables; in directories with a single target, the per-target
variable is unnecessary, and in directories with multiple targets, the
per-target variable is often undesirable, since it forces some files
to be compiled twice, even though there ends up being no difference
between the two files.
2013-08-22 11:49:16 -04:00
Dan Williams b69171061c dhcp: use private socket to return status if available
Allows DHCP to work when a bus daemon isn't running.  This also
fixes a race condition where when multiple interfaces are attempting
to get a DHCP lease at the same time, if one DHCP client instance
triggers the callout, that instance gets the bus name, and any
other client triggering the callout at that time will fail because
the bus name is already taken.  Since this commit allows using
a private socket, where no process has a bus name, this race is
avoided.

Also move the DHCP helper from callouts/ to src/dhcp-manager/ to
consolidate all the DHCP stuff and clean up some of the helper's
code.
2013-04-08 11:30:31 -05:00
Pavel Šimerda faa1bcb540 build: improve documentation and test configure options
Use --enable-doc and --enable-tests instead of --with-docs and
--with-tests. This is consistent with other features and with
--enable-gtk-doc option. Support current variants as fallback.

Don't build tests unless --enable-tests is specified.
2012-11-13 20:23:06 +01:00
Pavel Šimerda d82669d3fd build: unify NetworkManager path handling (some paths are changed)
Use autoconf/automake variables for NetworkManager paths. Use
NetworkManager subdirectory where appropriate.

Files in /var/run (or /run on some distros) are moved into a separate
directory as is usual with other daemons. It makes the filesystem
more readable and file prefixing unnecessary.

/var/run/NetworkManager.pid -> /var/run/NetworkManager/NetworkManager.pid
/var/run/nm-dns-dnsmasq.pid -> /var/run/NetworkManager/dnsmasq.pid
/var/run/nm-dns-dnsmasq.conf -> /var/run/NetworkManager/dnsmasq.conf

The /var/run/NetworkManager directory is created at runtime, if it doesn't
exist.

Note: Path-based security policies like SELinux and AppArmor may need to
be adapted.
2012-11-05 14:01:47 +01:00
Colin Walters 59f2cd0f8d build: remove G_DISABLE_DEPRECATED
This functionality is (mostly) obsoleted by the newer
GLIB_VERSION_MIN_REQUIRED and GLIB_VERSION_MAX_ALLOWED defines.  With
this, your build doesn't all of a sudden blow up if we deprecate
something in GLib - you have to explicitly opt-in to the newer
version.

G_DISABLE_DEPRECATED does still apply for macros and things that can't
take __attribute__((deprecated)), but it's not really worth the pain
and cargo culting around just for that.
2012-10-31 19:41:07 +01:00
Dan Williams 757a34fcdd callouts: remove glib code from DHCP callout
The whole callout is pure dbus, not dbus-glib, so there's really no need
for glib code there.  Even so, DBUS_LIBS contains dbus-glib and gobject,
so we're still linking to glib/gobject.
2012-07-16 19:54:07 -05:00
Colin Walters 74ec56d956 build: fix srcdir != builddir for new generated headers 2012-02-22 16:27:28 -06:00
Colin Walters dab7dfaf35 build: fix srcdir != builddir
nm-version.h is in ${top_builddir}/include.
2012-01-09 14:20:36 -06:00
Dan Williams f898dbf1a9 dispatcher: enhance dispatcher script environment (bgo #648382)
For VPN connections, the interface name would be that of the VPN's
IP interface, but the script environment would be the that of the
VPN's parent device.  Enhance the environment by adding any VPN
specific details as additional environment variables prefixed by
"VPN_".  Leave the existing environment setup intact for backwards
compatiblity.

Additionally, the dispatcher never got updated for IPv6 support,
so push IPv6 configuration and DHCPv6 configuration into the
environment too.

Even better, push everything the dispatcher needs to it instead
of making the dispatcher make D-Bus requests back to NM, which
sometimes fails if NM has already torn down the device or the
connection which the device was using.

And add some testcases to ensure that we don't break backwards compat,
the testcases here were grabbed from a 0.8.4 machine with a hacked up
dispatcher to dump everything it was given from NM.
2011-05-02 22:54:28 -05:00
Pablo Castellano ce5c0d5ac6 build: enable AM_SILENT_RULES (bgo #625263) 2010-08-03 12:58:46 -07:00
Dan Williams 58fcc8efe6 libnm-glib: libnm_glib -> libnm-glib
Bothered me for a long time; now that we've bumped the soname, we can
rename the library too.
2009-08-26 13:07:35 -05:00
Dan Williams 537c2f1f86 build: always link locally-built libraries first (bgo #580131) 2009-08-20 12:31:17 -05:00
Daniel Drake ff88cf12c2 olpc: add mesh device logic and config setting 2009-08-05 16:34:02 -04:00
Michael Biebl 1c3c6c2a66 Remove DBUS_API_SUBJECT_TO_CHANGE
We require dbus 1.1 anyway
2009-05-02 18:00:22 -04:00
Dan Williams 73659e724c makefile cleanups
0.7 requires dbus 1.1 or greater (for system bus activation), so make that
explicit, and remove compat code for D-Bus 0.6 and earlier.  Consolidate
the various glib pkgconfig checks into one, since most anything will require
gthread, glib, and gobject anyway.  Fixup the docs makefile to be more
automake-compatible and let 'make clean' actually work correctly when
docs are built.
2009-02-15 11:20:25 -05:00
Dan Williams a419bdfb9e 2008-08-17 Dan Williams <dcbw@redhat.com>
* callouts/Makefile.am
	  src/Makefile.am
		- Move dispatcher directory creation to callouts/Makefile.am

	* system-settings/plugins/keyfile/Makefile.am
		- Create keyfile connections directory in DESTDIR (bgo #546833)



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3976 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-08-17 22:54:49 +00:00
Dan Williams 641a7072b8 2008-08-07 Dan Williams <dcbw@redhat.com>
* callouts/nm-dispatcher-action.c
		- (nm_dispatcher_action): grab device path and create the device; pass
			the device's DHCP4 config to script caller
		- (dispatch_scripts): dump the DHCP4 config to the environment of called
			scripts

	* libnm-glib/nm-dhcp4-config.c
	  libnm-glib/nm-dhcp4-config.h
		- (nm_dhcp4_config_get_options): expose
		- (nm_dhcp4_config_get_one_option): renamed from nm_dhcp4_config_get_option



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3907 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-08-07 17:47:08 +00:00
Dan Williams 64f1a1d423 2008-07-09 Dan Williams <dcbw@redhat.com>
* callouts/Makefile.am
	  callouts/nm-avahi-autoipd-action.c
	  callouts/nm-avahi-autoipd.conf
		- avahi-autoipd callout to send options back to NM

	* src/autoip.c
	  src/autoip.h
		- remove

	* src/nm-device.c
	  src/nm-device-private.h
	  src/nm-manager.c
		- Use avahi-autoipd for IPv4LL functionality rather than really crappy
			old custom stuff



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3816 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-07-09 14:05:49 +00:00
Dan Williams 8afd2d8ecd 2008-06-26 Dan Williams <dcbw@redhat.com>
Patch from Michael Biebl <biebl@debian.org>

	* Clean up build system stuff



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3773 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-06-26 17:34:04 +00:00
Dan Williams c39d6e32d8 2008-05-01 Dan Williams <dcbw@redhat.com>
Patch from Michael Biebl <biebl@debian.org>

	* callouts/Makefile.am
	  callouts/org.freedesktop.nm_dispatcher.service.in
	  system-settings/src/Makefile.am
	  system-settings/src/org.freedesktop.NetworkManagerSystemSettings.service.in
		- use the right install location for dbus-activated stuff



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3624 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-05-01 10:11:14 +00:00
Dan Williams 74e56e23e8 2008-04-27 Dan Williams <dcbw@redhat.com>
* callouts/Makefile.am
	  callouts/nm-dispatcher-action.c
	  callouts/nm-dispatcher-action.h
	  callouts/nm-dispatcher.conf
	  callouts/nm-dispatcher.xml
	  callouts/org.freedesktop.nm_dispatcher.service
		- Re-implement the dispatcher as a system-bus activated service that
			NM calls on-demand, rather than an always running daemon

	* src/Makefile.am
		- Add callouts dir to includes to pick up dispatcher defines

	* src/nm-device.c
		- (nm_device_state_changed): call dispatcher on device activated/
			deactivated

	* src/vpn-manager/nm-vpn-connection.c
		- (nm_vpn_connection_set_vpn_state): call dispatcher when VPN connections
			go up and down

	* src/NetworkManagerUtils.c
	  src/NetworkManagerUtils.h
		- (nm_utils_call_dispatcher): helper to call dispatcher



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3607 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-04-27 14:30:06 +00:00
Dan Williams 93f08e2f11 2007-08-14 Dan Williams <dcbw@redhat.com>
* callouts/Makefile.am
	  src/dhcp-manager/nm-dhcp-manager.c
	  src/dhcp-manager/nm-dhcp-manager.h
	  src/dhcp-manager/Makefile.am
		- Change install location of nm-dhcp-client.action to ${prefix}/libexec



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2682 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-08-14 18:35:38 +00:00
Dan Williams ff4c26f965 2007-08-12 Dan Williams <dcbw@redhat.com>
* Makefile.am
	  configure.in
	  callouts/Makefile.am
	  callouts/nm-dhcp-client-action.c
	  callouts/nm-dhcp-client.conf
		- Add dhclient-executed callout that takes the place of dhclient-script
		and dhcdbd, pushing DHCP options out to the system bus as a signal that
		NM then listens for



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2664 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-08-12 15:21:15 +00:00