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).
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>
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.)
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
* 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
* 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
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
* 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
* 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