Commit graph

523 commits

Author SHA1 Message Date
Lubomir Rintel da13c7a1a4 libnm-core: add NMSettingTCConfig with qdisc support
Currently is only able to hold the queueing disciplines.
2017-12-11 10:52:22 +01:00
Thomas Haller 79d5a06c8b build: don't link libnm against libjansson when building --without-json-validation
Also, don't add the CFLAGS for libjansson to dflt_cppflags_libnm_core.
dflt_cppflags_libnm_core is used also by core and libnm. But those
components do not (directly) link against libjansson. The cannot use
these flags.
2017-12-08 11:09:34 +01:00
Thomas Haller b1c65d32fe Revert "Makefile: rework team compilation flags"
I don't think we should do this.

- renamining/dropping configure options is still an annoyance,
  because it requires to different ./configure options depending
  on the version. The rename from --enable-teamctl to --enable-team
  might be theoretically nice, but more annoying then helpful.

- There is no strict dependency between --enable-team and
  --enable-json-validation. At most, one could argue that
  when enabling the team plugin (--enable-teamctl), then
  libnm must also be build with --enable-json-validation.
  But in fact, the team plugin will happily work with a
  libnm that doesn't link against libjansson.
  That is --enable-teamctl --disable-json-validation will work
  in practice just fine.
  On the other hand, libnm is a client library to create connection
  profiles, fully supporting team profiles also makes sense if the
  actual plugin is not installed (or build). Thus, --disable-teamctl
  --enable-json-validation certainly makes sense.

At this point, one might ask whether libnm is even still complete without
libjansson. Maybe libnm should *require* --enable-json-validation.
But that is not what the patch was doing, and it would also need
some careful consideration before doing so.

This reverts commit 9d5cd7eae8.
2017-12-08 09:07:30 +01:00
Francesco Giudici 9d5cd7eae8 Makefile: rework team compilation flags
Rename the team functionality enablement from 'teamdctl' to 'team'.
Force jansson lib requirement for team functionality: NetworkManager
requires the teamd daemon to manage team. As teamd depends upon jansson
lib, adding jansson requirement for teaming support in NetworkManager
seems reasonable.
Remove the jansson_validation flag, as the only generic json function in
nmcli (not related to team) was the one to check if a string was in json
format. Anyway, that function is used for team checks only. So, move
also json validation functions under the WITH_TEAM flag.
2017-12-08 00:46:27 +01:00
Lubomir Rintel 9bb30f86ec libnm-core: merge the settings tests into a single one
Thomas likes this more and who am I to argue.
2017-12-08 00:46:27 +01:00
Beniamino Galvani 9c27d73b2e build: fix path in Makefile
Fixes: 8e172eb984
2017-12-06 09:23:21 +01:00
Thomas Haller 8e172eb984 ifcfg-rh: move nm-inotify-helper to ifcfg-rh plugin
The helper is only used by ifcfg-rh. Move it to the plugin.
2017-12-05 19:57:24 +01:00
Thomas Haller 272439cb20 shared/compat: add compat for nm_setting_vpn_get_data_keys() and nm_setting_vpn_get_secret_keys() 2017-11-23 14:44:25 +01:00
Thomas Haller 1cb147663b shared: add nm-utils/nm-compat.h 2017-11-23 14:44:25 +01:00
Thomas Haller c512a01853 build: fix link failure of src/tests/test-systemd (2)
Actually, test-systemd only needs siphash24.c, not the
other parts.

Fixes: ac95f7da0b
2017-11-16 12:03:56 +01:00
Thomas Haller bfa7ae679a build: fix link failure of src/tests/test-systemd
Fixes: ac95f7da0b
2017-11-16 11:59:59 +01:00
Thomas Haller ac95f7da0b build: include "siphash24.c" source in "nm-hash-utils.c"
This allows the compiler to inline the siphash24*() functions
for nm_hash_ptr() and nm_hash_str() (even without LTO).

This of course only applies to nm_hash_ptr() and nm_hash_str(),
which are implemented in "nm-hash-utils.c" itself. All other
nm_hash_*() functions are inline functions in "nm-hash-utils.h",
and thus these functions can be inlined instead. That is, in
other cases, the nm_hash_*() function instead can be inlined.
For nm_hash_ptr() and nm_hash_str() instead we want to inline the
siphash24*() functions.

So, no longer compile "siphash24.c" directly. Instead, only
build "nm-hash-utils.c" which internally #include "siphash24.c".
2017-11-16 11:49:52 +01:00
Beniamino Galvani 30f679c444 build: fix 'make distcheck'
CC       src/systemd/src/basic/src_libsystemd_nm_la-string-table.lo
 ../../src/systemd/src/basic/parse-util.c:30:10: fatal error: 'errno-list.h' file not found
 #include "errno-list.h"
         ^~~~~~~~~~~~~~

Fixes: 1a2419a0c9
2017-11-15 18:49:09 +01:00
Thomas Haller 0ed49717ab all: support route-attribute "onlink" for IPv4
Kernel doesn't support it for IPv6.

This is especially useful, if you combine static routes
with DHCP. In that case, you might want to get the device-route
to the gateway automatically, but add a static-route for it.
2017-11-13 11:35:44 +01:00
Thomas Haller 11b241eb1c shared: add jansson.h compatibility and utils header 2017-11-09 17:32:22 +01:00
Beniamino Galvani c3efedf54b libnm: add checkpoint support 2017-11-09 10:12:30 +01:00
Beniamino Galvani b227198e92 build: fix make distcheck
Fixes the following errors in 'make distcheck':

1)
  GEN      libnm/fake-typelib/NMClient.typelib
 failed to open 'libnm/fake-typelib/NMClient.typelib.tmp': No such file or directory
 make[2]: *** [libnm/fake-typelib/NMClient.typelib] Error 1

2)
  GEN      libnm/fake-typelib/typelibs.c
 ../../libnm/fake-typelib/typelibs.gresource.xml: Failed to locate “NetworkManager.typelib” in any source directory.
 make[1]: *** [Makefile:17790: libnm/fake-typelib/typelibs.c] Error 1

3)
 ERROR: files left in build directory after distclean:
 ./libnm/fake-typelib/typelibs.c
 ./libnm/fake-typelib/NMClient.typelib
 ./libnm/fake-typelib/NetworkManager.typelib

Fixes: 4d1f090aed
2017-11-08 18:49:49 +01:00
Beniamino Galvani 29a576496e ifcfg-rh: persist the connection type for TeamPort connections
Currently the ifcfg-rh plugin doesn't explicitly store the connection
type for team slaves and is only able to read back ethernet and vlan
connections.

Leave this unchanged for ethernet and vlan slaves, but store the TYPE
variable for other connection types (Wi-Fi and Infiniband) so that we
can properly determine their type when the connection is read.
2017-11-06 16:40:57 +01:00
Thomas Haller 84878ac4e4 build: fix glib-compile-resources for unsupported --internal flag
Travis' version of glib-compile-resources does not support the
--internal flag:

    GEN      libnm/fake-typelib/typelibs.c
  Unknown option --internal
  make: *** [libnm/fake-typelib/typelibs.c] Error 1

We don't really need it anyway, because we have a linker version
script, that controls symbol visibility.

Fixes: 4d1f090aed
2017-11-06 14:47:27 +01:00
Lubomir Rintel a172b901d5 build: make dist with fake typelibs
Fixes: 4d1f090aed
2017-11-06 12:01:48 +01:00
Lubomir Rintel 4d1f090aed libnm: register empty NMClient and NetworkManager when loading libnm with GIR
Register empty "NMClient" and "NetworkManager" GIR modules as soon as libnm is
loaded witch gnome-introspection. This prevents the real modules from being
loaded because they would in turn load libnm-glib and abort() and crash.

In particular this prevents the GNOME shell from crashing with
libnm-glib abort and allows gracefully disabling the extensions which
use the obsolete library.

Test:

  $ cat test.js
  const NM = imports.gi.NM;
  print (NM.SecretAgentGetSecretsFlags.ALLOW_INTERACTION);

  const NMClient = imports.gi.NMClient;
  print (NMClient.SecretAgentGetSecretsFlags.ALLOW_INTERACTION);

Before:

  $ gjs test.js
  1

  (gjs:16253): libnm-util-ERROR **: libnm symbols detected; Mixing libnm with libnm-util/libnm-glib is not supported
  Trace/breakpoint trap (core dumped)
  $

After:

  $ gjs test.js
  1
  Gjs-Message: JS WARNING: [test.js 5]: reference to undefined property "SecretAgentGetSecretsFlags"

  (gjs:16228): Gjs-WARNING **: JS ERROR: TypeError: NMClient.SecretAgentGetSecretsFlags is undefined
  @test.js:5:1

  JS_EvaluateScript() failed
