Commit Graph

10 Commits

Author SHA1 Message Date
Lubomir Rintel
8a46b25cfa all: require glib 2.40
RHEL 7.1 and Ubuntu 14.04 LTS both have this.

https://bugzilla.gnome.org/show_bug.cgi?id=792323
2018-01-18 11:45:36 +01:00
Thomas Haller
52baa8c52b clients: drop redundant #include "NetworkManager.h"
This header is already included by "nm-default.h".
2018-01-08 12:38:54 +01:00
Thomas Haller
93adadbdcb all: use nm_direct_hash() instead of g_direct_hash()
We also do this for libnm, where it causes visible changes
in behavior. But if somebody would rely on the hashing implementation
for hash tables, it would be seriously flawed.
2017-11-16 11:49:52 +01:00
Thomas Haller
3ee8de20c4 all: include "nm-utils/nm-hash-utils.h" by default
Next we will use siphash24() instead of the glib version g_direct_hash() or
g_str_hash(). Hence, the "nm-utils/nm-hash-utils.h" header becomes very
fundamental and will be needed basically everywhere.

Instead of requiring the users to include them, let it be included via
"nm-default.h" header.
2017-11-16 11:49:51 +01: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
275ab5fb8f cli: make properties list a list of pointers
That allows for the property list to contain derived
property types. Also, the list can be directly passed
off as a "const NMMetaAbstractInfo *const*" list.
2017-04-13 10:10:12 +02:00
Thomas Haller
d32817999c cli: move information about valid connection settings to common 2017-04-12 14:12:20 +02:00
Thomas Haller
41b31051f2 cli: use nmc_print() to output device's IP4 info
The IP4 info adds a new type: to expose strv arguments
for addresses, etc.
2017-04-12 14:00:00 +02:00
Thomas Haller
3045daf127 cli: use nmc_print() to output setting data 2017-04-12 11:24:04 +02:00
Thomas Haller
022117ff36 cli/tests: add "clients/common/tests/test-general.c" 2017-04-05 16:53:06 +02:00