2017-11-06 11:47:05 +01:00
Beniamino Galvani a83ab252ee ifcfg-rh: add support for 802-1x.password-raw property
When the ifcfg-rh plugin writes a 802-1x setting it currently ignores
the password-raw property and so the password disappears when the
connection is saved. Add support for the property.
2017-10-31 10:19:49 +01:00
Lubomir Rintel b23f8ceb34 build: always include data/NetworkManager-ovs.conf in dist 2017-10-31 09:11:54 +01:00
Lubomir Rintel 6b532fed50 man: add OpenVSwitch overview 2017-10-30 21:46:55 +01:00
Lubomir Rintel 830a5a14cb device: add support for OpenVSwitch devices 2017-10-30 21:46:55 +01:00
Lubomir Rintel 3f74528a0b libnm: add support for ovs-bridge devices 2017-10-30 17:40:09 +01:00
Lubomir Rintel c536d7e666 libnm: add support for ovs-port devices 2017-10-30 17:40:09 +01:00
Lubomir Rintel e5c19377ec libnm: add support for ovs-interface devices 2017-10-30 17:40:08 +01:00
Lubomir Rintel b5925d693c introspection: add o.fd.NM.Device.OvsBridge interface 2017-10-30 17:40:08 +01:00
Lubomir Rintel 6748c44cb6 introspection: add o.fd.NM.Device.OvsPort interface 2017-10-30 17:40:08 +01:00
Lubomir Rintel b0f3dc0add introspection: add o.fd.NM.Device.OvsInterface interface 2017-10-30 17:40:08 +01:00
Lubomir Rintel cb9b024ddb libnm-core: add ovs-bridge setting 2017-10-30 17:40:08 +01:00
Lubomir Rintel 8a1ae40a80 libnm-core: add ovs-port setting 2017-10-30 17:40:08 +01:00
Lubomir Rintel 27790fa976 libnm-core: add ovs-interface setting 2017-10-30 17:40:08 +01:00
Lubomir Rintel d4a7fe4679 libnm-core: add ovs-patch setting 2017-10-30 17:40:08 +01:00
juga0 3aba3e38c3 dhcp: add support for dhcpcanon client
https://github.com/NetworkManager/NetworkManager/pull/31
2017-10-30 10:43:10 +01:00
Beniamino Galvani 5c2c7d37c3 build: create clients/common/ when building libnmc_base library
Fixes the following build error where gcc fails because the
client/common does not exist yet:

  CC       shared/nm-utils/clients_common_libnmc_base_la-nm-enum-utils.lo
 cc1: error: ./clients/common: No such file or directory [-Werror]
 cc1: all warnings being treated as errors
 make[4]: *** [shared/nm-utils/clients_common_libnmc_base_la-nm-enum-utils.lo] Error 1
 #

 libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I../shared -I./shared -I../libnm-core -I./libnm-core -I../libnm -I./libnm -I../clients/common -I./clients/common ... -c ../shared/nm-utils/nm-enum-utils.c  -fPIC -DPIC -o shared/nm-utils/.libs/clients_common_libnmc_base_la-nm-enum-utils.o
 cc1: error: ./clients/common: No such file or directory [-Werror]

Fixes: 3434261811
2017-10-19 14:21:59 +02:00
Thomas Haller ee76b0979f all: use siphash24 for hashing
siphash24() is wildly used by projects nowadays.

It's certainly slower then our djb hashing that we used before.
But quite likely it's fast enough for us, given how wildly it is
used. I think it would be hard to profile NetworkManager to show
that the performance of hash tables is the issue, be it with
djb or siphash24.

Certainly with siphash24() it's much harder to exploit the hashing
algorithm to cause worst case hash operations (provided that the
seed is kept private). Does this better resistance against a denial
of service matter for us? Probably not, but let's better be safe then
sorry.

Note that systemd's implementation uses a different seed for each hash
table (at least, after the hash table grows to a certain size).
We don't do that and use only one global seed.
2017-10-18 13:27:02 +02:00
Thomas Haller 3434261811 core,clients: use our own string hashing function nm_str_hash()
Replace the usage of g_str_hash() with our own nm_str_hash().

GLib's g_str_hash() uses djb2 hashing function, just like we
do at the moment. The only difference is, that we use a diffrent
seed value.

Note, that we initialize the hash seed with random data (by calling
getrandom() or reading /dev/urandom). That is a change compared to
before.

This change of the hashing function and accessing the random pool
might be undesired for libnm/libnm-core. Hence, the change is not
done there as it possibly changes behavior for public API. Maybe
we should do that later though.

At this point, there isn't much of a change. This patch becomes
interesting, if we decide to use a different hashing algorithm.
2017-10-18 13:05:00 +02:00
Thomas Haller 281d2d9fad shared: split random and hash utils
"nm-utils/nm-shared-utils.h" shall contain utility function without other
dependencies. It is intended to be used by other projects as-is.

nm_utils_random_bytes() requires getrandom() and a HAVE_GETRANDOM configure
check. That makes it more cumbersome to re-use "nm-shared-utils.h", in
cases where you don't care about nm_utils_random_bytes().

Split nm_utils_random_bytes() out to a separate file.

Same for hash utils, which depend on nm_utils_random_bytes(). Also, hash
utils will eventually be extended to use siphash24.
2017-10-17 20:02:59 +02:00
Beniamino Galvani aa964ae969 build: move nm-client-utils.c to libnmc-base.a
In a later commit we'll add a new generic client function used by
nmcli and nmtui. nm-client-utils.c seems the right place for it, so
move the file to the base library that is used by both clients.

While at it, also put in that file some functions that will be needed
by nmtui.
2017-10-16 17:25:35 +02:00
Thomas Haller 01677a3e40 build: cleanup style for toplevel Makefile.am
Use consistently $() instead of ${}.

Don't use the $(top_*) variables, because we don't do recursive make
and the toplevel directory is the same as the current directory.
For consistency, only use the non-toplevel versions of the variables.
2017-09-25 18:23:15 +02:00
Beniamino Galvani 2f66fbf32d build: add missing header file to Makefile
Fixes: 734c5b38ad
2017-09-22 12:06:11 +02:00
Thomas Haller 77ec302714 core: rework handling of default-routes and drop NMDefaultRouteManager
Remove NMDefaultRouteManager. Instead, add the default-route to the
NMIP4Config/NMIP6Config instance.

This basically reverts commit e8824f6a52.
We added NMDefaultRouteManager because we used the corresponding to `ip
route replace` when configuring routes. That would replace default-routes
on other interfaces so we needed a central manager to coordinate routes.
Now, we use the corresponding of `ip route append` to configure routes,
and each interface can configure routes indepdentently.

In NMDevice, when creating the default-route, ignore @auto_method for
external devices. We shall not touch these devices.

Especially the code in NMPolicy regarding selection of the best-device
seems wrong. It probably needs further adjustments in the future.
Especially get_best_ip_config() should be replaced, because this
distinction VPN vs. devices seems wrong to me.
Thereby, remove the @ignore_never_default argument. It was added by
commit bb75026004, I don't think it's
needed anymore.

This brings another change. Now that we track default-routes in
NMIP4Config/NMIP6Config, they are also exposed on D-Bus like regular
routes. I think that makes sense, but it is a change in behavior, as
previously such routes were not exposed there.
2017-09-08 11:11:21 +02:00
Thomas Haller 802ecd2e54 tui: link nm-utils/nm-shared-utils.c into nmtui 2017-09-05 14:12:19 +02:00
Thomas Haller f0de7d347f platform: add non-exclusive routes and drop route-manager
Previously, we would add exclusive routes via netlink message flags
NLM_F_CREATE | NLM_F_REPLACE for RTM_NEWROUTE. Similar to `ip route replace`.
Using that form of RTM_NEWROUTE message, we could only add a certain
route with a certain network/plen,metric triple once. That was already
hugely inconvenient, because

 - when configuring routes, multiple (managed) interfaces may get
   conflicting routes (multihoming). Only one of the routes can be actually
   configured using `ip route replace`, so we need to track routes that are
   currently shadowed.

 - when configuring routes, we might replace externally configured
   routes on unmanaged interfaces. We should not interfere with such
   routes.

That was worked around by having NMRouteManager (and NMDefaultRouteManager).
NMRouteManager would keep a list of the routes which NetworkManager would like
to configure, even if momentarily being unable to do so due to conflicting routes.
This worked mostly well but was complicated. It involved bumping metrics to
avoid conflicts for device routes, as we might require them for gateway routes.

Drop that now. Instead, use the corresponding of `ip route append` to configure
routes. This allows NetworkManager to confiure (almost) all routes that we care.
Especially, it can configure all routes on a managed interface, without
replacing/interfering with routes on other interfaces. Hence, NMRouteManager
becomes obsolete.

It practice it is a bit more complicated because:

 - when adding an IPv4 address, kernel will automatically create a device route
   for the subnet. We should avoid that by using the IFA_F_NOPREFIXROUTE flag for
   IPv4 addresses (still to-do). But as kernel may not support that flag for IPv4
   addresses yet (and we don't require such a kernel yet), we still need functionality
   similar to nm_route_manager_ip4_route_register_device_route_purge_list().
   This functionality is now handled via nm_platform_ip4_dev_route_blacklist_set().

 - trying to configure an IPv6 route with a source address will be rejected
   by kernel as long as the address is tentative (see related bug rh#1457196).
   Preferably, NMDevice would keep the list of routes which should be configured,
   while kernel would have the list of what actually is configured. There is a
   feed-back loop where both affect each other (for example, when externally deleting
   a route, NMDevice must forget about it too). Previously, NMRouteManager would have
   the task of remembering all routes which we currently want to configure, but cannot
   due to conflicting routes.
   We get rid of that, because now we configure non-exclusive routes. We however still
   will need to remember IPv6 routes with a source address, that currently cannot be
   configured yet. Hence, we will need to keep track of routes that
   currently cannot be configured, but later may be.
   That is still not done yet, as NMRouteManager didn't handle this
   correctly either.
2017-08-24 10:48:03 +02:00
Francesco Giudici 121a6bb638 build: fix building src/systemd
While rebasing systemd from upstream the "sd-adapt/process-util.h" file
was renamed and few other header files were added in the sources.
Update Makefile.am.

Fixes: e0cdaf9880
2017-08-11 12:42:21 +02:00
Beniamino Galvani e0cdaf9880 systemd: merge branch systemd into master
- fix DHCP over Infiniband

https://bugzilla.redhat.com/show_bug.cgi?id=1477678
2017-08-10 11:21:31 +02:00
Beniamino Galvani df72cad107 device: add NMDevicePPP
The new device type represents a PPP interface, and will implement the
activation of new-style PPPoE connections, i.e. the ones that don't
claim the parent device.
2017-08-05 08:03:15 +02:00
Thomas Haller 1c5d98292a c-list: add c_list_sort()
Add a stable, recursive merge sort for CList.

This could be improved by doing an iterative implementation.
The recursive implementation's stack depth is not an issue,
as it is bound by O(ln(n)). But an iterative implementation
would safe the overhead of O(n*log(n)) function calls and be
potentially faster.
2017-07-25 06:42:14 +02:00
Thomas Haller d61eaf2545 service: don't install dependency for "NetworkManager-wait-online.service" to "network-online.target.wants"
If we install "NetworkManager-wait-online.service" in the
"network-online.target.wants" directory, network-online.target always
pulls in NetworkManager-wait-online.service. As it was, it could only
be disabled by masking the service.

Instead, we should enable NetworkManager-wait-online.sevice via
systemd's preset. That is already done for Fedora 26 and newer.

Note that NetworkManager-wait-online.sevice already has Install.WantedBy.
This way, the dependency is created automatically when enabling the service.

https://bugzilla.redhat.com/show_bug.cgi?id=1455704
2017-07-17 16:04:21 +02:00
Thomas Haller e160928b9e platform: move the NMPCache from linux platform to NMPlatform
We want to expose the NMPLookup and NMDedupMultiHeadEntry to the users
of NMPlatform, so that they can iterate the cache directly.

That means, NMPCache becames an integral part of NMPlatform's API
and must also be implemented by NMFakePlatform.
2017-07-05 18:37:39 +02:00
Thomas Haller bb009630a1 core: remove NMMultiIndex
It's unused now.
2017-07-05 18:37:38 +02:00
Thomas Haller f9202c2ac1 shared: add NMDedupMultiIndex "nm-dedup-multi.h"
Add the NMDedupMultiIndex cache. It basically tracks
objects as doubly linked list. With the addition that
each object and the list head is indexed by a hash table.
Also, it supports tracking multiple distinct lists,
all indexed by the idx-type instance.
It also deduplicates the tracked objects and shares them.

 - the objects that can be put into the cache must be immutable
   and ref-counted. That is, the cache will deduplicate them
   and share the reference. Also, as these objects are immutable
   and ref-counted, it is safe that users outside the cache
   own them too (as long as they keep them immutable and manage
   their reference properly).

   The deduplication uses obj_id_hash_func() and obj_id_equal_func().
   These functions must cover *every* aspect of the objects when
   comparing equality. For example nm_platform_ip4_route_cmp()
   would be a function that qualifies as obj_id_equal_func().

   The cache creates references to the objects as needed and
   gives them back. This happens via obj_get_ref() and
   obj_put_ref(). Note that obj_get_ref() is free to create
   a new object, for example to convert a stack-allocated object
   to a (ref-counted) heap allocated one.

   The deduplication process creates NMDedupIndexBox instances
   which are the ref-counted entity. In principle, the objects
   themself don't need to be ref-counted as that is handled by
   the boxing instance.

 - The cache doesn't only do deduplication. It is a multi-index,
   meaning, callers add objects using a index handle NMDedupMultiIdxType.
   The NMDedupMultiIdxType instance is the access handle to lookup
   the list and objects inside the cache. Note that the idx-type
   instance may partition the objects in distinct lists.

For all operations there are cross-references and  hash table lookups.
Hence, every operation of this data structure is O(1) and the memory
overhead for an index tracking an object is constant.

The cache preserves ordering (due to linked list) and exposes the list
as public API. This allows users to iterate the list without any
additional copying of elements.
2017-07-05 14:22:10 +02:00
Thomas Haller b8bc80bcdb all: add base object type in "nm-obj.h"
Platform has it's own, simple implementation of object types:
NMPObject. Extract a base type and move it to "shared/nm-utils/nm-obj.h"
so it can be reused.

The base type is trival, but it allows us to implement other objects
which are compatible with NMPObjects. Currently there is no API for generic
NMObjBaseInst type, so compatible in this case only means, that they
can be used in the same context (see example below).
The only thing that you can do with a NMObjBaseInst is check it's
NMObjBaseClass.

Incidentally, NMObjBaseInst is also made compatible to GTypeInstance.
It means, an NMObjBaseInst is not necessarily a valid GTypeInstance (like NMPObject
is not), but it could be implemented as such.

For example, you could do:

    if (NMP_CLASS_IS_VALID ((NMPClass *) obj->klass)) {
        /* is an NMPObject */
    } else if (G_TYPE_CHECK_INSTANCE_TYPE (obj, NM_TYPE_SOMETHING)) {
        /* it a NMSometing GType */
    } else {
        /* something else? */
    }

The reason why NMPObject is not implemented as proper GTypeInstance is
because it would require us to register a GType (like
g_type_register_fundamental). However, then the NMPClass struct can
no longer be const and immutable memory. But we could.

NMObjBaseInst may or may not be a GTypeInstance. In a sense, it's
a base type of GTypeInstance and all our objects should be based
on it (optionally, they we may make them valid GTypes too).
2017-07-05 14:22:10 +02:00
Thomas Haller b55fba8fbd build: fix race creating "libnm-core/tests" directory for "nm-core-tests-enum-types.c"
https://bugzilla.gnome.org/show_bug.cgi?id=783783
2017-06-14 14:04:57 +02:00
Thomas Haller 484d666485 build: fix nm binutils tool when building with LTO
When building with -flto, we need to use linker plugins.
In case of binutils' nm, it means to prefer gcc-nm if
available.

Like for ranlib and ar, prefer gcc-nm.

- replace AC_PATH_TOOL() by AC_CHECK_TOOLS(). That is consistent
  with what we do for ar,ranlib and suggested on bgo#783311.
- instead of using the variable $BINUTILS_NM, replace it by
  $NM, which is more common according to bgo#783311.
- Keep recognizing $BINUTILS_NM environment, which was introduced
  by commit 8bc88bcc7c. This is purely to keep previous build
  scripts working. Originally I named it "$BINUTILS_NM" because
  using $NM in NetworkManager seemed confusing. But well...

https://bugs.gentoo.org/show_bug.cgi?id=620052
https://bugzilla.gnome.org/show_bug.cgi?id=782525
https://bugzilla.gnome.org/show_bug.cgi?id=783311
2017-06-01 12:51:31 +02:00
Lubomir Rintel afebdc795d build: add a missing test artifact to dist
Fixes: ba05819c89
2017-06-01 12:47:43 +02:00
Lubomir Rintel 28505ae92b build: don't drop the test suite log on failure
Fixes: 2198f73b0e
2017-05-31 20:11:11 +02:00
Thomas Haller ba05819c89 ifcfg-rh/tests: add test for reading NETMASK property 2017-05-30 11:10:19 +02:00
Thomas Haller 371b761680 build: sort filenames in Makefile.am alphabetically 2017-05-30 11:10:19 +02:00
Thomas Haller 5a67130e15 build: don't link static libraries multiple times
libnm-core.a should only be linked once in libnm.so. Previously,
it was linked twice, once as part of libnm-utils.a and once
directly in libnm.so.

Fixes: 8df944c7e4
2017-05-19 14:52:03 +02:00
Thomas Haller 733160c862 build: don't install intermediate library libnm/libnm-utils.la
Fixes: 8df944c7e4
2017-05-19 14:13:41 +02:00
Thomas Haller 8df944c7e4 libnm: add testable libnm/nm-libnm-utils.c file
Previously, internal parts of libnm were not testable.
Instead, add "libnm/nm-libnm-utils.c" and "libnm/libnm-utils.la"
to contain code that can be statically linked with a new
test "libnm/tests/test-general".
2017-05-19 12:45:45 +02:00
Thomas Haller 5bfb7c3c89 hostname: split out hostname management from NMSettings
Hostname management is complicated. At least, how it is implemented currently.
For example, NMPolicy also sets the hostname (NMPolicy calls
nm_settings_set_transient_hostname() to have hostnamed set the hostname,
but then falls back to sethostname() in settings_set_hostname_cb()).
Also, NMManager tracks the hostname in NM_MANAGER_HOSTNAME too, and
NMPolicy listens to changes from there -- instead of changes from
NMSettings.

Eventually, NMHostnameManager should contain the hostname parts from NMSettings
and NMPolicy.
2017-05-12 17:29:33 +02:00
Thomas Haller d079846330 shared: add "nm-utils/c-list.h" header
Include the circular, doubly-linked list implementation from
c-util/c-list [1], commit 864051de6e7e1c93c782064fbe3a86b4c17ac466.

[1] https://github.com/c-util/c-list
2017-05-11 18:26:07 +02:00
Thomas Haller 79be44d990 ifcfg: add read/write support for user-data
The user data values are encoded in shell variables named
prefix "NM_USER_". The variable name is an encoded form of the
data key, consisting only of upper-case letters, digits, and underscore.

The alternative would be something like

  NM_USER_1_KEY=my.keys.1
  NM_USER_1_VAL='some value'
  NM_USER_2_KEY=my.other.KEY.42
  NM_USER_2_VAL='other value'

contary to

  NM_USER_MY__KEYS__1='some value'
  NM_USER_MY__OTHER___K_E_Y__42='other value'

The advantage of the former, numbered scheme is that it may be easier to
find the key of a user-data entry. With the current implementation, the
shell script would have to decode the key, like the ifcfg-rh plugin
does.

However, user data keys are opaque identifers for values. Usually, you
are not concerned with a certain name of the key, you already know it.
Hence, you don't need to write a shell script to decode the key name,
instead, you can use it directly:

  if [ -z ${NM_USER_MY__OTHER___K_E_Y__42+x} ]; then
      do_something_with_key "$NM_USER_MY__OTHER___K_E_Y__42"
  fi

Otherwise, you'd first have to search write a shell script to search
for the interesting key -- in this example "$NM_USER_2_KEY", before being
able to access the value "$NM_USER_2_VAL".
2017-05-06 14:12:19 +02:00
Thomas Haller f04bf45e84 ifcfg-rh/tests: compare the written files to a expected result
We have unit tests for writing and re-reading ifcfg file. Those
tests compare whether a file can be successfully read and is
semantically identical.

However, there were no tests that a certain output is written in
a stable format. We aim not to change the output of what we write.
For that, add tests to not only check the semantic of the written
ifcfg file, but their bits and bytes.

Some future changes may well intentionally change the current
output. That will require to update the expected result files
and can be done via

  NMTST_IFCFG_RH_UPDATE_EXPECTED=yes src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh

Note that alias, route, and key files are not checked.

Related: https://bugzilla.redhat.com/show_bug.cgi?id=1445414
2017-04-26 12:30:02 +02:00
Thomas Haller 0af2f5c28b core: add NMNetns to bundle platform and route managers
NMPlatform, NMRouteManager and NMDefaultRouteManager are singletons
instances. Users of those are for example NMDevice, which registers
to GObject signals of both NMPlatform and NMRouteManager.

Hence, as NMDevice:dispose() disconnects the signal handlers, it must
ensure that those singleton instances live longer then the NMDevice
instance. That is usually accomplished by having users of singleton
instances own a reference to those instances.
For NMDevice that effectively means that it shall own a reference to
several singletons.

NMPlatform, NMRouteManager, and NMDefaultRouteManager are all
per-namespace. In general it doesn't make sense to have more then
one instances of these per name space. Nnote that currently we don't
support multiple namespaces yet. If we will ever support multiple
namespaces, then a NMDevice would have a reference to all of these
manager instances. Hence, introduce a new class NMNetns which bundles
them together.
2017-04-18 15:49:14 +02:00
Thomas Haller ab47a2d5fe build: fix broken line wraps in Makefile.am 2017-04-07 13:52:12 +02:00
Thomas Haller 9f7380e973 build: add missing build dependency for ifupdown
And reorder _OBJECTS dependencies of settings plugins after their
corresponding _LDADD declartion.

https://mail.gnome.org/archives/networkmanager-list/2017-April/msg00016.html
2017-04-07 12:37:56 +02:00
Thomas Haller b3e2808c32 build: commit pre-generated "settings-docs.c" in git
nmcli has documentation strings embedded. Those strings are extracted
from gtk-doc comments, using pygobject and put in the generated file
"clients/common/settings-docs.c".

This file "clients/common/settings-docs.c" is disted, so from
a source tarball you can build nmcli without enabling introspection.
However, when building from a git-tree, the file is missing and
thus one cannot build --with-nmcli unless also using at least
--enable-introspection to generate "clients/common/settings-docs.c".

That is inconvenient. Especially during cross-compilation, where
one also needs python and pygobject in the foreign architecture (because
the generation of "settings-docs.c" loads the built libnm.so via
pygobject). It is bad because nmcli is an essential part of
NetworkManager, so building --without-nmcli is not a great option.
Previously, the only alternative was to pre-generate a source tarball
on a separate machine and build that. This however complicates efforts
to automatically build git snapshots of NetworkManager.

Fix that by commiting "clients/common/settings-docs.c.in" to git.
When building with --disable-introspection, the pre-generated
file is used instead. This is fine, because the file only depends
on static, checked-in documentation strings that seldomly change.

Also add a check target to notice when the pre-generated file differs
from what we are about to generate during --enable-introspection.
That happens when editing one of the gtk-doc entires. In this case,
`make check` will notify that the pre-generated "settings-docs.c.in"
file needs updating too.

Yes, when changing gtk-doc comments you need to updte the file manually.
At least, the check failure notifies you.
2017-04-05 16:53:06 +02:00
Thomas Haller 022117ff36 cli/tests: add "clients/common/tests/test-general.c" 2017-04-05 16:53:06 +02:00
Thomas Haller d9462879ac build: build intermediate library libnmc.la for nmcli
Used for unit testing in the next commit.

Also add libnmc-base.la, which contains common files for nmcli and
nmtui.
2017-04-05 16:53:06 +02:00
Thomas Haller db300afba1 cli: split out new file "nm-meta-setting-access.h"
"nm-meta-setting-desc.h" contains static type description, vtable and (internal)
accessor functions. Add accessor functions that operate on top of the type description
to "nm-meta-setting-access.h".
2017-04-05 16:53:06 +02:00
Thomas Haller d2af54f9bb build: fix out-of-tree build after moving generated settings-docs.c
Fixes: d720f0955f
2017-03-30 17:52:05 +02:00
Thomas Haller d720f0955f cli: embed gtk-doc directly in property-info structure
Also mark them for translation.
2017-03-30 16:35:52 +02:00
Thomas Haller f5a0b62765 cli: use enum property type for connection.lldp
Change in behavior:

  - the setter would previoulsy allow "enable" case-insensitive.
    Now, it's case sensitive.
2017-03-30 13:09:58 +02:00
Thomas Haller a8730c51c8 libnm: move enum utils to new shared file shared/nm-utils/nm-enum-utils.h
libnm contains the public function nm_utils_enum_from_str() et al.
The function is not flexible enough for nmcli's usecase. So, I would
need another public function like nm_utils_enum_from_str_full() that
has an extended API.

That was already required previously for ifcfg-rh writer, but in that
case I could just add it as internal API as libnm-core is linked statically
with NetworkManager.

I don't want to commit to a public API for an utility function. So move
the code instead to the shared directory, so that nmcli may link
statically against it and use the internal API.
2017-03-30 13:09:58 +02:00
Thomas Haller 23298bfc88 cli: move utils function from common.h to nm-meta-setting-desc.c
These functions are only used by nm-meta-setting-desc.c. Make them internal.
Unfortunately, they are part of "common.h" which cannot be used without
the rest of nmcli. Still todo.
2017-03-30 13:09:58 +02:00
Thomas Haller b5c8622ad3 cli: split nm-meta-setting-desc out of settings
This part contains static functions and variables to describe
settings. It is distinct from the mechanism to use them, or
access them.

Split it out.

It still uses clients/cli/common.h and clients/cli/utils.h
which shall be fixed next.
2017-03-30 13:09:58 +02:00
Thomas Haller d3ad7920de cli: add setting-info structure to settings.c
Will get more use soon.
2017-03-30 13:09:55 +02:00
Thomas Haller 68ab166f38 build: declare build dependencies requiring "nm-core-enum-types.h"
cat <<-EOF > /tmp/glib-mkenums
	#!/bin/bash
	sleep 15 && /usr/bin/glib-mkenums "\$@"
	EOF

	chmod +x /tmp/glib-mkenums

	(export PATH="/tmp:$PATH" &&
	 git clean -fdx &&
	 ./autogen.sh &&
	 make -j20 all-am)
2017-03-29 11:26:04 +02:00
Beniamino Galvani e044071825 ifcfg-rh: also check BONDING_OPTS to determine the connection type
Connections with "TYPE=Ethernet" and "BONDING_OPTS=..." are regarded
by initscripts as bond masters. To maintain the best compatibility, do
the same.

https://bugzilla.redhat.com/show_bug.cgi?id=1434555
2017-03-29 09:47:37 +02:00
Thomas Haller 18663c0960 build: declare build dependency for ifcfg-rh tests 2017-03-28 22:37:19 +02:00
Lubomir Rintel 9d43869e47 core: make connectivity checking per-device
This moves tracking of connectivity to NMDevice and makes the NMManager
negotiate the best of known connectivity states of devices. The NMConnectivity
singleton handles its own configuration and scheduling of the permission
checks, but otherwise greatly simplifies it.

This will be useful to determine correct metrics for multiple default routes
depending on actual internet connectivity.

The per-device connection checks is not yet exposed on the D-Bus, since they
probably should be per-address-family as well.
2017-03-28 15:26:47 +02:00
Thomas Haller 4ec7dd987e libnm: add NMSettingUser
This only adds new API for a NMSettingUser. The setting class
is still entirely unused.

The point is getting the new API into 1.8.0 release of libnm.
It's easier to backport the use of the API to a stable branch
then backporting public API.

https://bugzilla.gnome.org/show_bug.cgi?id=776276
https://bugzilla.redhat.com/show_bug.cgi?id=1421429
2017-03-28 14:58:21 +02:00
Lubomir Rintel 7750a384a5 libnm-util/vapi: add missing dependencies
Works by dumb luck for in-tree build, because the .deps files that are
meant for the distribution happen to be the builddir. The out-of-tree
builds would generate an empty file.
2017-03-24 11:38:49 +01:00
Lubomir Rintel ec17f82960 build: yet another missing dependency 2017-03-24 11:38:49 +01:00
Thomas Haller 8b9dfa013d build: fix building clients/cli/settings-docs.c (4)
We also dist libnm/nm-property-docs.xml, so depending on
whether we build from git or source tarball, the file
is in $(srcdir) or $(builddir).

Fixes: d7ad13591b
2017-03-24 10:48:56 +01:00
Thomas Haller 5581d91973 build: fix building clients/cli/settings-docs.c (3)
Fixes: d7ad13591b
2017-03-24 10:31:15 +01:00
Thomas Haller 431493827b build: fix building clients/cli/settings-docs.c (2)
Fixes: d7ad13591b
2017-03-23 23:23:47 +01:00
Thomas Haller 3468a54ec1 build: fix building clients/cli/settings-docs.c
Fixes: d7ad13591b
2017-03-23 20:57:28 +01:00
Thomas Haller 0fefcbfb2d build: don't link against libm.so
There are very few places where we actually use floating point
or #include <math.h>.

Drop that library, although we very likely still get it as indirect
dependency (e.g. on my system it is still dragged in by libsystemd.so,
libudev.so and libnl-3.so).
2017-03-23 19:06:02 +01:00
Thomas Haller d628ada05a build: remove currently unneeded include of shared/nm-setting-metadata.h from nmcli
One day, I wish we would have more setting metadata in shared via
"shared/nm-setting-metadata.h", ready for nmcli and nmtui to use
(by statically linking against the internal API).

Anyway, it is still unused, so drop the files from the SOURCES of
nmcli.
2017-03-23 18:58:47 +01:00
Thomas Haller d7ad13591b build: fix out-of-tree build for including "clients/cli/settings-docs.c"
"$(srcdir)/clients/cli/settings.c" includes "$(builddir)/clients/cli/settings-docs.c",
hence, we need "-I$(builddir)/clients/cli".

This basically reverts commit bbce089840,
but adds dependencies so that the build directory exists.
2017-03-23 18:50:34 +01:00
Lubomir Rintel bbce089840 cli/build: drop $builddir/cli/ from the include path
The sources should reach files in the $builddir using #include "".
Besides, it is not guarranteed to be around:

    CC       shared/clients_cli_nmcli-nm-setting-metadata.o
  cc1: error: ./clients/cli: No such file or directory [-Werror=missing-include-dirs]
  cc1: all warnings being treated as errors
  Makefile:12971: recipe for target 'shared/clients_cli_nmcli-nm-setting-metadata.o' failed
2017-03-23 17:41:04 +01:00
Lubomir Rintel 96571ec621 build: ensure libnm-core is around before mkenums puts files there
It's not sufficient to make nm-core-enum-types.[ch] depend on the
dirstamp, because they also depend on their own stamps that are to be
placed in libnm-core.

  $ make libnm-core/nm-core-enum-types.h.stamp
    GEN      libnm-core/nm-core-enum-types.h
  /bin/sh: libnm-core/nm-core-enum-types.h.tmp: No such file or directory
  ../../Makefile.glib:107: recipe for target 'libnm-core/nm-core-enum-types.h.stamp' failed
  make: *** [libnm-core/nm-core-enum-types.h.stamp] Error 1
2017-03-23 17:41:04 +01:00
Thomas Haller e32839838e udev: drop libgudev in favor of libudev
libgudev is just a wrapper around libudev. We can
use libudev directly and drop the dependency for
libgudev.
2017-03-22 12:41:06 +01:00
Francesco Giudici 7307dea9c4 connectivity: switch connectivity checking to libcurl
[lkundrak@v3.sk: removed libsoup altogether, implemented TODOs and fixed
the poll condition handling]

Co-authored-by: Lubomir Rintel <lkundrak@v3.sk>
2017-03-22 12:09:39 +01:00
Lubomir Rintel c05befd5aa dns-manager: use libpsl directly
...instead of via libsoup. This makes it possible to do gTLD suffix checking
even if we're building without libsoup support.
2017-03-22 12:09:39 +01:00
Lubomir Rintel a91369f80d libnm-core: drop NMVpnConnectionStateReason
It's now the same as NMActiveConnectionStateReason. Keep a compatibility
typedef and enum.
2017-03-17 10:21:19 +01:00
Lubomir Rintel e947739dd6 build: avoid passing enums-to-docbook.pl to itself on its command line 2017-03-16 17:11:29 +01:00
Lubomir Rintel 2198f73b0e build: delete unsuccessfully built artifacts
We use output redirection in numerous places; leaving the half-built
artifacts in place would cause the subsequent builds to succeed when it
should not.
2017-03-16 17:10:51 +01:00
Lubomir Rintel e3c87e80de build: allow longer manual page titles
Otherwise the docbook template chops off the "NM-SETTINGS-IFCFG-RH"
title; even in the middle of an escape sequence.
2017-03-10 14:35:18 +01:00
Thomas Haller fada1da80b systemd: merge branch systemd into master 2017-03-09 01:04:15 +01:00
Beniamino Galvani 9dac51d9c0 team: support the ethernet.cloned-mac-address property
The only reliable way of setting a MAC address for the team is through
the "hwaddr" property in the configuration passed to teamd. In order
to rewrite the configuration we need Jansson support; since it is
already a requirement for teamd, let the team plugin depend on it.
2017-02-23 10:07:06 +01:00
Beniamino Galvani a1b729fddb build: automatically determine Jansson support if not specified
If configure is called without --enable-json-validation or
--disable-json-validation, let's automatically choose a value
depending on the availability of the library.
2017-02-23 10:05:48 +01:00
Beniamino Galvani b42f780e04 core: add support for dummy devices
Add support for creating dummy devices. This commit adds a D-Bus
interface 'org.freedesktop.NetworkManager.Device.Dummy' which is used
primarily for determining the device type but does not carry any
properties.
2017-02-22 21:05:04 +01:00
Beniamino Galvani 1bf2d3b049 libnm-core: add dummy connection setting
The setting must be present in connections with type=dummy. It does
not contain any property.
2017-02-22 21:05:04 +01:00
Thomas Haller 86ac68049a build: ensure libnm-core directory exists for generated files
Since we generate "libnm-core/nm-core-enum-types.h" via GLIB_GENERAED,
there is no obvious place to $(MKDIR_P). Add a dependency to the
.dirstamp of the directory to instruct automake to create the directory.
2017-02-22 13:16:28 +01:00
Thomas Haller 47e55561a7 build: ensure build directories exist for gdbus-codegen targets 2017-02-22 11:48:40 +01:00
Thomas Haller d440958de1 build: don't depend on libnm-core directory for make target 2017-02-22 11:43:21 +01:00
Thomas Haller c2f0764c1e build: add slash to directory name for mkdir
Just for consistency with other locations that call
$(MKDIR_P).
2017-02-22 11:42:38 +01:00
Thomas Haller e824dd34f0 build: fix type on Makefile.am
Fixes: 3cc00dd550
2017-02-21 00:37:48 +01:00
Thomas Haller 3cc00dd550 ifcfg: also read DEFROUTE and GATEWAY from alias files
Also accept DEFROUTE and GATEWAY when they are defined in
alias files -- provided, that they are not yet defined
in the main ifcfg file.
2017-02-20 23:18:36 +01:00
Thomas Haller c79e84368a all: add new "shared/nm-setting-metadata.h" file
"shared/nm-setting-metadata.h" will contain data structures
to handle NM setting properties in a generic way.

For now, this is internal API, but shared between libnm-core (which
extends to libnm, NetworkManager, device-plugins, settings-plugins),
and nmcli.

Related: https://bugzilla.gnome.org/show_bug.cgi?id=732292
2017-02-17 19:51:53 +01:00
Lubomir Rintel dbbcd076fb build: disable dependency tracking on distcheck
This just tests a configuration we don't typically run also potentially
making distcheck a tiny bit faster.
2017-02-16 15:57:03 +01:00
Lubomir Rintel 258382be12 build: create missing directories for out-of-tree builds
They could be created by dumb luck with dependency tracking, but
apparently some distributions disable that.
2017-02-16 15:55:23 +01:00
Thomas Haller 4179cbb677 build: fix dist-ing "man/common.ent.in" 2017-02-15 23:21:29 +01:00
Thomas Haller 03efe8dba7 build: fix out-of-tree build generating "man/common.ent"
Fixes: 4de6f603e3
2017-02-15 23:21:29 +01:00
Thomas Haller 4de6f603e3 build: use sed instead of AC_SUBST() to generate man/common.ent
Otherwise, substitions are not properly expanded.

For example

- "AC_SUBST(nmrundir, '${runstatedir}'/$PACKAGE, [NetworkManager runtime state directory])"
  gives ${runstatedir}/NetworkManager/resolv.conf

- "AC_SUBST(nmrundir, "${runstatedir}/$PACKAGE", [NetworkManager runtime state directory])"
  gives ${prefix}/var/run/NetworkManager/resolv.conf
2017-02-15 18:36:24 +01:00
Thomas Haller 0769a52f05 build: simplify (un)install hooks for man pages 2017-02-14 00:17:32 +01:00
Thomas Haller b599f1b743 build: combine handling of setting docs and man pages
Building the man pages via xsltproc requires "docbook.xsl"
which is part of docbook.

Previously, we would build the man pages solely based on
"--enable-introspection", which checks for the presence of
xsltproc, but not docbook. This can lead to build failure
when docbook is not available, but "--enable-introspection"
is given.

Instead of adding yet another configure option to fine-tune
and say "--with-docbook --disable-gtk-doc", just simplify it.

Now, documentation (both man pages and setting docs) will be generated
with "--enable-gtk-doc" and "--enable-introspection".
If the documentation is not about to be generated, pre-generated docs
will be installed if they are available. That is commonly the case
with a source tarball, but not with a git checkout.
Finally, if documentation is nither generated nor pre-generated,
no documentation will be installed *duh*.

This removes the possibility to treat man pages separate from settings
docs. Now you either generate both, install both pre-generated, or don't
get any of them.

https://bugzilla.gnome.org/show_bug.cgi?id=778551
2017-02-14 00:08:22 +01:00
Thomas Haller 5936a8babe build: move code around and reorder conditions
No changes really, except moving related stuff closer together.
2017-02-13 18:12:26 +01:00
Thomas Haller 8bc88bcc7c build: allow configuring path to binutils's nm tool during build
`nm` is used by "tools/create-exports-NetworkManager.sh" script.
Alloc configuring an explicit path during configure.

  BINUTILS_NM=/usr/bin/nm ./configure
2017-02-08 16:52:23 +01:00
Lubomir Rintel d9ebd31d40 build: install all necessary directories 2017-01-29 12:28:55 +01:00
Lubomir Rintel b4e1d4794e build: don't install /run files
They're volatile and created during runtime.
2017-01-29 12:28:55 +01:00
Thomas Haller cd267cceed build: add missing GLIB_CFLAGS for compiling adsl device plugin 2017-01-29 12:25:05 +01:00
Beniamino Galvani 91d0c036de build: libnm-wwan.so depends on linker script
(cherry picked from commit 8134d72f49)
2017-01-25 17:21:29 +01:00
Thomas Haller 90f097b9f5 build: don't install /etc/dbus-1/system.d/nm-ifcfg-rh.conf when building without ifcfg-rh plugin
(cherry picked from commit cca0ba01e4)
2017-01-18 00:11:21 +01:00
Jiří Klimeš 49e1fefc35 ifcfg-rh: add a basic test for Proxy setting 2017-01-17 14:27:31 +01:00
Beniamino Galvani d252a99fa2 libnm-core: add NMSettingMacsec
The new NMSettingMacsec contains information necessary to establish a
MACsec connection. At the moment we support two different MACsec
modes, both using wpa_supplicant: PSK and EAP.

PSK mode is based on a static CAK key for the MACsec key agreement
protocol, while EAP mode derives keys from a 802.1x authentication and
thus requires the presence of a NMSetting8021x in the connection.
2017-01-16 17:37:14 +01:00
Beniamino Galvani 67adbda83e core,libnm: introduce NMDeviceMacsec
At the moment the device only exposes the current link status, but
cannot create new links.
2017-01-16 17:37:14 +01:00
Thomas Haller f4fb4d271f keyfile/tests: add test for reading dcb connection
Catches previously fixed memleak in read_array_of_uint()
2017-01-05 11:13:17 +01:00
Thomas Haller a8afbb7299 systemd: merge branch systemd into master 2017-01-04 15:55:46 +01:00
Beniamino Galvani a7945ef765 build: don't run GIR tools on private headers
Fixes the warning:

libnm-glib/nm-object-private.h:28: Warning: NMClient: symbol='PropertyMarshalFunc': Unknown namespace for identifier 'PropertyMarshalFunc'
2016-12-20 11:40:12 +01:00
Thomas Haller 0dfb5d2452 build: remove "src/NetworkManager.ver-orig"
Generating "src/NetworkManager.ver" each time seems to work well.
Thus, src/NetworkManager.ver-orig is unused an gets easily out
of date. Just remove it. It's not useful anymore.
2016-12-18 17:45:15 +01:00
Michael Catanzaro 4b6fb82bc5 build: always use the right python for generate-settings-docs.py
Fixes: 6070fe697a

https://bugzilla.gnome.org/show_bug.cgi?id=775768
2016-12-16 09:13:24 +01:00
Lubomir Rintel 0c2a59b08a build: build documentation for o.fd.NM.DnsManager
Fixes: 14105ece56
2016-12-15 20:29:46 +01:00
Francesco Giudici 2ee6b7bf82 ifcfg-rh: merge branch 'fg/dhcp_hostname_bgo775622'
https://bugzilla.gnome.org/show_bug.cgi?id=775622
2016-12-15 11:29:05 +01:00
Thomas Haller 6070fe697a build: allow specifying the python interpreter for building
As build-requirement, we either require
  - python2 with python-gobject-base
  - python3 with python3-gobject-base
Previously, we would require that a plain `python` gives the desired
interpreter version.

If somebody's "/usr/bin/env python" however points to a different
python version, there was no easy way to change it -- aside
resetting the $PATH variable to some desired "python" binary.

Now, you can specify it during configure:

  ./configure PYTHON=python3 ...

This especially matters, if you only have python3-gobject-base
installed, you /usr/bin/python is a symlink to python2.

https://bugzilla.gnome.org/show_bug.cgi?id=775768
2016-12-14 19:00:42 +01:00
Francesco Giudici 6bf69d0fa1 ifcfg-rh/tests: add ipv6 hostname legacy support read test 2016-12-14 16:21:26 +01:00
Beniamino Galvani 597f327b20 dns: merge branch 'bg/dns-dbus-bgo603321'
https://bugzilla.gnome.org/show_bug.cgi?id=603321
2016-12-12 22:27:39 +01:00
Beniamino Galvani a8d6005256 libnm: implement support for DNS manager properties 2016-12-12 22:06:24 +01:00
Beniamino Galvani 14105ece56 dns: export DNS manager D-Bus object
Extend the D-Bus API and introduce a new NMDnsManager interface that
contains all the information related to DNS configuration.

At the moment the new DnsManager object only contains basic properties
describing the current DNS mode and resolv.conf manager.
2016-12-12 21:49:15 +01:00
Thomas Haller a2402acfed build: fix dependency of NetworkManager.ver for libnm-ppp-plugin
Fixes: 025235e00f
2016-12-12 21:38:26 +01:00
Beniamino Galvani 025235e00f ppp: split ppp manager into a plugin
Moving the PPP manager to a separate plugin that is loaded when needed
has the advantage of slightly reducing memory footprint and makes it
possible to install the PPP support only where needed.

https://bugzilla.gnome.org/show_bug.cgi?id=773482
2016-12-06 11:08:11 +01:00
Thomas Haller a80ba4ea09 build: fix gtk-doc/introspection handling for build
- `make dist` requires --enable-gtk-doc --enable-introspection --with-libnm-glib
- --enable-gtk-doc requires --enable-introspection
- --with-nmcli requires either --enable-introspection or pregenerated
   settings-docs.c files from the dist tarball. It does not require
   --enable-gtk-doc.

There is a bit of a problem in that --enable-introspection requires
now xsltproc. However, gobject-introspection does itself not depend
on xsltproc. So, more correct might be a special --enable-doc argument,
that combines --enable-introspection --with-xsltproc. Anyway, that
seems to make it more complicated then it already is so just implicitly
(and surprisingly?) require xsltproc with --enable-introspection.

https://bugzilla.gnome.org/show_bug.cgi?id=775003
2016-11-28 12:43:51 +01:00
Emmanuele Bassi 41ed42d5ba build: do not require GTK-Doc to build nmcli
We can simply check for xsltproc and depend on pygobject and
introspection.

https://bugzilla.gnome.org/show_bug.cgi?id=775003
2016-11-28 12:43:47 +01:00
Thomas Haller a4224b9882 build: combine targets for nm-settings*.xml via pattern rule in Makefile.am 2016-11-24 16:55:17 +01:00
Thomas Haller 7864435c3c build: fix out-of-tree build to find common.ent for documentation
Need to pass --path to xsltproc to find common.ent in the
build-directory.

  $ git clean -fdx && NMTST_MAKE='V=1 -d' ./tools/test-build.sh man/nm-settings-ifcfg-rh.xml
2016-11-24 16:55:17 +01:00
Thomas Haller 5701febb16 build: avoid specifying man/nm-settings.xml paths multiple times
Don't repeat yourself. Aim to specify paths at few places.
2016-11-24 16:55:17 +01:00
Thomas Haller 020f4fb5ba build: combine pattern rule for makefiles 2016-11-24 16:55:17 +01:00
Thomas Haller ab208d69da build: fix lookup "nm-settings-docs-overrides.xml" for out-of-tree build
When building "libnm/nm-settings-docs.xml", we require
"nm-settings-docs-overrides.xml". As we dist the overrides files,
we must consult VPATH to locate the proper version of the file.
2016-11-24 16:55:00 +01:00
Thomas Haller 2ac6c5a981 build: rename intermediate doc xmls
Allows to use pattern rules by making the
related files having a common naming scheme.

This commit only renames files.
2016-11-24 16:54:17 +01:00
Thomas Haller ec4a1b7540 build: avoid some uses of BUILT_SOURCES in Makefile.am
BUILT_SOURCES only matters during `make all`, `make check`
and `make install`.

It would be nice to be able to build every target specifically
from an empty git-tree.

Drop the use of BUILT_SOURCES where we already have the explicit
dependencies declared.
2016-11-24 16:52:27 +01:00
Thomas Haller 99bf51d3c7 build: add explicit dependency objects to generated source files
BUILT_DIR only matters during `make all` and `make check`.
2016-11-24 15:59:27 +01:00
Thomas Haller 53496b3bb7 build: don't use $(top_*dir) in Makefile.am
It's the same as the current directory. For consistency
don't use the "top_" prefix.
2016-11-24 15:59:27 +01:00
Thomas Haller a332e17f6b build: consistently use $() instead of ${} in Makefile.am 2016-11-24 15:59:27 +01:00
Thomas Haller 063bacdb84 build: drop $(top_builddir) for referring to libnm/libnm.la 2016-11-24 15:59:27 +01:00
Lubomir Rintel 88f3f29882 build: install the D-Bus introspection data
This would make it easier to develop against NetworkManager D-Bus API.
2016-11-23 15:43:42 +01:00
Lubomir Rintel 972e0d2803 all: rename the introspection data to use the interface paths in names
This makes it easier to install the files with proper names.
Also, it makes the makefile rules slightly simpler.

Lastly, the documentation is now generated into docs/api, which makes it
possible to get rid of the awkward relative file names in docbook.
2016-11-23 15:43:42 +01:00
Francesco Giudici 3bcca564c7 ifcfg-rh/tests: add tests for link negotiation options
Thanks to Thomas Haller for making test code much more compact taking
advantage of the nmtst_create_minimal_connection function.
2016-11-22 15:24:47 +01:00
Thomas Haller f1017b7f69 build: move setting install_manpages variable 2016-11-22 11:00:49 +01:00
Thomas Haller 2c9572d302 build: remove redundant check for ENABLE_GTK_DOC
BUILD_SETTING_DOCS is only enabled when we have also ENABLE_GTK_DOC.
Remove the redundant check.
2016-11-22 11:00:49 +01:00
Thomas Haller 11e26d015a build: add explicit dependency of nmcli sources to "settings-docs.c"
Instead of relying on BUILT_SOURCES.

  $ git clean -fdx && NOCONFIGURE=x ./autogen.sh && ./configure --enable-gtk-doc && make clients/cli/nmcli

Also, add the file to DISTCLEANFILES.
2016-11-21 15:48:05 +01:00
Lubomir Rintel bd01d9ca2e build: silence some verbose make rules 2016-11-21 15:35:12 +01:00
Thomas Haller 58236425cb build: cleanup include paths in Makefile.am
- Use -I$() instead of -I${}
- omit "top_" for -I$(srcdir)
- remove quoting for include paths
  We don't quote other places either. You just cannot
  build NetworkManager in a path that contain invalid
  characters.
- remove trailing slash from include paths
- fix indention with spaces in Makefile.am
2016-11-21 14:26:37 +01:00
Thomas Haller 44ecb41593 build: don't add subdirectories to include search path but require qualified include
Keep the include paths clean and separate. We use directories to group source
files together. That makes sense (I guess), but then we should use this
grouping also when including files. Thus require to #include files with their
path relative to "src/".

Also, we build various artifacts from the "src/" tree. Instead of having
individual CFLAGS for each artifact in Makefile.am, the CFLAGS should be
unified. Previously, the CFLAGS for each artifact differ and are inconsistent
in which paths they add to the search path. Fix the inconsistency by just
don't add the paths at all.
2016-11-21 14:26:37 +01:00
Thomas Haller a65762ca33 build: rename "src/ppp-manager" to "src/ppp"
The ppp directory does not only contain the manager
instance, but various files related to ppp.

Rename.
2016-11-21 14:07:47 +01:00
Thomas Haller 8c7f5e2653 build: rename "src/dnsmasq-manager" to "src/dnsmasq"
The dnsmasq directory does not only contain the manager
instance, but various files related to dnsmasq.

Rename.
2016-11-21 14:07:47 +01:00
Thomas Haller 2603b01684 build: rename "src/vpn-manager" to "src/vpn"
The vpn directory does not only contain the manager
instance, but various files related to VPN.

Rename.
2016-11-21 14:07:47 +01:00
Thomas Haller 62c2e6ccda build: rename "src/dns-manager" to "src/dns"
The dns directory does not only contain the manager
instance, but various files related to DNS.

Rename.
2016-11-21 14:07:47 +01:00
Thomas Haller e053996881 build: rename "src/dhcp-manager" to "src/dhcp"
The dhcp directory does not only contain the manager
instance, but various files related to DHCP.

Rename.
2016-11-21 14:07:47 +01:00
Thomas Haller 1706366351 build: rename "src/supplicant-manager" to "src/supplicant"
The supplicant directory does not only contain the manager
instance, but various files related to wpa-supplicant.

Rename.
2016-11-21 14:07:47 +01:00
Thomas Haller d080b5d0ff build: add dependency for ifcfg-rh objects to "nmdbus-ifcfg-rh.h"
$ git clean -fdx && NOCONFIGURE=x ./autogen.sh && mkdir -p x/y && cd x/y && ../../configure && make src/settings/plugins/ifcfg-rh/libnm-settings-plugin-ifcfg-rh.la
  ...
  ../../src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-plugin.c:49:55: fatal error: settings/plugins/ifcfg-rh/nmdbus-ifcfg-rh.h: No such file or directory
  #include "settings/plugins/ifcfg-rh/nmdbus-ifcfg-rh.h"
2016-11-21 14:07:47 +01:00
Lubomir Rintel 0f867d31c1 build: silence some verbose make rules 2016-11-21 13:53:03 +01:00
Thomas Haller 7ed550133b build: add dist-dependency for libnm-glib/libnm-glib-vpn.la
We want that plain `make dist` works. For that, we need to build
libnm-glib-vpn.la too.
2016-11-20 18:14:37 +01:00
Thomas Haller 29ac5de825 build: fix dependencies for generated headers
Some source files depend on other generated headers. For example,
"libnm/nm-device-modem.c" includes the generated "libnm/nm-enum-types.h".

The generated headers are part of BUILT_SOURCES to ensure that
they are generated first. However, this only works for `make all`
and `make check`.

We want that a plain `make dist` works as well. Thus, we need to
explicitly declare the additional dependencies.

Previously, that was done by having an explicity dependency of the
source files to the generated headers. However, that results in make
thinking the sources are build targets and out-of-tree builds fail:

  ./autogen.sh
  make distclean
  mkdir -p X/Y
  cd X/Y
  ../../configure --enable-tests=yes --with-valgrind=no --enable-gtk-doc --enable-more-warnings=error --with-udev-dir=/data/src/_NetworkManager/NetworkManager-1.5.2/_inst/lib/udev --with-wext=no --enable-ifcfg-rh--enable-ifupdown --enable-ifnet --disable-code-coverage --srcdir=../.. --prefix=/data/src/_NetworkManager/NetworkManager-1.5.2/_instr
  make -d V=1

fails with
  CPPFLAGS="" CFLAGS="-Wall -std=gnu99 -Werror -Wshadow -Wmissing-declarations -Wmissing-prototypes -Wdeclaration-after-statement -Wfloat-equal -Wno-unused-parameter -Wno-sign-compare -Wstrict-prototypes -Wno-unused-but-set-variable -Wundef -Wimplicit-function-declaration -Wpointer-arith -Winit-self -Wmissing-include-dirs -Wno-pragmas -g -O2 -Warray-bounds -Wunused-value  -fno-strict-aliasing  -fdata-sections -ffunction-sections -Wl,--gc-sections" LDFLAGS="" CC="gcc" PKG_CONFIG="/usr/bin/pkg-config" DLLTOOL="false"  CFLAGS="-Wall -std=gnu99 -Werror -Wshadow -Wmissing-declarations -Wmissing-prototypes -Wdeclaration-after-statement -Wfloat-equal -Wno-unused-parameter -Wno-sign-compare -Wstrict-prototypes -Wno-unused-but-set-variable -Wundef -Wimplicit-function-declaration -Wpointer-arith -Winit-self -Wmissing-include-dirs -Wno-pragmas -g -O2 -Warray-bounds -Wunused-value  -fno-strict-aliasing  -fdata-sections -ffunction-sections -Wl,--gc-sections -Wno-error" /usr/bin/g-ir-scanner   --namespace=NM --nsversion=1.0 --libtool="/bin/sh ./libtool" --pkg=gio-2.0 --pkg=gudev-1.0 --include=Gio-2.0 --pkg-export=libnm  --library=libnm/libnm.la --warn-all --identifier-prefix=NM --symbol-prefix=nm --cflags-begin -I../../shared -I./shared -I../../libnm-core -I./libnm-core  -pthread -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_32 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_32   -I/usr/include/nss3 -I/usr/include/nspr4 -I./introspection -I../../libnm -I./libnm -I/usr/include/gudev-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -DG_LOG_DOMAIN=\""libnm"\" -DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIB -DNMRUNDIR=\"/data/src/_NetworkManager/NetworkManager-1.5.2/_instr/var/run/NetworkManager\" --cflags-end  libnm-core/nm-core-enum-types.h shared/nm-version-macros.h ../../libnm-core/nm-connection.h ../../libnm-core/nm-core-types.h ../../libnm-core/nm-dbus-interface.h ../../libnm-core/nm-errors.h ../../libnm-core/nm-setting-8021x.h ../../libnm-core/nm-setting-adsl.h ../../libnm-core/nm-setting-bluetooth.h ../../libnm-core/nm-setting-bond.h ../../libnm-core/nm-setting-bridge-port.h ../../libnm-core/nm-setting-bridge.h ../../libnm-core/nm-setting-cdma.h ../../libnm-core/nm-setting-connection.h ../../libnm-core/nm-setting-dcb.h ../../libnm-core/nm-setting-generic.h ../../libnm-core/nm-setting-gsm.h ../../libnm-core/nm-setting-infiniband.h ../../libnm-core/nm-setting-ip-config.h ../../libnm-core/nm-setting-ip-tunnel.h ../../libnm-core/nm-setting-ip4-config.h ../../libnm-core/nm-setting-ip6-config.h ../../libnm-core/nm-setting-macvlan.h ../../libnm-core/nm-setting-olpc-mesh.h ../../libnm-core/nm-setting-ppp.h ../../libnm-core/nm-setting-pppoe.h ../../libnm-core/nm-setting-proxy.h ../../libnm-core/nm-setting-serial.h ../../libnm-core/nm-setting-team-port.h ../../libnm-core/nm-setting-team.h ../../libnm-core/nm-setting-tun.h ../../libnm-core/nm-setting-vlan.h ../../libnm-core/nm-setting-vpn.h ../../libnm-core/nm-setting-vxlan.h ../../libnm-core/nm-setting-wimax.h ../../libnm-core/nm-setting-wired.h ../../libnm-core/nm-setting-wireless-security.h ../../libnm-core/nm-setting-wireless.h ../../libnm-core/nm-setting.h ../../libnm-core/nm-simple-connection.h ../../libnm-core/nm-utils.h ../../libnm-core/nm-version.h ../../libnm-core/nm-vpn-dbus-interface.h ../../libnm-core/nm-vpn-editor-plugin.h ../../libnm-core/nm-vpn-plugin-info.h libnm-core/nm-core-enum-types.c shared/nm-utils/nm-shared-utils.c ../../libnm-core/crypto.c ../../libnm-core/nm-connection.c ../../libnm-core/nm-dbus-utils.c ../../libnm-core/nm-errors.c ../../libnm-core/nm-keyfile-reader.c ../../libnm-core/nm-keyfile-utils.c ../../libnm-core/nm-keyfile-writer.c ../../libnm-core/nm-property-compare.c ../../libnm-core/nm-setting-8021x.c ../../libnm-core/nm-setting-adsl.c ../../libnm-core/nm-setting-bluetooth.c ../../libnm-core/nm-setting-bond.c ../../libnm-core/nm-setting-bridge-port.c ../../libnm-core/nm-setting-bridge.c ../../libnm-core/nm-setting-cdma.c ../../libnm-core/nm-setting-connection.c ../../libnm-core/nm-setting-dcb.c ../../libnm-core/nm-setting-generic.c ../../libnm-core/nm-setting-gsm.c ../../libnm-core/nm-setting-infiniband.c ../../libnm-core/nm-setting-ip-config.c ../../libnm-core/nm-setting-ip-tunnel.c ../../libnm-core/nm-setting-ip4-config.c ../../libnm-core/nm-setting-ip6-config.c ../../libnm-core/nm-setting-macvlan.c ../../libnm-core/nm-setting-olpc-mesh.c ../../libnm-core/nm-setting-ppp.c ../../libnm-core/nm-setting-pppoe.c ../../libnm-core/nm-setting-proxy.c ../../libnm-core/nm-setting-serial.c ../../libnm-core/nm-setting-team-port.c ../../libnm-core/nm-setting-team.c ../../libnm-core/nm-setting-tun.c ../../libnm-core/nm-setting-vlan.c ../../libnm-core/nm-setting-vpn.c ../../libnm-core/nm-setting-vxlan.c ../../libnm-core/nm-setting-wimax.c ../../libnm-core/nm-setting-wired.c ../../libnm-core/nm-setting-wireless-security.c ../../libnm-core/nm-setting-wireless.c ../../libnm-core/nm-setting.c ../../libnm-core/nm-simple-connection.c ../../libnm-core/nm-utils.c ../../libnm-core/nm-vpn-editor-plugin.c ../../libnm-core/nm-vpn-plugin-info.c ../../libnm-core/crypto_nss.c libnm/nm-enum-types.h ../../libnm/NetworkManager.h ../../libnm/nm-access-point.h ../../libnm/nm-active-connection.h ../../libnm/nm-client.h ../../libnm/nm-device-adsl.h ../../libnm/nm-device-bond.h ../../libnm/nm-device-bridge.h ../../libnm/nm-device-bt.h ../../libnm/nm-device-ethernet.h ../../libnm/nm-device-generic.h ../../libnm/nm-device-infiniband.h ../../libnm/nm-device-ip-tunnel.h ../../libnm/nm-device-macvlan.h ../../libnm/nm-device-modem.h ../../libnm/nm-device-olpc-mesh.h ../../libnm/nm-device-team.h ../../libnm/nm-device-tun.h ../../libnm/nm-device-vlan.h ../../libnm/nm-device-vxlan.h ../../libnm/nm-device-wifi.h ../../libnm/nm-device-wimax.h ../../libnm/nm-device.h ../../libnm/nm-dhcp-config.h ../../libnm/nm-ip-config.h ../../libnm/nm-object.h ../../libnm/nm-remote-connection.h ../../libnm/nm-types.h ../../libnm/nm-vpn-connection.h ../../libnm/nm-vpn-editor.h ../../libnm/nm-wimax-nsp.h ../../libnm/nm-secret-agent-old.h ../../libnm/nm-vpn-plugin-old.h ../../libnm/nm-vpn-service-plugin.h libnm/nm-enum-types.c ../../libnm/nm-access-point.c ../../libnm/nm-active-connection.c ../../libnm/nm-client.c ../../libnm/nm-dbus-helpers.c ../../libnm/nm-device-adsl.c ../../libnm/nm-device-bond.c ../../libnm/nm-device-bridge.c ../../libnm/nm-device-bt.c ../../libnm/nm-device-ethernet.c ../../libnm/nm-device-generic.c ../../libnm/nm-device-infiniband.c ../../libnm/nm-device-ip-tunnel.c ../../libnm/nm-device-macvlan.c ../../libnm/nm-device-modem.c ../../libnm/nm-device-olpc-mesh.c ../../libnm/nm-device-team.c ../../libnm/nm-device-tun.c ../../libnm/nm-device-vlan.c ../../libnm/nm-device-vxlan.c ../../libnm/nm-device-wifi.c ../../libnm/nm-device-wimax.c ../../libnm/nm-device.c ../../libnm/nm-dhcp-config.c ../../libnm/nm-dhcp4-config.c ../../libnm/nm-dhcp6-config.c ../../libnm/nm-ip-config.c ../../libnm/nm-ip4-config.c ../../libnm/nm-ip6-config.c ../../libnm/nm-manager.c ../../libnm/nm-object.c ../../libnm/nm-remote-connection.c ../../libnm/nm-remote-settings.c ../../libnm/nm-secret-agent-old.c ../../libnm/nm-vpn-connection.c ../../libnm/nm-vpn-plugin-old.c ../../libnm/nm-vpn-editor.c ../../libnm/nm-vpn-service-plugin.c ../../libnm/nm-wimax-nsp.c libnm/libnm.la --output libnm/NM-1.0.gir
  ERROR: shared/nm-utils/nm-shared-utils.c: no such a file or directory
  /usr/share/gobject-introspection-1.0/Makefile.introspection:155: recipe for target 'libnm/NM-1.0.gir' failed
  make: *** [libnm/NM-1.0.gir] Error 1

The error is due to "shared/nm-utils/nm-shared-utils.h" not using VPATH:

       Finished prerequisites of target file 'shared/nm-utils/nm-shared-utils.c'.
       Prerequisite 'libnm-util/nm-utils-enum-types.h' is newer than target 'shared/nm-utils/nm-shared-utils.c'.
      Must remake target 'shared/nm-utils/nm-shared-utils.c'.
    Ignoring VPATH name '../../shared/nm-utils/nm-shared-utils.c'.

The proper fix is to have the object files depend on the generated
headers instead.
2016-11-20 17:23:06 +01:00
Thomas Haller b3d4bc578d build: rename variables for mkenums files to have _mkenums suffix
The *_gen variables were really the *-enum-types.[hc] files generated
by glib-mkenums. Rename the variables, to make this clearer.
2016-11-20 14:40:38 +01:00
Thomas Haller 5070ac4b73 build: use variable instead of filenames for $(libnm_lib_h_pub_gen) 2016-11-20 14:35:47 +01:00
Thomas Haller 9776c73f98 build: fix Makefile.am for libnm-core/crypto_*.c
Fixes: 6e4d759d73
2016-11-18 17:21:22 +01:00
Thomas Haller b9e3b8a3eb build: don't dist generated libnm-core/tests/nm-core-tests-enum-types.* 2016-11-18 16:40:25 +01:00
Thomas Haller 6e4d759d73 build: refactor Makefile.am for libnm-core and libnm
- assign the differnt types of sources to different variables
  and use them.
- don't dist generated enum-types sources
2016-11-18 16:40:25 +01:00
Thomas Haller 0a65628c87 build: add dist-hook dependency for documentation files
./autogen.sh --enable-gtk-doc --with-libnm-glib && make dist
2016-11-18 16:40:25 +01:00
Thomas Haller af12661dee build: refactor handling sources for libnm-util 2016-11-18 16:40:25 +01:00
Thomas Haller a85742bdd1 build: don't dist generated enum-types for libnm-glib 2016-11-18 16:40:25 +01:00
Thomas Haller 3d3ce77bf6 build: add dependency for generated files for libnm-glib
Although the generated files are part of BUILD_SOURCES,
that only matters during `make all`.
2016-11-18 16:40:25 +01:00
Thomas Haller 830564e175 build: refactor handling sources for libnm-glib
We have generated headers, and non-generated.
We have public headers and internal headers.
We have headers/sources for libnm-glib and libnm-glib-vpn.

We want that non-generated files depend on generated files.
Thus, reorder it all and assign the groups to different variables.
2016-11-18 16:40:25 +01:00
Thomas Haller c1289fe79b build: let libnm/libnm.la sources depend on introspection files
Source files like libnm/nm-client.c include introspection files like
nmdbus-manager.h. These files are part of BUILT_SOURCES, which is
a pre-requisite to "all" target.

However, that is not sufficient for
  ./autogen --enable-gtk-doc && make dist
2016-11-18 16:40:25 +01:00
Thomas Haller 07a8f22aef build: only generate documentation when BUILD_SETTING_DOCS
Generating the docs, requires man/nm-settings.xml. That is only present
when
  - ./configure --enable-gtk-doc --with-introspecton
  - in a dist-tarball, contrary to a git-tree

Only create docs, when we also regenerate the manuals (BUILD_SETTING_DOCS).
That is, you can no longer generate docs, by relying on the pre-generated
manual pages.
If you want to generate docs, you have to regenerate the manual pages
as well.

Previously, doing the following in a git-tree failed:

    $ git clean -fdx
    $ ./autogen.sh --enable-gtk-doc --enable-introspection=no && make
    ...
    make[2]: Entering directory './NetworkManager/docs/api'
      DOC   Preparing build
      DOC   Scanning header files
      DOC   Introspecting gobjects
      DOC   Building XML
      DOC   Building XML
    make[2]: *** No rule to make target '../../man/nm-settings.xml', needed by 'html-build.stamp'.  Stop.
    make[2]: Leaving directory './NetworkManager/docs/api'
2016-11-18 16:40:25 +01:00
Thomas Haller 3cd56809ed core: drop unused "nm-bt-enum-types.h"
In core, we should not use any generated enum-types. Especially
nm-bt-enum-types.h was unused already.
2016-11-18 16:40:25 +01:00
Thomas Haller d66d7fb707 core: drop unused "nm-modem-enum-types.h"
In core, we should not use any generated enum-types.
They are just bloat.
2016-11-18 16:40:25 +01:00
Thomas Haller a791a9aa4b systemd: merge branch systemd into master 2016-11-13 14:16:42 +01:00
Thomas Haller 7b78a931df build: generate src/NetworkManager.ver during build
This adds 0.4 seconds to the build time.

You can disable it by setting $NM_BUILD_NO_CREATE_EXPORTS environment
variable. This is useful in the unexpected case that the script
is broken.
Or, if you just want to use a different, non-generated version-script.
Or, if you want to save 0.4 seconds build-time.
2016-11-10 18:30:38 +01:00
Lubomir Rintel 7700efad18 build: don't build the wimax nsp bindings
Added accidentally by the object-manager branch.
2016-11-10 18:11:24 +01:00
Lubomir Rintel 1f5b48a59e libnm: use the o.fd.DBus.ObjectManager API for object management
This speeds up the initial object tree load significantly. Also, it
reduces the object management complexity by shifting the duties to
GDBusObjectManager.

The lifetime of all NMObjects is now managed by the NMClient via the
object manager. The NMClient creates the NMObjects for GDBus objects,
triggers the initialization and serves as an object registry (replaces
the nm-cache).

The ObjectManager uses the o.fd.DBus.ObjectManager API to learn of the
object creation, removal and property changes. It takes care of the
property changes so that we don't have to and lets us always see a
consistent object state.  Thus at the time we learn of a new object we
already know its properties.

The NMObject unfortunately can't be made synchronously initializable as
the NMRemoteConnection's settings are not managed with standard
o.fd.DBus Properties and ObjectManager APIs and thus are not known to
the ObjectManager.  Thus most of the asynchronous object property
changing code in nm-object.c is preserved. The objects notify the
properties that reference them of their initialization in from their
init_finish() methods, thus the asynchronously created objects are not
allowed to fail creation (or the dependees would wait forever). Not a
problem -- if a connection can't get its Settings, it's either invisible
or being removed (presumably we'd learn of the removal from the object
manager soon).

The NMObjects can't be created by the object manager itself, since we
can't determine the resulting object type in proxy_type() yet (we can't
tell from the name and can't access the interface list). Therefore the
GDBusObject is coupled with a NMObject later on.

Lastly, now that all the objects are managed by the object manager, the
NMRemoteSettings and NMManager go away when the daemon is stopped. The
complexity of dealing with calls to NMClient that would require any of
the resources that these objects manage (connection or device lists,
etc.) had to be moved to NMClient. The bright side is that his allows
for removal all of the daemon presence tracking from NMObject.
2016-11-10 16:48:48 +01:00
Beniamino Galvani cd73f281cc tui: add support for IP tunnel connections 2016-11-09 17:45:39 +01:00
Lubomir Rintel 44fca246a7 rdisc: rename to ndisc
We'll soon not only do the router discovery, but announce ourselves as a
reouter. "Neighbor discovery" sounds to be a more appropriate name for
the class than "Router discovery".
2016-11-09 17:16:47 +01:00